<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=RU link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'>Thanks, works great.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<pre><font size=2 color=navy face=Arial><span lang=EN-US style='font-size:10.0pt;
font-family:Arial;color:navy'>I also found a </span></font><span lang=EN-GB>CmsJspXmlContentBean</span><span
lang=EN-US> that can extract elements using specified language.<o:p></o:p></span></pre><pre><font
size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt'>Yuriy.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt'>P.S. Do you know how to detect locales that present in file?</span></font><font
color=navy face=Arial><span lang=EN-US style='font-family:Arial;color:navy'><o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Jonathan Woods<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, August 15, 2006
1:40 PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'The OpenCms mailing list'<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [opencms-dev] Locale
on-the-fly</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Yuriy -</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>I use Java rather than the OpenCms taglib,
and in theory that makes things quite easy.  Maybe this would be useful
for you too.</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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.</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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:</span></font><o:p></o:p></p>

<p><b><font size=2 color="#7f0055" face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:#7F0055;font-weight:bold'>final</span></font></b><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> CmsResource
cmsResource = <b><font color="#7f0055"><span style='color:#7F0055;font-weight:
bold'>this</span></font></b>.<font color="#0000c0"><span style='color:#0000C0'>cmsObject</span></font>.readResource(relativeResourcePath,
CmsResourceFilter.<i><font color="#0000c0"><span style='color:#0000C0;
font-style:italic'>ALL</span></font></i>);<br>
<b><font color="#7f0055"><span style='color:#7F0055;font-weight:bold'>final</span></font></b>
CmsFile resourceFile = CmsFile.<i><span style='font-style:italic'>upgrade</span></i>(cmsResource,
<b><font color="#7f0055"><span style='color:#7F0055;font-weight:bold'>this</span></font></b>.<font
color="#0000c0"><span style='color:#0000C0'>cmsObject</span></font>);<br>
<b><font color="#7f0055"><span style='color:#7F0055;font-weight:bold'>final</span></font></b>
CmsXmlContent xmlDocument = CmsXmlContentFactory.<i><span style='font-style:
italic'>unmarshal</span></i>(<b><font color="#7f0055"><span style='color:#7F0055;
font-weight:bold'>this</span></font></b>.<font color="#0000c0"><span
style='color:#0000C0'>cmsObject</span></font>, resourceFile, <b><font
color="#7f0055"><span style='color:#7F0055;font-weight:bold'>true</span></font></b>);</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Jon</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Y. Glebov<br>
<b><span style='font-weight:bold'>Sent:</span></b> 15 August 2006 09:34<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">opencms-dev@opencms.org</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> [opencms-dev] Locale
on-the-fly</span></font><span lang=EN-US><o:p></o:p></span></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Hi all.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;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 size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;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 size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;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 size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>How it’s possible?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Thanks.<o:p></o:p></span></font></p>

</div>

</body>

</html>