- Migrated MailConfig and XmlConfig to new configuration system
    - Replaced StringJoiner to several toString methods with collection.stream().collect and Collectors#joining    


git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3797 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2016-01-14 18:17:44 +00:00
parent 05102e0269
commit a1bef5b73f
12 changed files with 743 additions and 503 deletions

View File

@ -23,16 +23,20 @@ import com.arsdigita.bebop.util.BebopConstants;
import com.arsdigita.templating.PresentationManager; import com.arsdigita.templating.PresentationManager;
import com.arsdigita.ui.SimplePage; import com.arsdigita.ui.SimplePage;
import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.UncheckedWrapperException;
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 java.util.StringJoiner; import java.util.StringJoiner;
import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.Configuration; import org.libreccm.configuration.Configuration;
import org.libreccm.configuration.ConfigurationManager; import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.configuration.Setting; import org.libreccm.configuration.Setting;
import java.util.stream.Collectors;
/** /**
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
@ -40,165 +44,167 @@ import org.libreccm.configuration.Setting;
@Configuration(descBundle = "com.arsdigita.bebop.BebopConfigDescription", @Configuration(descBundle = "com.arsdigita.bebop.BebopConfigDescription",
descKey = "bebop.config.description") descKey = "bebop.config.description")
public final class BebopConfig { public final class BebopConfig {
@Setting(descKey = "bebop.config.presenter_class_name") @Setting(descKey = "bebop.config.presenter_class_name")
private String presenterClassName = PageTransformer.class.getName(); private String presenterClassName = PageTransformer.class.getName();
@Setting(descKey = "bebop.config.base_page_name") @Setting(descKey = "bebop.config.base_page_name")
private String basePageClassName = SimplePage.class.getName(); private String basePageClassName = SimplePage.class.getName();
@Setting(descKey = "bebop.config.tidy_config_file") @Setting(descKey = "bebop.config.tidy_config_file")
private String tidyConfigFile private String tidyConfigFile
= "com/arsdigita/bebop/parameters/tidy.properties"; = "com/arsdigita/bebop/parameters/tidy.properties";
@Setting(descKey = "bebop.config.fancy_errors") @Setting(descKey = "bebop.config.fancy_errors")
private Boolean fancyErrors = false; private Boolean fancyErrors = false;
@Setting(descKey = "bebop.config.dcp_on_buttons") @Setting(descKey = "bebop.config.dcp_on_buttons")
private Boolean dcpOnButtons = true; private Boolean dcpOnButtons = true;
@Setting(descKey = "bebop.config.dcp_on_links") @Setting(descKey = "bebop.config.dcp_on_links")
private Boolean dcpOnLinks = false; private Boolean dcpOnLinks = false;
@Setting(descKey = "bebop.config.tree_select_enabled") @Setting(descKey = "bebop.config.tree_select_enabled")
private Boolean treeSelectEnabled = false; private Boolean treeSelectEnabled = false;
@Setting(descKey = "bebop.config.dhtml_editors") @Setting(descKey = "bebop.config.dhtml_editors")
private Set<String> dhtmlEditors = new HashSet<>( private Set<String> dhtmlEditors = new HashSet<>(
Arrays.asList(new String[]{BebopConstants.BEBOP_XINHAEDITOR, Arrays.asList(new String[]{BebopConstants.BEBOP_XINHAEDITOR,
BebopConstants.BEBOP_FCKEDITOR, BebopConstants.BEBOP_FCKEDITOR,
BebopConstants.BEBOP_DHTMLEDITOR})); BebopConstants.BEBOP_DHTMLEDITOR}));
@Setting(descKey = "bebop.config.default_dhtml_editor") @Setting(descKey = "bebop.config.default_dhtml_editor")
private String defaultDhtmlEditor = BebopConstants.BEBOP_XINHAEDITOR; private String defaultDhtmlEditor = BebopConstants.BEBOP_XINHAEDITOR;
@Setting(descKey = "bebop.config.dhtml_editor_srcfile") @Setting(descKey = "bebop.config.dhtml_editor_srcfile")
private String dhtmlEditorSrcFile = "/assets/xinha/XinhaLoader.js"; private String dhtmlEditorSrcFile = "/assets/xinha/XinhaLoader.js";
@Setting(descKey = "bebop.config.show_class_name") @Setting(descKey = "bebop.config.show_class_name")
private Boolean showClassName = false; private Boolean showClassName = false;
public static BebopConfig getConfig() { public static BebopConfig getConfig() {
final CdiUtil cdiUtil = new CdiUtil(); final CdiUtil cdiUtil = new CdiUtil();
final ConfigurationManager confManager = cdiUtil.findBean( final ConfigurationManager confManager = cdiUtil.findBean(
ConfigurationManager.class); ConfigurationManager.class);
return confManager.findConfiguration(BebopConfig.class); return confManager.findConfiguration(BebopConfig.class);
} }
public String getPresenterClassName() { public String getPresenterClassName() {
return presenterClassName; return presenterClassName;
} }
@SuppressWarnings("unchecked")
public Class<PresentationManager> getPresenterClass() { public Class<PresentationManager> getPresenterClass() {
try { try {
return (Class<PresentationManager>) Class. return (Class<PresentationManager>) Class.
forName(presenterClassName); forName(presenterClassName);
} catch (ClassNotFoundException ex) { } catch (ClassNotFoundException ex) {
throw new UncheckedWrapperException(ex); throw new UncheckedWrapperException(ex);
} }
} }
public void setPresenterClassName(final String presenterClassName) { public void setPresenterClassName(final String presenterClassName) {
this.presenterClassName = presenterClassName; this.presenterClassName = presenterClassName;
} }
public void setPresenterClass( public void setPresenterClass(
final Class<PresentationManager> presenterClass) { final Class<PresentationManager> presenterClass) {
setPresenterClassName(presenterClass.getName()); setPresenterClassName(presenterClass.getName());
} }
public String getBasePageClassName() { public String getBasePageClassName() {
return basePageClassName; return basePageClassName;
} }
@SuppressWarnings("unchecked")
public Class<BasePage> getBasePageClass() { public Class<BasePage> getBasePageClass() {
try { try {
return (Class<BasePage>)Class.forName(basePageClassName); return (Class<BasePage>) Class.forName(basePageClassName);
} catch (ClassNotFoundException ex) { } catch (ClassNotFoundException ex) {
throw new UncheckedWrapperException(ex); throw new UncheckedWrapperException(ex);
} }
} }
public void setBasePageClassName(final String basePageClassName) { public void setBasePageClassName(final String basePageClassName) {
this.basePageClassName = basePageClassName; this.basePageClassName = basePageClassName;
} }
public void setBasePageClass(final Class<BasePage> basePageClass) { public void setBasePageClass(final Class<BasePage> basePageClass) {
setBasePageClassName(basePageClass.getName()); setBasePageClassName(basePageClass.getName());
} }
public String getTidyConfigFile() { public String getTidyConfigFile() {
return tidyConfigFile; return tidyConfigFile;
} }
public void setTidyConfigFile(final String tidyConfigFile) { public void setTidyConfigFile(final String tidyConfigFile) {
this.tidyConfigFile = tidyConfigFile; this.tidyConfigFile = tidyConfigFile;
} }
public Boolean getFancyErrors() { public Boolean getFancyErrors() {
return fancyErrors; return fancyErrors;
} }
public void setFancyErrors(final Boolean fancyErrors) { public void setFancyErrors(final Boolean fancyErrors) {
this.fancyErrors = fancyErrors; this.fancyErrors = fancyErrors;
} }
public Boolean getDcpOnButtons() { public Boolean getDcpOnButtons() {
return dcpOnButtons; return dcpOnButtons;
} }
public void setDcpOnButtons(final Boolean dcpOnButtons) { public void setDcpOnButtons(final Boolean dcpOnButtons) {
this.dcpOnButtons = dcpOnButtons; this.dcpOnButtons = dcpOnButtons;
} }
public Boolean getDcpOnLinks() { public Boolean getDcpOnLinks() {
return dcpOnLinks; return dcpOnLinks;
} }
public void setDcpOnLinks(final Boolean dcpOnLinks) { public void setDcpOnLinks(final Boolean dcpOnLinks) {
this.dcpOnLinks = dcpOnLinks; this.dcpOnLinks = dcpOnLinks;
} }
public Boolean isTreeSelectEnabled() { public Boolean isTreeSelectEnabled() {
return treeSelectEnabled; return treeSelectEnabled;
} }
public void setTreeSelectEnabled(final Boolean treeSelectEnabled) { public void setTreeSelectEnabled(final Boolean treeSelectEnabled) {
this.treeSelectEnabled = treeSelectEnabled; this.treeSelectEnabled = treeSelectEnabled;
} }
public Set<String> getDhtmlEditors() { public Set<String> getDhtmlEditors() {
return new HashSet<>(dhtmlEditors); return new HashSet<>(dhtmlEditors);
} }
public void setDhtmlEditors(final Set<String> dhtmlEditors) { public void setDhtmlEditors(final Set<String> dhtmlEditors) {
this.dhtmlEditors = dhtmlEditors; this.dhtmlEditors = dhtmlEditors;
} }
public String getDefaultDhtmlEditor() { public String getDefaultDhtmlEditor() {
return defaultDhtmlEditor; return defaultDhtmlEditor;
} }
public void setDefaultDhtmlEditor(final String defaultDhtmlEditor) { public void setDefaultDhtmlEditor(final String defaultDhtmlEditor) {
this.defaultDhtmlEditor = defaultDhtmlEditor; this.defaultDhtmlEditor = defaultDhtmlEditor;
} }
public String getDhtmlEditorSrcFile() { public String getDhtmlEditorSrcFile() {
return dhtmlEditorSrcFile; return dhtmlEditorSrcFile;
} }
public void setDhtmlEditorSrcFile(final String dhtmlEditorSrcFile) { public void setDhtmlEditorSrcFile(final String dhtmlEditorSrcFile) {
this.dhtmlEditorSrcFile = dhtmlEditorSrcFile; this.dhtmlEditorSrcFile = dhtmlEditorSrcFile;
} }
public Boolean getShowClassName() { public Boolean getShowClassName() {
return showClassName; return showClassName;
} }
public void setShowClassName(final Boolean showClassName) { public void setShowClassName(final Boolean showClassName) {
this.showClassName = showClassName; this.showClassName = showClassName;
} }
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 7; int hash = 7;
@ -213,7 +219,7 @@ public final class BebopConfig {
hash = 89 * hash + Objects.hashCode(showClassName); hash = 89 * hash + Objects.hashCode(showClassName);
return hash; return hash;
} }
@Override @Override
public boolean equals(final Object obj) { public boolean equals(final Object obj) {
if (this == obj) { if (this == obj) {
@ -252,32 +258,31 @@ public final class BebopConfig {
} }
return Objects.equals(showClassName, other.getShowClassName()); return Objects.equals(showClassName, other.getShowClassName());
} }
@Override @Override
public String toString() { public String toString() {
final StringJoiner joiner = new StringJoiner(", "); return String.format(
dhtmlEditors.forEach(s -> joiner.add(s)); "%s{ "
+ "tidyConfigFile = %s, "
return String.format("%s{ " + "fancyErrors = %b, "
+ "tidyConfigFile = %s, " + "dcpOnButtons = %b, "
+ "fancyErrors = %b, " + "dcpOnLinks = %b, "
+ "dcpOnButtons = %b, " + "treeSelectEnabled = %b, "
+ "dcpOnLinks = %b, " + "dhtmlEditors = { %s }, "
+ "treeSelectEnabled = %b, " + "defaultDhtmlEditor = %s, "
+ "dhtmlEditors = { %s }, " + "dhtmlEditorSrcFile = %s, "
+ "defaultDhtmlEditor = %s, " + "showClassName = %b"
+ "dhtmlEditorSrcFile = %s, " + " }",
+ "showClassName = %b" super.toString(),
+ " }", tidyConfigFile,
super.toString(), fancyErrors,
tidyConfigFile, dcpOnButtons,
fancyErrors, dcpOnLinks,
dcpOnButtons, treeSelectEnabled,
dcpOnLinks, dhtmlEditors.stream().collect(Collectors.joining(", ")),
treeSelectEnabled, defaultDhtmlEditor,
joiner.toString(), dhtmlEditorSrcFile,
defaultDhtmlEditor, showClassName);
dhtmlEditorSrcFile,
showClassName);
} }
} }

View File

@ -30,6 +30,7 @@ import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.configuration.Setting; import org.libreccm.configuration.Setting;
import java.util.StringJoiner; import java.util.StringJoiner;
import java.util.stream.Collectors;
/** /**
* *
@ -124,7 +125,7 @@ public final class KernelConfig {
public boolean emailIsPrimaryIdentifier() { public boolean emailIsPrimaryIdentifier() {
return EMAIL.equals(primaryUserIdentifier); return EMAIL.equals(primaryUserIdentifier);
} }
public boolean screenNameIsPrimaryIdentifier() { public boolean screenNameIsPrimaryIdentifier() {
return SCREEN_NAME.equals(primaryUserIdentifier); return SCREEN_NAME.equals(primaryUserIdentifier);
} }
@ -256,32 +257,28 @@ public final class KernelConfig {
@Override @Override
public String toString() { public String toString() {
final StringJoiner joiner = new StringJoiner(", "); return String.format(
if (supportedLanguages != null) { "%s{ "
supportedLanguages.forEach(s -> joiner.add(s)); + "debugEnabled = %b, "
} + "webdevSupportEnabled = %b, "
+ "dataPermissionCheckEnabled = %b, "
return String.format("%s{ " + "primaryUserIdentifier = \"%s\", "
+ "debugEnabled = %b, " + "ssoEnabled = %b, "
+ "webdevSupportEnabled = %b, " + "rememberLoginEnabeled = %b, "
+ "dataPermissionCheckEnabled = %b, " + "secureLoginEnabled = %b, "
+ "primaryUserIdentifier = \"%s\", " + "supportedLanguages = { \"%s\" }, "
+ "ssoEnabled = %b, " + "defaultLanguage = \"%s\""
+ "rememberLoginEnabeled = %b, " + " }",
+ "secureLoginEnabled = %b, " super.toString(),
+ "supportedLanguages = \"%s\", " debugEnabled,
+ "defaultLanguage = \"%s\"" webdevSupportEnabled,
+ " }", dataPermissionCheckEnabled,
super.toString(), primaryUserIdentifier,
debugEnabled, ssoEnabled,
webdevSupportEnabled, rememberLoginEnabled,
dataPermissionCheckEnabled, secureLoginEnabled,
primaryUserIdentifier, supportedLanguages.stream().collect(Collectors.joining(", ")),
ssoEnabled, defaultLanguage);
rememberLoginEnabled,
secureLoginEnabled,
joiner.toString(),
defaultLanguage);
} }
} }

View File

@ -28,6 +28,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.StringJoiner; import java.util.StringJoiner;
import java.util.stream.Collectors;
/** /**
* *
@ -160,24 +161,22 @@ public final class SecurityConfig {
@Override @Override
public String toString() { public String toString() {
final StringJoiner joiner = new StringJoiner(", "); return String.format(
excludedExtensions.forEach(s -> joiner.add(s)); "%s{ "
+ "excludedExtensions = { %s }, "
return String.format("%s{ " + "autoRegistrationEnabled = %b, "
+ "excludedExtensions = { %s }, " + "passwordRecoveryEnabled = %b, "
+ "autoRegistrationEnabled = %b, " + "hashAlgorithm = \"%s\", "
+ "passwordRecoveryEnabled = %b, " + "saltLength = %d, "
+ "hashAlgorithm = \"%s\", " + "hashIterations = %d"
+ "saltLength = %d, " + " }",
+ "hashIterations = %d" super.toString(),
+ " }", excludedExtensions.stream().collect(Collectors.joining(", ")),
super.toString(), autoRegistrationEnabled,
joiner.toString(), passwordRecoveryEnabled,
autoRegistrationEnabled, hashAlgorithm,
passwordRecoveryEnabled, saltLength,
hashAlgorithm, hashIterations);
saltLength,
hashIterations);
} }
} }

View File

@ -0,0 +1,157 @@
/*
* Copyright (C) 2003-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.mail;
import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.ErrorList;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.ParameterError;
import com.arsdigita.util.parameter.StringParameter;
import com.arsdigita.util.parameter.URLParameter;
import com.arsdigita.util.UncheckedWrapperException;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;
/**
* LegacyMailConfig
*
* @author Rafael H. Schloming &lt;rhs@mit.edu&gt;
* @version $Revision: #7 $ $Date: 2004/08/16 $
* @version $Id: LegacyMailConfig.java 1513 2007-03-22 09:09:03Z chrisgilbert23 $
*/
public final class LegacyMailConfig extends AbstractConfig {
private Properties m_props;
private final Parameter m_debug = new BooleanParameter
("waf.mail.debug", Parameter.OPTIONAL, Boolean.FALSE);
private final Parameter m_javamail = new PropertyFileParameter
("waf.mail.javamail.configuration", Parameter.OPTIONAL, null);
/* used by Mail when the user is not logged in. */
private final Parameter m_defaultFrom = new StringParameter
("waf.mail.default_from", Parameter.OPTIONAL, "");
private final Parameter m_sendHTML = new BooleanParameter
("waf.mail.send_html_mail", Parameter.OPTIONAL, Boolean.FALSE);
/**
* Constructor registers the parameter ands loads values from config file.
*
*/
public LegacyMailConfig() {
register(m_javamail);
register(m_debug);
register(m_defaultFrom);
register(m_sendHTML);
loadInfo();
}
public Properties getJavamail() {
if (m_props == null) {
URL propsFile = (URL) get(m_javamail);
if (propsFile == null) {
m_props = new Properties();
m_props.put("mail.transport.protocol", "smtp");
m_props.put("mail.smtp.host", "localhost");
} else {
try {
m_props = PropertyFileParameter.getProperties(propsFile);
} catch (IOException ioe) {
throw new UncheckedWrapperException
("unable to retrieve properties file from "
+ propsFile, ioe);
}
}
}
return m_props;
}
/**
*
* @return
*/
public String getDefaultFrom() {
String from = (String) get(m_defaultFrom);
//TODO: usage of arsdigita.web.Web, not sure if the class will be kept in ccm_ng
// if (null == from)
// from = "notloggedin@" + Web.getConfig().getServer().getName();
return from;
}
/**
*
* @return
*/
public boolean isDebug() {
return get(m_debug).equals(Boolean.TRUE);
}
/**
* determine whether messages with mime type text/html
* should be sent as html emails (with plain text alternative) or
* just sent as translated plain text
* @return
*/
public boolean sendHTMLMessageAsHTMLEmail () {
return ((Boolean)get(m_sendHTML)).booleanValue();
}
/**
*
*/
private static class PropertyFileParameter extends URLParameter {
PropertyFileParameter(String name, int multiplicity, Object defaalt) {
super(name, multiplicity, defaalt);
}
@Override
protected void doValidate(Object value, ErrorList errors) {
super.doValidate(value, errors);
if (!errors.isEmpty()) {
return;
}
try {
getProperties((URL) value);
} catch (IOException ioe) {
errors.add(new ParameterError(this, ioe));
}
}
public static Properties getProperties(URL url) throws IOException {
Properties props = new Properties();
props.load(url.openStream());
return props;
}
}
}

View File

@ -76,16 +76,7 @@ public class Mail implements MessageType {
*/ */
private static final Logger s_log = private static final Logger s_log =
Logger.getLogger(Mail.class); Logger.getLogger(Mail.class);
private static MailConfig s_config;
public static MailConfig getConfig() {
if (s_config == null) {
s_config = new MailConfig();
s_config.load("ccm-core/mail.properties");
s_config.require("javamail.properties");
}
return s_config;
}
private static final InternetAddress[] EMPTY_ADDRESS_LIST = private static final InternetAddress[] EMPTY_ADDRESS_LIST =
new InternetAddress[0]; new InternetAddress[0];
/** /**
@ -293,7 +284,7 @@ public class Mail implements MessageType {
// Write a copy of the message into the log file // Write a copy of the message into the log file
if (getConfig().isDebug()) { if (MailConfig.getConfig().isDebug()) {
if (msg != null) { if (msg != null) {
try { try {
ByteArrayOutputStream os = new ByteArrayOutputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream();
@ -717,7 +708,8 @@ public class Mail implements MessageType {
if (s_session == null) { if (s_session == null) {
// Set up the properties // Set up the properties
Properties props = new Properties(getConfig().getJavamail()); Properties props = new Properties(
MailConfig.getConfig().getJavaMailProperties());
// Check for overrides of the server information // Check for overrides of the server information
if (s_host != null) { if (s_host != null) {
@ -729,7 +721,7 @@ public class Mail implements MessageType {
// Set up the session // Set up the session
s_session = Session.getInstance(props, null); s_session = Session.getInstance(props, null);
s_session.setDebug(getConfig().isDebug()); s_session.setDebug(MailConfig.getConfig().isDebug());
} }
return s_session; return s_session;

View File

@ -1,157 +1,162 @@
/* /*
* Copyright (C) 2003-2004 Red Hat Inc. 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.mail; package com.arsdigita.mail;
import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.ErrorList;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.ParameterError;
import com.arsdigita.util.parameter.StringParameter;
import com.arsdigita.util.parameter.URLParameter;
import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.UncheckedWrapperException;
import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.Configuration;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.configuration.Setting;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.Objects;
import java.util.Properties; import java.util.Properties;
/** /**
* MailConfig
* *
* @author Rafael H. Schloming &lt;rhs@mit.edu&gt; * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @version $Revision: #7 $ $Date: 2004/08/16 $
* @version $Id: MailConfig.java 1513 2007-03-22 09:09:03Z chrisgilbert23 $
*/ */
public final class MailConfig extends AbstractConfig { @Configuration
public final class MailConfig {
private Properties m_props; @Setting
private Boolean debug = false;
private final Parameter m_debug = new BooleanParameter @Setting
("waf.mail.debug", Parameter.OPTIONAL, Boolean.FALSE); private String javaMailPropertiesFile = null;
private final Parameter m_javamail = new PropertyFileParameter @Setting
("waf.mail.javamail.configuration", Parameter.OPTIONAL, null); private String defaultFrom = "";
/* used by Mail when the user is not logged in. */ @Setting
private final Parameter m_defaultFrom = new StringParameter private Boolean sendHtml = false;
("waf.mail.default_from", Parameter.OPTIONAL, "");
private final Parameter m_sendHTML = new BooleanParameter public static MailConfig getConfig() {
("waf.mail.send_html_mail", Parameter.OPTIONAL, Boolean.FALSE); final CdiUtil cdiUtil = new CdiUtil();
final ConfigurationManager confManager = cdiUtil.findBean(
ConfigurationManager.class);
/** return confManager.findConfiguration(MailConfig.class);
* Constructor registers the parameter ands loads values from config file.
*
*/
public MailConfig() {
register(m_javamail);
register(m_debug);
register(m_defaultFrom);
register(m_sendHTML);
loadInfo();
} }
public Properties getJavamail() { public Boolean isDebug() {
if (m_props == null) { return debug;
URL propsFile = (URL) get(m_javamail);
if (propsFile == null) {
m_props = new Properties();
m_props.put("mail.transport.protocol", "smtp");
m_props.put("mail.smtp.host", "localhost");
} else {
try {
m_props = PropertyFileParameter.getProperties(propsFile);
} catch (IOException ioe) {
throw new UncheckedWrapperException
("unable to retrieve properties file from "
+ propsFile, ioe);
}
}
}
return m_props;
} }
/** public void setDebug(final Boolean debug) {
* this.debug = debug;
* @return
*/
public String getDefaultFrom() {
String from = (String) get(m_defaultFrom);
//TODO: usage of arsdigita.web.Web, not sure if the class will be kept in ccm_ng
// if (null == from)
// from = "notloggedin@" + Web.getConfig().getServer().getName();
return from;
} }
/** public String getJavaMailPropertiesFile() {
* return javaMailPropertiesFile;
* @return
*/
public boolean isDebug() {
return get(m_debug).equals(Boolean.TRUE);
} }
/** public Properties getJavaMailProperties() {
* determine whether messages with mime type text/html final Properties properties = new Properties();
* should be sent as html emails (with plain text alternative) or
* just sent as translated plain text
* @return
*/
public boolean sendHTMLMessageAsHTMLEmail () {
return ((Boolean)get(m_sendHTML)).booleanValue();
}
/**
*
*/
private static class PropertyFileParameter extends URLParameter {
PropertyFileParameter(String name, int multiplicity, Object defaalt) {
super(name, multiplicity, defaalt);
}
@Override
protected void doValidate(Object value, ErrorList errors) {
super.doValidate(value, errors);
if (!errors.isEmpty()) {
return;
}
if (javaMailPropertiesFile == null
|| javaMailPropertiesFile.isEmpty()) {
properties.put("mail.transport.protocol", "smtp");
properties.put("mail.smtp.host", "localhost");
} else {
try { try {
getProperties((URL) value); properties.load(new URL(javaMailPropertiesFile).openStream());
} catch (IOException ioe) { } catch (IOException ex) {
errors.add(new ParameterError(this, ioe)); throw new UncheckedWrapperException(String.format(
"Unable to retrieve properties for JavaMail from \"%s\".",
javaMailPropertiesFile));
} }
} }
public static Properties getProperties(URL url) throws IOException { return properties;
Properties props = new Properties(); }
props.load(url.openStream());
return props; public void setJavaMailPropertiesFile(final String javaMailPropertiesFile) {
this.javaMailPropertiesFile = javaMailPropertiesFile;
}
public String getDefaultFrom() {
return defaultFrom;
}
public void setDefaultFrom(final String defaultFrom) {
this.defaultFrom = defaultFrom;
}
public Boolean getSendHtml() {
return sendHtml;
}
public void setSendHtml(final Boolean sendHtml) {
this.sendHtml = sendHtml;
}
@Override
public int hashCode() {
int hash = 3;
hash = 67 * hash + Objects.hashCode(debug);
hash = 67 * hash + Objects.hashCode(javaMailPropertiesFile);
hash = 67 * hash + Objects.hashCode(defaultFrom);
hash = 67 * hash + Objects.hashCode(sendHtml);
return hash;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
} }
if (obj == null) {
return false;
}
if (!(obj instanceof MailConfig)) {
return false;
}
final MailConfig other = (MailConfig) obj;
if (!Objects.equals(javaMailPropertiesFile,
other.getJavaMailPropertiesFile())) {
return false;
}
if (!Objects.equals(defaultFrom, other.getDefaultFrom())) {
return false;
}
if (!Objects.equals(debug, other.isDebug())) {
return false;
}
return Objects.equals(sendHtml, other.getSendHtml());
}
@Override
public String toString() {
return String.format(
"%s{ "
+ "debug = %b, "
+ "javaMailPropertiesFile = \"%s\", "
+ "defaultFrom = \"%s\", "
+ "sendHtml = %b"
+ " }",
super.toString(),
debug,
javaMailPropertiesFile,
defaultFrom,
sendHtml);
} }
} }

View File

@ -1,237 +0,0 @@
/*
* Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.xml;
import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.StringParameter;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParserFactory;
import org.apache.log4j.Logger;
/**
* Stores the configuration record for the XML functionality.
*
* Most important: Configuration of the XML factories: - Document Builder - Sax Parser - XSL
* Transformer
*
* @version $Id: XMLConfig.java 1393 2006-11-28 09:12:32Z sskracic $
*/
public final class XMLConfig extends AbstractConfig {
/**
* Internal logger instance to faciliate debugging. Enable logging output by editing
* /WEB-INF/conf/log4j.properties int hte runtime environment and set
* com.arsdigita.xml.XMLConfig=DEBUG by uncommenting or adding the line.
*/
private static final Logger s_log = Logger.getLogger(XMLConfig.class);
/**
* Private instance of this class to be returned after initialization.
*/
private static XMLConfig s_config;
/**
* Returns the singleton configuration record for the XML functionality
*
* @return The <code>XMLConfig</code> record; it cannot be null
*/
public static final synchronized XMLConfig getConfig() {
if (s_config == null) {
s_config = new XMLConfig();
// read values from the persistent storage
s_config.load();
}
return s_config;
}
// supported XSL transformer implementations
private static final String RESIN = "com.caucho.xsl.Xsl";
private static final String SAXON = "com.icl.saxon.TransformerFactoryImpl";
private static final String SAXON_HE = "net.sf.saxon.TransformerFactoryImpl";
private static final String XALAN = "org.apache.xalan.processor.TransformerFactoryImpl";
private static final String XSLTC = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
// supported documentBuilder implementations
private static final String DOM_XERCES = "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
private static final String DOM_RESIN = "com.caucho.xml.parsers.XmlDocumentBuilderFactory";
// supported SAX parser implementations
private static final String SAX_XERCES = "org.apache.xerces.jaxp.SAXParserFactoryImpl";
private static final String SAX_RESIN = "com.caucho.xml.parsers.XmlSAXParserFactory";
private final Parameter m_xfmr = new StringParameter(
"waf.xml.xsl_transformer",
Parameter.REQUIRED, "saxon");
private final Parameter m_builder = new StringParameter(
"waf.xml.dom_builder",
Parameter.REQUIRED, "xerces");
private final Parameter m_parser = new StringParameter(
"waf.xml.sax_parser",
Parameter.REQUIRED, "xerces");
private final Parameter m_activateFullTimeFormatter = new BooleanParameter(
"waf.xml.activate_full_date_formatter",
Parameter.OPTIONAL, false);
/**
* Constructs an empty XMLConfig object following the singleton pattern.
*
* They are meant as a singleton pattern (with private constructor), but it does not work with
* the associated classes AbstractConfig and ConfigRegistry because they can currently not deal
* with a private constructor
*/
// private XMLConfig() {
public XMLConfig() {
super();
register(m_xfmr);
register(m_builder);
register(m_parser);
register(m_activateFullTimeFormatter);
loadInfo();
}
/* ************ public getter / setter section ************ */
/**
* Returns the XSL Transformer factory class name to use.
*
* The method assures that the return value is a valid class name.
*
* @return String XSL Transformer factory class name
*/
public String getXSLTransformerFactoryClassname() {
final String key = (String) get(m_xfmr);
// Defined values: saxon (default)|jd.xslt|resin|xalan|xsltc
if (key.equalsIgnoreCase("xsltc")) {
return XSLTC;
} else if (key.equalsIgnoreCase("xalan")) {
return XALAN;
} else if (key.equalsIgnoreCase("resin")) {
return RESIN;
} else if (key.equalsIgnoreCase("saxonhe")) {
return SAXON_HE;
} else {
// return defaultValue
return getDefaultXSLTransformerFactoryClassname();
}
}
/**
* Returns the class name of the default {@link TransformerFactory}. This method encapsulates
* the default value so that is easy to change. The method is only for use by the
* classes in the {@code com.arsdigita.xml} package, therefore the method is {@code protected}.
*
* @return
*/
protected String getDefaultXSLTransformerFactoryClassname() {
return SAXON;
}
/**
* Returns the Document Builder factory class name to use
*
* The method assures that the return value is a valid class name.
*
* Not used at the moment.
*
* @return String Document Builder factory class name
*/
public String getDOMBuilderFactoryClassname() {
final String key = (String) get(m_builder);
// Defined values: xerces (default)|resin
if (key.equalsIgnoreCase("resin")) {
return DOM_RESIN;
} else {
return getDefaultDOMBuilderFactoryClassname();
}
}
/**
* Returns the class name of the default {@link DocumentBuilderFactory}.
* This method encapsulates the default value so that is easy to change. The method is only for
* use by the classes in the {@code com.arsdigita.xml} package, therefore the method is
* {@code protected}.
*
* @return
*/
protected String getDefaultDOMBuilderFactoryClassname() {
return DOM_XERCES;
}
/**
* Returns the Sax Parser factory class name to use.
*
* The method assures that the return value is a valid class name.
*
* Not used at the moment.
*
* @return String Sax Parser factory class name
*/
public String getSAXParserFactoryClassname() {
final String key = (String) get(m_parser);
// Defined values: xerces (default)|resin
if (key.equalsIgnoreCase("resin")) {
return SAX_RESIN;
} else {
return getDefaultSAXParserFactoryClassname();
}
}
/**
* Returns the class name of the default {@link SAXParserFactory}.
* This method encapsulates the default value so that is easy to change. The method is only for
* use by the classes in the {@code com.arsdigita.xml} package, therefore the method is
* {@code protected}.
*
* @return
*/
protected String getDefaultSAXParserFactoryClassname() {
return SAX_XERCES;
}
/**
* Returns the activateFullTimeFormatter flag.
*
* @return
*/
public boolean getActivateFullTimeFormatter() {
return (Boolean) get(m_activateFullTimeFormatter);
}
/**
* Sets the activateFullTimeFormatter flag.
*
* @param activateFullTimeFormatter
*/
public void setActivateFullTimeFormatter(final boolean activateFullTimeFormatter) {
set(m_activateFullTimeFormatter, activateFullTimeFormatter);
}
}

View File

@ -0,0 +1,254 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package com.arsdigita.xml;
import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.Configuration;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.configuration.Setting;
import java.util.Objects;
/**
* Stores the configuration record for the XML functionality.
*
* Most important: Configuration of the XML factories: - Document Builder - Sax
* Parser - XSL Transformer
*
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Configuration
public final class XmlConfig {
// supported XSL transformer implementations
private static final String RESIN = "com.caucho.xsl.Xsl";
private static final String SAXON = "com.icl.saxon.TransformerFactoryImpl";
private static final String SAXON_HE = "net.sf.saxon.TransformerFactoryImpl";
private static final String XALAN
= "org.apache.xalan.processor.TransformerFactoryImpl";
private static final String XSLTC
= "org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
// supported documentBuilder implementations
private static final String DOM_XERCES
= "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
private static final String DOM_RESIN
= "com.caucho.xml.parsers.XmlDocumentBuilderFactory";
// supported SAX saxParser implementations
private static final String SAX_XERCES
= "org.apache.xerces.jaxp.SAXParserFactoryImpl";
private static final String SAX_RESIN
= "com.caucho.xml.parsers.XmlSAXParserFactory";
@Setting
private String xslTransformer = "saxonhe";
@Setting
private String domBuilder = "xerces";
@Setting
private String saxParser = "xerces";
@Setting
private Boolean fullTimeFormatterEnabled = false;
public static XmlConfig getConfig() {
final CdiUtil cdiUtil = new CdiUtil();
final ConfigurationManager confManager = cdiUtil.findBean(
ConfigurationManager.class);
return confManager.findConfiguration(XmlConfig.class);
}
public String getXslTransformer() {
return xslTransformer;
}
public String getXslTransformerFactoryClassname() {
switch (xslTransformer) {
case "xsltc":
return XSLTC;
case "xalan":
return XALAN;
case "resin":
return RESIN;
case "saxonhe":
return SAXON_HE;
default:
return getDefaultXslTransformerFactoryClassname();
}
}
/**
* Returns the class name of the default {@link TransformerFactory}. This
* method encapsulates the default value so that is easy to change. The
* method is only for use by the classes in the {@code com.arsdigita.xml}
* package, therefore the method is {@code protected}.
*
* @return
*/
protected String getDefaultXslTransformerFactoryClassname() {
return SAXON;
}
public void setXslTransformer(final String xslTransformer) {
this.xslTransformer = xslTransformer;
}
public String getDomBuilder() {
return domBuilder;
}
/**
* Returns the Document Builder factory class name to use
*
* The method assures that the return value is a valid class name.
*
* Not used at the moment.
*
* @return String Document Builder factory class name
*/
public String getDomBuilderFactoryClassname() {
switch(domBuilder) {
case "resin":
return DOM_RESIN;
default:
return getDefaultDomBuilderFactoryClassname();
}
}
/**
* Returns the class name of the default {@link DocumentBuilderFactory}.
* This method encapsulates the default value so that is easy to change. The method is only for
* use by the classes in the {@code com.arsdigita.xml} package, therefore the method is
* {@code protected}.
*
* @return
*/
protected String getDefaultDomBuilderFactoryClassname() {
return DOM_XERCES;
}
public void setDomBuilder(final String domBuilder) {
this.domBuilder = domBuilder;
}
public String getSaxParser() {
return saxParser;
}
/**
* Returns the Sax Parser factory class name to use.
*
* The method assures that the return value is a valid class name.
*
* Not used at the moment.
*
* @return String Sax Parser factory class name
*/
public String getSaxParserFactoryClassname() {
switch(saxParser) {
case "resin":
return SAX_RESIN;
default:
return getDefaultSaxParserFactoryClassname();
}
}
/**
* Returns the class name of the default {@link SAXParserFactory}.
* This method encapsulates the default value so that is easy to change. The method is only for
* use by the classes in the {@code com.arsdigita.xml} package, therefore the method is
* {@code protected}.
*
* @return
*/
protected String getDefaultSaxParserFactoryClassname() {
return SAX_XERCES;
}
public void setSaxParser(final String saxParser) {
this.saxParser = saxParser;
}
public Boolean isFullTimeFormatterEnabled() {
return fullTimeFormatterEnabled;
}
public void setFullTimeFormatterEnabled(
final Boolean fullTimeFormatterEnabled) {
this.fullTimeFormatterEnabled = fullTimeFormatterEnabled;
}
@Override
public int hashCode() {
int hash = 3;
hash = 19 * hash + Objects.hashCode(xslTransformer);
hash = 19 * hash + Objects.hashCode(domBuilder);
hash = 19 * hash + Objects.hashCode(saxParser);
hash = 19 * hash + Objects.hashCode(fullTimeFormatterEnabled);
return hash;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof XmlConfig)) {
return false;
}
final XmlConfig other = (XmlConfig) obj;
if (!Objects.equals(xslTransformer, other.getXslTransformer())) {
return false;
}
if (!Objects.equals(domBuilder, other.getDomBuilder())) {
return false;
}
if (!Objects.equals(saxParser, other.getSaxParser())) {
return false;
}
return Objects.equals(fullTimeFormatterEnabled,
other.isFullTimeFormatterEnabled());
}
@Override
public String toString() {
return String.format("%s{ "
+ "xslTransformer = \"%s\", "
+ "domBuilder = \"%s\", "
+ "parser = \"%s\", "
+ "fullTimeFormatterEnabled = %b"
+ " }",
super.toString(),
xslTransformer,
domBuilder,
saxParser,
fullTimeFormatterEnabled);
}
}

View File

@ -272,8 +272,21 @@ public class ConfigurationManager {
final ConfigurationInfo confInfo = new ConfigurationInfo(); final ConfigurationInfo confInfo = new ConfigurationInfo();
confInfo.setName(configuration.getClass().getName()); confInfo.setName(configuration.getClass().getName());
confInfo.setDescBundle(annotation.descBundle()); if (annotation.descBundle() == null
confInfo.setDescKey(annotation.descKey()); || annotation.descBundle().isEmpty()) {
confInfo.setDescBundle(String.join("",
configuration.getClass()
.getName(),
"Description"));
} else {
confInfo.setDescBundle(annotation.descBundle());
}
if (annotation.descKey() == null
|| annotation.descKey().isEmpty()) {
confInfo.setDescKey("description");
} else {
confInfo.setDescKey(annotation.descKey());
}
final Field[] fields = configuration.getDeclaredFields(); final Field[] fields = configuration.getDeclaredFields();
for (final Field field : fields) { for (final Field field : fields) {
@ -313,7 +326,15 @@ public class ConfigurationManager {
final Configuration confAnnotation = configuration.getAnnotation( final Configuration confAnnotation = configuration.getAnnotation(
Configuration.class); Configuration.class);
final String descBundle = confAnnotation.descBundle(); final String descBundle;
if (confAnnotation.descBundle() == null
|| confAnnotation.descBundle().isEmpty()) {
descBundle = String.join("",
configuration.getClass().getName(),
"Description");
} else {
descBundle = confAnnotation.descBundle();
}
final Field field; final Field field;
try { try {
@ -356,7 +377,12 @@ public class ConfigurationManager {
settingInfo.setConfClass(configuration.getName()); settingInfo.setConfClass(configuration.getName());
settingInfo.setDescBundle(descBundle); settingInfo.setDescBundle(descBundle);
settingInfo.setDescKey(settingAnnotation.descKey()); if (settingAnnotation.descKey() == null
|| settingAnnotation.descKey().isEmpty()) {
settingInfo.setDescKey(field.getName());
} else {
settingInfo.setDescKey(settingAnnotation.descKey());
}
return settingInfo; return settingInfo;
} }
@ -778,4 +804,5 @@ public class ConfigurationManager {
return category; return category;
} }
} }

View File

@ -0,0 +1,30 @@
# 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
description = Configuration for the sending mails
debug.label = Mail debug flag
debug.description = Enables or disables debugging for the mail component
javaMailPropertiesFile.label = JavaMail properties URL
javaMailPropertiesFile.description = URL of properties file used to create JavaMail session for outgoing mail, eg file:///etc/javamail.properties
defaultFrom.label = Default from
defaultFrom.description = Default value for the from E-Mail address for E-Mails send by the system
sendHtml.label = Send html messages as html emails
sendHtml.description = Determine whether to send html messages as html, or convert to plain mail

View File

@ -1,19 +0,0 @@
waf.xml.xsl_transformer.title=XSLT transformer
waf.xml.xsl_transformer.purpose=Define the XSLT transformer factory to use
waf.xml.xsl_transformer.example=Choose one of: saxon (default)|jd.xslt|resin|xalan|xsltc
waf.xml.xsl_transformer.format=[string]
waf.xml.dom_builder.title=DOM builder
waf.xml.dom_builder.purpose=Define the DOM builder factory to use
waf.xml.dom_builder.example=Choose one of: xerces (default)|resin
waf.xml.dom_builder.format=[string]
waf.xml.sax_parser.title=SAX parser
waf.xml.sax_parser.purpose=Define the SAX parser factory to use
waf.xml.sax_parser.example=Choose one of: xerces (default)|resin
waf.xml.sax_parser.format=[string]
waf.xml.activate_full_date_formatter.title=Activate FullDateFormatter
waf.xml.activate_full_date_formatter.purpose=Set this to true to make FullDateFormatter output semantic date XML; the XSL templates may need to be modified accordingly
waf.xml.activate_full_date_formatter.example=true
waf.xml.activate_full_date_formatter.format=[boolean]

View File

@ -0,0 +1,30 @@
# 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
description = Stores the configuration record for the XML functionality.
xslTransformer.label = XSL Transformer
xslTransformer.description = Define the XSL transformer factory to use
domBuilder.label = DOM Builder
domBuilder.description = Define the DOM builder factory to use
saxParser.label = SAX Parser
saxParser.description = Define the SAX parser factory to use
fullTimeFormatterEnabled.label = Enable full time formatter
fullTimeFormatterEnabled.description = Set this to true to make FullDateFormatter output semantic date XML; the XSL templates may need to be modified accordingly