<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.EmailStyle19 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=blue link=blue>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2>Marcello -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2>You can use OpenCms to host JSPs (either as JSP content, or
as content based on a JSP template), and they'll therefore have access not only
to any OpenCms-specific functionality and content but also to any functionality
you create yourself. You can include real Java (in <%
%> delimiters) and invoke third party taglibs or your own Java
classes.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2>Architecturally, the best approach would be to keep JDBC
stuff out of JSPs and slap it in your own Java classes, writing them to present
a useful interface to your JSPs. I imagine some people have even
integrated OpenCms with an object persistence framework like Hibernate, but
you need not be so sophisticated.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2>Your own Java classes can be made available in a variety of
ways. Clearly they've got to be in a classpath accessible to the JSPs in
which you import them. If you're intending to bundle up your
development into an OpenCms module, then this means putting them in the
template's 'lib' folder (as a Jar) or 'class' folder (as bare classes); or
you can put them in the OpenCms-wide classpath, <opencms
home>/WEB-INF/classes. This last approach is quite a good one for
quickly developing stuff, because it means you don't have to bundle things up as
a module intil you've finished development; the downside of all this is that you
may have to restart OpenCms to pick up new versions of any of your classes which
it has already loaded.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2>As for database access via JDBC, I'm not sure of the best
strategy. OpenCms maintains a pool of connections, and you should probably
make use of this - i.e. you should probably use OpenCms code to get access to a
JDBC Connection. I haven't yet thought about this, but maybe someone else
on the list can give some good advice. As for where the data should sit,
my current feeling (without much thought behind it) is that you should use the
same database instance (named 'opencms' by default) to host your own tables etc,
because that probably makes things like backup easier - but don't forget that
they won't be accessible to OpenCms admin functionality.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=432051820-15022006><FONT face=Arial
color=#0000ff size=2>Jon</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>Villani
Marcello<BR><B>Sent:</B> 15 February 2006 13:44<BR><B>To:</B> The OpenCms
mailing list<BR><B>Subject:</B> [opencms-dev] create my own
view<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Hi
All,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">As I have an existing
(and complex), database schema, I can’t use the opencms database to store my
contents. So I was thinking to use opencms in conjunction with jdbc to manage
it.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The problem I have now
is that I don’t know how to build my own view to handle my
contents!<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">To be clearer: I’d like
to have a view that I can personalize as much as I want. Is it possible? How can
I build it?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Regards,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Marcello<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> <o:p></o:p></SPAN></FONT></P></DIV></BODY></HTML>