Korrekturen und Feinarbeiten an den Tabs für SciInstitute und SciDepartment
git-svn-id: https://svn.libreccm.org/ccm/trunk@1313 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
4ea7b71896
commit
4e04b6335d
|
|
@ -15,8 +15,8 @@ import java.util.Map;
|
|||
*/
|
||||
public class CompareFilter implements Filter {
|
||||
|
||||
private static final String ALL = "--ALL--";
|
||||
private static final String NONE = "--NONE--";
|
||||
public static final String ALL = "--ALL--";
|
||||
public static final String NONE = "--NONE--";
|
||||
private final String property;
|
||||
private final String label;
|
||||
private final boolean allOption;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import com.redhat.persistence.pdl.PDL;
|
|||
import java.io.Reader;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
|
@ -445,7 +446,7 @@ class DataQueryImpl implements DataQuery {
|
|||
}
|
||||
|
||||
Object secondElement = orderTwo;
|
||||
if (orderTwo instanceof String && orderTwo != null) {
|
||||
if ((orderTwo != null) && (orderTwo instanceof String)) {
|
||||
Path two = unalias(Path.get((String) orderTwo));
|
||||
// XXX:
|
||||
if (!hasProperty(two)) {
|
||||
|
|
@ -466,6 +467,10 @@ class DataQueryImpl implements DataQuery {
|
|||
}
|
||||
}
|
||||
|
||||
if ((orderTwo != null) && (orderTwo instanceof Date)) {
|
||||
|
||||
}
|
||||
|
||||
addOrder("case when (" + orderOne + " is null) then " +
|
||||
secondElement + " else " + orderOne + " end " + suffix);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,8 +101,19 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
|
|||
final Element filtersElem = depProjectsElem.newChildElement(
|
||||
"filters");
|
||||
|
||||
projects.addOrder("case when (projectBegin is null) "
|
||||
+ "then '0001-01-01' "
|
||||
+ "else projectBegin "
|
||||
+ "end desc");
|
||||
projects.addOrder("case when (projectEnd is null) "
|
||||
+ "then '0001-01-01' "
|
||||
+ "else projectEnd "
|
||||
+ "end desc");
|
||||
projects.addOrder("title asc");
|
||||
|
||||
if (((request.getParameter(STATUS_PARAM) == null)
|
||||
|| (request.getParameter(STATUS_PARAM).trim().isEmpty()))
|
||||
|| request.getParameter(STATUS_PARAM).trim().isEmpty()
|
||||
|| CompareFilter.NONE.equals(request.getParameter(STATUS_PARAM)))
|
||||
&& ((request.getParameter(TITLE_PARAM) == null)
|
||||
|| request.getParameter(TITLE_PARAM).trim().isEmpty())) {
|
||||
|
||||
|
|
@ -110,20 +121,20 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
|
|||
|
||||
depProjectsElem.newChildElement("greeting");
|
||||
|
||||
projects.addOrder("projectEnd desc");
|
||||
projects.addOrder("projectBegin desc");
|
||||
//projects.addOrder("projectEnd desc");
|
||||
//projects.addOrder("projectBegin desc");
|
||||
//projects.addOrder("projectEnd desc nulls last");
|
||||
//projects.addOrder("projectBegin desc nulls last");
|
||||
//projects.addOrderWithNull("projectEnd", new Date(0), false);
|
||||
//projects.addOrderWithNull("projectBegin", new Date(0), false);
|
||||
projects.addOrder("title");
|
||||
//projects.addOrder("title");
|
||||
|
||||
projects.setRange(1, config.getGreetingSize() + 1);
|
||||
|
||||
titleFilter.generateXml(filtersElem);
|
||||
|
||||
} else {
|
||||
projects.addOrder("title");
|
||||
//projects.addOrder("title");
|
||||
|
||||
applyStatusFilter(projects, request);
|
||||
applyTitleFilter(projects, request);
|
||||
|
|
@ -247,7 +258,8 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
|
|||
final Element parent,
|
||||
final PageState state) {
|
||||
final long start = System.currentTimeMillis();
|
||||
final ContentPage project = (ContentPage) DomainObjectFactory.newInstance(new OID(
|
||||
final ContentPage project = (ContentPage) DomainObjectFactory.
|
||||
newInstance(new OID(
|
||||
"com.arsdigita.cms.contenttypes.SciProject", projectId));
|
||||
logger.debug(String.format("Got domain object for project '%s' "
|
||||
+ "in %d ms.",
|
||||
|
|
|
|||
|
|
@ -114,11 +114,22 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
|
|||
|
||||
publications.addOrder("year desc");
|
||||
if (config.getOneRowPerAuthor()) {
|
||||
publications.addOrder("surname");
|
||||
publications.addOrder("case when (authorSurname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorSurname "
|
||||
+ "end asc");
|
||||
publications.addOrder("case when (authorGivenname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorGivenname "
|
||||
+ "end asc");
|
||||
} else {
|
||||
publications.addOrder("authors");
|
||||
publications.addOrder("case when ((authors is null) "
|
||||
+ "or (char_length(authors) = 0)) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authors "
|
||||
+ "end asc");
|
||||
}
|
||||
publications.addOrder("title");
|
||||
publications.addOrder("title asc");
|
||||
|
||||
publications.setRange(1, config.getGreetingSize() + 1);
|
||||
|
||||
|
|
@ -174,12 +185,22 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
|
|||
|
||||
publications.addOrder("year desc");
|
||||
if (config.getOneRowPerAuthor()) {
|
||||
publications.addOrder("surname");
|
||||
publications.addOrder("title");
|
||||
publications.addOrder("case when (authorSurname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorSurname "
|
||||
+ "end asc");
|
||||
publications.addOrder("case when (authorGivenname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorGivenname "
|
||||
+ "end asc");
|
||||
} else {
|
||||
publications.addOrder("authors");
|
||||
publications.addOrder("title");
|
||||
publications.addOrder("case when ((authors is null) "
|
||||
+ "or (char_length(authors) = 0)) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authors "
|
||||
+ "end asc");
|
||||
}
|
||||
publications.addOrder("title");
|
||||
|
||||
final DataQuery yearQuery = getData(orgaunit);
|
||||
yearFilter.setDataQuery(yearQuery, "year");
|
||||
|
|
|
|||
|
|
@ -101,8 +101,19 @@ public class SciInstituteProjectsTab implements GenericOrgaUnitTab {
|
|||
final Element filtersElem = depProjectsElem.newChildElement(
|
||||
"filters");
|
||||
|
||||
projects.addOrder("case when (projectBegin is null) "
|
||||
+ "then '0001-01-01' "
|
||||
+ "else projectBegin "
|
||||
+ "end desc");
|
||||
projects.addOrder("case when (projectEnd is null) "
|
||||
+ "then '0001-01-01' "
|
||||
+ "else projectEnd "
|
||||
+ "end desc");
|
||||
projects.addOrder("title asc");
|
||||
|
||||
if (((request.getParameter(STATUS_PARAM) == null)
|
||||
|| (request.getParameter(STATUS_PARAM).trim().isEmpty()))
|
||||
|| request.getParameter(STATUS_PARAM).trim().isEmpty()
|
||||
|| CompareFilter.NONE.equals(request.getParameter(STATUS_PARAM)))
|
||||
&& ((request.getParameter(TITLE_PARAM) == null)
|
||||
|| request.getParameter(TITLE_PARAM).trim().isEmpty())) {
|
||||
|
||||
|
|
@ -110,20 +121,18 @@ public class SciInstituteProjectsTab implements GenericOrgaUnitTab {
|
|||
|
||||
depProjectsElem.newChildElement("greeting");
|
||||
|
||||
projects.addOrder("projectEnd desc");
|
||||
projects.addOrder("projectBegin desc");
|
||||
//projects.addOrder("projectEnd desc nulls last");
|
||||
//projects.addOrder("projectBegin desc nulls last");
|
||||
//projects.addOrderWithNull("projectEnd", null, false);
|
||||
//projects.addOrderWithNull("projectBegin", null, false);
|
||||
projects.addOrder("title");
|
||||
//projects.addOrder("title");
|
||||
|
||||
projects.setRange(1, config.getGreetingSize() + 1);
|
||||
|
||||
titleFilter.generateXml(filtersElem);
|
||||
|
||||
} else {
|
||||
projects.addOrder("title");
|
||||
//projects.addOrder("title");
|
||||
|
||||
applyStatusFilter(projects, request);
|
||||
applyTitleFilter(projects, request);
|
||||
|
|
@ -247,7 +256,8 @@ public class SciInstituteProjectsTab implements GenericOrgaUnitTab {
|
|||
final Element parent,
|
||||
final PageState state) {
|
||||
final long start = System.currentTimeMillis();
|
||||
final ContentPage project = (ContentPage) DomainObjectFactory.newInstance(new OID(
|
||||
final ContentPage project = (ContentPage) DomainObjectFactory.
|
||||
newInstance(new OID(
|
||||
"com.arsdigita.cms.contenttypes.SciProject", projectId));
|
||||
logger.debug(String.format("Got domain object for project '%s' "
|
||||
+ "in %d ms.",
|
||||
|
|
|
|||
|
|
@ -142,11 +142,21 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
|||
|
||||
publications.addOrder("year desc");
|
||||
if (config.getOneRowPerAuthor()) {
|
||||
publications.addOrder("surname");
|
||||
publications.addOrder("case when (authorSurname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorSurname "
|
||||
+ "end asc");
|
||||
publications.addOrder("case when (authorGivenname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorGivenname "
|
||||
+ "end asc");
|
||||
} else {
|
||||
publications.addOrder("authors");
|
||||
publications.addOrder("case when (authors is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authors "
|
||||
+ "end asc");
|
||||
}
|
||||
publications.addOrder("title");
|
||||
publications.addOrder("title asc");
|
||||
|
||||
yearFilter.setDataQuery(getData(orgaunit), "year");
|
||||
|
||||
|
|
@ -200,12 +210,21 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
|||
}*/
|
||||
|
||||
if (config.getOneRowPerAuthor()) {
|
||||
publications.addOrder("surname");
|
||||
publications.addOrder("title");
|
||||
publications.addOrder("case when (authorSurname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorSurname "
|
||||
+ "end asc");
|
||||
publications.addOrder("case when (authorGivenname is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authorGivenname "
|
||||
+ "end asc");
|
||||
} else {
|
||||
publications.addOrder("authors");
|
||||
publications.addOrder("title");
|
||||
publications.addOrder("case when (authors is null) "
|
||||
+ "then 'zzzz' "
|
||||
+ "else authors "
|
||||
+ "end asc");
|
||||
}
|
||||
publications.addOrder("title asc");
|
||||
|
||||
final DataQuery yearQuery = getData(orgaunit);
|
||||
yearFilter.setDataQuery(yearQuery, "year");
|
||||
|
|
|
|||
Loading…
Reference in New Issue