[opencms-dev] Including opencms content in an external webapplication

Jack Bakker jbakker at iable.ca
Fri Feb 17 01:32:38 CET 2006


Hello Petros,

For SSO:

In Tomcat, we've put Struts apps in contexts alongside an OpenCms 
context within a <Host... block, used a Single Sign On (SSO) valve, and 
in a Struts action (CmsAction) use HttpURLConnection while passing in 
the JSESSIONIDSSO cookie to get SSO across 'external' struts apps and 
OpenCms.

Good luck

Jack

On 16/02/2006 5:38 PM, Jason Trump wrote:
> Hi Petros,
> 
> We've done something like this to display OpenCms content in a WebLogic Portal application.  I'd recommend just deploying the opencms WAR on the same application server, and then using simple servlet RequestDispatcher includes to load and display the content.  This strategy is much easier than trying to make API calls to load the content, because OpenCms itself makes heavy use of the servlet/JSP container to render the content.  Loading the documents from the database is unlikely to give you something very useful.
> 
> Something like this in your servlet code:
> 
> 
> public void loadCmsContent(ServletContext myContext, HttpServletRequest request, HttpServletResponse response, String cmsPath)
> {
>      ServletContext opencmsContext = myContext.getContext("/opencms");
>      RequestDispatcher dispatcher = opencmsContext.getRequestDispatcher("/opencms" + cmsPath);
>      dispatcher.include(request, response);
> }
> 
> 
> I found that I also had to create a special subclass of HttpServletRequestWrapper to pass to RequestDispatcher.include to make this work correctly, as well as a subclass of HttpServletResponseWrapper to capture the results (as I did not want to immediately include the cms document in the current response).  You can send me an email directly if you want to discuss this approach in more detail.
> 
> Hope that helps,
> jason
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org on behalf of Petros Giakouvakis
> Sent: Fri 2/17/2006 1:20 AM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] Including opencms content in an external webapplication
>  
> Hi,
> 
> I am trying to include content written in opencms to be included in an 
> external web application. Can anybody tell which jars are needed for 
> this and how this is done exactly?
> 
> I have searched through the archive, but haven't really found an answer 
> to this.
> Kind regards,
> Petros
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev

-- 

/






More information about the opencms-dev mailing list