Commit fb28a68a by Harsh Shah

System Repinned for Case Insensitive Comparator fix

parent 4f975674
...@@ -103,7 +103,7 @@ public class Utils ...@@ -103,7 +103,7 @@ public class Utils
public static List<Job> getJobsSorted(Job[] jobs, JobSortOption jobSortOption, JobStatus jobStatus) public static List<Job> getJobsSorted(Job[] jobs, JobSortOption jobSortOption, JobStatus jobStatus)
{ {
ObjectTransform transform = Job.pipesJob().toObjectCreated(); ObjectTransform transform = Job.pipesJob().toObjectCreated();
Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR; Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST;
if(jobSortOption == JobSortOption.OLDEST || jobSortOption == JobSortOption.NEWEST) if(jobSortOption == JobSortOption.OLDEST || jobSortOption == JobSortOption.NEWEST)
{ {
...@@ -121,8 +121,8 @@ public class Utils ...@@ -121,8 +121,8 @@ public class Utils
} }
comparator = jobSortOption == JobSortOption.OLDEST ? comparator = jobSortOption == JobSortOption.OLDEST ?
CollectionUtils.DEFAULT_COMPARATOR : CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST :
CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR); CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST);
} }
else if(jobSortOption == JobSortOption.CLOSING_SOON) else if(jobSortOption == JobSortOption.CLOSING_SOON)
{ {
...@@ -132,12 +132,12 @@ public class Utils ...@@ -132,12 +132,12 @@ public class Utils
else if(jobSortOption == JobSortOption.ALPHA_A_Z) else if(jobSortOption == JobSortOption.ALPHA_A_Z)
{ {
transform = Job.pipesJob().toJobTitle(); transform = Job.pipesJob().toJobTitle();
comparator = CollectionUtils.CASE_INSENSITIVE_COMPARATOR; comparator = CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST;
} }
else if(jobSortOption == JobSortOption.ALPHA_Z_A) else if(jobSortOption == JobSortOption.ALPHA_Z_A)
{ {
transform = Job.pipesJob().toJobTitle(); transform = Job.pipesJob().toJobTitle();
comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR); comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST);
} }
return ObjstoreUtils.sort( Arrays.asList(jobs), return ObjstoreUtils.sort( Arrays.asList(jobs),
...@@ -149,27 +149,27 @@ public class Utils ...@@ -149,27 +149,27 @@ public class Utils
public static List<Client> getClientsSorted(Client[] clients, ClientSortOption clientSortOption) public static List<Client> getClientsSorted(Client[] clients, ClientSortOption clientSortOption)
{ {
ObjectTransform transform = Client.pipesClient().toObjectCreated(); ObjectTransform transform = Client.pipesClient().toObjectCreated();
Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR; Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST;
if(clientSortOption == ClientSortOption.ALPHA_A_Z) if(clientSortOption == ClientSortOption.ALPHA_A_Z)
{ {
transform = Client.pipesClient().toClientName(); transform = Client.pipesClient().toClientName();
comparator = CollectionUtils.CASE_INSENSITIVE_COMPARATOR; comparator = CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST;
} }
else if(clientSortOption == ClientSortOption.ALPHA_Z_A) else if(clientSortOption == ClientSortOption.ALPHA_Z_A)
{ {
transform = Client.pipesClient().toClientName(); transform = Client.pipesClient().toClientName();
comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR); comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST);
} }
else if(clientSortOption == ClientSortOption.OPEN_JOBS) else if(clientSortOption == ClientSortOption.OPEN_JOBS)
{ {
transform = new ClientJobCountTransform(JobStatus.OPEN); transform = new ClientJobCountTransform(JobStatus.OPEN);
comparator = CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR); comparator = CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST);
} }
else if(clientSortOption == ClientSortOption.FILLED_JOBS) else if(clientSortOption == ClientSortOption.FILLED_JOBS)
{ {
transform = new ClientJobCountTransform(JobStatus.FILLED); transform = new ClientJobCountTransform(JobStatus.FILLED);
comparator = CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR); comparator = CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST);
} }
return ObjstoreUtils.sort( Arrays.asList(clients), new ObjectTransform[]{transform}, new Comparator[]{comparator}); return ObjstoreUtils.sort( Arrays.asList(clients), new ObjectTransform[]{transform}, new Comparator[]{comparator});
...@@ -216,7 +216,7 @@ public class Utils ...@@ -216,7 +216,7 @@ public class Utils
public static List<JobApplication> getApplicationsSorted(JobApplication[] applications, AppSortOption appSortOption) public static List<JobApplication> getApplicationsSorted(JobApplication[] applications, AppSortOption appSortOption)
{ {
ObjectTransform transform = JobApplication.pipesJobApplication().toObjectCreated(); ObjectTransform transform = JobApplication.pipesJobApplication().toObjectCreated();
Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR; Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST;
if(appSortOption==AppSortOption.OLDEST) if(appSortOption==AppSortOption.OLDEST)
{ {
...@@ -236,12 +236,12 @@ public class Utils ...@@ -236,12 +236,12 @@ public class Utils
else if(appSortOption==AppSortOption.ALPHA_A_Z) else if(appSortOption==AppSortOption.ALPHA_A_Z)
{ {
transform = JobApplication.pipesJobApplication().toCandidate().toUser().toFirstName(); transform = JobApplication.pipesJobApplication().toCandidate().toUser().toFirstName();
comparator = CollectionUtils.CASE_INSENSITIVE_COMPARATOR; comparator = CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST;
} }
else if(appSortOption==AppSortOption.ALPHA_Z_A) else if(appSortOption==AppSortOption.ALPHA_Z_A)
{ {
transform = JobApplication.pipesJobApplication().toCandidate().toUser().toFirstName(); transform = JobApplication.pipesJobApplication().toCandidate().toUser().toFirstName();
comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR); comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST);
} }
return ObjstoreUtils.sort( Arrays.asList(applications), return ObjstoreUtils.sort( Arrays.asList(applications),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<SYSTEM name="PerformaInvestments" targetDir="C:/build/PerformaInvestments" executor="testMainApp"> <SYSTEM name="PerformaInvestments" targetDir="C:/build/PerformaInvestments" executor="testMainApp">
<WEBAPP name="cmsWebApp" relative-path="cmsWebApp" deployment="cms"> <WEBAPP name="cmsWebApp" relative-path="cmsWebApp" deployment="cms">
<OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="3c1d38dc38c69786b3a4a45553f309aa57cd2836"/> <OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="2bb1972b665029a5167e3d25f5197c79c206a899"/>
</WEBAPP> </WEBAPP>
<PARAMETER name="key.file"/> <PARAMETER name="key.file"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment