Package org.infoglue.cms.applications.common

Examples of org.infoglue.cms.applications.common.ToolbarButton


 
  private List<ToolbarButton> getEntityPropertiesFooterButtons(String toolbarKey, InfoGluePrincipal principal, Locale locale, HttpServletRequest request, boolean disableCloseButton) throws Exception
  {
    List<ToolbarButton> buttons = new ArrayList<ToolbarButton>();

    buttons.add(new ToolbarButton("",
                    getLocalizedString(locale, "tool.contenttool.save.label"),
                    getLocalizedString(locale, "tool.contenttool.save.label"),
                    "validateAndSubmitContentForm();",
                    "css/images/v3/saveInlineIcon.gif",
                    "left",
                    "save",
                    true));

    buttons.add(new ToolbarButton("",
                    getLocalizedString(locale, "tool.contenttool.saveAndExit.label"),
                    getLocalizedString(locale, "tool.contenttool.saveAndExit.label"),
                    "validateAndSubmitContentFormThenExit();",
                    "css/images/v3/saveAndExitInlineIcon.gif",
                    "left",
                    "saveAndExit",
                    true));
   
    buttons.add(new ToolbarButton("",
                      getLocalizedString(locale, "tool.contenttool.cancel.label"),
                      getLocalizedString(locale, "tool.contenttool.cancel.label"),
                      "cancel();",
                      "css/images/v3/cancelIcon.gif",
                      "left",
View Full Code Here


  private List<ToolbarButton> getCommonAddNextCancelButton(String toolbarKey, InfoGluePrincipal principal, Locale locale, HttpServletRequest request, boolean disableCloseButton)
  {
    List<ToolbarButton> buttons = new ArrayList<ToolbarButton>();

    buttons.add(new ToolbarButton("",
          getLocalizedString(locale, "tool.common.addButton.label"),
          getLocalizedString(locale, "tool.common.addButton.label"),
          "add();",
          "css/images/v3/addIcon.png",
          "left",
          "add",
          true));

    buttons.add(new ToolbarButton("",
          getLocalizedString(locale, "tool.common.nextButton.label"),
          getLocalizedString(locale, "tool.common.nextButton.label"),
          "next();",
          "css/images/v3/nextBackground.gif",
          "left",
          "next",
          true));

    buttons.add(new ToolbarButton("",
          getLocalizedString(locale, "tool.common.cancelButton.label"),
          getLocalizedString(locale, "tool.common.cancelButton.label"),
          "if(parent && parent.closeInlineDiv) parent.closeInlineDiv(); else if(parent && parent.closeDialog) parent.closeDialog(); else window.close();",
          "css/images/v3/cancelIcon.gif",
          "left",
View Full Code Here

 
  private List<ToolbarButton> getCommonAddSaveCancelButton(String toolbarKey, InfoGluePrincipal principal, Locale locale, HttpServletRequest request, boolean disableCloseButton)
  {
    List<ToolbarButton> buttons = new ArrayList<ToolbarButton>();

    buttons.add(new ToolbarButton("",
          getLocalizedString(locale, "tool.common.addButton.label"),
          getLocalizedString(locale, "tool.common.addButton.label"),
          "add();",
          "css/images/v3/addIcon.png",
          "left",
View Full Code Here

    return buttons;   
  }

  private ToolbarButton getCommonFooterUseSelectedButton(String toolbarKey, InfoGluePrincipal principal, Locale locale, HttpServletRequest request, boolean disableCloseButton)
  {
    return new ToolbarButton("useSelected",
        getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
        getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
        "useSelectedAsset();",
        "",
        "",
View Full Code Here

    if(label == null)
      label = getLocalizedString(locale, "tool.contenttool.save.label");
    if(title == null)
      title = getLocalizedString(locale, "tool.contenttool.save.label");
     
    return new ToolbarButton("",
          label,
          title,
          javascriptCode,
          "css/images/v3/saveInlineIcon.gif",
          "left",
View Full Code Here

          true);
  }

  private ToolbarButton getCommonFooterSaveAndExitButton(String toolbarKey, InfoGluePrincipal principal, Locale locale, HttpServletRequest request, boolean disableCloseButton, String exitUrl)
  {
    return new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.saveAndExit.label"),
          getLocalizedString(locale, "tool.contenttool.saveAndExit.label"),
          "saveAndExit(\"" + exitUrl + "\");",
          "css/images/v3/saveAndExitInlineIcon.gif",
          "left",
View Full Code Here

    return getDialogCancelButton(toolbarKey, principal, locale, request, disableCloseButton);
  }

  private ToolbarButton getCommonFooterCancelButton(String toolbarKey, InfoGluePrincipal principal, Locale locale, HttpServletRequest request, boolean disableCloseButton, String cancelUrl, boolean isJavascript)
  {
    return new ToolbarButton("cancelButton",
        getLocalizedString(locale, "tool.contenttool.cancel.label"),
        getLocalizedString(locale, "tool.contenttool.cancel.label"),
        "" + cancelUrl + "",
        "css/images/v3/cancelIcon.gif",
        "left",
View Full Code Here

   
    Integer contentId = new Integer(request.getParameter("contentId"));
    ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
   
   
    ToolbarButton createButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.createContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.createContentTitle"),
          "CreateContent!inputV3.action?isBranch=false&repositoryId=" + contentVO.getRepositoryId() + "&parentContentId=" + contentId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "create",
          "inlineDiv");

    ToolbarButton createFolderButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.createContentFolderLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.createContentFolderTitle"),
          "CreateContent!inputV3.action?isBranch=true&repositoryId=" + contentVO.getRepositoryId() + "&parentContentId=" + contentId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "create",
          "inlineDiv");

    createButton.getSubButtons().add(createFolderButton);
    buttons.add(createButton);

    ToolbarButton copyContentButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.copyContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.copyContentTitle"),
          "CopyContent!input.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "copy");
    buttons.add(copyContentButton);

    ToolbarButton moveButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveContentTitle"),
          "MoveContent!inputV3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&hideLeafs=true&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "moveContent");

    ToolbarButton moveMultipleButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveMultipleContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveMultipleContentTitle"),
          "MoveMultipleContent!inputV3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "moveContent");
   
    moveButton.getSubButtons().add(moveMultipleButton);
    buttons.add(moveButton);

    ToolbarButton deleteButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentTitle"),
          "DeleteContent!V3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&changeTypeId=4&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "",
          "delete",
          true,
          true,
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentConfirmationLabel", new String[]{contentVO.getName()}),
          "inlineDiv");

    if(ContentController.getContentController().hasPublishedVersion(contentId) && !contentVO.getIsBranch())
    {
      deleteButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
            "javascript:alert('" + formatter.escapeForJavascripts(getLocalizedErrorMessage(locale, "3300")) + "');",
            "",
            "delete");
    }
   
    if(contentVO.getIsBranch())
    {
      ToolbarButton deleteChildrenButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenTitle"),
          "DeleteContentChildren.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&changeTypeId=4&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "",
          "delete",
          true,
          true,
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenConfirmationLabel", new String[]{contentVO.getName()}),
          "inlineDiv");
   
      deleteButton.getSubButtons().add(deleteChildrenButton);
    }
   
    buttons.add(deleteButton);

    if(contentVO.getIsBranch())
    {
      if(hasAccessTo(principal, "ToolTabsAndButtons.ContentToolbarContentPropertiesButton", true, false, true))
      {
        buttons.add(new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.editContentMetaInfoLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.editContentMetaInfoTitle"),
          "ViewContentProperties!V3.action?contentId=" + contentId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "properties"));
      }
    }
   
    ToolbarButton publishButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentsLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentsTitle"),
          "ViewListContentVersion!V3.action?contentId=" + contentId + "&recurseContents=true&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "publish");
   
    if(hasAccessTo(principal, "Content.PublishFolder", false, true, false))
    {
      ToolbarButton submitToPublishButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentTitle"),
          "ViewListContentVersion!V3.action?contentId=" + contentId + "&recurseContents=false&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "submitToPublish");
   
      publishButton.getSubButtons().add(submitToPublishButton);
    }
   
    buttons.add(publishButton);

    if(ContentController.getContentController().hasPublishedVersion(contentId) || contentVO.getIsBranch())
    {
      ToolbarButton unpublishButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsTitle"),
            "UnpublishContentVersion!inputV3.action?contentId=" + contentId + "&recurseContents=false&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "unpublish");
 
      ToolbarButton unpublishAllButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsAllLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsAllTitle"),
            "UnpublishContentVersion!inputChooseContentsV3.action?contentId=" + contentId + "&recurseContents=false&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "unpublish");
 
      unpublishAllButton.getSubButtons().add(unpublishButton);
      buttons.add(unpublishAllButton);
    }
   
    if(contentVO.getIsProtected().intValue() == ContentVO.YES.intValue())
    {
      if(hasAccessTo(principal, "Common.ManageAccessRights", true) || !CmsPropertyHandler.getHideAccessRightsIfNotAllowedToManage())
      {
        buttons.add(new ToolbarButton("",
            getLocalizedString(locale, "tool.common.accessRights.accessRightsContentButtonLabel"),
            getLocalizedString(locale, "tool.common.accessRights.accessRightsContentButtonLabel"),
            "ViewAccessRights!V3.action?interceptionPointCategory=Content&extraParameters=" + contentVO.getId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "css/images/v3/accessRightIcon.gif",
            "accessRights"));
      }
    }
   
    String contentPath = getContentIDPath(contentVO);

    /*
    ToolbarButton syncTreeButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.showContentInTreeLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.showContentInTreeTitle"),
          "javascript:syncWithTree('" + contentPath + "', " + contentVO.getRepositoryId() + ", 'contentTreeIframe');",
          "",
          "syncTree");
    */

    ToolbarButton changeContentTypeButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.changeContentTypeDefinitionLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.changeContentTypeDefinitionTitle"),
          "UpdateContent!inputContentType.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId(),
          "",
          "changeContentType");

    ToolbarButton runTaskButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.runTaskLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.runTaskTitle"),
          "ViewExecuteTask.action?contentId=" + contentId + "",
          "",
          "runTask");

    ToolbarButton exportContentButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.exportContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.exportContentTitle"),
          "ExportContent!input.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId(),
          "",
          "exportContent");

    ToolbarButton importContentButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.importContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.importContentTitle"),
          "ImportContent!input.action?parentContentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId(),
          "",
          "importContent");

    ToolbarButton createContentsFromUploadButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.createContentsFromUploadLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.createContentsFromUploadLabel"),
          "CreateContentAndAssetFromUpload!input.action?parentContentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId(),
          "",
          "createContentsFromUpload");

    changeContentTypeButton.getSubButtons().add(runTaskButton);
    if(hasAccessTo(principal, "ToolTabsAndButtons.ContentToolbarAdvancedButtons", true))
    {
      changeContentTypeButton.getSubButtons().add(exportContentButton);
      changeContentTypeButton.getSubButtons().add(importContentButton);
      changeContentTypeButton.getSubButtons().add(createContentsFromUploadButton);
     
      ToolbarButton archiveVersionsButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.archiveContentLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.archiveContentLabel"),
            "ViewArchiveTool!cleanOldVersionsForContent.action?contentId=" + contentId + "&recurse=true",
            "",
            "archiveContentVersions");
