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");