Package net.sf.archimede.jsf.component.tree

Examples of net.sf.archimede.jsf.component.tree.CustomTreeNode


        return "";
    }
   
    public String removeVersion() {
        FolderDao folderDao = FolderDao.createInstance();
        CustomTreeNode ctn = (CustomTreeNode) this.versionsTreeModel.getNode();
        folderDao.removeVersion((Folder) ctn.getContent());
       
        Folder folder = folderDao.retrieve(this.selectedFolder.getId());
        this.selectedFolder = new ViewFolder(folder);
        this.metadataTreeModel = getMetadataTreeNode();
        this.versionsTreeModel = getVersionsTreeNode();
View Full Code Here


      metadataEmpty = false;
      this.selectedFolder = new ViewFolder(FolderDao.createInstance().retrieve(this.selectedFolder.getId()));
        List metadatas = this.selectedFolder.getMetadatas();
        String rootName = "metadatas";
       
        CustomTreeNode treeData = new CustomTreeNode("root", rootName, false);
        treeData.setContent(this.selectedFolder);
       
        int metadataCount = 0;
        List paths = new ArrayList();
        for (Iterator it = metadatas.iterator(); it.hasNext(); metadataCount++) {
            Metadata currentMetadata = (Metadata) it.next();
            CustomTreeNode tnb = new CustomTreeNode("metadata", currentMetadata.getName(), false);
            tnb.setContent(currentMetadata);
            tnb.setIdentifier(currentMetadata.getId());
            treeData.getChildren().add(tnb);
           
            this.addUIElement(tnb, currentMetadata.getRootElement());
           
            paths.add(tnb.getIdentifier());
           
            //On affiche 50 elements et moins...
            //for (int i = 0; i < currentMetadata.getRootElement().getElements().size(); i++) {
           
//            List childElements = currentMetadata.getRootElement().getElements();
View Full Code Here

    private void addUIElement(CustomTreeNode elementNode, Element element) {
        String elementName = "element";
        if (element.isValue()) {
            elementName = "valueElement";
        }
        CustomTreeNode tnb = new CustomTreeNode(elementName, element.getName(), false);

        tnb.setContent(new ViewElement(element));
        elementNode.getChildren().add(tnb);
        tnb.setParent(elementNode);
       
        if (!(element.isValue())) {
            List attributes = element.getAttributes();
            Iterator attrIt = attributes.iterator();
            while(attrIt.hasNext()) {
                Attribute currentAttr = (Attribute) attrIt.next();
                CustomTreeNode attributeTreeNode = new CustomTreeNode("attribute", currentAttr.getName(), false);
                attributeTreeNode.setContent(currentAttr);
                attributeTreeNode.setParent(tnb);
                tnb.getChildren().add(attributeTreeNode);
            }
           
            List childElements = element.getElements();
            Iterator elementsIt = childElements.iterator();
View Full Code Here

    }
   

   
    public String addElement() throws ObjectLockedException, ObjectExistsException {
        CustomTreeNode tnb = (CustomTreeNode) this.metadataTreeModel.getNode();
        ViewElement selectedViewElement = (ViewElement) tnb.getContent();
        String elementName = selectedViewElement.getSelectedNamedChildElementName();
       
        for (Iterator childTypesIt = selectedViewElement.getNamedChildElementTypes().iterator(); childTypesIt.hasNext(); ) {
            ElementType currentElementType = (ElementType) childTypesIt.next();
            if (currentElementType.getName().equals(elementName)) {
View Full Code Here

       
        return "";
    }
   
    public String removeMetadata() {
      CustomTreeNode tnb = (CustomTreeNode) this.metadataTreeModel.getNode();
      Metadata selectedMetadata = (Metadata) tnb.getContent();
      this.selectedFolder.getMetadatas().remove(selectedMetadata);
      MetadataDao metadataDao = MetadataDao.createInstance();
      try {
        metadataDao.remove(selectedMetadata);
      } catch (ObjectLockedException e) {
View Full Code Here

        this.metadataTreeModel = getMetadataTreeNode();
        return "";
    }
   
    public String copyElement() throws ObjectLockedException, ObjectExistsException {
        CustomTreeNode tnb = (CustomTreeNode) this.metadataTreeModel.getNode();
        Element selectedElement = (Element) tnb.getContent();
        Element parentElement = selectedElement.getParent();
        List elements = parentElement.getElements();
        elements.add(selectedElement.relativeClone());
        MetadataDao.createInstance().update(parentElement.getMetadataParent());
        this.metadataTreeModel = getMetadataTreeNode();
View Full Code Here

        this.metadataTreeModel = getMetadataTreeNode();
        return "";
    }
   
    public String removeElement() {
        CustomTreeNode tnb = (CustomTreeNode) this.metadataTreeModel.getNode();
        ViewElement currentElement = (ViewElement) tnb.getContent();
        Element parentElement = currentElement.getParent();
        List elements = parentElement.getElements();
        elements.remove(currentElement.getElement());
        try {
      MetadataDao.createInstance().update(parentElement.getMetadataParent());
View Full Code Here

   
    private TreeNode getTreeData() {
        List metadatas = this.selectedFolder.getMetadatas();
        String rootName = "metadatas";
       
        CustomTreeNode treeData = new CustomTreeNode("root", rootName, false);
        treeData.setContent(this.selectedFolder);
       
        Iterator it = metadatas.iterator();
        while(it.hasNext()) {
            Metadata currentMetadata = (Metadata) it.next();
            CustomTreeNode tnb = new CustomTreeNode("metadata", currentMetadata.getName(), false);
            tnb.setContent(currentMetadata);
            tnb.setIdentifier(currentMetadata.getId());
            treeData.getChildren().add(tnb);
           
            this.addUIElement(tnb, currentMetadata.getRootElement());
        }
        return treeData;
View Full Code Here

        if (!attrIt.hasNext()) {
            System.out.println(element.getName() + " has no attributes");
        }
        while(attrIt.hasNext()) {
            Attribute currentAttr = (Attribute) attrIt.next();
            CustomTreeNode tnb = new CustomTreeNode("attribute", currentAttr.getName(), false);
            tnb.setContent(currentAttr);
            tnb.setParent(elementNode);
            //tnbFile.setIdentifier(currentAttr.getId());
            elementNode.getChildren().add(tnb);
        }
       
        List childElements = element.getElements();
        Iterator elementsIt = childElements.iterator();
        while(elementsIt.hasNext()) {
            Element currentElement = (Element) elementsIt.next();
            CustomTreeNode tnb = new CustomTreeNode("element", currentElement.getName(), false);
            tnb.setContent(currentElement);
            //tnb.setIdentifier(currentElement.getId());
            elementNode.getChildren().add(tnb);
            elementNode.setParent(elementNode);
            this.addUIElement(tnb, currentElement);
        }
View Full Code Here

TOP

Related Classes of net.sf.archimede.jsf.component.tree.CustomTreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.