[opencms-dev] Question: Best way to integrate OpenCms with otherapplications

Joe Desbonnet joe at galway.net
Thu Feb 15 14:19:42 CET 2007


I've appended one of my JSPs below. What I do is extract the
parameters I require and formulate the HTTP request that needs to be
forwarded to my other application. For convenience I've created a tiny
library which encapsulates the HTTP Client code.

This works well for read only data provided the other application
server is on the same host (or connected by a very fast LAN). I would
worry if there is a chance that the HTTP request could stall due to
packet loss etc.

I still haven't tried a read/write case (eg shopping cart). I guess
session state info needs to be relayed there.

One thing to remember: if you are using the Flex Cache, you must set
the cache directives
to recognize any parameters you use in your JSP. Eg in the case below
I have
"uri;element;params=(locality,classification);timeout=60"
set as the "cache" property on the JSP script.


<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%
String localityCode = request.getParameter("locality");
String classCode = request.getParameter("classification");
String params = "?locality=" + localityCode;
if (classCode != null && classCode.length() > 0) {
	params += "&classification=" + classCode;
}
%>
<cms:include property="template" element="head">
<cms:param name="pageTitle">Directory of <%=localityCode%></cms:param>
</cms:include>
<%
ie.wombat.opencms.util.include.IncludeUtil.includeHttpGet("http://localhost/GalwayNet/jsp/yp/include/locality-list.jsp"
+ params,out);
%>
<cms:include property="template" element="foot" />


On 2/15/07, Eli Irl <igmdublin at hotmail.com> wrote:
> Hi,
> Thank you for your answer, like for example your at Business Directory if
> you want to request by category, do you have another application in tomcat
> which is responsable to get the information from legacy databases?
>
> In my case with the shopping cart I have now servlets to search and show the
> products of my production databases and would like to place it in a page
> generated for OpenCMS but the rest of the information: banners for
> publicity, offers, images would be stored and managed in OpenCms VFS.
>
> I spent few months evaluating CMS to be able to do it and the most flexible
> and clear I found it was OpenCms but because I am not experienced developer
> I have some doubts if I could do it or not.
>
> Regards,
> Eli
>
>
> >From: "Joe Desbonnet" <joe at galway.net>
> >Reply-To: The OpenCms mailing list <opencms-dev at opencms.org>
> >To: "The OpenCms mailing list" <opencms-dev at opencms.org>
> >Subject: Re: [opencms-dev] Question: Best way to integrate OpenCms with
> >otherapplications
> >Date: Thu, 15 Feb 2007 11:42:41 +0000
> >
> >I've got an OpenCms based site that includes many pages featuring data
> >from a legacy database. My approach is to create a separate webapp in
> >my servlet container (Tomcat) which responds to HTTP GET requests from
> >OpenCms and returns HTML suitable for inclusion in the OpenCms
> >template.
> >
> >I use Apache HTTP Client library to issue GET requests from my OpenCms
> >template JSPs and include the response in my OpenCms pages.  I find
> >this works well for me. It allows me to make changes to the format of
> >the included HTML without having to touch OpenCms.
> >
> >I'm not sure how well that will work for read/write scenarios, eg
> >shopping carts.
> >
> >See http://www.galway.net/ for that in action (most of the business
> >directory listings are generated that way)
> >
> >Joe.
> >
> >
> >On 2/15/07, Eli Irl <igmdublin at hotmail.com> wrote:
> >>
> >>Dear Sirs/Madams
> >>
> >>I am new developing with OpenCms. For the Management Content point of view
> >>I
> >>believe is great but to decide if I can use I need to know if I can
> >>integrate it with other applications: for example if I want that some
> >>group
> >>of users can have access to private content managed for OpenCms plus a
> >>shopping cart application, would be possible? In that case what is the
> >>best
> >>practices or way to do it?
> >>
> >>I post this question in OpenCms forum but I did not get any answer.
> >>
> >>Thank you very much.
> >>
> >>Kind regards,
> >>Eli
> >>
> >>_________________________________________________________________
> >>Charla con tus amigos en línea mediante MSN Messenger:
> >>http://messenger.latam.msn.com/
> >>
> >>
> >>_______________________________________________
> >>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
>
> _________________________________________________________________
> Acepta el reto MSN Premium: Protección para tus hijos en internet.
> Descárgalo y pruébalo 2 meses gratis.
> http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil
>
>
> _______________________________________________
> 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