Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.RepositoryVO


      if(repositoryId == null)
      {
          List repositories = RepositoryController.getController().getAuthorizedRepositoryVOList(this.getInfoGluePrincipal(), false);
          for(Iterator i=repositories.iterator();i.hasNext();)
          {
              RepositoryVO r = (RepositoryVO) i.next();
          BaseEntityVO entityVO = getRootEntityVO(r.getId(), this.getInfoGluePrincipal());
             
              String src= action + "?repositoryId=" + r.getId() + urlArgSeparator + (sortLanguageId != null ? "sortLanguageId=" + sortLanguageId : "") + urlArgSeparator + "parent=" + entityVO.getId();
        if(createAction && src.length() >0) src += urlArgSeparator + "createAction=true";
        if(action.length()>0 && src.length() >0) src += urlArgSeparator + "action=" + action;
        String allowedContentTypeIdsUrlEncodedString = getAllowedContentTypeIdsAsUrlEncodedString();
        logger.info("allowedContentTypeIdsUrlEncodedString1:" + allowedContentTypeIdsUrlEncodedString);
        if(allowedContentTypeIdsUrlEncodedString.length()>0 && src.length() >0)
            src += urlArgSeparator + allowedContentTypeIdsUrlEncodedString;
             
        logger.info("src:" + src);
         
        String text=r.getName();
              Element element = root.addElement("tree");
              element
              .addAttribute("id", "" + r.getId())
                .addAttribute("repositoryId", "" + r.getId())
                .addAttribute("text", encode(text))
                .addAttribute("src", src)
                .addAttribute("hasChildren", "true")
                .addAttribute("type", TYPE_REPOSITORY);
          }
View Full Code Here


       
        logger.info("repositoryString:" + repositoryString);
        logger.info("restString:" + restString);
        try
        {
          RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithName(repositoryString);
          logger.info("repositoryVO:" + repositoryVO);
         
          if(repositoryVO == null && components != null && components.size() > 0)
          {
            ContentVO contentVO = (ContentVO)components.get(0);
            repositoryVO = RepositoryController.getController().getRepositoryVOWithId(contentVO.getRepositoryId());
            logger.info("repositoryVO:" + repositoryVO);
          }
         
          if(repositoryVO != null)
          {
            LanguageVO languageVO = LanguageController.getController().getMasterLanguage(repositoryVO.getRepositoryId());
 
            ContentVO parentContent = ContentController.getContentController().getContentVOWithPath(repositoryVO.getId(), restString, true, principal);
            logger.info("parentContent:" + parentContent);
            ContentVO newContentVO = ContentController.getContentController().create(parentContent.getId(), contentTypeDefinitionVO.getContentTypeDefinitionId(), parentContent.getRepositoryId(), missingRemoteContentVO);
            logger.info("Now we want to create the version also on:" + newContentVO.getName());
            ContentVersionVO contentVersionVO = new ContentVersionVO();
            contentVersionVO.setVersionComment("deployment");
View Full Code Here

    buttons.add(new ImageButton(true, "javascript:submitToUnpublish('publication');", getLocalizedString(getSession().getLocale(), "images.publishingtool.buttons.unpublishEdition"), "tool.publishtool.unpublishEdition.header", "Unpublish the marked edition and send the versions back to publishable state"));
    buttons.add(new ImageButton(true, "javascript:submitToDeny();", getLocalizedString(getSession().getLocale(), "images.publishingtool.buttons.denyPublishing"), "tool.publishtool.denyPublication.header", "Deny the checked items from publication"));
   
    try
    {
        RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(this.repositoryId);

        String repositoryName = repositoryVO.getName();
      String dnsName = repositoryVO.getDnsName();

        String previewUrl = null;
       
        String keyword = "preview=";
        int startIndex = (dnsName == null) ? -1 : dnsName.indexOf(keyword);
View Full Code Here

  private List<LanguageVO> languageVOList;
   
    public ViewRepositoryAction()
    {
        this(new RepositoryVO());
    }
View Full Code Here

      }
      else if(path != null)
      {
        if(this.repositoryName != null && repositoryId == null)
        {
          RepositoryVO repositoryVO = getController().getRepositoryWithName(repositoryName);
          if(repositoryVO != null)
            this.repositoryId = repositoryVO.getId();
        }
       
        if(repositoryId == null)
          repositoryId = this.getController().getRepositoryId();
       
View Full Code Here

      SiteNodeVO siteNodeVO = NodeDeliveryController.getNodeDeliveryController(siteNodeId, languageId, contentId, deliveryContext).getSiteNodeVO(database, siteNodeId);
      String dnsName = CmsPropertyHandler.getWebServerAddress();
      if(siteNodeVO != null)
      {
        RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNodeVO.getRepositoryId(), database);
        if(repositoryVO.getDnsName() != null && !repositoryVO.getDnsName().equals(""))
          dnsName = repositoryVO.getDnsName();
      }

      pageAsDigitalAssetUrl = urlComposer.composeDigitalAssetUrl(dnsName, fileName, context);
     
      if(cacheUrl)
View Full Code Here

   
    SiteNodeVO siteNodeVO = getSiteNodeVO(db, this.siteNodeId);
    String dnsName = CmsPropertyHandler.getWebServerAddress();
    if(siteNodeVO != null)
    {
      RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNodeVO.getRepositoryId(), db);
      if(repositoryVO.getDnsName() != null && !repositoryVO.getDnsName().equals(""))
        dnsName = repositoryVO.getDnsName();
    }

    /*
    SiteNode siteNode = this.getSiteNode(db, this.siteNodeId);
    String dnsName = CmsPropertyHandler.getWebServerAddress();
View Full Code Here

      */
      SiteNodeVO currentSiteNode = SiteNodeController.getController().getSmallSiteNodeVOWithId(deliveryContext.getSiteNodeId(), db);

      if(!siteNode.getRepositoryId().equals(currentSiteNode.getRepositoryId()))
      {
        RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNode.getRepositoryId(), db);
        String dnsName = repositoryVO.getDnsName();
        logger.info("dnsName:" + dnsName + " for siteNode " + siteNode.getName());

        //            String operatingMode = CmsPropertyHandler.getOperatingMode();
        String keyword = "";
        if (operatingMode.equalsIgnoreCase("0"))
        {
          keyword = "working=";
        }
        else if (operatingMode.equalsIgnoreCase("2"))
        {
          keyword = "preview=";
        }
        if (operatingMode.equalsIgnoreCase("3"))
        {
          keyword = "live=";
        }

        String repositoryPath = null;
        if (!operatingMode.equals("3"))
        {
          int workingPathStartIndex = dnsName.indexOf("workingPath=");
          if(workingPathStartIndex != -1)
          {
            int workingPathEndIndex = dnsName.indexOf(",", workingPathStartIndex);
            if(workingPathEndIndex > -1)
              repositoryPath = dnsName.substring(workingPathStartIndex + 12, workingPathEndIndex);
            else
              repositoryPath = dnsName.substring(workingPathStartIndex + 12);
          }
        }

        if(repositoryPath == null)
        {
          int pathStartIndex = dnsName.indexOf("path=");
          if(pathStartIndex != -1)
          {
            int pathEndIndex = dnsName.indexOf(",", pathStartIndex);
            if(pathEndIndex > -1)
              repositoryPath = dnsName.substring(pathStartIndex + 5, pathEndIndex);
            else
              repositoryPath = dnsName.substring(pathStartIndex + 5);
          }
        }

        if(logger.isInfoEnabled())
        {
          logger.info("repositoryPath in constructing new url:" + repositoryPath);
          logger.info("dnsName:" + dnsName);
          logger.info("repositoryPath:" + repositoryPath);
        }

        if(dnsName != null)
        {
          int startIndex = dnsName.indexOf(keyword);
          if(startIndex != -1)
          {
            int endIndex = dnsName.indexOf(",", startIndex);
            if(endIndex > -1)
              dnsName = dnsName.substring(startIndex, endIndex);
            else
              dnsName = dnsName.substring(startIndex);

            dnsName = dnsName.split("=")[1];
          }
          else
          {
            int endIndex = dnsName.indexOf(",");
            if(endIndex > -1)
              dnsName = dnsName.substring(0, endIndex);
            else
              dnsName = dnsName.substring(0);
          }
        }

        if(logger.isInfoEnabled())
        {
          logger.info("A4:" + dnsName);
        }
        if(schema != null && schema.equalsIgnoreCase("https"))
        {
          dnsName = dnsName.replaceFirst(unprotectedProtocolName + "://", protectedProtocolName + "://").replaceFirst(unprotectedProtocolPort, protectedProtocolPort);
        }
        if(logger.isInfoEnabled())
        {
          logger.info("A42:" + dnsName);
        }

        if(repositoryPath != null)
        {
          if(applicationContext.startsWith("/"))
            applicationContext = dnsName + applicationContext + "/" + repositoryPath;
          else
            applicationContext = dnsName + "/" + (applicationContext.equals("") ? "" : applicationContext + "/") + repositoryPath;
        }
        else
        {
          if(applicationContext.startsWith("/"))
            applicationContext = dnsName + applicationContext;
          else
            applicationContext = dnsName + "/" + applicationContext;
        }

        if(logger.isInfoEnabled())
        {
          logger.info("A5:" + applicationContext);
        }

      }
      else
      {
        RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNode.getRepositoryId(), db);
        String dnsName = repositoryVO.getDnsName();

        String repositoryPath = null;
        if (!operatingMode.equals("3"))
            {
              int workingPathStartIndex = dnsName.indexOf("workingPath=");
              if(workingPathStartIndex != -1)
              {
                int workingPathEndIndex = dnsName.indexOf(",", workingPathStartIndex);
                if(workingPathEndIndex > -1)
                    repositoryPath = dnsName.substring(workingPathStartIndex + 12, workingPathEndIndex);
                else
                  repositoryPath = dnsName.substring(workingPathStartIndex + 12);
              }
            }

            if(repositoryPath == null)
            {
                int pathStartIndex = dnsName.indexOf("path=");
                if(pathStartIndex != -1)
                {
                int pathEndIndex = dnsName.indexOf(",", pathStartIndex);
                if(pathEndIndex > -1)
                    repositoryPath = dnsName.substring(pathStartIndex + 5, pathEndIndex);
                else
                  repositoryPath = dnsName.substring(pathStartIndex + 5);
                }
            }

        logger.info("repositoryPath in constructing new url:" + repositoryPath);

        if(repositoryPath != null)
        {
          applicationContext = applicationContext + "/" + repositoryPath;
        }
      }

      StringBuilder sb = new StringBuilder(256);

      if ((deliveryContext.getUseFullUrl() || makeAccessBasedProtocolAdjustments) && applicationContext.indexOf("://") == -1)
      {
        String originalUrl;
        if (request == null)
        {
          logger.info("Could not derive full base URL since we got no request. Getting value from DNS names instead.");
          RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNode.getRepositoryId(), db);
          originalUrl = getHost(repositoryVO.getDnsName(), operatingMode);
        }
        else
        {
          originalUrl = request.getRequestURL().toString();
        }
        if (originalUrl != null)
        {
          String base = originalUrl;
          int indexOfProtocol = base.indexOf("://");
          if (indexOfProtocol > -1)
          {
            indexOfProtocol += 3;
          }
          else
          {
            indexOfProtocol = 0;
          }
          int indexFirstSlash = originalUrl.indexOf("/", indexOfProtocol);
          if (indexFirstSlash > -1)
          {
            base = originalUrl.substring(0, indexFirstSlash);
          }
          sb.append(base);
        }
      }

      sb.append(applicationContext);

      try
      {
        String navigationPath = NodeDeliveryController.getNodeDeliveryController(siteNodeId, languageId, contentId).getPageNavigationPath(db, infoGluePrincipal, siteNodeId, languageId, contentId, deliveryContext);
        if(navigationPath != null && navigationPath.startsWith("/") && sb.toString().endsWith("/"))
          sb.append(navigationPath.substring(1));
        else
          sb.append(navigationPath);

        if(sb.toString().endsWith(applicationContext) && !sb.toString().endsWith("/"))
        {
          sb.append("/");
        }

        boolean addedContent = false;
              /*
              if(contentId != null && contentId.intValue() != -1)
              {
                  sb.append("?contentId=").append(String.valueOf(contentId));
                  addedContent = true;
              }
              */
             
              if(contentId != null && contentId.intValue() != -1)
              {
                if(!CmsPropertyHandler.getNiceURIDisableNiceURIForContent().equals("true"))
                {
                  String navigationTitle = ContentDeliveryController.getContentDeliveryController().getContentAttribute(db, contentId, languageId, "NavigationTitle", siteNodeId, true, deliveryContext, infoGluePrincipal, false, false);
                  if(navigationTitle == null || navigationTitle.equals(""))
                    navigationTitle = ContentDeliveryController.getContentDeliveryController().getContentAttribute(db, contentId, languageId, "Title", siteNodeId, true, deliveryContext, infoGluePrincipal, false, false);
                  if(navigationTitle != null && !navigationTitle.equals(""))
                  {
                    navigationTitle = new VisualFormatter().replaceNiceURINonAsciiWithSpecifiedChars(navigationTitle, CmsPropertyHandler.getNiceURIDefaultReplacementCharacterForContent());
                    sb.append("/" + navigationTitle + ".cid").append(String.valueOf(contentId));
                      addedContent = true;
            }
                  else
                  {
                      if(contentId != null && contentId.intValue() != -1)
                      {
                          sb.append("?contentId=").append(String.valueOf(contentId));
                          addedContent = true;
              }
            }
                }
                else
                {
                    if(contentId != null && contentId.intValue() != -1)
                    {
                        sb.append("?contentId=").append(String.valueOf(contentId));
                        addedContent = true;
            }
          }
              }

              if(!enableNiceURIForLanguage.equalsIgnoreCase("true"))
              {
                if (languageId != null && languageId.intValue() != -1 && deliveryContext.getLanguageId().intValue() != languageId.intValue())
                {
                    if(addedContent)
                        sb.append(getRequestArgumentDelimiter());
                    else
                        sb.append("?");
                       
                    sb.append("languageId=").append(String.valueOf(languageId));
                }
              }
             
              url = (!sb.toString().equals("") ? sb.toString() : "/");
          }
          catch (Exception e)
      {
              logger.warn("Error generating url:" + e.getMessage());
          }
        }
        else
        {          
            if(!useDNSNameInUrls.equalsIgnoreCase("false"))
            {
          if(siteNodeId == null)
            siteNodeId = new Integer(-1);
 
          if(languageId == null)
            languageId = new Integer(-1);
 
          if(contentId == null)
            contentId = new Integer(-1);
 
              String arguments = "siteNodeId=" + siteNodeId + getRequestArgumentDelimiter() + "languageId=" + languageId + getRequestArgumentDelimiter() + "contentId=" + contentId;

              //SiteNode siteNode = SiteNodeController.getSiteNodeWithId(siteNodeId, db, true);
              SiteNodeVO siteNode = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId, db);
          String dnsName = CmsPropertyHandler.getWebServerAddress();
          if(siteNode != null)
          {
            RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNode.getRepositoryId(), db);
            if(siteNode != null && repositoryVO.getDnsName() != null && !repositoryVO.getDnsName().equals(""))
              dnsName = repositoryVO.getDnsName();
          }

