X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fmodel%2FParentNodeFolder.java;h=51ffb11182ab545431ad6478f73f82ff40505ad6;hb=e797ab69fbb9d6a4abe901155108ab8155ceba5b;hp=91163c84248001308df6266cd6267bd2019b2330;hpb=d50c0fe50cd69947bc7146991afa0826a8c8f53b;p=gpl%2Fargeo-slc.git
diff --git a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ParentNodeFolder.java b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ParentNodeFolder.java
index 91163c842..51ffb1118 100644
--- a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ParentNodeFolder.java
+++ b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/model/ParentNodeFolder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007-2012 Mathieu Baudier
+ * Copyright (C) 2007-2012 Argeo GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,16 +21,24 @@ import javax.jcr.RepositoryException;
import javax.jcr.nodetype.NodeType;
import org.argeo.slc.SlcException;
-import org.argeo.slc.jcr.SlcJcrResultUtils;
import org.argeo.slc.jcr.SlcNames;
import org.argeo.slc.jcr.SlcTypes;
/**
- * UI Tree component that wrap a node of type NT_UNSTRUCTURED. list either
- * result folders, other folders and/or a list of results. keeps a reference to
- * its parent.
+ * UI Tree component that wrap a node of type NT_UNSTRUCTURED or base node for
+ * UI specific, user defined tree structure of type SLC_MY_RESULTS_ROOT_FOLDER.
+ *
+ * It is used for
+ *
+ * - automatically generated tree structure to store results (typically
+ * Year/Month/Day...)
+ * - parent node for user defined tree structure (typically My Results node)
+ *
+ * It thus lists either result folders, other folders and/or a list of results
+ * and keeps a reference to its parent.
*/
public class ParentNodeFolder extends ResultParent {
+ // private final static Log log = LogFactory.getLog(ParentNodeFolder.class);
private Node node = null;
@@ -65,42 +73,40 @@ public class ParentNodeFolder extends ResultParent {
ResultFolder rf = new ResultFolder(this, currNode,
currNode.getName());
addChild(rf);
+ } else if (currNode.isNodeType(SlcTypes.SLC_CHECK)) {
+ // FIXME : manually skip node types that are not to be
+ // displayed
+ // Do nothing
} else if (currNode.isNodeType(NodeType.NT_UNSTRUCTURED))
addChild(new ParentNodeFolder(this, currNode,
currNode.getName()));
}
} catch (RepositoryException re) {
throw new SlcException(
- "Unexpected error while initializing simple node folder : "
+ "Unexpected error while initializing ParentNodeFolder : "
+ getName(), re);
}
}
- @Override
- public synchronized void dispose() {
- super.dispose();
- }
-
public Node getNode() {
return node;
}
- /**
- * Overriden in the specific case of "My result" root object to return an
- * ordered list of children
- */
- public synchronized Object[] getChildren() {
- Object[] children = super.getChildren();
- try {
- if (node.getPath().equals(
- SlcJcrResultUtils.getMyResultsBasePath(node.getSession())))
- return ResultParentUtils.orderChildren(children);
- else
- return children;
- } catch (RepositoryException re) {
- throw new SlcException(
- "Unexpected error while initializing simple node folder : "
- + getName(), re);
- }
- }
+ // /**
+ // * Overriden in the specific case of "My result" root object to return an
+ // * ordered list of children
+ // */
+ // public synchronized Object[] getChildren() {
+ // Object[] children = super.getChildren();
+ // try {
+ // if (node.isNodeType(SlcTypes.SLC_MY_RESULT_ROOT_FOLDER))
+ // return ResultParentUtils.orderChildren(children);
+ // else
+ // return children;
+ // } catch (RepositoryException re) {
+ // throw new SlcException(
+ // "Unexpected error while initializing simple node folder : "
+ // + getName(), re);
+ // }
+ // }
}
\ No newline at end of file