Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Workflow external tasks and CSSDK
Bowker
TS 6.5
win2003
Using a Perl external app and spawning OS commands to perform operations is quite easy, the external commands (from what I can tell) run as SYSTEM.
I'm now trying to convert those tasks into Java apps and utilize CSSDK to perform specific operations. Unfortunately in order to do anything useful in CSSDK you need to create a CSClient which requires a username, password and role.
Any ideas how I can utilize CSSDK from an externaltask without a Username/Password/Role?
Dan Bowker
Northern Trust
Web Publishing Technology
Find more posts tagged with
Comments
Migrateduser
Hi Dan,
Unfortunately this feature is not present in the current CSSDK SOAP client. However, if you are running the CS application on the same box as the TeamSite, you could potentially use the CSSDK's CSLocalFactory instead of the CSSOAPFactory. In this local mode, there is a method called CSLocalFactory.getClientForTrustedUser call that you can use in order to get a CSClient without giving a password (I assume that is your main goal). For this method to work, the Java application needs to be run as a user that has read permissions on the <iw-home>/private/etc/passphrase file, and has to have write permissions on the "temp" location (on Windows, it is the TEMP env variable, and on Unix, it is /tmp).
Please note that this method is not available in versions earlier than TS6.5.
If you do not want to use the local factory, you could achieve the same purpose by running an automated CS application every 24 hours to get a session string for a user you want to run your main CS application as, and store it in a commonly accessible location, and use the session string to get CSClient. I'll give more details that might make it more clear why this is required. A CSClient object is essentially an encapsulation of the session string for a particular user (among other things). The default expiration time for the session string is 24 hours, and can be changed in iw.cfg. Once you obtain a session string for a user, it can be used to obtain CSClient objects any number of times during the 24 hour period without a problem, as long as you do not call CSClient.endSession().
The rationale behind allowing only CSLocalFactory to be able to do logins without password, is similar to the way perl scripts were allowed to use CLTs to do TS jobs.
Hope this helps.
Best Regards,
Narendra
Bowker
Do you have any documentation on "getClientForTrustedUser"? It's not in my javadoc.
Dan Bowker
Northern Trust
Web Publishing Technology
Migrateduser
There is javadoc for the method in CSFactory, but it doesn't give much more details than what I have already mentioned to you. There are some small notes about this method in the release notes for CSSDK 2.5. Also, please note that this method is available only through CSLocalFactory, and in CSSDK 2.5 only.
Best Regards,
Narendra
Bowker
How do I get a "session string" after I create a CSClient object?
Dan Bowker
Northern Trust
Web Publishing Technology
Migrateduser
You need to call "client.getContext().getSessionString()".
Best Regards,
Narendra
dazzlad
Whereabouts in the javadoc is this method?
The info in the release notes doesn't explain the arguments for this method.
Thanks.
Darren.
Darren.
Migrateduser
CSClient.getContext() returns a CSContext object; The javadocs of CSContext class detail the getSessionString method.
Best Regards,
Narendra
dazzlad
Hi.
Thanks, but I was asking about the getClientForTrustedUser methods parameters.
Sorry, I should have been more clear.
Darren.
Migrateduser
Oh sorry! The getClientForTrustedUser is in the CSFactory class. Only the CSLocalFactory subclass supports this particular method.
Hope that helps.
Best Regards,
Narendra
dazzlad
Yes,
I understand this, but where are the parameters of this method documented?
Thanks.
Darren.
Bill Klish
Log into the support site and download the CS SDK software. The javadocs are included in the cssdk_doc.jar file
dazzlad
Yes I know mate.
The getClientForTrustedUser is not documented.
Darren.
Bill Klish
Yes it is in the cssdk_doc.jar file, I just opened it up.
Expand that and take a look at the CSFactory or CSLocalFactory definitions. The method is defined right there. This method was introduced in CS SDK 2.5 SP1, so make sure you get the correct version.