Session in Precondition??

Options
Kasbe_Prashant
edited May 11, 2012 in Documentum #1

Hello Experts,

I need to check file extension of documents in the precondition class depending on which I would be enabling particular menuitem.

Is this possible in precondition class without acquiring the session.

As I read in WDK development guide that :

"Avoid calling IDfSession.getObject() or performing queries inside queryExecute(). These

calls can seriously degrade performance. Most attribute arguments can be retrieved, as

they are cached by the initial query on the page rather than from a getObject() call. For

example, if the page has a databound control to r_lock_owner, that attribute value is cached.

Your component can check for the existence of the argument value and query only if the

argument was not passed. You can also write trace statements that signal when precondition

arguments are not passed. This will allow you to determine which custom components

are not passing the appropriate arguments."

Is it possible to get the objectName thru params inside the precondition class so that I can perform the preconditions basics.

Regards

Prashant

Comments

  • kcrkarthik
    edited May 11, 2012 #2
    Options

    "without acquiring the session" -> what does that mean? there is already a session with you when logged into the wdk app. Instead of checking the file extension, check the a_content_type which is a sysobject's standard attribute.

    The pre-condition's queryExecute function has ArgumentList as parameter. try fetching the object_name from the argument list. like: arg.get("object_name");

    -karthik

  • Kasbe_Prashant
    edited May 11, 2012 #3
    Options

    I'm unable to get object_name in arguments, however I'm able to get content type by specifying the conf as below

    <param name="contentType" required="false"></param>

    and in precondition java file from the arguments I get the content type.

    But for everyone's benefit if someone can specify which all attributes can be sent from .xml file to precondition java file then it would be great.

    Regards

    Prashant

  • lastnitescurry
    edited May 11, 2012 #4
    Options
    I'm unable to get object_name in arguments, however I'm able to get content type by specifying the conf as below<param name="contentType" required="false"></param>and in precondition java file from the arguments I get the content type.But for everyone's benefit if someone can specify which all attributes can be sent from .xml file to precondition java file then it would be great.

    it is of more benfit for all to learn how to get this information themselves.... i.e. teach a man to fish......

    In that case, look for the code that populates the arguments, which in Webtop 6.7 Cabinets view, can be found in the JSP file "/webcomponent/navigation/doclist/doclist_body.jsp"

          <!-- multiselect action checkbox - add arguments for all actions here -->
          <dmfx:actionmultiselectcheckbox name='check' value='false' cssclass='actions'>
            <dmf:argument name='objectId' datafield='r_object_id'/>
            <dmf:argument name='type' datafield='r_object_type'/>
            <dmf:argument name='lockOwner' datafield='r_lock_owner'/>
            <dmfx:argument name='folderId' contextvalue='objectId'/>
            <dmfx:argument name='folderPath' contextvalue='folderPath'/>
            <dmf:argument name='ownerName' datafield='owner_name'/>
            <dmf:argument name='contentSize' datafield='r_full_content_size'/>
            <dmf:argument name='contentType' datafield='a_content_type'/>
            <dmf:argument name="isVirtualDoc" datafield='r_is_virtual_doc'/>
            <dmf:argument name="linkCount" datafield='r_link_cnt'/>
            <dmf:argument name='startworkflowId' value='startworkflow'/>
            <dmf:argument name='workflowRuntimeState' value='-1'/>
            <dmf:argument name='isReference' datafield='i_is_reference'/>
            <dmf:argument name='isReplica' datafield='i_is_replica'/>
            <dmf:argument name='assembledFromId' datafield='r_assembled_from_id'/>
            <dmf:argument name='isFrozenAssembly' datafield='r_has_frzn_assembly'/>
            <dmf:argument name='compoundArchitecture' datafield='a_compound_architecture'/>
            <dmf:argument name='roomId' datafield='room_status'/>
            <dmf:argument name='topicStatus' datafield='topic_status'/>
            <dmf:argument name='attach' datafield='attachment'/>
            <dmf:argument name='eventType' datafield='event_type'/>
            <dmf:argument name='events' datafield='events'/>
            <dmf:argument name='notificationStatus' datafield='notification_status'/>
          </dmfx:actionmultiselectcheckbox>
       </dmf:datagridRowTd>

    of course you could get caught up if the other views e.g. My Files, Subscriptions, ... , did not present these argument