<!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.2963" name=GENERATOR>
<STYLE>@page Section1 {size: 595.3pt 841.9pt; margin: 2.0cm 42.5pt 2.0cm 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"
}
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
}
SPAN.EmailStyle17 {
COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal
}
SPAN.EmailStyle18 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=RU vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2>Yuriy -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2>I use Java rather than the OpenCms taglib, and in theory
that makes things quite easy. Maybe this would be useful for you
too.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2>For example, CmsJspActionElement provides a convenience
method getContent(String target, String element, Locale locale) which returns
the String contents of an element with xpath 'element' in resource with
site-relative path 'target'. The value of locale in this case is a Locale
derived from language, rather than a country-specific one, since under the hood
OpenCms deals mainly with languages - so you'd pass in Locale.ENGLISH,
Locale.GERMAN etc, rather than Locale.UK etc.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2>If you're retrieving the contents of several XML elements,
then it's more efficient to get hold of an instance of the OpenCms interface
I_CmsXmlDocument. Again, the Java API makes this fairly easy.
To use an example from the source code of CmsJspActionElement
itself:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT size=1>
<P align=left></FONT><B><FONT color=#7f0055><FONT face=Arial
size=2>final</FONT></B></FONT><FONT face=Arial><FONT size=2> CmsResource
cmsResource = <B><FONT color=#7f0055>this</B></FONT></FONT></FONT><FONT
face=Arial><FONT size=2>.<FONT
color=#0000c0>cmsObject</FONT>.readResource(relativeResourcePath,
CmsResourceFilter.<I><FONT color=#0000c0>ALL</I></FONT></FONT></FONT><FONT
face=Arial><FONT size=2>);<BR><B><FONT
color=#7f0055>final</B></FONT></FONT></FONT><FONT face=Arial><FONT size=2>
CmsFile resourceFile = CmsFile.<I>upgrade</I>(cmsResource, <B><FONT
color=#7f0055>this</B></FONT></FONT></FONT><FONT face=Arial><FONT size=2>.<FONT
color=#0000c0>cmsObject</FONT></FONT></FONT><FONT face=Arial><FONT
size=2>);<BR><B><FONT color=#7f0055>final</B></FONT></FONT></FONT><FONT
face=Arial><FONT size=2> CmsXmlContent xmlDocument =
CmsXmlContentFactory.<I>unmarshal</I>(<B><FONT
color=#7f0055>this</B></FONT></FONT></FONT><FONT face=Arial><FONT size=2>.<FONT
color=#0000c0>cmsObject</FONT>, resourceFile, <B><FONT
color=#7f0055>true</B></FONT></FONT></FONT><FONT face=Arial
size=2>);</FONT></P></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2>Jon</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=677343009-15082006><FONT face=Arial
color=#0000ff size=2></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>Y.
Glebov<BR><B>Sent:</B> 15 August 2006 09:34<BR><B>To:</B>
opencms-dev@opencms.org<BR><B>Subject:</B> [opencms-dev] Locale
on-the-fly<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi all.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">My problem with including page
element in another locale is still actual.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have a page with content and I
need to switch languages only for this<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Content, but language of other page
elements must remain the same. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">How it’s
possible?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks.<o:p></o:p></SPAN></FONT></P></DIV></BODY></HTML>