]>
git.argeo.org Git - gpl/argeo-slc.git/blob - cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/model/ParentNodeFolder.java
1 package org
.argeo
.slc
.client
.ui
.model
;
4 import javax
.jcr
.NodeIterator
;
5 import javax
.jcr
.RepositoryException
;
6 import javax
.jcr
.nodetype
.NodeType
;
8 import org
.argeo
.slc
.SlcException
;
9 import org
.argeo
.slc
.SlcNames
;
10 import org
.argeo
.slc
.SlcTypes
;
13 * UI Tree component that wrap a node of type NT_UNSTRUCTURED or base node for
14 * UI specific, user defined tree structure of type SLC_MY_RESULTS_ROOT_FOLDER.
18 * <li>automatically generated tree structure to store results (typically
19 * Year/Month/Day...)</li>
20 * <li>parent node for user defined tree structure (typically My Results node)</li>
22 * It thus lists either result folders, other folders and/or a list of results
23 * and keeps a reference to its parent.
25 public class ParentNodeFolder
extends ResultParent
{
26 // private final static Log log = LogFactory.getLog(ParentNodeFolder.class);
28 private Node node
= null;
34 * throws an exception if null
37 public ParentNodeFolder(ParentNodeFolder parent
, Node node
, String name
) {
40 throw new SlcException("Node Object cannot be null");
46 protected void initialize() {
48 NodeIterator ni
= node
.getNodes();
49 while (ni
.hasNext()) {
50 Node currNode
= ni
.nextNode();
51 if (currNode
.isNodeType(SlcTypes
.SLC_TEST_RESULT
)) {
52 SingleResultNode srn
= new SingleResultNode(this, currNode
,
53 currNode
.getProperty(SlcNames
.SLC_TEST_CASE
)
56 } else if (currNode
.isNodeType(SlcTypes
.SLC_RESULT_FOLDER
)) {
58 ResultFolder rf
= new ResultFolder(this, currNode
,
61 } else if (currNode
.isNodeType(SlcTypes
.SLC_CHECK
)) {
62 // FIXME : manually skip node types that are not to be
65 } else if (currNode
.isNodeType(NodeType
.NT_UNSTRUCTURED
))
66 addChild(new ParentNodeFolder(this, currNode
,
69 } catch (RepositoryException re
) {
70 throw new SlcException(
71 "Unexpected error while initializing ParentNodeFolder : "
76 public Node
getNode() {
81 // * Overriden in the specific case of "My result" root object to return an
82 // * ordered list of children
84 // public synchronized Object[] getChildren() {
85 // Object[] children = super.getChildren();
87 // if (node.isNodeType(SlcTypes.SLC_MY_RESULT_ROOT_FOLDER))
88 // return ResultParentUtils.orderChildren(children);
91 // } catch (RepositoryException re) {
92 // throw new SlcException(
93 // "Unexpected error while initializing simple node folder : "