Sitemap

Sunday, April 5, 2015

UCM: Customizing a Page's Action Menu

Here we will try to customize the interface of UCM to include an option to delete all revisions of a particular content.


We will develop a custom component like below:



This is the script written in the custom component:

<@dynamichtml custom_docinfo_menus_setup@>
 <!--c:include all other previous instances using super.-->
 <$include super.custom_docinfo_menus_setup$>
 <$if isFalse(dIsCheckedOut)$>
 <$exec rsAppendNewRow("PageMenusData")$>
 <$PageMenusData.nodeId = "DELETE_ALL_REVISIONS"$>
 <$PageMenusData.parentId = "CONTENT_ACTIONS"$>
 <$PageMenusData.label = "Delete All Revisions"$>
 <$PageMenusData.type = "item"$>
 <$PageMenusData.href = "javascript:deleteAllRevisions();"$>
 <$PageMenusData.loadOrder = 100$>
 <$endif$>
<@end@>

<@dynamichtml std_info_html_head_declarations@>
 <$include super.std_info_html_head_declarations$>
 <$if isFalse(dIsCheckedOut)$>
 <script type="text/javascript">
  function deleteAllRevisions() {
   var response = confirm("Are you sure you want to delete this content item and all revisions?");
   if (response) {
    window.location = "<$HttpCgiPath & "?IdcService=DELETE_DOC&dID=" & dID & "&dDocName=" & urlEscape7Bit(dDocName) & "&idcToken=" & idcToken$>"
   }
  }
 </script>
 <$endif$>
<@end@>


No comments:

Post a Comment