Commit 3a28fc44 by Nilu

HT013 My company screen without tabs. Need to work on styles

parent 306a313f
......@@ -12,6 +12,11 @@
<column name="hiring_team_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="time_zone" type="String" nullable="true" length="200"/>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/>
<column name="has_client_support" type="Boolean" nullable="true"/>
<column name="added_by_user_id" type="Long" length="11" nullable="false"/>
</NODE>
......
......@@ -12,6 +12,11 @@ CREATE TABLE tl_company (
hiring_team_type varchar(200) NULL,
industry varchar(200) NULL,
time_zone varchar(200) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
has_client_support char(1) NULL,
added_by_user_id numeric(12) NOT NULL
);
......
......@@ -13,6 +13,11 @@ CREATE TABLE tl_company (
hiring_team_type varchar2(200) NULL,
industry varchar2(200) NULL,
time_zone varchar2(200) NULL,
state varchar2(200) NULL,
country varchar2(200) NULL,
post_code varchar2(10) NULL,
city varchar2(100) NULL,
has_client_support char(1) NULL,
added_by_user_id number(12) NOT NULL
);
......
......@@ -13,6 +13,11 @@ CREATE TABLE tl_company (
hiring_team_type varchar(200) NULL,
industry varchar(200) NULL,
time_zone varchar(200) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
has_client_support char(1) NULL,
added_by_user_id numeric(12) NOT NULL
);
......
......@@ -30,6 +30,8 @@ import performa.orm.types.*;
import performa.orm.types.TimeZone;
import oneit.business.shopping.orm.*;
public abstract class BaseCompany extends BaseBusinessClass
......@@ -46,6 +48,11 @@ public abstract class BaseCompany extends BaseBusinessClass
public static final String FIELD_HiringTeamType = "HiringTeamType";
public static final String FIELD_Industry = "Industry";
public static final String FIELD_TimeZone = "TimeZone";
public static final String FIELD_State = "State";
public static final String FIELD_Country = "Country";
public static final String FIELD_PostCode = "PostCode";
public static final String FIELD_City = "City";
public static final String FIELD_HasClientSupport = "HasClientSupport";
public static final String SINGLEREFERENCE_AddedByUser = "AddedByUser";
public static final String MULTIPLEREFERENCE_Users = "Users";
public static final String BACKREF_Users = "";
......@@ -61,6 +68,11 @@ public abstract class BaseCompany extends BaseBusinessClass
private static final EnumeratedAttributeHelper<Company, HiringTeamType> HELPER_HiringTeamType = new EnumeratedAttributeHelper<Company, HiringTeamType> (HiringTeamType.FACTORY_HiringTeamType);
private static final EnumeratedAttributeHelper<Company, Industry> HELPER_Industry = new EnumeratedAttributeHelper<Company, Industry> (Industry.FACTORY_Industry);
private static final EnumeratedAttributeHelper<Company, TimeZone> HELPER_TimeZone = new EnumeratedAttributeHelper<Company, TimeZone> (TimeZone.FACTORY_TimeZone);
private static final EnumeratedAttributeHelper<Company, State> HELPER_State = new EnumeratedAttributeHelper<Company, State> (State.FACTORY_State);
private static final EnumeratedAttributeHelper<Company, Countries> HELPER_Country = new EnumeratedAttributeHelper<Company, Countries> (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper<Company> HELPER_PostCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_City = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_HasClientSupport = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
......@@ -68,6 +80,11 @@ public abstract class BaseCompany extends BaseBusinessClass
private HiringTeamType _HiringTeamType;
private Industry _Industry;
private TimeZone _TimeZone;
private State _State;
private Countries _Country;
private String _PostCode;
private String _City;
private Boolean _HasClientSupport;
// Private attributes corresponding to single references
......@@ -87,6 +104,11 @@ public abstract class BaseCompany extends BaseBusinessClass
private static final AttributeValidator[] FIELD_HiringTeamType_Validators;
private static final AttributeValidator[] FIELD_Industry_Validators;
private static final AttributeValidator[] FIELD_TimeZone_Validators;
private static final AttributeValidator[] FIELD_State_Validators;
private static final AttributeValidator[] FIELD_Country_Validators;
private static final AttributeValidator[] FIELD_PostCode_Validators;
private static final AttributeValidator[] FIELD_City_Validators;
private static final AttributeValidator[] FIELD_HasClientSupport_Validators;
// Arrays of behaviour decorators
......@@ -109,6 +131,11 @@ public abstract class BaseCompany extends BaseBusinessClass
FIELD_HiringTeamType_Validators = (AttributeValidator[])setupAttribMetaData_HiringTeamType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Industry_Validators = (AttributeValidator[])setupAttribMetaData_Industry(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TimeZone_Validators = (AttributeValidator[])setupAttribMetaData_TimeZone(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_State_Validators = (AttributeValidator[])setupAttribMetaData_State(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Country_Validators = (AttributeValidator[])setupAttribMetaData_Country(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PostCode_Validators = (AttributeValidator[])setupAttribMetaData_PostCode(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_City_Validators = (AttributeValidator[])setupAttribMetaData_City(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_HasClientSupport_Validators = (AttributeValidator[])setupAttribMetaData_HasClientSupport(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Company.initialiseReference ();
......@@ -246,6 +273,108 @@ public abstract class BaseCompany extends BaseBusinessClass
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_State(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "state");
metaInfo.put ("defaultValue", "State.WA");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "State");
metaInfo.put ("type", "State");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.State:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_State, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "State", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.State:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Country(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "country");
metaInfo.put ("defaultValue", "Countries.AU");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "Country");
metaInfo.put ("type", "Countries");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.Country:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_Country, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "Country", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.Country:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_PostCode(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "post_code");
metaInfo.put ("length", "10");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "PostCode");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.PostCode:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_PostCode, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "PostCode", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.PostCode:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_City(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "city");
metaInfo.put ("length", "100");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "City");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.City:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_City, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "City", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.City:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_HasClientSupport(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "has_client_support");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "HasClientSupport");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.HasClientSupport:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_HasClientSupport, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "HasClientSupport", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.HasClientSupport:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -277,6 +406,11 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.initialise (_HiringTeamType));
_Industry = (Industry)(HELPER_Industry.initialise (_Industry));
_TimeZone = (TimeZone)(HELPER_TimeZone.initialise (_TimeZone));
_State = (State)(State.WA);
_Country = (Countries)(Countries.AU);
_PostCode = (String)(HELPER_PostCode.initialise (_PostCode));
_City = (String)(HELPER_City.initialise (_City));
_HasClientSupport = (Boolean)(Boolean.FALSE);
}
......@@ -547,35 +681,525 @@ public abstract class BaseCompany extends BaseBusinessClass
}
/**
* Set the attribute Industry. Checks to ensure a new value
* Set the attribute Industry. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIndustry (Industry newIndustry) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Industry.compare (_Industry, newIndustry);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newIndustry = bhd.setIndustry ((Company)this, newIndustry);
oldAndNewIdentical = HELPER_Industry.compare (_Industry, newIndustry);
}
if (FIELD_Industry_Validators.length > 0)
{
Object newIndustryObj = HELPER_Industry.toObject (newIndustry);
if (newIndustryObj != null)
{
int loopMax = FIELD_Industry_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_Industry);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Industry_Validators[v].checkAttribute (this, FIELD_Industry, metadata, newIndustryObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Industry () != FieldWriteability.FALSE, "Field Industry is not writeable");
preIndustryChange (newIndustry);
markFieldChange (FIELD_Industry);
_Industry = newIndustry;
postFieldChange (FIELD_Industry);
postIndustryChange ();
}
}
/**
* Get the attribute TimeZone
*/
public TimeZone getTimeZone ()
{
assertValid();
TimeZone valToReturn = _TimeZone;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getTimeZone ((Company)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preTimeZoneChange (TimeZone newTimeZone) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postTimeZoneChange () throws FieldException
{
}
public FieldWriteability getWriteability_TimeZone ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute TimeZone. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setTimeZone (TimeZone newTimeZone) throws FieldException
{
boolean oldAndNewIdentical = HELPER_TimeZone.compare (_TimeZone, newTimeZone);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newTimeZone = bhd.setTimeZone ((Company)this, newTimeZone);
oldAndNewIdentical = HELPER_TimeZone.compare (_TimeZone, newTimeZone);
}
if (FIELD_TimeZone_Validators.length > 0)
{
Object newTimeZoneObj = HELPER_TimeZone.toObject (newTimeZone);
if (newTimeZoneObj != null)
{
int loopMax = FIELD_TimeZone_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_TimeZone);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_TimeZone_Validators[v].checkAttribute (this, FIELD_TimeZone, metadata, newTimeZoneObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_TimeZone () != FieldWriteability.FALSE, "Field TimeZone is not writeable");
preTimeZoneChange (newTimeZone);
markFieldChange (FIELD_TimeZone);
_TimeZone = newTimeZone;
postFieldChange (FIELD_TimeZone);
postTimeZoneChange ();
}
}
/**
* Get the attribute State
*/
public State getState ()
{
assertValid();
State valToReturn = _State;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getState ((Company)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preStateChange (State newState) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postStateChange () throws FieldException
{
}
public FieldWriteability getWriteability_State ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute State. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setState (State newState) throws FieldException
{
boolean oldAndNewIdentical = HELPER_State.compare (_State, newState);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newState = bhd.setState ((Company)this, newState);
oldAndNewIdentical = HELPER_State.compare (_State, newState);
}
if (FIELD_State_Validators.length > 0)
{
Object newStateObj = HELPER_State.toObject (newState);
if (newStateObj != null)
{
int loopMax = FIELD_State_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_State);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_State_Validators[v].checkAttribute (this, FIELD_State, metadata, newStateObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_State () != FieldWriteability.FALSE, "Field State is not writeable");
preStateChange (newState);
markFieldChange (FIELD_State);
_State = newState;
postFieldChange (FIELD_State);
postStateChange ();
}
}
/**
* Get the attribute Country
*/
public Countries getCountry ()
{
assertValid();
Countries valToReturn = _Country;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getCountry ((Company)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preCountryChange (Countries newCountry) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postCountryChange () throws FieldException
{
}
public FieldWriteability getWriteability_Country ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Country. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setCountry (Countries newCountry) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Country.compare (_Country, newCountry);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newCountry = bhd.setCountry ((Company)this, newCountry);
oldAndNewIdentical = HELPER_Country.compare (_Country, newCountry);
}
if (FIELD_Country_Validators.length > 0)
{
Object newCountryObj = HELPER_Country.toObject (newCountry);
if (newCountryObj != null)
{
int loopMax = FIELD_Country_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_Country);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Country_Validators[v].checkAttribute (this, FIELD_Country, metadata, newCountryObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Country () != FieldWriteability.FALSE, "Field Country is not writeable");
preCountryChange (newCountry);
markFieldChange (FIELD_Country);
_Country = newCountry;
postFieldChange (FIELD_Country);
postCountryChange ();
}
}
/**
* Get the attribute PostCode
*/
public String getPostCode ()
{
assertValid();
String valToReturn = _PostCode;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getPostCode ((Company)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void prePostCodeChange (String newPostCode) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postPostCodeChange () throws FieldException
{
}
public FieldWriteability getWriteability_PostCode ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PostCode. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPostCode (String newPostCode) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PostCode.compare (_PostCode, newPostCode);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newPostCode = bhd.setPostCode ((Company)this, newPostCode);
oldAndNewIdentical = HELPER_PostCode.compare (_PostCode, newPostCode);
}
if (FIELD_PostCode_Validators.length > 0)
{
Object newPostCodeObj = HELPER_PostCode.toObject (newPostCode);
if (newPostCodeObj != null)
{
int loopMax = FIELD_PostCode_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_PostCode);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PostCode_Validators[v].checkAttribute (this, FIELD_PostCode, metadata, newPostCodeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PostCode () != FieldWriteability.FALSE, "Field PostCode is not writeable");
prePostCodeChange (newPostCode);
markFieldChange (FIELD_PostCode);
_PostCode = newPostCode;
postFieldChange (FIELD_PostCode);
postPostCodeChange ();
}
}
/**
* Get the attribute City
*/
public String getCity ()
{
assertValid();
String valToReturn = _City;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getCity ((Company)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preCityChange (String newCity) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postCityChange () throws FieldException
{
}
public FieldWriteability getWriteability_City ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute City. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIndustry (Industry newIndustry) throws FieldException
public void setCity (String newCity) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Industry.compare (_Industry, newIndustry);
boolean oldAndNewIdentical = HELPER_City.compare (_City, newCity);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newIndustry = bhd.setIndustry ((Company)this, newIndustry);
oldAndNewIdentical = HELPER_Industry.compare (_Industry, newIndustry);
newCity = bhd.setCity ((Company)this, newCity);
oldAndNewIdentical = HELPER_City.compare (_City, newCity);
}
if (FIELD_Industry_Validators.length > 0)
if (FIELD_City_Validators.length > 0)
{
Object newIndustryObj = HELPER_Industry.toObject (newIndustry);
Object newCityObj = HELPER_City.toObject (newCity);
if (newIndustryObj != null)
if (newCityObj != null)
{
int loopMax = FIELD_Industry_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_Industry);
int loopMax = FIELD_City_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_City);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Industry_Validators[v].checkAttribute (this, FIELD_Industry, metadata, newIndustryObj);
FIELD_City_Validators[v].checkAttribute (this, FIELD_City, metadata, newCityObj);
}
}
}
......@@ -593,26 +1217,26 @@ public abstract class BaseCompany extends BaseBusinessClass
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Industry () != FieldWriteability.FALSE, "Field Industry is not writeable");
preIndustryChange (newIndustry);
markFieldChange (FIELD_Industry);
_Industry = newIndustry;
postFieldChange (FIELD_Industry);
postIndustryChange ();
Debug.assertion (getWriteability_City () != FieldWriteability.FALSE, "Field City is not writeable");
preCityChange (newCity);
markFieldChange (FIELD_City);
_City = newCity;
postFieldChange (FIELD_City);
postCityChange ();
}
}
/**
* Get the attribute TimeZone
* Get the attribute HasClientSupport
*/
public TimeZone getTimeZone ()
public Boolean getHasClientSupport ()
{
assertValid();
TimeZone valToReturn = _TimeZone;
Boolean valToReturn = _HasClientSupport;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getTimeZone ((Company)this, valToReturn);
valToReturn = bhd.getHasClientSupport ((Company)this, valToReturn);
}
return valToReturn;
......@@ -624,7 +1248,7 @@ public abstract class BaseCompany extends BaseBusinessClass
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preTimeZoneChange (TimeZone newTimeZone) throws FieldException
protected void preHasClientSupportChange (Boolean newHasClientSupport) throws FieldException
{
}
......@@ -634,46 +1258,46 @@ public abstract class BaseCompany extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postTimeZoneChange () throws FieldException
protected void postHasClientSupportChange () throws FieldException
{
}
public FieldWriteability getWriteability_TimeZone ()
public FieldWriteability getWriteability_HasClientSupport ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute TimeZone. Checks to ensure a new value
* Set the attribute HasClientSupport. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setTimeZone (TimeZone newTimeZone) throws FieldException
public void setHasClientSupport (Boolean newHasClientSupport) throws FieldException
{
boolean oldAndNewIdentical = HELPER_TimeZone.compare (_TimeZone, newTimeZone);
boolean oldAndNewIdentical = HELPER_HasClientSupport.compare (_HasClientSupport, newHasClientSupport);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newTimeZone = bhd.setTimeZone ((Company)this, newTimeZone);
oldAndNewIdentical = HELPER_TimeZone.compare (_TimeZone, newTimeZone);
newHasClientSupport = bhd.setHasClientSupport ((Company)this, newHasClientSupport);
oldAndNewIdentical = HELPER_HasClientSupport.compare (_HasClientSupport, newHasClientSupport);
}
if (FIELD_TimeZone_Validators.length > 0)
if (FIELD_HasClientSupport_Validators.length > 0)
{
Object newTimeZoneObj = HELPER_TimeZone.toObject (newTimeZone);
Object newHasClientSupportObj = HELPER_HasClientSupport.toObject (newHasClientSupport);
if (newTimeZoneObj != null)
if (newHasClientSupportObj != null)
{
int loopMax = FIELD_TimeZone_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_TimeZone);
int loopMax = FIELD_HasClientSupport_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_HasClientSupport);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_TimeZone_Validators[v].checkAttribute (this, FIELD_TimeZone, metadata, newTimeZoneObj);
FIELD_HasClientSupport_Validators[v].checkAttribute (this, FIELD_HasClientSupport, metadata, newHasClientSupportObj);
}
}
}
......@@ -691,12 +1315,12 @@ public abstract class BaseCompany extends BaseBusinessClass
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_TimeZone () != FieldWriteability.FALSE, "Field TimeZone is not writeable");
preTimeZoneChange (newTimeZone);
markFieldChange (FIELD_TimeZone);
_TimeZone = newTimeZone;
postFieldChange (FIELD_TimeZone);
postTimeZoneChange ();
Debug.assertion (getWriteability_HasClientSupport () != FieldWriteability.FALSE, "Field HasClientSupport is not writeable");
preHasClientSupportChange (newHasClientSupport);
markFieldChange (FIELD_HasClientSupport);
_HasClientSupport = newHasClientSupport;
postFieldChange (FIELD_HasClientSupport);
postHasClientSupportChange ();
}
}
......@@ -1321,6 +1945,11 @@ public abstract class BaseCompany extends BaseBusinessClass
tl_companyPSet.setAttrib (FIELD_HiringTeamType, HELPER_HiringTeamType.toObject (_HiringTeamType)); //
tl_companyPSet.setAttrib (FIELD_Industry, HELPER_Industry.toObject (_Industry)); //
tl_companyPSet.setAttrib (FIELD_TimeZone, HELPER_TimeZone.toObject (_TimeZone)); //
tl_companyPSet.setAttrib (FIELD_State, HELPER_State.toObject (_State)); //
tl_companyPSet.setAttrib (FIELD_Country, HELPER_Country.toObject (_Country)); //
tl_companyPSet.setAttrib (FIELD_PostCode, HELPER_PostCode.toObject (_PostCode)); //
tl_companyPSet.setAttrib (FIELD_City, HELPER_City.toObject (_City)); //
tl_companyPSet.setAttrib (FIELD_HasClientSupport, HELPER_HasClientSupport.toObject (_HasClientSupport)); //
_AddedByUser.getPersistentSets (allSets);
}
......@@ -1340,6 +1969,11 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.fromObject (_HiringTeamType, tl_companyPSet.getAttrib (FIELD_HiringTeamType))); //
_Industry = (Industry)(HELPER_Industry.fromObject (_Industry, tl_companyPSet.getAttrib (FIELD_Industry))); //
_TimeZone = (TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, tl_companyPSet.getAttrib (FIELD_TimeZone))); //
_State = (State)(HELPER_State.fromObject (_State, tl_companyPSet.getAttrib (FIELD_State))); //
_Country = (Countries)(HELPER_Country.fromObject (_Country, tl_companyPSet.getAttrib (FIELD_Country))); //
_PostCode = (String)(HELPER_PostCode.fromObject (_PostCode, tl_companyPSet.getAttrib (FIELD_PostCode))); //
_City = (String)(HELPER_City.fromObject (_City, tl_companyPSet.getAttrib (FIELD_City))); //
_HasClientSupport = (Boolean)(HELPER_HasClientSupport.fromObject (_HasClientSupport, tl_companyPSet.getAttrib (FIELD_HasClientSupport))); //
_AddedByUser.setFromPersistentSets (objectID, allSets);
}
......@@ -1392,6 +2026,51 @@ public abstract class BaseCompany extends BaseBusinessClass
e.addException (ex);
}
try
{
setState (otherCompany.getState ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setCountry (otherCompany.getCountry ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setPostCode (otherCompany.getPostCode ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setCity (otherCompany.getCity ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setHasClientSupport (otherCompany.getHasClientSupport ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -1411,6 +2090,11 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = sourceCompany._HiringTeamType;
_Industry = sourceCompany._Industry;
_TimeZone = sourceCompany._TimeZone;
_State = sourceCompany._State;
_Country = sourceCompany._Country;
_PostCode = sourceCompany._PostCode;
_City = sourceCompany._City;
_HasClientSupport = sourceCompany._HasClientSupport;
}
}
......@@ -1472,6 +2156,11 @@ public abstract class BaseCompany extends BaseBusinessClass
_HiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.readExternal (_HiringTeamType, vals.get(FIELD_HiringTeamType))); //
_Industry = (Industry)(HELPER_Industry.readExternal (_Industry, vals.get(FIELD_Industry))); //
_TimeZone = (TimeZone)(HELPER_TimeZone.readExternal (_TimeZone, vals.get(FIELD_TimeZone))); //
_State = (State)(HELPER_State.readExternal (_State, vals.get(FIELD_State))); //
_Country = (Countries)(HELPER_Country.readExternal (_Country, vals.get(FIELD_Country))); //
_PostCode = (String)(HELPER_PostCode.readExternal (_PostCode, vals.get(FIELD_PostCode))); //
_City = (String)(HELPER_City.readExternal (_City, vals.get(FIELD_City))); //
_HasClientSupport = (Boolean)(HELPER_HasClientSupport.readExternal (_HasClientSupport, vals.get(FIELD_HasClientSupport))); //
_AddedByUser.readExternalData(vals.get(SINGLEREFERENCE_AddedByUser));
_Users.readExternalData(vals.get(MULTIPLEREFERENCE_Users));
_Clients.readExternalData(vals.get(MULTIPLEREFERENCE_Clients));
......@@ -1490,6 +2179,11 @@ public abstract class BaseCompany extends BaseBusinessClass
vals.put (FIELD_HiringTeamType, HELPER_HiringTeamType.writeExternal (_HiringTeamType));
vals.put (FIELD_Industry, HELPER_Industry.writeExternal (_Industry));
vals.put (FIELD_TimeZone, HELPER_TimeZone.writeExternal (_TimeZone));
vals.put (FIELD_State, HELPER_State.writeExternal (_State));
vals.put (FIELD_Country, HELPER_Country.writeExternal (_Country));
vals.put (FIELD_PostCode, HELPER_PostCode.writeExternal (_PostCode));
vals.put (FIELD_City, HELPER_City.writeExternal (_City));
vals.put (FIELD_HasClientSupport, HELPER_HasClientSupport.writeExternal (_HasClientSupport));
vals.put (SINGLEREFERENCE_AddedByUser, _AddedByUser.writeExternalData());
vals.put (MULTIPLEREFERENCE_Users, _Users.writeExternalData());
vals.put (MULTIPLEREFERENCE_Clients, _Clients.writeExternalData());
......@@ -1522,6 +2216,26 @@ public abstract class BaseCompany extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_TimeZone, HELPER_TimeZone.toObject(this._TimeZone), HELPER_TimeZone.toObject(otherCompany._TimeZone));
}
if (!HELPER_State.compare(this._State, otherCompany._State))
{
listener.notifyFieldChange(this, other, FIELD_State, HELPER_State.toObject(this._State), HELPER_State.toObject(otherCompany._State));
}
if (!HELPER_Country.compare(this._Country, otherCompany._Country))
{
listener.notifyFieldChange(this, other, FIELD_Country, HELPER_Country.toObject(this._Country), HELPER_Country.toObject(otherCompany._Country));
}
if (!HELPER_PostCode.compare(this._PostCode, otherCompany._PostCode))
{
listener.notifyFieldChange(this, other, FIELD_PostCode, HELPER_PostCode.toObject(this._PostCode), HELPER_PostCode.toObject(otherCompany._PostCode));
}
if (!HELPER_City.compare(this._City, otherCompany._City))
{
listener.notifyFieldChange(this, other, FIELD_City, HELPER_City.toObject(this._City), HELPER_City.toObject(otherCompany._City));
}
if (!HELPER_HasClientSupport.compare(this._HasClientSupport, otherCompany._HasClientSupport))
{
listener.notifyFieldChange(this, other, FIELD_HasClientSupport, HELPER_HasClientSupport.toObject(this._HasClientSupport), HELPER_HasClientSupport.toObject(otherCompany._HasClientSupport));
}
// Compare single assocs
_AddedByUser.compare (otherCompany._AddedByUser, listener);
......@@ -1551,6 +2265,11 @@ public abstract class BaseCompany extends BaseBusinessClass
visitor.visitField(this, FIELD_HiringTeamType, HELPER_HiringTeamType.toObject(getHiringTeamType()));
visitor.visitField(this, FIELD_Industry, HELPER_Industry.toObject(getIndustry()));
visitor.visitField(this, FIELD_TimeZone, HELPER_TimeZone.toObject(getTimeZone()));
visitor.visitField(this, FIELD_State, HELPER_State.toObject(getState()));
visitor.visitField(this, FIELD_Country, HELPER_Country.toObject(getCountry()));
visitor.visitField(this, FIELD_PostCode, HELPER_PostCode.toObject(getPostCode()));
visitor.visitField(this, FIELD_City, HELPER_City.toObject(getCity()));
visitor.visitField(this, FIELD_HasClientSupport, HELPER_HasClientSupport.toObject(getHasClientSupport()));
visitor.visitAssociation (_AddedByUser);
visitor.visitAssociation (_Users);
visitor.visitAssociation (_Clients);
......@@ -1615,6 +2334,26 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return filter.matches (getTimeZone ());
}
else if (attribName.equals (FIELD_State))
{
return filter.matches (getState ());
}
else if (attribName.equals (FIELD_Country))
{
return filter.matches (getCountry ());
}
else if (attribName.equals (FIELD_PostCode))
{
return filter.matches (getPostCode ());
}
else if (attribName.equals (FIELD_City))
{
return filter.matches (getCity ());
}
else if (attribName.equals (FIELD_HasClientSupport))
{
return filter.matches (getHasClientSupport ());
}
else if (attribName.equals (SINGLEREFERENCE_AddedByUser))
{
return filter.matches (getAddedByUser ());
......@@ -1674,6 +2413,36 @@ public abstract class BaseCompany extends BaseBusinessClass
return this;
}
public SearchAll andState (QueryFilter<State> filter)
{
filter.addFilter (context, "tl_company.state", "State");
return this;
}
public SearchAll andCountry (QueryFilter<Countries> filter)
{
filter.addFilter (context, "tl_company.country", "Country");
return this;
}
public SearchAll andPostCode (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_company.post_code", "PostCode");
return this;
}
public SearchAll andCity (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_company.city", "City");
return this;
}
public SearchAll andHasClientSupport (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_company.has_client_support", "HasClientSupport");
return this;
}
public SearchAll andAddedByUser (QueryFilter<CompanyUser> filter)
{
filter.addFilter (context, "tl_company.added_by_user_id", "AddedByUser");
......@@ -1731,6 +2500,26 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return HELPER_TimeZone.toObject (getTimeZone ());
}
else if (attribName.equals (FIELD_State))
{
return HELPER_State.toObject (getState ());
}
else if (attribName.equals (FIELD_Country))
{
return HELPER_Country.toObject (getCountry ());
}
else if (attribName.equals (FIELD_PostCode))
{
return HELPER_PostCode.toObject (getPostCode ());
}
else if (attribName.equals (FIELD_City))
{
return HELPER_City.toObject (getCity ());
}
else if (attribName.equals (FIELD_HasClientSupport))
{
return HELPER_HasClientSupport.toObject (getHasClientSupport ());
}
else
{
return super.getAttribute (attribName);
......@@ -1760,6 +2549,26 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return HELPER_TimeZone;
}
else if (attribName.equals (FIELD_State))
{
return HELPER_State;
}
else if (attribName.equals (FIELD_Country))
{
return HELPER_Country;
}
else if (attribName.equals (FIELD_PostCode))
{
return HELPER_PostCode;
}
else if (attribName.equals (FIELD_City))
{
return HELPER_City;
}
else if (attribName.equals (FIELD_HasClientSupport))
{
return HELPER_HasClientSupport;
}
else
{
return super.getAttributeHelper (attribName);
......@@ -1789,6 +2598,26 @@ public abstract class BaseCompany extends BaseBusinessClass
{
setTimeZone ((TimeZone)(HELPER_TimeZone.fromObject (_TimeZone, attribValue)));
}
else if (attribName.equals (FIELD_State))
{
setState ((State)(HELPER_State.fromObject (_State, attribValue)));
}
else if (attribName.equals (FIELD_Country))
{
setCountry ((Countries)(HELPER_Country.fromObject (_Country, attribValue)));
}
else if (attribName.equals (FIELD_PostCode))
{
setPostCode ((String)(HELPER_PostCode.fromObject (_PostCode, attribValue)));
}
else if (attribName.equals (FIELD_City))
{
setCity ((String)(HELPER_City.fromObject (_City, attribValue)));
}
else if (attribName.equals (FIELD_HasClientSupport))
{
setHasClientSupport ((Boolean)(HELPER_HasClientSupport.fromObject (_HasClientSupport, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
......@@ -1825,6 +2654,26 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return getWriteability_TimeZone ();
}
else if (fieldName.equals (FIELD_State))
{
return getWriteability_State ();
}
else if (fieldName.equals (FIELD_Country))
{
return getWriteability_Country ();
}
else if (fieldName.equals (FIELD_PostCode))
{
return getWriteability_PostCode ();
}
else if (fieldName.equals (FIELD_City))
{
return getWriteability_City ();
}
else if (fieldName.equals (FIELD_HasClientSupport))
{
return getWriteability_HasClientSupport ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_Users))
{
return getWriteability_Users ();
......@@ -1867,6 +2716,31 @@ public abstract class BaseCompany extends BaseBusinessClass
fields.add (FIELD_TimeZone);
}
if (getWriteability_State () != FieldWriteability.TRUE)
{
fields.add (FIELD_State);
}
if (getWriteability_Country () != FieldWriteability.TRUE)
{
fields.add (FIELD_Country);
}
if (getWriteability_PostCode () != FieldWriteability.TRUE)
{
fields.add (FIELD_PostCode);
}
if (getWriteability_City () != FieldWriteability.TRUE)
{
fields.add (FIELD_City);
}
if (getWriteability_HasClientSupport () != FieldWriteability.TRUE)
{
fields.add (FIELD_HasClientSupport);
}
super.putUnwriteable (fields);
}
......@@ -1880,6 +2754,11 @@ public abstract class BaseCompany extends BaseBusinessClass
result.add(HELPER_HiringTeamType.getAttribObject (getClass (), _HiringTeamType, false, FIELD_HiringTeamType));
result.add(HELPER_Industry.getAttribObject (getClass (), _Industry, false, FIELD_Industry));
result.add(HELPER_TimeZone.getAttribObject (getClass (), _TimeZone, false, FIELD_TimeZone));
result.add(HELPER_State.getAttribObject (getClass (), _State, false, FIELD_State));
result.add(HELPER_Country.getAttribObject (getClass (), _Country, false, FIELD_Country));
result.add(HELPER_PostCode.getAttribObject (getClass (), _PostCode, false, FIELD_PostCode));
result.add(HELPER_City.getAttribObject (getClass (), _City, false, FIELD_City));
result.add(HELPER_HasClientSupport.getAttribObject (getClass (), _HasClientSupport, false, FIELD_HasClientSupport));
return result;
}
......@@ -2002,6 +2881,96 @@ public abstract class BaseCompany extends BaseBusinessClass
return newTimeZone;
}
/**
* Get the attribute State
*/
public State getState (Company obj, State original)
{
return original;
}
/**
* Change the value set for attribute State.
* May modify the field beforehand
* Occurs before validation.
*/
public State setState (Company obj, State newState) throws FieldException
{
return newState;
}
/**
* Get the attribute Country
*/
public Countries getCountry (Company obj, Countries original)
{
return original;
}
/**
* Change the value set for attribute Country.
* May modify the field beforehand
* Occurs before validation.
*/
public Countries setCountry (Company obj, Countries newCountry) throws FieldException
{
return newCountry;
}
/**
* Get the attribute PostCode
*/
public String getPostCode (Company obj, String original)
{
return original;
}
/**
* Change the value set for attribute PostCode.
* May modify the field beforehand
* Occurs before validation.
*/
public String setPostCode (Company obj, String newPostCode) throws FieldException
{
return newPostCode;
}
/**
* Get the attribute City
*/
public String getCity (Company obj, String original)
{
return original;
}
/**
* Change the value set for attribute City.
* May modify the field beforehand
* Occurs before validation.
*/
public String setCity (Company obj, String newCity) throws FieldException
{
return newCity;
}
/**
* Get the attribute HasClientSupport
*/
public Boolean getHasClientSupport (Company obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute HasClientSupport.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setHasClientSupport (Company obj, Boolean newHasClientSupport) throws FieldException
{
return newHasClientSupport;
}
}
......@@ -2078,6 +3047,26 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return toTimeZone ();
}
if (name.equals ("State"))
{
return toState ();
}
if (name.equals ("Country"))
{
return toCountry ();
}
if (name.equals ("PostCode"))
{
return toPostCode ();
}
if (name.equals ("City"))
{
return toCity ();
}
if (name.equals ("HasClientSupport"))
{
return toHasClientSupport ();
}
if (name.equals ("AddedByUser"))
{
return toAddedByUser ();
......@@ -2095,6 +3084,16 @@ public abstract class BaseCompany extends BaseBusinessClass
public PipeLine<From, Industry> toIndustry () { return pipe(new ORMAttributePipe<Me, Industry>(FIELD_Industry)); }
public PipeLine<From, TimeZone> toTimeZone () { return pipe(new ORMAttributePipe<Me, TimeZone>(FIELD_TimeZone)); }
public PipeLine<From, State> toState () { return pipe(new ORMAttributePipe<Me, State>(FIELD_State)); }
public PipeLine<From, Countries> toCountry () { return pipe(new ORMAttributePipe<Me, Countries>(FIELD_Country)); }
public PipeLine<From, String> toPostCode () { return pipe(new ORMAttributePipe<Me, String>(FIELD_PostCode)); }
public PipeLine<From, String> toCity () { return pipe(new ORMAttributePipe<Me, String>(FIELD_City)); }
public PipeLine<From, Boolean> toHasClientSupport () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_HasClientSupport)); }
public CompanyUser.CompanyUserPipeLineFactory<From, CompanyUser> toAddedByUser () { return toAddedByUser (Filter.ALL); }
public CompanyUser.CompanyUserPipeLineFactory<From, CompanyUser> toAddedByUser (Filter<CompanyUser> filter)
......
......@@ -10,4 +10,10 @@ public class Company extends BaseCompany
{
// Do not add any code to this, always put it in initialiseNewObject
}
public boolean showHasClientSupport()
{
return isTrue(getHasClientSupport());
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
<IMPORT value="performa.orm.types.*"/>
<IMPORT value="performa.orm.types.TimeZone"/>
<IMPORT value="oneit.business.shopping.orm.*"/>
<MULTIPLEREFERENCE name="Users" type="CompanyUser" backreferenceName="Company"/>
<MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="Company"/>
......@@ -16,6 +17,11 @@
<ATTRIB name="HiringTeamType" type="HiringTeamType" dbcol="hiring_team_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Industry" type="Industry" dbcol="industry" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="TimeZone" type="TimeZone" dbcol="time_zone" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="State" type="State" dbcol="state" mandatory="false" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" mandatory="false" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/>
<ATTRIB name="City" type="String" dbcol="city" mandatory="false" length="100"/>
<ATTRIB name="HasClientSupport" type="Boolean" dbcol="has_client_support" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true"/>
......
......@@ -16,6 +16,7 @@ import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
import performa.orm.types.TimeZone;
import oneit.business.shopping.orm.*;
......@@ -32,6 +33,11 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private HiringTeamType dummyHiringTeamType;
private Industry dummyIndustry;
private TimeZone dummyTimeZone;
private State dummyState;
private Countries dummyCountry;
private String dummyPostCode;
private String dummyCity;
private Boolean dummyHasClientSupport;
// Static constants corresponding to attribute helpers
......@@ -39,6 +45,11 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private static final EnumeratedAttributeHelper HELPER_HiringTeamType = new EnumeratedAttributeHelper (HiringTeamType.FACTORY_HiringTeamType);
private static final EnumeratedAttributeHelper HELPER_Industry = new EnumeratedAttributeHelper (Industry.FACTORY_Industry);
private static final EnumeratedAttributeHelper HELPER_TimeZone = new EnumeratedAttributeHelper (TimeZone.FACTORY_TimeZone);
private static final EnumeratedAttributeHelper HELPER_State = new EnumeratedAttributeHelper (State.FACTORY_State);
private static final EnumeratedAttributeHelper HELPER_Country = new EnumeratedAttributeHelper (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper HELPER_PostCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_City = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_HasClientSupport = DefaultAttributeHelper.INSTANCE;
......@@ -49,10 +60,15 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
dummyHiringTeamType = (HiringTeamType)(HELPER_HiringTeamType.initialise (dummyHiringTeamType));
dummyIndustry = (Industry)(HELPER_Industry.initialise (dummyIndustry));
dummyTimeZone = (TimeZone)(HELPER_TimeZone.initialise (dummyTimeZone));
dummyState = (State)(HELPER_State.initialise (dummyState));
dummyCountry = (Countries)(HELPER_Country.initialise (dummyCountry));
dummyPostCode = (String)(HELPER_PostCode.initialise (dummyPostCode));
dummyCity = (String)(HELPER_City.initialise (dummyCity));
dummyHasClientSupport = (Boolean)(HELPER_HasClientSupport.initialise (dummyHasClientSupport));
}
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.added_by_user_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.added_by_user_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -107,6 +123,11 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
!tl_companyPSet.containsAttrib(Company.FIELD_HiringTeamType)||
!tl_companyPSet.containsAttrib(Company.FIELD_Industry)||
!tl_companyPSet.containsAttrib(Company.FIELD_TimeZone)||
!tl_companyPSet.containsAttrib(Company.FIELD_State)||
!tl_companyPSet.containsAttrib(Company.FIELD_Country)||
!tl_companyPSet.containsAttrib(Company.FIELD_PostCode)||
!tl_companyPSet.containsAttrib(Company.FIELD_City)||
!tl_companyPSet.containsAttrib(Company.FIELD_HasClientSupport)||
!tl_companyPSet.containsAttrib(Company.SINGLEREFERENCE_AddedByUser))
{
// We will need to retrieve it
......@@ -177,10 +198,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_company " +
"SET company_name = ?, hiring_team_type = ?, industry = ?, time_zone = ?, added_by_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET company_name = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, added_by_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_company.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -440,6 +461,11 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
tl_companyPSet.setAttrib(Company.FIELD_HiringTeamType, HELPER_HiringTeamType.getFromRS(dummyHiringTeamType, r, "hiring_team_type"));
tl_companyPSet.setAttrib(Company.FIELD_Industry, HELPER_Industry.getFromRS(dummyIndustry, r, "industry"));
tl_companyPSet.setAttrib(Company.FIELD_TimeZone, HELPER_TimeZone.getFromRS(dummyTimeZone, r, "time_zone"));
tl_companyPSet.setAttrib(Company.FIELD_State, HELPER_State.getFromRS(dummyState, r, "state"));
tl_companyPSet.setAttrib(Company.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country"));
tl_companyPSet.setAttrib(Company.FIELD_PostCode, HELPER_PostCode.getFromRS(dummyPostCode, r, "post_code"));
tl_companyPSet.setAttrib(Company.FIELD_City, HELPER_City.getFromRS(dummyCity, r, "city"));
tl_companyPSet.setAttrib(Company.FIELD_HasClientSupport, HELPER_HasClientSupport.getFromRS(dummyHasClientSupport, r, "has_client_support"));
tl_companyPSet.setAttrib(Company.SINGLEREFERENCE_AddedByUser, r.getObject ("added_by_user_id"));
......@@ -458,10 +484,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_company " +
" (company_name, hiring_team_type, industry, time_zone, added_by_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (company_name, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, added_by_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))) .listEntry (objectID.longID ()).toList().toArray());
tl_companyPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -70,11 +70,11 @@
<oneit:ormEnum obj="<%= client %>" attributeName="Country" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>" field="State or Province" /></label>
<label><oneit:ormlabel obj="<%= client %>" field="State" /></label>
<oneit:ormEnum obj="<%= client %>" attributeName="State" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>" field="Postal Code" /></label>
<label><oneit:ormlabel obj="<%= client %>" field="PostCode" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="PostCode" cssClass="form-control" />
</div>
</div>
......
......@@ -15,3 +15,5 @@ CultureCriteria.CultureElementRating = Rating
AssessmentCriteriaTemplate.TemplateName = Template Name
CultureCriteriaTemplate.TemplateName = Template Name
Company.HasClientSupport = We help clients with hiring
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Debug.assertion(company != null , "Invalid company in admin portal my company");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
<script type="text/javascript">
$(document).ready(function(){
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
});
</script>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title">Manage Company</h1>
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<div class="form-page-area">
<div class="create-job">
<div class="assessment-criteria">
<div class="form-group">
<label class="label-16">Company Details</label>
</div>
<div class="form-group">
<label><oneit:label GUIName="Company Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" />
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:label GUIName="Industry" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="Industry" cssClass="form-control"/>
</div>
</div>
<div class="form-group">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= company %>" id="has-client-support" attributeName="HasClientSupport" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="company.showHasClientSupport() ? 'checked': 'unchecked'" company="<%= company %>">
<label for="has-client-support">
<oneit:ormlabel obj="<%= company %>" field="HasClientSupport" />
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<div class="form-brack-line-sub"></div>
<div class="form-group row">
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= company %>" field="Country" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="Country" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= company %>" field="State" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="State" cssClass="form-control"/>
</div>
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= company %>" field="PostCode" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="PostCode" cssClass="form-control" />
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= company %>" field="City" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="City" cssClass="form-control" />
</div>
<div class="col-md-6">
<label><oneit:label GUIName="Default Timezone" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="TimeZone" cssClass="form-control"/>
</div>
</div>
<div class="text-center form-group">
<oneit:button value="Save Updates" name="save" cssClass="btn btn-primary largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
</div>
</div>
</div>
</div>
</oneit:form>
</div>
</div>
</div>
</oneit:dynIncluded>
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_company</tableName>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/>
<column name="has_client_support" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_industry</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="NAME" type="String" nullable="false" length="200"/>
<column name="VALUE" type="String" nullable="false" length="200"/>
<column name="DESCRIPTION" type="String" nullable="true" length="200"/>
<column name="SORT_ORDER" type="Long" nullable="false"/>
<column name="DISABLED" type="Boolean" nullable="false"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment