Beim SciInstitutePublicationsTab kann jetzt eingestellt werden, dass nur Publikationen es Typs WorkingPaper angezeigt werden
bzw. diese ausgeschlossen werden. Wird für bestimmte Anwendungsfälle benötigt. git-svn-id: https://svn.libreccm.org/ccm/trunk@1276 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
b37fd9c47e
commit
fbb91c0767
|
|
@ -51,6 +51,8 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
||||||
private final TextFilter titleFilter = new TextFilter(TITLE_PARAM,
|
private final TextFilter titleFilter = new TextFilter(TITLE_PARAM,
|
||||||
ContentPage.TITLE);
|
ContentPage.TITLE);
|
||||||
private final TextFilter authorFilter;
|
private final TextFilter authorFilter;
|
||||||
|
private boolean excludeWorkingPapers = false;
|
||||||
|
private boolean onlyWorkingPapers = false;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
config.load();
|
config.load();
|
||||||
|
|
@ -66,6 +68,14 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setExcludeWorkingPapers(final boolean excludeWorkingPapers) {
|
||||||
|
this.excludeWorkingPapers = excludeWorkingPapers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnlyWorkingPapers(final boolean onlyWorkingPapers) {
|
||||||
|
this.onlyWorkingPapers = onlyWorkingPapers;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasData(final GenericOrganizationalUnit orgaunit) {
|
public boolean hasData(final GenericOrganizationalUnit orgaunit) {
|
||||||
final long start = System.currentTimeMillis();
|
final long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
|
@ -105,6 +115,22 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
||||||
final Element filtersElem = publicationsElem.newChildElement(
|
final Element filtersElem = publicationsElem.newChildElement(
|
||||||
"filters");
|
"filters");
|
||||||
|
|
||||||
|
if (excludeWorkingPapers && onlyWorkingPapers) {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"onlyWorkingPapers and excludeWorkingPapers are both set "
|
||||||
|
+ "to true. This is not possible.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (excludeWorkingPapers) {
|
||||||
|
publications.addFilter(
|
||||||
|
"objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onlyWorkingPapers) {
|
||||||
|
publications.addFilter(
|
||||||
|
"objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'");
|
||||||
|
}
|
||||||
|
|
||||||
if (((yearValue == null) || yearValue.trim().isEmpty())
|
if (((yearValue == null) || yearValue.trim().isEmpty())
|
||||||
&& ((titleValue == null) || titleValue.trim().isEmpty())
|
&& ((titleValue == null) || titleValue.trim().isEmpty())
|
||||||
&& ((authorValue == null) || authorValue.trim().isEmpty())) {
|
&& ((authorValue == null) || authorValue.trim().isEmpty())) {
|
||||||
|
|
@ -123,7 +149,7 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
||||||
publications.setRange(1, config.getGreetingSize() + 1);
|
publications.setRange(1, config.getGreetingSize() + 1);
|
||||||
|
|
||||||
yearFilter.setDataQuery(publications, "year");
|
yearFilter.setDataQuery(publications, "year");
|
||||||
|
|
||||||
yearFilter.generateXml(filtersElem);
|
yearFilter.generateXml(filtersElem);
|
||||||
titleFilter.generateXml(filtersElem);
|
titleFilter.generateXml(filtersElem);
|
||||||
authorFilter.generateXml(filtersElem);
|
authorFilter.generateXml(filtersElem);
|
||||||
|
|
@ -273,7 +299,7 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*publicationsFilter.append(String.format("orgaunitId = %s",
|
/*publicationsFilter.append(String.format("orgaunitId = %s",
|
||||||
orgaunit.getID().toString()));*/
|
orgaunit.getID().toString()));*/
|
||||||
orgaunitIds.add(orgaunit.getID().toString());
|
orgaunitIds.add(orgaunit.getID().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -296,7 +322,7 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
||||||
yearFilter.setValue(yearValue);
|
yearFilter.setValue(yearValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((yearFilter.getFilter() != null)
|
if ((yearFilter.getFilter() != null)
|
||||||
&& !(yearFilter.getFilter().isEmpty())) {
|
&& !(yearFilter.getFilter().isEmpty())) {
|
||||||
publications.addFilter(yearFilter.getFilter());
|
publications.addFilter(yearFilter.getFilter());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue