Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
292bd731
Commit
292bd731
authored
Sep 08, 2017
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit client modifications
parent
3e27bee9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
483 additions
and
21 deletions
+483
-21
Client.xml
cmsWebApp/sql/Client.xml
+2
-0
Client.sql
cmsWebApp/sql/ms/Client.sql
+2
-0
Client.sql
cmsWebApp/sql/oracle/Client.sql
+2
-0
Client.sql
cmsWebApp/sql/postgres/Client.sql
+2
-0
BaseClient.java
cmsWebApp/src/performa/orm/BaseClient.java
+400
-0
Client.xml
cmsWebApp/src/performa/orm/Client.xml
+5
-3
ClientPersistenceMgr.java
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
+17
-6
edit_client.jsp
cmsWebApp/webroot/extensions/adminportal/edit_client.jsp
+27
-12
fieldnamesOverride.txt
...ot/extensions/adminportal/messages/fieldnamesOverride.txt
+11
-0
20170908_Alter_Client.xml
...ot/extensions/performa/upgrades/20170908_Alter_Client.xml
+15
-0
No files found.
cmsWebApp/sql/Client.xml
View file @
292bd731
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
<column
name=
"state"
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=
"country"
type=
"String"
nullable=
"true"
length=
"200"
/>
<column
name=
"post_code"
type=
"String"
nullable=
"true"
length=
"10"
/>
<column
name=
"post_code"
type=
"String"
nullable=
"true"
length=
"10"
/>
<column
name=
"city"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"time_zone"
type=
"String"
nullable=
"true"
length=
"200"
/>
<column
name=
"company_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"company_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
</NODE>
</NODE>
...
...
cmsWebApp/sql/ms/Client.sql
View file @
292bd731
...
@@ -17,6 +17,8 @@ CREATE TABLE tl_client (
...
@@ -17,6 +17,8 @@ CREATE TABLE tl_client (
state
varchar
(
200
)
NULL
,
state
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
post_code
varchar
(
10
)
NULL
,
post_code
varchar
(
10
)
NULL
,
city
varchar
(
100
)
NULL
,
time_zone
varchar
(
200
)
NULL
,
company_id
numeric
(
12
)
NULL
company_id
numeric
(
12
)
NULL
);
);
...
...
cmsWebApp/sql/oracle/Client.sql
View file @
292bd731
...
@@ -18,6 +18,8 @@ CREATE TABLE tl_client (
...
@@ -18,6 +18,8 @@ CREATE TABLE tl_client (
state
varchar2
(
200
)
NULL
,
state
varchar2
(
200
)
NULL
,
country
varchar2
(
200
)
NULL
,
country
varchar2
(
200
)
NULL
,
post_code
varchar2
(
10
)
NULL
,
post_code
varchar2
(
10
)
NULL
,
city
varchar2
(
100
)
NULL
,
time_zone
varchar2
(
200
)
NULL
,
company_id
number
(
12
)
NULL
company_id
number
(
12
)
NULL
);
);
...
...
cmsWebApp/sql/postgres/Client.sql
View file @
292bd731
...
@@ -18,6 +18,8 @@ CREATE TABLE tl_client (
...
@@ -18,6 +18,8 @@ CREATE TABLE tl_client (
state
varchar
(
200
)
NULL
,
state
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
country
varchar
(
200
)
NULL
,
post_code
varchar
(
10
)
NULL
,
post_code
varchar
(
10
)
NULL
,
city
varchar
(
100
)
NULL
,
time_zone
varchar
(
200
)
NULL
,
company_id
numeric
(
12
)
NULL
company_id
numeric
(
12
)
NULL
);
);
...
...
cmsWebApp/src/performa/orm/BaseClient.java
View file @
292bd731
...
@@ -28,6 +28,8 @@ import oneit.utils.parsers.FieldException;
...
@@ -28,6 +28,8 @@ import oneit.utils.parsers.FieldException;
import
performa.orm.types.*
;
import
performa.orm.types.*
;
import
performa.orm.types.TimeZone
;
import
oneit.business.shopping.orm.*
;
import
oneit.business.shopping.orm.*
;
...
@@ -51,6 +53,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -51,6 +53,8 @@ public abstract class BaseClient extends BaseBusinessClass
public
static
final
String
FIELD_State
=
"State"
;
public
static
final
String
FIELD_State
=
"State"
;
public
static
final
String
FIELD_Country
=
"Country"
;
public
static
final
String
FIELD_Country
=
"Country"
;
public
static
final
String
FIELD_PostCode
=
"PostCode"
;
public
static
final
String
FIELD_PostCode
=
"PostCode"
;
public
static
final
String
FIELD_City
=
"City"
;
public
static
final
String
FIELD_TimeZone
=
"TimeZone"
;
public
static
final
String
SINGLEREFERENCE_Company
=
"Company"
;
public
static
final
String
SINGLEREFERENCE_Company
=
"Company"
;
public
static
final
String
BACKREF_Company
=
""
;
public
static
final
String
BACKREF_Company
=
""
;
public
static
final
String
MULTIPLEREFERENCE_Jobs
=
"Jobs"
;
public
static
final
String
MULTIPLEREFERENCE_Jobs
=
"Jobs"
;
...
@@ -70,6 +74,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -70,6 +74,8 @@ public abstract class BaseClient extends BaseBusinessClass
private
static
final
EnumeratedAttributeHelper
<
Client
,
State
>
HELPER_State
=
new
EnumeratedAttributeHelper
<
Client
,
State
>
(
State
.
FACTORY_State
);
private
static
final
EnumeratedAttributeHelper
<
Client
,
State
>
HELPER_State
=
new
EnumeratedAttributeHelper
<
Client
,
State
>
(
State
.
FACTORY_State
);
private
static
final
EnumeratedAttributeHelper
<
Client
,
Countries
>
HELPER_Country
=
new
EnumeratedAttributeHelper
<
Client
,
Countries
>
(
Countries
.
FACTORY_Countries
);
private
static
final
EnumeratedAttributeHelper
<
Client
,
Countries
>
HELPER_Country
=
new
EnumeratedAttributeHelper
<
Client
,
Countries
>
(
Countries
.
FACTORY_Countries
);
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_PostCode
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_PostCode
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Client
>
HELPER_City
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
EnumeratedAttributeHelper
<
Client
,
TimeZone
>
HELPER_TimeZone
=
new
EnumeratedAttributeHelper
<
Client
,
TimeZone
>
(
TimeZone
.
FACTORY_TimeZone
);
// Private attributes corresponding to business object data
// Private attributes corresponding to business object data
...
@@ -82,6 +88,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -82,6 +88,8 @@ public abstract class BaseClient extends BaseBusinessClass
private
State
_State
;
private
State
_State
;
private
Countries
_Country
;
private
Countries
_Country
;
private
String
_PostCode
;
private
String
_PostCode
;
private
String
_City
;
private
TimeZone
_TimeZone
;
// Private attributes corresponding to single references
// Private attributes corresponding to single references
...
@@ -105,6 +113,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -105,6 +113,8 @@ public abstract class BaseClient extends BaseBusinessClass
private
static
final
AttributeValidator
[]
FIELD_State_Validators
;
private
static
final
AttributeValidator
[]
FIELD_State_Validators
;
private
static
final
AttributeValidator
[]
FIELD_Country_Validators
;
private
static
final
AttributeValidator
[]
FIELD_Country_Validators
;
private
static
final
AttributeValidator
[]
FIELD_PostCode_Validators
;
private
static
final
AttributeValidator
[]
FIELD_PostCode_Validators
;
private
static
final
AttributeValidator
[]
FIELD_City_Validators
;
private
static
final
AttributeValidator
[]
FIELD_TimeZone_Validators
;
// Arrays of behaviour decorators
// Arrays of behaviour decorators
...
@@ -131,6 +141,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -131,6 +141,8 @@ public abstract class BaseClient extends BaseBusinessClass
FIELD_State_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_State
(
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_Country_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Country
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_PostCode_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_PostCode
(
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_TimeZone_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_TimeZone
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
REFERENCE_Client
.
initialiseReference
();
REFERENCE_Client
.
initialiseReference
();
...
@@ -359,6 +371,46 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -359,6 +371,46 @@ public abstract class BaseClient extends BaseBusinessClass
return
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 Client.City:"
,
metaInfo
);
ATTRIBUTES_METADATA_Client
.
put
(
FIELD_City
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Client
.
class
,
"City"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Client.City:"
,
validators
);
return
validators
;
}
// Meta Info setup
private
static
List
setupAttribMetaData_TimeZone
(
Map
validatorMapping
)
{
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"attribHelper"
,
"EnumeratedAttributeHelper"
);
metaInfo
.
put
(
"dbcol"
,
"time_zone"
);
metaInfo
.
put
(
"mandatory"
,
"false"
);
metaInfo
.
put
(
"name"
,
"TimeZone"
);
metaInfo
.
put
(
"type"
,
"TimeZone"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Client.TimeZone:"
,
metaInfo
);
ATTRIBUTES_METADATA_Client
.
put
(
FIELD_TimeZone
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Client
.
class
,
"TimeZone"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Client.TimeZone:"
,
validators
);
return
validators
;
}
// END OF STATIC METADATA DEFINITION
// END OF STATIC METADATA DEFINITION
...
@@ -395,6 +447,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -395,6 +447,8 @@ public abstract class BaseClient extends BaseBusinessClass
_State
=
(
State
)(
State
.
WA
);
_State
=
(
State
)(
State
.
WA
);
_Country
=
(
Countries
)(
Countries
.
AU
);
_Country
=
(
Countries
)(
Countries
.
AU
);
_PostCode
=
(
String
)(
HELPER_PostCode
.
initialise
(
_PostCode
));
_PostCode
=
(
String
)(
HELPER_PostCode
.
initialise
(
_PostCode
));
_City
=
(
String
)(
HELPER_City
.
initialise
(
_City
));
_TimeZone
=
(
TimeZone
)(
HELPER_TimeZone
.
initialise
(
_TimeZone
));
}
}
...
@@ -1306,6 +1360,202 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1306,6 +1360,202 @@ public abstract class BaseClient extends BaseBusinessClass
}
}
}
}
/**
* Get the attribute City
*/
public
String
getCity
()
{
assertValid
();
String
valToReturn
=
_City
;
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
valToReturn
=
bhd
.
getCity
((
Client
)
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
setCity
(
String
newCity
)
throws
FieldException
{
boolean
oldAndNewIdentical
=
HELPER_City
.
compare
(
_City
,
newCity
);
try
{
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
newCity
=
bhd
.
setCity
((
Client
)
this
,
newCity
);
oldAndNewIdentical
=
HELPER_City
.
compare
(
_City
,
newCity
);
}
if
(
FIELD_City_Validators
.
length
>
0
)
{
Object
newCityObj
=
HELPER_City
.
toObject
(
newCity
);
if
(
newCityObj
!=
null
)
{
int
loopMax
=
FIELD_City_Validators
.
length
;
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Client
.
get
(
FIELD_City
);
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
{
FIELD_City_Validators
[
v
].
checkAttribute
(
this
,
FIELD_City
,
metadata
,
newCityObj
);
}
}
}
}
catch
(
FieldException
e
)
{
if
(!
oldAndNewIdentical
)
{
e
.
setWouldModify
();
}
throw
e
;
}
if
(!
oldAndNewIdentical
)
{
assertValid
();
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
*/
public
TimeZone
getTimeZone
()
{
assertValid
();
TimeZone
valToReturn
=
_TimeZone
;
for
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
valToReturn
=
bhd
.
getTimeZone
((
Client
)
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
(
ClientBehaviourDecorator
bhd
:
Client_BehaviourDecorators
)
{
newTimeZone
=
bhd
.
setTimeZone
((
Client
)
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_Client
.
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
();
}
}
/**
/**
...
@@ -1836,6 +2086,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1836,6 +2086,8 @@ public abstract class BaseClient extends BaseBusinessClass
tl_clientPSet
.
setAttrib
(
FIELD_State
,
HELPER_State
.
toObject
(
_State
));
//
tl_clientPSet
.
setAttrib
(
FIELD_State
,
HELPER_State
.
toObject
(
_State
));
//
tl_clientPSet
.
setAttrib
(
FIELD_Country
,
HELPER_Country
.
toObject
(
_Country
));
//
tl_clientPSet
.
setAttrib
(
FIELD_Country
,
HELPER_Country
.
toObject
(
_Country
));
//
tl_clientPSet
.
setAttrib
(
FIELD_PostCode
,
HELPER_PostCode
.
toObject
(
_PostCode
));
//
tl_clientPSet
.
setAttrib
(
FIELD_PostCode
,
HELPER_PostCode
.
toObject
(
_PostCode
));
//
tl_clientPSet
.
setAttrib
(
FIELD_City
,
HELPER_City
.
toObject
(
_City
));
//
tl_clientPSet
.
setAttrib
(
FIELD_TimeZone
,
HELPER_TimeZone
.
toObject
(
_TimeZone
));
//
_Company
.
getPersistentSets
(
allSets
);
_Company
.
getPersistentSets
(
allSets
);
}
}
...
@@ -1860,6 +2112,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1860,6 +2112,8 @@ public abstract class BaseClient extends BaseBusinessClass
_State
=
(
State
)(
HELPER_State
.
fromObject
(
_State
,
tl_clientPSet
.
getAttrib
(
FIELD_State
)));
//
_State
=
(
State
)(
HELPER_State
.
fromObject
(
_State
,
tl_clientPSet
.
getAttrib
(
FIELD_State
)));
//
_Country
=
(
Countries
)(
HELPER_Country
.
fromObject
(
_Country
,
tl_clientPSet
.
getAttrib
(
FIELD_Country
)));
//
_Country
=
(
Countries
)(
HELPER_Country
.
fromObject
(
_Country
,
tl_clientPSet
.
getAttrib
(
FIELD_Country
)));
//
_PostCode
=
(
String
)(
HELPER_PostCode
.
fromObject
(
_PostCode
,
tl_clientPSet
.
getAttrib
(
FIELD_PostCode
)));
//
_PostCode
=
(
String
)(
HELPER_PostCode
.
fromObject
(
_PostCode
,
tl_clientPSet
.
getAttrib
(
FIELD_PostCode
)));
//
_City
=
(
String
)(
HELPER_City
.
fromObject
(
_City
,
tl_clientPSet
.
getAttrib
(
FIELD_City
)));
//
_TimeZone
=
(
TimeZone
)(
HELPER_TimeZone
.
fromObject
(
_TimeZone
,
tl_clientPSet
.
getAttrib
(
FIELD_TimeZone
)));
//
_Company
.
setFromPersistentSets
(
objectID
,
allSets
);
_Company
.
setFromPersistentSets
(
objectID
,
allSets
);
}
}
...
@@ -1957,6 +2211,24 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1957,6 +2211,24 @@ public abstract class BaseClient extends BaseBusinessClass
e
.
addException
(
ex
);
e
.
addException
(
ex
);
}
}
try
{
setCity
(
otherClient
.
getCity
());
}
catch
(
FieldException
ex
)
{
e
.
addException
(
ex
);
}
try
{
setTimeZone
(
otherClient
.
getTimeZone
());
}
catch
(
FieldException
ex
)
{
e
.
addException
(
ex
);
}
}
}
}
}
...
@@ -1981,6 +2253,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -1981,6 +2253,8 @@ public abstract class BaseClient extends BaseBusinessClass
_State
=
sourceClient
.
_State
;
_State
=
sourceClient
.
_State
;
_Country
=
sourceClient
.
_Country
;
_Country
=
sourceClient
.
_Country
;
_PostCode
=
sourceClient
.
_PostCode
;
_PostCode
=
sourceClient
.
_PostCode
;
_City
=
sourceClient
.
_City
;
_TimeZone
=
sourceClient
.
_TimeZone
;
}
}
}
}
...
@@ -2044,6 +2318,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2044,6 +2318,8 @@ public abstract class BaseClient extends BaseBusinessClass
_State
=
(
State
)(
HELPER_State
.
readExternal
(
_State
,
vals
.
get
(
FIELD_State
)));
//
_State
=
(
State
)(
HELPER_State
.
readExternal
(
_State
,
vals
.
get
(
FIELD_State
)));
//
_Country
=
(
Countries
)(
HELPER_Country
.
readExternal
(
_Country
,
vals
.
get
(
FIELD_Country
)));
//
_Country
=
(
Countries
)(
HELPER_Country
.
readExternal
(
_Country
,
vals
.
get
(
FIELD_Country
)));
//
_PostCode
=
(
String
)(
HELPER_PostCode
.
readExternal
(
_PostCode
,
vals
.
get
(
FIELD_PostCode
)));
//
_PostCode
=
(
String
)(
HELPER_PostCode
.
readExternal
(
_PostCode
,
vals
.
get
(
FIELD_PostCode
)));
//
_City
=
(
String
)(
HELPER_City
.
readExternal
(
_City
,
vals
.
get
(
FIELD_City
)));
//
_TimeZone
=
(
TimeZone
)(
HELPER_TimeZone
.
readExternal
(
_TimeZone
,
vals
.
get
(
FIELD_TimeZone
)));
//
_Company
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_Company
));
_Company
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_Company
));
_Jobs
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_Jobs
));
_Jobs
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_Jobs
));
...
@@ -2066,6 +2342,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2066,6 +2342,8 @@ public abstract class BaseClient extends BaseBusinessClass
vals
.
put
(
FIELD_State
,
HELPER_State
.
writeExternal
(
_State
));
vals
.
put
(
FIELD_State
,
HELPER_State
.
writeExternal
(
_State
));
vals
.
put
(
FIELD_Country
,
HELPER_Country
.
writeExternal
(
_Country
));
vals
.
put
(
FIELD_Country
,
HELPER_Country
.
writeExternal
(
_Country
));
vals
.
put
(
FIELD_PostCode
,
HELPER_PostCode
.
writeExternal
(
_PostCode
));
vals
.
put
(
FIELD_PostCode
,
HELPER_PostCode
.
writeExternal
(
_PostCode
));
vals
.
put
(
FIELD_City
,
HELPER_City
.
writeExternal
(
_City
));
vals
.
put
(
FIELD_TimeZone
,
HELPER_TimeZone
.
writeExternal
(
_TimeZone
));
vals
.
put
(
SINGLEREFERENCE_Company
,
_Company
.
writeExternalData
());
vals
.
put
(
SINGLEREFERENCE_Company
,
_Company
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_Jobs
,
_Jobs
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_Jobs
,
_Jobs
.
writeExternalData
());
...
@@ -2117,6 +2395,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2117,6 +2395,14 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_PostCode
,
HELPER_PostCode
.
toObject
(
this
.
_PostCode
),
HELPER_PostCode
.
toObject
(
otherClient
.
_PostCode
));
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_PostCode
,
HELPER_PostCode
.
toObject
(
this
.
_PostCode
),
HELPER_PostCode
.
toObject
(
otherClient
.
_PostCode
));
}
}
if
(!
HELPER_City
.
compare
(
this
.
_City
,
otherClient
.
_City
))
{
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_City
,
HELPER_City
.
toObject
(
this
.
_City
),
HELPER_City
.
toObject
(
otherClient
.
_City
));
}
if
(!
HELPER_TimeZone
.
compare
(
this
.
_TimeZone
,
otherClient
.
_TimeZone
))
{
listener
.
notifyFieldChange
(
this
,
other
,
FIELD_TimeZone
,
HELPER_TimeZone
.
toObject
(
this
.
_TimeZone
),
HELPER_TimeZone
.
toObject
(
otherClient
.
_TimeZone
));
}
// Compare single assocs
// Compare single assocs
_Company
.
compare
(
otherClient
.
_Company
,
listener
);
_Company
.
compare
(
otherClient
.
_Company
,
listener
);
...
@@ -2150,6 +2436,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2150,6 +2436,8 @@ public abstract class BaseClient extends BaseBusinessClass
visitor
.
visitField
(
this
,
FIELD_State
,
HELPER_State
.
toObject
(
getState
()));
visitor
.
visitField
(
this
,
FIELD_State
,
HELPER_State
.
toObject
(
getState
()));
visitor
.
visitField
(
this
,
FIELD_Country
,
HELPER_Country
.
toObject
(
getCountry
()));
visitor
.
visitField
(
this
,
FIELD_Country
,
HELPER_Country
.
toObject
(
getCountry
()));
visitor
.
visitField
(
this
,
FIELD_PostCode
,
HELPER_PostCode
.
toObject
(
getPostCode
()));
visitor
.
visitField
(
this
,
FIELD_PostCode
,
HELPER_PostCode
.
toObject
(
getPostCode
()));
visitor
.
visitField
(
this
,
FIELD_City
,
HELPER_City
.
toObject
(
getCity
()));
visitor
.
visitField
(
this
,
FIELD_TimeZone
,
HELPER_TimeZone
.
toObject
(
getTimeZone
()));
visitor
.
visitAssociation
(
_Company
);
visitor
.
visitAssociation
(
_Company
);
visitor
.
visitAssociation
(
_Jobs
);
visitor
.
visitAssociation
(
_Jobs
);
...
@@ -2229,6 +2517,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2229,6 +2517,14 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
return
filter
.
matches
(
getPostCode
());
return
filter
.
matches
(
getPostCode
());
}
}
else
if
(
attribName
.
equals
(
FIELD_City
))
{
return
filter
.
matches
(
getCity
());
}
else
if
(
attribName
.
equals
(
FIELD_TimeZone
))
{
return
filter
.
matches
(
getTimeZone
());
}
else
if
(
attribName
.
equals
(
SINGLEREFERENCE_Company
))
else
if
(
attribName
.
equals
(
SINGLEREFERENCE_Company
))
{
{
return
filter
.
matches
(
getCompany
());
return
filter
.
matches
(
getCompany
());
...
@@ -2318,6 +2614,18 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2318,6 +2614,18 @@ public abstract class BaseClient extends BaseBusinessClass
return
this
;
return
this
;
}
}
public
SearchAll
andCity
(
QueryFilter
<
String
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_client.city"
,
"City"
);
return
this
;
}
public
SearchAll
andTimeZone
(
QueryFilter
<
TimeZone
>
filter
)
{
filter
.
addFilter
(
context
,
"tl_client.time_zone"
,
"TimeZone"
);
return
this
;
}
public
SearchAll
andCompany
(
QueryFilter
<
Company
>
filter
)
public
SearchAll
andCompany
(
QueryFilter
<
Company
>
filter
)
{
{
filter
.
addFilter
(
context
,
"tl_client.company_id"
,
"Company"
);
filter
.
addFilter
(
context
,
"tl_client.company_id"
,
"Company"
);
...
@@ -2395,6 +2703,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2395,6 +2703,14 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
return
HELPER_PostCode
.
toObject
(
getPostCode
());
return
HELPER_PostCode
.
toObject
(
getPostCode
());
}
}
else
if
(
attribName
.
equals
(
FIELD_City
))
{
return
HELPER_City
.
toObject
(
getCity
());
}
else
if
(
attribName
.
equals
(
FIELD_TimeZone
))
{
return
HELPER_TimeZone
.
toObject
(
getTimeZone
());
}
else
else
{
{
return
super
.
getAttribute
(
attribName
);
return
super
.
getAttribute
(
attribName
);
...
@@ -2444,6 +2760,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2444,6 +2760,14 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
return
HELPER_PostCode
;
return
HELPER_PostCode
;
}
}
else
if
(
attribName
.
equals
(
FIELD_City
))
{
return
HELPER_City
;
}
else
if
(
attribName
.
equals
(
FIELD_TimeZone
))
{
return
HELPER_TimeZone
;
}
else
else
{
{
return
super
.
getAttributeHelper
(
attribName
);
return
super
.
getAttributeHelper
(
attribName
);
...
@@ -2493,6 +2817,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2493,6 +2817,14 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
setPostCode
((
String
)(
HELPER_PostCode
.
fromObject
(
_PostCode
,
attribValue
)));
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_TimeZone
))
{
setTimeZone
((
TimeZone
)(
HELPER_TimeZone
.
fromObject
(
_TimeZone
,
attribValue
)));
}
else
else
{
{
super
.
setAttribute
(
attribName
,
attribValue
);
super
.
setAttribute
(
attribName
,
attribValue
);
...
@@ -2549,6 +2881,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2549,6 +2881,14 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
return
getWriteability_PostCode
();
return
getWriteability_PostCode
();
}
}
else
if
(
fieldName
.
equals
(
FIELD_City
))
{
return
getWriteability_City
();
}
else
if
(
fieldName
.
equals
(
FIELD_TimeZone
))
{
return
getWriteability_TimeZone
();
}
else
if
(
fieldName
.
equals
(
MULTIPLEREFERENCE_Jobs
))
else
if
(
fieldName
.
equals
(
MULTIPLEREFERENCE_Jobs
))
{
{
return
getWriteability_Jobs
();
return
getWriteability_Jobs
();
...
@@ -2612,6 +2952,16 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2612,6 +2952,16 @@ public abstract class BaseClient extends BaseBusinessClass
fields
.
add
(
FIELD_PostCode
);
fields
.
add
(
FIELD_PostCode
);
}
}
if
(
getWriteability_City
()
!=
FieldWriteability
.
TRUE
)
{
fields
.
add
(
FIELD_City
);
}
if
(
getWriteability_TimeZone
()
!=
FieldWriteability
.
TRUE
)
{
fields
.
add
(
FIELD_TimeZone
);
}
super
.
putUnwriteable
(
fields
);
super
.
putUnwriteable
(
fields
);
}
}
...
@@ -2630,6 +2980,8 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2630,6 +2980,8 @@ public abstract class BaseClient extends BaseBusinessClass
result
.
add
(
HELPER_State
.
getAttribObject
(
getClass
(),
_State
,
false
,
FIELD_State
));
result
.
add
(
HELPER_State
.
getAttribObject
(
getClass
(),
_State
,
false
,
FIELD_State
));
result
.
add
(
HELPER_Country
.
getAttribObject
(
getClass
(),
_Country
,
false
,
FIELD_Country
));
result
.
add
(
HELPER_Country
.
getAttribObject
(
getClass
(),
_Country
,
false
,
FIELD_Country
));
result
.
add
(
HELPER_PostCode
.
getAttribObject
(
getClass
(),
_PostCode
,
false
,
FIELD_PostCode
));
result
.
add
(
HELPER_PostCode
.
getAttribObject
(
getClass
(),
_PostCode
,
false
,
FIELD_PostCode
));
result
.
add
(
HELPER_City
.
getAttribObject
(
getClass
(),
_City
,
false
,
FIELD_City
));
result
.
add
(
HELPER_TimeZone
.
getAttribObject
(
getClass
(),
_TimeZone
,
false
,
FIELD_TimeZone
));
return
result
;
return
result
;
}
}
...
@@ -2860,6 +3212,42 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2860,6 +3212,42 @@ public abstract class BaseClient extends BaseBusinessClass
return
newPostCode
;
return
newPostCode
;
}
}
/**
* Get the attribute City
*/
public
String
getCity
(
Client
obj
,
String
original
)
{
return
original
;
}
/**
* Change the value set for attribute City.
* May modify the field beforehand
* Occurs before validation.
*/
public
String
setCity
(
Client
obj
,
String
newCity
)
throws
FieldException
{
return
newCity
;
}
/**
* Get the attribute TimeZone
*/
public
TimeZone
getTimeZone
(
Client
obj
,
TimeZone
original
)
{
return
original
;
}
/**
* Change the value set for attribute TimeZone.
* May modify the field beforehand
* Occurs before validation.
*/
public
TimeZone
setTimeZone
(
Client
obj
,
TimeZone
newTimeZone
)
throws
FieldException
{
return
newTimeZone
;
}
}
}
...
@@ -2952,6 +3340,14 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2952,6 +3340,14 @@ public abstract class BaseClient extends BaseBusinessClass
{
{
return
toPostCode
();
return
toPostCode
();
}
}
if
(
name
.
equals
(
"City"
))
{
return
toCity
();
}
if
(
name
.
equals
(
"TimeZone"
))
{
return
toTimeZone
();
}
if
(
name
.
equals
(
"Company"
))
if
(
name
.
equals
(
"Company"
))
{
{
return
toCompany
();
return
toCompany
();
...
@@ -2979,6 +3375,10 @@ public abstract class BaseClient extends BaseBusinessClass
...
@@ -2979,6 +3375,10 @@ public abstract class BaseClient extends BaseBusinessClass
public
PipeLine
<
From
,
Countries
>
toCountry
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Countries
>(
FIELD_Country
));
}
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
>
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
,
TimeZone
>
toTimeZone
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
TimeZone
>(
FIELD_TimeZone
));
}
public
Company
.
CompanyPipeLineFactory
<
From
,
Company
>
toCompany
()
{
return
toCompany
(
Filter
.
ALL
);
}
public
Company
.
CompanyPipeLineFactory
<
From
,
Company
>
toCompany
()
{
return
toCompany
(
Filter
.
ALL
);
}
public
Company
.
CompanyPipeLineFactory
<
From
,
Company
>
toCompany
(
Filter
<
Company
>
filter
)
public
Company
.
CompanyPipeLineFactory
<
From
,
Company
>
toCompany
(
Filter
<
Company
>
filter
)
...
...
cmsWebApp/src/performa/orm/Client.xml
View file @
292bd731
...
@@ -5,14 +5,15 @@
...
@@ -5,14 +5,15 @@
<BUSINESSCLASS
name=
"Client"
package=
"performa.orm"
>
<BUSINESSCLASS
name=
"Client"
package=
"performa.orm"
>
<IMPORT
value=
"performa.orm.types.*"
/>
<IMPORT
value=
"performa.orm.types.*"
/>
<IMPORT
value=
"performa.orm.types.TimeZone"
/>
<IMPORT
value=
"oneit.business.shopping.orm.*"
/>
<IMPORT
value=
"oneit.business.shopping.orm.*"
/>
<MULTIPLEREFERENCE
name=
"Jobs"
type=
"Job"
backreferenceName=
"Client"
/>
<MULTIPLEREFERENCE
name=
"Jobs"
type=
"Job"
backreferenceName=
"Client"
/>
<TABLE
name=
"tl_client"
tablePrefix=
"object"
>
<TABLE
name=
"tl_client"
tablePrefix=
"object"
>
<ATTRIB
name=
"ClientName"
type=
"String"
dbcol=
"client_name"
mandatory=
"true"
length=
"100"
/>
<ATTRIB
name=
"ClientName"
type=
"String"
dbcol=
"client_name"
mandatory=
"true"
length=
"100"
/>
<ATTRIB
name=
"ClientLogo"
type=
"BinaryContent"
dbcol=
"client_logo"
mandatory=
"false"
binaryHandler=
"loggedin"
attribHelper=
"BLOBAttributeHelper"
attribHelperInstance=
"BLOBAttributeHelper.INSTANCE"
/>
<ATTRIB
name=
"ClientLogo"
type=
"BinaryContent"
dbcol=
"client_logo"
mandatory=
"false"
binaryHandler=
"loggedin"
attribHelper=
"BLOBAttributeHelper"
attribHelperInstance=
"BLOBAttributeHelper.INSTANCE"
/>
<ATTRIB
name=
"Email"
type=
"String"
dbcol=
"email"
mandatory=
"false"
length=
"100"
validators=
"Email"
/>
<ATTRIB
name=
"Email"
type=
"String"
dbcol=
"email"
mandatory=
"false"
length=
"100"
validators=
"Email"
/>
<ATTRIB
name=
"ContactName"
type=
"String"
dbcol=
"contact_name"
mandatory=
"false"
length=
"100"
/>
<ATTRIB
name=
"ContactName"
type=
"String"
dbcol=
"contact_name"
mandatory=
"false"
length=
"100"
/>
<ATTRIB
name=
"ContactSurname"
type=
"String"
dbcol=
"contact_surname"
mandatory=
"false"
length=
"100"
/>
<ATTRIB
name=
"ContactSurname"
type=
"String"
dbcol=
"contact_surname"
mandatory=
"false"
length=
"100"
/>
...
@@ -20,7 +21,8 @@
...
@@ -20,7 +21,8 @@
<ATTRIB
name=
"State"
type=
"State"
dbcol=
"state"
mandatory=
"false"
defaultValue=
"State.WA"
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=
"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=
"PostCode"
type=
"String"
dbcol=
"post_code"
mandatory=
"false"
length=
"10"
/>
<ATTRIB
name=
"City"
type=
"String"
dbcol=
"city"
mandatory=
"false"
length=
"100"
/>
<ATTRIB
name=
"TimeZone"
type=
"TimeZone"
dbcol=
"time_zone"
mandatory=
"false"
attribHelper=
"EnumeratedAttributeHelper"
/>
<SINGLEREFERENCE
name=
"Company"
type=
"Company"
dbcol=
"company_id"
backreferenceName=
"Clients"
/>
<SINGLEREFERENCE
name=
"Company"
type=
"Company"
dbcol=
"company_id"
backreferenceName=
"Clients"
/>
...
...
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
View file @
292bd731
...
@@ -15,6 +15,7 @@ import oneit.utils.resource.*;
...
@@ -15,6 +15,7 @@ import oneit.utils.resource.*;
import
oneit.utils.*
;
import
oneit.utils.*
;
import
oneit.utils.threading.*
;
import
oneit.utils.threading.*
;
import
performa.orm.types.*
;
import
performa.orm.types.*
;
import
performa.orm.types.TimeZone
;
import
oneit.business.shopping.orm.*
;
import
oneit.business.shopping.orm.*
;
...
@@ -37,6 +38,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -37,6 +38,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
private
State
dummyState
;
private
State
dummyState
;
private
Countries
dummyCountry
;
private
Countries
dummyCountry
;
private
String
dummyPostCode
;
private
String
dummyPostCode
;
private
String
dummyCity
;
private
TimeZone
dummyTimeZone
;
// Static constants corresponding to attribute helpers
// Static constants corresponding to attribute helpers
...
@@ -49,6 +52,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -49,6 +52,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
private
static
final
EnumeratedAttributeHelper
HELPER_State
=
new
EnumeratedAttributeHelper
(
State
.
FACTORY_State
);
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
EnumeratedAttributeHelper
HELPER_Country
=
new
EnumeratedAttributeHelper
(
Countries
.
FACTORY_Countries
);
private
static
final
DefaultAttributeHelper
HELPER_PostCode
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_PostCode
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
HELPER_City
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
EnumeratedAttributeHelper
HELPER_TimeZone
=
new
EnumeratedAttributeHelper
(
TimeZone
.
FACTORY_TimeZone
);
...
@@ -64,10 +69,12 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -64,10 +69,12 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
dummyState
=
(
State
)(
HELPER_State
.
initialise
(
dummyState
));
dummyState
=
(
State
)(
HELPER_State
.
initialise
(
dummyState
));
dummyCountry
=
(
Countries
)(
HELPER_Country
.
initialise
(
dummyCountry
));
dummyCountry
=
(
Countries
)(
HELPER_Country
.
initialise
(
dummyCountry
));
dummyPostCode
=
(
String
)(
HELPER_PostCode
.
initialise
(
dummyPostCode
));
dummyPostCode
=
(
String
)(
HELPER_PostCode
.
initialise
(
dummyPostCode
));
dummyCity
=
(
String
)(
HELPER_City
.
initialise
(
dummyCity
));
dummyTimeZone
=
(
TimeZone
)(
HELPER_TimeZone
.
initialise
(
dummyTimeZone
));
}
}
private
String
SELECT_COLUMNS
=
"{PREFIX}tl_client.object_id as id, {PREFIX}tl_client.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_client.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_client.client_name, {PREFIX}tl_client.client_logo, {PREFIX}tl_client.email, {PREFIX}tl_client.contact_name, {PREFIX}tl_client.contact_surname, {PREFIX}tl_client.phone, {PREFIX}tl_client.state, {PREFIX}tl_client.country, {PREFIX}tl_client.post_code, {PREFIX}tl_client.company_id, 1 AS commasafe "
;
private
String
SELECT_COLUMNS
=
"{PREFIX}tl_client.object_id as id, {PREFIX}tl_client.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_client.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_client.client_name, {PREFIX}tl_client.client_logo, {PREFIX}tl_client.email, {PREFIX}tl_client.contact_name, {PREFIX}tl_client.contact_surname, {PREFIX}tl_client.phone, {PREFIX}tl_client.state, {PREFIX}tl_client.country, {PREFIX}tl_client.post_code, {PREFIX}tl_client.c
ity, {PREFIX}tl_client.time_zone, {PREFIX}tl_client.c
ompany_id, 1 AS commasafe "
;
private
String
SELECT_JOINS
=
""
;
private
String
SELECT_JOINS
=
""
;
public
BaseBusinessClass
fetchByID
(
ObjectID
id
,
PersistentSetCollection
allPSets
,
RDBMSPersistenceContext
context
,
SQLManager
sqlMgr
)
throws
SQLException
,
StorageException
public
BaseBusinessClass
fetchByID
(
ObjectID
id
,
PersistentSetCollection
allPSets
,
RDBMSPersistenceContext
context
,
SQLManager
sqlMgr
)
throws
SQLException
,
StorageException
...
@@ -127,6 +134,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -127,6 +134,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_State
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_State
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_Country
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_Country
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_PostCode
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_PostCode
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_City
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
FIELD_TimeZone
)||
!
tl_clientPSet
.
containsAttrib
(
Client
.
SINGLEREFERENCE_Company
))
!
tl_clientPSet
.
containsAttrib
(
Client
.
SINGLEREFERENCE_Company
))
{
{
// We will need to retrieve it
// We will need to retrieve it
...
@@ -207,10 +216,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -207,10 +216,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
{
int
rowsUpdated
=
executeStatement
(
sqlMgr
,
int
rowsUpdated
=
executeStatement
(
sqlMgr
,
"UPDATE {PREFIX}tl_client "
+
"UPDATE {PREFIX}tl_client "
+
"SET client_name = ?, client_logo = ?, email = ?, contact_name = ?, contact_surname = ?, phone = ?, state = ?, country = ?, post_code = ?, company_id = ? , object_LAST_UPDATED_DATE = "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
" "
+
"SET client_name = ?, client_logo = ?, email = ?, contact_name = ?, contact_surname = ?, phone = ?, state = ?, country = ?, post_code = ?, c
ity = ?, time_zone = ?, c
ompany_id = ? , object_LAST_UPDATED_DATE = "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
" "
+
"WHERE tl_client.object_id = ? AND "
+
getConcurrencyCheck
(
sqlMgr
,
"object_LAST_UPDATED_DATE"
,
obj
.
getObjectLastModified
())
+
" "
,
"WHERE tl_client.object_id = ? AND "
+
getConcurrencyCheck
(
sqlMgr
,
"object_LAST_UPDATED_DATE"
,
obj
.
getObjectLastModified
())
+
" "
,
CollectionUtils
.
listEntry
(
HELPER_ClientName
.
getForSQL
(
dummyClientName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientName
))).
listEntry
(
HELPER_ClientLogo
.
getForSQL
(
dummyClientLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientLogo
))).
listEntry
(
HELPER_Email
.
getForSQL
(
dummyEmail
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Email
))).
listEntry
(
HELPER_ContactName
.
getForSQL
(
dummyContactName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactName
))).
listEntry
(
HELPER_ContactSurname
.
getForSQL
(
dummyContactSurname
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactSurname
))).
listEntry
(
HELPER_Phone
.
getForSQL
(
dummyPhone
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Phone
))).
listEntry
(
HELPER_State
.
getForSQL
(
dummyState
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_State
))).
listEntry
(
HELPER_Country
.
getForSQL
(
dummyCountry
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Country
))).
listEntry
(
HELPER_PostCode
.
getForSQL
(
dummyPostCode
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_PostCode
))).
listEntry
(
SQLManager
.
CheckNull
((
Long
)(
tl_clientPSet
.
getAttrib
(
Client
.
SINGLEREFERENCE_Company
)))).
listEntry
(
objectID
.
longID
()).
listEntry
(
obj
.
getObjectLastModified
()).
toList
().
toArray
());
CollectionUtils
.
listEntry
(
HELPER_ClientName
.
getForSQL
(
dummyClientName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientName
))).
listEntry
(
HELPER_ClientLogo
.
getForSQL
(
dummyClientLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientLogo
))).
listEntry
(
HELPER_Email
.
getForSQL
(
dummyEmail
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Email
))).
listEntry
(
HELPER_ContactName
.
getForSQL
(
dummyContactName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactName
))).
listEntry
(
HELPER_ContactSurname
.
getForSQL
(
dummyContactSurname
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactSurname
))).
listEntry
(
HELPER_Phone
.
getForSQL
(
dummyPhone
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Phone
))).
listEntry
(
HELPER_State
.
getForSQL
(
dummyState
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_State
))).
listEntry
(
HELPER_Country
.
getForSQL
(
dummyCountry
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Country
))).
listEntry
(
HELPER_PostCode
.
getForSQL
(
dummyPostCode
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_PostCode
))).
listEntry
(
HELPER_City
.
getForSQL
(
dummyCity
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_City
))).
listEntry
(
HELPER_TimeZone
.
getForSQL
(
dummyTimeZone
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_TimeZone
))).
listEntry
(
SQLManager
.
CheckNull
((
Long
)(
tl_clientPSet
.
getAttrib
(
Client
.
SINGLEREFERENCE_Company
)))).
listEntry
(
objectID
.
longID
()).
listEntry
(
obj
.
getObjectLastModified
()).
toList
().
toArray
());
if
(
rowsUpdated
!=
1
)
if
(
rowsUpdated
!=
1
)
{
{
...
@@ -475,6 +484,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -475,6 +484,8 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_State
,
HELPER_State
.
getFromRS
(
dummyState
,
r
,
"state"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_State
,
HELPER_State
.
getFromRS
(
dummyState
,
r
,
"state"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_Country
,
HELPER_Country
.
getFromRS
(
dummyCountry
,
r
,
"country"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_Country
,
HELPER_Country
.
getFromRS
(
dummyCountry
,
r
,
"country"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_PostCode
,
HELPER_PostCode
.
getFromRS
(
dummyPostCode
,
r
,
"post_code"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_PostCode
,
HELPER_PostCode
.
getFromRS
(
dummyPostCode
,
r
,
"post_code"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_City
,
HELPER_City
.
getFromRS
(
dummyCity
,
r
,
"city"
));
tl_clientPSet
.
setAttrib
(
Client
.
FIELD_TimeZone
,
HELPER_TimeZone
.
getFromRS
(
dummyTimeZone
,
r
,
"time_zone"
));
tl_clientPSet
.
setAttrib
(
Client
.
SINGLEREFERENCE_Company
,
r
.
getObject
(
"company_id"
));
tl_clientPSet
.
setAttrib
(
Client
.
SINGLEREFERENCE_Company
,
r
.
getObject
(
"company_id"
));
...
@@ -493,10 +504,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -493,10 +504,10 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
{
{
executeStatement
(
sqlMgr
,
executeStatement
(
sqlMgr
,
"INSERT INTO {PREFIX}tl_client "
+
"INSERT INTO {PREFIX}tl_client "
+
" (client_name, client_logo, email, contact_name, contact_surname, phone, state, country, post_code, company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) "
+
" (client_name, client_logo, email, contact_name, contact_surname, phone, state, country, post_code,
city, time_zone,
company_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) "
+
"VALUES "
+
"VALUES "
+
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
", "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
")"
,
" (?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?,
?, ?, "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
", "
+
sqlMgr
.
getPortabilityServices
().
getTimestampExpression
()
+
")"
,
CollectionUtils
.
listEntry
(
HELPER_ClientName
.
getForSQL
(
dummyClientName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientName
))).
listEntry
(
HELPER_ClientLogo
.
getForSQL
(
dummyClientLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientLogo
))).
listEntry
(
HELPER_Email
.
getForSQL
(
dummyEmail
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Email
))).
listEntry
(
HELPER_ContactName
.
getForSQL
(
dummyContactName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactName
))).
listEntry
(
HELPER_ContactSurname
.
getForSQL
(
dummyContactSurname
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactSurname
))).
listEntry
(
HELPER_Phone
.
getForSQL
(
dummyPhone
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Phone
))).
listEntry
(
HELPER_State
.
getForSQL
(
dummyState
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_State
))).
listEntry
(
HELPER_Country
.
getForSQL
(
dummyCountry
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Country
))).
listEntry
(
HELPER_PostCode
.
getForSQL
(
dummyPostCode
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_PostCode
)))
.
listEntry
(
SQLManager
.
CheckNull
((
Long
)(
tl_clientPSet
.
getAttrib
(
Client
.
SINGLEREFERENCE_Company
))))
.
listEntry
(
objectID
.
longID
()).
toList
().
toArray
());
CollectionUtils
.
listEntry
(
HELPER_ClientName
.
getForSQL
(
dummyClientName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientName
))).
listEntry
(
HELPER_ClientLogo
.
getForSQL
(
dummyClientLogo
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ClientLogo
))).
listEntry
(
HELPER_Email
.
getForSQL
(
dummyEmail
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Email
))).
listEntry
(
HELPER_ContactName
.
getForSQL
(
dummyContactName
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactName
))).
listEntry
(
HELPER_ContactSurname
.
getForSQL
(
dummyContactSurname
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_ContactSurname
))).
listEntry
(
HELPER_Phone
.
getForSQL
(
dummyPhone
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Phone
))).
listEntry
(
HELPER_State
.
getForSQL
(
dummyState
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_State
))).
listEntry
(
HELPER_Country
.
getForSQL
(
dummyCountry
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_Country
))).
listEntry
(
HELPER_PostCode
.
getForSQL
(
dummyPostCode
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_PostCode
)))
.
listEntry
(
HELPER_City
.
getForSQL
(
dummyCity
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_City
))).
listEntry
(
HELPER_TimeZone
.
getForSQL
(
dummyTimeZone
,
tl_clientPSet
.
getAttrib
(
Client
.
FIELD_TimeZone
)))
.
listEntry
(
SQLManager
.
CheckNull
((
Long
)(
tl_clientPSet
.
getAttrib
(
Client
.
SINGLEREFERENCE_Company
))))
.
listEntry
(
objectID
.
longID
()).
toList
().
toArray
());
tl_clientPSet
.
setStatus
(
PersistentSetStatus
.
PROCESSED
);
tl_clientPSet
.
setStatus
(
PersistentSetStatus
.
PROCESSED
);
}
}
...
...
cmsWebApp/webroot/extensions/adminportal/edit_client.jsp
View file @
292bd731
...
@@ -38,46 +38,61 @@
...
@@ -38,46 +38,61 @@
<label class="label-16">Details</label>
<label class="label-16">Details</label>
</div>
</div>
<div class="form-group">
<div class="form-group">
<
oneit:label GUIName="Client Name" /
>
<
label><oneit:label GUIName="Client Name" /></label
>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ClientName" cssClass="form-control" />
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ClientName" cssClass="form-control" />
</div>
</div>
<div class="form-group">
<div class="form-group">
<
oneit:label GUIName="Client Logo" /
>
<
label><oneit:ormlabel obj="<%= client %>" field="ClientLogo" /></label
>
<oneit:ormInput obj="<%= client %>" type="file" attributeName="ClientLogo" accept="image/*"/>
<oneit:ormInput obj="<%= client %>" type="file" attributeName="ClientLogo" accept="image/*"/>
</div>
</div>
<div class="form-brack-line-sub"></div>
<div class="form-brack-line-sub"></div>
<div class="form-group">
<div class="form-group">
<label><oneit:
label GUIName="Contact Email Address
" /></label>
<label><oneit:
ormlabel obj="<%= client %>" field="Email
" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="Email" cssClass="form-control" />
<oneit:ormInput obj="<%= client %>" type="text" attributeName="Email" cssClass="form-control" />
</div>
</div>
<div class="form-group row">
<div class="form-group row">
<div class="col-md-6">
<div class="col-md-6">
<label><oneit:label GUIName="Contact First
Name" /></label>
<label><oneit:ormlabel obj="<%= client %>" field="Contact
Name" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ContactName" cssClass="form-control" />
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ContactName" cssClass="form-control" />
</div>
</div>
<div class="col-md-6">
<div class="col-md-6">
<label><oneit:label GUIName="Contact Last N
ame" /></label>
<label><oneit:ormlabel obj="<%= client %>" field="ContactSurn
ame" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ContactSurname" cssClass="form-control" />
<oneit:ormInput obj="<%= client %>" type="text" attributeName="ContactSurname" cssClass="form-control" />
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label><oneit:
label GUIName="Contact Phone Number
" /></label>
<label><oneit:
ormlabel obj="<%= client %>" field="Phone
" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="Phone" cssClass="form-control" />
<oneit:ormInput obj="<%= client %>" type="text" attributeName="Phone" cssClass="form-control" />
</div>
</div>
<div class="form-brack-line-sub"></div>
<div class="form-group row">
<div class="form-group row">
<div class="col-md-4">
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>"
field="Country" /></label>
<label><oneit:ormlabel obj="<%= client %>" field="Country" /></label>
<oneit:ormEnum obj="<%= client %>" attributeName="Country" cssClass="form-control"/>
<oneit:ormEnum obj="<%= client %>" attributeName="Country" cssClass="form-control"/>
</div>
</div>
<div class="col-md-4">
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>"
field="State" /></label>
<label><oneit:ormlabel obj="<%= client %>" field="State" /></label>
<oneit:ormEnum obj="<%= client %>"
attributeName="State" cssClass="form-control"/>
<oneit:ormEnum obj="<%= client %>" attributeName="State" cssClass="form-control"/>
</div>
</div>
<div class="col-md-4">
<div class="col-md-4">
<label><oneit:ormlabel obj="<%= client %>" field="PostCode" /></label>
<label><oneit:ormlabel obj="<%= client %>" field="PostCode" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="PostCode" cssClass="form-control" />
<oneit:ormInput obj="<%= client %>" type="text" attributeName="PostCode" cssClass="form-control" />
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= client %>" field="City" /></label>
<oneit:ormInput obj="<%= client %>" type="text" attributeName="City" cssClass="form-control" />
</div>
<div class="col-md-6">
<label><oneit:ormlabel obj="<%= client %>" field="TimeZone"/></label>
<oneit:ormEnum obj="<%= client %>" attributeName="TimeZone" cssClass="form-control"/>
</div>
</div>
</div>
</div>
<div class="text-center form-group">
<div class="text-center form-group">
<oneit:button value="Save Updates" name="save" cssClass="btn btn-primary largeBtn"
<oneit:button value="Save Updates" name="save" cssClass="btn btn-primary largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
...
...
cmsWebApp/webroot/extensions/adminportal/messages/fieldnamesOverride.txt
View file @
292bd731
...
@@ -16,4 +16,14 @@ AssessmentCriteriaTemplate.TemplateName = Template Name
...
@@ -16,4 +16,14 @@ AssessmentCriteriaTemplate.TemplateName = Template Name
CultureCriteriaTemplate.TemplateName = Template Name
CultureCriteriaTemplate.TemplateName = Template Name
Client.TimeZone = Time Zone
Client.PostCode = Postal Code
Client.Phone = Contact Phone Number
Client.Email = Contact Email Address
Client.ContactName = Contact First Name
Client.ContactSurname = Contact Last Name
Client.ClientLogo = Client Logo
Client.State = State or Province
Company.TimeZone =
Company.HasClientSupport = We help clients with hiring
Company.HasClientSupport = We help clients with hiring
\ No newline at end of file
cmsWebApp/webroot/extensions/performa/upgrades/20170908_Alter_Client.xml
0 → 100644
View file @
292bd731
<?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_client
</tableName>
<column
name=
"city"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"time_zone"
type=
"String"
nullable=
"true"
length=
"200"
/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment