<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" 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"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR><!--[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 name="PersonName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><!--[if !mso]>
<STYLE>st1\:* {
BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
font-family: Tahoma;
}
@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
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
PRE {
FONT-SIZE: 10pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Courier New"
}
SPAN.EmailStyle17 {
COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal
}
SPAN.EmailStyle18 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal
}
SPAN.EmailStyle20 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
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 vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=587522317-15082006><FONT face=Arial
color=#0000ff size=2>Cool.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=587522317-15082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=587522317-15082006><FONT face=Arial
color=#0000ff size=2>You'll find OpenCms Javadoc useful here, particularly for
I_CmsXmlDocument:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=587522317-15082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=587522317-15082006><FONT face=Arial
color=#0000ff size=2> <FONT
face="Courier New">/**<BR> * Returns a List of all
locales that have at last one element in <BR> * this XML
document.<p><BR> * <BR> *
@return a List of all locales that have at last one element in this XML
document<BR> */<BR> List
getLocales();</FONT></FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=587522317-15082006><FONT face="Courier New"
color=#0000ff size=2> /**<BR> *
Returns a List of all locales that have the given element set in this XML
document.<p><BR> * <BR> *
If no locale for the given element name is available, an empty list is
returned.<p><BR> * <BR> *
@param element the element to look up the locale List
for<BR> * @return a List of all Locales that have the
given element set in this XML document<BR>
*/<BR> List getLocales(String element);</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=587522317-15082006></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>I<SPAN class=587522317-15082006>f you're not using an
IDE, you can still see the Javadoc at various places on the web; just Google for
e.g. "opencms javadoc" (but make sure you're getting the documentation for a
recent version).</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=587522317-15082006></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=587522317-15082006>Jon</SPAN></FONT></FONT></FONT></DIV>
<DIV><BR></DIV>
<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 14:43<BR><B>To:</B> 'The OpenCms mailing
list'<BR><B>Subject:</B> RE: [opencms-dev] Locale
on-the-fly<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thanks, works
great.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P><PRE><FONT face=Arial color=navy size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">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 face="Courier New" size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p> </o:p></SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt">Yuriy.<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p> </o:p></SPAN></FONT></PRE><PRE><FONT face="Courier New" size=2><SPAN lang=EN-US style="FONT-SIZE: 10pt">P.S. Do you know how to detect locales that present in file?</SPAN></FONT><FONT face=Arial color=navy><SPAN lang=EN-US style="COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></PRE>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN lang=EN-US
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; 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 face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Yuriy
-</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">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 face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">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 face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">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 face=Arial color=#7f0055 size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: Arial">final</SPAN></FONT></B><FONT
face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> CmsResource
cmsResource = <B><FONT color=#7f0055><SPAN
style="FONT-WEIGHT: bold; COLOR: #7f0055">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="FONT-WEIGHT: bold; COLOR: #7f0055">final</SPAN></FONT></B> CmsFile
resourceFile = CmsFile.<I><SPAN
style="FONT-STYLE: italic">upgrade</SPAN></I>(cmsResource, <B><FONT
color=#7f0055><SPAN
style="FONT-WEIGHT: bold; COLOR: #7f0055">this</SPAN></FONT></B>.<FONT
color=#0000c0><SPAN style="COLOR: #0000c0">cmsObject</SPAN></FONT>);<BR><B><FONT
color=#7f0055><SPAN
style="FONT-WEIGHT: bold; COLOR: #7f0055">final</SPAN></FONT></B> CmsXmlContent
xmlDocument = CmsXmlContentFactory.<I><SPAN
style="FONT-STYLE: italic">unmarshal</SPAN></I>(<B><FONT color=#7f0055><SPAN
style="FONT-WEIGHT: bold; COLOR: #7f0055">this</SPAN></FONT></B>.<FONT
color=#0000c0><SPAN style="COLOR: #0000c0">cmsObject</SPAN></FONT>,
resourceFile, <B><FONT color=#7f0055><SPAN
style="FONT-WEIGHT: bold; COLOR: #7f0055">true</SPAN></FONT></B>);</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Jon</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN lang=EN-US style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma size=2><SPAN
lang=EN-US
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN lang=EN-US
style="FONT-SIZE: 10pt; 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 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>