- Sichern des aktuellen Standes der neuen Sci-Typen.

- Kleinere Bug-Fixes an anderen Stellen


git-svn-id: https://svn.libreccm.org/ccm/trunk@1270 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-11-19 14:10:20 +00:00
parent f0b37603c1
commit f6ef24d03c
11 changed files with 240 additions and 112 deletions

View File

@ -16,11 +16,13 @@ import java.util.Map;
public class CompareFilter implements Filter {
private static final String ALL = "--ALL--";
private static final String NONE = "--NONE--";
private final String property;
private final String label;
private final boolean allOption;
private final boolean allOptionIsDefault;
private final boolean propertyIsNumeric;
private boolean emptyDefaultOption = false;
private Map<String, Option> options = new LinkedHashMap<String, Option>();
private String value;
@ -36,6 +38,16 @@ public class CompareFilter implements Filter {
this.propertyIsNumeric = propertyIsNumeric;
}
public CompareFilter(final String label,
final String property,
final boolean allOption,
final boolean allOptionIsDefault,
final boolean propertyIsNumeric,
final boolean emptyDefaultOption) {
this(label, property, allOption, allOptionIsDefault, propertyIsNumeric);
this.emptyDefaultOption = true;
}
@Override
public String getProperty() {
return property;
@ -67,13 +79,15 @@ public class CompareFilter implements Filter {
if ((value == null) || value.isEmpty()) {
if (allOptionIsDefault) {
value = ALL;
} else if (emptyDefaultOption) {
return "";
} else {
value =
new ArrayList<Option>(options.values()).get(0).getLabel();
}
}
if (ALL.equals(value)) {
if (ALL.equals(value) || NONE.equals(value)) {
return "";
}
@ -132,6 +146,8 @@ public class CompareFilter implements Filter {
if ((value == null) || value.isEmpty()) {
if (allOptionIsDefault) {
selected = ALL;
} else if (emptyDefaultOption) {
selected = NONE;
} else {
List<Option> optionsList =
new ArrayList<Option>(options.values());
@ -151,6 +167,10 @@ public class CompareFilter implements Filter {
option.addAttribute("label", ALL);
}
if (emptyDefaultOption) {
final Element emptyOption = filter.newChildElement("option");
emptyOption.addAttribute("label", NONE);
}
Element option;
for (Map.Entry<String, Option> entry : options.entrySet()) {
option = filter.newChildElement("option");

View File

@ -18,6 +18,7 @@ import java.util.Set;
*/
public class SelectFilter implements Filter {
public static final String NONE = "--NONE--";
public static final String ALL = "--ALL--";
private final String property;
private final String label;
@ -27,6 +28,7 @@ public class SelectFilter implements Filter {
private final boolean allOptionIsDefault;
private final boolean reverseOptions;
private final boolean propertyIsNumeric;
private boolean emptyDefaultOption = false;
private String value;
public SelectFilter(final String label,
@ -44,6 +46,18 @@ public class SelectFilter implements Filter {
this.propertyIsNumeric = propertyIsNumeric;
}
public SelectFilter(final String label,
final String property,
final boolean reverseOptions,
final boolean allOption,
final boolean allOptionIsDefault,
final boolean propertyIsNumeric,
final boolean emptyDefaultOption) {
this(label, property, reverseOptions, allOption, allOptionIsDefault,
propertyIsNumeric);
this.emptyDefaultOption = emptyDefaultOption;
}
@Override
public String getProperty() {
return property;
@ -61,18 +75,17 @@ public class SelectFilter implements Filter {
}
public String getFilter() {
List<String> options;
options = getOptions();
if ((value == null) || value.isEmpty()) {
if (allOptionIsDefault) {
value = ALL;
} else if(emptyDefaultOption) {
value = NONE;
} else {
value = options.get(0);
value = getOptions().get(0);
}
}
if (ALL.equals(value)) {
if (ALL.equals(value) || NONE.equals(value)) {
return null;
}
@ -95,9 +108,15 @@ public class SelectFilter implements Filter {
filter = parent.newChildElement("filter");
filter.addAttribute("type", "select");
if(options.isEmpty()) {
return;
}
if ((value == null) || value.isEmpty()) {
if (allOptionIsDefault) {
selected = ALL;
} else if(emptyDefaultOption) {
selected = NONE;
} else {
selected = options.get(0);
}
@ -108,6 +127,11 @@ public class SelectFilter implements Filter {
filter.addAttribute("label", label);
filter.addAttribute("selected", selected);
if (emptyDefaultOption) {
optionElem = filter.newChildElement("option");
optionElem.addAttribute("label", NONE);
}
if (allOption) {
optionElem = filter.newChildElement("option");
optionElem.addAttribute("label", ALL);

View File

@ -94,7 +94,7 @@ public class PersonalPublicationsConfig extends AbstractConfig {
order = new StringParameter(
"com.arsdigita.cms.publicpersonlprofile.publications.order",
Parameter.REQUIRED,
"year,title");
"year,authors,title");
register(publicationGroups);
register(groupSplit);

View File

@ -107,7 +107,8 @@ query getIdsOfPublicationsForOrgaUnitOneRowPerAuthor {
join cms_organizationalunits_publications_map on cms_pages.item_id = cms_organizationalunits_publications_map.publication_id
join cms_organizationalunits on cms_organizationalunits_publications_map.orgaunit_id = cms_organizationalunits.organizationalunit_id
join acs_objects on cms_pages.item_id = acs_objects.object_id
join cms_items on cms_items.item_id = cms_pages.item_id;
join cms_items on cms_items.item_id = cms_pages.item_id
where cms_organizationalunits.organizationalunit_id in :orgaunitIds
} map {
publicationId = cms_pages.item_id;
objectType = acs_objects.object_type;
@ -131,6 +132,7 @@ query getIdsOfPublicationsForOrgaUnit {
Integer year;
String authors;
String language;
Boolean reviewed;
do {
select cms_pages.item_id,
@ -138,14 +140,16 @@ query getIdsOfPublicationsForOrgaUnit {
cms_pages.title,
cms_organizationalunits.organizationalunit_id,
ct_publications.year,
ct_publications.authors
cms_items.language
ct_publications.authors,
cms_items.language,
ct_publications.reviewed
from cms_pages
join ct_publications on cms_pages.item_id = ct_publications.publication_id
join cms_organizationalunits_publications_map on cms_pages.item_id = cms_organizationalunits_publications_map.publication_id
join cms_organizationalunits on cms_organizationalunits_publications_map.orgaunit_id = cms_organizationalunits.organizationalunit_id
join acs_objects on cms_pages.item_id = acs_objects.object_id
join cms_items on cms_pages.item_id = cms_items.item_id
where cms_organizationalunits.organizationalunit_id in :orgaunitIds
} map {
publicationId = cms_pages.item_id;
objectType = acs_objects.object_type;
@ -153,6 +157,8 @@ query getIdsOfPublicationsForOrgaUnit {
title = cms_pages.title;
year = ct_publications.year;
authors = ct_publications.authors;
language = cms_items.language;
reviewed = ct_publications.reviewed;
}
}

View File

@ -70,7 +70,7 @@ public class SciDepartmentConfig extends AbstractConfig {
new StringParameter(
"com.arsdigita.cms.contenttypes.sciproject.tabs",
Parameter.REQUIRED,
"summary:com.arsdigita.cms.contenttypes.ui.SciDepartmentSummaryTab;desc:com.arsdigita.cms.contenttypes.ui.SciDepartmentDescTab;members:com.arsdigita.cms.contenttypes.ui.SciDepartmentMembersTab");
"summary:com.arsdigita.cms.contenttypes.ui.SciDepartmentSummaryTab;desc:com.arsdigita.cms.contenttypes.ui.SciDepartmentDescTab;members:com.arsdigita.cms.contenttypes.ui.SciDepartmentMembersTab;projects:com.arsdigita.cms.contenttypes.ui.SciDepartmentProjectsTab;publications:com.arsdigita.cms.contenttypes.ui.SciDepartmentPublicationsTab");
register(enableSubDepartmentsStep);
register(enableSuperDepartmentsStep);

View File

@ -132,7 +132,7 @@ public class SciDepartmentMembersTab implements GenericOrgaUnitTab {
final DataQuery personsQuery = SessionManager.getSession().
retrieveQuery(
"com.arsdigita.cms.contenttypes.getIdsOfMembersOfOrgaUnits");
final StringBuffer personsFilter = new StringBuffer();
//final StringBuffer personsFilter = new StringBuffer();
final List<String> orgaUnitIds = new ArrayList<String>();
if (config.isMergingMembers()) {
@ -145,18 +145,18 @@ public class SciDepartmentMembersTab implements GenericOrgaUnitTab {
SciDepartmentSubDepartmentsStep.ASSOC_TYPE);
while (subDepartmentsQuery.next()) {
if (personsFilter.length() > 0) {
/*if (personsFilter.length() > 0) {
personsFilter.append(" or ");
}
personsFilter.append(String.format("orgaunitId = %s",
subDepartmentsQuery.get(
"orgaunitId").toString()));
"orgaunitId").toString()));*/
orgaUnitIds.add(subDepartmentsQuery.get(
"orgaunitId").toString());
}
} else {
personsFilter.append(String.format("orgaunitId = %s",
orgaunit.getID().toString()));
/*personsFilter.append(String.format("orgaunitId = %s",
orgaunit.getID().toString()));*/
orgaUnitIds.add(orgaunit.getID().toString());
}

View File

@ -17,6 +17,10 @@ import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.xml.Element;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
@ -37,6 +41,7 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
"projectEnd",
false,
false,
false,
true);
private final TextFilter titleFilter = new TextFilter(TITLE_PARAM,
ContentPage.TITLE);
@ -45,6 +50,23 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
config.load();
}
public SciDepartmentProjectsTab() {
final Calendar now = new GregorianCalendar();
final String today = String.format("%d-%02d-%02d",
now.get(Calendar.YEAR),
now.get(Calendar.MONTH) + 1,
now.get(Calendar.DAY_OF_MONTH));
statusFilter.addOption("currentProjects",
CompareFilter.Operators.GTEQ,
today,
true);
statusFilter.addOption("finishedProjects",
CompareFilter.Operators.LT,
today,
false);
}
public boolean hasData(final GenericOrganizationalUnit orgaunit) {
final long start = System.currentTimeMillis();
final ContentTypeCollection types = ContentType.getAllContentTypes();
@ -81,9 +103,13 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
statusFilter.generateXml(filtersElem);
if (((request.getParameter(STATUS_PARAM) == null)
|| (request.getParameter(STATUS_PARAM).trim().isEmpty()))
|| (request.getParameter(STATUS_PARAM).trim().isEmpty())
|| (statusFilter.getFilter() == null)
|| (statusFilter.getFilter().trim().isEmpty()))
&& ((request.getParameter(TITLE_PARAM) == null)
|| request.getParameter(TITLE_PARAM).trim().isEmpty())) {
|| request.getParameter(TITLE_PARAM).trim().isEmpty())
|| (titleFilter.getFilter() == null)
|| !(titleFilter.getFilter().trim().isEmpty())) {
depProjectsElem.newChildElement("greeting");
@ -138,8 +164,9 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
final DataQuery projectsQuery = SessionManager.getSession().
retrieveQuery(
"com.arsdigita.cms.contenttypes. getIdsOfProjectsOfOrgaUnit");
final StringBuffer projectsFilter = new StringBuffer();
"com.arsdigita.cms.contenttypes.getIdsOfProjectsOfOrgaUnit");
//final StringBuffer projectsFilter = new StringBuffer();
final List<String> orgaunitIds = new ArrayList<String>();
if (config.isMergingProjects()) {
final DataQuery subDepartmentsQuery =
@ -151,19 +178,22 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
SciDepartmentProjectsStep.ASSOC_TYPE);
while (subDepartmentsQuery.next()) {
if (projectsFilter.length() > 0) {
/*if (projectsFilter.length() > 0) {
projectsFilter.append(" or ");
}
projectsFilter.append(String.format("orgaunitId = %s",
subDepartmentsQuery.get(
"orgaunitId").toString()));
"orgaunitId").toString()));*/
orgaunitIds.add(subDepartmentsQuery.get("orgaunitId").toString());
}
} else {
projectsFilter.append(String.format("orgaunitId = %s",
orgaunit.getID().toString()));
//projectsFilter.append(String.format("orgaunitId = %s",
// orgaunit.getID().toString()));
orgaunitIds.add(orgaunit.getID().toString());
}
projectsQuery.addFilter(projectsFilter.toString());
//projectsQuery.addFilter(projectsFilter.toString());
projectsQuery.setParameter("orgaunitIds", orgaunitIds);
logger.debug(String.format(
"Got projects of department '%s'"
@ -181,8 +211,11 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
statusFilter.setValue(statusValue);
}
if ((statusFilter.getFilter() != null)
&& !(statusFilter.getFilter().trim().isEmpty())) {
projects.addFilter(statusFilter.getFilter());
}
}
private void applyTitleFilter(final DataQuery projects,
final HttpServletRequest request) {
@ -191,8 +224,11 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
titleFilter.setValue(titleValue);
}
if ((titleFilter.getFilter() != null)
&& !(titleFilter.getFilter().trim().isEmpty())) {
projects.addFilter(titleFilter.getFilter());
}
}
private void generateProjectXml(final BigDecimal projectId,
final Element parent,
@ -213,6 +249,8 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
final PageState state) {
final long start = System.currentTimeMillis();
final XmlGenerator generator = new XmlGenerator(project);
generator.setItemElemName("project", "");
generator.setUseExtraXml(false);
generator.generateXML(state, parent, "");
logger.debug(String.format("Generated XML for project '%s' in %d ms.",
project.getName(),

View File

@ -17,6 +17,8 @@ import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.xml.Element;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
@ -34,16 +36,17 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
private static final String YEAR_PARAM = "year";
private static final String TITLE_PARAM = "title";
private static final String AUTHOR_PARAM = "author";
private static final String SORT_PARAM = "sortBy";
/*private static final String SORT_PARAM = "sortBy";
private static final String SORT_BY_YEAR_ASC = "yearAsc";
private static final String SORT_BY_YEAR_DESC = "yearDesc";
private static final String SORT_BY_TITLE = "title";
private static final String SORT_BY_AUTHOR = "author";
private static final String SORT_BY_AUTHOR = "author";*/
private final SelectFilter yearFilter = new SelectFilter(YEAR_PARAM,
YEAR_PARAM,
true,
true,
false,
false,
true,
true);
private final TextFilter titleFilter = new TextFilter(TITLE_PARAM,
ContentPage.TITLE);
@ -97,15 +100,15 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
final String yearValue = request.getParameter(YEAR_PARAM);
final String titleValue = request.getParameter(TITLE_PARAM);
final String authorValue = request.getParameter(AUTHOR_PARAM);
final String sortValue = request.getParameter(SORT_PARAM);
//final String sortValue = request.getParameter(SORT_PARAM);
final Element filtersElem = depPublicationsElem.newChildElement(
"filters");
if (((yearValue == null) || yearValue.trim().isEmpty())
&& ((titleValue == null) || titleValue.trim().isEmpty())
&& ((authorValue == null) || authorValue.trim().isEmpty())
&& ((sortValue == null) || sortValue.trim().isEmpty())) {
&& ((authorValue == null) || authorValue.trim().isEmpty())) {
//&& ((sortValue == null) || sortValue.trim().isEmpty())) {
depPublicationsElem.newChildElement("greeting");
@ -119,13 +122,15 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
publications.setRange(1, config.getGreetingSize() + 1);
yearFilter.setDataQuery(publications, "year");
yearFilter.generateXml(filtersElem);
titleFilter.generateXml(filtersElem);
authorFilter.generateXml(filtersElem);
} else {
if (SORT_BY_AUTHOR.equals(sortValue)) {
/*if (SORT_BY_AUTHOR.equals(sortValue)) {
if (config.getOneRowPerAuthor()) {
publications.addOrder("surname");
} else {
@ -165,8 +170,18 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
}
publications.addOrder("title");
publications.addOrder("year asc");
}*/
if (config.getOneRowPerAuthor()) {
publications.addOrder("surname");
publications.addOrder("title");
} else {
publications.addOrder("authors");
publications.addOrder("title");
}
yearFilter.setDataQuery(publications, "year");
applyYearFilter(publications, request);
applyTitleFilter(publications, request);
applyAuthorFilter(publications, request);
@ -175,7 +190,10 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
(int) publications.size(),
config.getPageSize());
if (paginator.getPageCount() > config.getEnableSearchLimit()) {
if ((paginator.getPageCount() > config.getEnableSearchLimit())
|| (yearValue != null) || !(yearValue.trim().isEmpty())
|| (titleValue != null) || !(titleValue.trim().isEmpty())
|| (authorValue != null) || !(authorValue.trim().isEmpty())) {
yearFilter.generateXml(filtersElem);
titleFilter.generateXml(filtersElem);
authorFilter.generateXml(filtersElem);
@ -185,7 +203,7 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
paginator.generateXml(depPublicationsElem);
}
final Element sortFieldsElem = depPublicationsElem.newChildElement(
/*final Element sortFieldsElem = depPublicationsElem.newChildElement(
"sortFields");
sortFieldsElem.addAttribute("sortBy", sortValue);
@ -196,7 +214,7 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
sortFieldsElem.newChildElement("sortField").addAttribute("label",
SORT_BY_YEAR_ASC);
sortFieldsElem.newChildElement("sortField").addAttribute("label",
SORT_BY_YEAR_DESC);
SORT_BY_YEAR_DESC);*/
while (publications.next()) {
generatePublicationXml(
@ -236,7 +254,8 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
retrieveQuery(
"com.arsdigita.cms.contenttypes.getIdsOfPublicationsForOrgaUnit");
}
final StringBuffer publicationsFilter = new StringBuffer();
//final StringBuffer publicationsFilter = new StringBuffer();
final List<String> orgaunitIds = new ArrayList<String>();
if (config.isMergingPublications()) {
final DataQuery subDepartmentsQuery =
@ -247,19 +266,22 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
subDepartmentsQuery.setParameter("assocType",
SciDepartmentSubDepartmentsStep.ASSOC_TYPE);
while (subDepartmentsQuery.next()) {
if (publicationsFilter.length() > 0) {
/*if (publicationsFilter.length() > 0) {
publicationsFilter.append(" or ");
}
publicationsFilter.append(String.format("orgaunitId = %s",
subDepartmentsQuery.get(
"orgaunitId").toString()));
"orgaunitId").toString()));*/
orgaunitIds.add(subDepartmentsQuery.get("orgaunitId").toString());
}
} else {
publicationsFilter.append(String.format("orgaunitId = %s",
orgaunit.getID().toString()));
//publicationsFilter.append(String.format("orgaunitId = %s",
// orgaunit.getID().toString()));
orgaunitIds.add(orgaunit.getID().toString());
}
publicationsQuery.addFilter(publicationsFilter.toString());
//publicationsQuery.addFilter(publicationsFilter.toString());
publicationsQuery.setParameter("orgaunitIds", orgaunitIds);
logger.debug(String.format(
"Got publications of department '%s'"
@ -277,8 +299,11 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
yearFilter.setValue(yearValue);
}
if ((yearFilter.getFilter() != null)
&& !(yearFilter.getFilter().isEmpty())) {
publications.addFilter(yearFilter.getFilter());
}
}
private void applyTitleFilter(final DataQuery publications,
final HttpServletRequest request) {
@ -287,8 +312,11 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
titleFilter.setValue(titleValue);
}
if ((titleFilter.getFilter() != null)
&& !(titleFilter.getFilter().isEmpty())) {
publications.addFilter(titleFilter.getFilter());
}
}
private void applyAuthorFilter(final DataQuery publications,
final HttpServletRequest request) {
@ -297,8 +325,11 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
authorFilter.setValue(authorValue);
}
if ((authorFilter.getFilter() != null)
&& !(authorFilter.getFilter().isEmpty())) {
publications.addFilter(authorFilter.getFilter());
}
}
private void generatePublicationXml(final BigDecimal publicationId,
final String objectType,
@ -319,6 +350,8 @@ public class SciDepartmentPublicationsTab implements GenericOrgaUnitTab {
final PageState state) {
final long start = System.currentTimeMillis();
final XmlGenerator generator = new XmlGenerator(publication);
generator.setUseExtraXml(false);
generator.setItemElemName("publication", "");
generator.generateXML(state, parent, "");
logger.debug(String.format(
"Generated XML for publication '%s' in %d ms.",

View File

@ -30,9 +30,10 @@ query getIdsOfProjectsOfOrgaUnit {
do {
select distinct on (ct_sci_projects.project_id) ct_sci_projects.project_id, cms_pages.title, ct_sci_projects.projectbegin, ct_sci_projects.projectend, cms_organizationalunits_hierarchy_map.superior_orgaunit_id
from ct_sci_projects
join cms_pages on ct_sci_project.project_id = cms_pages.item_id
join cms_organizationalunits_hierarchy_map on ct_sci_projects = cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id
join cms_pages on ct_sci_projects.project_id = cms_pages.item_id
join cms_organizationalunits_hierarchy_map on ct_sci_projects.project_id = cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id
where cms_organizationalunits_hierarchy_map.assoc_type = 'ProjectOf'
and cms_organizationalunits_hierarchy_map.superior_orgaunit_id in :orgaunitIds
} map {
projectId = ct_sci_projects.project_id;
orgaunitId = cms_organizationalunits_hierarchy_map.superior_orgaunit_id;

View File

@ -13,8 +13,8 @@
<xrd:property name="/object/fundingVolume"/>
</xrd:attributes>
<xrd:associations rule="include">
<!-- <xrd:property name="/object/contacts"/>
<xrd:property name="/object/persons"/> -->
<!-- <xrd:property name="/object/contacts"/> -->
<xrd:property name="/object/persons"/>
</xrd:associations>
</xrd:adapter>
</xrd:context>

View File

@ -17,8 +17,10 @@ import com.arsdigita.persistence.SessionManager;
import com.arsdigita.xml.Element;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.apache.log4j.Logger;
@ -105,7 +107,8 @@ public class SciProjectSummaryTab implements GenericOrgaUnitTab {
final Element beginSkipMonthElem = lifeSpanElem.newChildElement(
"beginSkipMonth");
beginSkipMonthElem.setText(project.getBeginSkipMonth().toString());
beginSkipMonthElem.setText(
project.getBeginSkipMonth().toString());
final Element beginSkipDayElem = lifeSpanElem.newChildElement(
"beginSkipDay");
@ -196,16 +199,19 @@ public class SciProjectSummaryTab implements GenericOrgaUnitTab {
retrieveQuery(
"com.arsdigita.cms.contenttypes.getIdsOfMembersOfOrgaUnits");
final StringBuffer personsFilter = new StringBuffer();
//final StringBuffer personsFilter = new StringBuffer();
final List<String> projectIds = new ArrayList<String>();
while (subProjectsQuery.next()) {
if (personsFilter.length() > 0) {
/*if (personsFilter.length() > 0) {
personsFilter.append(" or ");
}
personsFilter.append(String.format("orgaunitId = %s",
subProjectsQuery.get(
"orgaunitId").toString()));
"orgaunitId").toString()));*/
projectIds.add(subProjectsQuery.get("orgaunitId").toString());
}
personsQuery.addFilter(personsFilter.toString());
//personsQuery.addFilter(personsFilter.toString());
personsQuery.setParameter("orgaunitIds", projectIds);
personsQuery.addOrder(GenericPerson.SURNAME);
personsQuery.addOrder(GenericPerson.GIVENNAME);