CCM NG: Part of the ongoing migration to a database based configuration system
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3790 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
c024ac5593
commit
97567275e2
|
|
@ -26,7 +26,7 @@ import com.arsdigita.bebop.parameters.BitSetParameter;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.bebop.util.Traversal;
|
import com.arsdigita.bebop.util.Traversal;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.util.SystemInformation;
|
import com.arsdigita.util.SystemInformation;
|
||||||
import com.arsdigita.xml.Document;
|
import com.arsdigita.xml.Document;
|
||||||
|
|
@ -625,7 +625,7 @@ public class Page extends SimpleComponent implements Container {
|
||||||
m_panel.generateXML(state, page);
|
m_panel.generateXML(state, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LegacyKernelConfig.getConfig().isDebugEnabled()
|
if (KernelConfig.getConfig().isDebugEnabled()
|
||||||
&& debugStructure(state.getRequest())) {
|
&& debugStructure(state.getRequest())) {
|
||||||
|
|
||||||
Element structure = page.newChildElement("bebop:structure",
|
Element structure = page.newChildElement("bebop:structure",
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.arsdigita.bebop.util.Attributes;
|
import com.arsdigita.bebop.util.Attributes;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
||||||
|
|
@ -294,7 +294,7 @@ public class SimpleComponent extends Completable
|
||||||
if (m_attr != null) {
|
if (m_attr != null) {
|
||||||
m_attr.exportAttributes(target);
|
m_attr.exportAttributes(target);
|
||||||
}
|
}
|
||||||
if (LegacyKernelConfig.getConfig().isDebugEnabled() ||
|
if (KernelConfig.getConfig().isDebugEnabled() ||
|
||||||
Bebop.getConfig().showClassName()) {
|
Bebop.getConfig().showClassName()) {
|
||||||
target.addAttribute("bebop:classname", getClass().getName(),
|
target.addAttribute("bebop:classname", getClass().getName(),
|
||||||
BEBOP_XML_NS);
|
BEBOP_XML_NS);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.bebop.Bebop;
|
||||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
import com.arsdigita.globalization.Globalization;
|
import com.arsdigita.globalization.Globalization;
|
||||||
import com.arsdigita.globalization.GlobalizationHelper;
|
import com.arsdigita.globalization.GlobalizationHelper;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.templating.PresentationManager;
|
import com.arsdigita.templating.PresentationManager;
|
||||||
import com.arsdigita.templating.Templating;
|
import com.arsdigita.templating.Templating;
|
||||||
import com.arsdigita.templating.XSLParameterGenerator;
|
import com.arsdigita.templating.XSLParameterGenerator;
|
||||||
|
|
@ -454,7 +454,7 @@ public class PageTransformer implements PresentationManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy and paste from BasePresentationManager
|
// copy and paste from BasePresentationManager
|
||||||
if (LegacyKernelConfig.getConfig().isDebugEnabled()) {
|
if (KernelConfig.getConfig().isDebugEnabled()) {
|
||||||
Document origDoc = (Document) req.getAttribute(
|
Document origDoc = (Document) req.getAttribute(
|
||||||
"com.arsdigita.xml.Document");
|
"com.arsdigita.xml.Document");
|
||||||
Debugger.addDebugger(new TransformationDebugger(template.
|
Debugger.addDebugger(new TransformationDebugger(template.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
package com.arsdigita.dispatcher;
|
package com.arsdigita.dispatcher;
|
||||||
|
|
||||||
//import com.arsdigita.kernel.Kernel;
|
//import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.util.ParameterProvider;
|
import com.arsdigita.util.ParameterProvider;
|
||||||
import com.arsdigita.util.StringUtils;
|
import com.arsdigita.util.StringUtils;
|
||||||
|
|
@ -1135,7 +1135,7 @@ public final class DispatcherHelper implements DispatcherConstants {
|
||||||
* @return The negotiated locale
|
* @return The negotiated locale
|
||||||
*/
|
*/
|
||||||
public static Locale getNegotiatedLocale() {
|
public static Locale getNegotiatedLocale() {
|
||||||
LegacyKernelConfig kernelConfig = LegacyKernelConfig.getConfig();
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
|
|
||||||
// Set the preferedLocale to the default locale (first entry in the
|
// Set the preferedLocale to the default locale (first entry in the
|
||||||
// config parameter list)
|
// config parameter list)
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,15 @@
|
||||||
package com.arsdigita.globalization;
|
package com.arsdigita.globalization;
|
||||||
|
|
||||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
|
||||||
import javax.servlet.ServletRequest;
|
import javax.servlet.ServletRequest;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
|
@ -19,7 +23,6 @@ import javax.servlet.http.HttpSession;
|
||||||
*/
|
*/
|
||||||
public class GlobalizationHelper {
|
public class GlobalizationHelper {
|
||||||
|
|
||||||
public static final String LANG_INDEPENDENT = LegacyKernelConfig.getConfig().getLanguagesIndependentCode();
|
|
||||||
private static final String LANG_PARAM = "lang";
|
private static final String LANG_PARAM = "lang";
|
||||||
|
|
||||||
// Don't instantiate
|
// Don't instantiate
|
||||||
|
|
@ -27,30 +30,32 @@ public class GlobalizationHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the best matching locate for the request. In contrast to
|
* This method returns the best matching locate for the request. In contrast
|
||||||
* the other methods available this one will also respect the supported_languages
|
* to the other methods available this one will also respect the
|
||||||
* config entry.
|
* supported_languages config entry.
|
||||||
*
|
*
|
||||||
* @return The negotiated locale
|
* @return The negotiated locale
|
||||||
*/
|
*/
|
||||||
public static java.util.Locale getNegotiatedLocale() {
|
public static java.util.Locale getNegotiatedLocale() {
|
||||||
LegacyKernelConfig kernelConfig = LegacyKernelConfig.getConfig();
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
|
|
||||||
// Set the preferedLocale to the default locale (first entry in the config parameter list)
|
// Set the preferedLocale to the default locale (first entry in the config parameter list)
|
||||||
java.util.Locale preferedLocale = getPrefferedLocale();
|
java.util.Locale preferedLocale = getPrefferedLocale();
|
||||||
|
|
||||||
// The ACCEPTED_LANGUAGES from the client
|
// The ACCEPTED_LANGUAGES from the client
|
||||||
Enumeration locales = null;
|
Enumeration<java.util.Locale> locales = null;
|
||||||
|
|
||||||
// Try to get the RequestContext
|
// Try to get the RequestContext
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Get the SerrvletRequest
|
// Get the SerrvletRequest
|
||||||
ServletRequest request = ((ServletRequest) DispatcherHelper.getRequest());
|
ServletRequest request = ((ServletRequest) DispatcherHelper
|
||||||
|
.getRequest());
|
||||||
|
|
||||||
// Get the selected locale from the request, if any
|
// Get the selected locale from the request, if any
|
||||||
java.util.Locale selectedLocale = getSelectedLocale(request);
|
java.util.Locale selectedLocale = getSelectedLocale(request);
|
||||||
if (selectedLocale != null && kernelConfig.hasLanguage(selectedLocale.getLanguage())) {
|
if (selectedLocale != null && kernelConfig.hasLanguage(
|
||||||
|
selectedLocale.getLanguage())) {
|
||||||
preferedLocale = selectedLocale;
|
preferedLocale = selectedLocale;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -81,8 +86,10 @@ public class GlobalizationHelper {
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
private static Locale getPrefferedLocale() {
|
private static Locale getPrefferedLocale() {
|
||||||
LegacyKernelConfig kernelConfig = LegacyKernelConfig.getConfig();
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
java.util.Locale preferedLocale = new java.util.Locale(kernelConfig.getDefaultLanguage(), "", "");
|
|
||||||
|
java.util.Locale preferedLocale = new java.util.Locale(kernelConfig
|
||||||
|
.getDefaultLanguage(), "", "");
|
||||||
return preferedLocale;
|
return preferedLocale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,17 +113,15 @@ public class GlobalizationHelper {
|
||||||
// If there is a request language string, then this will have priority
|
// If there is a request language string, then this will have priority
|
||||||
// because this will only be the case, if someone selected another
|
// because this will only be the case, if someone selected another
|
||||||
// language with the language selector
|
// language with the language selector
|
||||||
if(selectedRequestLang != null) {
|
if (selectedRequestLang != null) {
|
||||||
// Get the Locale object for the param
|
// Get the Locale object for the param
|
||||||
if((selectedLocale = scanLocale(selectedRequestLang)) != null) {
|
if ((selectedLocale = scanLocale(selectedRequestLang)) != null) {
|
||||||
// Save the request parameter as session value
|
// Save the request parameter as session value
|
||||||
session.setAttribute(LANG_PARAM, selectedRequestLang);
|
session.setAttribute(LANG_PARAM, selectedRequestLang);
|
||||||
}
|
}
|
||||||
} else {
|
} else // If there is a session stored language, use it
|
||||||
// If there is a session stored language, use it
|
if (selectedSessionLang != null) {
|
||||||
if(selectedSessionLang != null) {
|
selectedLocale = scanLocale(selectedSessionLang);
|
||||||
selectedLocale = scanLocale(selectedSessionLang);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectedLocale;
|
return selectedLocale;
|
||||||
|
|
@ -126,6 +131,7 @@ public class GlobalizationHelper {
|
||||||
* Create a Locale from a browser provides language string
|
* Create a Locale from a browser provides language string
|
||||||
*
|
*
|
||||||
* @param lang A string encoded locale, as provided by browsers
|
* @param lang A string encoded locale, as provided by browsers
|
||||||
|
*
|
||||||
* @return A java.util.Locale representation of the language string
|
* @return A java.util.Locale representation of the language string
|
||||||
*/
|
*/
|
||||||
private static java.util.Locale scanLocale(String lang) {
|
private static java.util.Locale scanLocale(String lang) {
|
||||||
|
|
@ -135,7 +141,8 @@ public class GlobalizationHelper {
|
||||||
// Split the string and create the Locale object
|
// Split the string and create the Locale object
|
||||||
StringTokenizer paramValues = new StringTokenizer(lang, "_");
|
StringTokenizer paramValues = new StringTokenizer(lang, "_");
|
||||||
if (paramValues.countTokens() > 1) {
|
if (paramValues.countTokens() > 1) {
|
||||||
return new java.util.Locale(paramValues.nextToken(), paramValues.nextToken());
|
return new java.util.Locale(paramValues.nextToken(), paramValues
|
||||||
|
.nextToken());
|
||||||
} else {
|
} else {
|
||||||
return new java.util.Locale(paramValues.nextToken());
|
return new java.util.Locale(paramValues.nextToken());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,15 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.kernel;
|
package com.arsdigita.kernel;
|
||||||
|
|
||||||
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.libreccm.configuration.Configuration;
|
import org.libreccm.configuration.Configuration;
|
||||||
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
import org.libreccm.configuration.Setting;
|
import org.libreccm.configuration.Setting;
|
||||||
|
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
|
@ -36,6 +39,9 @@ import java.util.StringJoiner;
|
||||||
descKey = "kernel.config.description")
|
descKey = "kernel.config.description")
|
||||||
public final class KernelConfig {
|
public final class KernelConfig {
|
||||||
|
|
||||||
|
private static final String EMAIL = "email";
|
||||||
|
private static final String SCREEN_NAME = "screen_name";
|
||||||
|
|
||||||
@Setting(descKey = "kernel.config.debug_enabled")
|
@Setting(descKey = "kernel.config.debug_enabled")
|
||||||
private boolean debugEnabled = false;
|
private boolean debugEnabled = false;
|
||||||
|
|
||||||
|
|
@ -46,7 +52,7 @@ public final class KernelConfig {
|
||||||
private boolean dataPermissionCheckEnabled = true;
|
private boolean dataPermissionCheckEnabled = true;
|
||||||
|
|
||||||
@Setting(descKey = "kernel.config.primary_user_identifier")
|
@Setting(descKey = "kernel.config.primary_user_identifier")
|
||||||
private String primaryUserIdentifier = "email";
|
private String primaryUserIdentifier = EMAIL;
|
||||||
|
|
||||||
@Setting(descKey = "kernel.config.sso_enabled")
|
@Setting(descKey = "kernel.config.sso_enabled")
|
||||||
private boolean ssoEnabled = false;
|
private boolean ssoEnabled = false;
|
||||||
|
|
@ -64,6 +70,13 @@ public final class KernelConfig {
|
||||||
@Setting(descKey = "kernel.config.default_language")
|
@Setting(descKey = "kernel.config.default_language")
|
||||||
private String defaultLanguage = "en";
|
private String defaultLanguage = "en";
|
||||||
|
|
||||||
|
public static KernelConfig getConfig() {
|
||||||
|
final CdiUtil cdiUtil = new CdiUtil();
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
return confManager.findConfiguration(KernelConfig.class);
|
||||||
|
}
|
||||||
|
|
||||||
public KernelConfig() {
|
public KernelConfig() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
@ -98,8 +111,8 @@ public final class KernelConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrimaryUserIdentifier(final String primaryUserIdentifier) {
|
public void setPrimaryUserIdentifier(final String primaryUserIdentifier) {
|
||||||
if ("screen_name".equals(primaryUserIdentifier)
|
if (SCREEN_NAME.equals(primaryUserIdentifier)
|
||||||
|| "email".equals(primaryUserIdentifier)) {
|
|| EMAIL.equals(primaryUserIdentifier)) {
|
||||||
this.primaryUserIdentifier = primaryUserIdentifier;
|
this.primaryUserIdentifier = primaryUserIdentifier;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
|
|
@ -108,6 +121,14 @@ public final class KernelConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean emailIsPrimaryIdentifier() {
|
||||||
|
return EMAIL.equals(primaryUserIdentifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean screenNameIsPrimaryIdentifier() {
|
||||||
|
return SCREEN_NAME.equals(primaryUserIdentifier);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSsoEnabled() {
|
public boolean isSsoEnabled() {
|
||||||
return ssoEnabled;
|
return ssoEnabled;
|
||||||
}
|
}
|
||||||
|
|
@ -156,6 +177,10 @@ public final class KernelConfig {
|
||||||
supportedLanguages.remove(language);
|
supportedLanguages.remove(language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasLanguage(final String language) {
|
||||||
|
return supportedLanguages.contains(language);
|
||||||
|
}
|
||||||
|
|
||||||
public String getDefaultLanguage() {
|
public String getDefaultLanguage() {
|
||||||
return defaultLanguage;
|
return defaultLanguage;
|
||||||
}
|
}
|
||||||
|
|
@ -231,7 +256,7 @@ public final class KernelConfig {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
final StringJoiner joiner = new StringJoiner(",");
|
final StringJoiner joiner = new StringJoiner(", ");
|
||||||
if (supportedLanguages != null) {
|
if (supportedLanguages != null) {
|
||||||
supportedLanguages.forEach(s -> joiner.add(s));
|
supportedLanguages.forEach(s -> joiner.add(s));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,203 +0,0 @@
|
||||||
/*
|
|
||||||
* 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.kernel;
|
|
||||||
|
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
|
||||||
import com.arsdigita.util.parameter.BooleanParameter;
|
|
||||||
import com.arsdigita.util.parameter.EnumerationParameter;
|
|
||||||
import com.arsdigita.util.parameter.Parameter;
|
|
||||||
import com.arsdigita.util.parameter.StringParameter;
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Justin Ross
|
|
||||||
* @see com.arsdigita.kernel.Kernel
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
public final class LegacyKernelConfig extends AbstractConfig {
|
|
||||||
|
|
||||||
/** A logger instance. */
|
|
||||||
private static final Logger s_log = Logger.getLogger(LegacyKernelConfig.class);
|
|
||||||
|
|
||||||
/** Singelton config object. */
|
|
||||||
private static LegacyKernelConfig s_conf;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gain a LegacyKernelConfig object.
|
|
||||||
*
|
|
||||||
* Singelton pattern, don't instantiate a LegacyKernelConfig object using the
|
|
||||||
constructor directly!
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static synchronized LegacyKernelConfig getConfig() {
|
|
||||||
if (s_conf == null) {
|
|
||||||
s_conf = new LegacyKernelConfig();
|
|
||||||
s_conf.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
return s_conf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** TODO: should be renamed waf.kernel.debug" */
|
|
||||||
private static Parameter m_debug = new BooleanParameter
|
|
||||||
("waf.debug", Parameter.REQUIRED, Boolean.FALSE);
|
|
||||||
/** Whether WEB development support should be activated (true) or not. */
|
|
||||||
// Handled in OLD initializer c.ad.webdevsupport.LegacyInitializer
|
|
||||||
private static Parameter m_webdevSupport = new BooleanParameter
|
|
||||||
("waf.webdev_support", Parameter.REQUIRED, Boolean.FALSE);
|
|
||||||
private final Parameter m_permissions = new BooleanParameter
|
|
||||||
("waf.kernel.data_permission_check_enabled", Parameter.REQUIRED,
|
|
||||||
Boolean.TRUE);
|
|
||||||
/** User Login by screen name or email address */
|
|
||||||
private final EnumerationParameter m_identifier = new EnumerationParameter
|
|
||||||
("waf.kernel.primary_user_identifier", Parameter.REQUIRED,
|
|
||||||
"email");
|
|
||||||
/**
|
|
||||||
* */
|
|
||||||
private final Parameter m_SSO = new BooleanParameter
|
|
||||||
("waf.kernel.sso_login", Parameter.REQUIRED, Boolean.FALSE);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* */
|
|
||||||
private final Parameter m_remember = new BooleanParameter
|
|
||||||
("waf.kernel.remember_login", Parameter.REQUIRED, Boolean.TRUE);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* */
|
|
||||||
private final Parameter m_secureLogin = new BooleanParameter
|
|
||||||
("waf.kernel.secure_login", Parameter.REQUIRED, Boolean.FALSE);
|
|
||||||
|
|
||||||
/** String containing the supported languages.
|
|
||||||
The first one is considered default. */
|
|
||||||
private final Parameter m_supportedLanguages = new StringParameter
|
|
||||||
("waf.kernel.supported_languages", Parameter.REQUIRED,
|
|
||||||
"en,de,fr,nl,it,pt,es");
|
|
||||||
private final Parameter m_languageIndependentItems = new BooleanParameter
|
|
||||||
("waf.kernel.language_independent_items", Parameter.REQUIRED, Boolean.FALSE);
|
|
||||||
private final Parameter m_languageIndependentCode = new StringParameter
|
|
||||||
("waf.kernel.language_independent_code", Parameter.OPTIONAL,
|
|
||||||
"--");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*/
|
|
||||||
public LegacyKernelConfig() {
|
|
||||||
|
|
||||||
// Add recognised Login user identification to enumeration parameter
|
|
||||||
m_identifier.put("email", "email");
|
|
||||||
m_identifier.put("screen_name", "screenName");
|
|
||||||
|
|
||||||
|
|
||||||
register(m_debug);
|
|
||||||
register(m_webdevSupport);
|
|
||||||
register(m_permissions);
|
|
||||||
register(m_identifier);
|
|
||||||
register(m_SSO);
|
|
||||||
register(m_remember);
|
|
||||||
register(m_secureLogin);
|
|
||||||
register(m_supportedLanguages);
|
|
||||||
register(m_languageIndependentItems);
|
|
||||||
register(m_languageIndependentCode);
|
|
||||||
|
|
||||||
loadInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public final boolean isDebugEnabled() {
|
|
||||||
return ((Boolean) get(m_debug)).booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true, if WEB developer support should be activated.
|
|
||||||
*/
|
|
||||||
public final boolean isWebdevSupportActive() {
|
|
||||||
return ((Boolean) get(m_webdevSupport)).booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isDataPermissionCheckEnabled() {
|
|
||||||
return ((Boolean) get(m_permissions)).booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String getPrimaryUserIdentifier() {
|
|
||||||
return (String) get(m_identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean emailIsPrimaryIdentifier() {
|
|
||||||
return "email".equals(get(m_identifier));
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean screenNameIsPrimaryIdentifier() {
|
|
||||||
return !emailIsPrimaryIdentifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isSSOenabled() {
|
|
||||||
return ((Boolean) get(m_SSO)).booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX Move this to WebConfig.
|
|
||||||
public final boolean isLoginRemembered() {
|
|
||||||
return ((Boolean) get(m_remember)).booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isSecureLoginRequired() {
|
|
||||||
return ((Boolean) get(m_secureLogin)).booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the defaultLanguage flag.
|
|
||||||
*/
|
|
||||||
public final String getDefaultLanguage() {
|
|
||||||
return ((String) get(m_supportedLanguages)).trim().substring(0, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the supportedLanguages as String.
|
|
||||||
*/
|
|
||||||
public final String getSupportedLanguages() {
|
|
||||||
return (String) get(m_supportedLanguages);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the supportedLanguages as StringTokenizer.
|
|
||||||
*/
|
|
||||||
public final StringTokenizer getSupportedLanguagesTokenizer() {
|
|
||||||
return new StringTokenizer(this.getSupportedLanguages(), ",", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the languagesIndependentCode as String.
|
|
||||||
*/
|
|
||||||
public final String getLanguagesIndependentCode() {
|
|
||||||
return (String) get(m_languageIndependentCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true, if language lang is part of supported langs
|
|
||||||
*/
|
|
||||||
public final boolean hasLanguage(String lang) {
|
|
||||||
return ((String) get(m_supportedLanguages)).contains(lang);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean languageIndependentItems() {
|
|
||||||
return ((Boolean) get(m_languageIndependentItems)).booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2011 pboy (pboy@barkhof.uni-bremen.de) 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.notification;
|
||||||
|
|
||||||
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
|
import com.arsdigita.util.parameter.IntegerParameter;
|
||||||
|
import com.arsdigita.util.parameter.Parameter;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LegacyNotificationConfig
|
||||||
|
*
|
||||||
|
* @author Peter Boy <pboy@barkhof.uni-bremen.de>
|
||||||
|
* @version $Id: LegacyNotificationConfig.java $
|
||||||
|
*/
|
||||||
|
public class LegacyNotificationConfig extends AbstractConfig {
|
||||||
|
|
||||||
|
/** Private Logger instance. */
|
||||||
|
private static final Logger s_log = Logger.getLogger(LegacyNotificationConfig.class);
|
||||||
|
|
||||||
|
/** Private Object to hold one's own instance to return to users. */
|
||||||
|
private static LegacyNotificationConfig s_conf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the singleton configuration record for the content section
|
||||||
|
* environment.
|
||||||
|
*
|
||||||
|
* @return The <code>ContentSectionConfig</code> record; it cannot be null
|
||||||
|
*/
|
||||||
|
public static synchronized LegacyNotificationConfig getInstance() {
|
||||||
|
if (s_conf == null) {
|
||||||
|
s_conf = new LegacyNotificationConfig();
|
||||||
|
s_conf.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
return s_conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// /////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Set of parameters controlling Overdue Task alerts:
|
||||||
|
// Currently there is no way to persist it nor to persist on a per section base.
|
||||||
|
// Therefore Initializer has to create overdue task alert mechanism using a
|
||||||
|
// configuration applied to every content section.
|
||||||
|
//
|
||||||
|
// /////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request manager's delay in seconds.
|
||||||
|
*/
|
||||||
|
private IntegerParameter m_requestManagerDelay = new IntegerParameter
|
||||||
|
("waf.notification.request_manager_delay", Parameter.REQUIRED,
|
||||||
|
new Integer(900));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request manager's period in seconds
|
||||||
|
*/
|
||||||
|
private IntegerParameter m_requestManagerPeriod = new IntegerParameter
|
||||||
|
("waf.notification.request_manager_period", Parameter.REQUIRED,
|
||||||
|
new Integer(900));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Digest queue's delay in seconds.
|
||||||
|
*/
|
||||||
|
private IntegerParameter m_digestQueueDelay = new IntegerParameter
|
||||||
|
("waf.notification.digest_queue_delay", Parameter.REQUIRED,
|
||||||
|
new Integer(900));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Digest queue's period in seconds
|
||||||
|
*/
|
||||||
|
private IntegerParameter m_digestQueuePeriod = new IntegerParameter
|
||||||
|
("waf.notification.digest_queue_period", Parameter.REQUIRED,
|
||||||
|
new Integer(900));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple queue's delay in seconds.
|
||||||
|
*/
|
||||||
|
private IntegerParameter m_simpleQueueDelay = new IntegerParameter
|
||||||
|
("waf.notification.simple_queue_delay", Parameter.REQUIRED,
|
||||||
|
new Integer(900));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple queue's period in seconds
|
||||||
|
*/
|
||||||
|
private IntegerParameter m_simpleQueuePeriod = new IntegerParameter
|
||||||
|
("waf.notification.simple_queue_period", Parameter.REQUIRED,
|
||||||
|
new Integer(900));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
* Do not use it directly! Singleton design pattern!
|
||||||
|
*/
|
||||||
|
public LegacyNotificationConfig() {
|
||||||
|
s_log.debug("Executing NotificationConfig Constructor.");
|
||||||
|
register(m_requestManagerDelay);
|
||||||
|
register(m_requestManagerPeriod);
|
||||||
|
register(m_simpleQueueDelay);
|
||||||
|
register(m_simpleQueuePeriod);
|
||||||
|
register(m_digestQueueDelay);
|
||||||
|
register(m_digestQueuePeriod);
|
||||||
|
s_log.debug("NotificationConfig register executed.");
|
||||||
|
|
||||||
|
s_log.debug("Executing NotificationConfig loadinfo.");
|
||||||
|
loadInfo();
|
||||||
|
s_log.debug("Leaving NotificationConfig Constructor.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve request manager's delay in seconds.
|
||||||
|
* @return delay, in seconds.
|
||||||
|
*/
|
||||||
|
public int getRequestManagerDelay() {
|
||||||
|
s_log.debug("m_requestManagerDelay retrieved.");
|
||||||
|
// return ((Integer) get(m_requestManagerDelay)).intValue();
|
||||||
|
return 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve request manager's period in seconds
|
||||||
|
* @return period, in seconds
|
||||||
|
*/
|
||||||
|
public int getRequestManagerPeriod() {
|
||||||
|
s_log.debug("m_requestManagerPeriod retrieved.");
|
||||||
|
// return ((Integer) get(m_requestManagerPeriod)).intValue();
|
||||||
|
return 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve digest queue's delay in seconds.
|
||||||
|
* @return delay, in seconds.
|
||||||
|
*/
|
||||||
|
public int getDigestQueueDelay() {
|
||||||
|
s_log.debug("m_digestQueueDelay retrieved.");
|
||||||
|
// return ((Integer) get(m_digestQueueDelay)).intValue();
|
||||||
|
return 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve digest queue's period in seconds
|
||||||
|
* @return period, in seconds
|
||||||
|
*/
|
||||||
|
public int getDigestQueuePeriod() {
|
||||||
|
s_log.debug("m_digestQueuePeriod retrieved.");
|
||||||
|
// return ((Integer) get(m_digestQueuePeriod)).intValue();
|
||||||
|
return 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve simple queue's delay in seconds.
|
||||||
|
* @return delay, in seconds.
|
||||||
|
*/
|
||||||
|
public int getSimpleQueueDelay() {
|
||||||
|
s_log.debug("m_simpleQueueDelay retrieved.");
|
||||||
|
// return ((Integer) get(m_simpleQueueDelay)).intValue();
|
||||||
|
return 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve simple queue's period in seconds
|
||||||
|
* @return period, in seconds
|
||||||
|
*/
|
||||||
|
public int getSimpleQueuePeriod() {
|
||||||
|
s_log.debug("m_simpleQueuePeriod retrieved.");
|
||||||
|
// return ((Integer) get(m_simpleQueuePeriod)).intValue();
|
||||||
|
return 900;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,190 +1,176 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2011 pboy (pboy@barkhof.uni-bremen.de) All Rights Reserved.
|
* Copyright (C) 2016 LibreCCM Foundation.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* as published by the Free Software Foundation; either version 2.1 of
|
* License as published by the Free Software Foundation; either
|
||||||
* the License, or (at your option) any later version.
|
* 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,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
*
|
* MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.notification;
|
package com.arsdigita.notification;
|
||||||
|
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
import com.arsdigita.util.parameter.IntegerParameter;
|
import org.libreccm.configuration.Configuration;
|
||||||
import com.arsdigita.util.parameter.Parameter;
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
|
import org.libreccm.configuration.Setting;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NotificationConfig
|
|
||||||
*
|
*
|
||||||
* @author Peter Boy <pboy@barkhof.uni-bremen.de>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
* @version $Id: NotificationConfig.java $
|
|
||||||
*/
|
*/
|
||||||
public class NotificationConfig extends AbstractConfig {
|
@Configuration(
|
||||||
|
descBundle = "com.arsdigita.notification.NotificationConfigDescription",
|
||||||
|
descKey = "notification.config.description")
|
||||||
|
public final class NotificationConfig {
|
||||||
|
|
||||||
/** Private Logger instance. */
|
@Setting(descKey = "notification.config.request_manager_delay")
|
||||||
private static final Logger s_log = Logger.getLogger(NotificationConfig.class);
|
private Integer requestManagerDelay = 900;
|
||||||
|
|
||||||
/** Private Object to hold one's own instance to return to users. */
|
@Setting(descKey = "notification.config.request_manager_period")
|
||||||
private static NotificationConfig s_conf;
|
private Integer requestManagerPeriod = 900;
|
||||||
|
|
||||||
/**
|
@Setting(descKey = "notification.config.digest_queue_delay")
|
||||||
* Returns the singleton configuration record for the content section
|
private Integer digestQueueDelay = 900;
|
||||||
* environment.
|
|
||||||
*
|
|
||||||
* @return The <code>ContentSectionConfig</code> record; it cannot be null
|
|
||||||
*/
|
|
||||||
public static synchronized NotificationConfig getInstance() {
|
|
||||||
if (s_conf == null) {
|
|
||||||
s_conf = new NotificationConfig();
|
|
||||||
s_conf.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
return s_conf;
|
@Setting(descKey = "notification.config.digest_queue_period")
|
||||||
|
private Integer digestQueuePeriod = 900;
|
||||||
|
|
||||||
|
@Setting(descKey = "notification.config.simple_queue_delay")
|
||||||
|
private Integer simpleQueueDelay = 900;
|
||||||
|
|
||||||
|
@Setting(descKey = "notification.config.simple_queue_period")
|
||||||
|
private Integer simpleQueuePeriod = 900;
|
||||||
|
|
||||||
|
public static NotificationConfig getConfig() {
|
||||||
|
final CdiUtil cdiUtil = new CdiUtil();
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
return confManager.findConfiguration(NotificationConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// /////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Set of parameters controlling Overdue Task alerts:
|
|
||||||
// Currently there is no way to persist it nor to persist on a per section base.
|
|
||||||
// Therefore Initializer has to create overdue task alert mechanism using a
|
|
||||||
// configuration applied to every content section.
|
|
||||||
//
|
|
||||||
// /////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Request manager's delay in seconds.
|
|
||||||
*/
|
|
||||||
private IntegerParameter m_requestManagerDelay = new IntegerParameter
|
|
||||||
("waf.notification.request_manager_delay", Parameter.REQUIRED,
|
|
||||||
new Integer(900));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Request manager's period in seconds
|
|
||||||
*/
|
|
||||||
private IntegerParameter m_requestManagerPeriod = new IntegerParameter
|
|
||||||
("waf.notification.request_manager_period", Parameter.REQUIRED,
|
|
||||||
new Integer(900));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Digest queue's delay in seconds.
|
|
||||||
*/
|
|
||||||
private IntegerParameter m_digestQueueDelay = new IntegerParameter
|
|
||||||
("waf.notification.digest_queue_delay", Parameter.REQUIRED,
|
|
||||||
new Integer(900));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Digest queue's period in seconds
|
|
||||||
*/
|
|
||||||
private IntegerParameter m_digestQueuePeriod = new IntegerParameter
|
|
||||||
("waf.notification.digest_queue_period", Parameter.REQUIRED,
|
|
||||||
new Integer(900));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Simple queue's delay in seconds.
|
|
||||||
*/
|
|
||||||
private IntegerParameter m_simpleQueueDelay = new IntegerParameter
|
|
||||||
("waf.notification.simple_queue_delay", Parameter.REQUIRED,
|
|
||||||
new Integer(900));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Simple queue's period in seconds
|
|
||||||
*/
|
|
||||||
private IntegerParameter m_simpleQueuePeriod = new IntegerParameter
|
|
||||||
("waf.notification.simple_queue_period", Parameter.REQUIRED,
|
|
||||||
new Integer(900));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
* Do not use it directly! Singleton design pattern!
|
|
||||||
*/
|
|
||||||
public NotificationConfig() {
|
public NotificationConfig() {
|
||||||
s_log.debug("Executing NotificationConfig Constructor.");
|
super();
|
||||||
register(m_requestManagerDelay);
|
|
||||||
register(m_requestManagerPeriod);
|
|
||||||
register(m_simpleQueueDelay);
|
|
||||||
register(m_simpleQueuePeriod);
|
|
||||||
register(m_digestQueueDelay);
|
|
||||||
register(m_digestQueuePeriod);
|
|
||||||
s_log.debug("NotificationConfig register executed.");
|
|
||||||
|
|
||||||
s_log.debug("Executing NotificationConfig loadinfo.");
|
|
||||||
loadInfo();
|
|
||||||
s_log.debug("Leaving NotificationConfig Constructor.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getRequestManagerDelay() {
|
||||||
/**
|
return requestManagerDelay;
|
||||||
* Retrieve request manager's delay in seconds.
|
|
||||||
* @return delay, in seconds.
|
|
||||||
*/
|
|
||||||
public int getRequestManagerDelay() {
|
|
||||||
s_log.debug("m_requestManagerDelay retrieved.");
|
|
||||||
// return ((Integer) get(m_requestManagerDelay)).intValue();
|
|
||||||
return 900;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setRequestManagerDelay(final Integer requestManagerDelay) {
|
||||||
* Retrieve request manager's period in seconds
|
this.requestManagerDelay = requestManagerDelay;
|
||||||
* @return period, in seconds
|
|
||||||
*/
|
|
||||||
public int getRequestManagerPeriod() {
|
|
||||||
s_log.debug("m_requestManagerPeriod retrieved.");
|
|
||||||
// return ((Integer) get(m_requestManagerPeriod)).intValue();
|
|
||||||
return 900;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Integer getRequestManagerPeriod() {
|
||||||
* Retrieve digest queue's delay in seconds.
|
return requestManagerPeriod;
|
||||||
* @return delay, in seconds.
|
|
||||||
*/
|
|
||||||
public int getDigestQueueDelay() {
|
|
||||||
s_log.debug("m_digestQueueDelay retrieved.");
|
|
||||||
// return ((Integer) get(m_digestQueueDelay)).intValue();
|
|
||||||
return 900;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setRequestManagerPeriod(final Integer requestManagerPeriod) {
|
||||||
* Retrieve digest queue's period in seconds
|
this.requestManagerPeriod = requestManagerPeriod;
|
||||||
* @return period, in seconds
|
|
||||||
*/
|
|
||||||
public int getDigestQueuePeriod() {
|
|
||||||
s_log.debug("m_digestQueuePeriod retrieved.");
|
|
||||||
// return ((Integer) get(m_digestQueuePeriod)).intValue();
|
|
||||||
return 900;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Integer getDigestQueueDelay() {
|
||||||
* Retrieve simple queue's delay in seconds.
|
return digestQueueDelay;
|
||||||
* @return delay, in seconds.
|
|
||||||
*/
|
|
||||||
public int getSimpleQueueDelay() {
|
|
||||||
s_log.debug("m_simpleQueueDelay retrieved.");
|
|
||||||
// return ((Integer) get(m_simpleQueueDelay)).intValue();
|
|
||||||
return 900;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setDigestQueueDelay(final Integer digestQueueDelay) {
|
||||||
* Retrieve simple queue's period in seconds
|
this.digestQueueDelay = digestQueueDelay;
|
||||||
* @return period, in seconds
|
}
|
||||||
*/
|
|
||||||
public int getSimpleQueuePeriod() {
|
public Integer getDigestQueuePeriod() {
|
||||||
s_log.debug("m_simpleQueuePeriod retrieved.");
|
return digestQueuePeriod;
|
||||||
// return ((Integer) get(m_simpleQueuePeriod)).intValue();
|
}
|
||||||
return 900;
|
|
||||||
|
public void setDigestQueuePeriod(final Integer digestQueuePeriod) {
|
||||||
|
this.digestQueuePeriod = digestQueuePeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSimpleQueueDelay() {
|
||||||
|
return simpleQueueDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSimpleQueueDelay(final Integer simpleQueueDelay) {
|
||||||
|
this.simpleQueueDelay = simpleQueueDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSimpleQueuePeriod() {
|
||||||
|
return simpleQueuePeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSimpleQueuePeriod(final Integer simpleQueuePeriod) {
|
||||||
|
this.simpleQueuePeriod = simpleQueuePeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 89 * hash + Objects.hashCode(requestManagerDelay);
|
||||||
|
hash = 89 * hash + Objects.hashCode(requestManagerPeriod);
|
||||||
|
hash = 89 * hash + Objects.hashCode(digestQueueDelay);
|
||||||
|
hash = 89 * hash + Objects.hashCode(digestQueuePeriod);
|
||||||
|
hash = 89 * hash + Objects.hashCode(simpleQueueDelay);
|
||||||
|
hash = 89 * hash + Objects.hashCode(simpleQueuePeriod);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof NotificationConfig)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final NotificationConfig other = (NotificationConfig) obj;
|
||||||
|
if (!Objects.equals(requestManagerDelay, other.getRequestManagerDelay())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(requestManagerPeriod,
|
||||||
|
other.getRequestManagerPeriod())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(digestQueueDelay, other.getDigestQueueDelay())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(digestQueuePeriod, other.getDigestQueuePeriod())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(simpleQueueDelay, other.getSimpleQueueDelay())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Objects.equals(simpleQueuePeriod, other.getSimpleQueuePeriod());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.format("%s{ "
|
||||||
|
+ "requestManagerDelay = %d, "
|
||||||
|
+ "requestManagerPeriod = %d, "
|
||||||
|
+ "digestQueueDelay = %d, "
|
||||||
|
+ "digestQueuePeriod = %d, "
|
||||||
|
+ "simpleQueueDelay = %d, "
|
||||||
|
+ "simpleQueuePeriod = %d"
|
||||||
|
+ " }",
|
||||||
|
super.toString(),
|
||||||
|
requestManagerDelay,
|
||||||
|
requestManagerPeriod,
|
||||||
|
digestQueueDelay,
|
||||||
|
digestQueuePeriod,
|
||||||
|
simpleQueueDelay,
|
||||||
|
simpleQueuePeriod);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
package com.arsdigita.templating;
|
package com.arsdigita.templating;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Bebop;
|
import com.arsdigita.bebop.Bebop;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.util.ExceptionUnwrapper;
|
import com.arsdigita.util.ExceptionUnwrapper;
|
||||||
import com.arsdigita.util.Exceptions;
|
import com.arsdigita.util.Exceptions;
|
||||||
|
|
@ -193,7 +193,7 @@ public class Templating {
|
||||||
template = new XSLTemplate(source);
|
template = new XSLTemplate(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (LegacyKernelConfig.getConfig().isDebugEnabled()
|
} else if (KernelConfig.getConfig().isDebugEnabled()
|
||||||
&& template.isModified()) {
|
&& template.isModified()) {
|
||||||
// XXX referencing Kernel above is a broken dependency.
|
// XXX referencing Kernel above is a broken dependency.
|
||||||
// Debug mode should be captured at a lower level,
|
// Debug mode should be captured at a lower level,
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,17 @@ public abstract class UI {
|
||||||
private static final UIConfig s_config = UIConfig.getConfig();
|
private static final UIConfig s_config = UIConfig.getConfig();
|
||||||
|
|
||||||
/** URL for systems public top level page (entry or start page). */
|
/** URL for systems public top level page (entry or start page). */
|
||||||
private static final String s_rootPageURL = s_config.getRootPage();
|
private static final String s_rootPageURL = s_config.getRootPageUrl();
|
||||||
/** URL to page a user should be redirected to after login. */
|
/** URL to page a user should be redirected to after login. */
|
||||||
private static final String s_userRedirectURL = s_config.getUserRedirect();
|
private static final String s_userRedirectURL = s_config.getUserRedirectUrl();
|
||||||
/** (Absolute) URL for workspace page. */
|
/** (Absolute) URL for workspace page. */
|
||||||
private static final String s_workspaceURL = s_config.getWorkspace();
|
private static final String s_workspaceURL = s_config.getWorkspaceUrl();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a handle to the UI config record.
|
* Provides a handle to the UI config record.
|
||||||
*
|
*
|
||||||
* @return Instance of UIConfig
|
* @return Instance of LegacyUIConfig
|
||||||
*/
|
*/
|
||||||
public static UIConfig getConfig() {
|
public static UIConfig getConfig() {
|
||||||
return s_config;
|
return s_config;
|
||||||
|
|
|
||||||
|
|
@ -1,276 +1,153 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2010 pboy (pboy@barkhof.uni-bremen.de) All Rights Reserved.
|
* Copyright (C) 2016 LibreCCM Foundation.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* as published by the Free Software Foundation; either version 2.1 of
|
* License as published by the Free Software Foundation; either
|
||||||
* the License, or (at your option) any later version.
|
* 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,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
*
|
* MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.ui;
|
package com.arsdigita.ui;
|
||||||
|
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
import com.arsdigita.util.StringUtils;
|
import org.libreccm.configuration.Configuration;
|
||||||
import com.arsdigita.util.parameter.Parameter;
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
import com.arsdigita.util.parameter.StringArrayParameter;
|
import org.libreccm.configuration.Setting;
|
||||||
import com.arsdigita.util.parameter.StringParameter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import org.apache.log4j.Logger;
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A configuration record for configuration of the core UI package
|
|
||||||
* (layout of main UI components).
|
|
||||||
*
|
*
|
||||||
* Accessors of this class may return null. Developers should take care
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
* to trap null return values in their code.
|
|
||||||
*
|
|
||||||
* @author Peter Boy <pboy@barkhof.uni-bremen.de>
|
|
||||||
* @version $Id: $
|
|
||||||
*/
|
*/
|
||||||
public class UIConfig extends AbstractConfig {
|
@Configuration(descBundle = "com.arsdigita.ui.UIConfigDescription",
|
||||||
|
descKey = "ui.config.description")
|
||||||
|
public final class UIConfig {
|
||||||
|
|
||||||
/** A logger instance. */
|
@Setting(descKey = "ui.config.default_layout")
|
||||||
private static final Logger s_log = Logger.getLogger(UIConfig.class);
|
private List<String> defaultLayout = Arrays.asList(new String[]{
|
||||||
|
"top:com.arsdigita.ui.UserBanner",
|
||||||
|
"bottom:com.arsdigita.ui.SiteBanner",
|
||||||
|
"bottom:com.arsdigita.ui.DebugPanel"
|
||||||
|
});
|
||||||
|
|
||||||
/** Singelton config object. */
|
@Setting(descKey = "ui.config.root_page_url")
|
||||||
private static UIConfig s_conf;
|
private String rootPageUrl = "/register/";
|
||||||
|
|
||||||
/**
|
@Setting(descKey = "ui.config.user_redirect_url")
|
||||||
* Gain a UIConfig object.
|
private String userRedirectUrl = "/permissions/";
|
||||||
*
|
|
||||||
* Singelton pattern, don't instantiate a lifecacle object using the
|
|
||||||
* constructor directly!
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static synchronized UIConfig getConfig() {
|
|
||||||
if (s_conf == null) {
|
|
||||||
s_conf = new UIConfig();
|
|
||||||
s_conf.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
return s_conf;
|
@Setting(descKey = "ui.config.workspace_url")
|
||||||
|
private String workspaceUrl = "pvt/";
|
||||||
|
|
||||||
|
public static UIConfig getConfig() {
|
||||||
|
final CdiUtil cdiUtil = new CdiUtil();
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
return confManager.findConfiguration(UIConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Default set of page component objects defining the default layout for the
|
|
||||||
* <strong>SimplePage</strong> class.
|
|
||||||
*
|
|
||||||
* Format expected by clients:
|
|
||||||
* list { { "margin_position", "class_name_of_bebop_component"} ,
|
|
||||||
* { "margin_position", "class_name_of_bebop_component"} ,
|
|
||||||
* ...
|
|
||||||
* { "margin_position", "class_name_of_bebop_component"}
|
|
||||||
* }
|
|
||||||
* Elements are optional and may have 0 ...n pairs of position/classname.
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* defaultLayout = { { "top", "com.arsdigita.ui.UserBanner" },
|
|
||||||
* { "bottom", "com.arsdigita.ui.SiteBanner" },
|
|
||||||
* { "bottom", "com.arsdigita.ui.DebugPanel" }
|
|
||||||
* { "left", "com.arsdigita.x.y.z" },
|
|
||||||
* { "right", "com.arsdigita.x.y.z" }
|
|
||||||
* };
|
|
||||||
*
|
|
||||||
* Currently there is no list parameter model available. We use a
|
|
||||||
* StringArrayParameter instead, where each String element contains a
|
|
||||||
* colon separated position:class entry. It is converted to a list by
|
|
||||||
* the getter method.
|
|
||||||
*/
|
|
||||||
// Quick 'md Dirty, we reeally need a StringListParameter class
|
|
||||||
private final Parameter m_defaultLayout =
|
|
||||||
new StringArrayParameter(
|
|
||||||
"core.ui.default_layout",
|
|
||||||
Parameter.REQUIRED,
|
|
||||||
new String[]
|
|
||||||
{ "top:com.arsdigita.ui.UserBanner"
|
|
||||||
,"bottom:com.arsdigita.ui.SiteBanner"
|
|
||||||
,"bottom:com.arsdigita.ui.DebugPanel"
|
|
||||||
//,"left:com.arsdigita.x.y.zl",
|
|
||||||
//,"right:com.arsdigita.x.y.zr",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The customized layout for applications using the SimplePage class
|
|
||||||
* Format: list presumably same format as m_defaultLayout. details unknown
|
|
||||||
*
|
|
||||||
* According to a comment in old enterprise.init file:
|
|
||||||
* // Application specific page components
|
|
||||||
* // applicationLayouts = {
|
|
||||||
* // { "forums",
|
|
||||||
* // {
|
|
||||||
* // { "top", "com.arsdigita.x.y.z" },
|
|
||||||
* // { "left", "com.arsdigita.x.y.z" },
|
|
||||||
* // { "bottom", "com.arsdigita.x.y.z" },
|
|
||||||
* // { "right", "com.arsdigita.x.y.z" }
|
|
||||||
* // }
|
|
||||||
* // },
|
|
||||||
* // { "search",
|
|
||||||
* // {
|
|
||||||
* // { "top", "com.arsdigita.x.y.z" },
|
|
||||||
* // { "left", "com.arsdigita.x.y.z" },
|
|
||||||
* // { "bottom", "com.arsdigita.x.y.z" },
|
|
||||||
* // { "right", "com.arsdigita.x.y.z" }
|
|
||||||
* // }
|
|
||||||
* // }
|
|
||||||
* // };
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private final Parameter m_applicationLayouts =
|
|
||||||
new StringArrayParameter(
|
|
||||||
"core.ui.application_layouts",
|
|
||||||
Parameter.OPTIONAL,
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
/** String containing the relative URL for the top level page
|
|
||||||
* (or entry page / home page) of the site, Without leading slash but
|
|
||||||
* with trailing slash in case of a directory.
|
|
||||||
* By default it is the login page, but usually the root page of the
|
|
||||||
* main presentation application, e.g. portal, navigation, forum, etc. */
|
|
||||||
private final Parameter m_rootPageURL =
|
|
||||||
new StringParameter("core.ui.pagemap.root_page_url",
|
|
||||||
Parameter.REQUIRED, "/register/");
|
|
||||||
|
|
||||||
/** String containing the URL of a page, a servlet or a jsp, to which a
|
|
||||||
* user after login will be redirected to.
|
|
||||||
* In case of a jsp or servlet it may contain user specific logic to
|
|
||||||
* redirect to a page specific for the user or a group of users.
|
|
||||||
* By default it is the /permissions/ page, but usually it is an
|
|
||||||
* application like personal-portal or content-center. */
|
|
||||||
private final Parameter m_userRedirectURL =
|
|
||||||
new StringParameter("core.ui.pagemap.user_redirect_url",
|
|
||||||
Parameter.REQUIRED, "/permissions/");
|
|
||||||
|
|
||||||
/** String containing the URL for the workspace of the site. */
|
|
||||||
// Old initializer: waf.pagemap.workspace
|
|
||||||
// XXX url pvt seems not to exist anymore! (pboy 2011-02-03)
|
|
||||||
private final Parameter m_workspaceURL = new StringParameter
|
|
||||||
("core.ui.pagemap.workspace_url", Parameter.REQUIRED, "pvt/");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an empty RuntimeConfig object.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public UIConfig() {
|
public UIConfig() {
|
||||||
// pboy: According to the comment for the getConfig() method a singleton
|
super();
|
||||||
// pattern is to be used. Therefore the constructor must be changed to
|
|
||||||
// private!
|
|
||||||
// private UIConfig() {
|
|
||||||
register(m_defaultLayout);
|
|
||||||
register(m_applicationLayouts);
|
|
||||||
|
|
||||||
register(m_rootPageURL);
|
|
||||||
register(m_userRedirectURL);
|
|
||||||
register(m_workspaceURL);
|
|
||||||
|
|
||||||
loadInfo();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public List<String> getDefaultLayout() {
|
||||||
* Retrieve the set of default page component objects defining
|
return new ArrayList<>(defaultLayout);
|
||||||
* the default layout for SimplePage class.
|
}
|
||||||
*/
|
|
||||||
public List getDefaultLayout() {
|
|
||||||
|
|
||||||
/** List contain the default layout used to create a SimplePage. */
|
public void setDefaultLayout(final List<String> defaultLayout) {
|
||||||
ArrayList defaultLayout = new ArrayList();
|
this.defaultLayout = defaultLayout;
|
||||||
/** Value of the defaultLayout parameter, a string array of
|
}
|
||||||
pair of position:class strings */
|
|
||||||
String[] layoutParameter = (String[]) get(m_defaultLayout) ;
|
|
||||||
|
|
||||||
for (int i = 0; i < layoutParameter.length ; ++i) {
|
public String getRootPageUrl() {
|
||||||
String[] layoutSection = StringUtils.split(layoutParameter[i],':');
|
return rootPageUrl;
|
||||||
defaultLayout.add(Arrays.asList(layoutSection));
|
}
|
||||||
|
|
||||||
|
public void setRootPageUrl(final String rootPageUrl) {
|
||||||
|
this.rootPageUrl = rootPageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserRedirectUrl() {
|
||||||
|
return userRedirectUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRedirectUrl(final String userRedirectUrl) {
|
||||||
|
this.userRedirectUrl = userRedirectUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkspaceUrl() {
|
||||||
|
return workspaceUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkspaceUrl(final String workspaceUrl) {
|
||||||
|
this.workspaceUrl = workspaceUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 31 * hash + Objects.hashCode(defaultLayout);
|
||||||
|
hash = 31 * hash + Objects.hashCode(rootPageUrl);
|
||||||
|
hash = 31 * hash + Objects.hashCode(userRedirectUrl);
|
||||||
|
hash = 31 * hash + Objects.hashCode(workspaceUrl);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return defaultLayout;
|
if (obj == null) {
|
||||||
}
|
return false;
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the set of customized layout for applications using the
|
|
||||||
* SimplePage class.
|
|
||||||
* Parameter is optional, method may return null!
|
|
||||||
*/
|
|
||||||
public List getApplicationLayouts() {
|
|
||||||
|
|
||||||
/** Value of the customLayout parameter, a string array of
|
|
||||||
pair of position:class strings */
|
|
||||||
String[] customParameter = (String[]) get(m_applicationLayouts) ;
|
|
||||||
|
|
||||||
if (customParameter != null) {
|
|
||||||
// This part of method could NOT be tested yet!
|
|
||||||
/** List contain the application layout used to create a SimplePage. */
|
|
||||||
ArrayList customLayout = new ArrayList();
|
|
||||||
for (int i = 0; i < customParameter.length ; ++i) {
|
|
||||||
String[] layoutSection = StringUtils.split(customParameter[i],':');
|
|
||||||
customLayout.add(Arrays.asList(layoutSection));
|
|
||||||
}
|
|
||||||
return customLayout;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (!(obj instanceof UIConfig)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final UIConfig other = (UIConfig) obj;
|
||||||
|
if (!Objects.equals(rootPageUrl, other.getRootPageUrl())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(userRedirectUrl, other.getUserRedirectUrl())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(workspaceUrl, other.getWorkspaceUrl())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Objects.equals(defaultLayout, other.getDefaultLayout());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Retrieve the site's root page url - i.e. the front page, the
|
public String toString() {
|
||||||
* (usually public) top level entry page for the site.
|
final StringJoiner joiner = new StringJoiner(", ");
|
||||||
* By default it is the login page, but usually the root page of the main
|
if (defaultLayout != null) {
|
||||||
* presentation application, e.g. portal, navigation, forum, etc.
|
defaultLayout.forEach(s -> joiner.add(s));
|
||||||
*
|
}
|
||||||
* @return root page url
|
|
||||||
*/
|
|
||||||
public String getRootPage() {
|
|
||||||
String rootPageURL = (String)get(m_rootPageURL) ;
|
|
||||||
// Previous configurations required NO leading slash. Just in case an
|
|
||||||
// old configuration is in place we have to translate.
|
|
||||||
return ( rootPageURL.startsWith("/") ?
|
|
||||||
rootPageURL : "/"+rootPageURL );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return String.format("%s{ "
|
||||||
* Retrieve systems user login redirect page url, that is the page, a
|
+ "defaultLayout = \"%s\", "
|
||||||
* servlet oder a JSP ti which a user is redirected to after login.
|
+ "rootPageUrl = \"%s\", "
|
||||||
* By default it is the /permissions/ page, but usually it is an application
|
+ "userRedirectUrl = \"%s\", "
|
||||||
* like personal-portal or content-center.
|
+ "workspaceUrl = \"%s\""
|
||||||
*
|
+ " }",
|
||||||
* @return user login redirect page url
|
super.toString(),
|
||||||
*/
|
defaultLayout,
|
||||||
public String getUserRedirect() {
|
rootPageUrl,
|
||||||
String userRedirectURL = (String)get(m_userRedirectURL);
|
userRedirectUrl,
|
||||||
// Previous configurations required NO leading slash. Just in case an
|
workspaceUrl);
|
||||||
// old configuration is in place we have to translate.
|
|
||||||
return ( userRedirectURL.startsWith("/") ?
|
|
||||||
userRedirectURL : "/"+userRedirectURL );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve systems workspace url.
|
|
||||||
*
|
|
||||||
* @return workspace page url
|
|
||||||
*/
|
|
||||||
public String getWorkspace() {
|
|
||||||
String workspaceURL = (String)get(m_workspaceURL);
|
|
||||||
// Previous configurations required NO leading slash. Just in case an
|
|
||||||
// old configuration is in place we have to translate.
|
|
||||||
return ( workspaceURL.startsWith("/") ?
|
|
||||||
workspaceURL : "/"+workspaceURL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import com.arsdigita.bebop.parameters.EmailParameter;
|
||||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
|
|
||||||
import static com.arsdigita.ui.admin.AdminConstants.*;
|
import static com.arsdigita.ui.admin.AdminConstants.*;
|
||||||
|
|
@ -158,7 +158,7 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
// Screen name
|
// Screen name
|
||||||
m_screenName = new TextField(new StringParameter(
|
m_screenName = new TextField(new StringParameter(
|
||||||
USER_FORM_INPUT_SCREEN_NAME));
|
USER_FORM_INPUT_SCREEN_NAME));
|
||||||
if (LegacyKernelConfig.getConfig().screenNameIsPrimaryIdentifier()) {
|
if (KernelConfig.getConfig().screenNameIsPrimaryIdentifier()) {
|
||||||
m_screenName.addValidationListener(new NotEmptyValidationListener());
|
m_screenName.addValidationListener(new NotEmptyValidationListener());
|
||||||
}
|
}
|
||||||
add(USER_FORM_LABEL_SCREEN_NAME);
|
add(USER_FORM_LABEL_SCREEN_NAME);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ import com.arsdigita.bebop.form.Password;
|
||||||
import com.arsdigita.bebop.form.Submit;
|
import com.arsdigita.bebop.form.Submit;
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.URLParameter;
|
import com.arsdigita.bebop.parameters.URLParameter;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.ui.UI;
|
import com.arsdigita.ui.UI;
|
||||||
import com.arsdigita.web.URL;
|
import com.arsdigita.web.URL;
|
||||||
import com.arsdigita.web.ReturnSignal;
|
import com.arsdigita.web.ReturnSignal;
|
||||||
|
|
@ -126,7 +126,7 @@ public class ChangePasswordForm extends Form
|
||||||
final Subject subject = cdiUtil.findBean(Subject.class);
|
final Subject subject = cdiUtil.findBean(Subject.class);
|
||||||
final Shiro shiro = cdiUtil.findBean(Shiro.class);
|
final Shiro shiro = cdiUtil.findBean(Shiro.class);
|
||||||
|
|
||||||
final LegacyKernelConfig kernelConfig = LegacyKernelConfig.getConfig();
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
final User user = shiro.getUser();
|
final User user = shiro.getUser();
|
||||||
|
|
||||||
final Label greeting = new Label(LoginHelper.getMessage(
|
final Label greeting = new Label(LoginHelper.getMessage(
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import com.arsdigita.bebop.parameters.EmailParameter;
|
||||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
@ -285,7 +285,7 @@ public abstract class UserForm extends Form
|
||||||
|
|
||||||
final String oldEmail = user.getPrimaryEmailAddress().getAddress();
|
final String oldEmail = user.getPrimaryEmailAddress().getAddress();
|
||||||
final String email = (String) m_email.getValue(state);
|
final String email = (String) m_email.getValue(state);
|
||||||
if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()
|
if (KernelConfig.getConfig().emailIsPrimaryIdentifier()
|
||||||
&& email != null && !email.equals(oldEmail)) {
|
&& email != null && !email.equals(oldEmail)) {
|
||||||
final User result = userRepository.findByEmailAddress(email);
|
final User result = userRepository.findByEmailAddress(email);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ import com.arsdigita.bebop.parameters.EmailParameter;
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.bebop.parameters.URLParameter;
|
import com.arsdigita.bebop.parameters.URLParameter;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.ui.UI;
|
import com.arsdigita.ui.UI;
|
||||||
|
|
||||||
|
|
@ -61,6 +61,7 @@ import org.apache.shiro.authc.UsernamePasswordToken;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Bebop form that accepts login and password from the user and attempts to
|
* A Bebop form that accepts login and password from the user and attempts to
|
||||||
|
|
@ -133,6 +134,8 @@ public class UserLoginForm extends Form implements LoginConstants,
|
||||||
addValidationListener(this);
|
addValidationListener(this);
|
||||||
addProcessListener(this);
|
addProcessListener(this);
|
||||||
|
|
||||||
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
|
|
||||||
m_autoRegistrationOn = autoRegistrationOn;
|
m_autoRegistrationOn = autoRegistrationOn;
|
||||||
|
|
||||||
m_timestamp = new Hidden(new StringParameter(FORM_TIMESTAMP));
|
m_timestamp = new Hidden(new StringParameter(FORM_TIMESTAMP));
|
||||||
|
|
@ -158,7 +161,7 @@ public class UserLoginForm extends Form implements LoginConstants,
|
||||||
"login.userRegistrationForm.cookieOption"));
|
"login.userRegistrationForm.cookieOption"));
|
||||||
Option opt = new Option(FORM_PERSISTENT_LOGIN_P_DEFAULT, optLabel);
|
Option opt = new Option(FORM_PERSISTENT_LOGIN_P_DEFAULT, optLabel);
|
||||||
m_isPersistent.addOption(opt);
|
m_isPersistent.addOption(opt);
|
||||||
if (LegacyKernelConfig.getConfig().isLoginRemembered()) {
|
if (kernelConfig.isRememberLoginEnabled()) {
|
||||||
m_isPersistent.setOptionSelected(FORM_PERSISTENT_LOGIN_P_DEFAULT);
|
m_isPersistent.setOptionSelected(FORM_PERSISTENT_LOGIN_P_DEFAULT);
|
||||||
}
|
}
|
||||||
cookiePanel.add(m_isPersistent);
|
cookiePanel.add(m_isPersistent);
|
||||||
|
|
@ -192,7 +195,9 @@ public class UserLoginForm extends Form implements LoginConstants,
|
||||||
"subsite:loginPromptMsg",
|
"subsite:loginPromptMsg",
|
||||||
LoginServlet.SUBSITE_NS_URI);
|
LoginServlet.SUBSITE_NS_URI);
|
||||||
|
|
||||||
if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
|
|
||||||
|
if (kernelConfig.emailIsPrimaryIdentifier()) {
|
||||||
loginMessage.setClassAttr("email");
|
loginMessage.setClassAttr("email");
|
||||||
} else {
|
} else {
|
||||||
loginMessage.setClassAttr("screenName");
|
loginMessage.setClassAttr("screenName");
|
||||||
|
|
@ -200,7 +205,7 @@ public class UserLoginForm extends Form implements LoginConstants,
|
||||||
|
|
||||||
add(loginMessage);
|
add(loginMessage);
|
||||||
|
|
||||||
if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
if (kernelConfig.emailIsPrimaryIdentifier()) {
|
||||||
add(new Label(LoginHelper.getMessage(
|
add(new Label(LoginHelper.getMessage(
|
||||||
"login.userRegistrationForm.email")));
|
"login.userRegistrationForm.email")));
|
||||||
m_loginName = new TextField(new EmailParameter(FORM_LOGIN));
|
m_loginName = new TextField(new EmailParameter(FORM_LOGIN));
|
||||||
|
|
@ -228,7 +233,10 @@ public class UserLoginForm extends Form implements LoginConstants,
|
||||||
public void init(FormSectionEvent event)
|
public void init(FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
s_log.info("In init");
|
s_log.info("In init");
|
||||||
if (LegacyKernelConfig.getConfig().isSSOenabled()) {
|
|
||||||
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
|
|
||||||
|
if (kernelConfig.isSsoEnabled()) {
|
||||||
// try SSO login
|
// try SSO login
|
||||||
s_log.info("trying SSO");
|
s_log.info("trying SSO");
|
||||||
// try {
|
// try {
|
||||||
|
|
@ -345,32 +353,6 @@ public class UserLoginForm extends Form implements LoginConstants,
|
||||||
} catch (AuthenticationException ex) {
|
} catch (AuthenticationException ex) {
|
||||||
onLoginFail(event, ex);
|
onLoginFail(event, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// try {
|
|
||||||
// final CcmSessionContext ctx = Web.getUserContext();
|
|
||||||
// final String username;
|
|
||||||
// if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
|
||||||
// username = ((InternetAddress) m_loginName.getValue(state)).
|
|
||||||
// getAddress();
|
|
||||||
// } else {
|
|
||||||
// username = (String) m_loginName.getValue(state);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final String password = ((String)m_password.getValue(state)).trim();
|
|
||||||
// boolean forever = getPersistentLoginValue(event.getPageState(),
|
|
||||||
// false);
|
|
||||||
// // attempt to log in user
|
|
||||||
// final CdiUtil cdiUtil = new CdiUtil();
|
|
||||||
// final LoginManager loginManager;
|
|
||||||
|
|
||||||
// loginManager = cdiUtil.findBean(LoginManager.class);
|
|
||||||
// loginManager.login(username, password);
|
|
||||||
// onLoginSuccess(event);
|
|
||||||
// } catch (FailedLoginException e) {
|
|
||||||
// onLoginFail(event, e);
|
|
||||||
// } catch (LoginException e) {
|
|
||||||
// onLoginException(event, e);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import com.arsdigita.bebop.form.Hidden;
|
||||||
import com.arsdigita.bebop.parameters.ArrayParameter;
|
import com.arsdigita.bebop.parameters.ArrayParameter;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.bebop.parameters.URLParameter;
|
import com.arsdigita.bebop.parameters.URLParameter;
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.ui.UI;
|
import com.arsdigita.ui.UI;
|
||||||
import com.arsdigita.web.URL;
|
import com.arsdigita.web.URL;
|
||||||
import com.arsdigita.web.ReturnSignal;
|
import com.arsdigita.web.ReturnSignal;
|
||||||
|
|
@ -121,7 +121,7 @@ public class UserNewForm extends UserForm implements FormInitListener,
|
||||||
m_confirm.setValue(state, "");
|
m_confirm.setValue(state, "");
|
||||||
String loginName = (String) m_loginName.getValue(state);
|
String loginName = (String) m_loginName.getValue(state);
|
||||||
if (loginName != null) {
|
if (loginName != null) {
|
||||||
if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
if (KernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
||||||
m_email.setValue(state, loginName);
|
m_email.setValue(state, loginName);
|
||||||
} else {
|
} else {
|
||||||
m_screenName.setValue(state, loginName);
|
m_screenName.setValue(state, loginName);
|
||||||
|
|
@ -143,7 +143,7 @@ public class UserNewForm extends UserForm implements FormInitListener,
|
||||||
final String firstName = (String) m_firstName.getValue(state);
|
final String firstName = (String) m_firstName.getValue(state);
|
||||||
final String lastName = (String) m_lastName.getValue(state);
|
final String lastName = (String) m_lastName.getValue(state);
|
||||||
final String screenName;
|
final String screenName;
|
||||||
if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
if (KernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
||||||
screenName = null;
|
screenName = null;
|
||||||
} else {
|
} else {
|
||||||
screenName = (String) m_screenName.getValue(state);
|
screenName = (String) m_screenName.getValue(state);
|
||||||
|
|
@ -175,7 +175,7 @@ public class UserNewForm extends UserForm implements FormInitListener,
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final String loginName;
|
final String loginName;
|
||||||
if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
if (KernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
||||||
loginName = email;
|
loginName = email;
|
||||||
} else {
|
} else {
|
||||||
loginName = screenName;
|
loginName = screenName;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.web;
|
package com.arsdigita.web;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
@ -48,7 +48,7 @@ public abstract class Debugger {
|
||||||
|
|
||||||
public static class DebugParameterListener implements ParameterListener {
|
public static class DebugParameterListener implements ParameterListener {
|
||||||
public void run(HttpServletRequest sreq, ParameterMap map) {
|
public void run(HttpServletRequest sreq, ParameterMap map) {
|
||||||
if (LegacyKernelConfig.getConfig().isDebugEnabled()) {
|
if (KernelConfig.getConfig().isDebugEnabled()) {
|
||||||
final String value = sreq.getParameter(DEBUG_PARAMETER);
|
final String value = sreq.getParameter(DEBUG_PARAMETER);
|
||||||
|
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
|
|
@ -86,7 +86,7 @@ public abstract class Debugger {
|
||||||
private static class DebuggerListLocal extends InternalRequestLocal {
|
private static class DebuggerListLocal extends InternalRequestLocal {
|
||||||
@Override
|
@Override
|
||||||
protected Object initialValue() {
|
protected Object initialValue() {
|
||||||
if (LegacyKernelConfig.getConfig().isDebugEnabled()) {
|
if (KernelConfig.getConfig().isDebugEnabled()) {
|
||||||
return new ArrayList();
|
return new ArrayList();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -95,7 +95,7 @@ public abstract class Debugger {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void clearValue() {
|
protected void clearValue() {
|
||||||
if (LegacyKernelConfig.getConfig().isDebugEnabled()) {
|
if (KernelConfig.getConfig().isDebugEnabled()) {
|
||||||
ArrayList list = (ArrayList) get();
|
ArrayList list = (ArrayList) get();
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.logging.log4j.message.FormattedMessage;
|
import org.apache.logging.log4j.message.FormattedMessage;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -497,11 +498,13 @@ public class ConfigurationManager {
|
||||||
} else if (Double.class.getName().equals(valueTypeName)) {
|
} else if (Double.class.getName().equals(valueTypeName)) {
|
||||||
return (AbstractSetting<T>) new DoubleSetting();
|
return (AbstractSetting<T>) new DoubleSetting();
|
||||||
} else if (List.class.getName().equals(valueTypeName)) {
|
} else if (List.class.getName().equals(valueTypeName)) {
|
||||||
return (AbstractSetting<T>) new EnumSetting();
|
return (AbstractSetting<T>) new StringListSetting();
|
||||||
} else if (LocalizedString.class.getName().equals(valueTypeName)) {
|
} else if (LocalizedString.class.getName().equals(valueTypeName)) {
|
||||||
return (AbstractSetting<T>) new LocalizedStringSetting();
|
return (AbstractSetting<T>) new LocalizedStringSetting();
|
||||||
} else if (Long.class.getName().equals(valueTypeName)) {
|
} else if (Long.class.getName().equals(valueTypeName)) {
|
||||||
return (AbstractSetting<T>) new LongSetting();
|
return (AbstractSetting<T>) new LongSetting();
|
||||||
|
} else if (Set.class.getName().equals(valueTypeName)) {
|
||||||
|
return (AbstractSetting<T>) new EnumSetting();
|
||||||
} else if (String.class.getName().equals(valueTypeName)) {
|
} else if (String.class.getName().equals(valueTypeName)) {
|
||||||
return (AbstractSetting<T>) new StringSetting();
|
return (AbstractSetting<T>) new StringSetting();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,9 @@ package org.libreccm.configuration;
|
||||||
import static org.libreccm.core.CoreConstants.*;
|
import static org.libreccm.core.CoreConstants.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collections;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -110,14 +111,15 @@ public class EnumSetting
|
||||||
final StringBuffer enumValues = new StringBuffer();
|
final StringBuffer enumValues = new StringBuffer();
|
||||||
enumValues.append("{ ");
|
enumValues.append("{ ");
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
value.forEach((String v) -> {
|
final List<String> values = new ArrayList<>(value);
|
||||||
|
values.forEach((String v) -> {
|
||||||
enumValues.append('\"').append(v).append('\"');
|
enumValues.append('\"').append(v).append('\"');
|
||||||
if (enumValues.indexOf(v) != enumValues.length() - 1) {
|
if (values.indexOf(v) != values.size()- 1) {
|
||||||
enumValues.append(", ");
|
enumValues.append(", ");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
enumValues.append(" }");
|
|
||||||
}
|
}
|
||||||
|
enumValues.append(" }");
|
||||||
|
|
||||||
return super.toString(String.format(", value = %s%s",
|
return super.toString(String.format(", value = %s%s",
|
||||||
enumValues.toString(),
|
enumValues.toString(),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
/*
|
||||||
|
* 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.configuration;
|
||||||
|
|
||||||
|
import static org.libreccm.core.CoreConstants.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import javax.persistence.ElementCollection;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.JoinTable;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "SETTINGS_STRING_LIST", schema = DB_SCHEMA)
|
||||||
|
public class StringListSetting extends AbstractSetting<List<String>> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7093818804712916413L;
|
||||||
|
|
||||||
|
@ElementCollection
|
||||||
|
@JoinTable(name = "SETTINGS_STRING_LIST",
|
||||||
|
schema = DB_SCHEMA,
|
||||||
|
joinColumns = {@JoinColumn(name = "LIST_ID")})
|
||||||
|
private List<String> value;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getValue() {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return new ArrayList<>(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setValue(final List<String> value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addListValue(final String value) {
|
||||||
|
this.value.add(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeListValue(final String value) {
|
||||||
|
this.value.remove(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 41 * hash + Objects.hashCode(value);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof StringListSetting)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final StringListSetting other = (StringListSetting) obj;
|
||||||
|
if (!other.canEqual(this)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Objects.equals(value, other.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canEqual(final Object obj) {
|
||||||
|
return obj instanceof StringListSetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(final String data) {
|
||||||
|
final StringBuilder listValues = new StringBuilder();
|
||||||
|
listValues.append("{ ");
|
||||||
|
if (value != null) {
|
||||||
|
value.forEach((String v) -> {
|
||||||
|
listValues.append('\"').append(v).append('\"');
|
||||||
|
if (value.indexOf(v) != value.size() - 1) {
|
||||||
|
listValues.append(", ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
listValues.append(" }");
|
||||||
|
|
||||||
|
return super.toString(String.format(", value = %s%s",
|
||||||
|
listValues.toString(),
|
||||||
|
data));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
import org.apache.shiro.authc.AuthenticationException;
|
import org.apache.shiro.authc.AuthenticationException;
|
||||||
import org.apache.shiro.authc.AuthenticationInfo;
|
import org.apache.shiro.authc.AuthenticationInfo;
|
||||||
|
|
@ -202,7 +202,7 @@ public class CcmShiroRealm extends AuthorizingRealm {
|
||||||
|
|
||||||
// Depending of the configuration of CCM use the appropriate method
|
// Depending of the configuration of CCM use the appropriate method
|
||||||
// for finding the user in the database.
|
// for finding the user in the database.
|
||||||
final LegacyKernelConfig config = LegacyKernelConfig.getConfig();
|
final KernelConfig config = KernelConfig.getConfig();
|
||||||
final User user;
|
final User user;
|
||||||
if ("email".equals(config.getPrimaryUserIdentifier())) {
|
if ("email".equals(config.getPrimaryUserIdentifier())) {
|
||||||
user = userRepository.findByEmailAddress(userIdentifier);
|
user = userRepository.findByEmailAddress(userIdentifier);
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import javax.enterprise.context.ApplicationScoped;
|
||||||
import javax.enterprise.inject.Produces;
|
import javax.enterprise.inject.Produces;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
|
@ -97,7 +99,7 @@ public class Shiro {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Subject getPublicUser() {
|
public Subject getPublicUser() {
|
||||||
if (LegacyKernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
if (KernelConfig.getConfig().emailIsPrimaryIdentifier()) {
|
||||||
return buildInternalSubject("public-user@localhost");
|
return buildInternalSubject("public-user@localhost");
|
||||||
} else {
|
} else {
|
||||||
return buildInternalSubject("public-user");
|
return buildInternalSubject("public-user");
|
||||||
|
|
@ -109,7 +111,7 @@ public class Shiro {
|
||||||
}
|
}
|
||||||
|
|
||||||
public User getUser() {
|
public User getUser() {
|
||||||
final LegacyKernelConfig kernelConfig = LegacyKernelConfig.getConfig();
|
final KernelConfig kernelConfig = KernelConfig.getConfig();
|
||||||
if (kernelConfig.emailIsPrimaryIdentifier()) {
|
if (kernelConfig.emailIsPrimaryIdentifier()) {
|
||||||
return userRepository.findByEmailAddress((String) getSubject().
|
return userRepository.findByEmailAddress((String) getSubject().
|
||||||
getPrincipal());
|
getPrincipal());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<registry>
|
|
||||||
<config class="com.arsdigita.kernel.KernelConfig"
|
|
||||||
storage="ccm-core/kernel.properties"/>
|
|
||||||
</registry>
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
# 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
|
||||||
|
|
||||||
|
notification.config.description=Configuration for the notification system
|
||||||
|
|
||||||
|
notification.config.request_manager_delay=Start of request manager's delay in seconds.
|
||||||
|
notification.config.request_manager_period=Request manager's activities period in seconds
|
||||||
|
|
||||||
|
notification.config.digest_queue_delay=Start of Digest Queue's delay in seconds.
|
||||||
|
notification.config.digest_queue_period=Digest Queue's activities period in seconds
|
||||||
|
|
||||||
|
notification.config.simple_queue_delay=Start of Simple Queue's delay in seconds.
|
||||||
|
notification.config.simple_queue_period=Simple Queue's activities period in seconds
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
ui.config.description=Configuration for the UI system
|
||||||
|
|
||||||
|
ui.config.default_layout=Default layout components for SimplePage class
|
||||||
|
ui.config.root_page_url=Enter the relative URL for top-level page (to document root and without constant prefix if configured)
|
||||||
|
ui.config.user_redirect_url=Enter the relative URL to a page which redirects the request according to the logged in user (if exists)
|
||||||
|
ui.config.workspace_url=Enter the relative URL for the Workspace Page (to document root and without constant prefix if configured)
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
create table CCM_CORE.APPLICATIONS (
|
create table CCM_CORE.APPLICATIONS (
|
||||||
APPLICATION_TYPE varchar(1024) not null,
|
APPLICATION_TYPE varchar(1024) not null,
|
||||||
PRIMARY_URL varchar(1024) not null,
|
PRIMARY_URL varchar(1024) not null,
|
||||||
|
|
@ -518,6 +517,13 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CORE.SETTINGS_STRING_LIST (
|
||||||
|
OBJECT_ID bigint not null,
|
||||||
|
LIST_ID bigint not null,
|
||||||
|
value varchar(255),
|
||||||
|
primary key (OBJECT_ID)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CORE.TASK_ASSIGNMENTS (
|
create table CCM_CORE.TASK_ASSIGNMENTS (
|
||||||
TASK_ASSIGNMENT_ID bigint not null,
|
TASK_ASSIGNMENT_ID bigint not null,
|
||||||
ROLE_ID bigint,
|
ROLE_ID bigint,
|
||||||
|
|
@ -1048,6 +1054,16 @@
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CORE.SETTINGS;
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_34s3comqq4mhy9kcr04iavfef
|
||||||
|
foreign key (OBJECT_ID)
|
||||||
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_obwiaa74lrjqjlpjidjltysoq
|
||||||
|
foreign key (LIST_ID)
|
||||||
|
references CCM_CORE.SETTINGS_STRING_LIST;
|
||||||
|
|
||||||
alter table CCM_CORE.TASK_ASSIGNMENTS
|
alter table CCM_CORE.TASK_ASSIGNMENTS
|
||||||
add constraint FK_klh64or0yq26c63181j1tps2o
|
add constraint FK_klh64or0yq26c63181j1tps2o
|
||||||
foreign key (ROLE_ID)
|
foreign key (ROLE_ID)
|
||||||
|
|
|
||||||
|
|
@ -518,6 +518,13 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CORE.SETTINGS_STRING_LIST (
|
||||||
|
OBJECT_ID int8 not null,
|
||||||
|
LIST_ID int8 not null,
|
||||||
|
value varchar(255),
|
||||||
|
primary key (OBJECT_ID)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CORE.TASK_ASSIGNMENTS (
|
create table CCM_CORE.TASK_ASSIGNMENTS (
|
||||||
TASK_ASSIGNMENT_ID int8 not null,
|
TASK_ASSIGNMENT_ID int8 not null,
|
||||||
ROLE_ID int8,
|
ROLE_ID int8,
|
||||||
|
|
@ -1048,6 +1055,16 @@
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CORE.SETTINGS;
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_34s3comqq4mhy9kcr04iavfef
|
||||||
|
foreign key (OBJECT_ID)
|
||||||
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_obwiaa74lrjqjlpjidjltysoq
|
||||||
|
foreign key (LIST_ID)
|
||||||
|
references CCM_CORE.SETTINGS_STRING_LIST;
|
||||||
|
|
||||||
alter table CCM_CORE.TASK_ASSIGNMENTS
|
alter table CCM_CORE.TASK_ASSIGNMENTS
|
||||||
add constraint FK_klh64or0yq26c63181j1tps2o
|
add constraint FK_klh64or0yq26c63181j1tps2o
|
||||||
foreign key (ROLE_ID)
|
foreign key (ROLE_ID)
|
||||||
|
|
|
||||||
|
|
@ -1,181 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2015 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.kernel;
|
|
||||||
|
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
|
||||||
import com.arsdigita.util.JavaPropertyReader;
|
|
||||||
import com.arsdigita.util.parameter.AbstractParameter;
|
|
||||||
import com.arsdigita.web.CCMApplicationContextListener;
|
|
||||||
import com.arsdigita.xml.XML;
|
|
||||||
import com.arsdigita.xml.formatters.DateFormatter;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
|
||||||
|
|
||||||
import org.jboss.arquillian.container.test.api.Deployment;
|
|
||||||
import org.jboss.arquillian.junit.Arquillian;
|
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
|
||||||
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.experimental.categories.Category;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.libreccm.categorization.Categorization;
|
|
||||||
import org.libreccm.core.CcmObject;
|
|
||||||
import org.libreccm.jpa.EntityManagerProducer;
|
|
||||||
import org.libreccm.jpa.utils.UriConverter;
|
|
||||||
import org.libreccm.l10n.LocalizedString;
|
|
||||||
import org.libreccm.security.Permission;
|
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
|
||||||
import org.libreccm.web.ApplicationRepository;
|
|
||||||
import org.libreccm.workflow.Workflow;
|
|
||||||
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
|
||||||
*/
|
|
||||||
@RunWith(Arquillian.class)
|
|
||||||
@Category(IntegrationTest.class)
|
|
||||||
public class LegacyKernelConfigTest {
|
|
||||||
|
|
||||||
public LegacyKernelConfigTest() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setUpClass() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void tearDownClass() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@After
|
|
||||||
public void tearDown() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deployment
|
|
||||||
public static WebArchive createDeployment() {
|
|
||||||
final PomEquippedResolveStage pom = Maven
|
|
||||||
.resolver()
|
|
||||||
.loadPomFromFile("pom.xml");
|
|
||||||
final PomEquippedResolveStage dependencies = pom
|
|
||||||
.importCompileAndRuntimeDependencies();
|
|
||||||
final File[] libs = dependencies.resolve().withTransitivity().asFile();
|
|
||||||
|
|
||||||
for (File lib : libs) {
|
|
||||||
System.err.printf("Adding file '%s' to test archive...%n",
|
|
||||||
lib.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
return ShrinkWrap
|
|
||||||
.create(WebArchive.class,
|
|
||||||
"LibreCCM-com.arsdigita.kernel.KernelConfigTest.war")
|
|
||||||
.addPackage(CcmObject.class.getPackage())
|
|
||||||
.addPackage(Categorization.class.getPackage())
|
|
||||||
.addPackage(Permission.class.getPackage())
|
|
||||||
.addPackage(LocalizedString.class.getPackage())
|
|
||||||
.addPackage(Workflow.class.getPackage())
|
|
||||||
.addPackage(UriConverter.class.getPackage())
|
|
||||||
.addPackage(ApplicationRepository.class.getPackage())
|
|
||||||
.addPackage(EntityManagerProducer.class.getPackage())
|
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
|
||||||
.addPackage(AbstractParameter.class.getPackage())
|
|
||||||
.addPackage(JavaPropertyReader.class.getPackage())
|
|
||||||
.addPackage(CCMApplicationContextListener.class.getPackage())
|
|
||||||
.addPackage(XML.class.getPackage())
|
|
||||||
.addPackage(DateFormatter.class.getPackage())
|
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
|
||||||
.addAsLibraries(libs)
|
|
||||||
.addAsResource(
|
|
||||||
"configs/com/arsdigita/kernel/KernelConfigTest/ccm-core.config",
|
|
||||||
"ccm-core.config")
|
|
||||||
.addAsWebInfResource(
|
|
||||||
"configs/com/arsdigita/kernel/KernelConfigTest/registry.properties",
|
|
||||||
"conf/registry/registry.properties")
|
|
||||||
.addAsWebInfResource(
|
|
||||||
"configs/com/arsdigita/kernel/KernelConfigTest/kernel.properties",
|
|
||||||
"conf/registry/ccm-core/kernel.properties")
|
|
||||||
.addAsResource(
|
|
||||||
"com/arsdigita/kernel/KernelConfig_parameter.properties",
|
|
||||||
"com/arsdigita/kernel/KernelConfig_parameter.properties")
|
|
||||||
.addAsResource("test-persistence.xml",
|
|
||||||
"META-INF/persistence.xml")
|
|
||||||
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
|
||||||
.addAsResource("configs/shiro.ini", "shiro.ini")
|
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void verifyKernelConfig() {
|
|
||||||
final LegacyKernelConfig kernelConfig = LegacyKernelConfig.getConfig();
|
|
||||||
|
|
||||||
assertThat(kernelConfig.isDebugEnabled(),
|
|
||||||
is(true));
|
|
||||||
assertThat(kernelConfig.isWebdevSupportActive(),
|
|
||||||
is(false));
|
|
||||||
assertThat(kernelConfig.isDataPermissionCheckEnabled(),
|
|
||||||
is(false));
|
|
||||||
assertThat(kernelConfig.getPrimaryUserIdentifier(),
|
|
||||||
is(equalTo("email")));
|
|
||||||
assertThat(kernelConfig.screenNameIsPrimaryIdentifier(),
|
|
||||||
is(false));
|
|
||||||
assertThat(kernelConfig.emailIsPrimaryIdentifier(),
|
|
||||||
is(true));
|
|
||||||
assertThat(kernelConfig.isSSOenabled(),
|
|
||||||
is(false));
|
|
||||||
assertThat(kernelConfig.isLoginRemembered(),
|
|
||||||
is(true));
|
|
||||||
assertThat(kernelConfig.isSecureLoginRequired(),
|
|
||||||
is(false));
|
|
||||||
assertThat(kernelConfig.getSupportedLanguages(),
|
|
||||||
is(equalTo("de,en")));
|
|
||||||
assertThat(kernelConfig.languageIndependentItems(),
|
|
||||||
is(true));
|
|
||||||
assertThat(kernelConfig.getLanguagesIndependentCode(),
|
|
||||||
is(equalTo("--")));
|
|
||||||
assertThat(kernelConfig.hasLanguage("de"),
|
|
||||||
is(true));
|
|
||||||
assertThat(kernelConfig.hasLanguage("en"),
|
|
||||||
is(true));
|
|
||||||
assertThat(kernelConfig.hasLanguage("es"),
|
|
||||||
is(false));
|
|
||||||
assertThat(kernelConfig.getDefaultLanguage(),
|
|
||||||
is(equalTo("de")));
|
|
||||||
final StringTokenizer tokenizer = kernelConfig
|
|
||||||
.getSupportedLanguagesTokenizer();
|
|
||||||
assertThat(tokenizer.countTokens(), is(2));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.kernel.security;
|
package com.arsdigita.kernel.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.JavaPropertyReader;
|
import com.arsdigita.util.JavaPropertyReader;
|
||||||
import com.arsdigita.util.parameter.AbstractParameter;
|
import com.arsdigita.util.parameter.AbstractParameter;
|
||||||
|
|
@ -111,7 +110,6 @@ public class SecurityConfigTest {
|
||||||
.addPackage(UriConverter.class.getPackage())
|
.addPackage(UriConverter.class.getPackage())
|
||||||
.addPackage(ApplicationRepository.class.getPackage())
|
.addPackage(ApplicationRepository.class.getPackage())
|
||||||
.addPackage(EntityManagerProducer.class.getPackage())
|
.addPackage(EntityManagerProducer.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameter.class.getPackage())
|
.addPackage(AbstractParameter.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -136,7 +135,6 @@ public class AuthorizationInterceptorTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
import com.arsdigita.util.parameter.AbstractParameterContext;
|
import com.arsdigita.util.parameter.AbstractParameterContext;
|
||||||
import com.arsdigita.web.CCMApplicationContextListener;
|
import com.arsdigita.web.CCMApplicationContextListener;
|
||||||
|
|
@ -132,9 +130,7 @@ public class GroupManagerTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
.addPackage(CCMApplicationContextListener.class.getPackage())
|
.addPackage(CCMApplicationContextListener.class.getPackage())
|
||||||
.addPackage(XML.class.getPackage())
|
.addPackage(XML.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -146,7 +145,6 @@ public class PermissionCheckerTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -137,7 +136,6 @@ public class PermissionManagerTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -132,7 +131,6 @@ public class RoleManagerTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -163,7 +162,6 @@ public class SecuredCollectionTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -163,7 +162,6 @@ public class SecuredIteratorTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -132,7 +131,6 @@ public class ShiroTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.security;
|
package org.libreccm.security;
|
||||||
|
|
||||||
import com.arsdigita.kernel.LegacyKernelConfig;
|
|
||||||
import com.arsdigita.kernel.security.SecurityConfig;
|
import com.arsdigita.kernel.security.SecurityConfig;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
@ -133,7 +132,6 @@ public class UserManagerTest {
|
||||||
.addPackage(MimeTypeConverter.class.getPackage())
|
.addPackage(MimeTypeConverter.class.getPackage())
|
||||||
.addPackage(EqualsVerifier.class.getPackage())
|
.addPackage(EqualsVerifier.class.getPackage())
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
.addPackage(IntegrationTest.class.getPackage())
|
||||||
.addPackage(LegacyKernelConfig.class.getPackage())
|
|
||||||
.addPackage(SecurityConfig.class.getPackage())
|
.addPackage(SecurityConfig.class.getPackage())
|
||||||
.addPackage(AbstractConfig.class.getPackage())
|
.addPackage(AbstractConfig.class.getPackage())
|
||||||
.addPackage(AbstractParameterContext.class.getPackage())
|
.addPackage(AbstractParameterContext.class.getPackage())
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
|
||||||
|
|
||||||
CREATE SCHEMA ccm_core;
|
CREATE SCHEMA ccm_core;
|
||||||
|
|
||||||
|
|
||||||
create table CCM_CORE.APPLICATIONS (
|
create table CCM_CORE.APPLICATIONS (
|
||||||
APPLICATION_TYPE varchar(1024) not null,
|
APPLICATION_TYPE varchar(1024) not null,
|
||||||
PRIMARY_URL varchar(1024) not null,
|
PRIMARY_URL varchar(1024) not null,
|
||||||
|
|
@ -524,6 +523,13 @@ CREATE SCHEMA ccm_core;
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CORE.SETTINGS_STRING_LIST (
|
||||||
|
OBJECT_ID bigint not null,
|
||||||
|
LIST_ID bigint not null,
|
||||||
|
value varchar(255),
|
||||||
|
primary key (OBJECT_ID)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CORE.TASK_ASSIGNMENTS (
|
create table CCM_CORE.TASK_ASSIGNMENTS (
|
||||||
TASK_ASSIGNMENT_ID bigint not null,
|
TASK_ASSIGNMENT_ID bigint not null,
|
||||||
ROLE_ID bigint,
|
ROLE_ID bigint,
|
||||||
|
|
@ -1054,6 +1060,16 @@ CREATE SCHEMA ccm_core;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CORE.SETTINGS;
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_34s3comqq4mhy9kcr04iavfef
|
||||||
|
foreign key (OBJECT_ID)
|
||||||
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_obwiaa74lrjqjlpjidjltysoq
|
||||||
|
foreign key (LIST_ID)
|
||||||
|
references CCM_CORE.SETTINGS_STRING_LIST;
|
||||||
|
|
||||||
alter table CCM_CORE.TASK_ASSIGNMENTS
|
alter table CCM_CORE.TASK_ASSIGNMENTS
|
||||||
add constraint FK_klh64or0yq26c63181j1tps2o
|
add constraint FK_klh64or0yq26c63181j1tps2o
|
||||||
foreign key (ROLE_ID)
|
foreign key (ROLE_ID)
|
||||||
|
|
|
||||||
|
|
@ -524,6 +524,13 @@ CREATE SCHEMA ccm_core;
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CORE.SETTINGS_STRING_LIST (
|
||||||
|
OBJECT_ID int8 not null,
|
||||||
|
LIST_ID int8 not null,
|
||||||
|
value varchar(255),
|
||||||
|
primary key (OBJECT_ID)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CORE.TASK_ASSIGNMENTS (
|
create table CCM_CORE.TASK_ASSIGNMENTS (
|
||||||
TASK_ASSIGNMENT_ID int8 not null,
|
TASK_ASSIGNMENT_ID int8 not null,
|
||||||
ROLE_ID int8,
|
ROLE_ID int8,
|
||||||
|
|
@ -1054,6 +1061,16 @@ CREATE SCHEMA ccm_core;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CORE.SETTINGS;
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_34s3comqq4mhy9kcr04iavfef
|
||||||
|
foreign key (OBJECT_ID)
|
||||||
|
references CCM_CORE.SETTINGS;
|
||||||
|
|
||||||
|
alter table CCM_CORE.SETTINGS_STRING_LIST
|
||||||
|
add constraint FK_obwiaa74lrjqjlpjidjltysoq
|
||||||
|
foreign key (LIST_ID)
|
||||||
|
references CCM_CORE.SETTINGS_STRING_LIST;
|
||||||
|
|
||||||
alter table CCM_CORE.TASK_ASSIGNMENTS
|
alter table CCM_CORE.TASK_ASSIGNMENTS
|
||||||
add constraint FK_klh64or0yq26c63181j1tps2o
|
add constraint FK_klh64or0yq26c63181j1tps2o
|
||||||
foreign key (ROLE_ID)
|
foreign key (ROLE_ID)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue