buttons.add(getDeleteButton());
if(this.contentVersionId != null)
{
if(!isReadOnly())
buttons.add(new ImageButton(true, "javascript:openPopup('ViewDigitalAsset.action?contentVersionId=" + this.contentVersionId + "', 'FileUpload', 'width=400,height=200,resizable=no');", getLocalizedString(getSession().getLocale(), "images.contenttool.buttons.newAsset"), "tool.contenttool.uploadDigitalAsset.header"));
if(hasPublishedVersion())
{
ImageButton unpublishButton = getUnpublishButton();
ImageButton unpublishAllButton = getUnpublishAllButton();
unpublishButton.getSubButtons().add(unpublishAllButton);
buttons.add(unpublishButton);
}
if(!isReadOnly())
buttons.add(getPublishButton());
if(this.contentVO.getIsProtected().intValue() == ContentVO.YES.intValue())
{
ImageButton accessRightsButton = getAccessRightsButton();
accessRightsButton.getSubButtons().add(getContentVersionAccessRightsButton());
buttons.add(accessRightsButton);
}
if(this.contentVO.getContentTypeDefinitionId() != null)
{
ContentTypeDefinitionVO contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(this.contentVO.getContentTypeDefinitionId());
if(contentTypeDefinitionVO != null && (contentTypeDefinitionVO.getName().equalsIgnoreCase("HTMLTemplate") || contentTypeDefinitionVO.getName().equalsIgnoreCase("PageTemplate") || contentTypeDefinitionVO.getName().equalsIgnoreCase("PagePartTemplate")))
{
List interceptionPointVOList = InterceptionPointController.getController().getInterceptionPointVOList("Component");
if(interceptionPointVOList != null && interceptionPointVOList.size() > 0)
buttons.add(getComponentAccessRightsButton());
buttons.add(getDeployComponentButton());
}
}
if(this.siteNodeId != null)
{
RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(this.repositoryId);
String dnsName = repositoryVO.getDnsName();
String workingUrl = null;
String keyword = "working=";
int startIndex = (dnsName == null) ? -1 : dnsName.indexOf(keyword);
if(startIndex != -1)
{
int endIndex = dnsName.indexOf(",", startIndex);
if(endIndex > -1)
dnsName = dnsName.substring(startIndex, endIndex);
else
dnsName = dnsName.substring(startIndex);
String hostName = dnsName.split("=")[1];
if(hostName.indexOf("localhost") == -1)
workingUrl = hostName + CmsPropertyHandler.getComponentRendererUrl() + "ViewPage.action";
else
workingUrl = CmsPropertyHandler.getComponentRendererUrl() + "ViewPage.action";
}
else
{
workingUrl = CmsPropertyHandler.getPreviewDeliveryUrl();
}
ImageButton previewSiteButton = new ImageButton(true, "javascript:openPopup('" + workingUrl + "?siteNodeId=" + this.siteNodeId + "&languageId=" + this.languageId + "', 'SitePreview', 'width=800,height=600,resizable=yes,toolbar=yes,scrollbars=yes,status=yes,location=yes,menubar=yes');", getLocalizedString(getSession().getLocale(), "images.contenttool.buttons.previewSite"), "tool.contenttool.previewSite.header");
ImageButton previewContentButton = new ImageButton(true, "javascript:openPopup('ViewContentVersion!preview.action?contentVersionId=" + this.contentVersionId + "&contentId=" + this.contentId + "&languageId=" + this.languageId + "', 'ContentPreview', 'width=800,height=600,resizable=yes,toolbar=yes,scrollbars=yes,status=yes,location=yes,menubar=yes');", getLocalizedString(getSession().getLocale(), "images.contenttool.buttons.previewContent"), "tool.contenttool.previewContent.header");
previewSiteButton.getSubButtons().add(previewContentButton);
buttons.add(previewSiteButton);
}