User Guide – SPFx

Access tokens have a limited lifespan. Users can customize the expiry for these tokens in the application screen on iManage:

If an API is made with an expired token, a 401 Unauthorized status is returned. imDocShare automatically processes expired tokens and attempts to retrieve a new token when required. For this, we use refresh tokens which last much longer.

This is different from a login lifetime when using iManage itself. iManage for security reasons will log out users automatically after 90 minutes of inactivity. As a iManage user, you can enable an automated login option if your organization has Microsoft Active Directory Services.

If an API is made with an expired token, a 401 Unauthorized status is returned. imDocShare automatically processes expired tokens and attempts to retrieve a new token when required. For this, we use refresh tokens which last much longer.

This is different from a login lifetime when using iManage itself. iManage for security reasons will log out users automatically after 90 minutes of inactivity. As a iManage user, you can enable an automated login option if your organization has Microsoft Active Directory Services.

Clicking on this will reveal a logout option which will remove the iManage session from the browser. Note: This will log you out of iManage in every tab of the current browser. The page will refresh automatically, and users must login to iManage before resuming usage.

Invalid URL error

Users must make sure that the URL they submit to https://iManage.force.com is EXACTLY the same as their auth page URL. This must match case and spelling exactly or else it will throw invalid URL error. This includes http and https.

Duplicate Webparts

In some older SharePoint versions, webparts linger on the page even after they have been deleted. The number of webparts can be seen here:

If there is more than one webpart on a page, it will impact how our software will function, e.g. the page might have multiple auth popups among other things, as the hidden webparts will still be loading code. To remove the unnecessary webparts officially, open the page in Web Part Page Maintenance and remove hidden webparts.

Auth failing to refresh or redirect

If Authentication is failing to redirect or failing to reload the page after logging in or clicking the “Allow / Deny” prompt, this may be due to existing errors on the page which may block attempts to navigate to another page. In order to avoid this, or to test whether this is the issue, please insert our webpart on a blank Sharepoint page that loads no other content such as ScriptEditor webparts or scripts embedded into the Master Page. If the webpart can work on the blank page but not on the original page, there is some content that is blocking the functionality of our app. In this case, we recommend fixing the existing errors on the page or using a page which does not load the problematic content.

The document viewer WebPart is the core of our application. It comes out of the box with 5 varied and configurable viewtypes.

In normal view, it can show a single source: a workspace, folder or special folders such as category folders, or search folders.

In RecentDoc view, it can show the user’s most recent document or workspaces

In Favorites view, it can show user-specified favorite documents or folders

Normal View also makes use of a breadcrumb Trail which is a visual indicator which shows the received primary source as the “root” and when navigating through subfolders, creates a sequential list of containers that can be navigated back to at any point. In the above example, “Bill – Info” is the root source that is defined in the configs. The user in the example has navigated 5 levels deeper to find the document named “Contract 19342342” and they can click on any sub-container name to travel directly back to that container. Uploading a document while inside a sub-container will upload to the sub-container instead of the primary source.

You can add the Document Viewer WebPart by picking it in the same menu where you added the Like all our webparts, it will require the user to insert a configuration object before it can start up. An example and explanation of the DocumentViewer JSON Config Object is shown below:

Viewtype: Normal View

{

viewType“: “normalView”,

assetPath“: “https://{your-tenant}.sharepoint.com/sites/AppCatalog/SiteAssets/80f7bcb7-98fe-43d7-8c8d-cbafb53acd81/”,

primarySource“: {

“id”: “Active!88”,

“type”: “folder”

},

columns“: [“name”, “version”, “id”, “edit_date”, “type”],

libraryId“: “Active”,

clientID“: “ff6c96e7-c007-4421-ab54-e8e3fa28f241”,

baseURL“: “https://cloudimanage.com”,

contextMenu“: [“download”, “delete”, “rename”, “favorites”, “checkOutIn”, “prevTab”, “prevBrowser”],

searchBehavior“: “searchContainer”

}

For explanations of each property, what they do and what values should be used to change them, please see our Config Builder Properties Appendix at the end of the document.

Viewtype: Recent Doc

The Recent Doc viewtype is a different configuration of the Document Viewer Webpart that shows a collection of recent documents or workspaces that are derived from the individual user account of the iManage user. The only difference between a regular document viewer and RecentDocs lies in the configuration. RecentDoc has the simplest configuration as it does not require any sources or additional configuration. It simply shows the last 40 most recent documents based on the user’s account. This list will only be updated after edited documents have been checked in, or after they have been initially uploaded.

An example and explanation of theRecent Doc JSON Object is as follows:

{

viewType“: “normalView”,

assetPath“: “https://{your-tenant}.sharepoint.com/sites/AppCatalog/SiteAssets/80f7bcb7-98fe-43d7-8c8d-cbafb53acd81/”,

primarySource“: “recent”,

columns“: [“name”, “version”, “id”, “edit_date”, “type”],

libraryId“: “Active”,

clientID“: “ff6c96e7-c007-4421-ab54-e8e3fa28f241”,

baseURL“: “https://cloudimanage.com”,

contextMenu“: [“download”, “delete”, “rename”, “favorites”, “checkOutIn”, “prevTab”, “prevBrowser”],

searchBehavior“: “searchContainer”

}

