JungleDocs | JavaScript API

You can use the JungleDocs interface to work with JungleDocs, but you can also use JavaScript API. In this tutorial, you will learn a little more about using JavaScript API with JungleDocs.


JavaScript API can be used to open the JungleDocs' interface or to execute a rule just as users would do from the JungleDocs button in the ribbon.

There are two ways to make JavaScript API available:

  1. Activate “EnovaPoint JungleDocs” site feature;
  2. Include JungleDocs JavaScript file manually to the page (/layouts/15/Enova.SP.JungleDocs/JungleDocsActions.js).

Open JungleDocs dialog

Use the  EnovaSPJungleDocOpenDialog() function to open the JungleDocs dialog.

EnovaSPJungleDocOpenDialog(siteUrl, listId, itemIds, folderUrl, viewId, navigateAfterCreation, openAfterCreation, filterQuery, listIsOnCurrentPage, reloadPage)

  • siteUrl – SharePoint Context Site URL (Required).
  • listId – SharePoint Context List ID (Required).
  • itemIds – Selected item ID(s) (for From Existing, Reports and Convert).
  • folderUrl – Context fodler URL (for Reports and Convert).
  • viewId – Current View ID (for Reports and Convert).
  • navigateAfterCreation – Default value for “Navigate to target list after creation” checkbox (true or false).
  • openAfterCreation – default value for “Open after creation” checkbox (true or false).
  • filterQuery – Additional filter on items (for Reports and Convert).
  • listIsOnCurrentPage – Is call coming from Context List (true or false).
  • reloadPage – Should current page be reloaded after JungleDocs finishes (true or false).

Examples:

Link to open JungleDocs dialog for new document creation using Base Rules:
<a href="javascript:EnovaSPJungleDocOpenDialog('http://dev2012/sites/JungleDocs1', '765b2739-46ae-4c23-9a66-ebf6888d5466', '', '', '', true, false, '', false, false)">Open JungleDocs for Base Rules</a><br>

Link to open JungleDocs dialog for new document creation using From Existing Rules (specified selected item – source item):
<a href="javascript:EnovaSPJungleDocOpenDialog('http://dev2012/sites/JungleDocs1', '765b2739-46ae-4c23-9a66-ebf6888d5466', '1', '', '', true, false, '', false, false)">Open JungleDocs for From Existing Rules</a><br>

Link to open JungleDocs dialog for new report creation using Report Rules or convert document (specified selected items, view and filter):
<a href="javascript:EnovaSPJungleDocOpenDialog('http://dev2012/sites/JungleDocs1', '765b2739-46ae-4c23-9a66-ebf6888d5466', '1,2,3', '/sites/JungleDocs1/Proposals', '041D0414-F003-4739-86E7-9952A8FCEB14', true, false, 'FilterField1=Editor&FilterValue1=Kiril%20Sidun&SortField=LinkFilename&SortDir=Asc', false, false)">Open JungleDocs for Report Rules or Convert</a><br>

Execute JungleDocs rule

Use the  EnovaSPJungleDocExecuteRule() function to execute the specified JungleDocs rule.

EnovaSPJungleDocExecuteRule(siteUrl, listId, itemIds, viewId, ruleType, ruleName, creationType, navigateAfterCreation, openAfterCreation, listIsOnCurrentPage, reloadPage)

  • siteUrl – SharePoint Context Site URL (Required).
  • listId – SharePoint Context List ID (Required).
  • itemIds – Selected item ID(s) (for From Existing, Reports and Convert).
  • viewId – Current View ID (for Reports and Convert).
  • ruleType – JungleDocs Rule Type (Base, FromExisting or Report).
  • ruleName – JungleDocs Rule name or ID.
  • creationType – Creation type (Create, CopySource or Upload).
  • navigateAfterCreation – Default value for “Navigate to target list after creation” checkbox (true or false)
  • openAfterCreation – default value for “Open after creation”  checkbox (true or false)
  • listIsOnCurrentPage – Is call coming from Context List (true or false)
  • reloadPage – Should current page be reloaded after JungleDocs finishes (true or false)

Example:

Execute JungleDocs Base Rule „Document“:
<a href="javascript:EnovaSPJungleDocExecuteRule('http://dev2012/sites/JungleDocs1','765b2739-46ae-4c23-9a66-ebf6888d5466','2','','Base','0x0101003AD2EF030E92BB45ACE99CA66830169B','Create',true,false,false,false);">Document</a>

Still need help? Contact Us Contact Us