JavaScript API

Applies to JungleDocs for SharePoint 2010-2019.
For JungleDocs for Office 365 tutorials, click here.

Instead of the JungleDocs interface, you can use JavaScript API. In this tutorial, you will learn more about using JavaScript API with JungleDocs.


About JavaScript API

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).

Opening JungleDocs dialog

To open the JungleDocs dialog, use the EnovaSPJungleDocOpenDialog function.

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).

Example

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>


Executing a JungleDocs rule

To execute the specified JungleDocs rule, use the EnovaSPJungleDocExecuteRule function.

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>

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us