View Full Code Here

    else
    {
      contentVersionId = new Integer(contentVersionIdString);
    }
   
    ToolbarButton copyContentButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.copyContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.copyContentTitle"),
          "CopyContent!input.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "copy");
    buttons.add(copyContentButton);

    ToolbarButton moveButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveContentTitle"),
          "MoveContent!inputV3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&hideLeafs=true&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "moveContent");

    ToolbarButton moveMultipleButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveMultipleContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.moveMultipleContentTitle"),
          "MoveMultipleContent!inputV3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "moveContent");
   
    moveButton.getSubButtons().add(moveMultipleButton);
    buttons.add(moveButton);
   
        ToolbarButton deleteButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentTitle"),
          "DeleteContent!V3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&changeTypeId=4&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "",
          "delete",
          true,
          true,
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentConfirmationLabel", new String[]{contentVO.getName()}),
          "inlineDiv");
   
    if(ContentController.getContentController().hasPublishedVersion(contentId) && !contentVO.getIsBranch())
    {
      deleteButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentLabel"),
            "javascript:alert('" + formatter.escapeForJavascripts(getLocalizedErrorMessage(locale, "3300")) + "');",
            "",
            "delete");
    }

    if(contentVO.getIsBranch())
    {
      ToolbarButton deleteChildrenButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenTitle"),
          "DeleteContentChildren.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&changeTypeId=4&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "",
          "delete",
          true,
          true,
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.deleteContentChildrenConfirmationLabel", new String[]{contentVO.getName()}),
          "inlineDiv");
   
      deleteButton.getSubButtons().add(deleteChildrenButton);
    }
   
    buttons.add(deleteButton);

        //if(!isReadOnly(contentVersionId))
    //{
      if(contentVersionId != null)
      {
        buttons.add(new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.uploadDigitalAsset.label"),
            getLocalizedString(locale, "tool.contenttool.uploadDigitalAsset.label"),
            "ViewDigitalAsset.action?contentVersionId=" + contentVersionId + "",
            "",
            "attachAsset"));
      }
    //}

    if(contentVO.getIsBranch())
    {
      if(hasAccessTo(principal, "ToolTabsAndButtons.ContentToolbarMetadataButton", true))
      {
        buttons.add(new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.editContentMetaInfoLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.editContentMetaInfoTitle"),
            "ViewContentProperties!V3.action?contentId=" + contentId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "properties"));
      }
    }
   
    ToolbarButton publishButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentTitle"),
          "ViewListContentVersion!v3.action?contentId=" + contentId + (languageIdString != null ? "&languageId=" + languageIdString : "") + "&recurseContents=false&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "",
          "publish");

    if(contentVO.getIsBranch())
    {
      ToolbarButton submitToPublishButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentsLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.publishContentsTitle"),
            "ViewListContentVersion!v3.action?contentId=" + contentId + (languageIdString != null ? "&languageId=" + languageIdString : "") + "&recurseContents=false&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "submitToPublish");
 
      publishButton.getSubButtons().add(submitToPublishButton);
    }
    else
    {
      if(ContentController.getContentController().hasPublishedVersion(contentId) && !contentVO.getIsBranch())
      {
        ToolbarButton debugContentPublicationButton = new ToolbarButton("",
              getLocalizedString(locale, "tool.publishingtool.toolbarV3.forcePublicationLabel"),
              getLocalizedString(locale, "tool.publishingtool.toolbarV3.forcePublicationTitle"),
              "ViewPublications!showDebugEntityPublication.action?entityName=Content&entityId=" + contentId,
              "",
              "refresh");
        publishButton.getSubButtons().add(debugContentPublicationButton);
      }
    }
   
    buttons.add(publishButton);
   
    if(ContentController.getContentController().hasPublishedVersion(contentId) || contentVO.getIsBranch())
    {
      ToolbarButton unpublishButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsTitle"),
            "UnpublishContentVersion!inputV3.action?contentId=" + contentId + (languageIdString != null ? "&languageId=" + languageIdString : "") + "&recurseContents=false&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "unpublish");
 
      ToolbarButton unpublishAllButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsAllLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.unpublishContentsAllTitle"),
            "UnpublishContentVersion!inputChooseContentsV3.action?contentId=" + contentId + (languageIdString != null ? "&languageId=" + languageIdString : "") + "&recurseContents=false&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "unpublish");
 
      unpublishAllButton.getSubButtons().add(unpublishButton);
      buttons.add(unpublishAllButton);
    }
   
    if(contentVO.getContentTypeDefinitionId() != null)
    {
      ContentTypeDefinitionVO contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentVO.getContentTypeDefinitionId());
      if(contentTypeDefinitionVO != null && (contentTypeDefinitionVO.getName().equalsIgnoreCase("HTMLTemplate") || contentTypeDefinitionVO.getName().equalsIgnoreCase("PageTemplate") || contentTypeDefinitionVO.getName().equalsIgnoreCase("PagePartTemplate")))
      {
        if(hasAccessTo(principal, "Common.ManageAccessRights", true) || !CmsPropertyHandler.getHideAccessRightsIfNotAllowedToManage())
        {
          buttons.add(new ToolbarButton("",
                getLocalizedString(locale, "tool.contenttool.toolbarV3.componentAccessRightsLabel"),
                getLocalizedString(locale, "tool.contenttool.toolbarV3.componentAccessRightsTitle"),
                "ViewAccessRights!V3.action?interceptionPointCategory=Component&extraParameters=" + contentId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
                "",
                "componentAccessRights"));
        }
       
        buttons.add(new ToolbarButton("",
              getLocalizedString(locale, "tool.contenttool.toolbarV3.deployComponentLabel"),
              getLocalizedString(locale, "tool.contenttool.toolbarV3.deployComponentTitle"),
              "ViewDeploymentChooseServer!inputQuickV3.action?contentId=" + contentId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
              "",
              "deployContent"));
      }
    }
    /*
    //if(contentVO.getIsProtected().intValue() == ContentVO.YES.intValue())
    //{
      ToolbarButton contentAccessRight = new ToolbarButton("",
            getLocalizedString(locale, "tool.common.accessRights.accessRightsContentButtonLabel"),
            getLocalizedString(locale, "tool.common.accessRights.accessRightsContentButtonLabel"),
            "ViewAccessRights!V3.action?interceptionPointCategory=Content&extraParameters=" + contentVO.getId() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "css/images/v3/accessRightIcon.gif",
            "accessRights");

      ToolbarButton contentVersionAccessRight = new ToolbarButton("",
          getLocalizedString(locale, "tool.common.accessRights.accessRightsContentVersionButtonLabel"),
          getLocalizedString(locale, "tool.common.accessRights.accessRightsContentVersionButtonLabel"),
          "ViewAccessRights!V3.action?interceptionPointCategory=ContentVersion&extraParameters=" + contentId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
          "css/images/v3/accessRightIcon.gif",
          "accessRights");
 
      contentAccessRight.getSubButtons().add(contentVersionAccessRight);
      buttons.add(contentAccessRight);
    //}
     */

    String contentPath = getContentIDPath(contentVO);
    /*
    ToolbarButton syncTreeButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.showContentInTreeLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.showContentInTreeTitle"),
          "javascript:syncWithTree('" + contentPath + "', " + contentVO.getRepositoryId() + ", 'contentTreeIframe');",
          "",
          "syncTree");
    */
   
    ToolbarButton changeContentTypeButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.changeContentTypeDefinitionLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.changeContentTypeDefinitionTitle"),
          "UpdateContent!inputContentType.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId(),
          "",
          "changeContentType");
   
    ToolbarButton runTaskButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.runTaskLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.runTaskTitle"),
          "ViewExecuteTask.action?contentId=" + contentId + "",
          "",
          "runTask");

    changeContentTypeButton.getSubButtons().add(runTaskButton);
   
    ToolbarButton changeLanguageButton = null;
    if(contentVersionId != null)
    {
      changeLanguageButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.changeLanguageLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.changeLanguageTitle"),
            "ChangeVersionLanguage!inputV3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&contentVersionId=" + contentVersionId + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "",
            "changeLanguage");
      changeContentTypeButton.getSubButtons().add(changeLanguageButton);
     
      ToolbarButton versionAsXMLButton = new ToolbarButton("",
            getLocalizedString(locale, "tool.contenttool.toolbarV3.showDataAsXMLLabel"),
            getLocalizedString(locale, "tool.contenttool.toolbarV3.showDataAsXMLTitle"),
            "ViewContentVersion!asXMLV3.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId() + "&contentVersionId=" + contentVersionId,
            "",
            "showDataAsXML");
      changeContentTypeButton.getSubButtons().add(versionAsXMLButton);
    }
   
    ToolbarButton exportContentButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.exportContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.exportContentTitle"),
          "ExportContent!input.action?contentId=" + contentId + "&repositoryId=" + contentVO.getRepositoryId(),
          "",
          "exportContent");
   
    changeContentTypeButton.getSubButtons().add(exportContentButton);

    if(hasAccessTo(principal, "ToolTabsAndButtons.ContentToolbarAdvancedButtons", true))
    {
      buttons.add(changeContentTypeButton);
    }
    else if(hasAccessTo(principal, "ToolTabsAndButtons.ContentToolbarChangeContentTypeAndLanguageButtons", true))
    {
      changeContentTypeButton.getSubButtons().clear();
      if(changeLanguageButton != null)
        changeContentTypeButton.getSubButtons().add(changeLanguageButton);
      buttons.add(changeContentTypeButton);
    }
   
    ToolbarButton archiveVersionsButton = new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.archiveContentLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.archiveContentLabel"),
          "ViewArchiveTool!cleanOldVersionsForContent.action?contentId=" + contentId,
          "",
          "archiveContentVersions");
