From e0fb729f11ab8da539349e9932e0414b74a3fcc5 Mon Sep 17 00:00:00 2001
From: pb
Date: Sat, 27 Apr 2013 08:17:18 +0000
Subject: [PATCH] =?UTF-8?q?Die=20Nutzung=20von=20ChainedResourceBundle=20?=
=?UTF-8?q?=C3=BCberall=20entfernt=20und=20auf=20*.properties=20umgestellt?=
=?UTF-8?q?.=20Die=20Klasse=20in=20core=20zun=C3=A4chst=20nicht=20entfernt?=
=?UTF-8?q?,=20als=20Referenz=20f=C3=BCr=20die=20weitere=20Entwicklung=20d?=
=?UTF-8?q?er=20Globalisierung/Lokalisierung.=20Die=20=C3=84nderungen=20so?=
=?UTF-8?q?llten=20auch=20in=202.0.x=20=C3=BCbernommen=20werden.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: https://svn.libreccm.org/ccm/trunk@2144 8810af33-2d31-482b-a856-94f89814c4df
---
.../FileAttachmentGlobalize.java | 2 +-
.../ImageStepResources_en.properties | 2 +
.../ui/ImageComponentAttachListener.java | 30 +++-
.../cms/contentassets/ui/ImageStep.java | 1 -
...ublicPersonalProfileGlobalizationUtil.java | 33 ++++
.../util/AgendaGlobalizationUtil.java | 20 ++-
.../util/AgendaResourceBundle.java | 39 -----
.../ArticleResources_de.properties | 2 +
.../cms/contenttypes/DecisionTreeUtil.java | 21 ++-
.../util/EventGlobalizationUtil.java | 23 +--
.../util/EventResourceBundle.java | 42 -----
.../FAQItemResources_de.properties | 4 +
.../util/FAQGlobalizationUtil.java | 23 +--
.../contenttypes/util/FAQResourceBundle.java | 39 -----
.../util/GlossaryGlobalizationUtil.java | 24 +--
.../util/GlossaryResourceBundle.java | 39 -----
.../HealthCareFacilityGlobalizationUtil.java | 24 +--
.../HealthCareFacilityResourceBundle.java | 39 -----
.../util/ImageGlobalizationUtil.java | 25 ++-
.../util/ImageResourceBundle.java | 38 ----
.../arsdigita/cms/contenttypes/Member.java | 3 +-
.../util/MemberGlobalizationUtil.java | 14 +-
.../util/MemberResourceBundle.java | 35 ----
.../util/MOTDGlobalizationUtil.java | 26 +--
.../contenttypes/util/MOTDResourceBundle.java | 39 -----
.../util/MPArticleGlobalizationUtil.java | 24 +--
.../util/MultiPartArticleResourceBundle.java | 39 -----
.../util/NewsItemGlobalizationUtil.java | 23 +--
.../util/NewsItemResourceBundle.java | 41 -----
.../util/OrganizationGlobalizationUtil.java | 24 +--
.../util/OrganizationResourceBundle.java | 39 -----
.../util/PersonGlobalizationUtil.java | 31 +++-
.../util/PersonResourceBundle.java | 35 ----
.../ResearchNetworkGlobalizationUtil.java | 40 ++++-
.../ResearchNetworkResourceBundle.java | 22 ---
.../util/SimpleAddressGlobalizationUtil.java | 24 +--
.../util/SimpleAddressResourceBundle.java | 42 -----
.../util/SiteProxyGlobalizationUtil.java | 25 +--
.../util/SiteProxyResourceBundle.java | 47 -----
.../util/SurveyGlobalizationUtil.java | 42 +++--
.../util/SurveyResourceBundle.java | 17 --
.../util/ContenttypesGlobalizationUtil.java | 29 +++-
.../util/ContenttypesResourceBundle.java | 9 +
.../cms/ui/item/ItemLanguagesTable.java | 2 +-
.../arsdigita/cms/util/CMSResourceBundle.java | 10 ++
.../cms/util/CMSResourceBundle_de.java | 10 --
.../cms/util/CMSResourceBundle_en_GB.java | 10 --
.../cms/util/CMSResourceBundle_fr.java | 10 --
.../arsdigita/cms/util/GlobalizationUtil.java | 49 +++---
.../cms/util/GlobalizationUtilOld.java | 81 +++++++++
.../ChainableResourceBundle.java | 8 +-
.../globalization/ChainedResourceBundle.java | 12 ++
.../LegacyInitializer.java.nolongerInUse | 162 ------------------
.../globalization/MessageCatalog.java | 132 ++++++--------
.../globalization/MixedResourceBundle.java | 81 ++++-----
.../util/ContactGlobalizationUtil.java | 21 ++-
.../util/ContactResourceBundle.java | 44 -----
.../util/ESDServiceGlobalizationUtil.java | 47 ++---
.../util/ESDServiceResourceBundle.java | 42 -----
.../util/GlobalizationUtil.java | 41 ++++-
.../themedirector/util/GlobalizationUtil.java | 16 +-
61 files changed, 694 insertions(+), 1224 deletions(-)
create mode 100755 ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ImageStepResources_en.properties
delete mode 100755 ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaResourceBundle.java
create mode 100755 ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties
delete mode 100755 ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java
create mode 100755 ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemResources_de.properties
delete mode 100755 ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQResourceBundle.java
delete mode 100755 ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryResourceBundle.java
delete mode 100644 ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityResourceBundle.java
delete mode 100644 ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageResourceBundle.java
delete mode 100644 ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberResourceBundle.java
delete mode 100755 ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDResourceBundle.java
delete mode 100755 ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MultiPartArticleResourceBundle.java
delete mode 100755 ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemResourceBundle.java
delete mode 100755 ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationResourceBundle.java
delete mode 100644 ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonResourceBundle.java
delete mode 100644 ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkResourceBundle.java
delete mode 100755 ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressResourceBundle.java
delete mode 100755 ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyResourceBundle.java
delete mode 100755 ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyResourceBundle.java
delete mode 100644 ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_de.java
delete mode 100644 ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_en_GB.java
delete mode 100644 ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_fr.java
create mode 100755 ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtilOld.java
delete mode 100755 ccm-core/src/com/arsdigita/globalization/LegacyInitializer.java.nolongerInUse
delete mode 100755 ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactResourceBundle.java
delete mode 100755 ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceResourceBundle.java
diff --git a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentGlobalize.java b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentGlobalize.java
index e7f3b681a..22fa12f0a 100644
--- a/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentGlobalize.java
+++ b/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/FileAttachmentGlobalize.java
@@ -18,7 +18,7 @@ package com.arsdigita.cms.contentassets;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- * Service routine tp provide localized versions of key strings for the
+ * Service routine to provide localized versions of key strings for the
* FileAttachment UI and messages.
*
* @author pb
diff --git a/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ImageStepResources_en.properties b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ImageStepResources_en.properties
new file mode 100755
index 000000000..aa3cf0ed3
--- /dev/null
+++ b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ImageStepResources_en.properties
@@ -0,0 +1,2 @@
+com.arsdigita.cms.contentassets.image_step_label=Add Images
+com.arsdigita.cms.contentassets.image_step_description=Add Images
diff --git a/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java
index e2326486c..2ce871111 100644
--- a/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java
+++ b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageComponentAttachListener.java
@@ -1,7 +1,22 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright (C) 2004-2012 Sören Bernstein, Universität Bremen. All Rights Reserved.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
*/
+
package com.arsdigita.cms.contentassets.ui;
import com.arsdigita.bebop.MapComponentSelectionModel;
@@ -24,15 +39,20 @@ import org.apache.log4j.Logger;
public class ImageComponentAttachListener extends ImageComponentAbstractListener {
private final ImageStep m_imageStep;
- private static final Logger s_log = Logger.getLogger(ImageComponentAttachListener.class);
+ private static final Logger s_log = Logger.getLogger(
+ ImageComponentAttachListener.class);
- public ImageComponentAttachListener(MapComponentSelectionModel imageComponent, ImageStep imageStep) {
+ public ImageComponentAttachListener(MapComponentSelectionModel imageComponent,
+ ImageStep imageStep) {
super(imageComponent);
m_imageStep = imageStep;
}
@Override
- protected void processImage(FormSectionEvent event, PageState ps, ImageComponent component, ReusableImageAsset image) {
+ protected void processImage(FormSectionEvent event,
+ PageState ps,
+ ImageComponent component,
+ ReusableImageAsset image) {
ContentItem item = m_imageStep.getItem(ps);
if (null == item) {
s_log.error("No item selected in ImageStepEdit",
diff --git a/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageStep.java b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageStep.java
index e8fa2a235..c9001e917 100755
--- a/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageStep.java
+++ b/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageStep.java
@@ -44,7 +44,6 @@ import org.apache.log4j.Logger;
* @author unknown
* @author Sören Bernstein (quasimodo)
*/
-
public class ImageStep extends SecurityPropertyEditor {
private static final Logger s_log = Logger.getLogger(ImageStep.class);
diff --git a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/ui/PublicPersonalProfileGlobalizationUtil.java b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/ui/PublicPersonalProfileGlobalizationUtil.java
index 7d6b225bb..2c2b3b9b2 100644
--- a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/ui/PublicPersonalProfileGlobalizationUtil.java
+++ b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/ui/PublicPersonalProfileGlobalizationUtil.java
@@ -1,21 +1,54 @@
+/*
+ * Copyright (C) 2010-2013 Jens Pelzetter All Rights Reserved.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.globalization.GlobalizedMessage;
/**
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author Jens Pelzetter
* @version $Id$
*/
public class PublicPersonalProfileGlobalizationUtil {
+ /** Name of Java resource files to handle PPP's globalisation. */
public static final String BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.ui.PublicPersonalProfileResources";
+ /**
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
+ */
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
+ /**
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
+ */
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
}
diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java
index ca88af066..40867b76f 100755
--- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java
+++ b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaGlobalizationUtil.java
@@ -18,22 +18,23 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
-public class AgendaGlobalizationUtil {
+public class AgendaGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle Agenda's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.AgendaResourceBundle";
+ "com.arsdigita.cms.contenttypes.AgendaResources";
/**
* This returns a globalized message using the type specific bundle,
@@ -44,8 +45,9 @@ public class AgendaGlobalizationUtil {
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaResourceBundle.java b/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaResourceBundle.java
deleted file mode 100755
index 8955c7c22..000000000
--- a/ccm-cms-types-agenda/src/com/arsdigita/cms/contenttypes/util/AgendaResourceBundle.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Form to edit the basic properties of an event. This form can be extended to
- * create forms for Event subclasses.
- **/
-public class AgendaResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String AGENDA_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.AgendaResources";
-
- public AgendaResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(AGENDA_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties
new file mode 100755
index 000000000..e13d0a048
--- /dev/null
+++ b/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ArticleResources_de.properties
@@ -0,0 +1,2 @@
+article.authoring.image.title=Bild
+article.authoring.image.description=Bild
diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeUtil.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeUtil.java
index 75a2a6537..50ce790b4 100644
--- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeUtil.java
+++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeUtil.java
@@ -18,23 +18,38 @@
*/
package com.arsdigita.cms.contenttypes;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- * Miscellaneous utility methods for the Decision Tree content type.
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author Carsten Clasohm
* @version $Id$
*/
-public class DecisionTreeUtil {
+public class DecisionTreeUtil implements Globalized {
+
+ /** Name of Java resource files to handle DecisionTree's globalisation. */
public static final String BUNDLE_NAME =
- "com.arsdigita.camden.cms.contenttypes.DecisionTreeResources";
+ "com.arsdigita.cms.contenttypes.DecisionTreeResources";
+ /**
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
+ */
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
+ /**
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
+ */
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
}
diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java
index 585997987..5f476203a 100755
--- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java
+++ b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventGlobalizationUtil.java
@@ -19,34 +19,37 @@
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-public class EventGlobalizationUtil {
+public class EventGlobalizationUtil implements Globalized {
- /** Name of the Java class to handle Event's globalisation. */
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.EventResourceBundle";
+ "com.arsdigita.cms.contenttypes.EventResourceBundle";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java b/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java
deleted file mode 100755
index 6b8660620..000000000
--- a/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/util/EventResourceBundle.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import com.arsdigita.cms.util.CMSGlobalized;
-import com.arsdigita.globalization.ChainedResourceBundle;
-
-import java.util.PropertyResourceBundle;
-
-/**
- * Resource Bundle used in UI for Event ContentType.
- *
- * @author Shashin Shinde (sshinde@redhat.com)
- */
-public class EventResourceBundle extends ChainedResourceBundle
- implements CMSGlobalized {
-
- public final static String EVENT_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.EventResources";
-
- public EventResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(EVENT_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemResources_de.properties b/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemResources_de.properties
new file mode 100755
index 000000000..a79d47af5
--- /dev/null
+++ b/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/FAQItemResources_de.properties
@@ -0,0 +1,4 @@
+faq_item.authoring.basic_properties.description=Frage und Antwort bearbeiten
+cms.contenttypes.ui.faq.question=Frage:
+cms.contenttypes.ui.faq.answer=Antwort:
+cms.contenttypes.ui.faq.sectionName=Abschnitt
diff --git a/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQGlobalizationUtil.java b/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQGlobalizationUtil.java
index 7826a431f..9278c1955 100755
--- a/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQGlobalizationUtil.java
+++ b/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQGlobalizationUtil.java
@@ -18,34 +18,37 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-public class FAQGlobalizationUtil {
+public class FAQGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle FAQ's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.FAQResourceBundle";
+ "com.arsdigita.cms.contenttypes.FAQItemResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQResourceBundle.java b/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQResourceBundle.java
deleted file mode 100755
index 0f7c72a63..000000000
--- a/ccm-cms-types-faqitem/src/com/arsdigita/cms/contenttypes/util/FAQResourceBundle.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Form to edit the basic properties of an event. This form can be extended to
- * create forms for Event subclasses.
- **/
-public class FAQResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String FAQ_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.FAQItemResources";
-
- public FAQResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(FAQ_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryGlobalizationUtil.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryGlobalizationUtil.java
index cb6c4818e..1d94127a2 100755
--- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryGlobalizationUtil.java
+++ b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryGlobalizationUtil.java
@@ -18,34 +18,36 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
-public class GlossaryGlobalizationUtil {
+public class GlossaryGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle Glossary's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.GlossaryResourceBundle";
+ "com.arsdigita.cms.contenttypes.GlossaryResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryResourceBundle.java b/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryResourceBundle.java
deleted file mode 100755
index ffe39573d..000000000
--- a/ccm-cms-types-glossaryitem/src/com/arsdigita/cms/contenttypes/util/GlossaryResourceBundle.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Form to edit the basic properties of an event. This form can be extended to
- * create forms for Event subclasses.
- **/
-public class GlossaryResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String GLOSSARY_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.GlossaryResources";
-
- public GlossaryResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(GLOSSARY_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityGlobalizationUtil.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityGlobalizationUtil.java
index 9122e9ce8..9ae3d9068 100644
--- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityGlobalizationUtil.java
+++ b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityGlobalizationUtil.java
@@ -18,34 +18,36 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
-public class HealthCareFacilityGlobalizationUtil {
+public class HealthCareFacilityGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle HealthCare's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.HealthCareFacilityResourceBundle";
+ "com.arsdigita.cms.contenttypes.HealthCareFacilityResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityResourceBundle.java b/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityResourceBundle.java
deleted file mode 100644
index 7b5e299ea..000000000
--- a/ccm-cms-types-healthCareFacility/src/com/arsdigita/cms/contenttypes/util/HealthCareFacilityResourceBundle.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Form to edit the basic properties of an event. This form can be extended to
- * create forms for Event subclasses.
- **/
-public class HealthCareFacilityResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String HEALTH_CARE_FACILITY_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.HealthCareFacilityResources";
-
- public HealthCareFacilityResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(HEALTH_CARE_FACILITY_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageGlobalizationUtil.java b/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageGlobalizationUtil.java
index 506a9bc17..2dd020bc1 100644
--- a/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageGlobalizationUtil.java
+++ b/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageGlobalizationUtil.java
@@ -18,25 +18,34 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
-public class ImageGlobalizationUtil {
-
+/**
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
+ *
+ */
+public class ImageGlobalizationUtil implements Globalized {
+
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.ImageResourceBundle";
-
+ "com.arsdigita.cms.contenttypes.ImageResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageResourceBundle.java b/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageResourceBundle.java
deleted file mode 100644
index 2c5e158f2..000000000
--- a/ccm-cms-types-image/src/com/arsdigita/cms/contenttypes/util/ImageResourceBundle.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Resource Bundle used in UI for Image ContentType.
- */
-public class ImageResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String IMAGE_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.ImageResources";
-
- public ImageResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(IMAGE_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java
index c1bc43a04..749991298 100644
--- a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java
+++ b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/Member.java
@@ -33,7 +33,8 @@ import java.math.BigDecimal;
public class Member extends GenericPerson {
/** Data object type for this domain object */
- public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Member";
+ public static final String BASE_DATA_OBJECT_TYPE =
+ "com.arsdigita.cms.contenttypes.Member";
/**
* Default constructor. This creates a new (empty) Member.
diff --git a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberGlobalizationUtil.java b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberGlobalizationUtil.java
index f565a8247..3dd11de44 100644
--- a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberGlobalizationUtil.java
+++ b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberGlobalizationUtil.java
@@ -19,11 +19,21 @@
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
-public class MemberGlobalizationUtil {
+/**
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
+ *
+ */
+public class MemberGlobalizationUtil implements Globalized {
+
+ /** Name of Java resource files to handle Member's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.MemberResourceBundle";
+ "com.arsdigita.cms.contenttypes.MemberResources";
public static GlobalizedMessage globalize (String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
diff --git a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberResourceBundle.java b/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberResourceBundle.java
deleted file mode 100644
index ce0ea0639..000000000
--- a/ccm-cms-types-member/src/com/arsdigita/cms/contenttypes/util/MemberResourceBundle.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-public class MemberResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
- public static final String MEMBER_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.MemberResources";
-
- public MemberResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(MEMBER_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
\ No newline at end of file
diff --git a/ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDGlobalizationUtil.java b/ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDGlobalizationUtil.java
index f31fdd8bc..f9aab8005 100755
--- a/ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDGlobalizationUtil.java
+++ b/ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDGlobalizationUtil.java
@@ -16,37 +16,41 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-public class MOTDGlobalizationUtil {
+public class MOTDGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.MOTDResourceBundle";
-
+ "com.arsdigita.cms.contenttypes.MOTDResources";
+
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDResourceBundle.java b/ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDResourceBundle.java
deleted file mode 100755
index 2cfa68104..000000000
--- a/ccm-cms-types-motditem/src/com/arsdigita/cms/contenttypes/util/MOTDResourceBundle.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Form to edit the basic properties of an motd. This form can be extended to
- * create forms for Motd subclasses.
- **/
-public class MOTDResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String MOTD_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.MOTDResources";
-
- public MOTDResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(MOTD_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MPArticleGlobalizationUtil.java b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MPArticleGlobalizationUtil.java
index 03ef198b2..4b3f2ea96 100755
--- a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MPArticleGlobalizationUtil.java
+++ b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MPArticleGlobalizationUtil.java
@@ -18,34 +18,36 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
-public class MPArticleGlobalizationUtil {
+public class MPArticleGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.MultiPartArticleResourceBundle";
+ "com.arsdigita.cms.contenttypes.MultiPartArticleResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MultiPartArticleResourceBundle.java b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MultiPartArticleResourceBundle.java
deleted file mode 100755
index d3bfe0884..000000000
--- a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/util/MultiPartArticleResourceBundle.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Form to edit the basic properties of an event. This form can be extended to
- * create forms for Event subclasses.
- **/
-public class MultiPartArticleResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String MPARTICLE_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.MultiPartArticleResources";
-
- public MultiPartArticleResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(MPARTICLE_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java
index 375e8762b..107135659 100755
--- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java
+++ b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemGlobalizationUtil.java
@@ -18,35 +18,38 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
*
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
-public class NewsItemGlobalizationUtil {
+public class NewsItemGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle NewsItem's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.NewsItemResourceBundle";
+ "com.arsdigita.cms.contenttypes.NewsItemResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemResourceBundle.java b/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemResourceBundle.java
deleted file mode 100755
index da3a070cc..000000000
--- a/ccm-cms-types-newsitem/src/com/arsdigita/cms/contenttypes/util/NewsItemResourceBundle.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Resource Bundle used in UI for Newsitem ContentType.
- *
- * @author Shashin Shinde sshinde@redhat.com
- *
- */
-public class NewsItemResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String NEWSITEM_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.NewsItemResources";
-
- public NewsItemResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(NEWSITEM_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationGlobalizationUtil.java b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationGlobalizationUtil.java
index bed9ed99a..34f9d2347 100755
--- a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationGlobalizationUtil.java
+++ b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationGlobalizationUtil.java
@@ -18,34 +18,36 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
-public class OrganizationGlobalizationUtil {
+public class OrganizationGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.OrganizationResourceBundle";
+ "com.arsdigita.cms.contenttypes.OrganizationResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationResourceBundle.java b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationResourceBundle.java
deleted file mode 100755
index 453790562..000000000
--- a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/util/OrganizationResourceBundle.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Form to edit the basic properties of an event. This form can be extended to
- * create forms for Event subclasses.
- **/
-public class OrganizationResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String ORGANIZATION_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.OrganizationResources";
-
- public OrganizationResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(ORGANIZATION_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonGlobalizationUtil.java b/ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonGlobalizationUtil.java
index 8d51027e7..c510bc350 100644
--- a/ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonGlobalizationUtil.java
+++ b/ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonGlobalizationUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
+ * Copyright (C) 2009 Jens Pelzetter, Center of Social Politic Research, University of Bremen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -19,17 +19,36 @@
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
-public class PersonGlobalizationUtil {
- final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.PersonResourceBundle";
+/**
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
+ *
+ */
+public class PersonGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
+ final public static String BUNDLE_NAME =
+ "com.arsdigita.cms.contenttypes.PersonResources";
+
+ /**
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
+ */
public static GlobalizedMessage globalize (String key) {
- return new GlobalizedMessage(key, BUNDLE_NAME);
+ return new GlobalizedMessage(key, BUNDLE_NAME);
}
+ /**
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
+ */
public static GlobalizedMessage globalize (String key, Object[] args) {
- return new GlobalizedMessage(key, BUNDLE_NAME, args);
+ return new GlobalizedMessage(key, BUNDLE_NAME, args);
}
}
\ No newline at end of file
diff --git a/ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonResourceBundle.java b/ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonResourceBundle.java
deleted file mode 100644
index 4cb1ad2c8..000000000
--- a/ccm-cms-types-person/src/com/arsdigita/cms/contenttypes/util/PersonResourceBundle.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-public class PersonResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
- public static final String PERSON_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.PersonResources";
-
- public PersonResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(PERSON_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
\ No newline at end of file
diff --git a/ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkGlobalizationUtil.java b/ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkGlobalizationUtil.java
index 4d3011e04..7c43a4bbc 100644
--- a/ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkGlobalizationUtil.java
+++ b/ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkGlobalizationUtil.java
@@ -1,27 +1,53 @@
+/*
+ * Copyright (C) 2010-2013 Jens Pelzetter, University of Bremen. All Rights Reserved.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
package com.arsdigita.cms.contenttypes;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
+ *
* @author Jens Pelzetter
*/
-public class ResearchNetworkGlobalizationUtil {
+public class ResearchNetworkGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.ResearchNetworkResourceBundle";
+ "com.arsdigita.cms.contenttypes.ResearchNetworkResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkResourceBundle.java b/ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkResourceBundle.java
deleted file mode 100644
index 1932160c5..000000000
--- a/ccm-cms-types-researchnetwork/src/com/arsdigita/cms/contenttypes/ResearchNetworkResourceBundle.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.arsdigita.cms.contenttypes;
-
-import com.arsdigita.cms.util.CMSGlobalized;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import java.util.PropertyResourceBundle;
-
-/**
- *
- * @author Jens Pelzetter
- */
-public class ResearchNetworkResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String RESEARCH_NETWORK_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.ResearchNetworkResources";
-
- public ResearchNetworkResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(RESEARCH_NETWORK_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-
-}
diff --git a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressGlobalizationUtil.java b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressGlobalizationUtil.java
index d57008c93..9b61da8d0 100755
--- a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressGlobalizationUtil.java
+++ b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressGlobalizationUtil.java
@@ -18,34 +18,36 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author randyg@arsdigita.com
* @version $Revision: #4 $ $Date: 2004/08/17 $
*/
-
-public class SimpleAddressGlobalizationUtil {
+public class SimpleAddressGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.SimpleAddressResourceBundle";
+ "com.arsdigita.cms.contenttypes.SimpleAddressResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressResourceBundle.java b/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressResourceBundle.java
deleted file mode 100755
index e4d8ef67d..000000000
--- a/ccm-cms-types-simpleaddress/src/com/arsdigita/cms/contenttypes/util/SimpleAddressResourceBundle.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Resource Bundle used in UI for Address ContentType.
- *
- * @author Shashin Shinde sshinde@redhat.com
- *
- */
-public class SimpleAddressResourceBundle extends ChainedResourceBundle
- implements CMSGlobalized {
-
- public final static String ADDRESS_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.SimpleAddressResources";
-
- public SimpleAddressResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(ADDRESS_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyGlobalizationUtil.java b/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyGlobalizationUtil.java
index 8cd73ba6a..43bda121d 100755
--- a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyGlobalizationUtil.java
+++ b/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyGlobalizationUtil.java
@@ -18,35 +18,36 @@
*/
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * Contains methods to simplify globalizing keys related to SiteProxy
- * ContentType object.
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author Shashin Shinde sshinde@redhat.com
- *
* @version $Id: SiteProxyGlobalizationUtil.java 287 2005-02-22 00:29:02Z sskracic $
- *
*/
-public class SiteProxyGlobalizationUtil {
+public class SiteProxyGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.SiteProxyResourceBundle";
+ "com.arsdigita.cms.contenttypes.SiteProxyResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyResourceBundle.java b/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyResourceBundle.java
deleted file mode 100755
index b8150b637..000000000
--- a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/util/SiteProxyResourceBundle.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-
-import com.arsdigita.globalization.ChainedResourceBundle;
-
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- *
- * Resource Bundle used in UI for SiteProxy ContentType.
- *
- * @author Shashin Shinde sshinde@redhat.com
- *
- * @version $Id: SiteProxyResourceBundle.java 287 2005-02-22 00:29:02Z sskracic $
- *
- */
-public class SiteProxyResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String CONTACT_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.SiteProxyResources";
-
- public SiteProxyResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(CONTACT_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-
-}
diff --git a/ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyGlobalizationUtil.java b/ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyGlobalizationUtil.java
index c45335040..46d4cf989 100755
--- a/ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyGlobalizationUtil.java
+++ b/ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyGlobalizationUtil.java
@@ -1,31 +1,53 @@
+/*
+ * Copyright (C) 2011 Sören Bernstein, University of Brfemen. All Rights Reserved.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author Sören Bernstein
*/
-public class SurveyGlobalizationUtil {
+public class SurveyGlobalizationUtil implements Globalized {
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.SurveyResourceBundle";
+ "com.arsdigita.cms.contenttypes.SurveyResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyResourceBundle.java b/ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyResourceBundle.java
deleted file mode 100755
index dfe3ddaea..000000000
--- a/ccm-cms-types-survey/src/com/arsdigita/cms/contenttypes/util/SurveyResourceBundle.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.arsdigita.cms.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-import com.arsdigita.globalization.ChainedResourceBundle;
-import com.arsdigita.cms.util.CMSGlobalized;
-
-public class SurveyResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String SURVEY_BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.SurveyResources";
-
- public SurveyResourceBundle() {
- super();
- addBundle((PropertyResourceBundle) getBundle(SURVEY_BUNDLE_NAME));
- addBundle((PropertyResourceBundle) getBundle(BUNDLE_NAME));
- }
-}
diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesGlobalizationUtil.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesGlobalizationUtil.java
index 0d7c8b3b8..ff83a4d14 100644
--- a/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesGlobalizationUtil.java
+++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesGlobalizationUtil.java
@@ -19,17 +19,38 @@
package com.arsdigita.cms.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
-public class ContenttypesGlobalizationUtil {
+/**
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
+ *
+ * @author randyg@arsdigita.com
+ * @version $Revision: #4 $ $Date: 2004/08/17 $
+ */
+public class ContenttypesGlobalizationUtil implements Globalized {
+
+ /** Name of Java resource files to handle CMS's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.cms.contenttypes.util.ContenttypesResourceBundle";
+ "com.arsdigita.cms.contenttypes.ContenttypesResources";
+ /**
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
+ */
public static GlobalizedMessage globalize (String key) {
- return new GlobalizedMessage(key, BUNDLE_NAME);
+ return new GlobalizedMessage(key, BUNDLE_NAME);
}
+ /**
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
+ */
public static GlobalizedMessage globalize (String key, Object[] args) {
- return new GlobalizedMessage(key, BUNDLE_NAME, args);
+ return new GlobalizedMessage(key, BUNDLE_NAME, args);
}
}
\ No newline at end of file
diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesResourceBundle.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesResourceBundle.java
index 9669965cd..1f65edfcc 100644
--- a/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesResourceBundle.java
+++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/util/ContenttypesResourceBundle.java
@@ -23,6 +23,15 @@ import java.util.PropertyResourceBundle;
import com.arsdigita.globalization.ChainedResourceBundle;
import com.arsdigita.cms.util.CMSGlobalized;
+
+
+// Developers Note (2013-04):
+// No longer used because we found no way to make localization work properly.
+// Back to use plain property files as of 2013-04 (version 6.6.8)
+// Retained for easy reference to further develop localization infrastructure.
+
+
+
public class ContenttypesResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
public static final String MEMBER_BUNDLE_NAME =
"com.arsdigita.cms.contenttypes.ContenttypesResources";
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java b/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java
index a9c5a33a3..266fcec2a 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/item/ItemLanguagesTable.java
@@ -42,7 +42,7 @@ import java.math.BigDecimal;
import org.apache.log4j.Logger;
/**
- * Displays a list of all language instances of an item.
+ * Displays a list of all language instances of an item.
*
*/
public class ItemLanguagesTable extends DataTable {
diff --git a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle.java b/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle.java
index a94f559a5..3d434d6be 100755
--- a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle.java
+++ b/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle.java
@@ -23,6 +23,13 @@ import com.arsdigita.globalization.ChainedResourceBundle;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
+
+// Developers Note (2013-04):
+// No longer used because we found no way to make localization work properly.
+// Back to use plain property files as of 2013-04 (version 6.6.8)
+// Retained for easy reference to further develop localization infrastructure.
+
+
/**
* Main ResourceBundle for CMS UI.
* Can be extended using:
@@ -34,6 +41,9 @@ public class CMSResourceBundle extends ChainedResourceBundle implements CMSGloba
public CMSResourceBundle() {
super();
+ // addBundle((PropertyResourceBundle) getBundle(BUNDLE_NAME));
+
+ // try to make proper localisation work, no success, ne regression either
addBundle((PropertyResourceBundle) getBundle(BUNDLE_NAME,
ResourceBundle.Control.getNoFallbackControl(
ResourceBundle.Control.FORMAT_DEFAULT)));
diff --git a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_de.java b/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_de.java
deleted file mode 100644
index 1fd809bf5..000000000
--- a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_de.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.arsdigita.cms.util;
-
-/**
- *
- * @author Jens Pelzetter
- * @version $Id$
- */
-public class CMSResourceBundle_de extends CMSResourceBundle {
-
-}
diff --git a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_en_GB.java b/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_en_GB.java
deleted file mode 100644
index a46e69062..000000000
--- a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_en_GB.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.arsdigita.cms.util;
-
-/**
- *
- * @author Jens Pelzetter
- * @version $Id$
- */
-public class CMSResourceBundle_en_GB extends CMSResourceBundle {
-
-}
diff --git a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_fr.java b/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_fr.java
deleted file mode 100644
index c0edadc50..000000000
--- a/ccm-cms/src/com/arsdigita/cms/util/CMSResourceBundle_fr.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.arsdigita.cms.util;
-
-/**
- *
- * @author Jens Pelzetter
- * @version $Id$
- */
-public class CMSResourceBundle_fr extends CMSResourceBundle {
-
-}
diff --git a/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java b/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java
index d98fa6f68..35c30fac9 100755
--- a/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java
+++ b/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtil.java
@@ -16,58 +16,53 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
package com.arsdigita.cms.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * .
- * Contains methods to simplify globalizing keys
- *
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
+ *
* @author yon@arsdigita.com
* @version $Revision: #7 $ $Date: 2004/08/17 $
*/
-public class GlobalizationUtil {
+public class GlobalizationUtil implements Globalized {
- /** Name of the Java class to handle CMS's globalisation. */
- //public static String s_bundleName = "com.arsdigita.cms.util.CMSResourceBundle";
- public static String s_bundleName = "com.arsdigita.cms.CMSResources";
+ /** Name of Java resource files to handle CMS's globalisation. */
+ private static final String BUNDLE_NAME = "com.arsdigita.cms.CMSResources";
/**
- * This returns a globalized message using the package specific bundle,
- * provided by method getBundleName()
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
- return new GlobalizedMessage(key, getBundleName());
+ return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
* Returns a globalized message object, using the package specific bundle,
- * provided by method getBundleName(). Also takes in an Object[] of
- * arguments to interpolate into the retrieved message using the
- * MessageFormat class.
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
- return new GlobalizedMessage(key, getBundleName(), args);
+ return new GlobalizedMessage(key, BUNDLE_NAME, args);
}
/**
* Returns the name of the package specific resource bundle.
- * @return
+ *
+ * Used e.g. by com.arsdigita.cms.ui.item.ItemLanguageTable to get the
+ * bundle tp pass to DataTable.
+ *
+ * @return Name of resource bundle as String
*/
public static String getBundleName() {
- return s_bundleName;
- }
-
- /*
- * Not a part of API. Otherwise it would need to be properly synchronized.
- * Only meant be used to override resource keys in CMSResources
- * by a custom application, in Initializer.
- */
- public static void internalSetBundleName(String bundleName) {
- s_bundleName = bundleName;
+ return BUNDLE_NAME;
}
}
diff --git a/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtilOld.java b/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtilOld.java
new file mode 100755
index 000000000..09ca063fc
--- /dev/null
+++ b/ccm-cms/src/com/arsdigita/cms/util/GlobalizationUtilOld.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.util;
+
+import com.arsdigita.globalization.GlobalizedMessage;
+
+
+// Developers Note:
+// Counterpart to CMSResourceBundle java class.
+// No longer used because we couldn't find a way to make proper localization
+// work.
+// Retained for easy reference to further develop localization infrastructure.
+
+
+/**
+ *
+ * .
+ * Contains methods to simplify globalizing keys
+ *
+ *
+ * @author yon@arsdigita.com
+ * @version $Revision: #7 $ $Date: 2004/08/17 $
+ */
+public class GlobalizationUtilOld {
+
+ /** Name of the Java class to handle CMS's globalisation. */
+ //public static String s_bundleName = "com.arsdigita.cms.util.CMSResourceBundle";
+ public static String s_bundleName = "com.arsdigita.cms.CMSResources";
+
+ /**
+ * This returns a globalized message using the package specific bundle,
+ * provided by method getBundleName()
+ */
+ public static GlobalizedMessage globalize(String key) {
+ return new GlobalizedMessage(key, getBundleName());
+ }
+
+ /**
+ * Returns a globalized message object, using the package specific bundle,
+ * provided by method getBundleName(). Also takes in an Object[] of
+ * arguments to interpolate into the retrieved message using the
+ * MessageFormat class.
+ */
+ public static GlobalizedMessage globalize(String key, Object[] args) {
+ return new GlobalizedMessage(key, getBundleName(), args);
+ }
+
+ /**
+ * Returns the name of the package specific resource bundle.
+ * @return
+ */
+ public static String getBundleName() {
+ return s_bundleName;
+ }
+
+ /*
+ * Not a part of API. Otherwise it would need to be properly synchronized.
+ * Only meant be used to override resource keys in CMSResources
+ * by a custom application, in Initializer.
+ */
+ public static void internalSetBundleName(String bundleName) {
+ s_bundleName = bundleName;
+ }
+
+}
diff --git a/ccm-core/src/com/arsdigita/globalization/ChainableResourceBundle.java b/ccm-core/src/com/arsdigita/globalization/ChainableResourceBundle.java
index b2070ded6..cc0d62ccb 100755
--- a/ccm-core/src/com/arsdigita/globalization/ChainableResourceBundle.java
+++ b/ccm-core/src/com/arsdigita/globalization/ChainableResourceBundle.java
@@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
package com.arsdigita.globalization;
import java.util.Enumeration;
@@ -39,10 +40,9 @@ public interface ChainableResourceBundle {
public Object handleGetObject(String key);
/**
- * This is the public version of ResourceBundle.getKeys()
- * which normally has protected access. If you have a PropertyResourceBundle
- * or a ListResourceBundle, this will simply delegate to the
- * getKeys() method.
+ * This is the public version of ResourceBundle.getKeys() which normally has
+ * protected access. If you have a PropertyResourceBundle or a
+ * ListResourceBundle, this will simply delegate to the getKeys() method.
*
* @return
*/
diff --git a/ccm-core/src/com/arsdigita/globalization/ChainedResourceBundle.java b/ccm-core/src/com/arsdigita/globalization/ChainedResourceBundle.java
index e3183d369..66b670d07 100755
--- a/ccm-core/src/com/arsdigita/globalization/ChainedResourceBundle.java
+++ b/ccm-core/src/com/arsdigita/globalization/ChainedResourceBundle.java
@@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
package com.arsdigita.globalization;
import java.util.Collections;
@@ -27,6 +28,14 @@ import java.util.ListResourceBundle;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
+
+// Developers Note (2013-04):
+// No longer used because we found no way to make localization work properly.
+// Back to use plain property files as of 2013-04 (version 6.6.8)
+// Retained for easy reference to further develop localization infrastructure.
+// Should be completely removed in the future.
+
+
/**
* This is a ResourceBundle that allows the developer to add additional
* ChainableResourceBundles to it. Then, when the bundle is asked for
@@ -47,6 +56,9 @@ public class ChainedResourceBundle extends ResourceBundle {
private final List bundles;
private final List keys;
+ /**
+ * Constructor to create a new ChainedResourceBundle.
+ */
public ChainedResourceBundle() {
super();
bundles = new LinkedList();
diff --git a/ccm-core/src/com/arsdigita/globalization/LegacyInitializer.java.nolongerInUse b/ccm-core/src/com/arsdigita/globalization/LegacyInitializer.java.nolongerInUse
deleted file mode 100755
index 271123f67..000000000
--- a/ccm-core/src/com/arsdigita/globalization/LegacyInitializer.java.nolongerInUse
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.globalization;
-
-import com.arsdigita.initializer.Configuration;
-import com.arsdigita.initializer.InitializationException;
-import com.arsdigita.persistence.DataCollection;
-import com.arsdigita.persistence.SessionManager;
-import com.arsdigita.persistence.TransactionContext;
-
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-/**
- * Initialize the Globalization package
- *
- * Old initializer system. Needs LegacyInitializer as glue to invoke.
- *
- * @version $Revision: #15 $ $Date: 2004/08/16 $
- */
-public class LegacyInitializer implements com.arsdigita.initializer.Initializer {
-
- private static final String DEFAULT_CHARSET = "defaultCharset";
- private static final String CHARSETS = "charsets";
- private static final String LOCALES = "locales";
-
- private static final Logger s_log = Logger.getLogger(LegacyInitializer.class);
-
- private Configuration m_conf = new Configuration();
-
- public LegacyInitializer() throws InitializationException {
- m_conf.initParameter
- (CHARSETS,
- "Recognized character sets",
- List.class);
-
- m_conf.initParameter
- (LOCALES,
- "Recognized locales",
- List.class);
-
- m_conf.initParameter
- (DEFAULT_CHARSET,
- "Default character set for locales not listed",
- String.class);
- }
-
- public Configuration getConfiguration() {
- return m_conf;
- }
-
- public void startup() throws InitializationException {
- TransactionContext txn = SessionManager.getSession().
- getTransactionContext();
- txn.beginTxn();
-
- // if ( ! isLoaded() ) {
- // s_log.info("Globalization Initializer is loading.");
- // load();
- // }
- LocaleNegotiator.setApplicationLocaleProvider
- (new ApplicationLocaleProvider());
- LocaleNegotiator.setClientLocaleProvider(new ClientLocaleProvider());
- LocaleNegotiator.setSystemLocaleProvider(new SystemLocaleProvider());
-
- String defaultCharset = (String)m_conf.getParameter(DEFAULT_CHARSET);
-
- Globalization.setDefaultCharset(defaultCharset);
-
- txn.commitTxn();
- }
-
- public void shutdown() {}
-
- private static boolean isLoaded() {
- DataCollection charsets = SessionManager.getSession().
- retrieve(Charset.BASE_DATA_OBJECT_TYPE);
- boolean result = (charsets.size() > 0);
- charsets.close();
- return result;
- }
-
- private void load() throws InitializationException {
- List charsets = (List) m_conf.getParameter(CHARSETS);
- if ( charsets == null ) {
- throw new InitializationException
- ("You must specify at least one charset in the \"" + CHARSETS +
- "\" parameter of the globalization initaliazer in the init " +
- " file. ISO-8859-1 would be a good first choice.");
- }
-
- Map charsetMap = new HashMap();
-
- for (Iterator i=charsets.iterator(); i.hasNext(); ) {
- String charsetName = (String) i.next();
-
- // Check if this is a valid charset. Is there a better way to do
- // this? - vadimn@redhat.com, Mon 2002-07-29 14:47:41 -0400
- try {
- new OutputStreamWriter(new ByteArrayOutputStream(), charsetName);
- } catch (UnsupportedEncodingException ex) {
- throw new InitializationException
- (charsetName + " is not a supported charset", ex);
- }
- Charset charset = new Charset();
- charset.setCharset(charsetName);
- charset.save();
- charsetMap.put(charsetName, charset);
- }
-
- List locales = (List) m_conf.getParameter(LOCALES);
-
- if ( locales == null ) {
- throw new InitializationException
- ("You must specify at least one locale in the \"" + LOCALES +
- "\" parameter of the globalization initializer section of " +
- "the init file. The \"en\" locale is probably required.");
- }
-
- for (Iterator i=locales.iterator(); i.hasNext(); ) {
- List localeData = (List) i.next();
- String language = (String) localeData.get(0);
- String country = (String) localeData.get(1);
- String variant = (String) localeData.get(2);
- String charsetName = (String) localeData.get(3);
- Locale locale = new Locale(language, country, variant);
-
- Charset defaultCharset = (Charset) charsetMap.get(charsetName);
- if ( defaultCharset == null ) {
- throw new InitializationException
- ("You must list " + charsetName + " in the \"" + CHARSETS +
- "\" parameter before using it in the \"" + LOCALES +
- "\" parameter.");
- }
- locale.setDefaultCharset(defaultCharset);
- locale.save();
- }
- }
-}
diff --git a/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java b/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java
index df942a14e..0668a5ca8 100755
--- a/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java
+++ b/ccm-core/src/com/arsdigita/globalization/MessageCatalog.java
@@ -37,18 +37,34 @@ import java.util.Date;
import java.util.Map;
import org.apache.log4j.Logger;
+// Most of the documentation reconstructed from code by pboy (2013-04)
/**
- *
- * MessageCatalog DomainObject comprised of:
- *
- *
+ * MessageCatalog DomainObject. It is comprised of:
*
* - name
* - locale
* - catalog
*
- *
*
+ * (pboy):
+ * A MessageCatalog object is a complete representation of the well known
+ * property file for a resource bundle.
+ *
+ * - name is analog to the (base) name of a property file for resource
+ * bundles. If used in conjunction with MixedResourceBundle
+ * (which might be the only intended use) name will be the
+ * class name of a child of MixedResourceBundle.
+ * - locale is analog to locale part of the property file name
+ * - catalog is a complete map of key/value pairs, analog to the content
+ * of a property file.
+ *
+ * Each MessageCatalog object is stored in one row in a database table with
+ * catalog as a BLOB field.
+ *
+ * The MessageCatalog is a pure storage backend for a java resource bundle
+ * class (like MixedResourceBundle) as an alternative or supplement to a set
+ * of property files (where each proerty file is a row in the database table).
+ *
* @version $Revision: #14 $ $Date: 2004/08/16 $
* @version $Id: MessageCatalog.java 287 2005-02-22 00:29:02Z sskracic $
*/
@@ -59,16 +75,13 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
Logger.getLogger(MessageCatalog.class.getName());
public final static String BASE_DATA_OBJECT_TYPE =
- "com.arsdigita.globalization.MessageCatalog";
+ "com.arsdigita.globalization.MessageCatalog";
private boolean m_isReadOnly = true;
/**
- *
* Constructor for a new root MessageCatalog.
- *
*
* @param name The name for this new MessageCatalog
- *
*/
public MessageCatalog(String name) {
super(BASE_DATA_OBJECT_TYPE);
@@ -77,14 +90,11 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Constructor for a new MessageCatalog associated with a particular
* Locale.
- *
*
* @param name The name for this new MessageCatalog
* @param locale The locale associated with this MessageCatalog
- *
*/
public MessageCatalog(String name, java.util.Locale locale)
throws GlobalizationException {
@@ -94,18 +104,16 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Constructor for retrieving a MessageCatalog.
- *
*
* @param dataObject The dataObject for this MessageCatalog
- *
*/
private MessageCatalog(DataObject dataObject) {
super(dataObject);
}
+ @Override
protected void initialize() {
super.initialize();
if (isNew() && getID() == null) {
@@ -119,11 +127,9 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Returns the appropriate object type for a MessageCatalog so that the
* proper type validation can take place when retrieving MessageCatalogs
* by OID.
- *
*
* @return String The fully qualified name of the base data object type
* for the MessageCatalog DataObject.
@@ -133,9 +139,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Return ID.
- *
*
* @return BigDecimal The ID of this DataObject
*/
@@ -144,9 +148,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Get the date that this MessageCatalog was last modified.
- *
*
* @return Date representing the date this MessageCatalog was last
* modified.
@@ -156,26 +158,22 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Set the date this MessageCatalog was last modified.
- *
*/
private void setLastModified() throws GlobalizationException {
if (!isReadOnly()) {
set("lastModified", new Date());
} else {
throw new GlobalizationException(
- "MessageCatalog is in read-only mode. You must use the " +
- "MessageCatalog.retrieveForEdit() static method to edit " +
- "a MessageCatalog."
- );
+ "MessageCatalog is in read-only mode. You must use the " +
+ "MessageCatalog.retrieveForEdit() static method to edit " +
+ "a MessageCatalog."
+ );
}
}
/**
- *
* Get the locale associated with this MessageCatalog.
- *
*
* @return java.util.Locale representing the language, country,
* and variant associated with this MessageCatalog
@@ -195,9 +193,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Set the locale associated with this MessageCatalog.
- *
*
* @param locale java.util.Locale representing the language, country,
* and variant associated with this MessageCatalog.
@@ -211,8 +207,8 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
if (localeObject == null) {
throw new GlobalizationException(
- "Locale " + locale.toString() + " is not supported."
- );
+ "Locale " + locale.toString() + " is not supported."
+ );
}
setLocale(localeObject);
@@ -221,17 +217,15 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
} else {
throw new GlobalizationException(
- "MessageCatalog is in read-only mode. You must use the " +
- "MessageCatalog.retrieveForEdit() static method to edit " +
- "a MessageCatalog."
- );
+ "MessageCatalog is in read-only mode. You must use the " +
+ "MessageCatalog.retrieveForEdit() static method to edit " +
+ "a MessageCatalog."
+ );
}
}
/**
- *
* Set the locale associated with this MessageCatalog.
- *
*
* @param locale representing the language, country, and variant
* associated with this MessageCatalog.
@@ -241,18 +235,14 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Clear the locale associated with this MessageCatalog.
- *
*/
private void clearLocale() {
setAssociation("locale", null);
}
/**
- *
* De-serialize the MessageCatalog from the database into a Map object.
- *
*
* @return Map representing the MessageCatalog
*/
@@ -275,7 +265,8 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
);
} catch (SQLException sqle) {
s_cat.error("SQL Exception", sqle);
- throw new UncheckedWrapperException("SQLException: " + sqle.getMessage(), sqle);
+ throw new UncheckedWrapperException("SQLException: " +
+ sqle.getMessage(), sqle);
}
} else {
throw new RuntimeException("Was not able to determine BLOB type.");
@@ -312,9 +303,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Serialize the MessageCatalog to the database from a Map object.
- *
*
* @param catalog representing the MessageCatalog
*/
@@ -343,17 +332,15 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
set("catalog", baos.toByteArray());
} else {
throw new GlobalizationException(
- "MessageCatalog is in read-only mode. You must use the " +
- "MessageCatalog.retrieveForEdit() static method to edit " +
- "a MessageCatalog."
- );
+ "MessageCatalog is in read-only mode. You must use the " +
+ "MessageCatalog.retrieveForEdit() static method to edit " +
+ "a MessageCatalog."
+ );
}
}
/**
- *
* Get the name of this MessageCatalog.
- *
*
* @return String representing the MessageCatalog's name
*/
@@ -362,9 +349,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Set the name of this MessageCatalog.
- *
*
* @param name representing the MessageCatalog's name
*/
@@ -376,9 +361,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Check whether or not this MessageCatalog is read-only or not.
- *
*
* @return boolean true if it is read-only
*/
@@ -387,34 +370,28 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Toggle read/write-ability of this MessageCatalog.
- *
*/
private void setReadWrite() {
m_isReadOnly = false;
}
/**
- *
* Retrieve a MessageCatalog object from persistent storage.
- *
*
* @param name The name of the MessageCatalog to retrieve.
*
* @return DataObject MessageCatalog
*/
private static DataObject load(String name)
- throws GlobalizationException {
+ throws GlobalizationException {
Locale locale = null;
return load(name, locale);
}
/**
- *
* Retrieve a MessageCatalog object from persistent storage.
- *
*
* @param name The name of the MessageCatalog to retrieve.
* @param locale The locale of the MessageCatalog to retrieve.
@@ -422,7 +399,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
* @return DataObject MessageCatalog
*/
private static DataObject load(String name, java.util.Locale locale)
- throws GlobalizationException {
+ throws GlobalizationException {
Locale localeObject = null;
@@ -434,9 +411,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Retrieve a MessageCatalog object from persistent storage.
- *
*
* @param name The name of the MessageCatalog to retrieve.
* @param locale The locale of the MessageCatalog to retrieve.
@@ -444,7 +419,7 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
* @return DataObject MessageCatalog
*/
private static DataObject load(String name, Locale locale)
- throws GlobalizationException {
+ throws GlobalizationException {
Session s = SessionManager.getSession();
DataCollection catalogs = s.retrieve(BASE_DATA_OBJECT_TYPE);
@@ -471,24 +446,20 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Retrieve the MessageCatalog from persistent storage.
- *
*
* @param name The name of the MessageCatalog to retrieve.
*
* @return MessageCatalog
*/
public static MessageCatalog retrieve(String name)
- throws GlobalizationException {
+ throws GlobalizationException {
return new MessageCatalog(load(name));
}
/**
- *
- * Retrieve the MessageCatalog from persistent storage.
- *
+ * Retrieve the MessageCatalog for a specific locale from persistent storage.
*
* @param name The name of the MessageCatalog to retrieve.
* @param locale The locale of the MessageCatalog to retrieve.
@@ -496,22 +467,20 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
* @return MessageCatalog
*/
public static MessageCatalog retrieve(String name, java.util.Locale locale)
- throws GlobalizationException {
+ throws GlobalizationException {
return new MessageCatalog(load(name, locale));
}
/**
- *
* Retrieve the MessageCatalog from persistent storage for edit.
- *
*
* @param name The name of the MessageCatalog to retrieve.
*
* @return MessageCatalog
*/
public static MessageCatalog retrieveForEdit(String name)
- throws GlobalizationException {
+ throws GlobalizationException {
MessageCatalog mc = new MessageCatalog(load(name));
mc.setReadWrite();
@@ -519,23 +488,22 @@ public class MessageCatalog extends DomainObject implements java.io.Serializable
}
/**
- *
* Retrieve the MessageCatalog from persistent storage for edit.
- *
*
* @param name The name of the MessageCatalog to retrieve.
* @param locale The locale of the MessageCatalog to retrieve.
*
* @return MessageCatalog
*/
- public static MessageCatalog retrieveForEdit(
- String name, java.util.Locale locale
- ) throws GlobalizationException {
+ public static MessageCatalog retrieveForEdit(String name,
+ java.util.Locale locale)
+ throws GlobalizationException {
MessageCatalog mc = new MessageCatalog(load(name, locale));
mc.setReadWrite();
return mc;
}
+ @Override
protected void beforeSave() {
try {
setLastModified();
diff --git a/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java b/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java
index 0c843d027..06122f8ca 100755
--- a/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java
+++ b/ccm-core/src/com/arsdigita/globalization/MixedResourceBundle.java
@@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
package com.arsdigita.globalization;
import java.io.File;
@@ -32,10 +33,7 @@ import java.util.StringTokenizer;
import org.apache.log4j.Logger;
/**
- *
* Extends java.util.ResourceBundle to have it do two things:
- *
- *
*
* -
* If there is a PropertyResourceBundle with the same name as this one
@@ -46,8 +44,20 @@ import org.apache.log4j.Logger;
* have the same resource bundle name as this one.
*
*
- *
*
+ * How to use (rough reconstruction from code)
+ * - for each *.properties file create a child of this class with the same(!) name
+ * in the same package (subdirecgory)
+ * - for each language-specific *.proerties file create a child of this class
+ * with the same(1) name
+ * - Example:
+ * - HelloWorldResources.class
+ * - HelloWorldResources.properties
+ * - HelloWorldResources_es.class
+ * - HelloWorldResources_es.properties
+ * - HelloWorldResources_es_CO.class
+ * - HelloWorldResources_es_CO.properties
+ *
* @version $Revision: #10 $ $Date: 2004/08/16 $
* @version $Id: MixedResourceBundle.java 287 2005-02-22 00:29:02Z sskracic $
*/
@@ -61,10 +71,8 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
private Date m_lastModified = null;
/**
- *
* Implement ResourceBundle.handleGetObject(). Reloads if contents have
* changed.
- *
*
* @param key The key to the object to retrieve.
*
@@ -78,9 +86,7 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
}
/**
- *
* Implement ResourceBundle.getKeys(). Reloads if contents have changed.
- *
*
* @return Enumeration of keys.
*/
@@ -134,12 +140,11 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
}
/**
- *
* Mix all static (PropertiesResourceBundle) and dynamic (MessageCatalog)
* resources into one two dimensional array of key, value pairs.
- *
*/
private void loadContents() {
+
Map contents = new HashMap();
setLastLoaded();
@@ -157,25 +162,20 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
}
/**
- *
* Look for a ".properties" file with the same name as the class instance
* that extends this class (MixedResourceBundle). If we find one, then:
- *
- *
*
* - load it from disk
* - return it as a map of key, value pairs.
*
- *
*
* @return Map A map representing all the entries from the properties file.
*/
private Map loadPropertyResources() {
Map contents = new HashMap();
String className = getClassName().replace('.', '/');
- URL propertiesURL = getClass().getClassLoader().getResource(
- className + ".properties"
- );
+ URL propertiesURL = getClass().getClassLoader()
+ .getResource(className + ".properties");
if (s_cat.isDebugEnabled()) {
s_cat.debug("Starting to load static resources.");
@@ -234,16 +234,12 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
}
/**
- *
* Look for a MessageCatalog with the same name as the class instance
* that extends this class (MixedResourceBundle). If we find one, then:
- *
- *
*
* - load it
* - return it as a map of key, value pairs.
*
- *
*
* @return Map A map representing all the entries from the MessageCatalog.
*/
@@ -286,26 +282,49 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
return contents;
}
+ /**
+ *
+ * @return
+ */
private boolean isModified() {
return lastModified().compareTo(lastLoaded()) > 0 ? true : false;
}
+ /**
+ *
+ * @return
+ */
private Date lastLoaded() {
return m_lastLoaded;
}
+ /**
+ *
+ */
private void setLastLoaded() {
m_lastLoaded = new Date();
}
+ /**
+ *
+ * @param date
+ */
private void setLastLoaded(Date date) {
m_lastLoaded = date;
}
+ /**
+ *
+ * @return
+ */
private Date lastModified() {
return m_lastModified;
}
+ /**
+ *
+ * @param date
+ */
private void setLastModified(Date date) {
if (
m_lastModified == null ||
@@ -316,9 +335,7 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
}
/**
- *
* Get the name of the instantiating class.
- *
*
* @return String representing the instantiating class
*/
@@ -334,14 +351,11 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
}
/**
- *
* Parse the instantiating class' name and return the name of the
* ResourceBundle/MessageCatalog that we are looking for. Note that we
* assume that the class name will not contain any underscores ("_")
* except for those that are used to denote the associated Locale. For
* example, all the following are valid:
- *
- *
*
* - HelloWorldResources.class
* - HelloWorldResources.properties
@@ -350,19 +364,15 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
* - HelloWorldResources_es_CO.class
* - HelloWorldResources_es_CO.properties
*
- *
- *
+ *
* while the follwing examples will cause this code to fail and are
* therefore not allowed (by convention):
- *
- *
*
* - Hello_World_Resources.class
* - Hello_World_Resources.properties
* - Hello_World_Resources_es.class
* - Hello_World_Resources_es.properties
*
- *
*
* @param className representing the instantiating class
*
@@ -384,14 +394,11 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
}
/**
- *
* Parse the instantiating class's name and return the Locale associated
* with the ResourceBundle/MessageCatalog we are looking for. Note that we
* assume that the class name will not contain any underscores ("_")
* except for those that are used to denote the associated Locale. For
* example, all the following are valid:
- *
- *
*
* - HelloWorldResources.class
* - HelloWorldResources.properties
@@ -400,19 +407,15 @@ public abstract class MixedResourceBundle extends java.util.ResourceBundle {
* - HelloWorldResources_es_CO.class
* - HelloWorldResources_es_CO.properties
*
- *
- *
+ *
* while the follwing examples will cause this code to fail and are
* therefore not allowed (by convention):
- *
- *
*
* - Hello_World_Resources.class
* - Hello_World_Resources.properties
* - Hello_World_Resources_es.class
* - Hello_World_Resources_es.properties
*
- *
*
* @param className representing the instantiating class
*
diff --git a/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactGlobalizationUtil.java b/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactGlobalizationUtil.java
index 40cd4e1f3..08436d997 100755
--- a/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactGlobalizationUtil.java
+++ b/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactGlobalizationUtil.java
@@ -18,33 +18,36 @@
*/
package com.arsdigita.london.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * Contains methods to simplify globalizing keys related to Contact
- * ContentType object.
- *
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author Shashin Shinde sshinde@redhat.com
* @version $Id: ContactGlobalizationUtil.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class ContactGlobalizationUtil {
+ /** Name of Java resource files to handle Contact's globalisation. */
final public static String BUNDLE_NAME =
- "com.arsdigita.london.contenttypes.util.ContactResourceBundle";
+ "com.arsdigita.london.contenttypes.ContactResources";
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
*/
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
/**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
*/
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactResourceBundle.java b/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactResourceBundle.java
deleted file mode 100755
index 3604759f5..000000000
--- a/ccm-ldn-types-contact/src/com/arsdigita/london/contenttypes/util/ContactResourceBundle.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.london.contenttypes.util;
-
-import java.util.PropertyResourceBundle;
-
-import com.arsdigita.globalization.ChainedResourceBundle;
-
-import com.arsdigita.cms.util.CMSGlobalized;
-
-/**
- * Resource Bundle used in UI for Contact ContentType.
- *
- * @author Shashin Shinde sshinde@redhat.com
- * @version $Id: ContactResourceBundle.java 287 2005-02-22 00:29:02Z sskracic $
- */
-public class ContactResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String CONTACT_BUNDLE_NAME =
- "com.arsdigita.london.contenttypes.ContactResources";
-
- public ContactResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(CONTACT_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-
-}
diff --git a/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceGlobalizationUtil.java b/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceGlobalizationUtil.java
index 8af9b94bf..8791207e9 100755
--- a/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceGlobalizationUtil.java
+++ b/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceGlobalizationUtil.java
@@ -17,38 +17,39 @@
*/
package com.arsdigita.london.contenttypes.util;
+import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- *
- * Contains methods to simplify globalizing keys related to
- * ESDService content type object.
- *
+* Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
* @author Shashin Shinde sshinde@redhat.com
- *
* @version $Id: ESDServiceGlobalizationUtil.java 287 2005-02-22 00:29:02Z sskracic $
- *
*/
-public class ESDServiceGlobalizationUtil {
+public class ESDServiceGlobalizationUtil implements Globalized {
- final public static String BUNDLE_NAME =
- "com.arsdigita.london.contenttypes.util.ESDServiceResourceBundle";
+ /** Name of Java resource files to handle CMS's globalisation. */
+ final public static String BUNDLE_NAME =
+ "com.arsdigita.london.contenttypes.ESDServiceResources";
- /**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
- */
- public static GlobalizedMessage globalize(String key) {
- return new GlobalizedMessage(key, BUNDLE_NAME);
- }
+ /**
+ * Returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
+ */
+ public static GlobalizedMessage globalize(String key) {
+ return new GlobalizedMessage(key, BUNDLE_NAME);
+ }
- /**
- * This returns a globalized message using the type specific bundle,
- * BUNDLE_NAME
- */
- public static GlobalizedMessage globalize(String key, Object[] args) {
- return new GlobalizedMessage(key, BUNDLE_NAME, args);
- }
+ /**
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
+ */
+ public static GlobalizedMessage globalize(String key, Object[] args) {
+ return new GlobalizedMessage(key, BUNDLE_NAME, args);
+ }
}
diff --git a/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceResourceBundle.java b/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceResourceBundle.java
deleted file mode 100755
index 782a139df..000000000
--- a/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/util/ESDServiceResourceBundle.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
- *
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package com.arsdigita.london.contenttypes.util;
-
-import com.arsdigita.cms.util.CMSGlobalized;
-import com.arsdigita.globalization.ChainedResourceBundle;
-
-import java.util.PropertyResourceBundle;
-
-/**
- * @author Shashin Shinde sshinde@redhat.com
- *
- * @version $Id: ESDServiceResourceBundle.java 287 2005-02-22 00:29:02Z sskracic $
- *
- */
-public class ESDServiceResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
-
- public final static String ESDSERVICE_BUNDLE_NAME =
- "com.arsdigita.london.contenttypes.ESDServiceResources";
-
- public ESDServiceResourceBundle() {
- super();
- addBundle((PropertyResourceBundle)getBundle(ESDSERVICE_BUNDLE_NAME));
- addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
- }
-
-}
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/util/GlobalizationUtil.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/util/GlobalizationUtil.java
index 26870414f..b90754aa3 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/util/GlobalizationUtil.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/util/GlobalizationUtil.java
@@ -1,16 +1,53 @@
+/*
+ * Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
package com.arsdigita.portalworkspace.util;
import com.arsdigita.globalization.Globalized;
import com.arsdigita.globalization.GlobalizedMessage;
+/**
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
+ *
+ * @version $Id: $
+ */
public class GlobalizationUtil implements Globalized {
- private static final String BUNDLE_NAME =
- "com.arsdigita.portalworkspace.WorkspaceResources";
+ /** Name of the Java resource files to handle Workspace globalisation. */
+ private static final String BUNDLE_NAME =
+ "com.arsdigita.portalworkspace.WorkspaceResources";
+
+ /**
+ * This returns a globalized message using the package specific bundle.
+ */
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
+ /**
+ * Returns a globalized message object, using the package specific bundle.
+ * Also takes in an Object[] of arguments to interpolate into the
+ * retrieved message using the MessageFormat class.
+ */
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
diff --git a/ccm-themedirector/src/com/arsdigita/themedirector/util/GlobalizationUtil.java b/ccm-themedirector/src/com/arsdigita/themedirector/util/GlobalizationUtil.java
index 7ec3e17bd..d7c5d998e 100755
--- a/ccm-themedirector/src/com/arsdigita/themedirector/util/GlobalizationUtil.java
+++ b/ccm-themedirector/src/com/arsdigita/themedirector/util/GlobalizationUtil.java
@@ -21,21 +21,33 @@ package com.arsdigita.themedirector.util;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- * Methods to simplify globalizing keys
+ * Compilation of methods to simplify the handling of globalizing keys.
+ * Basically it adds the name of package's resource bundle files to the
+ * globalize methods and forwards to GlobalizedMessage, shortening the
+ * method invocation in the various application classes.
*
* @author yon@arsdigita.com
* @version $Revision: #1 $ $Date: 2003/11/18 $
*/
-
public class GlobalizationUtil {
+ /** Name of resource files to handle themedirector's globalisation. */
public static final String BUNDLE_NAME =
"com.arsdigita.themedirector.ThemeDirectorResources";
+ /**
+ * This returns a globalized message using the package specific bundle,
+ * provided by BUNDLE_NAME.
+ */
public static GlobalizedMessage globalize(String key) {
return new GlobalizedMessage(key, BUNDLE_NAME);
}
+ /**
+ * Returns a globalized message object, using the package specific bundle,
+ * as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
+ * interpolate into the retrieved message using the MessageFormat class.
+ */
public static GlobalizedMessage globalize(String key, Object[] args) {
return new GlobalizedMessage(key, BUNDLE_NAME, args);
}