Package com.dotmarketing.beans

Examples of com.dotmarketing.beans.ContainerStructure


        String title = "Test container #"+UUIDGenerator.generateUuid();
        container.setTitle(title);
        container.setPreLoop("pre"); container.setPostLoop("post");
       
        List<ContainerStructure> containerStructureList = new ArrayList<ContainerStructure>();
        ContainerStructure cs=new ContainerStructure();
        cs.setStructureId(StructureCache.getStructureByVelocityVarName("webPageContent").getInode());
        cs.setCode("$body");
        containerStructureList.add(cs);
        container = APILocator.getContainerAPI().save(container, containerStructureList, host, user, false);
        String cInode=container.getInode();
       
        // clear cache lo ensure we load from hibernate
View Full Code Here


        String title = "Test container #"+UUIDGenerator.generateUuid();
        container.setTitle(title);
        container.setPreLoop("pre"); container.setPostLoop("post");
       
        List<ContainerStructure> containerStructureList = new ArrayList<ContainerStructure>();
        ContainerStructure cs=new ContainerStructure();
        cs.setStructureId(StructureCache.getStructureByVelocityVarName("webPageContent").getInode());
        cs.setCode("$body");
        containerStructureList.add(cs);
        container = APILocator.getContainerAPI().save(container, containerStructureList, host, user, false);
        String cInode=container.getInode();
       
       
        // 2nd
        container = new Container();
        String title2 = "Test 2nd container #"+UUIDGenerator.generateUuid();
        container.setTitle(title2);
        container.setPreLoop("pre"); container.setPostLoop("post");
        containerStructureList = new ArrayList<ContainerStructure>();
        cs=new ContainerStructure();
        cs.setStructureId(StructureCache.getStructureByVelocityVarName("webPageContent").getInode());
        cs.setCode("$body"); containerStructureList.add(cs);
        container = APILocator.getContainerAPI().save(container, containerStructureList, host, user, false);
        String cInode2=container.getInode();
        container = null;
       
        HibernateUtil.closeSession();
View Full Code Here

        container.setPreLoop( "preloop code" );
        container.setPostLoop( "postloop code" );
        //Save it

        List<ContainerStructure> csList = new ArrayList<ContainerStructure>();
        ContainerStructure cs = new ContainerStructure();
        cs.setStructureId(structure.getInode());
        cs.setCode("this is the code");
        csList.add(cs);

        container = APILocator.getContainerAPI().save( container, csList, defaultHost, user, false );

        //Create a template
View Full Code Here

        container.setPreLoop("preloop code");
        container.setPostLoop("postloop code");
        Structure st=StructureCache.getStructureByVelocityVarName("host");

        List<ContainerStructure> csList = new ArrayList<ContainerStructure>();
        ContainerStructure cs = new ContainerStructure();
        cs.setStructureId(st.getInode());
        cs.setCode("this is the code");
        csList.add(cs);
        container = APILocator.getContainerAPI().save(container, csList, host, user, false);


        String body="<html><body> #parseContainer('"+container.getIdentifier()+"') </body></html>";
View Full Code Here

      String[] structuresIds = structuresIdsStr.split("#");
      List<ContainerStructure> csList = new LinkedList<ContainerStructure>();

      for (String structureId : structuresIds) {
        String code = req.getParameter("code_"+structureId);
        ContainerStructure cs = new ContainerStructure();
        cs.setContainerId(container.getIdentifier());
        cs.setStructureId(structureId);
        cs.setCode(code);
        csList.add(cs);
      }

      APILocator.getContainerAPI().saveContainerStructures(csList);
View Full Code Here

      List<ContainerStructure> sourceCS = APILocator.getContainerAPI().getContainerStructures(currentContainer);
      List<ContainerStructure> newContainerCS = new LinkedList<ContainerStructure>();

      for (ContainerStructure oldCS : sourceCS) {
        ContainerStructure newCS = new ContainerStructure();
        newCS.setContainerId(newContainer.getIdentifier());
        newCS.setStructureId(oldCS.getStructureId());
        newCS.setCode(oldCS.getCode());
        newContainerCS.add(newCS);
      }

      APILocator.getContainerAPI().saveContainerStructures(newContainerCS);
View Full Code Here

      List<ContainerStructure> sourceCS = getContainerStructures(source);
      List<ContainerStructure> newContainerCS = new LinkedList<ContainerStructure>();

      for (ContainerStructure oldCS : sourceCS) {
        ContainerStructure newCS = new ContainerStructure();
        newCS.setContainerId(newContainer.getIdentifier());
        newCS.setStructureId(oldCS.getStructureId());
        newCS.setCode(oldCS.getCode());
        newContainerCS.add(newCS);
      }

      saveContainerStructures(newContainerCS);
View Full Code Here

        User user = APILocator.getUserAPI().getSystemUser();
        Host host = APILocator.getHostAPI().findDefaultHost(user, false);

        List<ContainerStructure> csList = new ArrayList<ContainerStructure>();
        ContainerStructure cs = new ContainerStructure();
        cs.setStructureId(st.getInode());
        cs.setCode("this is the code");
        csList.add(cs);

        cc = APILocator.getContainerAPI().save(cc, csList, host, user, false);

        assertTrue(UtilMethods.isSet(cc.getInode()));
        assertTrue(UtilMethods.isSet(cc.getIdentifier()));

        cc = APILocator.getContainerAPI().getWorkingContainerById(cc.getIdentifier(), user, false);

        assertTrue(UtilMethods.isSet(cc.getInode()));
        assertTrue(UtilMethods.isSet(cc.getIdentifier()));

        List<ContainerStructure> csListCopy = APILocator.getContainerAPI().getContainerStructures(cc);
        ContainerStructure csCopy = csListCopy.get(0);
        assertTrue(csCopy.getCode().equals(cs.getCode()));
        assertTrue(cc.getFriendlyName().equals(c.getFriendlyName()));
        assertTrue(cc.getTitle().equals(c.getTitle()));
        assertTrue(cc.getMaxContentlets()==c.getMaxContentlets());
        assertTrue(cc.getPreLoop().equals(c.getPreLoop()));
        assertTrue(cc.getPostLoop().equals(c.getPostLoop()));
View Full Code Here

        User user = APILocator.getUserAPI().getSystemUser();
        Host host = APILocator.getHostAPI().findDefaultHost(user, false);

        List<ContainerStructure> csList = new ArrayList<ContainerStructure>();
        ContainerStructure cs = new ContainerStructure();
        cs.setStructureId(st.getInode());
        cs.setCode("this is the code");
        csList.add(cs);

        cc = APILocator.getContainerAPI().save(cc, csList, host, user, false);

        assertTrue(UtilMethods.isSet(cc.getInode()));
View Full Code Here

        User user = APILocator.getUserAPI().getSystemUser();
        Host host = APILocator.getHostAPI().findDefaultHost(user, false);

        List<ContainerStructure> csList = new ArrayList<ContainerStructure>();
        ContainerStructure cs = new ContainerStructure();
        cs.setStructureId(st.getInode());
        cs.setCode("this is the code");
        csList.add(cs);
        Container saved = APILocator.getContainerAPI().save(container, csList, host, user, false);

        String inode=saved.getInode();
        String identifier=saved.getIdentifier();
View Full Code Here

TOP

Related Classes of com.dotmarketing.beans.ContainerStructure

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.