Paginator für Publikationen in SciOrganizationPanel, SciDepartmentPanel und SciProjectPanel

git-svn-id: https://svn.libreccm.org/ccm/trunk@856 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-04-16 14:16:38 +00:00
parent e15122ddd9
commit 14acb9e358
1 changed files with 14 additions and 3 deletions

View File

@ -464,8 +464,7 @@ public abstract class SciOrganizationBasePanel
final Element parent, final Element parent,
final PageState state) { final PageState state) {
RelatedLink link; RelatedLink link;
ContentItem publication; ContentItem publication;
String objectType;
List<ContentItem> publications; List<ContentItem> publications;
publications = new ArrayList<ContentItem>(); publications = new ArrayList<ContentItem>();
@ -500,7 +499,19 @@ public abstract class SciOrganizationBasePanel
} }
}); });
for (ContentItem pub : publications) { long pageNumber = getPageNumber(state);
long pageCount = getPageCount(publications.size());
long begin = getPaginatorBegin(pageNumber);
long count = getPaginatorCount(begin, publications.size());
long end = getPaginatorEnd(begin, count);
pageNumber = normalizePageNumber(pageCount, pageNumber);
createPaginatorElement(parent, pageNumber, pageCount, begin, end, count,
end);
List<ContentItem> publicationsToShow = publications.subList((int) begin,
(int) end);
for (ContentItem pub : publicationsToShow) {
generatePublicationXML(pub, parent, state); generatePublicationXML(pub, parent, state);
} }
} }