by Nissy Abraham, Developer, MOSMAR
The previous versions of iManage up to 9.x provided us with the ability to add dll references for iManage which enabled us to customise word in VBA to use iManage functionalities. We could capture iManage events in Word VBA using the corresponding references. But this is not the case in Work 10, where there is no possibility to get those Worksite events and properties in VBA unless through the plugins and RESTAPI’s.
The iManage Work extensibility framework enables you to create .NET plugins for iManage Work 10 for Office. Using these plugins, you can extend and customize the functionality of the iManage Work 10 for Office add-in.
iManage Work 10 for Office plugins are .NET assemblies loaded by the iManage Work 10 for Office add-in to extend and customise its functionality. The plugins are downloaded automatically from the Work 10 application Server for each distribution. They can catch the events when an action is performed on the application or a form is about to load, modify the document metadata, retrieve the Office document object, and so on.
Creating a Sample Plugin for Microsoft Word
Sample: Hello World
This plugin displays a “Hello World” message whenever Microsoft Word starts.
- Install iManage Work 10 for Office (version 10.0.1 or later).
- In Microsoft Visual Studio, create a new Visual C# project with unique Class Library (.NET Framework) namespace, for example,
- Add references to iManage Work 10 for Office libraries iwto.dll and IWInterfaces.dl. These DLLs are available in the install directory of iManage Work 10 for Office.
- Add a reference to System.Windows.Form under Work10OfficePlugin by right-clicking
- References-> Add Reference ->Assemblies ->Framework ->select System.Windows.Forms.
- Rename the default C# file cs to HelloWorld.cs
- Create a .NET class for the plugin in cs, for example, WordPlugin1. This class must derive from iManage.Work.Tools.PlugInBase
Include the following in the plugin host event in the Initialize method.
HelloWorld.cs
using System;
using iManage.Work.Tools;
namespace Work10OfficePlugins
{
public class WordPlugin1 : PlugInBase
{
public override bool Initialize(IPlugInHost host)
{
PlugInHost = host;
PlugInId = “myId”;
host.Startup += this.onStartup;
return true;
}
private void onStartup(object sender, EventArgs args)
{
System.Windows.Forms.MessageBox.Show(“Hello World!”);
}
}
}
Sideload the plugin in the Development environment:
- Create a resource file by right-clicking the project txt by right-clicking the project Work10OfficePlugins-> Add -> New Item -> Text File -> Add.
- Specify the MAC address of the development machine. Up to 20 MAC addresses can be provided in this config file.
- Right-click sideload_config.txt and select ->Properties -> Build Action -> Embedded Resource
sideload_config.txt
{
data: {
“macaddresses” : [ “00-0C-29-D4-BD-92”, “C1-12-83-07-3D-4C” ]
}
}
- Digitally sign the assembly:
- Right click the project Work10OfficePlugins -> Properties -> Signing -> Sign the assembly ->. Choose a strong name key file -> New
- Add a Key file name of your choice, for example, plugin
- Protect my key file with a password
- Enter a password and select OK
- Build the project by right-clicking the Work10OfficePlugins project and selecting Build. Ensure that there are no errors in the build.
- Navigate to the project directory where the compiled assembly Work10OfficePlugins.dll is.
- Copy Work10OfficePlugins.dll to %localappdata%/iManage/Work/plug_ins.If the plug_ins directory is not available, create it and then copy the assembly into it.
- Register the plugin:
- Add the wplugins.manifest file by right-clicking Work10OfficePlugins and selecting Add -> New Item-> Application Manifest File -> Add
- Add the following assembly details in the wplugins.manifest file
wplugins.manifest
<?xml version=”1.0″ encoding=”utf-8″ ?>
<configuration>
<word>
<entrypoints>
<entrypoint class=”Work10OfficePlugins.WordPlugin1″ resource=”
Work10OfficePlugins.sideload_config.txt”>
<assemblyIdentity name=”Work10OfficePlugins” version=”1.0.0.0″
publicKeyToken=”” language=”neutral” processorArchitecture=”msil” />
<provider name=”iManage”>iManage Office Plug In #1</provider>
</entrypoint>
</entrypoints>
</word>
</configuration>
- Copy the file to wplugins.manifest %localappdata%/iManage/Work/plug_ins.
- Start Microsoft Word. The “Hello World ” message is displayed.
Deploying the plugins
In the development environment, plugins are loaded to iManage Work Server using a sideloading mechanism as shown in the above example. Sideloaded plugins are authorized to run on up to twenty computers, identified by the MAC addresses of their network cards
In the production environment, the plugins can be registered and uploaded to iManage Work Server by the administrator using REST APIs or iManage Control Center
Using iManage Control Center
iManage Control Center (iCC) enables the administrators to upload iManage Work for Office plugins to iManage Work Server.
The developer creates a zip file which contains the plugin assembly files and manifest file and sends it to the administrator. Using iCC application, the administrator defines security settings on the plugin, and uploads it to iManage Work Server.
Creating Manifest File
You need to provide the information about your Office plugin to iManage Work server in file manifest.yaml. Identify a unique ID for your plugin and create the following manifest file in the YAML format as
manifest.yaml
# Information about Office plugin
id: UniqueIDForMyProject
name: Sample Office plugin
publisher: XYZ Inc.
version: ‘1’
# Name of the extensions
desktop_extensions:
– iwtoTestPlugIn.WordPlugin
– iwtoTestPlugIn.ExcelPlugIn
– iwtoTestPlugIn.PowerPointPlugIn
– iwtoTestPlugIn.OutlookPlugI
iManage Work REST APIs
The iManage Work REST APIs enable users to perform operations such as viewing documents, browsing workspaces, and searching for documents on the iManage Work server through the HTTP protocol. Several operations that are performed through the iManage Desktop client applications can be performed and/or automated using iManage Work REST APIs.
More information regarding Work 10 upgrade is available from
Need Help?
Please get in touch with MOSMAR should you need any help with your Work 10 upgrade.
We have years of experience with this product and know the intricate details of how to go about your upgrade.