Custom Actions Development
Custom Actions Development
Custom Actions Development
Version 9 Release 0
SC27-6373-00
IBM Datacap
Version 9 Release 0
SC27-6373-00
Note
Before using this information and the product it supports, read the information in “Notices” on page 9.
This edition applies to Version 8 Release 1 of Datacap (product number 5725-C15) and to all subsequent releases
and modifications until otherwise indicated in new editions.
© Copyright IBM Corporation 2014.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.
Contents
ibm.com and related resources. . . . . v RRX XML file structure for custom actions . . . . 5
How to send your comments . . . . . . . . . v rrx attributes . . . . . . . . . . . . . 6
Contacting IBM . . . . . . . . . . . . . vi com attributes . . . . . . . . . . . . 6
method attributes . . . . . . . . . . . . 6
Create custom actions . . . . . . . . 1 p attributes . . . . . . . . . . . . . . 6
Optional formatting tags . . . . . . . . . 6
Prerequisites . . . . . . . . . . . . . . 1
Sample rrx file . . . . . . . . . . . . . 7
Installing the project components . . . . . . . 1
Create an actions library . . . . . . . . . . 2
Creating a project by using the Datacap Custom Notices . . . . . . . . . . . . . . . 9
Action Library template . . . . . . . . . 2 Trademarks . . . . . . . . . . . . . . 11
Object model within the Datacap runtime Privacy policy considerations . . . . . . . . 11
environment . . . . . . . . . . . . . . 3
Deploying the DLL on other Datacap computers . . 5 Index . . . . . . . . . . . . . . . 13
Product support is available on the Web. Click Support from the product Web site
at:
Datacap
http://www.ibm.com/support/entry/portal/Software/
Enterprise_Content_Management/Datacap_Taskmaster_Capture
Knowledge Center
You can view the product documentation on ibm.com. See Knowledge Center at
http://www.ibm.com/support/knowledgecenter/SSZRWV_9.0.0/.
PDF publications
You can view the PDF files online using the Adobe Acrobat Reader for your
operating system. If you do not have the Acrobat Reader installed, you can
download it from the Adobe Web site at http://www.adobe.com.
Tell us how you feel about the value of quality content by taking the Importance of
High Quality Technical Information survey at the following link:
http://www.ibm.com/survey/oid/wsb.dll/s/ag2c1. If you want to help IBM
make this product easier to install and use, take the Consumability Survey at the
following link: http://www.ibm.com/software/data/info/consumability-survey/.
Contacting IBM
To contact IBM customer service in the United States or Canada, call
1-800-IBM-SERV (1-800-426-7378).
To learn about available service options, call one of the following numbers:
v In the United States: 1-888-426-4343
v In Canada: 1-800-465-9600
For more information about how to contact IBM, see the Contact IBM Web site at
http://www.ibm.com/contact/us/.
You can create custom actions for your Datacap applications by using Microsoft
Visual Studio 2010. Action libraries are written in C# .NET, implemented as COM
DLLs. The libraries are made available to your Datacap applications through a
datacap.rrx file that describes the public interface of the library. You add the
actions that you create to your Datacap installation to make them available for use
in your Datacap applications. The custom actions are provided in Datacap Studio.
You can add these actions to rulesets in the same manner as standard actions.
The following users can create custom actions for their Datacap applications:
v Datacap application support staff that does custom implementations
v Reseller application support staff that does custom implementations
v Customer IT staff responsible for Datacap implementations
To create custom actions, you must be experienced with the following disciplines:
v Datacap Studio
v Datacap document hierarchies (DCO)
v Microsoft Visual Studio
v C# programming
v XML
Prerequisites
You must ensure that the required software is installed and running on your
Datacap system before you can create custom actions.
The TM 9.0 NET 2.0 Action Library Template.zip and TM 9.0 NET 4.0 Action
Library Template.zip templates allow you to create new custom action DLLs that
You can download these templates from the Datacap Development Kit page on
IBM® developerWorks® at http://www.ibm.com/developerworks/industry/
library/ind-datacap-taskmaster/.
You use the Datacap Custom Action Library template to create a new project for
your actions. The template creates the action framework which you can expand to
add more custom actions. The framework also contains a sample action with code
that illustrates how to access DCO objects, update the DCO, write to the log, and
so on.
Ensure that you installed the action template by copying TM 9.0 NET 4.0 Action
Library Template.zip, TM 9.0 NET 2.0 Action Library Template.zip, etc. to
C:\Users\<userid>\My Documents\Visual Studio 2010\Templates\
ProjectTemplates\Visual C#. For instructions, see “Installing the project
components” on page 1.
For instructions on deploying your custom actions, see “Deploying the DLL on
other Datacap computers” on page 5.
If you need a library that is compatible with .NET 2, use the .NET 2 template
instead of .NET 4.
The following diagram shows the Datacap objects that are populated by
Rulerunner and accessible from any actions in the COM DLL.
Your COM DLL must declare an interface for each of the five objects that are
shown and must implement a set property for each. The code to declare an
interface is included in the Datacap Custom Action Library template in the source
file RRSExpected.cs.
DclogXLib.IDCLog PILOTCTRLLib.IBPilotCtrl
Enabled True BatchDir C:\Datacap\...
Filename C:\Datacap\... Filename C:\Datacap\...
Write() Write() Vscan
etc. etc.
Log object Pilot Properties object
1 2 3 4 5
COM DLL
1 Rulerunner populates the initial runtime DCO. Actions are responsible for
updating the DCO XML as necessary. In vScanSample, the myact_scan()
action adds page information to the runtime DCO for each image in the
application images folder. When the ruleset completes, Rulerunner writes
the DCO object to the batches folder in the profile.xml file.
Runtime DCO XML before Scan():
<?xml-stylesheet type="text/xsl" href="..\..\dco.xsl"?>
<B id="20100029.004">
<V n="TYPE">MyApp</V>
<V n="victim">yes</V>
</B>
Runtime DCO XML after Scan():
<?xml-stylesheet type="text/xsl" href="..\..\dco.xsl"?>
<B id="20100029.004">
<V n="TYPE">MyApp</V>
<V n="victim">yes</V>
<P id="P1"
<V n="TYPE">Other</V>
<V n="IMAGEFILE">tm000001.tif</V>
</P>
</B>
2 Rulerunner writes information to the profilerrs.log file in the batches
The .NET action template provides access to the dcSmart object. One of the
methods available in this class is MetaWord. MetaWord takes a string as a
parameter and returns a string. MetaWord allows your custom actions to accept
smart parameters. Passing a parameter string to MetaWord resolves any smart
parameters in your input string. It also returns the result that can be processed by
your C# code. If the input parameter does not contain any smart parameters, it
returns the original input string.
Important: Custom actions cannot decrypt built-in Datacap secure values from the
.app file, like database connection strings, passwords, or Advanced Values. For
example, MetaWord, when called on @APPVAR(*/lookupdb:cs) returns the secured
string [secured]011da7544c0b852139730dd582683b8c82a80466dfcd817[/secured].
Custom actions cannot decrypt the secured string.
The <ap> tag is not typically used because you can insert the help text into the
parameter definition by using the qi attribute. However, <ap> tags are still needed
if there are no parameters so you can explicitly state that there are no parameters.
For an example, see the convert.rrx file, in c:\datacap\rrs.
rrx attributes
The rrx attributes in the RRX XML file structure for COM actions are namespace
and version.
namespace
The namespace that is displayed in the Datacap Studio Actions Library pane
(required)
v Version number (optional)
com attributes
The com attributes in the RRX XML file structure for COM actions are ref and qi.
ref
<namespace>.<class_name> as specified in the actions library (required)
qi Description that is displayed in the Datacap Studio Action Library information
window (optional)
method attributes
The method attributes in the RRX XML file structure for COM actions are name and
qi.
name
Method (action) name (required)
qi Description that is displayed in the Datacap Studio Action Library information
window (optional)
p attributes
The p attributes in the RRX XML file structure for COM actions are name, type, and
qi.
name
Parameter name (required)
type
Parameter type (required)
You can use the following formatting tags in any of the field in the help text:
<b></b>
is output as
Hello Fred .
The following sample defines the myactions namespace that includes the methods;
myact_set_folder and myact_scan.
v myact_set_folder Contains the parameter folderpath of type string.
v myact_scan Contains no parameters but includes more help text options.
<?xml version=’1.0’ ?>
<rrx namespace="myactions" v="7.5.1">
<com ref="MyAction.CDCMyAction" qi="Sample actions">
<method name="myact_set_folder" qi="Specifies the folder to search">
<p name="folderpath" type="string" qi="path to folder"/>
</method>
<method name="myact_scan" qi="Poll the specified folder for image files">
<lvl>Batch level Open event only.</lvl>
<ret>False if failed; otherwise True.</ret>
<h>Details go here<br/>
<e>Example script goes here<br/></e>
</h>
</method>
</com>
</rrx>
The resulting Datacap Studio help text for each action is:
Example
Level
Returns
Requirement: All action methods must return a Boolean so the bool return value
is not specified in the RRX but is displayed by default.
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the user's responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not grant you
any license to these patents. You can send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply
to you.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
IBM Corporation
J46A/G4
555 Bailey Avenue
San Jose, CA 95141-1003
U.S.A.
The licensed program described in this document and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement or any equivalent agreement
between us.
This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
All statements regarding IBM's future direction or intent are subject to change or
withdrawal without notice, and represent goals and objectives only.
This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
Trademarks
The following terms are trademarks of the International Business Machines
Corporation in the United States, other countries, or both: http://www.ibm.com/
legal/copytrade.shtml
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
Java and all Java-based trademarks and logos are trademarks or registered
trademarks of Oracle and/or its affiliates.
Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered
trademarks or trademarks of Adobe Systems Incorporated in the United States,
and/or other countries.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other product and service names might be trademarks of IBM or other companies.
The Software Offering uses session and persistent cookies that collect each user's
user name, for purposes of session management, enhanced user usability, single
sign-on configuration. Session cookies cannot be disabled. Persistent cookies can be
disabled, but disabling them will also eliminate the functionality they enable.
If the configurations deployed for this Software Offering provide you as customer
the ability to collect personally identifiable information from end users via cookies
and other technologies, you should seek your own legal advice about any laws
applicable to such data collection, including any requirements for notice and
consent.
For more information about the use of various technologies, including cookies, for
these purposes, See IBM’s Privacy Policy at http://www.ibm.com/privacy and
IBM’s Online Privacy Statement at http://www.ibm.com/privacy/details the
Notices 11
section entitled “Cookies, Web Beacons and Other Technologies” and the “IBM
Software Products and Software-as-a-Service Privacy Statement” at
http://www.ibm.com/software/info/product-privacy.
C O
optional formatting tags
com attributes description 6
description 6 RRX XML file structure for COM
RRX XML file structure for COM actions 6
actions 6
custom action libraries
creating 2
RRX XML file structure for COM P
actions p attributes
com attributes 6 description 6, 7
method attributes 6 RRX XML file structure for COM
optional formatting tags 6 actions 6, 7
p attributes 6, 7 prerequisites
rrx attributes 6 custom actions 1
RRX XML file structure for custom installing for custom actions 1
actions project components
syntax 5 installing for custom actions 1
custom actions projects
actions libraries 2 creating 2
creating 1 starting 2
creating actions libraries 2
creating projects 2
Datacap object model 3 R
installing prerequisites 1 rrx attributes
installing project components 1 description 6
prerequisites 1 RRX XML file structure for COM
project components 1 actions 6
RRX XML file structure for COM RRX XML file structure for COM actions
actions com attributes 6
com attributes 6 method attributes 6
method attributes 6 optional formatting tags 6
optional formatting tags 6 p attributes 6, 7
p attributes 6, 7 rrx attributes 6
rrx attributes 6
RRX XML file structure for custom
actions
syntax 5
SC27-6373-00