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
de24c42a
Commit
de24c42a
authored
Sep 01, 2017
by
Nilu
Committed by
Harsh Shah
Sep 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All Clients HT010
parent
72df3ae8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
446 additions
and
17 deletions
+446
-17
Job.xml
cmsWebApp/sql/Job.xml
+3
-0
Job.sql
cmsWebApp/sql/ms/Job.sql
+3
-2
Job.sql
cmsWebApp/sql/oracle/Job.sql
+3
-2
Job.sql
cmsWebApp/sql/postgres/Job.sql
+3
-2
BaseClient.java
cmsWebApp/src/performa/orm/BaseClient.java
+0
-0
BaseJob.java
cmsWebApp/src/performa/orm/BaseJob.java
+34
-4
Client.java
cmsWebApp/src/performa/orm/Client.java
+12
-0
Client.xml
cmsWebApp/src/performa/orm/Client.xml
+3
-1
ClientPersistenceMgr.java
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
+1
-1
Job.xml
cmsWebApp/src/performa/orm/Job.xml
+1
-1
JobPersistenceMgr.java
cmsWebApp/src/performa/orm/JobPersistenceMgr.java
+10
-0
ClientSortOption.java
cmsWebApp/src/performa/orm/types/ClientSortOption.java
+143
-0
ClientSortOption.xml
cmsWebApp/src/performa/orm/types/ClientSortOption.xml
+13
-0
Utils.java
cmsWebApp/src/performa/utils/Utils.java
+57
-0
WebUtils.java
cmsWebApp/src/performa/utils/WebUtils.java
+1
-0
common.css
cmsWebApp/webroot/css/common.css
+52
-2
GeneralConfig_adminPortal.xml
...root/extensions/adminportal/GeneralConfig_adminPortal.xml
+2
-1
edit_client.jsp
cmsWebApp/webroot/extensions/adminportal/edit_client.jsp
+7
-0
list_clients.jsp
cmsWebApp/webroot/extensions/adminportal/list_clients.jsp
+98
-1
No files found.
cmsWebApp/sql/Job.xml
View file @
de24c42a
...
@@ -27,5 +27,7 @@
...
@@ -27,5 +27,7 @@
<column
name=
"client_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"client_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"company_user_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"company_user_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
</NODE>
</NODE>
<NODE
name=
"INDEX"
factory=
"Participant"
class=
"oneit.sql.transfer.DefineIndexOperation"
tableName=
"tl_job"
indexName=
"idx_tl_job_client_id"
isUnique=
"false"
><column
name=
"client_id"
/></NODE>
</NODE></OBJECTS>
</NODE></OBJECTS>
\ No newline at end of file
cmsWebApp/sql/ms/Job.sql
View file @
de24c42a
...
@@ -37,4 +37,6 @@ ALTER TABLE tl_job ADD
...
@@ -37,4 +37,6 @@ ALTER TABLE tl_job ADD
)
;
)
;
\ No newline at end of file
CREATE
INDEX
idx_tl_job_client_id
ON
tl_job
(
client_id
);
cmsWebApp/sql/oracle/Job.sql
View file @
de24c42a
...
@@ -38,4 +38,6 @@ ALTER TABLE tl_job ADD
...
@@ -38,4 +38,6 @@ ALTER TABLE tl_job ADD
)
;
)
;
\ No newline at end of file
CREATE
INDEX
idx_tl_job_client_id
ON
tl_job
(
client_id
);
cmsWebApp/sql/postgres/Job.sql
View file @
de24c42a
...
@@ -38,4 +38,6 @@ ALTER TABLE tl_job ADD
...
@@ -38,4 +38,6 @@ ALTER TABLE tl_job ADD
)
;
)
;
\ No newline at end of file
CREATE
INDEX
idx_tl_job_client_id
ON
tl_job
(
client_id
);
cmsWebApp/src/performa/orm/BaseClient.java
View file @
de24c42a
This diff is collapsed.
Click to expand it.
cmsWebApp/src/performa/orm/BaseJob.java
View file @
de24c42a
...
@@ -76,6 +76,7 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -76,6 +76,7 @@ public abstract class BaseJob extends BaseBusinessClass
public
static
final
String
SINGLEREFERENCE_JobTemplate
=
"JobTemplate"
;
public
static
final
String
SINGLEREFERENCE_JobTemplate
=
"JobTemplate"
;
public
static
final
String
SINGLEREFERENCE_Level
=
"Level"
;
public
static
final
String
SINGLEREFERENCE_Level
=
"Level"
;
public
static
final
String
SINGLEREFERENCE_Client
=
"Client"
;
public
static
final
String
SINGLEREFERENCE_Client
=
"Client"
;
public
static
final
String
BACKREF_Client
=
""
;
public
static
final
String
SINGLEREFERENCE_CompanyUser
=
"CompanyUser"
;
public
static
final
String
SINGLEREFERENCE_CompanyUser
=
"CompanyUser"
;
public
static
final
String
MULTIPLEREFERENCE_JobApplications
=
"JobApplications"
;
public
static
final
String
MULTIPLEREFERENCE_JobApplications
=
"JobApplications"
;
public
static
final
String
BACKREF_JobApplications
=
""
;
public
static
final
String
BACKREF_JobApplications
=
""
;
...
@@ -208,6 +209,7 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -208,6 +209,7 @@ public abstract class BaseJob extends BaseBusinessClass
String
tmp_JobApplications
=
JobApplication
.
BACKREF_Job
;
String
tmp_JobApplications
=
JobApplication
.
BACKREF_Job
;
String
tmp_AssessmentCriterias
=
AssessmentCriteria
.
BACKREF_Job
;
String
tmp_AssessmentCriterias
=
AssessmentCriteria
.
BACKREF_Job
;
String
tmp_CultureCriterias
=
CultureCriteria
.
BACKREF_Job
;
String
tmp_CultureCriterias
=
CultureCriteria
.
BACKREF_Job
;
String
tmp_Client
=
Client
.
BACKREF_Jobs
;
Map
validatorMapping
=
((
Map
)
ConfigMgr
.
getConfigObject
(
"CONFIG.ORMVALIDATOR"
,
"ValidatorMapping"
));
Map
validatorMapping
=
((
Map
)
ConfigMgr
.
getConfigObject
(
"CONFIG.ORMVALIDATOR"
,
"ValidatorMapping"
));
...
@@ -362,6 +364,7 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -362,6 +364,7 @@ public abstract class BaseJob extends BaseBusinessClass
{
{
Map
metaInfo
=
new
HashMap
();
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"backreferenceName"
,
"Jobs"
);
metaInfo
.
put
(
"dbcol"
,
"client_id"
);
metaInfo
.
put
(
"dbcol"
,
"client_id"
);
metaInfo
.
put
(
"name"
,
"Client"
);
metaInfo
.
put
(
"name"
,
"Client"
);
metaInfo
.
put
(
"type"
,
"Client"
);
metaInfo
.
put
(
"type"
,
"Client"
);
...
@@ -954,7 +957,7 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -954,7 +957,7 @@ public abstract class BaseJob extends BaseBusinessClass
_CultureTemplate
=
new
SingleAssociation
<
Job
,
CultureCriteriaTemplate
>
(
this
,
SINGLEREFERENCE_CultureTemplate
,
null
,
CultureCriteriaTemplate
.
REFERENCE_CultureCriteriaTemplate
,
""
);
_CultureTemplate
=
new
SingleAssociation
<
Job
,
CultureCriteriaTemplate
>
(
this
,
SINGLEREFERENCE_CultureTemplate
,
null
,
CultureCriteriaTemplate
.
REFERENCE_CultureCriteriaTemplate
,
""
);
_JobTemplate
=
new
SingleAssociation
<
Job
,
Job
>
(
this
,
SINGLEREFERENCE_JobTemplate
,
null
,
Job
.
REFERENCE_Job
,
""
);
_JobTemplate
=
new
SingleAssociation
<
Job
,
Job
>
(
this
,
SINGLEREFERENCE_JobTemplate
,
null
,
Job
.
REFERENCE_Job
,
""
);
_Level
=
new
SingleAssociation
<
Job
,
Level
>
(
this
,
SINGLEREFERENCE_Level
,
null
,
Level
.
REFERENCE_Level
,
"tl_job"
);
_Level
=
new
SingleAssociation
<
Job
,
Level
>
(
this
,
SINGLEREFERENCE_Level
,
null
,
Level
.
REFERENCE_Level
,
"tl_job"
);
_Client
=
new
SingleAssociation
<
Job
,
Client
>
(
this
,
SINGLEREFERENCE_Client
,
null
,
Client
.
REFERENCE_Client
,
"tl_job"
);
_Client
=
new
SingleAssociation
<
Job
,
Client
>
(
this
,
SINGLEREFERENCE_Client
,
Client
.
MULTIPLEREFERENCE_Jobs
,
Client
.
REFERENCE_Client
,
"tl_job"
);
_CompanyUser
=
new
SingleAssociation
<
Job
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_CompanyUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_job"
);
_CompanyUser
=
new
SingleAssociation
<
Job
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_CompanyUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_job"
);
_JobApplications
=
new
MultipleAssociation
<
Job
,
JobApplication
>
(
this
,
MULTIPLEREFERENCE_JobApplications
,
JobApplication
.
SINGLEREFERENCE_Job
,
JobApplication
.
REFERENCE_JobApplication
);
_JobApplications
=
new
MultipleAssociation
<
Job
,
JobApplication
>
(
this
,
MULTIPLEREFERENCE_JobApplications
,
JobApplication
.
SINGLEREFERENCE_Job
,
JobApplication
.
REFERENCE_JobApplication
);
_AssessmentCriterias
=
new
MultipleAssociation
<
Job
,
AssessmentCriteria
>
(
this
,
MULTIPLEREFERENCE_AssessmentCriterias
,
AssessmentCriteria
.
SINGLEREFERENCE_Job
,
AssessmentCriteria
.
REFERENCE_AssessmentCriteria
);
_AssessmentCriterias
=
new
MultipleAssociation
<
Job
,
AssessmentCriteria
>
(
this
,
MULTIPLEREFERENCE_AssessmentCriterias
,
AssessmentCriteria
.
SINGLEREFERENCE_Job
,
AssessmentCriteria
.
REFERENCE_AssessmentCriteria
);
...
@@ -972,7 +975,7 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -972,7 +975,7 @@ public abstract class BaseJob extends BaseBusinessClass
_CultureTemplate
=
new
SingleAssociation
<
Job
,
CultureCriteriaTemplate
>
(
this
,
SINGLEREFERENCE_CultureTemplate
,
null
,
CultureCriteriaTemplate
.
REFERENCE_CultureCriteriaTemplate
,
""
);
_CultureTemplate
=
new
SingleAssociation
<
Job
,
CultureCriteriaTemplate
>
(
this
,
SINGLEREFERENCE_CultureTemplate
,
null
,
CultureCriteriaTemplate
.
REFERENCE_CultureCriteriaTemplate
,
""
);
_JobTemplate
=
new
SingleAssociation
<
Job
,
Job
>
(
this
,
SINGLEREFERENCE_JobTemplate
,
null
,
Job
.
REFERENCE_Job
,
""
);
_JobTemplate
=
new
SingleAssociation
<
Job
,
Job
>
(
this
,
SINGLEREFERENCE_JobTemplate
,
null
,
Job
.
REFERENCE_Job
,
""
);
_Level
=
new
SingleAssociation
<
Job
,
Level
>
(
this
,
SINGLEREFERENCE_Level
,
null
,
Level
.
REFERENCE_Level
,
"tl_job"
);
_Level
=
new
SingleAssociation
<
Job
,
Level
>
(
this
,
SINGLEREFERENCE_Level
,
null
,
Level
.
REFERENCE_Level
,
"tl_job"
);
_Client
=
new
SingleAssociation
<
Job
,
Client
>
(
this
,
SINGLEREFERENCE_Client
,
null
,
Client
.
REFERENCE_Client
,
"tl_job"
);
_Client
=
new
SingleAssociation
<
Job
,
Client
>
(
this
,
SINGLEREFERENCE_Client
,
Client
.
MULTIPLEREFERENCE_Jobs
,
Client
.
REFERENCE_Client
,
"tl_job"
);
_CompanyUser
=
new
SingleAssociation
<
Job
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_CompanyUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_job"
);
_CompanyUser
=
new
SingleAssociation
<
Job
,
CompanyUser
>
(
this
,
SINGLEREFERENCE_CompanyUser
,
null
,
CompanyUser
.
REFERENCE_CompanyUser
,
"tl_job"
);
_JobApplications
=
new
MultipleAssociation
<
Job
,
JobApplication
>
(
this
,
MULTIPLEREFERENCE_JobApplications
,
JobApplication
.
SINGLEREFERENCE_Job
,
JobApplication
.
REFERENCE_JobApplication
);
_JobApplications
=
new
MultipleAssociation
<
Job
,
JobApplication
>
(
this
,
MULTIPLEREFERENCE_JobApplications
,
JobApplication
.
SINGLEREFERENCE_Job
,
JobApplication
.
REFERENCE_JobApplication
);
_AssessmentCriterias
=
new
MultipleAssociation
<
Job
,
AssessmentCriteria
>
(
this
,
MULTIPLEREFERENCE_AssessmentCriterias
,
AssessmentCriteria
.
SINGLEREFERENCE_Job
,
AssessmentCriteria
.
REFERENCE_AssessmentCriteria
);
_AssessmentCriterias
=
new
MultipleAssociation
<
Job
,
AssessmentCriteria
>
(
this
,
MULTIPLEREFERENCE_AssessmentCriterias
,
AssessmentCriteria
.
SINGLEREFERENCE_Job
,
AssessmentCriteria
.
REFERENCE_AssessmentCriteria
);
...
@@ -3706,7 +3709,7 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -3706,7 +3709,7 @@ public abstract class BaseJob extends BaseBusinessClass
return
null
;
return
null
;
}
else
if
(
assocName
.
equals
(
SINGLEREFERENCE_Client
))
}
else
if
(
assocName
.
equals
(
SINGLEREFERENCE_Client
))
{
{
return
null
;
return
Client
.
MULTIPLEREFERENCE_Jobs
;
}
else
if
(
assocName
.
equals
(
SINGLEREFERENCE_CompanyUser
))
}
else
if
(
assocName
.
equals
(
SINGLEREFERENCE_CompanyUser
))
{
{
return
null
;
return
null
;
...
@@ -4311,8 +4314,21 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -4311,8 +4314,21 @@ public abstract class BaseJob extends BaseBusinessClass
assertValid
();
assertValid
();
Debug
.
assertion
(
getWriteability_Client
()
!=
FieldWriteability
.
FALSE
,
"Assoc Client is not writeable"
);
Debug
.
assertion
(
getWriteability_Client
()
!=
FieldWriteability
.
FALSE
,
"Assoc Client is not writeable"
);
preClientChange
(
newClient
);
preClientChange
(
newClient
);
Client
oldClient
=
getClient
();
if
(
oldClient
!=
null
)
{
// This is to stop validation from triggering when we are removed
_Client
.
set
(
null
);
oldClient
.
removeFromJobs
((
Job
)(
this
));
}
_Client
.
set
(
newClient
);
_Client
.
set
(
newClient
);
if
(
newClient
!=
null
)
{
newClient
.
addToJobs
((
Job
)(
this
));
}
postClientChange
();
postClientChange
();
}
}
...
@@ -4858,6 +4874,20 @@ public abstract class BaseJob extends BaseBusinessClass
...
@@ -4858,6 +4874,20 @@ public abstract class BaseJob extends BaseBusinessClass
{
{
try
try
{
{
// Ensure we are removed from any loaded multi-associations that aren't mandatory
if
(
_Client
.
isLoaded
()
||
getTransaction
().
isObjectLoaded
(
_Client
.
getReferencedType
(),
getClientID
()))
{
Client
referenced
=
getClient
();
if
(
referenced
!=
null
)
{
// Stop the callback
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Setting backreference to null Jobs from "
,
getObjectID
(),
" to "
,
referenced
.
getObjectID
());
_Client
.
set
(
null
);
referenced
.
removeFromJobs
((
Job
)
this
);
}
}
for
(
JobApplication
referenced
:
CollectionUtils
.
reverse
(
getJobApplicationsSet
()))
for
(
JobApplication
referenced
:
CollectionUtils
.
reverse
(
getJobApplicationsSet
()))
{
{
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Setting backreference to null Job from "
,
getObjectID
(),
" to "
,
referenced
.
getObjectID
());
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Setting backreference to null Job from "
,
getObjectID
(),
" to "
,
referenced
.
getObjectID
());
...
...
cmsWebApp/src/performa/orm/Client.java
View file @
de24c42a
package
performa
.
orm
;
package
performa
.
orm
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.utils.filter.Filter
;
import
performa.orm.types.JobStatus
;
public
class
Client
extends
BaseClient
public
class
Client
extends
BaseClient
{
{
...
@@ -10,4 +14,11 @@ public class Client extends BaseClient
...
@@ -10,4 +14,11 @@ public class Client extends BaseClient
{
{
// Do not add any code to this, always put it in initialiseNewObject
// Do not add any code to this, always put it in initialiseNewObject
}
}
public
int
getApplicationCountByStatus
(
JobStatus
jobStatus
)
{
Filter
<
Job
>
filter
=
Job
.
SearchByAll
().
andJobStatus
(
new
EqualsFilter
<>(
jobStatus
));
return
pipesClient
().
toJobs
(
filter
).
toJobApplications
().
uniqueVals
().
size
();
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/Client.xml
View file @
de24c42a
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
<IMPORT
value=
"performa.orm.types.*"
/>
<IMPORT
value=
"performa.orm.types.*"
/>
<IMPORT
value=
"oneit.business.shopping.orm.*"
/>
<IMPORT
value=
"oneit.business.shopping.orm.*"
/>
<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"
/>
...
@@ -24,7 +26,7 @@
...
@@ -24,7 +26,7 @@
</TABLE>
</TABLE>
<SEARCH
type=
"All"
paramFilter=
"tl_client.object_id is not null"
>
<SEARCH
type=
"All"
paramFilter=
"tl_client.object_id is not null"
orderBy=
"tl_client.object_id"
>
</SEARCH>
</SEARCH>
</BUSINESSCLASS>
</BUSINESSCLASS>
...
...
cmsWebApp/src/performa/orm/ClientPersistenceMgr.java
View file @
de24c42a
...
@@ -418,7 +418,7 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
...
@@ -418,7 +418,7 @@ public class ClientPersistenceMgr extends ObjectPersistenceMgr
String
orderBy
=
" "
;
String
orderBy
=
"
ORDER BY tl_client.object_id
"
;
String
tables
=
" "
;
String
tables
=
" "
;
Set
<
String
>
joinTableSet
=
new
HashSet
<
String
>();
Set
<
String
>
joinTableSet
=
new
HashSet
<
String
>();
String
filter
;
String
filter
;
...
...
cmsWebApp/src/performa/orm/Job.xml
View file @
de24c42a
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<ATTRIB
name=
"Country"
type=
"Countries"
dbcol=
"country"
defaultValue=
"Countries.AU"
attribHelper=
"EnumeratedAttributeHelper"
/>
<ATTRIB
name=
"Country"
type=
"Countries"
dbcol=
"country"
defaultValue=
"Countries.AU"
attribHelper=
"EnumeratedAttributeHelper"
/>
<SINGLEREFERENCE
name=
"Level"
type=
"Level"
dbcol=
"level_id"
mandatory=
"true"
/>
<SINGLEREFERENCE
name=
"Level"
type=
"Level"
dbcol=
"level_id"
mandatory=
"true"
/>
<SINGLEREFERENCE
name=
"Client"
type=
"Client"
dbcol=
"client_id"
/>
<SINGLEREFERENCE
name=
"Client"
type=
"Client"
dbcol=
"client_id"
backreferenceName=
"Jobs"
/>
<SINGLEREFERENCE
name=
"CompanyUser"
type=
"CompanyUser"
dbcol=
"company_user_id"
/>
<SINGLEREFERENCE
name=
"CompanyUser"
type=
"CompanyUser"
dbcol=
"company_user_id"
/>
</TABLE>
</TABLE>
...
...
cmsWebApp/src/performa/orm/JobPersistenceMgr.java
View file @
de24c42a
...
@@ -200,6 +200,16 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
...
@@ -200,6 +200,16 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{
{
throw
new
RuntimeException
();
throw
new
RuntimeException
();
}
}
else
if
(
refName
.
equals
(
Job
.
SINGLEREFERENCE_Client
))
{
String
query
=
"SELECT "
+
SELECT_COLUMNS
+
"FROM {PREFIX}tl_job "
+
"WHERE "
+
SELECT_JOINS
+
"client_id = ?"
;
BaseBusinessClass
[]
results
=
loadQuery
(
allPSets
,
sqlMgr
,
context
,
query
,
new
Object
[]
{
_objectID
.
longID
()
},
null
,
false
);
return
results
;
}
else
else
{
{
throw
new
IllegalArgumentException
(
"Illegal reference type:"
+
refName
);
throw
new
IllegalArgumentException
(
"Illegal reference type:"
+
refName
);
...
...
cmsWebApp/src/performa/orm/types/ClientSortOption.java
0 → 100644
View file @
de24c42a
package
performa
.
orm
.
types
;
import
java.util.*
;
import
oneit.utils.*
;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public
class
ClientSortOption
extends
AbstractEnumerated
{
public
static
final
EnumeratedFactory
FACTORY_ClientSortOption
=
new
ClientSortOptionFactory
();
public
static
final
ClientSortOption
ALPHA_A_Z
=
new
ClientSortOption
(
"ALPHA_A_Z"
,
"ALPHA_A_Z"
,
"A-Z"
,
false
);
public
static
final
ClientSortOption
ALPHA_Z_A
=
new
ClientSortOption
(
"ALPHA_Z_A"
,
"ALPHA_Z_A"
,
"Z-A"
,
false
);
public
static
final
ClientSortOption
OPEN_JOBS
=
new
ClientSortOption
(
"OPEN_JOBS"
,
"OPEN_JOBS"
,
"Open Jobs"
,
false
);
public
static
final
ClientSortOption
FILLED_JOBS
=
new
ClientSortOption
(
"FILLED_JOBS"
,
"FILLED_JOBS"
,
"Filled Jobs"
,
false
);
private
static
final
ClientSortOption
[]
allClientSortOptions
=
new
ClientSortOption
[]
{
ALPHA_A_Z
,
ALPHA_Z_A
,
OPEN_JOBS
,
FILLED_JOBS
};
private
static
ClientSortOption
[]
getAllClientSortOptions
()
{
return
allClientSortOptions
;
}
private
ClientSortOption
(
String
name
,
String
value
,
String
description
,
boolean
disabled
)
{
super
(
name
,
value
,
description
,
disabled
);
}
public
static
final
Comparator
COMPARE_BY_POSITION
=
new
CompareEnumByPosition
(
allClientSortOptions
);
static
{
defineAdditionalData
();
}
public
boolean
isEqual
(
ClientSortOption
other
)
{
return
this
.
name
.
equals
(
other
.
name
);
}
public
Enumeration
getAllInstances
()
{
return
ClientSortOption
.
getAll
();
}
private
Object
readResolve
()
throws
java
.
io
.
ObjectStreamException
{
return
ClientSortOption
.
forName
(
this
.
name
);
}
public
EnumeratedFactory
getFactory
()
{
return
FACTORY_ClientSortOption
;
}
public
static
ClientSortOption
forName
(
String
name
)
{
if
(
name
==
null
)
{
return
null
;
}
ClientSortOption
[]
all
=
getAllClientSortOptions
();
int
enumIndex
=
AbstractEnumerated
.
getIndexForName
(
all
,
name
);
return
all
[
enumIndex
];
}
public
static
ClientSortOption
forValue
(
String
value
)
{
if
(
value
==
null
)
{
return
null
;
}
ClientSortOption
[]
all
=
getAllClientSortOptions
();
int
enumIndex
=
AbstractEnumerated
.
getIndexForValue
(
getAllClientSortOptions
(),
value
);
return
all
[
enumIndex
];
}
public
static
java
.
util
.
Enumeration
getAll
()
{
return
AbstractEnumerated
.
getAll
(
getAllClientSortOptions
());
}
public
static
ClientSortOption
[]
getClientSortOptionArray
()
{
return
(
ClientSortOption
[])
getAllClientSortOptions
().
clone
();
}
public
static
void
defineAdditionalData
()
{
}
static
class
ClientSortOptionFactory
implements
EnumeratedFactory
{
public
AbstractEnumerated
getForName
(
String
name
)
{
return
ClientSortOption
.
forName
(
name
);
}
public
AbstractEnumerated
getForValue
(
String
name
)
{
return
ClientSortOption
.
forValue
(
name
);
}
public
Enumeration
getAll
()
{
return
ClientSortOption
.
getAll
();
}
}
public
Map
getAdditionalAttributes
()
{
Map
attribs
=
new
HashMap
();
return
attribs
;
}
}
cmsWebApp/src/performa/orm/types/ClientSortOption.xml
0 → 100644
View file @
de24c42a
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT
package=
"performa.orm.types"
name=
"ClientSortOption"
>
<VALUE
name=
"ALPHA_A_Z"
value=
"ALPHA_A_Z"
description=
"A-Z"
/>
<VALUE
name=
"ALPHA_Z_A"
value=
"ALPHA_Z_A"
description=
"Z-A"
/>
<VALUE
name=
"OPEN_JOBS"
value=
"OPEN_JOBS"
description=
"Open Jobs"
/>
<VALUE
name=
"FILLED_JOBS"
value=
"FILLED_JOBS"
description=
"Filled Jobs"
/>
</CONSTANT>
</ROOT>
\ No newline at end of file
cmsWebApp/src/performa/utils/Utils.java
View file @
de24c42a
...
@@ -33,6 +33,7 @@ import oneit.utils.transform.param.ErrorTransform;
...
@@ -33,6 +33,7 @@ import oneit.utils.transform.param.ErrorTransform;
import
oneit.utils.transform.param.ORMTransform
;
import
oneit.utils.transform.param.ORMTransform
;
import
oneit.utils.transform.param.PrefixCompoundTransform
;
import
oneit.utils.transform.param.PrefixCompoundTransform
;
import
performa.orm.types.AppSortOption
;
import
performa.orm.types.AppSortOption
;
import
performa.orm.types.ClientSortOption
;
import
performa.orm.types.JobStatus
;
import
performa.orm.types.JobStatus
;
/**
/**
...
@@ -149,6 +150,62 @@ public class Utils
...
@@ -149,6 +150,62 @@ public class Utils
new
Comparator
[]{
comparator
});
new
Comparator
[]{
comparator
});
}
}
public
static
List
<
Client
>
getClientsSorted
(
Client
[]
clients
,
ClientSortOption
clientSortOption
)
{
ObjectTransform
transform
=
Client
.
pipesClient
().
toObjectCreated
();
Comparator
comparator
=
CollectionUtils
.
DEFAULT_COMPARATOR
;
if
(
clientSortOption
==
ClientSortOption
.
ALPHA_A_Z
)
{
transform
=
Client
.
pipesClient
().
toClientName
();
comparator
=
CollectionUtils
.
CASE_INSENSITIVE_COMPARATOR
;
}
else
if
(
clientSortOption
==
ClientSortOption
.
ALPHA_Z_A
)
{
transform
=
Client
.
pipesClient
().
toClientName
();
comparator
=
CollectionUtils
.
reverse
(
CollectionUtils
.
CASE_INSENSITIVE_COMPARATOR
);
}
else
if
(
clientSortOption
==
ClientSortOption
.
OPEN_JOBS
)
{
transform
=
ClientToOpenJobCountTransform
.
INSTANCE
;
comparator
=
CollectionUtils
.
reverse
(
CollectionUtils
.
DEFAULT_COMPARATOR
);
}
else
if
(
clientSortOption
==
ClientSortOption
.
FILLED_JOBS
)
{
transform
=
ClientToFilledJobCountTransform
.
INSTANCE
;
comparator
=
CollectionUtils
.
reverse
(
CollectionUtils
.
DEFAULT_COMPARATOR
);
}
return
ObjstoreUtils
.
sort
(
Arrays
.
asList
(
clients
),
new
ObjectTransform
[]{
transform
},
new
Comparator
[]{
comparator
});
}
public
static
class
ClientToOpenJobCountTransform
implements
ObjectTransform
<
Client
,
Integer
>
{
public
static
ClientToOpenJobCountTransform
INSTANCE
=
new
ClientToOpenJobCountTransform
();
@Override
public
Integer
transform
(
Client
client
)
{
return
client
.
getApplicationCountByStatus
(
JobStatus
.
OPEN
);
}
}
public
static
class
ClientToFilledJobCountTransform
implements
ObjectTransform
<
Client
,
Integer
>
{
public
static
ClientToFilledJobCountTransform
INSTANCE
=
new
ClientToFilledJobCountTransform
();
@Override
public
Integer
transform
(
Client
client
)
{
return
client
.
getApplicationCountByStatus
(
JobStatus
.
FILLED
);
}
}
public
static
int
getClosingSoonJobCount
(
Job
[]
jobs
)
public
static
int
getClosingSoonJobCount
(
Job
[]
jobs
)
{
{
...
...
cmsWebApp/src/performa/utils/WebUtils.java
View file @
de24c42a
...
@@ -30,6 +30,7 @@ public class WebUtils
...
@@ -30,6 +30,7 @@ public class WebUtils
public
static
final
String
JOBS
=
"Jobs"
;
public
static
final
String
JOBS
=
"Jobs"
;
public
static
final
String
CANDIDATES
=
"Candidates"
;
public
static
final
String
CANDIDATES
=
"Candidates"
;
public
static
final
String
CLIENTS
=
"Clients"
;
public
static
final
String
CLIENTS
=
"Clients"
;
public
static
final
String
EDIT_CLIENT
=
"EditClient"
;
public
static
final
String
MANAGE_USERS
=
"ManageUsers"
;
public
static
final
String
MANAGE_USERS
=
"ManageUsers"
;
public
static
final
String
MY_COMPANY
=
"MyCompany"
;
public
static
final
String
MY_COMPANY
=
"MyCompany"
;
public
static
final
String
BILLING
=
"Billing"
;
public
static
final
String
BILLING
=
"Billing"
;
...
...
cmsWebApp/webroot/css/common.css
View file @
de24c42a
...
@@ -4712,4 +4712,55 @@ label, label .label-title span {
...
@@ -4712,4 +4712,55 @@ label, label .label-title span {
.job-main-tabs
{
.job-main-tabs
{
max-width
:
1300px
;
max-width
:
1300px
;
}
}
\ No newline at end of file
/* Start of Clients HT010 */
.add-client-btn
{
margin-left
:
40px
;
}
.client-list
{
background
:
#fff
none
repeat
scroll
0
0
;
display
:
inline-block
;
width
:
100%
;
box-shadow
:
0
2px
3px
0
rgba
(
0
,
0
,
0
,
0.02
);
margin-bottom
:
10px
;
height
:
80px
;
}
.application-count
{
width
:
10%
;
padding
:
11px
15px
17px
50px
;
border-right
:
solid
1px
rgba
(
229
,
232
,
235
,
0.5
);
color
:
#7d7f82
;
font-size
:
30px
;
font-weight
:
300
;
font-family
:
"Usual-Light"
;
}
.application-count
.grey-span
{
letter-spacing
:
1px
;
color
:
#8e97a0
;
font-size
:
11px
;
font-weight
:
500
;
width
:
100%
;
float
:
left
;
font-family
:
"Usual-Medium"
;
text-transform
:
uppercase
;
}
.client-name-cell
{
width
:
60%
;
padding-left
:
39px
;
padding-top
:
25px
;
padding-bottom
:
25px
;
border-right
:
solid
1px
rgba
(
229
,
232
,
235
,
0.5
);
color
:
#1a2531
;
}
.client-name
{
text-align
:
left
;
font-size
:
20px
;
}
/* End of Clients HT010 */
cmsWebApp/webroot/extensions/adminportal/GeneralConfig_adminPortal.xml
View file @
de24c42a
...
@@ -55,7 +55,8 @@
...
@@ -55,7 +55,8 @@
<NODE
name=
"Config"
factory=
"Participant"
class=
"oneit.business.content.ArticleConfiguration"
>
<NODE
name=
"Config"
factory=
"Participant"
class=
"oneit.business.content.ArticleConfiguration"
>
<INHERITS
nodename=
"StandardJSP"
/>
<INHERITS
nodename=
"StandardJSP"
/>
<RenderMode
name=
"Page"
preIncludeJSP=
"extensions/adminportal/list_clients.jsp"
/>
<RenderMode
name=
"Page"
preIncludeJSP=
"extensions/adminportal/list_clients.jsp"
/>
<RenderMode
name=
"EditClient"
preIncludeJSP=
"extensions/adminportal/edit_client.jsp"
/>
</NODE>
</NODE>
</MAP>
</MAP>
...
...
cmsWebApp/webroot/extensions/adminportal/edit_client.jsp
0 → 100644
View file @
de24c42a
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<oneit:dynIncluded>
</oneit:dynIncluded>
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/list_clients.jsp
View file @
de24c42a
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<oneit:dynIncluded>
</oneit:dynIncluded>
<%
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_CLIENT);
String clientPage = WebUtils.getSamePageInRenderMode(request, "Page");
ClientSortOption clientSortOpt = (ClientSortOption) process.getAttribute("ClientSortOption");
Client[] clients = (Client[]) process.getAttribute("Clients");
if( request.getParameter("ClientSortOption") != null)
{
clientSortOpt = ClientSortOption.forName((String) request.getParameter("ClientSortOption"));
}
if(clientSortOpt == null)
{
clientSortOpt = ClientSortOption.ALPHA_A_Z;
}
if(clients == null)
{
// TODO: add filter to show jobs belongs to logged in company
clients = Client.SearchByAll()
.search(transaction);
process.setAttribute("Clients", clients);
}
List<Client> sortedClients = Utils.getClientsSorted(clients, clientSortOpt);
process.setAttribute("ClientSortOption", clientSortOpt);
%>
<oneit:form name="listClient" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part">
<div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Clients</div>
<oneit:button value="Add Client" name="gotoPage" cssClass="add-more-btn add-client-btn" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>"/>
<div class="shorting-dropdown">
<span class="order-label">order by</span>
<select class="form-control" onChange="location=this.value">
<%
for (ClientSortOption sortOption : ClientSortOption.getClientSortOptionArray())
{
String optionLink = clientPage + "&ClientSortOption=" + sortOption.getName() ;
%>
<option <%= (clientSortOpt != null && clientSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
</div>
<div class="main-client-list">
<%
for(Client client : clients)
{
%>
<div class="client-list" id="<%= client.getID() %>">
<div class="client-row">
<div class="client-name-cell jl-c">
<div class="client-name">
<a href="<%= nextPage+"&ClientID="+client.getObjectID() %>">
<oneit:toString value="<%= client.getClientName() %>" mode="EscapeHTML" />
</a>
</div>
</div>
<div class="application-count jl-c">
<oneit:toString value="<%= client.getApplicationCountByStatus(JobStatus.OPEN) %>" mode="EscapeHTML" nullValue="0"/>
<span class="grey-span">Open</span>
</div>
<div class="application-count jl-c">
<oneit:toString value="<%= client.getApplicationCountByStatus(JobStatus.COMPLETE) %>" mode="EscapeHTML" nullValue="0"/>
<span class="grey-span">Closed</span>
</div>
<div class="application-count jl-c">
<oneit:toString value="<%= client.getApplicationCountByStatus(JobStatus.DRAFT) %>" mode="EscapeHTML" nullValue="0"/>
<span class="grey-span">Filled</span>
</div>
<div class="application-count jl-c">
<oneit:toString value="<%= client.getApplicationCountByStatus(JobStatus.FILLED) %>" mode="EscapeHTML" nullValue="0"/>
<span class="grey-span">Draft</span>
</div>
</div>
</div>
<%
}
%>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ 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