View Full Code Here

    if (cvvo != null && (cvvo.getStateId().intValue() == ContentVersionVO.PUBLISH_STATE || cvvo.getStateId().intValue() == ContentVersionVO.UNPUBLISH_STATE))
    {
      List<EventVO> eventVOList = EventController.getEventVOListForEntity(ContentVersion.class.getName(), cvvo.getId());
      if(eventVOList != null && eventVOList.size() > 0)
      {
        buttons.add(new ToolbarButton("approvePublication",
                getLocalizedString(locale, "tool.contenttool.approve.label"),
                getLocalizedString(locale, "tool.contenttool.approve.label"),
                "approvePublication(" + eventVOList.get(0).getId() + ");",
                "css/images/v3/cancelIcon.gif",
                "left",
              "approvePublication",
                true));

        buttons.add(new ToolbarButton("denyPublication",
                getLocalizedString(locale, "tool.contenttool.deny.label"),
                getLocalizedString(locale, "tool.contenttool.deny.label"),
                "denyPublication(" + eventVOList.get(0).getId() + ");",
                "css/images/v3/cancelIcon.gif",
                "left",
              "denyPublication",
                false));
      }
    }

    buttons.add(getCompareButton(toolbarKey, principal, locale, request, disableCloseButton));

    buttons.add(getCommonFooterSaveButton(toolbarKey, principal, locale, request, disableCloseButton));
       
    if (cvvo != null)
    {
      Integer latestContentVersionId = cvvo.getContentVersionId();
     
      buttons.add(new ToolbarButton("uploadAsset",
            getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
            getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
            "ViewDigitalAsset.action?contentVersionId=" + latestContentVersionId,
            "",
            "",
            "attachAsset",
            false,
            false,
            "",
            "",
            "inlineDiv",
            500,
            550));
    }
    /*
    buttons.add(new ToolbarButton("",
                    getLocalizedString(locale, "tool.contenttool.publish.label"),
                    getLocalizedString(locale, "tool.contenttool.publish.label"),
                    "javascript:validateAndSubmitContentFormThenSubmitToPublish();",
                      "css/images/v3/publishIcon.gif"));
    */

    String cancelJS = "knownAction = true; document.location.reload(true);";
    if(request.getRequestURI().indexOf("UpdateContentVersion") > -1)
    {
      contentIdParameter = request.getParameter("contentId");
      languageIdParameter = request.getParameter("languageId");
      String repositoryIdParameter = request.getParameter("repositoryId");

      cancelJS = "knownAction = true; document.location.href = 'ViewContent!V3.action?contentId=" + contentIdParameter + "&repositoryId=" + repositoryIdParameter + "';";
      if(languageIdParameter != null && !languageIdParameter.equals(""))
        cancelJS = "knownAction = true; document.location.href = 'ViewContentVersion!V3.action?contentId=" + contentIdParameter + "&languageId=" + languageIdParameter + "';";
      if(contentVersionIdParameter != null && !contentVersionIdParameter.equals(""))
        cancelJS = cancelJS.replaceFirst("';", "&contentVersionIdParameter=" + contentVersionIdParameter + "';");
    }
   
    buttons.add(new ToolbarButton("reset",
                      getLocalizedString(locale, "tool.common.resetButton.label"),
                      getLocalizedString(locale, "tool.common.resetButton.label"),
                      cancelJS,
                      "css/images/v3/cancelIcon.gif",
                      "left",
                    "reset",
                      true));

    if(contentVersionIdParameter != null && !contentVersionIdParameter.equals(cvvo.getContentVersionId().toString()))
    {
      buttons.add(new ToolbarButton("revert",
            getLocalizedString(locale, "tool.common.revertButton.label"),
            getLocalizedString(locale, "tool.common.revertButton.label"),
            "UpdateContentVersion!revertToVersion.action?contentVersionId=" + contentVersionIdParameter,
            "",
            "reset",
View Full Code Here

TOP

Related Classes of org.infoglue.cms.applications.common.ToolbarButton

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.