Page 1 of 1

Execute XDQL with DMS_SESSION_ID param

Posted: Thu Sep 23, 2010 10:29 am
by HetBenkt
Hi,

We use oXygen for a documentum WCM project and use the the documentum (CMS) dataSource for access a repository from Oxygen 11.1.
We also use XDQL for executing queries on the documentum repository with the below template.
Inhere we use a parameter that is filled with a documentum session id like this: <xsl:param name="DMS_SESSION_ID" select="'default value'"/>
This parameter is correctly filled when running the XSL from documentum, but not from a local machine in oXygen.
We run it locally with Xalan transformer and 2 extensions: dfc.jar; aspectjrt.jar, but how can we reuse the session that is made from the dataSource and pass it to that DMS_SESSION_ID parameter so the XDQL gives results back in this variable: <xsl:variable name="strLanguageCode" select="xalan:nodeset($strResult)/xdql/object/language_code"/>
?

<!-- Create a general template rule for issuing XDQL queries-->
<xsl:template name="XDQL">
<xsl:param name="dql"/>
<xsl:param name="contentIncluded"/>
<xsl:variable name="xdql" select="java:com.documentum.xml.xdql.DfXmlQuery.new()"/>
<xsl:variable name="init" select="java:init($xdql)"/>
<xsl:variable name="param" select="java:setDql($xdql, $dql)"/>
<xsl:variable name="includeContent" select="java:includeContent($xdql, $contentIncluded)"/>
<xsl:variable name="setContentEncoding" select="java:setContentEncoding($xdql,'dom')"/>
<xsl:variable name="setContentFormat" select="java:setContentFormat($xdql,'xml')"/>
<xsl:variable name="rootNode" select="java:setRootNode($xdql, 'xdql')"/>
<xsl:variable name="execute" select="java:execute($xdql, 'DF_READ_QUERY', $DMS_SESSION_ID)"/>
<xsl:variable name="myResult" select="java:getXMLDOM($xdql)"/>
<xsl:copy-of select="$myResult"/>
</xsl:template>

Please let me know if you need more input.
Best regards,
Antal Bos

Re: Execute XDQL with DMS_SESSION_ID param

Posted: Thu Sep 23, 2010 2:51 pm
by adrian
Hello,

I'm afraid you cannot reuse the DMS_SESSION_ID of the data source created by Oxygen. I don't even see this DMS_SESSION_ID being accessible in our Documentum support implementation. The DFS API, that is used by Oxygen, hides the sessions under another layer and only exposes DFS services.

I'm not sure if this is helpful but in Oxygen if you want to set a specific value to the DMS_SESSION_ID stylesheet parameter you can do so in the "Edit scenario" dialog(Document -> Transformation -> Configure Transformation Scenario, Edit). Press the "Parameters" button and you will see a list of all the stylesheet parameters and their default values. You should also see the DMS_SESSION_ID parameter with its "default value".

Regards,
Adrian

Re: Execute XDQL with DMS_SESSION_ID param

Posted: Thu Sep 23, 2010 4:35 pm
by HetBenkt
Hi Adrian,

With that parameter setting you are correct.
When i output that parameter on my local machine it's indead filled with value 'default value', but when i run it from documentum it's getting filled with a DMCL session ID; that is value 's1'.
Running from oXygen i can also set that parameter to 's1', but then it's not a session ID object, but just as a String object.
I would like to have a more advanced parameter like: '${getDataSourceSession('repository_name')}'
Can this last option not be a solution; i know it will help a lot of people if we can reuse that session for running XDQL locally?

Best regards,
Antal

Re: Execute XDQL with DMS_SESSION_ID param

Posted: Fri Sep 24, 2010 3:37 pm
by adrian
Antal,

A parameter like that is unlikely to be implemented but we'll see what we can do.

Like I said in my previous post, the main problem is that Oxygen does not manage the DMS sessions, these are hidden by the DFS API we are using. And since this API implementation is not open source, we don't have a clear idea of what it's doing behind the scenes.

Regards,
Adrian

Re: Execute XDQL with DMS_SESSION_ID param

Posted: Fri Sep 24, 2010 4:24 pm
by HetBenkt
Hi Adrian,

I also get to the problem that a session is not accessible from extentions.
In XSL we can also create a new session like the sample below, but this gives us this error:
java.lang.IllegalAccessException: Class org.apache.xalan.extensions.ExtensionHandlerJavaPackage can not access a member of class com.documentum.fc.client.DfClient$ClientImpl with modifiers "public" - Class org.apache.xalan.extensions.ExtensionHandlerJavaPackage can not access a member of class com.documentum.fc.client.DfClient$ClientImpl with modifiers "public"


<!-- Create a general template rule for issuing XDQL queries-->
<xsl:template name="XDQL">
<xsl:param name="dql"/>
<xsl:variable name="idfclientx" select="java:com.documentum.com.DfClientX.new()"/>
<xsl:variable name="idfclient" select="java:getLocalClient($idfclientx)"/>
<xsl:variable name="loginInfo" select="java:getLoginInfo($idfclientx)"/>
<xsl:variable name="user" select="java:setUser($loginInfo, 'dmadmin')"/>
<xsl:variable name="password" select="java:setPassword($loginInfo, 's4BTRKgr')"/>
<xsl:variable name="idfsession" select="java:newSession($idfclient, 'wcm01', $loginInfo)"/>
<xsl:variable name="sessionId" select="java:getSessionId($idfsession)"/>
<xsl:variable name="xdql" select="java:com.documentum.xml.xdql.DfXmlQuery.new()"/>
<xsl:variable name="init" select="java:init($xdql)"/>
<xsl:variable name="param" select="java:setDql($xdql, $dql)"/>
<xsl:variable name="includeContent" select="java:includeContent($xdql, false())"/>
<xsl:variable name="setContentEncoding" select="java:setContentEncoding($xdql,'dom')"/>
<xsl:variable name="setContentFormat" select="java:setContentFormat($xdql,'xml')"/>
<xsl:variable name="rootNode" select="java:setRootNode($xdql, 'xdql')"/>
<xsl:variable name="execute" select="java:execute($xdql,
'DF_READ_QUERY', $sessionId)"/>
<xsl:variable name="myResult" select="java:getXMLDOM($xdql)"/>
<xsl:copy-of select="$myResult"/>
</xsl:template>

I think i leave it with the old way of working and test it from documentum.

Thank's for your quick replies,
Antal