Guest User

CustomActions.xml

a guest
Jun 8th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.31 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <CustomActions>
  3.   <ActionDefinition ID="Open Laserfiche Investigators Case">
  4.     <Title>Open Laserfiche Investigators Case Site</Title>
  5.     <Action>
  6.       <![CDATA[
  7.     var onWebServiceCallSuccess = function(result) {
  8.         if(result && result.url) {
  9.             window.open(result.url);
  10.         } else {
  11.             alert("Unable to open the Laser Investigators site");
  12.         }
  13.     }
  14.    
  15.     var onWebServiceCallFail = function(err) {
  16.         if(err && err.get_message) {
  17.             alert(err.get_message);
  18.         }
  19.     }
  20.    
  21.     var getSelectedDocumentID = function(context) {
  22.         var selItems = context.getSelectedItems();
  23.         var itemList = selItems.items;
  24.         if(itemList && itemList.length) {
  25.             return itemList[0].id;
  26.         }
  27.         return -1;
  28.     }
  29.    
  30.     // Get Document ID of selected item
  31.     var DocumentID = getSelectedDocumentID(context);
  32.  
  33.     Laserfiche.WebAccess.ActionsWebService.PerformCustomAction(
  34.         'GenerateLaserInvestigatorsURL', /* MethodName */
  35.         { DocumentID : DocumentID },  /* MethodArguments */
  36.         onWebServiceCallSuccess,      /* Function to run on succcess */
  37.         onWebServiceCallFail          /* Function to run on fail */
  38.     );
  39.     ]]>
  40.     </Action>
  41.     <Enabled>
  42.       <![CDATA[
  43.     return true;
  44.     ]]>
  45.     </Enabled>
  46.     <IconClass>InvestigatorsIcon</IconClass>
  47.     <Toolbars>7</Toolbars>
  48.   </ActionDefinition >
  49. </CustomActions>
Advertisement
Add Comment
Please, Sign In to add comment