From: Bruno Sinou Date: Mon, 12 Nov 2012 10:19:43 +0000 (+0000) Subject: remove some virtual folders from result tree view X-Git-Tag: argeo-slc-2.1.7~544 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=d38faac41402e2cb5a727ccb327f7f5d9c6f81f2;p=gpl%2Fargeo-slc.git remove some virtual folders from result tree view git-svn-id: https://svn.argeo.org/slc/trunk@5770 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/views/JcrResultTreeView.java b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/views/JcrResultTreeView.java index 57ea55eb6..9d5bb8cd9 100644 --- a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/views/JcrResultTreeView.java +++ b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/views/JcrResultTreeView.java @@ -370,7 +370,9 @@ public class JcrResultTreeView extends ViewPart { // Force initialization of the tree structure if needed SlcJcrResultUtils.getSlcResultsParentNode(session); SlcJcrResultUtils.getMyResultParentNode(session); - ResultParent[] roots = new ResultParent[5]; + // Remove yesterday and last 7 days virtual folders + // ResultParent[] roots = new ResultParent[5]; + ResultParent[] roots = new ResultParent[3]; // My results roots[0] = new ParentNodeFolder(null, @@ -386,33 +388,35 @@ public class JcrResultTreeView extends ViewPart { ResultParentUtils.getResultsForDates(session, datePathes), "Today"); - // Yesterday - cal = Calendar.getInstance(); - cal.add(Calendar.DAY_OF_YEAR, -1); - relPath = JcrUtils.dateAsPath(cal); - datePathes = new ArrayList(); - datePathes.add(relPath); - roots[2] = new VirtualFolder(null, - ResultParentUtils.getResultsForDates(session, datePathes), - "Yesterday"); - // Last 7 days - - cal = Calendar.getInstance(); - datePathes = new ArrayList(); - - for (int i = 0; i < 7; i++) { - cal.add(Calendar.DAY_OF_YEAR, -i); - relPath = JcrUtils.dateAsPath(cal); - datePathes.add(relPath); - } - roots[3] = new VirtualFolder(null, - ResultParentUtils.getResultsForDates(session, datePathes), - "Last 7 days"); + // // Yesterday + // cal = Calendar.getInstance(); + // cal.add(Calendar.DAY_OF_YEAR, -1); + // relPath = JcrUtils.dateAsPath(cal); + // datePathes = new ArrayList(); + // datePathes.add(relPath); + // roots[2] = new VirtualFolder(null, + // ResultParentUtils.getResultsForDates(session, datePathes), + // "Yesterday"); + // // Last 7 days + // + // cal = Calendar.getInstance(); + // datePathes = new ArrayList(); + // + // for (int i = 0; i < 7; i++) { + // cal.add(Calendar.DAY_OF_YEAR, -i); + // relPath = JcrUtils.dateAsPath(cal); + // datePathes.add(relPath); + // } + // roots[3] = new VirtualFolder(null, + // ResultParentUtils.getResultsForDates(session, datePathes), + // "Last 7 days"); // All results Node otherResultsPar = session.getNode(SlcJcrResultUtils .getSlcResultsBasePath(session)); - roots[4] = new ParentNodeFolder(null, otherResultsPar, + // roots[4] = new ParentNodeFolder(null, otherResultsPar, + // "All results"); + roots[2] = new ParentNodeFolder(null, otherResultsPar, "All results"); return roots; } catch (RepositoryException re) {