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,
|
||||
ContentPage.TITLE);
|
||||
private final TextFilter authorFilter;
|
||||
private boolean excludeWorkingPapers = false;
|
||||
private boolean onlyWorkingPapers = false;
|
||||
|
||||
static {
|
||||
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) {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
|
|
@ -105,6 +115,22 @@ public class SciInstitutePublicationsTab implements GenericOrgaUnitTab {
|
|||
final Element filtersElem = publicationsElem.newChildElement(
|
||||
"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())
|
||||
&& ((titleValue == null) || titleValue.trim().isEmpty())
|
||||
&& ((authorValue == null) || authorValue.trim().isEmpty())) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue