Commit 2451416b by Nilu

changes to accommodate workfflows in HT003

parent 683e0484
......@@ -9,6 +9,7 @@
<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="xxxx" type="CLOB" nullable="true"/>
<column name="xxxx" type="Long" length="11" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -8,7 +8,8 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
xxxx text NULL
xxxx text NULL,
xxxx numeric(12) NULL
);
......
......@@ -9,7 +9,8 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
xxxx clob NULL
xxxx clob NULL,
xxxx number(12) NULL
);
......
......@@ -9,7 +9,8 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
xxxx text NULL
xxxx text NULL,
xxxx numeric(12) NULL
);
......
......@@ -594,29 +594,21 @@ public class Job extends BaseJob
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
}
public WorkFlow getFirstWorkFlow()
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(1));
return pipelineJob().toWorkFlows(filter).val();
}
public WorkFlow getLastWorkFlow()
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(9));
return pipelineJob().toWorkFlows(filter).val();
}
public List<WorkFlow> getSortedMiddleWorkFlows()
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new LessThanFilter<>(9)).andSortOrder(new GreaterThanFilter<>(1));
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new LessThanFilter<>(9)).andSortOrder(new GreaterThanFilter<>(1));
return ObjstoreUtils.sort(pipelineJob().toWorkFlows(filter).uniqueVals(),
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
}
public WorkFlow getWorkFlowBySortOrder(int sortOrder)
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(sortOrder));
return pipelineJob().toWorkFlows(filter).val();
}
}
\ No newline at end of file
......@@ -28,6 +28,8 @@ import oneit.utils.parsers.FieldException;
import oneit.servlets.orm.*;
import performa.orm.*;
public abstract class BaseSearchApplicant extends SearchExecutor
......@@ -41,6 +43,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
// Static constants corresponding to field names
public static final String FIELD_Details = "Details";
public static final String SINGLEREFERENCE_Job = "Job";
// Static constants corresponding to searches
......@@ -54,6 +57,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
// Private attributes corresponding to single references
private SingleAssociation<SearchApplicant, Job> _Job;
// Private attributes corresponding to multiple references
......@@ -77,6 +81,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_Job();
FIELD_Details_Validators = (AttributeValidator[])setupAttribMetaData_Details(validatorMapping).toArray (new AttributeValidator[0]);
......@@ -93,6 +98,20 @@ public abstract class BaseSearchApplicant extends SearchExecutor
// Meta Info setup
private static void setupAssocMetaData_Job()
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "xxxx");
metaInfo.put ("name", "Job");
metaInfo.put ("type", "Job");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SearchApplicant.Job:", metaInfo);
ATTRIBUTES_METADATA_SearchApplicant.put (SINGLEREFERENCE_Job, Collections.unmodifiableMap (metaInfo));
}
// Meta Info setup
private static List setupAttribMetaData_Details(Map validatorMapping)
{
Map metaInfo = new HashMap ();
......@@ -146,6 +165,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
super._initialiseAssociations ();
_Job = new SingleAssociation<SearchApplicant, Job> (this, SINGLEREFERENCE_Job, null, Job.REFERENCE_Job, "it_does_not_matter");
}
......@@ -155,6 +175,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
super.initialiseReference ();
_Job = new SingleAssociation<SearchApplicant, Job> (this, SINGLEREFERENCE_Job, null, Job.REFERENCE_Job, "it_does_not_matter");
return this;
......@@ -270,6 +291,8 @@ public abstract class BaseSearchApplicant extends SearchExecutor
List result = super.getSingleAssocs ();
result.add("Job");
return result;
}
......@@ -281,7 +304,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return _Job.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
......@@ -295,7 +321,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return null ;
}
else
{
return super.getSingleAssocBackReference (assocName);
......@@ -309,7 +338,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return getJob ();
}
else
{
return super.getSingleAssoc (assocName);
......@@ -323,7 +355,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return getJob (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
......@@ -337,7 +372,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
return getJobID ();
}
else
{
return super.getSingleAssocID (assocName);
......@@ -351,7 +389,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_Job))
{
setJob ((Job)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
......@@ -361,6 +402,100 @@ public abstract class BaseSearchApplicant extends SearchExecutor
/**
* Get the reference Job
*/
public Job getJob () throws StorageException
{
assertValid();
try
{
return (Job)(_Job.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in SearchApplicant:", this.getObjectID (), ", was trying to get Job:", getJobID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _Job.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Job getJob (Get getType) throws StorageException
{
assertValid();
return _Job.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobID ()
{
assertValid();
if (_Job == null)
{
return null;
}
else
{
return _Job.getID ();
}
}
/**
* Called prior to the assoc 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 preJobChange (Job newJob) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postJobChange () throws FieldException
{
}
public FieldWriteability getWriteability_Job ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference Job. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setJob (Job newJob) throws StorageException, FieldException
{
if (_Job.wouldReferencedChange (newJob))
{
assertValid();
Debug.assertion (getWriteability_Job () != FieldWriteability.FALSE, "Assoc Job is not writeable");
preJobChange (newJob);
_Job.set (newJob);
postJobChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
......@@ -519,6 +654,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
it_does_not_matterPSet.setAttrib (FIELD_ObjectID, myID);
it_does_not_matterPSet.setAttrib (FIELD_Details, HELPER_Details.toObject (_Details)); //
_Job.getPersistentSets (allSets);
}
......@@ -534,6 +670,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
PersistentSet it_does_not_matterPSet = allSets.getPersistentSet (objectID, "it_does_not_matter");
_Details = (String)(HELPER_Details.fromObject (_Details, it_does_not_matterPSet.getAttrib (FIELD_Details))); //
_Job.setFromPersistentSets (objectID, allSets);
}
......@@ -590,6 +727,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
BaseSearchApplicant sourceSearchApplicant = (BaseSearchApplicant)(source);
_Job.copyFrom (sourceSearchApplicant._Job, linkToGhosts);
}
}
......@@ -627,6 +765,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
super.readExternalData(vals);
_Details = (String)(HELPER_Details.readExternal (_Details, vals.get(FIELD_Details))); //
_Job.readExternalData(vals.get(SINGLEREFERENCE_Job));
}
......@@ -639,6 +778,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
super.writeExternalData(vals);
vals.put (FIELD_Details, HELPER_Details.writeExternal (_Details));
vals.put (SINGLEREFERENCE_Job, _Job.writeExternalData());
}
......@@ -658,6 +798,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
}
// Compare single assocs
_Job.compare (otherSearchApplicant._Job, listener);
// Compare multiple assocs
......@@ -679,6 +820,7 @@ public abstract class BaseSearchApplicant extends SearchExecutor
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Details, HELPER_Details.toObject(getDetails()));
visitor.visitAssociation (_Job);
}
......@@ -687,6 +829,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
super.visitAssociations (visitor, scope);
if (scope.includes (_Job))
{
visitor.visit (_Job);
}
}
......@@ -716,6 +862,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
return filter.matches (getDetails ());
}
else if (attribName.equals (SINGLEREFERENCE_Job))
{
return filter.matches (getJob ());
}
else
{
return super.testFilter (attribName, filter);
......@@ -793,6 +943,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
return getWriteability_Details ();
}
else if (fieldName.equals (SINGLEREFERENCE_Job))
{
return getWriteability_Job ();
}
else
{
return super.getWriteable (fieldName);
......@@ -942,6 +1096,10 @@ public abstract class BaseSearchApplicant extends SearchExecutor
{
return toDetails ();
}
if (name.equals ("Job"))
{
return toJob ();
}
return super.to(name);
......@@ -949,6 +1107,12 @@ public abstract class BaseSearchApplicant extends SearchExecutor
public PipeLine<From, String> toDetails () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Details)); }
public Job.JobPipeLineFactory<From, Job> toJob () { return toJob (Filter.ALL); }
public Job.JobPipeLineFactory<From, Job> toJob (Filter<Job> filter)
{
return Job.REFERENCE_Job.new JobPipeLineFactory<From, Job> (this, new ORMSingleAssocPipe<Me, Job>(SINGLEREFERENCE_Job, filter));
}
}
......@@ -980,6 +1144,20 @@ class DummySearchApplicant extends SearchApplicant
}
public Job getJob () throws StorageException
{
return (Job)(Job.DUMMY_Job);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getJobID ()
{
return Job.DUMMY_Job.getObjectID();
}
}
package performa.search;
import oneit.objstore.BaseBusinessClass;
import oneit.objstore.rdbms.filters.EqualsFilter;
import performa.orm.JobApplication;
public class SearchApplicant extends BaseSearchApplicant
{
......@@ -10,4 +14,13 @@ public class SearchApplicant extends BaseSearchApplicant
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public BaseBusinessClass[] doSearch()
{
return JobApplication.SearchByDetails()
.byName(getDetails())
.andJob(new EqualsFilter<>(getJob()))
.search(getTransaction());
}
}
\ No newline at end of file
......@@ -5,11 +5,14 @@
<BUSINESSCLASS name="SearchApplicant" package="performa.search" superclass="SearchExecutor" >
<IMPORT value="oneit.servlets.orm.*" />
<IMPORT value="performa.orm.*"/>
<TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE" >
<ATTRIB name="Details" type="String" dbcol="xxxx" />
<SINGLEREFERENCE name="Job" type="Job" dbcol="xxxx" />
</TABLE>
</BUSINESSCLASS>
......
......@@ -15,6 +15,7 @@ import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import oneit.servlets.orm.*;
import performa.orm.*;
......@@ -42,7 +43,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
}
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, {PREFIX}it_does_not_matter.xxxx, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -93,7 +94,8 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
// Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(SearchApplicant.FIELD_Details))
!it_does_not_matterPSet.containsAttrib(SearchApplicant.FIELD_Details)||
!it_does_not_matterPSet.containsAttrib(SearchApplicant.SINGLEREFERENCE_Job))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
......@@ -163,10 +165,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}it_does_not_matter " +
"SET xxxx = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET xxxx = ?, xxxx = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))).listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -402,6 +404,7 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
it_does_not_matterPSet.setAttrib(SearchApplicant.FIELD_Details, HELPER_Details.getFromRS(dummyDetails, r, "xxxx"));
it_does_not_matterPSet.setAttrib(SearchApplicant.SINGLEREFERENCE_Job, r.getObject ("xxxx"));
}
......@@ -418,10 +421,10 @@ public class SearchApplicantPersistenceMgr extends SearchExecutorPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}it_does_not_matter " +
" (xxxx, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (xxxx, xxxx, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchApplicant.FIELD_Details))) .listEntry (SQLManager.CheckNull((Long)(it_does_not_matterPSet.getAttrib (SearchApplicant.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -11,6 +11,7 @@ public class SearchJob extends BaseSearchJob
// This constructor should not be called
public SearchJob ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
......
......@@ -224,7 +224,7 @@ public class Utils
}
//to sort application list
public static List<JobApplication> getApplicationsSorted(JobApplication[] applications, AppSortOption appSortOption)
public static List<JobApplication> getApplicationsSorted(List<JobApplication> applications, AppSortOption appSortOption)
{
ObjectTransform transform = JobApplication.pipesJobApplication().toObjectCreated();
Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST;
......@@ -255,7 +255,7 @@ public class Utils
comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST);
}
return ObjstoreUtils.sort( Arrays.asList(applications),
return ObjstoreUtils.sort(applications,
new ObjectTransform[]{transform},
new Comparator[]{comparator});
}
......
......@@ -30,7 +30,7 @@
<span>
<oneit:toString value="<%= noOfIncomplete %>" mode="Integer" />
</span>
<%= job.getFirstWorkFlow().getName() %>
<%= job.getWorkFlowBySortOrder(1).getName() %>
</oneit:button>
</li>
<ul>
......@@ -63,7 +63,7 @@
<span>
<oneit:toString value="<%= noOfUnsuitable %>" mode="Integer" />
</span>
<%= job.getFirstWorkFlow().getName() %>
<%= job.getWorkFlowBySortOrder(9).getName() %>
</oneit:button>
</div>
</div>
......
......@@ -9,6 +9,7 @@
Job job = (Job) process.getAttribute("Job");
List<JobApplication> applications = (List<JobApplication>) getData(request, "applications");
String currentPage = (String) getData(request, "currentPage");
int tabNumber = (int) getData(request, "TabNumber");
String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
%>
......
......@@ -4,6 +4,7 @@
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%@page import="oneit.utils.text.FormatUtils"%>
<%@ page import="oneit.utils.filter.*"%>
<oneit:dynIncluded>
<%
......@@ -18,10 +19,27 @@
Debug.assertion(job != null, "Job is null in admin portal view applicants");
String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
AppSortOption appSortOpt = (AppSortOption) process.getAttribute("AppSortOption");
int tabNumber = process.getAttribute("TabNumber") != null ? (int) process.getAttribute("TabNumber") : 1;
String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
AppSortOption appSortOpt = (AppSortOption) process.getAttribute("AppSortOption");
int tabNumber = process.getAttribute("TabNumber") != null ? (int) process.getAttribute("TabNumber") : 2;
SearchApplicant searchApplicant = (SearchApplicant) RunSearchExecutorFP.setupExecutor(request, SearchApplicant.REFERENCE_SearchApplicant, true);
JobApplication[] applications = (JobApplication[]) process.getAttribute("JobApplications");
WorkFlow workflow = job.getWorkFlowBySortOrder(tabNumber);
searchApplicant.setJob(job);
if(applications == null)
{
applications = (JobApplication[]) searchApplicant.doSearch();
}
if (getData (request, GenericObjSearchDF.GENERIC_SEARCH_RESULTS) != null)
{
applications = (JobApplication[])getData (request, GenericObjSearchDF.GENERIC_SEARCH_RESULTS);
}
process.setAttribute("JobApplications", applications);
if(request.getParameter("AppSortOption") != null)
{
......@@ -32,20 +50,15 @@
{
appSortOpt = AppSortOption.RANK;
}
JobApplication[] applications = (JobApplication[]) process.getAttribute("JobApplications");
if(applications == null)
{
applications = JobApplication.SearchByAll()
.andJob(new EqualsFilter<>(job))
.andApplicationStatus(new NotEqualsFilter<>(ApplicationStatus.DRAFT))
.search(transaction);
process.setAttribute("JobApplications", applications);
}
List<JobApplication> sortedApplications = applications!=null ? Utils.getApplicationsSorted(applications, appSortOpt) : new ArrayList<JobApplication>();
List<JobApplication> applicantList = Arrays.asList(applications);
// filter applicants by workflow
oneit.utils.filter.Filter<JobApplication> filter = JobApplication.SearchByAll().andApplicationStatus(new EqualsFilter<>(workflow.getApplicationStatus()));
applicantList = new ArrayList<>(CollectionFilter.filter(applicantList, filter));
List<JobApplication> sortedApplications = Utils.getApplicationsSorted(applicantList, appSortOpt);
process.setAttribute("AppSortOption", appSortOpt);
process.setAttribute("TabNumber", tabNumber);
......@@ -70,6 +83,7 @@
<oneit:dynInclude page="/extensions/adminportal/inc/application_list_data.jsp"
applications="<%= sortedApplications %>"
currentPage="<%= currentPage %>"
TabNumber="<%= tabNumber %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
</div>
......
......@@ -27,7 +27,7 @@
//to navigation between applications
if(applications==null)
{
applications = Utils.getApplicationsSorted(job.getJobApplicationsSet().toArray(new JobApplication[job.getJobApplicationsSet().size()]), AppSortOption.RANK);
// applications = Utils.getApplicationsSorted(job.getJobApplicationsSet(), AppSortOption.RANK);
process.setAttribute("Applications", applications);
}
......
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