Help Required on WDK Preconditions

aromal_b
aromal_b Member
edited August 10, 2013 in Documentum #1

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

Tagged:

Best Answer

  • PanfilovAB
    PanfilovAB Member
    edited August 8, 2013 #2 Answer ✓
    public abstract class PrivilegedCancelCheckoutPreCondition implements IActionPrecondition

Answers

  • PanfilovAB
    PanfilovAB Member
    edited August 8, 2013 #3 Answer ✓
    public abstract class PrivilegedCancelCheckoutPreCondition implements IActionPrecondition
  • aromal_b
    aromal_b Member
    edited August 10, 2013 #4

    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 from

    public 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.

  • PanfilovAB
    PanfilovAB Member
    edited August 10, 2013 #5

    Looks like you have some class named IConfigElement, ArgumentList or Context in the same package as your precondition.