For explanations of each property, what they do and what values should be used to change them, please see our Config Builder Properties Appendix at the end of the document.

Viewtype: Favorites

The Favorites viewtype is a different configuration of the Document Viewer Webpart that shows a collection of user-defined favorites that are derived from the account of the iManage user. The only difference between a regular document viewer and the Favorites view lies in the configuration and the configs for favorites is identical to Recent Docs except for the primary Source.

An example and explanation of the Favorites JSON Object is as follows:

{

viewType“: “normalView”,

assetPath“: “https://{your-tenant}.sharepoint.com/sites/AppCatalog/SiteAssets/80f7bcb7-98fe-43d7-8c8d-cbafb53acd81/”,

primarySource“: “favorites”,

columns“: [“name”, “version”, “id”, “edit_date”, “type”],

libraryId“: “Active”,

clientID“: “ff6c96e7-c007-4421-ab54-e8e3fa28f241”,

baseURL“: “https://cloudimanage.com”,

contextMenu“: [“download”, “delete”, “rename”, “favorites”, “checkOutIn”, “prevTab”, “prevBrowser”],

searchBehavior“: “searchContainer”

}

For explanations of each property, what they do and what values should be used to change them, please see our Config Builder Properties Appendix at the end of the document.

Other Views: Category folder, Search Folder

Other view types such as category folders and search folders are accessed in the same way that regular folders are. Simply use the ID of the specialized folder the same way you would with a regular folder.

Viewtype: TreeView

The Tree View WebPart shows a collection of container objects (folders, workspaces, specialized folders) on the left pane, with a corresponding document-viewer pane on the right. Subcontainer objects such as filters, saved searches, CollabSpaces etc. will unravel and be reveal in a tree-like structure on the left pane as the user clicks deeper into the directory.

Installation instructions:

The Tree View WebPart shows a collection of container objects (folders, workspaces, specialized folders) on the left pane, with a corresponding document-viewer pane on the right. Subcontainer objects such as filters, saved searches, CollabSpaces etc. will unravel and be reveal in a tree-like structure on the left pane as the user clicks deeper into the directory.

{

viewType“: “treeView”,

assetPath“: “https://{your-tenant}.sharepoint.com/sites/AppCatalog/SiteAssets/80f7bcb7-98fe-43d7-8c8d-cbafb53acd81/”,

columns“: [“name”, “version”, “id”, “edit_date”, “type”],

testValue“: “false”,

libraryId“: “Active”,

clientID“: “ff6c96e7-c007-4421-ab54-e8e3fa28f241”,

baseURL“: “https://cloudimanage.com”,

primarySource“: [{

“id”: “ACTIVE!148”,

“type”: “folder”

}, {

“id”: “ACTIVE!150”,

“type”: “folder”

}],

contextMenu“: [“download”, “delete”, “rename”, “favorites”, “checkOutIn”, “prevTab”, “prevBrowser”],

searchBehavior“: “searchContainer”

}

For explanations of each property, what they do and what values should be used to change them, please see our Config Builder Properties Appendix at the end of the document.

ImDocShare also supports the insertion of custom column properties. In order to use custom properties, please visit your iManage Matadata administration page, and make sure that the properties you have created are enabled. When inserting the property into the ImDocShare config, the spelling and capitalization must match exactly to the attribute that you have defined in the profile Attributes section of iManage Admin.

Note: If you are creating a brand-new custom field, it may take some time for the data to populate properly. Please wait a few minutes after creating the custom field for the data to be correctly associated in the iManage API.

In the figure below, you can see the custom column “Client” has been implemented.

If the Config builder has not been created yet, the following steps will create one.

Create a new page or use existing Config Builder webpart.

After generating the IManageViewer webpart, click edit button and wait till right panel shows up. All webparts require configs, even the config builder itself. Thankfully, unlike the other webparts, Config Builder only requires 2 configs.

Create the Config Builder webpart by pasting

{ “viewType”: “createConfig”, “assetPath”: “your-asset-path-here” }

to IManageViewer webpart.

For more information on how to obtain your asset Path please see the Config Builder Properties Appendix.

(Optional) To modify an already existing config string, click the Import button on bottom left.

Copy and paste the JSON string. Then click Import. This process will populate the form with provided data.

Choose options that you would like to show on Webparts.

The possible options include:

View Type:

Normal View, Recent Documents, Favorite Documents, Saved Search, Tree View, and Authentication

Column Properties:

The desired columns displayed on the web part.

Context Menu:

What options are available in the dropdown context menu for each file.

Please refer to the Config Builder Properties Appendix to see a full list of config values and what options are available to fill them out.

Please don’t forget to press the “+” button next to fields such as CabinetID or else the form will not register the input.

Please refer to the URL on iManage.com to find out ID codes for each document or container.

After setting your desired configuration, click ‘JSON View’ or ‘Copy to Clipboard’ button to copy the JSON string.

If deciding to modify an existing page, then click on “edit” button, and click on the IManageViewer webpart. After right panel pops up, replace the config that was generated using Config Builder into IManageViewer web part.

Click ‘Publish’ to publish the page.