<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE>@font-face {
font-family: Wingdings;
}
@font-face {
font-family: Tahoma;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 3.0cm 70.85pt 3.0cm; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
H1 {
FONT-WEIGHT: bold; FONT-SIZE: 16pt; MARGIN: 12pt 0cm 3pt; FONT-FAMILY: Arial
}
H2 {
FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN: 12pt 0cm 3pt; FONT-STYLE: italic; FONT-FAMILY: Arial
}
H3 {
FONT-WEIGHT: bold; FONT-SIZE: 13pt; MARGIN: 12pt 0cm 3pt; FONT-FAMILY: Arial
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman"
}
SPAN.emailstyle17 {
COLOR: windowtext; FONT-FAMILY: Arial
}
SPAN.emailstyle19 {
COLOR: navy; FONT-FAMILY: Arial
}
SPAN.emailstyle20 {
COLOR: navy; FONT-FAMILY: Arial
}
SPAN.EmailStyle21 {
COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=PT vLink=purple link=blue>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff
size=2>Ivo,</FONT></SPAN></DIV>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff size=2>have
you tryed to deploy the portlet directly under opencms module :
/system /<your_module>/classes/com/.. and enhance the web.xml of
opencms webapp to register your portlet? I think they must be in the same
Context e.g /opencms/opencms and /opencms/<your-portlet>, and similar to
servlets you have to deploy the dependend jar fiels into the lib directory of
your opencms module.</FONT></SPAN></DIV>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff size=2>please
forgive me, if I'm very wrong.</FONT></SPAN></DIV>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff size=2>Kind
regards</FONT></SPAN></DIV>
<DIV><SPAN class=448425816-28072004><FONT face=Arial color=#0000ff
size=2>Arash</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
opencms-dev-admin@opencms.org [mailto:opencms-dev-admin@opencms.org] <B>On
Behalf Of </B>Ivo Esteves<BR><B>Sent:</B> Wednesday, July 28, 2004 6:17
PM<BR><B>To:</B> opencms-dev@opencms.org<BR><B>Subject:</B> RE: [opencms-dev]
OpenCMS and portlets.<BR><BR></FONT></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Alex</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Sorry, my
persistence, but I don't now what else to do, and the only way that I can get
some help is here...</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I follow your
instructions, so I change the user to "Guest", but, unfortunately I continue
to get the same behaviour, this in my application (portlet).
</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">When I try your JSP
in OpenCms web application everything works ok...</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">What is the meaning
of this???</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I have OpenCms and my
portlet, deployed under the ${CATALINA_HOME}/webapps/. And when, in my
portlet, I do CmsObject cms = OpenCms.initCmsObject("Guest") I get a
java.lang.NullPointerException.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thanks other
again.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Ivo</SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=navy size=3><SPAN
lang=EN-GB style="FONT-SIZE: 12pt; COLOR: navy"></SPAN></FONT> </P></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Tahoma size=2><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
opencms-dev-admin@opencms.org [mailto:opencms-dev-admin@opencms.org] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Alexander
Kandzior<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> quarta-feira,
28 de Julho de 2004 </SPAN></FONT><FONT face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">15:33</SPAN></FONT><FONT
face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> </SPAN></FONT><FONT face=Tahoma
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">opencms-dev@opencms.org</SPAN></FONT><FONT
face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [opencms-dev] OpenCMS and
portlets.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN lang=EN-GB style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=blue
size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Ivo,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=blue
size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">you
can't initialize the CmsObject with the "Admin" user. This is a security
contraint. Only the "Guest" user can be initilized that way. However, once you
have the CmsObject with the "Guest" user, you can use the "loginUser()" method
to change the User to Admin. For that you will need to supply the password of
the Admin user.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=blue
size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Try the
following code on a JSP in the OpenCms web
application:</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Courier New"
size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">------------------------------</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Courier New"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><%@ page
import="org.opencms.main.*, org.opencms.file.*" %></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Courier New"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><%
CmsObject cms = OpenCms.initCmsObject("Guest"); %></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Courier New"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><p>Now
I am user: <b><%= cms.getRequestContext().currentUser().getName()
%></b></p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Courier New"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><%
cms.loginUser("Admin", "admin"); %></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Courier New"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><p>Now
I am user: <b><%= cms.getRequestContext().currentUser().getName()
%></b></p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Courier New"
size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">------------------------------</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN
style="FONT-SIZE: 12pt"><!-- Converted from text/plain format --> </SPAN></FONT></P>
<P style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman" size=2><SPAN
style="FONT-SIZE: 10pt">Best Regards,<BR>Alex.<BR><BR>Alexander
Kandzior<BR>Alkacon Software - The OpenCms Experts<BR><A
href="http://www.alkacon.com/">http://www.alkacon.com</A></SPAN></FONT>
</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 35.4pt; MARGIN-RIGHT: 0cm"><FONT
face=Tahoma size=2><SPAN lang=DE
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
opencms-dev-admin@opencms.org [mailto:opencms-dev-admin@opencms.org]
<B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Ivo
Esteves<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday,
July 28, 2004 3:21 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
opencms-dev@opencms.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [opencms-dev] OpenCMS and
portlets.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Alex</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Once again, thanks
allot for your help and time.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You gave me good
news, because I make deploy of my application (in this case portlet) in
"webapps" directory, so the problems isn't the application context. So I
assume that the problem is in my code.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">My problem, is that
I get a java.lang.NullPointerException, when I call
OpenCms.initCmsObject("Admin").</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The exception
occurs in "</SPAN></FONT><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">org.opencms.main.OpenCmsCore.initCmsObject(OpenCmsCore.java:935</SPAN></FONT><FONT
face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">)",
like</SPAN></FONT><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I don't have the
source of version 5.3.5, I can't go to source to see what's happening
wrong...</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Do you have any
idea about what's happening???</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Best
Regards.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face=Arial color=navy
size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Ivo</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 35.4pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face=Tahoma
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
opencms-dev-admin@opencms.org [mailto:opencms-dev-admin@opencms.org]
<B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Alexander
Kandzior<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B>
quarta-feira, 28 de Julho de 2004 </SPAN></FONT><FONT face=Tahoma
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">9:13</SPAN></FONT><FONT
face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> opencms-dev@opencms.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [opencms-dev] OpenCMS and
portlets.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face=Arial color=blue
size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Ivo,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face=Arial color=blue
size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">an
application context is a web application deployed in the "webapps" folder in
the ${CATALINA_HOME} directory. OpenCms usually is installed in the
"opencms" directory / application context. In case you want to share an
instance of the OpenCms object, your application must be deployed in the
same directory in "webapps" as OpenCms. Of course, you can rename the
directory name. </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face=Arial color=blue
size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I
think there is also a way to access one application context from another in
a Servlet, like this:</SPAN></FONT></P></DIV>
<DIV>
<P style="MARGIN-LEFT: 70.8pt"><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt">ServletContext otherContext = <B><FONT
color=gray><SPAN
style="FONT-WEIGHT: bold; COLOR: gray">getServletContext</SPAN></FONT></B>().<B><SPAN
style="FONT-WEIGHT: bold">getContext</SPAN></B>(<FONT color=#8000ff><SPAN
style="COLOR: #8000ff">"name"</SPAN></FONT>);</SPAN></FONT></P>
<P style="MARGIN-LEFT: 70.8pt"><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">but I did not try
using this myself so far.</SPAN></FONT></P><!-- Converted from text/plain format -->
<P style="MARGIN-LEFT: 70.8pt"><FONT face="Times New Roman" size=2><SPAN
style="FONT-SIZE: 10pt">Best Regards,<BR>Alex.<BR><BR>Alexander
Kandzior<BR>Alkacon Software - The OpenCms Experts<BR><A
href="http://www.alkacon.com/">http://www.alkacon.com</A></SPAN></FONT>
</P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 70.8pt; MARGIN-RIGHT: 0cm"><FONT
face=Tahoma size=2><SPAN lang=DE
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
opencms-dev-admin@opencms.org [mailto:opencms-dev-admin@opencms.org]
<B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Ivo
Esteves<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday,
July 27, 2004 7:40 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
opencms-dev@opencms.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [opencms-dev] OpenCMS
and portlets.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-GB style="FONT-SIZE: 12pt">Hi,
again...</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-GB style="FONT-SIZE: 12pt">In
advance, thanks for your quick response. </SPAN></FONT><FONT
face=Wingdings><SPAN lang=EN-GB
style="FONT-FAMILY: Wingdings">J</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-GB style="FONT-SIZE: 12pt">The
version that I'm using is the 5.3.5, so I can use the solution you give
me. But I have a problem and I think that is the application
context...</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-GB
style="FONT-SIZE: 12pt">I've OpenCms and portles(eXo platform) running
under TomCat 5.0.25. Can you tell me if the solution should work in this
environment?? I already tried but don't work, maybe TomCat isn't an
application context, or maybe I've done something
wrong???</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-GB
style="FONT-SIZE: 12pt">Someone have an idea???</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-GB
style="FONT-SIZE: 12pt">Thanks </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-GB style="FONT-SIZE: 12pt">Ivo
Esteves</SPAN></FONT></P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 70.8pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face=Tahoma
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
opencms-dev-admin@opencms.org [mailto:opencms-dev-admin@opencms.org]
<B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Alexander
Kandzior<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B>
sexta-feira, 23 de Julho de 2004 </SPAN></FONT><FONT face=Tahoma
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">15:52</SPAN></FONT><FONT
face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B>
opencms-dev@opencms.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [opencms-dev] OpenCMS
and portlets.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face=Arial
color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">What version do
you use? </SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face=Arial
color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">If you use the
current "stable" release, there is no easy way (without core code
modifications) to get a CmsObject.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face=Arial
color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">This has changed
in the current development version (CVS HEAD). In this version you can get
access to a CmsObject using the OpenCms singleton Object (e.g. using
method OpenCms.initCmsObject(String unsername). This just requires that
OpenCms shares an application context with your
application.</SPAN></FONT></P></DIV>
<DIV>
<P style="MARGIN-LEFT: 106.2pt"><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Best
Regards,<BR>Alex.<BR><BR>Alexander Kandzior<BR>Alkacon Software - The
OpenCms Experts<BR><A
href="http://www.alkacon.com/">http://www.alkacon.com</A>
</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 106.2pt; MARGIN-RIGHT: 0cm"><FONT
face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"> </SPAN></FONT><FONT
face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
opencms-dev-admin@opencms.org [mailto:opencms-dev-admin@opencms.org]
<B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Ivo
Esteves<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday,
July 23, 2004 4:25 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
opencms-dev@opencms.org<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> [opencms-dev] OpenCMS and
portlets.</SPAN></FONT></P></DIV>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt">Hi, </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face="Courier New"
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">I'm newbie in
OpenCMS. </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face="Courier New"
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">I'm developing a
portal using portlets and we decide to use OpenCMS only to be the
Content Management Service. </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face="Courier New"
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">To access resources
I've got to use the OpenCMS API, so far so good, but I don't know how to
get the CMSObject.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face="Courier New"
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">So far I only see
examples in JSP, that use </SPAN></FONT><SPAN
lang=EN-GB>CmsJspActionElement class to get it</SPAN><FONT
face="Courier New" size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">, but I'm using
portlets (Java) and I don't how to get the CMSObject to access
resources,</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT face="Courier New"
size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">If anyone has an
idea... </SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt">Thanks in advance.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 106.2pt"><FONT
face="Times New Roman" size=3><SPAN lang=EN-US
style="FONT-SIZE: 12pt">Ivo
Esteves</SPAN></FONT></P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></DIV></BLOCKQUOTE></BODY></HTML>