gatein SVN: r3632 - in portal/trunk: docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration and 4 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-07-15 14:23:19 -0400 (Thu, 15 Jul 2010)
New Revision: 3632
Added:
portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/
portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png
Modified:
portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-1301: Show "Simplified Chinese" for zh_CN and "Traditional Chinese" for zh_TW
Added: portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml 2010-07-15 18:23:19 UTC (rev 3632)
@@ -313,6 +313,32 @@
</section>
</section>
+ <section>
+ <title>Translating the language selection form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png" format="PNG" align="center" valign="middle"
+ scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <para>When choosing a language as on the screenshot above, the user is presented with a list of languages on the left side in the current chosen language
+ and on the right side, the same language translated into its own language.
+ Those texts are obtained from the JDK API <literal>java.util.Locale.getDisplayedLanguage()</literal> and <literal>java.util.Locale.getDisplayedCountry()</literal> (if needed) and all languages may not be translated and can also depend on the JVM currently used.
+ It is still possible to override those values by editing the <literal>locale.portal.webui</literal> resource bundle, to do so edit the file <filename>gatein.ear/02portal.war/WEB-INF/classes/locale/portal/webui_xx_yy.properties</filename> where <literal>xx_yy</literal>
+ represents the country code of the language in which you want to translate a particular language.
+ In that file, add or modify a key such as <literal>Locale.xx_yy</literal> with the value being the translated string.
+ </para>
+ <example>
+ <title>Changing the displayed text for Traditional Chinese in French</title>
+ <para>First edit <filename>gatein.ear/02portal.war/WEB-INF/classes/locale/portal/webui_fr.properties</filename> where <literal>ne</literal> is the country code for French, and add
+ the following key into it:
+ <programlisting>
+ Locale.zh_TW=Chinois traditionnel
+ </programlisting>
+ After a restart the language will be updated in the user interface when a user is trying to change the current language.
+ </para>
+ </example>
+ </section>
</section>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-07-15 18:23:19 UTC (rev 3632)
@@ -1347,4 +1347,8 @@
UIGadget.tooltip.Maximize=Maximieren
UIGadget.tooltip.Unmaximize=Normalgröße
UIGadget.tooltip.editGadget=Gadget bearbeiten
-UIGadget.tooltip.deleteGadget=Gadget löschen
\ No newline at end of file
+UIGadget.tooltip.deleteGadget=Gadget löschen
+
+
+Locale.zh_CN=Vereinfachtes Chinesisch
+Locale.zh_TW=Traditionelles Chinesisch
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-07-15 18:23:19 UTC (rev 3632)
@@ -174,6 +174,7 @@
Asia.label=Asia
Language.left.title=Select a language
+
#############################################################################
# Change Skin #
#############################################################################
@@ -1383,3 +1384,9 @@
UIConfirmation.title.exoMessages=Confirm message
UIConfirmation.Close=Close
+
+
+ ### Locales
+Locale.zh_CN=Simplified Chinese
+Locale.zh_TW=Traditional Chinese
+
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-07-15 18:23:19 UTC (rev 3632)
@@ -1310,3 +1310,7 @@
UIGadget.tooltip.Unmaximize=Restaurar
UIGadget.tooltip.editGadget=Editar Gadget
UIGadget.tooltip.deleteGadget=Borrar Gadget
+
+Locale.zh_CN=Chino simplificado
+Locale.zh_TW=Chino tradicional
+
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-07-15 18:23:19 UTC (rev 3632)
@@ -1285,3 +1285,7 @@
UIGadget.tooltip.deleteGadget=Supprimer la Gadget
UIUserToolBarDashboard.page.ClickAndType=Cliquez pour renommer
+
+Locale.zh_CN=Chinois simplifié
+Locale.zh_TW=Chinois traditionnel
+
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-07-15 18:23:19 UTC (rev 3632)
@@ -1348,3 +1348,6 @@
UIGadget.tooltip.deleteGadget=Elimina Gadget
UIListPermissionSelectorPopup.title.ListPermissionSelector=Seleziona il Permesso
+
+Locale.zh_CN=Cinese semplificato
+Locale.zh_TW=Cinese tradizionale
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-07-15 18:23:19 UTC (rev 3632)
@@ -1356,3 +1356,5 @@
UIGadget.tooltip.editGadget=\u30ac\u30b8\u30a7\u30c3\u30c8\u306e\u7de8\u96c6
UIGadget.tooltip.deleteGadget=\u30ac\u30b8\u30a7\u30c3\u30c8\u306e\u524a\u9664
+Locale.zh_CN=\u7c21\u4f53\u5b57\u4e2d\u56fd\u8a9e
+Locale.zh_TW=\u7e41\u4f53\u5b57\u4e2d\u56fd\u8a9e
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties 2010-07-15 18:23:19 UTC (rev 3632)
@@ -1351,3 +1351,5 @@
UIGadget.tooltip.Unmaximize=\u0930\u093f\u0938\u094d\u091f\u094b\u0930 \u0921\u093e\u0909\u0928
UIGadget.tooltip.editGadget=\u0917\u094d\u092f\u093e\u091c\u0947\u091f \u092a\u0930\u093f\u092e\u093e\u0930\u094d\u091c\u0928 \u0917\u0930\u094d\u0928\u0941\u0939\u094b\u0938\u094d
UIGadget.tooltip.deleteGadget=\u0917\u094d\u092f\u093e\u091c\u0947\u091f \u092e\u0947\u091f\u093e\u0909\u0928\u0941\u0939\u094b\u0938\u094d
+
+Locale.ne=\u0928\u0947\u092a\u093e\u0932\u0940
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml 2010-07-15 18:23:19 UTC (rev 3632)
@@ -1891,4 +1891,8 @@
<deleteGadget>删除小工具</deleteGadget>
</tooltip>
</UIGadget>
+ <Locale>
+ <zh_CN>全体字</zh_CN>
+ <zh_TW>全體字</zh_TW>
+ </Locale>
</bundle>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml 2010-07-15 18:23:19 UTC (rev 3632)
@@ -2068,4 +2068,9 @@
<deleteGadget>刪除小工具</deleteGadget>
</tooltip>
</UIGadget>
+
+ <Locale>
+ <zh_CN>繁体字</zh_CN>
+ <zh_TW>繁體字</zh_TW>
+ </Locale>
</bundle>
Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-07-15 18:23:19 UTC (rev 3632)
@@ -20,12 +20,15 @@
package org.exoplatform.webui.organization;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.Constants;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.UserProfile;
import org.exoplatform.services.organization.UserProfileHandler;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.ResourceBundleService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
@@ -42,6 +45,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.ResourceBundle;
/**
* Created by The eXo Platform SARL Author : Dang Van Minh minhdv81(a)yahoo.com
@@ -141,7 +145,6 @@
LocaleConfigService localeService = getApplicationComponent(LocaleConfigService.class);
Locale currentLocale = ((PortletRequestContext)WebuiRequestContext.getCurrentInstance()).getLocale();
Iterator<LocaleConfig> i = localeService.getLocalConfigs().iterator();
- String displayLanguage = null;
String displayName = null;
String language = null;
String country = null;
@@ -150,19 +153,32 @@
{
LocaleConfig config = i.next();
Locale locale = config.getLocale();
- displayName = locale.getDisplayName(currentLocale);
+ displayName = capitalizeFirstLetter(locale.getDisplayName(currentLocale));
+
language = locale.getLanguage();
country = locale.getCountry();
if (country != null && country.length() > 0)
{
- displayLanguage = displayName + " (" + locale.getDisplayCountry(currentLocale) + ")";
language = language + "_" + country;
}
- else
+
+
+ ResourceBundle localeResourceBundle;
+ try
{
- displayLanguage = displayName;
+ localeResourceBundle = getResourceBundle(currentLocale);
+ String key = "Locale." + language;
+ if (localeResourceBundle.containsKey(key))
+ {
+ displayName = localeResourceBundle.getString(key);
+ }
}
- option = new SelectItemOption<String>(displayLanguage, language, displayName);
+ catch (Exception e)
+ {
+ // ignore, use default displayName
+ }
+
+ option = new SelectItemOption<String>(displayName, language);
if (language.equals(selectedLang))
{
option.setSelected(true);
@@ -242,5 +258,28 @@
}
uiApp.addMessage(new ApplicationMessage("UIUserProfileInputSet.msg.sucsesful.update.userprofile", args));
}
+
+ private String capitalizeFirstLetter(String word)
+ {
+ if (word == null)
+ {
+ return null;
+ }
+ if (word.length() == 0)
+ {
+ return word;
+ }
+ StringBuilder result = new StringBuilder(word);
+ result.replace(0, 1, result.substring(0, 1).toUpperCase());
+ return result.toString();
+ }
+ private ResourceBundle getResourceBundle(Locale locale) throws Exception
+ {
+ ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
+ ResourceBundleService service =
+ (ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class);
+ ResourceBundle res = service.getResourceBundle("locale.portal.webui", locale);
+ return res;
+ }
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java 2010-07-15 18:23:19 UTC (rev 3632)
@@ -19,7 +19,12 @@
package org.exoplatform.portal.webui.portal;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.Constants;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
@@ -28,6 +33,9 @@
import org.exoplatform.services.organization.UserProfileHandler;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.ResourceBundleManager;
+import org.exoplatform.services.resources.ResourceBundleService;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIContainer;
@@ -42,6 +50,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
+import java.util.ResourceBundle;
@ComponentConfig(template = "system:/groovy/portal/webui/portal/UILanguageSelector.gtmpl", events = {
@EventConfig(listeners = UILanguageSelector.SaveActionListener.class),
@@ -63,16 +72,57 @@
{
LocaleConfig localeConfig = (LocaleConfig)object;
Locale locale = localeConfig.getLocale();
- String displayName = capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale));
String lang = locale.getLanguage();
String country = locale.getCountry();
- String localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale));;
+ ResourceBundle currentLocaleResourceBundle = getResourceBundle(currentLocale);
+ ResourceBundle localeResourceBundle = getResourceBundle(locale);
+
+ String key = "Locale." + lang;
+
+ String displayName = null;
+ if (currentLocaleResourceBundle.containsKey(key))
+ {
+ displayName = currentLocaleResourceBundle.getString(key);
+ }
+ else
+ {
+ displayName = capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale));
+ }
+
+ String localedName = null;
+ if (localeResourceBundle.containsKey(key))
+ {
+ localedName = localeResourceBundle.getString(key);
+ }
+ else
+ {
+ localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale));
+ }
+
+
if (country != null && country.length() > 0)
{
- displayName = capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale)) + " - " + capitalizeFirstLetter(locale.getDisplayCountry(currentLocale));
- localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale)) + " - " + capitalizeFirstLetter(locale.getDisplayCountry(locale));
lang = lang + "_" + country;
+ key = "Locale." + lang;
+
+ if (currentLocaleResourceBundle.containsKey(key))
+ {
+ displayName = currentLocaleResourceBundle.getString(key);
+ }
+ else
+ {
+ displayName = capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale)) + " - " + capitalizeFirstLetter(locale.getDisplayCountry(currentLocale));
+ }
+
+ if (localeResourceBundle.containsKey(key))
+ {
+ localedName = localeResourceBundle.getString(key);
+ }
+ else
+ {
+ localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale)) + " - " + capitalizeFirstLetter(locale.getDisplayCountry(locale));
+ }
}
if (localedName == null || localedName.length() == 0)
@@ -159,4 +209,15 @@
result.replace(0, 1, result.substring(0, 1).toUpperCase());
return result.toString();
}
+
+ private ResourceBundle getResourceBundle(Locale locale) throws Exception
+ {
+ ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
+ ResourceBundleService service =
+ (ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class);
+ ResourceBundle res = service.getResourceBundle("locale.portal.webui", locale);
+ return res;
+ }
+
+
}
\ No newline at end of file
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-07-15 16:34:46 UTC (rev 3631)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-07-15 18:23:19 UTC (rev 3632)
@@ -19,6 +19,8 @@
package org.exoplatform.portal.webui.portal;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfig;
@@ -37,6 +39,7 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.ResourceBundleService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.InitParams;
@@ -71,6 +74,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.ResourceBundle;
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@@ -187,13 +191,27 @@
Collection<?> listLocaleConfig = localeConfigService.getLocalConfigs();
LocaleConfig defaultLocale = localeConfigService.getDefaultLocaleConfig();
String defaultLanguage = defaultLocale.getLanguage();
- Locale currentLocate = Util.getPortalRequestContext().getLocale();
+ Locale currentLocale = Util.getPortalRequestContext().getLocale();
Iterator<?> iterator = listLocaleConfig.iterator();
while (iterator.hasNext())
{
LocaleConfig localeConfig = (LocaleConfig)iterator.next();
+ String displayName = capitalizeFirstLetter(localeConfig.getLocale().getDisplayName(currentLocale));
+ ResourceBundle localeResourceBundle = getResourceBundle(currentLocale);
+
+ String key = "Locale." + localeConfig.getLocale().getLanguage();
+ if (localeConfig.getLocale().getCountry() != null)
+ {
+ key += "_" + localeConfig.getLocale().getCountry();
+ }
+
+ if (localeResourceBundle.containsKey(key))
+ {
+ displayName = localeResourceBundle.getString(key);
+ }
+
SelectItemOption<String> option =
- new SelectItemOption<String>(localeConfig.getLocale().getDisplayName(currentLocate), localeConfig
+ new SelectItemOption<String>(displayName, localeConfig
.getLanguage());
if (defaultLanguage.equals(localeConfig.getLanguage()))
{
@@ -370,4 +388,27 @@
}
}
+ private String capitalizeFirstLetter(String word)
+ {
+ if (word == null)
+ {
+ return null;
+ }
+ if (word.length() == 0)
+ {
+ return word;
+ }
+ StringBuilder result = new StringBuilder(word);
+ result.replace(0, 1, result.substring(0, 1).toUpperCase());
+ return result.toString();
+ }
+
+ private ResourceBundle getResourceBundle(Locale locale) throws Exception
+ {
+ ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
+ ResourceBundleService service =
+ (ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class);
+ ResourceBundle res = service.getResourceBundle("locale.portal.webui", locale);
+ return res;
+ }
}
14 years, 5 months
gatein SVN: r3630 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-15 03:02:17 -0400 (Thu, 15 Jul 2010)
New Revision: 3630
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_005_EditGroupWithLabelContainsSpace.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_006_EditDescriptionOfGroup.html
Log:
TESTVN-1006: Create new GateIn Selenium
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_005_EditGroupWithLabelContainsSpace.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_005_EditGroupWithLabelContainsSpace.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_005_EditGroupWithLabelContainsSpace.html 2010-07-15 07:02:17 UTC (rev 3630)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_PRL_03_03_005_EditGroupWithLabelContainsSpace</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_PRL_03_03_005_EditGroupWithLabelContainsSpace</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit group with Label contains space--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to User and Group management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Group Management--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Group Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Group Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>groupName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>groupName</td>
+ <td>Test_PRL_03_03_005</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test_PRL_03_03_005</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PRL_03_03_005</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit group with label contains space--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test PRL 03 03 005</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete this group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this group?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_006_EditDescriptionOfGroup.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_006_EditDescriptionOfGroup.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_006_EditDescriptionOfGroup.html 2010-07-15 07:02:17 UTC (rev 3630)
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_PRL_03_03_006_EditDescriptionOfGroup</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_PRL_03_03_006_EditDescriptionOfGroup</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit Description of group--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to User and Group management--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Group management--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>groupName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>groupName</td>
+ <td>Test_PRL_03_03_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test_PRL_03_03_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PRL_03_03_006</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- edit description--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>description</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PRL_03_03_006_edit</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this group?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 5 months
gatein SVN: r3629 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-07-14 23:56:50 -0400 (Wed, 14 Jul 2010)
New Revision: 3629
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_004_ChangeGoupWithLabelLessThan3OrOver30Chars.html
Log:
TESTVN-1006: Create new GateIn Selenium
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_004_ChangeGoupWithLabelLessThan3OrOver30Chars.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_004_ChangeGoupWithLabelLessThan3OrOver30Chars.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_03_004_ChangeGoupWithLabelLessThan3OrOver30Chars.html 2010-07-15 03:56:50 UTC (rev 3629)
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8080/" />
+<title>Tét_PRL_03_03_004_EdỉtGoupWithLabelLessThan3OrOver30Chars</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Tét_PRL_03_03_004_EdỉtGoupWithLabelLessThan3OrOver30Chars</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit group with Label less than 3 or over 30 characters--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to User and Group Management--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Group Management--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Group Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Group Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new group--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>groupName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>groupName</td>
+ <td>Test_PRL_03_03_004</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test_PRL_03_03_004</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PRL_03_03_004</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit group with label less than 3 chars--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>label</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>PR</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>The length of the text in field "Label" must be between "3" and "30" characters. </td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>The length of the text in field "Label" must be between "3" and "30" characters. </td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[2]/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Edit label over 30 chars--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>label</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test_PRL_03_03_004 Test_PRL_03_03_004 Test_PRL_03_03_004 Test_PRL_03_03_004 Test_PRL_03_03_004</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>The length of the text in field "Label" must be between "3" and "30" characters. </td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>The length of the text in field "Label" must be between "3" and "30" characters. </td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[2]/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete this group--</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this group?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 5 months
gatein SVN: r3628 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-07-13 07:37:53 -0400 (Tue, 13 Jul 2010)
New Revision: 3628
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
Log:
GTNPORTAL-1340: Portlet Edit mode is broken in GateIn 3.1 for JSF Portlet
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2010-07-12 23:46:25 UTC (rev 3627)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java 2010-07-13 11:37:53 UTC (rev 3628)
@@ -218,7 +218,15 @@
if (portletResponse instanceof FragmentResponse)
{
FragmentResponse fragmentResponse = (FragmentResponse)portletResponse;
- content = new String(fragmentResponse.getBytes(), "UTF-8");
+ if (fragmentResponse.getType() == FragmentResponse.TYPE_BYTES)
+ {
+ content = new String(fragmentResponse.getBytes(), "UTF-8");
+ }
+ else
+ {
+ content = fragmentResponse.getContent();
+ }
+
}
else
{
14 years, 5 months
gatein SVN: r3627 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-07-12 19:46:25 -0400 (Mon, 12 Jul 2010)
New Revision: 3627
Removed:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/HtmlValidator.java
Log:
remove empty file
Deleted: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/HtmlValidator.java
===================================================================
14 years, 5 months
gatein SVN: r3626 - in portal/trunk/component/web/src/main/java/org/exoplatform: upload and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-07-12 18:30:03 -0400 (Mon, 12 Jul 2010)
New Revision: 3626
Modified:
portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/CharRefs.java
portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/RefsDecoder.java
portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java
Log:
hopefully finish to fix this mess
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/CharRefs.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/CharRefs.java 2010-07-12 22:27:53 UTC (rev 3625)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/CharRefs.java 2010-07-12 22:30:03 UTC (rev 3626)
@@ -1,27 +1,22 @@
-/**
+/*
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-//HTMLParser Library $Name: v1_5 $ - A java-based parser for HTML
-//http://sourceforge.org/projects/htmlparser
-//Copyright (C) 2004 Derrick Oswald
-//Copyright (C) 2006 eXo Platform SARL
-
//Revision Control Information
//$Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/util/Translate.java,v $
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/RefsDecoder.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/RefsDecoder.java 2010-07-12 22:27:53 UTC (rev 3625)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/services/html/refs/RefsDecoder.java 2010-07-12 22:30:03 UTC (rev 3626)
@@ -21,6 +21,8 @@
import org.exoplatform.services.chars.CharsUtil;
+import java.util.Comparator;
+
/**
* Author : Nhu Dinh Thuan
* nhudinhthuan(a)yahoo.com
@@ -29,6 +31,16 @@
public class RefsDecoder
{
+ private static final CharRefs charRefs = new CharRefs();
+
+ static Comparator<CharRef> comparator = new Comparator<CharRef>()
+ {
+ public int compare(CharRef o1, CharRef o2)
+ {
+ return o1.getName().compareTo(o2.getName());
+ }
+ };
+
public String decode(String text)
{
return new String(decodeChars(text.toCharArray()));
@@ -41,9 +53,8 @@
private char[] decodeChars(char[] chars)
{
- CharRefs charRefs = DecodeService.DECODE_CHARS_REF.getRef();
if (!charRefs.isSorted())
- charRefs.sort(DecodeService.comparator);
+ charRefs.sort(comparator);
int index = CharsUtil.indexOf(chars, '&', 0);
if (index < 0 || CharsUtil.indexOf(chars, ';', index) < 0)
return chars;
@@ -79,7 +90,7 @@
{
if (Character.isLetter(ckey[0]))
{
- CharRef item = charRefs.searchByName(new String(ckey), DecodeService.comparator);
+ CharRef item = charRefs.searchByName(new String(ckey), comparator);
if (item != null)
{
decode.append((char)item.getValue());
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java 2010-07-12 22:27:53 UTC (rev 3625)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/upload/RequestStreamReader.java 2010-07-12 22:30:03 UTC (rev 3626)
@@ -19,7 +19,7 @@
package org.exoplatform.upload;
-import org.exoplatform.upload.toremove.RefsDecoder;
+import org.exoplatform.services.html.refs.RefsDecoder;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
14 years, 5 months
gatein SVN: r3625 - portal/trunk/component/web/src/main/java/org/exoplatform/services/chars.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-07-12 18:27:53 -0400 (Mon, 12 Jul 2010)
New Revision: 3625
Added:
portal/trunk/component/web/src/main/java/org/exoplatform/services/chars/CharsUtil.java
Log:
direct svn copy of this file
Copied: portal/trunk/component/web/src/main/java/org/exoplatform/services/chars/CharsUtil.java (from rev 3624, portal/tags/3.1.0-GA/component/xml-parser/src/main/java/org/exoplatform/services/chars/CharsUtil.java)
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/services/chars/CharsUtil.java (rev 0)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/services/chars/CharsUtil.java 2010-07-12 22:27:53 UTC (rev 3625)
@@ -0,0 +1,133 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.chars;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Nhu Dinh Thuan
+ * thuan.nhu(a)exoplatform.com
+ * Sep 13, 2006
+ */
+public final class CharsUtil
+{
+
+ public static int indexOf(char[] value, char[] c, int start)
+ {
+ boolean is = false;
+ for (int i = start; i < value.length; i++)
+ {
+ is = true;
+ for (int j = 0; j < c.length; j++)
+ {
+ if (i + j < value.length && c[j] == value[i + j])
+ continue;
+ is = false;
+ break;
+ }
+ if (is)
+ return i;
+ }
+ return -1;
+ }
+
+ public static char[] cutAndTrim(char[] data, int start, int end)
+ {
+ int s = start;
+ int e = end - 1;
+ while (s < end)
+ {
+ if (!Character.isWhitespace(data[s]))
+ break;
+ s++;
+ }
+ while (e > start)
+ {
+ if (!Character.isWhitespace(data[e]))
+ break;
+ e--;
+ }
+ e++;
+ if (e <= s)
+ return new char[0];
+ char[] newChar = new char[e - s];
+ System.arraycopy(data, s, newChar, 0, newChar.length);
+ return newChar;
+ }
+
+ public static char[] cutBySpace(char[] data, int start)
+ {
+ int e = start;
+ while (e < data.length)
+ {
+ if (Character.isWhitespace(data[e]))
+ break;
+ e++;
+ }
+ if (e <= start)
+ return new char[0];
+ char[] newChar = new char[e - start];
+ System.arraycopy(data, start, newChar, 0, newChar.length);
+ return newChar;
+ }
+
+ public static int indexOfIgnoreCase(char[] value, char[] c, int start)
+ {
+ boolean is = false;
+ for (int i = start; i < value.length; i++)
+ {
+ is = true;
+ for (int j = 0; j < c.length; j++)
+ {
+ if (Character.toLowerCase(c[j]) == Character.toLowerCase(value[i + j]))
+ continue;
+ is = false;
+ break;
+ }
+ if (is)
+ return i;
+ }
+ return -1;
+ }
+
+ public static int indexOf(char[] value, char c, int start)
+ {
+ for (int i = start; i < value.length; i++)
+ {
+ if (c == value[i])
+ return i;
+ }
+ return -1;
+ }
+
+ /* public static void main(String args[]){
+ String yahoo =" nhu dinh thuan nhu dinh ";
+ String pattern = "dinh";
+ System.out.println(indexOf(yahoo.toCharArray(), pattern.toCharArray(), 7));
+ System.out.println(indexOf(yahoo.toCharArray(), 'd', 0));
+ pattern = "DiNh";
+ System.out.println(indexOf(yahoo.toCharArray(), pattern.toCharArray(), 7));
+ System.out.println(indexOfIgnoreCase(yahoo.toCharArray(), pattern.toCharArray(), 7));
+
+ char [] data = cutAndTrim(yahoo.toCharArray(), 19, 31);
+ System.out.println("|"+new String(data)+"|");
+ data = cutBySpace(yahoo.toCharArray(), 1);
+ System.out.println("|"+new String(data)+"|");
+ }*/
+}
14 years, 5 months
gatein SVN: r3623 - portal/trunk/component/web/src/main/java/org/exoplatform/services.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-07-12 18:25:29 -0400 (Mon, 12 Jul 2010)
New Revision: 3623
Removed:
portal/trunk/component/web/src/main/java/org/exoplatform/services/chars
Log:
remove error
Deleted: portal/trunk/component/web/src/main/java/org/exoplatform/services/chars
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/services/chars 2010-07-12 22:15:24 UTC (rev 3622)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/services/chars 2010-07-12 22:25:29 UTC (rev 3623)
@@ -1,133 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.chars;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Nhu Dinh Thuan
- * thuan.nhu(a)exoplatform.com
- * Sep 13, 2006
- */
-public final class CharsUtil
-{
-
- public static int indexOf(char[] value, char[] c, int start)
- {
- boolean is = false;
- for (int i = start; i < value.length; i++)
- {
- is = true;
- for (int j = 0; j < c.length; j++)
- {
- if (i + j < value.length && c[j] == value[i + j])
- continue;
- is = false;
- break;
- }
- if (is)
- return i;
- }
- return -1;
- }
-
- public static char[] cutAndTrim(char[] data, int start, int end)
- {
- int s = start;
- int e = end - 1;
- while (s < end)
- {
- if (!Character.isWhitespace(data[s]))
- break;
- s++;
- }
- while (e > start)
- {
- if (!Character.isWhitespace(data[e]))
- break;
- e--;
- }
- e++;
- if (e <= s)
- return new char[0];
- char[] newChar = new char[e - s];
- System.arraycopy(data, s, newChar, 0, newChar.length);
- return newChar;
- }
-
- public static char[] cutBySpace(char[] data, int start)
- {
- int e = start;
- while (e < data.length)
- {
- if (Character.isWhitespace(data[e]))
- break;
- e++;
- }
- if (e <= start)
- return new char[0];
- char[] newChar = new char[e - start];
- System.arraycopy(data, start, newChar, 0, newChar.length);
- return newChar;
- }
-
- public static int indexOfIgnoreCase(char[] value, char[] c, int start)
- {
- boolean is = false;
- for (int i = start; i < value.length; i++)
- {
- is = true;
- for (int j = 0; j < c.length; j++)
- {
- if (Character.toLowerCase(c[j]) == Character.toLowerCase(value[i + j]))
- continue;
- is = false;
- break;
- }
- if (is)
- return i;
- }
- return -1;
- }
-
- public static int indexOf(char[] value, char c, int start)
- {
- for (int i = start; i < value.length; i++)
- {
- if (c == value[i])
- return i;
- }
- return -1;
- }
-
- /* public static void main(String args[]){
- String yahoo =" nhu dinh thuan nhu dinh ";
- String pattern = "dinh";
- System.out.println(indexOf(yahoo.toCharArray(), pattern.toCharArray(), 7));
- System.out.println(indexOf(yahoo.toCharArray(), 'd', 0));
- pattern = "DiNh";
- System.out.println(indexOf(yahoo.toCharArray(), pattern.toCharArray(), 7));
- System.out.println(indexOfIgnoreCase(yahoo.toCharArray(), pattern.toCharArray(), 7));
-
- char [] data = cutAndTrim(yahoo.toCharArray(), 19, 31);
- System.out.println("|"+new String(data)+"|");
- data = cutBySpace(yahoo.toCharArray(), 1);
- System.out.println("|"+new String(data)+"|");
- }*/
-}
14 years, 5 months
gatein SVN: r3622 - portal/trunk/component/web/src/main/java/org/exoplatform/services.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-07-12 18:15:24 -0400 (Mon, 12 Jul 2010)
New Revision: 3622
Added:
portal/trunk/component/web/src/main/java/org/exoplatform/services/chars
Log:
copying that file directly in svn
Copied: portal/trunk/component/web/src/main/java/org/exoplatform/services/chars (from rev 3621, portal/tags/3.1.0-GA/component/xml-parser/src/main/java/org/exoplatform/services/chars/CharsUtil.java)
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/services/chars (rev 0)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/services/chars 2010-07-12 22:15:24 UTC (rev 3622)
@@ -0,0 +1,133 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.chars;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Nhu Dinh Thuan
+ * thuan.nhu(a)exoplatform.com
+ * Sep 13, 2006
+ */
+public final class CharsUtil
+{
+
+ public static int indexOf(char[] value, char[] c, int start)
+ {
+ boolean is = false;
+ for (int i = start; i < value.length; i++)
+ {
+ is = true;
+ for (int j = 0; j < c.length; j++)
+ {
+ if (i + j < value.length && c[j] == value[i + j])
+ continue;
+ is = false;
+ break;
+ }
+ if (is)
+ return i;
+ }
+ return -1;
+ }
+
+ public static char[] cutAndTrim(char[] data, int start, int end)
+ {
+ int s = start;
+ int e = end - 1;
+ while (s < end)
+ {
+ if (!Character.isWhitespace(data[s]))
+ break;
+ s++;
+ }
+ while (e > start)
+ {
+ if (!Character.isWhitespace(data[e]))
+ break;
+ e--;
+ }
+ e++;
+ if (e <= s)
+ return new char[0];
+ char[] newChar = new char[e - s];
+ System.arraycopy(data, s, newChar, 0, newChar.length);
+ return newChar;
+ }
+
+ public static char[] cutBySpace(char[] data, int start)
+ {
+ int e = start;
+ while (e < data.length)
+ {
+ if (Character.isWhitespace(data[e]))
+ break;
+ e++;
+ }
+ if (e <= start)
+ return new char[0];
+ char[] newChar = new char[e - start];
+ System.arraycopy(data, start, newChar, 0, newChar.length);
+ return newChar;
+ }
+
+ public static int indexOfIgnoreCase(char[] value, char[] c, int start)
+ {
+ boolean is = false;
+ for (int i = start; i < value.length; i++)
+ {
+ is = true;
+ for (int j = 0; j < c.length; j++)
+ {
+ if (Character.toLowerCase(c[j]) == Character.toLowerCase(value[i + j]))
+ continue;
+ is = false;
+ break;
+ }
+ if (is)
+ return i;
+ }
+ return -1;
+ }
+
+ public static int indexOf(char[] value, char c, int start)
+ {
+ for (int i = start; i < value.length; i++)
+ {
+ if (c == value[i])
+ return i;
+ }
+ return -1;
+ }
+
+ /* public static void main(String args[]){
+ String yahoo =" nhu dinh thuan nhu dinh ";
+ String pattern = "dinh";
+ System.out.println(indexOf(yahoo.toCharArray(), pattern.toCharArray(), 7));
+ System.out.println(indexOf(yahoo.toCharArray(), 'd', 0));
+ pattern = "DiNh";
+ System.out.println(indexOf(yahoo.toCharArray(), pattern.toCharArray(), 7));
+ System.out.println(indexOfIgnoreCase(yahoo.toCharArray(), pattern.toCharArray(), 7));
+
+ char [] data = cutAndTrim(yahoo.toCharArray(), 19, 31);
+ System.out.println("|"+new String(data)+"|");
+ data = cutBySpace(yahoo.toCharArray(), 1);
+ System.out.println("|"+new String(data)+"|");
+ }*/
+}
14 years, 5 months