Home > DOCUMENTUM > Syncplicity & Custom Plug-ins actions

Syncplicity & Custom Plug-ins actions

In the Previous post, I tried to explain the various customization and plug-ins that are available/offered with D2 in this post I will detail my experiences with the custom plug-ins , how to override a D2 Service and how we handle actions in D2. Let me start with a lighter concept with D2 before I jump onto the custom plugins and actions…

Syncplicity

Files can be shared directly from D2 to Syncplicity, allowing content to make available to users inside and outside an organization on multiple devices.  Folders may be synced from a menu option or from a workflow task. An icon is shown on the folder/content to indicate that the content has been synced. Automatic shares can be set up by an administrator and limited to specific document types.  Shares can also be manually initiated by authorized users.


Custom Plug-ins Custom Actions

1

 

2

3


Creating and Configuring a Custom Plug-in – Creating a New Plug-in Using the Template

  1. Rename the Your Co-PluginName project.
  2. Rename com.yourdomainhere.yourplugin in Eclipse to your domain namespace and package name for each package in the plug-in template.
  3. Optionally, rename PluginNameVersion.java and PluginNameVersion.properties ; If you rename the files, you must edit build.properties to reflect the name change.
  4. Edit build.properties and change project.version.file to reflect the package structure and the plug-in properties file name.
  5. Edit PluginNameVersion.properties
  6. Add the plug-in implementation classes. For example: *.webfs.services.content and *.webfs.services.create
  1. Re-run .\build\build.xml to rebuild the plug-in.

How do you create and handle actions, custom actions in D2?

  1. Create a Java class in the <project folder>/src/com/<your namespace>/<plug-in name>/webfs/services/custom/ folder.
  2. Import the d2fs resources:

import java.util.List;

import com.emc.d2fs.dctm.plugin.IPluginAction;

import com.emc.d2fs.dctm.web.services.D2fsContext;

import com.emc.d2fs.models.attribute.Attribute;

  1. Implement IPluginAction: public class <name of the class> implements IPluginAction
  2. The class must contain a method that has at minimum the following format:

public List<attribute> <methodName>(D2fsContext context) throws UnsupportedEncodingException, DfException, D2fsException;

  1. After building and installing the plug-in, create a menu button in D2 Config to allow end users to perform the custom action.

Throwing Exceptions

We can use Exception () and D2fsException () to report exceptions or errors encountered in Service extension or Custom Action code back to D2 and the end user. The following example shows how to use D2fsException ():

public List<Attribute> getCustomDownloadURL(D2fsContext context) throws UnsupportedEncodingException, DfException, D2fsException


Setting Up D2 Service Overrides

  1. Determine the <name of the service> : To determine the <name of the service>, replace the prefix I with D2. For example, IExportService uses the D2 service D2ExportService.
  1. Create a .java file named <name of the service>Plugin.java for the services class to configure the process in the <company name>-<plug-in name>/src/com/<your namespace>/<plug-in name>/webfs/services/<name of the service package>/ folder.
  2. Create and name the class <name of the service>Plugin. For example, the sample uses the service D2ExportService to name its class D2ExportServicePlugin.
  1. Extend the service class with the <name of the service> and implement the ID2fsPlugin interface. For example, the sample declares the class:

public class D2ExportServicePlugin extends D2ExportService implements ID2fsPlugin

The ID2fsPlugin interface forces the implementation of two methods:

  • getFullName: Returns the full plug-in name with its version number. The method is called by the About dialog box in D2.
  • getProductName: Returns the plug-in name to determine whether the plug-in should be executed based on the D2 configuration matrix.
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: