<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Carsten,<br>
<br>
I think you are right. There are many calls to 'new Locale(String)'
that should be replaced with calling the static
'CmsLocaleManager.getLocale(String)' method. We will include that
into the soon to be released version 8.0.4 of OpenCms.<br>
<br>
Greetings, Tobias<br>
<pre class="moz-signature" cols="300">--
Visit OpenCms Days 2012 Conference and Expo September 24 to 25, 2012 in Cologne, Germany <a class="moz-txt-link-freetext" href="http://www.opencms-days.org">http://www.opencms-days.org</a>
Alkacon Software GmbH - The OpenCms Experts
<a class="moz-txt-link-freetext" href="http://www.alkacon.com">http://www.alkacon.com</a> -- <a class="moz-txt-link-freetext" href="http://www.opencms.org">http://www.opencms.org</a>
</pre>
<br>
Am 10.04.2012 11:31, schrieb Carsten Wilhelm:
<blockquote
cite="mid:D82D5C6B7B5A0743A25E957985F461A81496476C@MAIL.agenturennetz.de"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@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:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.E-MailFormatvorlage18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></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]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Sorry - has
nobody a similar problem? I found a lot of calls to the
constructor „new Locale(locale)“ which is incorrect if you
are using locales containing country and maybe variant.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I found a
correct working solution in
CmsLocaleManager.getLocale(locale), which checks for
underscores and calls the Java Locale constructor
accordingly.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">From my point
of view, all occurrences of the standard constructor (where
user defined locales are used) need to be replaced by a call
to the static method above.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Can anybody
confirm this? Maybe I will patch the 8.0.3 code and try this
out in our installation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Kind regads,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Carsten</span><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F;mso-fareast-language:DE"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm
0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE">Von:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:DE">
<a class="moz-txt-link-abbreviated" href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>
[<a class="moz-txt-link-freetext" href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>]
<b>Im Auftrag von </b>Carsten Wilhelm<br>
<b>Gesendet:</b> Mittwoch, 4. April 2012 12:20<br>
<b>An:</b> <a class="moz-txt-link-abbreviated" href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a><br>
<b>Betreff:</b> [opencms-dev] Bug if locales of the
form "lc_CC" is used<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Just found a potentially bug in 8.0.3.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We’ve changed to the locale „de_DE“,
which is displayed correctly in the XML-Content-Editors
Dropdowns in the Explorer view. All content is displayed
correctly on the website and can be edited using ADE
normally.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Adding existing content using the „New“
wizard, checking the content type and drag the existing
element to the page is working, too.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Creating new content by dragging the
content type to the webpage results in an error message:
„Language de_DE already exists in xml document“ (I get the
german error message, so the english one might vary a little
bit).<o:p></o:p></p>
<p class="MsoNormal">Debugging using Eclipse and source
distribution leads to this line in
CmsContainerpageService.java:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> Locale locale = new
Locale(localeName);<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Which fails if a locale containing a „_“
is used. Unfortunately the java.util.Locale Class doesn’t
look after Underscores and puts „de_DE“ in the language
name. Afterwards, this seems to lead to confusion within the
OpenCms. If I add a breakpoint here and change the value
manually in Eclipse to „new Locale(„de“, „DE“)“ I can add
the contant and from there on content addition is working
for every other page. After restarting Tomcat I get the
error again if I add new content.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So - should the new Locale() part be
exchanged to something similar to what the CmsLocaleManager
is doing? Or am I doing something completely wrong?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards,<o:p></o:p></p>
<p class="MsoNormal">Carsten<span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7F7F7F;mso-fareast-language:DE"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
</body>
</html>