Help Required on WDK Preconditions
Hello Experts,
I am new to WDK. I managed to create a custom menu item with the help of WDK Tutorial.
Now I trying to make a menu Item visible only when the selected document is checked out. I am trying to do this preconditions.
However, I am getting Error below error from the prevalidation class when logging into webtop. I am unable to fix it. Can someone please help?
Error
Action Service - unable to instantiate qualifier class: com.ford.custom.PrivilegedCancelCheckoutPreCondition
class java.lang.InstantiationException
==========================================================================
My Action XML
=====================
<config version = "1.0">
<scope type="dm_sysobject">
<action id = "privileged_cancel_checkout_action">
<params>
<param name="objectId" required="true"/>
<param name="lockOwner" required="true"/>
</params>
<preconditions>
<precondition class="com.ford.custom.PrivilegedCancelCheckoutPreCondition">
</precondition>
</preconditions>
<execution class="com.documentum.web.formext.action.LaunchComponent">
<component>privileged_cancel_checkout_component</component>
<container>dialogcontainer</container>
</execution>
</action>
</scope>
</config>
===================================================================
My PreCondition Class:
public abstract class PrivilegedCancelCheckoutPreCondition implements IActionPrecondition
{
final private static String m_strRequiredParams[] = new String[] {"objectId", "lockOwner"};
String[] getRequiredParams()
{
System.out.println("************ INto the getRequiredParams...");
return m_strRequiredParams;
}
public boolean queryExecute(String strAction, IConfigElement config, ArgumentList arg, Context context, Component component)
{
boolean execute = false;
try
{
//get object ID
String objId = arg.get("objectId");
String strLockOwner = arg.get("lockOwner");
if ( strLockOwner == null || strLockOwner.length() == 0 )
{
execute = true;
}
}
catch(Exception de)
{
execute = false;
}
return execute;
}
}
==========================================================================
Best Regards,
A
Best Answer
-
public abstract class PrivilegedCancelCheckoutPreCondition implements IActionPrecondition
0
Answers
-
public abstract class PrivilegedCancelCheckoutPreCondition implements IActionPrecondition
0 -
Thanks a lot!!.
For some reason Eclipse was throwing error on removing the abstract keyword.
As per your suggestion I removed the abstract keyword and changed the queryExecute parameter frompublic boolean queryExecute(String strAction, IConfigElement config, ArgumentList arg, Context context, Component component)
to
public boolean queryExecute(String strAction, com.documentum.web.formext.config.IConfigElement config, com.documentum.web.common.ArgumentList arg, com.documentum.web.formext.config.Context context, Component component)
ie. with the package details and it worked fine.
Thanks again.
0 -
Looks like you have some class named IConfigElement, ArgumentList or Context in the same package as your precondition.
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 152 General Questions
- 148 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 9 XM Fax
- Follow Categories