.
- * */
+ *
+ */
public Object transformValue(HttpServletRequest request)
throws IllegalArgumentException {
Calendar c = getCalendar(request);
c.clear();
- String hour = Globalization.decodeParameter(request, getName()+".hour");
- String minute = Globalization.decodeParameter(request, getName()+".minute");
- String second = Globalization.decodeParameter(request, getName()+".second");
- String amOrPm = Globalization.decodeParameter(request, getName()+".amOrPm");
-
- if (StringUtils.emptyString(hour) &&
- StringUtils.emptyString(minute) &&
- StringUtils.emptyString(second)) {
+ String hour = Globalization
+ .decodeParameter(request, getName() + ".hour");
+ String minute = Globalization.decodeParameter(request, getName()
+ + ".minute");
+ String second = Globalization.decodeParameter(request, getName()
+ + ".second");
+ String amOrPm = Globalization.decodeParameter(request, getName()
+ + ".amOrPm");
+
+ if (StringUtils.emptyString(hour) && StringUtils.emptyString(minute)
+ && StringUtils.emptyString(second)) {
return transformSingleValue(request);
}
if (!StringUtils.emptyString(hour)) {
int hourInt = Integer.parseInt(hour);
-/* Das ist alles Blödsinn. Beim 24-Stundenformat brauchen wir das sowieso nicht.
+ /* Das ist alles Blödsinn. Beim 24-Stundenformat brauchen wir das sowieso nicht.
Beim 12-Stunden-Formato müßte es, wenn überhaupt, anderherum sein: Aus einer
eingetragenen 0 in den Stunden muß eine 12 werden. ABER: Die Informationen
werden in einem Calendar-Object gespeichert, das intern immer 24-Stunden-Format
@@ -100,7 +102,7 @@ zu 0:00 Uhr wird.
if ((hourInt == 12) && has12HourClock()) {
hourInt = 0;
}
-*/
+ */
c.set(Calendar.HOUR, hourInt);
}
@@ -112,35 +114,38 @@ zu 0:00 Uhr wird.
c.set(Calendar.SECOND, Integer.parseInt(second));
}
- if ( amOrPm != null ) {
+ if (amOrPm != null) {
c.set(Calendar.AM_PM, Integer.parseInt(amOrPm));
}
return c.getTime();
}
-
- public Object unmarshal ( String encoded ) {
+ public Object unmarshal(String encoded) {
try {
return new Date(Long.parseLong(encoded));
- } catch ( NumberFormatException ex ) {
+ } catch (NumberFormatException ex) {
throw new IllegalArgumentException("Cannot unmarshal time '"
- + encoded + "': " + ex.getMessage());
+ + encoded + "': " + ex
+ .getMessage());
}
}
- public String marshal ( Object value ) {
- return Long.toString(((Date)value).getTime());
+ public String marshal(Object value) {
+ return Long.toString(((Date) value).getTime());
}
- public Class getValueClass () {
+ public Class getValueClass() {
return Date.class;
}
- private boolean has12HourClock() {
- Locale locale = GlobalizationHelper.getNegotiatedLocale();
- DateFormat format_12Hour = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.US);
- DateFormat format_locale = DateFormat.getTimeInstance(DateFormat.SHORT, locale);
+ private boolean has12HourClock() {
+ Locale locale = CdiUtil.createCdiUtil().findBean(
+ GlobalizationHelper.class).getNegotiatedLocale();
+ DateFormat format_12Hour = DateFormat.getTimeInstance(DateFormat.SHORT,
+ Locale.US);
+ DateFormat format_locale = DateFormat.getTimeInstance(DateFormat.SHORT,
+ locale);
String midnight = "";
try {
@@ -150,4 +155,5 @@ zu 0:00 Uhr wird.
return midnight.contains("12");
}
+
}
diff --git a/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java b/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java
index fa99ffe7e..904a7aad0 100644
--- a/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java
+++ b/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java
@@ -22,8 +22,12 @@ import java.text.MessageFormat;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+
import javax.servlet.http.HttpServletRequest;
+
import org.apache.log4j.Logger;
+import org.libreccm.cdi.utils.CdiUtil;
+import org.libreccm.l10n.GlobalizationHelper;
/**
*
@@ -209,8 +213,8 @@ public class GlobalizedMessage {
* GlobalizedObject?
*/
public Object localize() {
- return localize(com.arsdigita.globalization.GlobalizationHelper
- .getNegotiatedLocale());
+ return localize(CdiUtil.createCdiUtil().findBean(
+ GlobalizationHelper.class).getNegotiatedLocale());
}
/**
@@ -232,8 +236,8 @@ public class GlobalizedMessage {
* GlobalizedObject?
*/
public Object localize(final HttpServletRequest request) {
- return localize(com.arsdigita.globalization.GlobalizationHelper
- .getNegotiatedLocale());
+ return localize(CdiUtil.createCdiUtil().findBean(
+ GlobalizationHelper.class).getNegotiatedLocale());
}
/**
diff --git a/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizationHelper.java b/ccm-core/src/main/java/com/arsdigita/globalization/LegacyGlobalizationHelper.java
similarity index 82%
rename from ccm-core/src/main/java/com/arsdigita/globalization/GlobalizationHelper.java
rename to ccm-core/src/main/java/com/arsdigita/globalization/LegacyGlobalizationHelper.java
index 1f5a8073c..414094a1d 100644
--- a/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizationHelper.java
+++ b/ccm-core/src/main/java/com/arsdigita/globalization/LegacyGlobalizationHelper.java
@@ -19,14 +19,17 @@ import javax.servlet.http.HttpSession;
/**
*
+ * @deprecated Replaced by {@link org.libreccm.l10n.GlobalizationHelper}
+ *
* @author Sören Bernstein
*/
-public class GlobalizationHelper {
+@Deprecated
+public class LegacyGlobalizationHelper {
private static final String LANG_PARAM = "lang";
// Don't instantiate
- private GlobalizationHelper() {
+ private LegacyGlobalizationHelper() {
}
/**
@@ -36,14 +39,14 @@ public class GlobalizationHelper {
*
* @return The negotiated locale
*/
- public static java.util.Locale getNegotiatedLocale() {
+ public static Locale getNegotiatedLocale() {
final KernelConfig kernelConfig = KernelConfig.getConfig();
// Set the preferedLocale to the default locale (first entry in the config parameter list)
- java.util.Locale preferedLocale = getPrefferedLocale();
+ Locale preferedLocale = getPrefferedLocale();
// The ACCEPTED_LANGUAGES from the client
- Enumeration locales = null;
+ Enumeration locales = null;
// Try to get the RequestContext
try {
@@ -53,7 +56,7 @@ public class GlobalizationHelper {
.getRequest());
// Get the selected locale from the request, if any
- java.util.Locale selectedLocale = getSelectedLocale(request);
+ Locale selectedLocale = getSelectedLocale(request);
if (selectedLocale != null && kernelConfig.hasLanguage(
selectedLocale.getLanguage())) {
preferedLocale = selectedLocale;
@@ -65,7 +68,7 @@ public class GlobalizationHelper {
while (locales.hasMoreElements()) {
// Test if the current locale is listed in the supported locales list
- java.util.Locale curLocale = (Locale) locales.nextElement();
+ Locale curLocale = (Locale) locales.nextElement();
if (kernelConfig.hasLanguage(curLocale.getLanguage())) {
preferedLocale = curLocale;
break;
@@ -82,13 +85,13 @@ public class GlobalizationHelper {
}
}
-// public static java.util.Locale getSystemLocale() {
+// public static Locale getSystemLocale() {
//
// }
private static Locale getPrefferedLocale() {
final KernelConfig kernelConfig = KernelConfig.getConfig();
- java.util.Locale preferedLocale = new java.util.Locale(kernelConfig
+ Locale preferedLocale = new Locale(kernelConfig
.getDefaultLanguage(), "", "");
return preferedLocale;
}
@@ -96,12 +99,12 @@ public class GlobalizationHelper {
/**
* Get the selected (as in fixed) locale from the ServletRequest
*
- * @return the selected locale as java.util.Locale or null if not defined
+ * @return the selected locale as Locale or null if not defined
*/
public static Locale getSelectedLocale(ServletRequest request) {
// Return value
- java.util.Locale selectedLocale = null;
+ Locale selectedLocale = null;
// Access current HttpSession or create a new one, if none exist
HttpSession session = ((HttpServletRequest) request).getSession(true);
@@ -132,19 +135,19 @@ public class GlobalizationHelper {
*
* @param lang A string encoded locale, as provided by browsers
*
- * @return A java.util.Locale representation of the language string
+ * @return A Locale representation of the language string
*/
- private static java.util.Locale scanLocale(String lang) {
+ private static Locale scanLocale(String lang) {
// Protect against empty lang string
if ((lang != null) && !(lang.isEmpty())) {
// Split the string and create the Locale object
StringTokenizer paramValues = new StringTokenizer(lang, "_");
if (paramValues.countTokens() > 1) {
- return new java.util.Locale(paramValues.nextToken(), paramValues
+ return new Locale(paramValues.nextToken(), paramValues
.nextToken());
} else {
- return new java.util.Locale(paramValues.nextToken());
+ return new Locale(paramValues.nextToken());
}
}
diff --git a/ccm-core/src/main/java/com/arsdigita/kernel/KernelConfig.java b/ccm-core/src/main/java/com/arsdigita/kernel/KernelConfig.java
index dfc7df812..d36424d0a 100644
--- a/ccm-core/src/main/java/com/arsdigita/kernel/KernelConfig.java
+++ b/ccm-core/src/main/java/com/arsdigita/kernel/KernelConfig.java
@@ -64,7 +64,7 @@ public final class KernelConfig {
@Setting
private Set supportedLanguages = new HashSet<>(
- Arrays.asList(new String[]{"en"}));
+ Arrays.asList(new String[]{"en", "de"}));
@Setting
private String defaultLanguage = "en";
diff --git a/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminServlet.java b/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminServlet.java
index b8b9711b0..399ca36df 100644
--- a/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminServlet.java
+++ b/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminServlet.java
@@ -18,6 +18,7 @@
*/
package com.arsdigita.ui.admin;
+import com.arsdigita.ui.admin.usersgroupsroles.UsersGroupsRolesTab;
import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.PageFactory;
diff --git a/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminUiConstants.java b/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminUiConstants.java
index d1c457c46..43dab5a5e 100644
--- a/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminUiConstants.java
+++ b/ccm-core/src/main/java/com/arsdigita/ui/admin/AdminUiConstants.java
@@ -37,7 +37,7 @@ public final class AdminUiConstants {
/**
* Globalisation resource for administration UI.
*/
- public static final String BUNDLE_NAME
+ public static final String ADMIN_BUNDLE
= "com.arsdigita.ui.admin.AdminResources";
/**
@@ -45,39 +45,39 @@ public final class AdminUiConstants {
*/
// Label MY_WORKSPACE_LABEL = new Label
// (new GlobalizedMessage("ui.admin.nav.workspace",
- // BUNDLE_NAME));
+ // ADMIN_BUNDLE));
// Label LOG_OUT_LABEL = new Label
// (new GlobalizedMessage("ui.admin.nav.logout",
- // BUNDLE_NAME));
+ // ADMIN_BUNDLE));
/**
* Administration page title
*/
public static final Label PAGE_TITLE_LABEL = new Label(
new GlobalizedMessage("ui.admin.dispatcher.title",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
/**
* Administration main tab names.
*/
public static final Label USER_TAB_TITLE = new Label(new GlobalizedMessage(
"ui.admin.tab.user",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label GROUP_TAB_TITLE = new Label(new GlobalizedMessage(
"ui.admin.tab.group",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label APPLICATIONS_TAB_TITLE = new Label(
new GlobalizedMessage("ui.admin.tab.applications",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label SYSINFO_TAB_TITLE = new Label(
- new GlobalizedMessage("ui.admin.tab.sysinfo.title", BUNDLE_NAME));
+ new GlobalizedMessage("ui.admin.tab.sysinfo.title", ADMIN_BUNDLE));
public static final GlobalizedMessage USER_NAVBAR_TITLE
= new GlobalizedMessage(
"ui.admin.tab.user.navbartitle",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
/**
* Tabbed pane indices
@@ -90,16 +90,16 @@ public final class AdminUiConstants {
*/
public static final Label USER_TAB_SUMMARY = new Label(
new GlobalizedMessage("ui.admin.tab.user.summary",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_TAB_BROWSE = new Label(new GlobalizedMessage(
"ui.admin.tab.user.browse",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_TAB_SEARCH = new Label(new GlobalizedMessage(
"ui.admin.tab.user.search",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_TAB_CREATE_USER = new Label(
new GlobalizedMessage("ui.admin.tab.user.createuser",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final int USER_TAB_SUMMARY_INDEX = 0;
public static final int USER_TAB_BROWSE_INDEX = 1;
@@ -123,15 +123,15 @@ public final class AdminUiConstants {
* User summary panel.
*/
public static final Label SUMMARY_PANEL_HEADER = new Label(
- new GlobalizedMessage("ui.admin.user.summarypanel.header", BUNDLE_NAME));
+ new GlobalizedMessage("ui.admin.user.summarypanel.header", ADMIN_BUNDLE));
public static final Label CREATE_USER_LABEL = new Label(
new GlobalizedMessage(
- "ui.admin.user.summarypanel.createUser", BUNDLE_NAME));
+ "ui.admin.user.summarypanel.createUser", ADMIN_BUNDLE));
public static final Label TOTAL_USERS_LABEL = new Label(
new GlobalizedMessage(
- "ui.admin.user.summarypanel.totalusers", BUNDLE_NAME));
+ "ui.admin.user.summarypanel.totalusers", ADMIN_BUNDLE));
/**
* User browse panel.
@@ -139,82 +139,82 @@ public final class AdminUiConstants {
public static final Label BROWSE_USER_PANEL_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.user.browsepanel.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_INFO_LABEL = new Label(new GlobalizedMessage(
"ui.admin.user.userinfo.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_EDIT_PANEL_HEADER = new Label(
new GlobalizedMessage("ui.admin.user.useredit.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_GROUP_PANEL_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.user.groupmembership.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_DELETE_FAILED_PANEL_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.user.action.delete.failed.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_PASSWORD_PANEL_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.user.password.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_ACTION_PANEL_HEADER = new Label(
new GlobalizedMessage("ui.admin.user.action.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_ACTION_CONTINUE = new Label(
new GlobalizedMessage("ui.admin.user.action.continue",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_DELETE_LABEL = new Label(
new GlobalizedMessage("ui.admin.user.delete.label",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_BAN_LABEL = new Label(new GlobalizedMessage(
"ui.admin.user.ban.label",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_UNBAN_LABEL = new Label(
new GlobalizedMessage("ui.admin.user.unban.label",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final GlobalizedMessage USER_DELETE_CONFIRMATION
= new GlobalizedMessage(
- "ui.admin.user.delete.confirm", BUNDLE_NAME);
+ "ui.admin.user.delete.confirm", ADMIN_BUNDLE);
public static final GlobalizedMessage USER_BAN_CONFIRMATION
= new GlobalizedMessage(
"ui.admin.user.ban.confirm",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final GlobalizedMessage USER_UNBAN_CONFIRMATION
= new GlobalizedMessage(
"ui.admin.user.unban.confirm",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final GlobalizedMessage USER_DELETE_FAILED_MSG
= new GlobalizedMessage(
- "ui.admin.user.delete.failed.label", BUNDLE_NAME);
+ "ui.admin.user.delete.failed.label", ADMIN_BUNDLE);
public static final Label USER_TAB_EXTREME_ACTION_LABEL = new Label(
new GlobalizedMessage(
"ui.admin.user.browsepanel.extremeaction",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label UPDATE_USER_PASSWORD_LABEL = new Label(
new GlobalizedMessage(
"ui.admin.user.browsepanel.updatePassword",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label BECOME_USER_LABEL = new Label(
new GlobalizedMessage("ui.admin.user.browsepanel.becomeUser",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
/**
* Create new user panel.
@@ -222,39 +222,39 @@ public final class AdminUiConstants {
public static final Label CREATE_USER_PANEL_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.user.createpanel.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
/**
* User search panel.
*/
public static final Label SEARCH_PANEL_HEADER = new Label(
new GlobalizedMessage("ui.admin.user.search.header",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label PASSWORD_FORM_LABEL_PASSWORD = new Label(
new GlobalizedMessage(
"ui.admin.user.userpasswordform.passwordlabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label PASSWORD_FORM_LABEL_CONFIRMATION_PASSWORD
= new Label(new GlobalizedMessage(
"ui.admin.user.userpasswordform.confirmpasswordlabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label PASSWORD_FORM_LABEL_QUESTION = new Label(
new GlobalizedMessage(
"ui.admin.user.userpasswordform.question",
- BUNDLE_NAME), false);
+ ADMIN_BUNDLE), false);
public static final Label PASSWORD_FORM_LABEL_ANSWER = new Label(
new GlobalizedMessage(
"ui.admin.user.userpasswordform.answer",
- BUNDLE_NAME), false);
+ ADMIN_BUNDLE), false);
public static final GlobalizedMessage PASSWORD_FORM_SUBMIT
= new GlobalizedMessage(
"ui.admin.user.userpasswordform.submit",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
/**
* Constants for user add/edit form.
@@ -279,95 +279,95 @@ public final class AdminUiConstants {
public static final Label USER_FORM_LABEL_FIRST_NAME = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.firstname",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_LAST_NAME = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.lastname",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_PASSWORD = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.password",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_PASSWORD_CONFIRMATION = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.confirmation",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_QUESTION = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.question",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_ANSWER = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.answer",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_PRIMARY_EMAIL = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.primaryemail",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_ADDITIONAL_EMAIL = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.additionalemail",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_ADDITIONAL_EMAIL_LIST = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.additionalemaillist",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_SCREEN_NAME = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.screenname",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_SSO = new Label(
new GlobalizedMessage(
"ui.admin.user.addeditform.ssologinname",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_LABEL_URL = new Label(
new GlobalizedMessage("ui.admin.user.addeditform.url",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label USER_FORM_DELETE_ADDITIONAL_EMAIL = new Label(
new GlobalizedMessage("ui.admin.user.addeditform.deleteemail",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final GlobalizedMessage USER_FORM_SUBMIT
= new GlobalizedMessage(
"ui.admin.user.addeditform.submit",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final GlobalizedMessage USER_FORM_ERROR_SCREEN_NAME_NOT_UNIQUE
= new GlobalizedMessage(
"ui.admin.user.addeditform.error.screenname.notunique",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final GlobalizedMessage USER_FORM_ERROR_PRIMARY_EMAIL_NOT_UNIQUE
= new GlobalizedMessage(
"ui.admin.user.addeditform.error.primaryemail.notunique",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final GlobalizedMessage USER_FORM_ERROR_PASSWORD_NOT_MATCH
= new GlobalizedMessage(
"ui.admin.user.addeditform.error.password.notmatch",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final GlobalizedMessage USER_FORM_ERROR_ANSWER_NULL
= new GlobalizedMessage(
"ui.admin.user.addeditform.error.answer.null",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final GlobalizedMessage USER_FORM_ERROR_ANSWER_WHITESPACE
= new GlobalizedMessage(
"ui.admin.user.addeditform.error.answer.whitespace",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
/**
* Constants for group add/edit form.
@@ -380,115 +380,115 @@ public final class AdminUiConstants {
public static final Label GROUP_FORM_LABEL_NAME = new Label(
new GlobalizedMessage(
"ui.admin.groups.addeditform.namelabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label GROUP_FORM_LABEL_PRIMARY_EMAIL = new Label(
new GlobalizedMessage(
"ui.admin.groups.addeditform.primaryemaillabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final GlobalizedMessage GROUP_FORM_SUBMIT
= new GlobalizedMessage(
- "ui.admin.groups.addeditform.submit", BUNDLE_NAME);
+ "ui.admin.groups.addeditform.submit", ADMIN_BUNDLE);
/**
* Constants for group administration tab.
*/
public static final Label GROUP_ACTION_CONTINUE = new Label(
new GlobalizedMessage("ui.admin.groups.actioncontinue",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final GlobalizedMessage GROUP_DELETE_FAILED_MSG
= new GlobalizedMessage(
"ui.admin.groups.groupdeletefailed",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final Label GROUP_INFORMATION_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.groups.groupinformation",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label SUBGROUP_HEADER = new Label(new GlobalizedMessage(
"ui.admin.groups.subgroups",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label GROUP_EDIT_HEADER = new Label(
new GlobalizedMessage("ui.admin.groups.groupedit",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label ADD_SUBGROUP_LABEL = new Label(
new GlobalizedMessage("ui.admin.groups.add",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label SUBMEMBER_HEADER = new Label(
new GlobalizedMessage("ui.admin.groups.submembers",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label DELETE_GROUP_LABEL = new Label(
new GlobalizedMessage("ui.admin.groups.delete",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label GROUP_EXTREME_ACTIONS_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.groups.extremeaction",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label GROUP_DELETE_FAILED_HEADER = new Label(
new GlobalizedMessage(
"ui.admin.groups.deletefailed",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label ADD_GROUP_LABEL = new Label(new GlobalizedMessage(
"ui.admin.groups.addgrouplabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label EDIT_GROUP_LABEL = new Label(
new GlobalizedMessage("ui.admin.groups.edit",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label SUBGROUP_COUNT_LABEL = new Label(
new GlobalizedMessage(
"ui.admin.groups.subgroupcountlabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final String GROUP_DELETE_CONFIRMATION
= "Are you sure you want to delete this group?";
public static final Label ADD_SUBMEMBER_LABEL = new Label(
new GlobalizedMessage("ui.admin.groups.addsubmemberlabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label REMOVE_SUBMEMBER_LABEL = new Label(
new GlobalizedMessage(
"ui.admin.groups.removesubmemberlabel",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label ADD_EXISTING_GROUP_TO_SUBGROUPS_LABEL = new Label(
new GlobalizedMessage(
"ui.admin.groups.addExisting",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label REMOVE_SUBGROUP_LABEL = new Label(
new GlobalizedMessage("ui.admin.groups.removeExisting",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label GROUP_SEARCH_LABEL = new Label(
- new GlobalizedMessage("ui.admin.groups.search", BUNDLE_NAME));
+ new GlobalizedMessage("ui.admin.groups.search", ADMIN_BUNDLE));
public static final GlobalizedMessage SEARCH_BUTTON = new GlobalizedMessage(
"ui.admin.groups.button.search",
- BUNDLE_NAME);
+ ADMIN_BUNDLE);
public static final Label GROUP_NO_RESULTS = new Label(
new GlobalizedMessage("ui.admin.groups.searchForm.noResults",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label FOUND_GROUPS_TITLE = new Label(
new GlobalizedMessage("ui.admin.groups.found.title",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final Label PICK_GROUPS = new Label(new GlobalizedMessage(
"ui.admin.groups.select.explanation",
- BUNDLE_NAME));
+ ADMIN_BUNDLE));
public static final GlobalizedMessage SAVE_BUTTON = new GlobalizedMessage(
- "ui.admin.save", BUNDLE_NAME);
+ "ui.admin.save", ADMIN_BUNDLE);
public static final String SEARCH_QUERY = "query";
diff --git a/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UserAdmin.java b/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UserAdmin.java
new file mode 100644
index 000000000..39545e3bb
--- /dev/null
+++ b/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UserAdmin.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 LibreCCM Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+package com.arsdigita.ui.admin.usersgroupsroles;
+
+import com.arsdigita.bebop.BoxPanel;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class UserAdmin extends BoxPanel {
+
+ public UserAdmin() {
+ super();
+
+ //add(new Label("User Admin class"));
+ add(new UsersTable());
+ }
+
+}
diff --git a/ccm-core/src/main/java/com/arsdigita/ui/admin/UsersGroupsRolesTab.java b/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UsersGroupsRolesTab.java
similarity index 90%
rename from ccm-core/src/main/java/com/arsdigita/ui/admin/UsersGroupsRolesTab.java
rename to ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UsersGroupsRolesTab.java
index 838ae2284..3f0e93e66 100644
--- a/ccm-core/src/main/java/com/arsdigita/ui/admin/UsersGroupsRolesTab.java
+++ b/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UsersGroupsRolesTab.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
-package com.arsdigita.ui.admin;
+package com.arsdigita.ui.admin.usersgroupsroles;
import com.arsdigita.bebop.BoxPanel;
import com.arsdigita.bebop.Component;
@@ -25,6 +25,7 @@ import com.arsdigita.bebop.List;
import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.Resettable;
+import com.arsdigita.bebop.SimpleContainer;
import com.arsdigita.bebop.list.ListModel;
import com.arsdigita.bebop.list.ListModelBuilder;
import com.arsdigita.globalization.GlobalizedMessage;
@@ -60,8 +61,8 @@ public class UsersGroupsRolesTab extends LayoutPanel {
});
sections.setClassAttr("navbar");
- final BoxPanel usersPanel = new BoxPanel();
- usersPanel.add(new Label("Users Panel"));
+// final BoxPanel usersPanel = new BoxPanel();
+// usersPanel.add(new Label("Users Panel"));
final BoxPanel groupsPanel = new BoxPanel();
groupsPanel.add(new Label("Groups Panel"));
@@ -73,25 +74,35 @@ public class UsersGroupsRolesTab extends LayoutPanel {
addSection(
new Label(new GlobalizedMessage(
"ui.admin.users_groups_roles.users.title",
- BUNDLE_NAME)),
- usersPanel,
+ ADMIN_BUNDLE)),
+ new UserAdmin(),
body);
addSection(
new Label(new GlobalizedMessage(
"ui.admin.users_groups_roles.groups.title",
- BUNDLE_NAME)),
+ ADMIN_BUNDLE)),
groupsPanel,
body);
addSection(
new Label(new GlobalizedMessage(
"ui.admin.users_roles_roles.users.title",
- BUNDLE_NAME)),
+ ADMIN_BUNDLE)),
rolesPanel,
body);
setLeft(sections);
setBody(body);
}
+
+ private SimpleContainer buildUserAdmin() {
+ final BoxPanel panel = new BoxPanel();
+
+
+
+ panel.add(new Label("User Admin"));
+
+ return panel;
+ }
private void addSection(final Label label,
final Component component,
diff --git a/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UsersTable.java b/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UsersTable.java
new file mode 100644
index 000000000..a52ff8fc0
--- /dev/null
+++ b/ccm-core/src/main/java/com/arsdigita/ui/admin/usersgroupsroles/UsersTable.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2016 LibreCCM Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+package com.arsdigita.ui.admin.usersgroupsroles;
+
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.Table;
+import com.arsdigita.bebop.table.TableColumn;
+import com.arsdigita.bebop.table.TableColumnModel;
+import com.arsdigita.bebop.table.TableModel;
+import com.arsdigita.bebop.table.TableModelBuilder;
+import com.arsdigita.globalization.GlobalizedMessage;
+import com.arsdigita.util.LockableImpl;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.libreccm.cdi.utils.CdiUtil;
+import org.libreccm.security.User;
+import org.libreccm.security.UserRepository;
+
+import java.util.List;
+
+import static com.arsdigita.ui.admin.AdminUiConstants.*;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class UsersTable extends Table {
+
+ private static final Logger LOGGER = LogManager.getLogger(UsersTable.class);
+
+ private static final int COL_SCREEN_NAME = 0;
+ private static final int COL_GIVEN_NAME = 1;
+ private static final int COL_FAMILY_NAME = 2;
+ private static final int COL_PRIMARY_EMAIL = 3;
+ private static final int COL_BANNED = 4;
+
+ public UsersTable() {
+ super();
+
+ setEmptyView(new Label(new GlobalizedMessage(
+ "ui.admin.users.table.no_users", ADMIN_BUNDLE)));
+
+ final TableColumnModel columnModel = getColumnModel();
+ columnModel.add(new TableColumn(
+ COL_SCREEN_NAME,
+ new Label(new GlobalizedMessage("ui.admin.users.table.screenname",
+ ADMIN_BUNDLE))));
+ columnModel.add(new TableColumn(
+ COL_GIVEN_NAME,
+ new Label(new GlobalizedMessage("ui.admin.users.table.givenname",
+ ADMIN_BUNDLE))));
+ columnModel.add(new TableColumn(
+ COL_FAMILY_NAME,
+ new Label(new GlobalizedMessage("ui.admin.users.table.familyname",
+ ADMIN_BUNDLE))));
+ columnModel.add(new TableColumn(
+ COL_PRIMARY_EMAIL,
+ new Label(new GlobalizedMessage(
+ "ui.admin.users.table.primary_email", ADMIN_BUNDLE))));
+ columnModel.add(new TableColumn(
+ COL_BANNED,
+ new Label(new GlobalizedMessage(
+ "ui.admin.users.table.banned", ADMIN_BUNDLE))));
+
+ setModelBuilder(new UsersTableModelBuilder());
+ }
+
+ private class UsersTableModelBuilder extends LockableImpl
+ implements TableModelBuilder {
+
+ @Override
+ public TableModel makeModel(final Table table, final PageState state) {
+ table.getRowSelectionModel().clearSelection(state);
+
+ return new UsersTableModel();
+ }
+
+ }
+
+ private class UsersTableModel implements TableModel {
+
+ private final List users;
+ private int index = -1;
+
+ public UsersTableModel() {
+ LOGGER.debug("Creating UsersTableModel...");
+ final UserRepository userRepository = CdiUtil.createCdiUtil()
+ .findBean(UserRepository.class);
+ users = userRepository.findAll();
+ LOGGER.debug("Found {} users in database.", users.size());
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 6;
+ }
+
+ @Override
+ public boolean nextRow() {
+ index++;
+ LOGGER.debug("Next row called. Index is {}", index);
+ return index < users.size();
+// index++;
+// LOGGER.debug("Result is '{}'. Index is now {}", result, index);
+// return result;
+ }
+
+ @Override
+ public Object getElementAt(final int columnIndex) {
+ LOGGER.debug("Getting element for row {}, column {}...",
+ index,
+ columnIndex);
+ final User user = users.get(index);
+ switch (columnIndex) {
+ case COL_BANNED:
+ return Boolean.toString(user.isBanned());
+ case COL_FAMILY_NAME:
+ return user.getFamilyName();
+ case COL_GIVEN_NAME:
+ return user.getGivenName();
+ case COL_PRIMARY_EMAIL:
+ return user.getPrimaryEmailAddress().getAddress();
+ case COL_SCREEN_NAME:
+ return user.getName();
+ default:
+ throw new IllegalArgumentException(
+ "No a valid column index.");
+ }
+ }
+
+ @Override
+ public Object getKeyAt(final int columnIndex) {
+ LOGGER.debug("Getting key for row {}, column {}...",
+ index,
+ columnIndex);
+ return users.get(index).getPartyId();
+ }
+
+ }
+
+}
diff --git a/ccm-core/src/main/java/org/libreccm/l10n/GlobalizationHelper.java b/ccm-core/src/main/java/org/libreccm/l10n/GlobalizationHelper.java
new file mode 100644
index 000000000..d51c1cb87
--- /dev/null
+++ b/ccm-core/src/main/java/org/libreccm/l10n/GlobalizationHelper.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2016 LibreCCM Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+package org.libreccm.l10n;
+
+import com.arsdigita.kernel.KernelConfig;
+
+import org.libreccm.configuration.ConfigurationManager;
+
+import java.util.Enumeration;
+import java.util.Locale;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+/**
+ * Provides the locale which has been selected based on the available languages
+ * configured in the {@link KernelConfig}, the preferred languages of the client
+ * provided an the request, the (optional) {@code lang} attribute in the current
+ * session and the optional {@code lang} parameter in the current request.
+ *
+ * The algorithm used in the class is as follows:
+ *
+ *
+ * -
+ * If there is an attribute {@code lang} in the current session use that
+ * language.
+ *
+ * -
+ * If there is a parameter {@code lang} for the current request, use that
+ * language and store the selected language in the session.
+ *
+ * -
+ * Get the languages preferred by the client as transmitted in the request and
+ * use the first match between the languages preferred by the client and
+ * available languages (from the {@link KernelConfig}).
+ *
+ *
+ *
+ * A historic note: This CDI bean replaces the old {@code GlobalizationHelper} class which used
+ * static methods and relied on the old {@code DispatcherHelper} for getting the
+ * current request. In a CDI environment we can simply inject the current request
+ * and don't need to bother with static methods etc.
+ *
+ * @author Jens Pelzetter
+ */
+@RequestScoped
+public class GlobalizationHelper {
+
+ private static final String LANG_PARAM = "lang";
+
+ @Inject
+ private HttpServletRequest request;
+
+ @Inject
+ private ConfigurationManager confManager;
+
+// private final KernelConfig kernelConfig;
+
+// public GlobalizationHelper() {
+// kernelConfig = confManager.findConfiguration(KernelConfig.class);
+// }
+
+ public Locale getNegotiatedLocale() {
+ final KernelConfig kernelConfig = confManager.findConfiguration(KernelConfig.class);
+
+ Locale preferred = new Locale(kernelConfig.getDefaultLanguage());
+
+ final Locale selectedLocale = getSelectedLocale();
+ if (selectedLocale == null || !kernelConfig.hasLanguage(selectedLocale
+ .getLanguage())) {
+ final Enumeration acceptedLocales = request.getLocales();
+
+ while (acceptedLocales.hasMoreElements()) {
+ final Locale current = acceptedLocales.nextElement();
+ if (kernelConfig.hasLanguage(current.getLanguage())) {
+ preferred = current;
+ break;
+ }
+ }
+ } else {
+ preferred = selectedLocale;
+ }
+
+ return preferred;
+ }
+
+ public Locale getSelectedLocale() {
+ // Get the current session, create one if there is none
+ final HttpSession session = request.getSession(true);
+
+ // Retrieve previously selected language from session. Might be null if
+ // no language has been selected in a previous request.
+ final String langSession = (String) session.getAttribute(LANG_PARAM);
+
+ // Get value of lang parameter from request URL. Will be null
+ // if the parameter is not set for the current request
+ final String langRequest = request.getParameter(LANG_PARAM);
+
+ Locale selected = null;
+
+ if (langRequest == null) {
+ if (langSession != null) {
+ selected = scanLocale(langSession);
+ }
+ } else {
+ final Locale localeRequest = scanLocale(langRequest);
+ if (localeRequest != null) {
+ session.setAttribute(LANG_PARAM, langRequest);
+ selected = localeRequest;
+ }
+ }
+
+ return selected;
+ }
+
+ private Locale scanLocale(final String language) {
+ if (language == null || language.isEmpty()) {
+ return null;
+ } else {
+ final String[] tokens = language.split("_");
+ if (tokens.length == 1) {
+ return new Locale(tokens[0]);
+ } else if (tokens.length == 2) {
+ return new Locale(tokens[0], tokens[1]);
+ } else if (tokens.length >= 3) {
+ return new Locale(tokens[0], tokens[1], tokens[2]);
+ } else {
+ return null;
+ }
+ }
+ }
+
+}
diff --git a/ccm-core/src/main/java/org/libreccm/themes/StaticThemesServlet.java b/ccm-core/src/main/java/org/libreccm/themes/StaticThemesServlet.java
new file mode 100644
index 000000000..7c7c8a735
--- /dev/null
+++ b/ccm-core/src/main/java/org/libreccm/themes/StaticThemesServlet.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2016 LibreCCM Foundation.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+package org.libreccm.themes;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.Set;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+@WebServlet(urlPatterns = {"/themes/static/*"})
+public class StaticThemesServlet extends HttpServlet {
+
+ private static final long serialVersionUID = -2732540547314051013L;
+
+ private static final Logger LOGGER = LogManager.getLogger(
+ StaticThemesServlet.class);
+
+ @Override
+ public void doGet(final HttpServletRequest request,
+ final HttpServletResponse response)
+ throws ServletException, IOException {
+
+ final String pathInfo = request.getPathInfo();
+ if (pathInfo == null) {
+ LOGGER.warn("Received request without path info which this Servlet "
+ + "can't handle. Responding with SC_FORBIDDEN.");
+ response.sendError(HttpServletResponse.SC_FORBIDDEN);
+ return;
+ }
+
+ final String resourcePath = String.join("", "/themes", pathInfo);
+ LOGGER.debug("Resource path is '{}'.", resourcePath);
+
+// final InputStream inStream = getClass().getClassLoader()
+// .getResourceAsStream(resourcePath);
+// final URL resourceUrl = getClass().getClassLoader().getResource(
+// String.format("file://%s", resourcePath));
+// final MimetypesFileTypeMap mimetypesMap = new MimetypesFileTypeMap();
+// final String type;
+// try {
+// type = mimetypesMap.getContentType(new File(resourceUrl.toURI()));
+// } catch (URISyntaxException ex) {
+// throw new ServletException(ex);
+// }
+//
+// response.setContentType(type);
+// if (inStream == null) {
+// LOGGER.warn("Failed to get requested resource '{}'", resourcePath);
+// response.sendError(HttpServletResponse.SC_NOT_FOUND);
+// return;
+// }
+//
+// IOUtils.copy(inStream, response.getOutputStream());
+ final ServletContext servletContext = getServletContext();
+
+ final Set paths = servletContext.getResourcePaths(resourcePath);
+ if (paths == null) {
+ final InputStream inputStream = servletContext.getResourceAsStream(
+ resourcePath);
+ if (inputStream == null) {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
+ } else {
+ response.setContentType(servletContext.getMimeType(resourcePath));
+ IOUtils.copy(inputStream, response.getOutputStream());
+ }
+ } else {
+ response.setContentType("text/plain");
+ final PrintWriter printWriter = response.getWriter();
+ printWriter.append(String.format("%s%n", resourcePath));
+ for(int i = 0; i < resourcePath.length(); i++) {
+ printWriter.append('=');
+ }
+ printWriter.append(System.lineSeparator());
+ paths.forEach(p -> printWriter.append(String.format("%s%n", p)));
+ }
+
+ //IOUtils.copy(new FileInputStream(file), response.getOutputStream());
+// try {
+// final File file = new File(resourceURL.toURI());
+// response.setContentType(getServletContext().getMimeType(resourcePath));
+// IOUtils.copy(getServletContext().getResourceAsStream(resourcePath),
+// response.getOutputStream());
+//
+// final Path path = Paths.get(resourceURL.toURI());
+//
+// Files.copy(path, response.getOutputStream());
+// } catch (URISyntaxException ex) {
+// throw new ServletException(ex);
+// }
+ }
+
+}
diff --git a/ccm-core/src/main/resources/META-INF/resources/themes/test/ccm-core.html b/ccm-core/src/main/resources/META-INF/resources/themes/test/ccm-core.html
new file mode 100644
index 000000000..ee53386e6
--- /dev/null
+++ b/ccm-core/src/main/resources/META-INF/resources/themes/test/ccm-core.html
@@ -0,0 +1,9 @@
+
+
+
+ ccm-core.html
+
+
+ ccm-core.txt
+
+
diff --git a/ccm-core/src/main/resources/META-INF/resources/themes/test/ccm-core.txt b/ccm-core/src/main/resources/META-INF/resources/themes/test/ccm-core.txt
new file mode 100644
index 000000000..e0e35a7c9
--- /dev/null
+++ b/ccm-core/src/main/resources/META-INF/resources/themes/test/ccm-core.txt
@@ -0,0 +1,9 @@
+Dies ist ein Test.
+
+Diese Datei liegt im Module
+
+ccm-core
+
+in
+
+/themes/test/ccm-core.txt
diff --git a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources.properties b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources.properties
index 6225d6a6f..1e2524411 100644
--- a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources.properties
+++ b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources.properties
@@ -160,3 +160,8 @@ ui.admin.tab.workflows.title=Workflows
ui.admin.users_groups_roles.users.title=Users
ui.admin.users_groups_roles.groups.title=Groups
ui.admin.users_roles_roles.users.title=Roles
+ui.admin.users.table.screenname=Username
+ui.admin.users.table.givenname=Given name
+ui.admin.users.table.familyname=Family name
+ui.admin.users.table.primary_email=E-Mail
+ui.admin.users.table.banned=Banned
diff --git a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_de.properties b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_de.properties
index 17bd0ef37..fbfb4aae6 100644
--- a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_de.properties
+++ b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_de.properties
@@ -160,3 +160,8 @@ ui.admin.tab.workflows.title=Arbeitsabl\u00e4ufe
ui.admin.users_groups_roles.users.title=Benutzer
ui.admin.users_groups_roles.groups.title=Gruppen
ui.admin.users_roles_roles.users.title=Rollen
+ui.admin.users.table.screenname=Benutzername
+ui.admin.users.table.givenname=Vorname
+ui.admin.users.table.familyname=Familienname
+ui.admin.users.table.primary_email=E-Mail
+ui.admin.users.table.banned=Gesperrt
diff --git a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_en.properties b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_en.properties
index 85ecddabe..f87d5fb69 100755
--- a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_en.properties
+++ b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_en.properties
@@ -133,3 +133,8 @@ ui.admin.user.userinfo.screenname=Username:
ui.admin.users_groups_roles.users.title=Users
ui.admin.users_groups_roles.groups.title=Groups
ui.admin.users_roles_roles.users.title=Roles
+ui.admin.users.table.screenname=Username
+ui.admin.users.table.givenname=Given name
+ui.admin.users.table.familyname=Family name
+ui.admin.users.table.primary_email=E-Mail
+ui.admin.users.table.banned=Banned
diff --git a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_fr.properties b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_fr.properties
index 2fbb3e1a7..61a59cb7d 100755
--- a/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_fr.properties
+++ b/ccm-core/src/main/resources/com/arsdigita/ui/admin/AdminResources_fr.properties
@@ -124,3 +124,8 @@ ui.admin.user.userinfo.screenname=Username:
ui.admin.users_groups_roles.users.title=Users
ui.admin.users_groups_roles.groups.title=Groups
ui.admin.users_roles_roles.users.title=Roles
+ui.admin.users.table.screenname=Username
+ui.admin.users.table.givenname=Given name
+ui.admin.users.table.familyname=Family name
+ui.admin.users.table.primary_email=E-Mail
+ui.admin.users.table.banned=Banned