Package org.infoglue.cms.entities.structure

Examples of org.infoglue.cms.entities.structure.SiteNodeVersionVO


    if(languageId != null && !languageId.equals(""))
      request.getSession().setAttribute("structureLanguageId", new Integer(languageId));
   
    SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(new Integer(siteNodeId));
   
    SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestActiveSiteNodeVersionVO(new Integer(siteNodeId));

    if(siteNodeVO != null && hasAccessTo(principal, "Common.CreatePage", true))
    {
      buttons.add(new ToolbarButton("createSiteNode",
            getLocalizedString(locale, "tool.structuretool.toolbarV3.createPageLabel"),
            getLocalizedString(locale, "tool.structuretool.toolbarV3.createPageTitle"),
            "CreateSiteNode!inputV3.action?isBranch=true&repositoryId=" + siteNodeVO.getRepositoryId() + "&parentSiteNodeId=" + siteNodeId + ((languageId != null && !languageId.equals("")) ? "&languageId=" + languageId : "") + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "create"));
     
      ToolbarButton copyPageButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.structuretool.toolbarV3.copyPageLabel"),
            getLocalizedString(locale, "tool.structuretool.toolbarV3.copyPageLabel"),
            "CopyMultipleSiteNodes!input.action?siteNodeId=" + new Integer(siteNodeId) + "&repositoryId=" + siteNodeVO.getRepositoryId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent" + ((languageId != null && !languageId.equals("")) ? "&sortLanguageId=" + languageId : ""),
            "",
            "copy");
      buttons.add(copyPageButton);
    }

    ToolbarButton moveSiteNodeButton = new ToolbarButton("moveSiteNode",
          getLocalizedString(locale, "tool.structuretool.toolbarV3.movePageLabel"),
          getLocalizedString(locale, "tool.structuretool.toolbarV3.movePageTitle"),
          "MoveSiteNode!inputV3.action?repositoryId=" + siteNodeVO.getRepositoryId() + "&siteNodeId=" + siteNodeId + "&hideLeafs=true&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent" + ((languageId != null && !languageId.equals("")) ? "&sortLanguageId=" + languageId : ""),
          "",
          "movePage");


    ToolbarButton moveMultipleSiteNodeButton = new ToolbarButton("moveMultipleSiteNode",
          getLocalizedString(locale, "tool.structuretool.toolbarV3.moveMultiplePageLabel"),
          getLocalizedString(locale, "tool.structuretool.toolbarV3.moveMultiplePageTitle"),
          "MoveMultipleSiteNodes!input.action?repositoryId=" + siteNodeVO.getRepositoryId() + "&siteNodeId=" + siteNodeId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent" + ((languageId != null && !languageId.equals("")) ? "&sortLanguageId=" + languageId : ""),
          "",
          "movePage");
   
    moveSiteNodeButton.getSubButtons().add(moveMultipleSiteNodeButton);

    buttons.add(moveSiteNodeButton);
   
    if(siteNodeVO != null && hasAccessTo(principal, "Common.DeletePage", true))
    {
      String localizedSiteNodeName = null;
      try
      {
        localizedSiteNodeName = ContentController.getContentController().getContentAttribute(siteNodeVO.getMetaInfoContentId(), Integer.valueOf(languageId), "NavigationTitle");
      }
      catch (NumberFormatException nex)
      {
        logger.warn("Failed to parse languageId for Delete page toolbar button. Message: " + nex.getMessage());
      }
      catch (Exception ex)
      {
        logger.warn("Error looking up localized name for SiteNode for Delete page toolbar botton. Message: " + ex.getMessage());
      }
      if (localizedSiteNodeName == null || localizedSiteNodeName.equals(""))
      {
        localizedSiteNodeName = siteNodeVO.getName();
      }

      ToolbarButton deleteButton = new ToolbarButton("deleteSiteNode",
            getLocalizedString(locale, "tool.structuretool.toolbarV3.deletePageLabel"),
            getLocalizedString(locale, "tool.structuretool.toolbarV3.deletePageTitle"),
            "DeleteSiteNode!V3.action?siteNodeId=" + siteNodeId + "&repositoryId=" + siteNodeVO.getRepositoryId() + "&changeTypeId=4&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "",
            "delete",
            true,
            true,
            getLocalizedString(locale, "tool.structuretool.toolbarV3.deletePageLabel"),
            getLocalizedString(locale, "tool.structuretool.toolbarV3.deletePageConfirmationLabel", new String[]{localizedSiteNodeName}),
            "inlineDiv");
     
      if(SiteNodeVersionController.getLatestPublishedSiteNodeVersionVO(new Integer(siteNodeId)) != null)
      {
        deleteButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
            "javascript:alert('" + formatter.escapeForJavascripts(getLocalizedErrorMessage(locale, "3300")) + "');",
            "",
            "delete");
      }
     
      buttons.add(deleteButton);
   
   
     
    ToolbarButton pageMetaDataButton = new ToolbarButton("",
      getLocalizedString(locale, "tool.structuretool.toolbarV3.editPageMetaInfoLabel"),
      getLocalizedString(locale, "tool.structuretool.toolbarV3.editPageMetaInfoTitle"),
      "ViewAndCreateContentForServiceBinding.action?siteNodeId=" + siteNodeId + ((languageId != null && !languageId.equals("")) ? "&languageId=" + languageId : "") + "&repositoryId=" + siteNodeVO.getRepositoryId() + "&siteNodeVersionId=" + siteNodeVersionVO.getId() + "&hideLeafs=true&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
      "",
      "properties");

    //ToolbarButton pageDetailButton = StructureToolbarController.getPageDetailButtons(siteNodeVO.getRepositoryId(), new Integer(siteNodeId), locale, principal);
    //pageMetaDataButton.getSubButtons().add(pageDetailButton);
    buttons.add(pageMetaDataButton);
    /*
    if(siteNodeVO != null && hasAccessTo(principal, "ToolTabsAndButtons.PageSimpleModeButton", true))
    {
      ToolbarButton pageDetailSimpleButton = StructureToolbarController.getPageDetailSimpleButtons(siteNodeVO.getRepositoryId(), new Integer(siteNodeId), locale, principal);
      pageMetaDataButton.getSubButtons().add(pageDetailSimpleButton);
    }*/
   
    buttons.add(StructureToolbarController.getPreviewButtons(siteNodeVO.getRepositoryId(), new Integer(siteNodeId), null, locale));

    ToolbarButton publishButton = StructureToolbarController.getPublishCurrentNodeButton(siteNodeVO.getRepositoryId(), new Integer(siteNodeId), locale);
    ToolbarButton publishStructureButton = StructureToolbarController.getPublishButtons(siteNodeVO.getRepositoryId(), new Integer(siteNodeId), locale);
    publishButton.getSubButtons().add(publishStructureButton);
    buttons.add(publishButton);
   
    ToolbarButton unpublishAllButton = StructureToolbarController.getUnpublishButton(siteNodeVO.getRepositoryId(), new Integer(siteNodeId), locale, true, false);
    ToolbarButton unpublishLatestButton = StructureToolbarController.getUnpublishButton(siteNodeVO.getRepositoryId(), new Integer(siteNodeId), locale, true, true);

    unpublishAllButton.getSubButtons().add(unpublishLatestButton);
    buttons.add(unpublishAllButton);

    ToolbarButton debugContentPublicationButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.publishingtool.toolbarV3.forcePublicationLabel"),
          getLocalizedString(locale, "tool.publishingtool.toolbarV3.forcePublicationTitle"),
          "ViewPublications!showDebugEntityPublication.action?entityName=SiteNode&entityId=" + siteNodeVO.getId(),
          "",
          "refresh");
    publishButton.getSubButtons().add(debugContentPublicationButton);

    //publishButton.getSubButtons().add(unpublishStructureButton);
    /*
    unpublishButton.getSubButtons().add(unpublishStructureButton);
    buttons.add(unpublishButton);
    */
   
    if(hasAccessTo(principal, "Common.ManageAccessRights", true) || !CmsPropertyHandler.getHideAccessRightsIfNotAllowedToManage())
    {
      buttons.add(new ToolbarButton("",
          getLocalizedString(locale, "tool.common.accessRights.accessRightsButtonLabel"),
          getLocalizedString(locale, "tool.common.accessRights.accessRightsButtonTitle"),
          "ViewAccessRights!V3.action?interceptionPointCategory=SiteNodeVersion&extraParameters=" + siteNodeVersionVO.getId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "css/images/v3/accessRightIcon.gif",
          "accessRights"));
    }

    if(hasAccessTo(principal, "ToolTabsAndButtons.ContentToolbarAdvancedButtons", true))
View Full Code Here


    private SiteNodeVO siteNodeVO;
    private SiteNodeVersionVO siteNodeVersionVO;

    public ViewSiteNodeVersionAction()
    {
        this(new SiteNodeVO(), new SiteNodeVersionVO());
    }
View Full Code Here

    initialize(true);
  }
 
  private void initialize(boolean changeState) throws Exception
  {
    SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getACLatestActiveSiteNodeVersionVO(this.getInfoGluePrincipal(), this.siteNodeId);
    logger.info("siteNodeVersionVO:" + siteNodeVersionVO.getId() + ":" + siteNodeVersionVO.getIsActive());
    if(changeState && siteNodeVersionVO.getStateId().intValue() != SiteNodeVersionVO.WORKING_STATE.intValue())
    {
        List events = new ArrayList();
      SiteNodeStateController.getController().changeState(siteNodeVersionVO.getId(), SiteNodeVersionVO.WORKING_STATE, "Edit on sight editing", true, this.getInfoGluePrincipal(), this.siteNodeId, events);
      this.stateChanged = true;
    }
   
    Integer currentRepositoryId = SiteNodeController.getController().getSiteNodeVOWithId(this.siteNodeId).getRepositoryId();
    this.masterLanguageVO = LanguageController.getController().getMasterLanguage(currentRepositoryId);   
View Full Code Here

     
      logger.info("siteNodeId:" + this.siteNodeId);
      logger.info("siteNodeVersionId:" + this.siteNodeVersionId);
      if(this.siteNodeVersionId == null)
      {
          SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getACLatestActiveSiteNodeVersionVO(this.getInfoGluePrincipal(), siteNodeId);
          if(siteNodeVersionVO != null)
              this.siteNodeVersionId = siteNodeVersionVO.getId();
      }
     
      if(this.siteNodeVersionId != null)
      {
        AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
View Full Code Here

        processBean.updateProcess("Read " + siteNodeMap.size() + " pages to change state on" /*getLocalizedString(getLocale(), "tool.structuretool.publicationProcess.gettingItems")*/);
        for(Entry<Integer,SiteNodeVO> entry : siteNodeMap.entrySet())
        {
          Integer siteNodeVersionId = entry.getKey();
          logger.info("Publishing:" + siteNodeVersionId);
          SiteNodeVersionVO siteNodeVersion = SiteNodeStateController.getController().changeState(siteNodeVersionId, entry.getValue(), SiteNodeVersionVO.PUBLISH_STATE, getVersionComment(), this.overrideVersionModifyer, this.recipientFilter, this.getInfoGluePrincipal(), events);
         
          if (events.size() % 50 == 0)
            processBean.updateLastDescription("Processed " + events.size() /*getLocalizedString(getLocale(), "tool.structuretool.publicationProcess.gettingItems")*/);
 
          newsiteNodeMap.put(siteNodeVersion.getId(), entry.getValue());
        }
   
        /*
        while(it.hasNext())
        {
 
View Full Code Here

  {
    boolean hasPublishedVersion = false;
   
    try
    {
      SiteNodeVersionVO siteNodeVersion = SiteNodeVersionController.getLatestPublishedSiteNodeVersionVO(this.siteNodeId);
      if(siteNodeVersion != null)
      {
        SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId());
        hasPublishedVersion = true;
        lastPublishedSiteNodeVersionId = siteNodeVersion.getId();
        this.repositoryId = siteNodeVO.getRepositoryId();
        this.name = siteNodeVO.getName();
        this.siteNodeId = siteNodeVO.getId();
      }
      /*
 
View Full Code Here

                    EventController.delete(repoEvent, db);
                  }
                }
                else if(event.getEntityClass().equals(SiteNodeVersion.class.getName()))
                {
                  SiteNodeVersionVO eventSNVVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(event.getEntityId(), db);
                  SiteNodeVersionVO repoEventSNVVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(repoEvent.getEntityId(), db);
                  if(eventSNVVO.getSiteNodeId().equals(repoEventSNVVO.getSiteNodeId()))
                  {
                    EventController.delete(repoEvent, db);
                  }
                }
              }
View Full Code Here

      */
      else if(oldSiteNodeVersion != null && oldSiteNodeVersion.getSiteNodeId() != null)
      {
        List<EventVO> events = new ArrayList<EventVO>();

        SiteNodeVersionVO newSiteNodeVersionVO = SiteNodeStateController.getController().changeState(entityId, siteNodeVO, SiteNodeVersionVO.PUBLISHED_STATE, "Published", overrideVersionModifyer, infoGluePrincipal, db, oldSiteNodeVersion.getSiteNodeId(), events);
        siteNodeVersion = SiteNodeVersionController.getController().getMediumSiteNodeVersionWithId(newSiteNodeVersionVO.getId(), db);
      }

      if(siteNodeVersion != null)
      {
        //The siteNodeVersion in here is the version we have done something with...
View Full Code Here

              String approveEntityId = null;
              String extraInfo = null;
             
              if(event.getEntityClass().contains("SiteNodeVersion"))
              {
                SiteNodeVersionVO snVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(event.getEntityId(), db);
                siteNodeId = snVersionVO.getSiteNodeId();
                approveEntityName = "SiteNode";
                approveEntityId = ""+siteNodeId;
              }
              else if(event.getEntityClass().contains("ContentVersion"))
              {
View Full Code Here

  private List<ReferenceBean> referencingBeanList = new ArrayList<ReferenceBean>();

    public String doExecute() throws Exception
    {
    this.referenceBeanList = RegistryController.getController().getReferencingObjectsForSiteNode(siteNodeId, 200, false, true);
    SiteNodeVersionVO latestSiteNodeVersion = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getLatestActiveSiteNodeVersionVO(siteNodeId);
      this.referencingBeanList = RegistryController.getController().getReferencedObjects(SiteNodeVersion.class.getName(), latestSiteNodeVersion.getSiteNodeVersionId().toString());

        return Action.SUCCESS;
    }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.structure.SiteNodeVersionVO

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.