Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Opening Documents using JAVA LAPI
Geoff_Price
Does anyone know how to open a document in its native application using LAPI and JAVA? I've written an interface in JSP, and I can generate a link using the FetchVersion api to allow the user to download the document to their local PC, but I would also like to generate a link to allow them to click it and have it automatically open the document instead of them having to save it locally, then navigate to it and double-clicking it to open it.Any help would be appreciated.Thanks,Geoff
Find more posts tagged with
Comments
Ryan_McDonald_(rmcdonal@opentext.com_(Delete)_1406
Message from Ryan McDonald <
rmcdonal@opentext.com
> via eLink
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">eLink
Something like this should do it:
response.setHeader("Content-Disposition","inline; filename=" + fileName + ";");
Ryan McDonald
From:
eLink Discussion: LAPI Discussion [mailto:lapi@elinkkc.opentext.com]
Sent:
Monday, January 17, 2005 2:32 PM
To:
eLink Recipient
Subject:
Opening Documents using JAVA LAPI
Opening Documents using JAVA LAPI
Posted by
JTASCN01
(Price, Geoff) on 01/17/2005 02:28 PM
Does anyone know how to open a document in its native application using LAPI and JAVA? I've written an interface in JSP, and I can generate a link using the FetchVersion api to allow the user to download the document to their local PC, but I would also like to generate a link to allow them to click it and have it automatically open the document instead of them having to save it locally, then navigate to it and double-clicking it to open it.
Any help would be appreciated.
Thanks,
Geoff
Geoff_Price
Ryan,Thank you for the tip. I guess I really should have researched the Content-Disposition a little better. Great solution. I ended up just passing in a Content-Type mime that would (hopefully) force the browsers to ask the user if they want to open or save the document. I used:response.setContentType("application/octet-stream");response.setHeader("Content-Disposition", "attachment; filename=doc_name");I was originally determining the actual mime-type of the document, but IE tries to determine for you what to open it with. I also am calling the function from an IFRAME and I don't want the document to be displayed in the IFRAME itself, which is what IE does.Thanks again for your help!
Kevin_Jones_(exeinc01admin_-_(deleted))
Can you tell me how you made the connection to Livelink Server from web application if only know the user name? Is it through cookie? Then how to retrieve the cookie? Thanks!
Geoff_Price
Kevin, can you give me some more information? Not sure what exactly you are looking for here. I am determining the user that is connecting through my application, then creating the llsession based on that user.We have SiteMinder protecting our webservers, so I have a mapping table in our database that retrieves the user's login information once they are authenticated via SiteMinder. Once I have their username and password, I create the llsession based on that user.Hope this helps. If not, provide me more info and maybe I can help.Geoff
Adam_Myatt
I could use some advice regarding making LAPI calls to a Livelink instance that is SSO-enabled behind Siteminder.I have a J2EE web application that is also SSO-enabled. I would like to drop the lapi.jar Java file into the Web-inf/lib directory and then be able to have my Java code make calls using Java LAPI to the Livelink instance. The sso user id is an available header parameter I can retrieve in the app from the SSO policy, but NOT the password. I can also retrieve the standard SSO Siteminder params like SMSESSION, SMAUTHREASON SMTRY, etc. I have difficulty connecting my Java web app using LAPI to the Livelink instance. I saw the Session constructor that takes a cookie instead of username and password. Can someone provide details on exactly what that cookie parameter in the Session constructor is, possible data format and values the cookie field expects, and if I can use the Siteminder parameters like SMESSION to login to Livelink via LAPI.Thanks.Connecting to LiveLink 9.5 SP1 using Java 1.4 and current lapi.jar file.
Adam_Myatt
I noticed when I ran the LAPI TestConnect utility without specifying arguments it listed usage of SSO authentication and the parameters : /ssocookiename /ssocokkievalue /ssocookiedomain /usewininetCan this be used to actually test a connection to a Livelink instance that is Siteminder SSO protected/enabled?
Adam_Myatt
This is interesting. I got the SSL classes I needed through a trial of the Secure Connect tool. I am finally able to use HTTPS connection in Java LAPI code since that is how our LL instance is configured. I successfully used the TestConnect utility to talk to LL through a Siteminder SSO: testconnect /https /server:llhost.ourcompany.com /certspath:c:\opentext\lapi\certs /cgipath:/livelink/livelink.exe /verifyserver:true /usewininet /ssocookiedomain:.ourcompany.com /ssocookiename:SMSESSION /ssocookievalue:jXMbL/gsS5bOPedc5LV...to connect HTTPS using port 443 to a LL instance that is Siteminder SSO protected. The value of the ssocookie "jXMbL/gsS5bOPedc5LV" was retrieved by going to the LLhost?func=admin.testargs. However I cannot make the Java LAPI code work for the life of me. Have the following : LLValue config = new LLValue();config.setAssoc(); LLValue rootCACertsList =new LLValue();LLSession.GetCARootCerts("c:\\opentext\\lapi\\certs",rootCACertsList); config.add( "HTTPS", LLValue.LL_TRUE );config.add( "VerifyServer", LLValue.LL_TRUE );config.add("CARootCerts",rootCACertsList); config.add( "LivelinkCGI", "/livelink/livelink.exe" );config.add("DomainName",".mycompany.com");String sSmSessionVal = "jXMbL/gsS5bOPedc5LV"; session = new LLSession("llhost.mycompany.com",443,sSmSessionVal,config);// also tried the following, but no lucksession = new LLSession("llhost.mycompany.com",443,"SMSESSION=" + sSmSessionVal,config);How can I make the Java LAPI code work the same as the TestConnect utility????? Anyone?
eLink User
Message from Nair, Krishnankutty N. via eLinkHave you tried something likeconfig.add( "EnableNTLM", LLValue.LL_TRUE ); -----Original Message-----From: eLink Discussion: LAPI Discussion[mailto:lapi@elinkkc.opentext.com] Sent: Thursday, April 27, 2006 2:01 PMTo: eLink RecipientSubject: RE - TestConnect utility and SSORE - TestConnect utility and SSOPosted by Myatt, Adam on 04/27/2006 02:58 PMThis is interesting. I got the SSL classes I needed through a trial ofthe Secure Connect tool. I am finally able to use HTTPS connection inJava LAPI code since that is how our LL instance is configured. Isuccessfully used the TestConnect utility to talk to LL through aSiteminder SSO: testconnect /https /server:llhost.ourcompany.com /certspath:c:\opentext\lapi\certs /cgipath:/livelink/livelink.exe/verifyserver:true /usewininet /ssocookiedomain:.ourcompany.com /ssocookiename:SMSESSION/ssocookievalue:jXMbL/gsS5bOPedc5LV...to connect HTTPS using port 443 to a LL instance that is SiteminderSSO protected. The value of the ssocookie "jXMbL/gsS5bOPedc5LV" was retrieved by going to theLLhost?func=admin.testargs. However I cannot make the Java LAPI code work for the life of me. Havethe following : LLValue config = new LLValue();config.setAssoc(); LLValue rootCACertsList =new LLValue();LLSession.GetCARootCerts("c:\\opentext\\lapi\\certs",rootCACertsList); config.add( "HTTPS", LLValue.LL_TRUE );config.add( "VerifyServer", LLValue.LL_TRUE );config.add("CARootCerts",rootCACertsList); config.add( "LivelinkCGI", "/livelink/livelink.exe" );config.add("DomainName",".mycompany.com");String sSmSessionVal = "jXMbL/gsS5bOPedc5LV"; session = newLLSession("llhost.mycompany.com",443,sSmSessionVal,config);// also tried the following, but no lucksession = new LLSession("llhost.mycompany.com",443,"SMSESSION=" +sSmSessionVal,config);How can I make the Java LAPI code work the same as the TestConnectutility????? Anyone?[To reply to this thread, use your normal E-mail reply function.]============================================================Topic: Opening Documents using JAVA LAPI
https://knowledge.opentext.com/knowledge/livelink.exe/open/3813583Discussion
: LAPI Discussion
https://knowledge.opentext.com/knowledge/livelink.exe/open/765428Livelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exeTo
Unsubscribe from this Discussion, send an e-mail tounsubscribe.lapi@elinkkc.opentext.com.
Adam_Myatt
Yes I tried that. Found it had no effect since the LL instance uses Siteminder SSO.Just wondering why my setup worked with TestConnect utility and not with the Java LAPI code.
Adam_Myatt
Finally got it to work. The confusion lies in the terminology around the Livelink Cookie that can be passed to the LLSession constructor. This is only a Livelink cookie, and has nothing to do with a browser session ID or the Siteminder cookie.If the HTTP header protocol that LAPI uses they do not pass an HTTP header named "cookie: " which is required for Siteminder to correctly know that you have already performed an SSO authentication.Scenario. You have a Java-based web app running in a J2EE server (say Tomcat or Weblogic). You request a page in a browser, the Siteminder "watching" the site intercepts the requests, sees you have not authenticated, and displays the SSO login page. You log in and authenticate, and Siteminder redirects you back to your web app. In that web app to auth to Livelink via HTTP/HTTPS where your Livelink instances is also "watched" by Siteminder you need to do the following. RRetrieve the Siteminder Session cookie (typically called SMSESSION) from the cookies using JSP like : String SMSESSION = "";Cookie[] cookies = request.getCookies();for(int i=0; i<cookies.length; i++){ String strCookieName = cookies[i].getName(); if("SMSESSION".equals(strCookieName.toUpperCase())) { SMSESSION = cookies[i].getValue(); }}Then pass that value to LAPI, but here's the PROBLEM . There is no way to do so with LAPI as is. You need to modify the Source of LLConnect.sendInitialHeader() method to append the text "Cookie: SMSESSION=VALUE" where `value? should be a parameter you pass in that is the actual value of the SMSESSION cookie retrieved through your web application and passed down through LAPI (modifyLLSession.getConfigValues to accept an additional value inside the LLValue object that is passed in. Then add an IF clause to retrieve that value and set an internal class member to that value. Append that class member to the "Cookie: SMSESSION=" text above in place of the VALUE marker. This is the ONLY way I have been able to get LAPI to work via HTTP/HTTPS where Livelink is behind Siteminder.