Package org.infoglue.cms.controllers.kernel.impl.simple

Examples of org.infoglue.cms.controllers.kernel.impl.simple.ContentVersionController


      {
      Collection containerNodes = sup.getChildContainerNodes(parent);
      Collection childNodes = sup.getChildLeafNodes(parent);
     
      ContentController contentController = ContentController.getContentController();
      ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();

      Iterator it = containerNodes.iterator();
      while (it.hasNext())
      {
        BaseNode theNode = (BaseNode) it.next();
        if (theNode.isContainer() && sup.hasChildren())
        {
          theNode.setChildren(sup.hasChildren(theNode.getId()));
        }
       
        // String src = theNode.hasChildren() ? action + "?repositoryId=" + repositoryId + urlArgSeparator + "parent=" + theNode.getId(): "";
        String src = action + "?repositoryId=" + repositoryId + urlArgSeparator + (sortLanguageId != null ? "sortLanguageId=" + sortLanguageId : "") + urlArgSeparator + "parent=" + theNode.getId();
        if(createAction && src.length() >0) src += urlArgSeparator + "createAction=true";
        if(createAction && src.length() >0) src += urlArgSeparator + "showLeafs=" + showLeafs;
        if(action.length()>0 && src.length() >0) src += urlArgSeparator + "action=" + action;
        String allowedContentTypeIdsUrlEncodedString = getAllowedContentTypeIdsAsUrlEncodedString();
        if(allowedContentTypeIdsUrlEncodedString.length()>0 && src.length() >0) src += urlArgSeparator + allowedContentTypeIdsUrlEncodedString;
         
            Element elm = root.addElement("tree");
            elm
              .addAttribute("id", "" + theNode.getId())
              .addAttribute("parent", "" + parent)
              .addAttribute("repositoryId", "" + repositoryId)
              .addAttribute("text", encode(theNode.getTitle()))
              .addAttribute("src", src)
              .addAttribute("isLocalized", (String)theNode.getParameters().get("isLocalized"))
              .addAttribute("isLanguageAvailable", (String)theNode.getParameters().get("isLanguageAvailable"))
              .addAttribute("isHidden", (String)theNode.getParameters().get("isHidden"))
              .addAttribute("type", TYPE_FOLDER)
              .addAttribute("hasChildren", "" + theNode.hasChildren());
           
            if(theNode.getParameters().containsKey("contentTypeDefinitionId"))
              elm.addAttribute("contentTypeDefinitionId", "" + theNode.getParameters().get("contentTypeDefinitionId"));
           
            if(theNode.getParameters().containsKey("isProtected"))
              elm.addAttribute("isProtected", (String)theNode.getParameters().get("isProtected"));

            if(theNode.getParameters().containsKey("stateId"))
              elm.addAttribute("stateId", (String)theNode.getParameters().get("stateId"));

            if(createAction) elm.addAttribute("action", makeAction(theNode));
      }
      
      it = childNodes.iterator();
      while (it.hasNext())
      {
        BaseNode theNode = (BaseNode) it.next();
       
        String text = theNode.getTitle();
        String action = makeAction(theNode);
            String type = TYPE_ITEM;
            Element elm = root.addElement("tree");
            elm
              .addAttribute("id", "" + theNode.getId())
              .addAttribute("parent", "" + parent)
              .addAttribute("repositoryId", "" + repositoryId)
              .addAttribute("text", encode(text))
              .addAttribute("type", type)
        ;

            if(theNode.getParameters().containsKey("contentTypeDefinitionId"))
              elm.addAttribute("contentTypeDefinitionId", "" + theNode.getParameters().get("contentTypeDefinitionId"));

            if(theNode.getParameters().containsKey("isProtected"))
              elm.addAttribute("isProtected", (String)theNode.getParameters().get("isProtected"));

            if(theNode.getParameters().containsKey("stateId"))
              elm.addAttribute("stateId", (String)theNode.getParameters().get("stateId"));

            if(createAction)
              elm.addAttribute("action", action);
            else
            {
              ContentVersionVO activeVersion = contentVersionController.getLatestActiveContentVersionVO(theNode.getId(), LanguageController.getController().getMasterLanguage(repositoryId).getLanguageId());
              if(activeVersion!=null && !useTemplate)
              {
                  elm.addAttribute("activeVersion", "" + activeVersion.getContentVersionId());
                  elm.addAttribute("activeVersionStateId", "" + activeVersion.getStateId());
                  elm.addAttribute("activeVersionModifier", "" + activeVersion.getVersionModifier());
View Full Code Here


   * This is a method to get hold of the SiteNodeVersionController.
   */
 
  public ContentVersionController getContentVersionController()
  {
    return new ContentVersionController();
  }
View Full Code Here

   
    public Element getContentElement(ContentVO vo) throws Bug, Exception
    {
        Element elm = DocumentHelper.createElement("content");
       
    ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();
        ContentVersionVO activeVersion = contentVersionController.getLatestActiveContentVersionVO(vo.getContentId(), LanguageController.getController().getMasterLanguage(vo.getRepositoryId()).getLanguageId());
        if(activeVersion!=null)
        {
          elm.addAttribute("id", "" + vo.getContentId());
          elm.addAttribute("creatorName", "" + vo.getCreatorName());
          elm.addAttribute("name", "" + vo.getName());
          elm.addAttribute("typedefid", "" + vo.getContentTypeDefinitionId());
          elm.addAttribute("expiredatetime", "" + vo.getExpireDateTime().getTime());
          elm.addAttribute("publishdatetime", "" + vo.getPublishDateTime().getTime());
          elm.addAttribute("isbranch", "" + vo.getIsBranch());
            elm.addAttribute("activeVersion", "" + activeVersion.getContentVersionId());
            elm.addAttribute("activeVersionStateId", "" + activeVersion.getStateId());
            elm.addAttribute("activeVersionModifier", "" + activeVersion.getVersionModifier());
            Element versionsElement = DocumentHelper.createElement("versions");
            elm.add(versionsElement);
           
            List<ContentVersionVO> versions = contentVersionController.getContentVersionVOWithParent(vo.getContentId());
            for(ContentVersionVO version: versions)
            {
              Element contentVersionElement = DocumentHelper.createElement("contentVersion");
              contentVersionElement.add(getContentVersionHeadElement(version));
              versionsElement.add(contentVersionElement);
View Full Code Here

        return elm;
    }

    public Element getContentVersionElement(Integer contentVersionId) throws SystemException, Bug, UnsupportedEncodingException
    {
    ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();
        ContentVersionVO vo = contentVersionController.getContentVersionVOWithId(contentVersionId);
        if(vo.getLanguageName() == null || vo.getLanguageName().equals("") && vo.getLanguageId() != null)
        {
          try
          {
            vo.setLanguageName(LanguageController.getController().getLanguageVOWithId(vo.getLanguageId()).getLanguageCode());
View Full Code Here

        return getContentVersionElement(vo);
    }
   
    public Element getContentVersionHeadElement(Integer contentVersionId) throws SystemException, Bug, UnsupportedEncodingException
    {
    ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();
        ContentVersionVO vo = contentVersionController.getContentVersionVOWithId(contentVersionId);
        if(vo.getLanguageName() == null || vo.getLanguageName().equals("") && vo.getLanguageId() != null)
        {
          try
          {
            vo.setLanguageName(LanguageController.getController().getLanguageVOWithId(vo.getLanguageId()).getLanguageCode());
View Full Code Here

          ContentVersionVO vo = getLatestContentVersionVO(parent, lvo.getLanguageId());
          if(vo!=null)
            root.add(getContentVersionElement(vo));
        }
       
    ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();
        return out(getFormattedDocument(doc));
  }
View Full Code Here

  {
    if(contentVO != null)
    {
      try
      {
        final ContentVersionController controller = ContentVersionController.getContentVersionController();
        setContentVersionVO(controller.getLatestActiveContentVersionVO(contentVO.getId(), languageVO.getId(), getDatabase()));
      }
      catch(Exception e)
      {
        throwException(e);
      }
View Full Code Here

    return contentVersionVO;
  }

    public Element getContentVersionElement(Integer contentVersionId) throws SystemException, Bug, UnsupportedEncodingException
    {
    ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();
        ContentVersionVO vo = contentVersionController.getContentVersionVOWithId(contentVersionId);
        return getContentVersionElement(vo);
    }
View Full Code Here

          ContentVersionVO vo = getLatestContentVersionVO(parent, lvo.getLanguageId());
          if(vo!=null)
            root.add(getContentVersionElement(vo));
        }
       
    ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();
        return out(getFormattedDocument(doc));
  }
View Full Code Here

      {
      Collection containerNodes = sup.getChildContainerNodes(parent);
      Collection childNodes = sup.getChildLeafNodes(parent);
     
      ContentController contentController = ContentController.getContentController();
      ContentVersionController contentVersionController = ContentVersionController.getContentVersionController();

      Iterator it = containerNodes.iterator();
      while (it.hasNext())
      {
        BaseNode theNode = (BaseNode) it.next();
        if (theNode.isContainer() && sup.hasChildren())
        {
          theNode.setChildren(sup.hasChildren(theNode.getId()));
        }
       
        String src = theNode.hasChildren() ? action + "?repositoryId=" + repositoryId + urlArgSeparator + "parent=" + theNode.getId(): "";
        if(createAction && src.length() >0) src += urlArgSeparator + "createAction=true";
        if(createAction && src.length() >0) src += urlArgSeparator + "showLeafs=" + showLeafs;
        if(action.length()>0 && src.length() >0) src += urlArgSeparator + "action=" + action;
        String allowedContentTypeIdsUrlEncodedString = getAllowedContentTypeIdsAsUrlEncodedString();
          if(allowedContentTypeIdsUrlEncodedString.length()>0 && src.length() >0) src += urlArgSeparator + allowedContentTypeIdsUrlEncodedString;
             
            Element elm = root.addElement("tree");
            elm
              .addAttribute("id", "" + theNode.getId())
              .addAttribute("parent", "" + parent)
              .addAttribute("repositoryId", "" + repositoryId)
              .addAttribute("text", theNode.getTitle())
              .addAttribute("src", src)
              .addAttribute("type", TYPE_FOLDER);
           
           
            if(createAction) elm.addAttribute("action", makeAction(theNode));
      }
     
      it = childNodes.iterator();
      while (it.hasNext())
      {
        BaseNode theNode = (BaseNode) it.next();
        String text = theNode.getTitle();
        String action = makeAction(theNode);
            String type = TYPE_ITEM;
            Element elm = root.addElement("tree");
            elm
              .addAttribute("id", "" + theNode.getId())
              .addAttribute("parent", "" + parent)
              .addAttribute("repositoryId", "" + repositoryId)
              .addAttribute("text", text)
              .addAttribute("type", type)
        ;
            if(createAction)
              elm.addAttribute("action", action);
            else
            {
              ContentVersionVO activeVersion = contentVersionController.getLatestActiveContentVersionVO(theNode.getId(), LanguageController.getController().getMasterLanguage(repositoryId).getLanguageId());
              if(activeVersion!=null && !useTemplate)
                  elm.addAttribute("activeVersion", "" + activeVersion.getContentVersionId());
            }
           
            if(!useTemplate)
View Full Code Here

TOP

Related Classes of org.infoglue.cms.controllers.kernel.impl.simple.ContentVersionController

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.