Package com.dotmarketing.beans

Examples of com.dotmarketing.beans.Tree


        /*//Validations
        assertTrue( foundContentlets != null && !foundContentlets.isEmpty() );*/

        //Verify if the content was related
        Tree tree = TreeFactory.getTree( parentContentlet.getIdentifier(), childContentlet.getIdentifier(), testRelationship.getRelationTypeValue() );

        //Validations
        assertNotNull( tree );
        assertNotNull( tree.getParent() );
        assertNotNull( tree.getChild() );
        assertEquals( tree.getParent(), parentContentlet.getIdentifier() );
        assertEquals( tree.getChild(), childContentlet.getIdentifier() );
        assertEquals( tree.getRelationType(), testRelationship.getRelationTypeValue() );
    }
View Full Code Here


        /*//Validations
        assertTrue( foundContentlets != null && !foundContentlets.isEmpty() );*/

        //Verify if the content was related
        Tree tree = TreeFactory.getTree( parentContentlet.getIdentifier(), childContentlet.getIdentifier(), testRelationship.getRelationTypeValue() );

        //Validations
        assertNotNull( tree );
        assertNotNull( tree.getParent() );
        assertNotNull( tree.getChild() );
        assertEquals( tree.getParent(), parentContentlet.getIdentifier() );
        assertEquals( tree.getChild(), childContentlet.getIdentifier() );
        assertEquals( tree.getRelationType(), testRelationship.getRelationTypeValue() );
    }
View Full Code Here

        related.setRecords(records);
        relateContent(contentlet, related, user, respectFrontendRoles);
    }

    private Tree getTree(String parent, String child, String relationType, List<Tree> trees) {
        Tree result = new Tree();

        for (Tree tree: trees) {
            if ((tree.getParent().equals(parent)) &&
                (tree.getChild().equals(child)) &&
                (tree.getRelationType().equals(relationType))) {
View Full Code Here

      catch(Exception e){
        throw new DotDataException(e.getMessage());
      }
     
      deleteRelatedContent(contentlet, related.getRelationship(), related.isHasParent(), user, respectFrontendRoles);
          Tree newTree = null;
          Set<Tree> uniqueRelationshipSet = new HashSet<Tree>();
 
          Relationship rel = related.getRelationship();
          List<Contentlet> conRels = RelationshipFactory.getAllRelationshipRecords(related.getRelationship(), contentlet, related.isHasParent());
 
          int treePosition = (conRels != null && conRels.size() != 0) ? conRels.size() : 1 ;
          int positionInParent = 1;
         
          for (Contentlet c : related.getRecords()) {
              if (child) {
                  newTree = new Tree(c.getIdentifier(), contentlet.getIdentifier(), rel.getRelationTypeValue(), positionInParent);
              } else {
                  newTree = new Tree(contentlet.getIdentifier(), c.getIdentifier(), rel.getRelationTypeValue(), treePosition);
              }
              positionInParent=positionInParent+1;
             
              if( uniqueRelationshipSet.add(newTree) ) {
                int newTreePosistion = newTree.getTreeOrder();
                Tree treeToUpdate = TreeFactory.getTree(newTree);
                treeToUpdate.setTreeOrder(newTreePosistion);
 
                if(treeToUpdate != null && UtilMethods.isSet(treeToUpdate.getRelationType()))
                  TreeFactory.saveTree(treeToUpdate);
                else
                  TreeFactory.saveTree(newTree);
 
                treePosition++;
View Full Code Here

TOP

Related Classes of com.dotmarketing.beans.Tree

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.