Package org.infoglue.cms.applications.common

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


      buttons.add(getReactivateButton(toolbarKey, principal, locale, request, disableCloseButton));
    }
   
    if(contentVersionIdString != null && !contentVersionIdString.equals(""))
    {
      buttons.add(new ToolbarButton("uploadAsset",
            getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
            getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
            "ViewDigitalAsset.action?contentVersionId=" + contentVersionIdString,
            "",
            "",
            "attachAsset",
            false,
            false,
            "",
            "",
            "inlineDiv",
            500,
            550));
    }

    buttons.add(getCommonFooterSaveButton(toolbarKey, principal, locale, request, disableCloseButton));
    if(saveAndExitURL != null && !saveAndExitURL.equals(""))
      buttons.add(getCommonFooterSaveAndExitButton(toolbarKey, principal, locale, request, disableCloseButton, saveAndExitURL));
    else
   
      buttons.add(new ToolbarButton("saveAndExit",
                    getLocalizedString(locale, "tool.contenttool.saveAndExit.label"),
                    getLocalizedString(locale, "tool.contenttool.saveAndExit.label"),
                    "validateAndSubmitContentFormThenClose();",
                    "css/images/v3/saveAndExitInlineIcon.gif",
                    "left",
View Full Code Here


    String contentIdString = request.getParameter("contentId");
    if(contentIdString == null || contentIdString.equals(""))
      contentIdString = (String)request.getAttribute("contentId");

    buttons.add(new ToolbarButton("useSelectedAsset",
          getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
          getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
          "useSelectedAsset();",
          "",
          "",
          "linkInsert",
          true,
          false,
          "",
          "",
          ""));

    if(contentIdString != null && !contentIdString.equals(""))
    {
      try
      {
        /*
         * ContentId and ContentVersionId are retrieved to check that the values are valid.
         * They are not actually used here.
         */
        Integer contentId = new Integer(contentIdString);
        ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
        String contentVersionIdString = request.getParameter("contentVersionId");
        Integer contentVersionId = null;
        if(contentVersionIdString == null)
        {
          LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId());
          ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentId, masterLanguageVO.getId());
          if(contentVersionVO != null)
            contentVersionId = contentVersionVO.getId();
        }
        else
        {
          contentVersionId = new Integer(contentVersionIdString);
        }
        if (logger.isDebugEnabled())
        {
          logger.debug("ContentVersionAssetsFooterButtons. contentId: " + contentId + ". contentVersionId: " + contentVersionId);
        }
        buttons.add(new ToolbarButton("uploadAsset",
              getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
              getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
              "uploadAsset()", //"ViewDigitalAsset.action?contentVersionId=" + contentVersionId
              "",
              "",
View Full Code Here

      {
        contentVersionId = new Integer(contentVersionIdString);
      }
    }
   
    buttons.add(new ToolbarButton("useSelectedAsset",
          getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
          getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
          "useSelectedAsset();",
          "",
          "",
          "linkInsert",
          true,
          false,
          "",
          "",
          ""));

    buttons.add(new ToolbarButton("uploadAsset",
          getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
          getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
          "uploadAsset();",
          "",
          "",
View Full Code Here

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

    buttons.add(new ToolbarButton("resize",
          getLocalizedString(locale, "tool.contenttool.imageEditor.resize"),
          getLocalizedString(locale, "tool.contenttool.imageEditor.resize"),
          "openResizeImageDialog();",
          "",
          "",
          "resize",
          true,
          false,
          "",
          "",
          ""));

    buttons.add(new ToolbarButton("crop",
          getLocalizedString(locale, "tool.contenttool.imageEditor.crop"),
          getLocalizedString(locale, "tool.contenttool.imageEditor.crop"),
          "activateCropTool();",
          "",
          "",
          "crop",
          true,
          false,
          "",
          "",
          ""));

    buttons.add(new ToolbarButton("rotate",
          getLocalizedString(locale, "tool.contenttool.imageEditor.rotate"),
          getLocalizedString(locale, "tool.contenttool.imageEditor.rotate"),
          "openRotateImageDialog();",
          "",
          "",
          "rotate",
          true,
          false,
          "",
          "",
          ""));

    buttons.add(new ToolbarButton("undo",
          getLocalizedString(locale, "tool.contenttool.undo.label"),
          getLocalizedString(locale, "tool.contenttool.undo.label"),
          "openUndoDialog();",
          "",
          "",
          "undo",
          true,
          false,
          "",
          "",
          ""));

    buttons.add(new ToolbarButton("save",
          getLocalizedString(locale, "tool.contenttool.save.label"),
          getLocalizedString(locale, "tool.contenttool.save.label"),
          "openSaveImageDialog();",
          "",
          "",
          "save",
          true,
          false,
          "",
          "",
          ""));

    buttons.add(new ToolbarButton("saveAs",
          getLocalizedString(locale, "tool.contenttool.saveAs.label"),
          getLocalizedString(locale, "tool.contenttool.saveAs.label"),
          "openSaveAsImageDialog();",
          "",
          "",
View Full Code Here

    String contentIdString = request.getParameter("contentId");
    if(contentIdString == null || contentIdString.equals(""))
      contentIdString = (String)request.getAttribute("contentId");

    buttons.add(new ToolbarButton("useSelectedPage",
          getLocalizedString(locale, "tool.contenttool.linkDialog.choosePage"),
          getLocalizedString(locale, "tool.contenttool.linkDialog.choosePage"),
          "useSelectedPage();",
          "",
          "",
          "linkInsert",
          true,
          false,
          "",
          "",
          ""));

    buttons.add(new ToolbarButton("useSelectedAsset",
          getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
          getLocalizedString(locale, "tool.contenttool.assetDialog.chooseAttachment"),
          "useSelectedAsset();",
          "",
          "",
          "linkInsertAsset",
          true,
          false,
          "",
          "",
          ""));
   
    if(contentIdString != null && !contentIdString.equals(""))
    {
      try
      {
        /*
         * ContentId and ContentVersionId are retrieved to check that the values are valid.
         * They are not actually used here.
         */
        Integer contentId = new Integer(contentIdString);
        ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
        String contentVersionIdString = request.getParameter("contentVersionId");
        Integer contentVersionId = null;
        if(contentVersionIdString == null)
        {
          LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId());
          ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentId, masterLanguageVO.getId());
          if(contentVersionVO != null)
            contentVersionId = contentVersionVO.getId();
        }
        else
        {
          contentVersionId = new Integer(contentVersionIdString);
        }
        if (logger.isDebugEnabled())
        {
          logger.debug("ContentVersionAssetsFooterButtons. contentId: " + contentId + ". contentVersionId: " + contentVersionId);
        }
        buttons.add(new ToolbarButton("uploadAsset",
              getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
              getLocalizedString(locale, "tool.contenttool.uploadNewAttachment"),
              "uploadAsset();",
              "",
              "",
View Full Code Here

 
  private List<ToolbarButton> getContentVersionWizardFooterButtons(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.common.nextButton.label"),
                    getLocalizedString(locale, "tool.common.nextButton.label"),
                    "javascript:validateAndSubmitContentForm();",
                    "css/images/v3/saveInlineIcon.gif",
                    "save"));
   
    buttons.add(new ToolbarButton("",
                      getLocalizedString(locale, "tool.contenttool.cancel.label"),
                      getLocalizedString(locale, "tool.contenttool.cancel.label"),
                      "if(parent && parent.closeInlineDiv) parent.parent.closeInlineDiv(); else if(parent && parent.closeDialog) parent.closeDialog(); else window.close();",
                      "css/images/v3/cancelIcon.gif",
                      "left",
View Full Code Here

   
    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))
    {
      buttons.add(new ToolbarButton("",
          getLocalizedString(locale, "tool.contenttool.toolbarV3.runTaskLabel"),
          getLocalizedString(locale, "tool.contenttool.toolbarV3.runTaskTitle"),
          "ViewExecuteTask.action?siteNodeId=" + siteNodeId + "",
          "",
          "runTask"));
View Full Code Here

 
  private List<ToolbarButton> getCreateSiteNodeButtons(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"),
          "javascript:validateAndSubmitContentForm();",
          "css/images/v3/saveInlineIcon.gif",
          "save"));
View Full Code Here

  private List<ToolbarButton> getContentRelationFooterButtons(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.common.addButton.label"),
          getLocalizedString(locale, "tool.common.addButton.label"),
          "add();",
          "css/images/v3/addIcon.png",
          "left",
View Full Code Here

    return buttons;   
  }

  private ToolbarButton getCompareButton(String toolbarKey, InfoGluePrincipal principal, Locale locale, HttpServletRequest request, boolean disableCloseButton) throws Exception
  {
    return new ToolbarButton("compare",
                    getLocalizedString(locale, "tool.common.compare.label"),
                    getLocalizedString(locale, "tool.common.compare.label"),
                    "compare();",
                    "css/images/v3/compareIcon.gif",
                    "left",
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.