//            String operatingMode = CmsPropertyHandler.getOperatingMode();
        String keyword = "";
        if(operatingMode.equalsIgnoreCase("0"))
View Full Code Here

        {
          SiteNodeVO siteNodeVO = NodeDeliveryController.getNodeDeliveryController(deliveryContext).getSiteNodeVO(getDatabase(), getTemplateController().getSiteNodeId());
          String dnsName = CmsPropertyHandler.getWebServerAddress();
          if(siteNodeVO != null)
          {
            RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNodeVO.getRepositoryId(), getDatabase());
            if(repositoryVO.getDnsName() != null && !repositoryVO.getDnsName().equals(""))
              dnsName = repositoryVO.getDnsName();
          }

          String bundleUrl = "";
          String bundleUrlTag = "";
         
View Full Code Here

    String url = "";
 
        String context = CmsPropertyHandler.getServletContext();

    SiteNodeVO siteNodeVO = this.nodeDeliveryController.getSiteNodeVO(getDatabase(), this.siteNodeId);
    RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNodeVO.getRepositoryId(), getDatabase());
    String dnsName = CmsPropertyHandler.getWebServerAddress();
    if(siteNodeVO != null && repositoryVO.getDnsName() != null && !repositoryVO.getDnsName().equals(""))
    {
      dnsName = repositoryVO.getDnsName();
    //SiteNode siteNode = this.nodeDeliveryController.getSiteNode(getDatabase(), this.siteNodeId);
    //String dnsName = CmsPropertyHandler.getWebServerAddress();
    //if(siteNode != null && siteNode.getRepository().getDnsName() != null && !siteNode.getRepository().getDnsName().equals(""))
    //{
    //  dnsName = siteNode.getRepository().getDnsName();
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.RepositoryVO

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.