CCM NG:
- 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
parent
05102e0269
commit
a1bef5b73f
|
|
@ -23,16 +23,20 @@ import com.arsdigita.bebop.util.BebopConstants;
|
|||
import com.arsdigita.templating.PresentationManager;
|
||||
import com.arsdigita.ui.SimplePage;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import org.libreccm.cdi.utils.CdiUtil;
|
||||
import org.libreccm.configuration.Configuration;
|
||||
import org.libreccm.configuration.ConfigurationManager;
|
||||
import org.libreccm.configuration.Setting;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
@ -89,6 +93,7 @@ public final class BebopConfig {
|
|||
return presenterClassName;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Class<PresentationManager> getPresenterClass() {
|
||||
try {
|
||||
return (Class<PresentationManager>) Class.
|
||||
|
|
@ -111,6 +116,7 @@ public final class BebopConfig {
|
|||
return basePageClassName;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Class<BasePage> getBasePageClass() {
|
||||
try {
|
||||
return (Class<BasePage>) Class.forName(basePageClassName);
|
||||
|
|
@ -255,10 +261,8 @@ public final class BebopConfig {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringJoiner joiner = new StringJoiner(", ");
|
||||
dhtmlEditors.forEach(s -> joiner.add(s));
|
||||
|
||||
return String.format("%s{ "
|
||||
return String.format(
|
||||
"%s{ "
|
||||
+ "tidyConfigFile = %s, "
|
||||
+ "fancyErrors = %b, "
|
||||
+ "dcpOnButtons = %b, "
|
||||
|
|
@ -275,9 +279,10 @@ public final class BebopConfig {
|
|||
dcpOnButtons,
|
||||
dcpOnLinks,
|
||||
treeSelectEnabled,
|
||||
joiner.toString(),
|
||||
dhtmlEditors.stream().collect(Collectors.joining(", ")),
|
||||
defaultDhtmlEditor,
|
||||
dhtmlEditorSrcFile,
|
||||
showClassName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import org.libreccm.configuration.ConfigurationManager;
|
|||
import org.libreccm.configuration.Setting;
|
||||
|
||||
import java.util.StringJoiner;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -256,12 +257,8 @@ public final class KernelConfig {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringJoiner joiner = new StringJoiner(", ");
|
||||
if (supportedLanguages != null) {
|
||||
supportedLanguages.forEach(s -> joiner.add(s));
|
||||
}
|
||||
|
||||
return String.format("%s{ "
|
||||
return String.format(
|
||||
"%s{ "
|
||||
+ "debugEnabled = %b, "
|
||||
+ "webdevSupportEnabled = %b, "
|
||||
+ "dataPermissionCheckEnabled = %b, "
|
||||
|
|
@ -269,7 +266,7 @@ public final class KernelConfig {
|
|||
+ "ssoEnabled = %b, "
|
||||
+ "rememberLoginEnabeled = %b, "
|
||||
+ "secureLoginEnabled = %b, "
|
||||
+ "supportedLanguages = \"%s\", "
|
||||
+ "supportedLanguages = { \"%s\" }, "
|
||||
+ "defaultLanguage = \"%s\""
|
||||
+ " }",
|
||||
super.toString(),
|
||||
|
|
@ -280,7 +277,7 @@ public final class KernelConfig {
|
|||
ssoEnabled,
|
||||
rememberLoginEnabled,
|
||||
secureLoginEnabled,
|
||||
joiner.toString(),
|
||||
supportedLanguages.stream().collect(Collectors.joining(", ")),
|
||||
defaultLanguage);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -160,10 +161,8 @@ public final class SecurityConfig {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringJoiner joiner = new StringJoiner(", ");
|
||||
excludedExtensions.forEach(s -> joiner.add(s));
|
||||
|
||||
return String.format("%s{ "
|
||||
return String.format(
|
||||
"%s{ "
|
||||
+ "excludedExtensions = { %s }, "
|
||||
+ "autoRegistrationEnabled = %b, "
|
||||
+ "passwordRecoveryEnabled = %b, "
|
||||
|
|
@ -172,7 +171,7 @@ public final class SecurityConfig {
|
|||
+ "hashIterations = %d"
|
||||
+ " }",
|
||||
super.toString(),
|
||||
joiner.toString(),
|
||||
excludedExtensions.stream().collect(Collectors.joining(", ")),
|
||||
autoRegistrationEnabled,
|
||||
passwordRecoveryEnabled,
|
||||
hashAlgorithm,
|
||||
|
|
|
|||
|
|
@ -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 <rhs@mit.edu>
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -76,16 +76,7 @@ public class Mail implements MessageType {
|
|||
*/
|
||||
private static final Logger s_log =
|
||||
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 =
|
||||
new InternetAddress[0];
|
||||
/**
|
||||
|
|
@ -293,7 +284,7 @@ public class Mail implements MessageType {
|
|||
|
||||
// Write a copy of the message into the log file
|
||||
|
||||
if (getConfig().isDebug()) {
|
||||
if (MailConfig.getConfig().isDebug()) {
|
||||
if (msg != null) {
|
||||
try {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
|
|
@ -717,7 +708,8 @@ public class Mail implements MessageType {
|
|||
if (s_session == null) {
|
||||
|
||||
// Set up the properties
|
||||
Properties props = new Properties(getConfig().getJavamail());
|
||||
Properties props = new Properties(
|
||||
MailConfig.getConfig().getJavaMailProperties());
|
||||
|
||||
// Check for overrides of the server information
|
||||
if (s_host != null) {
|
||||
|
|
@ -729,7 +721,7 @@ public class Mail implements MessageType {
|
|||
|
||||
// Set up the session
|
||||
s_session = Session.getInstance(props, null);
|
||||
s_session.setDebug(getConfig().isDebug());
|
||||
s_session.setDebug(MailConfig.getConfig().isDebug());
|
||||
}
|
||||
|
||||
return s_session;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 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
|
||||
|
|
@ -13,145 +13,150 @@
|
|||
*
|
||||
* 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
|
||||
*
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 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 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.net.URL;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* MailConfig
|
||||
*
|
||||
* @author Rafael H. Schloming <rhs@mit.edu>
|
||||
* @version $Revision: #7 $ $Date: 2004/08/16 $
|
||||
* @version $Id: MailConfig.java 1513 2007-03-22 09:09:03Z chrisgilbert23 $
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
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
|
||||
("waf.mail.debug", Parameter.OPTIONAL, Boolean.FALSE);
|
||||
@Setting
|
||||
private String javaMailPropertiesFile = null;
|
||||
|
||||
private final Parameter m_javamail = new PropertyFileParameter
|
||||
("waf.mail.javamail.configuration", Parameter.OPTIONAL, null);
|
||||
@Setting
|
||||
private String defaultFrom = "";
|
||||
|
||||
/* used by Mail when the user is not logged in. */
|
||||
private final Parameter m_defaultFrom = new StringParameter
|
||||
("waf.mail.default_from", Parameter.OPTIONAL, "");
|
||||
@Setting
|
||||
private Boolean sendHtml = false;
|
||||
|
||||
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 MailConfig() {
|
||||
register(m_javamail);
|
||||
register(m_debug);
|
||||
register(m_defaultFrom);
|
||||
register(m_sendHTML);
|
||||
|
||||
loadInfo();
|
||||
public static MailConfig getConfig() {
|
||||
final CdiUtil cdiUtil = new CdiUtil();
|
||||
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||
ConfigurationManager.class);
|
||||
return confManager.findConfiguration(MailConfig.class);
|
||||
}
|
||||
|
||||
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");
|
||||
public Boolean isDebug() {
|
||||
return debug;
|
||||
}
|
||||
|
||||
public void setDebug(final Boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public String getJavaMailPropertiesFile() {
|
||||
return javaMailPropertiesFile;
|
||||
}
|
||||
|
||||
public Properties getJavaMailProperties() {
|
||||
final Properties properties = new Properties();
|
||||
|
||||
if (javaMailPropertiesFile == null
|
||||
|| javaMailPropertiesFile.isEmpty()) {
|
||||
properties.put("mail.transport.protocol", "smtp");
|
||||
properties.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);
|
||||
}
|
||||
properties.load(new URL(javaMailPropertiesFile).openStream());
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedWrapperException(String.format(
|
||||
"Unable to retrieve properties for JavaMail from \"%s\".",
|
||||
javaMailPropertiesFile));
|
||||
}
|
||||
}
|
||||
|
||||
return m_props;
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setJavaMailPropertiesFile(final String javaMailPropertiesFile) {
|
||||
this.javaMailPropertiesFile = javaMailPropertiesFile;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @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 defaultFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isDebug() {
|
||||
return get(m_debug).equals(Boolean.TRUE);
|
||||
public void setDefaultFrom(final String defaultFrom) {
|
||||
this.defaultFrom = defaultFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
public Boolean getSendHtml() {
|
||||
return sendHtml;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static class PropertyFileParameter extends URLParameter {
|
||||
PropertyFileParameter(String name, int multiplicity, Object defaalt) {
|
||||
super(name, multiplicity, defaalt);
|
||||
public void setSendHtml(final Boolean sendHtml) {
|
||||
this.sendHtml = sendHtml;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doValidate(Object value, ErrorList errors) {
|
||||
super.doValidate(value, errors);
|
||||
|
||||
if (!errors.isEmpty()) {
|
||||
return;
|
||||
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;
|
||||
}
|
||||
|
||||
try {
|
||||
getProperties((URL) value);
|
||||
} catch (IOException ioe) {
|
||||
errors.add(new ParameterError(this, ioe));
|
||||
@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());
|
||||
}
|
||||
|
||||
public static Properties getProperties(URL url) throws IOException {
|
||||
Properties props = new Properties();
|
||||
props.load(url.openStream());
|
||||
return props;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
"%s{ "
|
||||
+ "debug = %b, "
|
||||
+ "javaMailPropertiesFile = \"%s\", "
|
||||
+ "defaultFrom = \"%s\", "
|
||||
+ "sendHtml = %b"
|
||||
+ " }",
|
||||
super.toString(),
|
||||
debug,
|
||||
javaMailPropertiesFile,
|
||||
defaultFrom,
|
||||
sendHtml);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -272,8 +272,21 @@ public class ConfigurationManager {
|
|||
|
||||
final ConfigurationInfo confInfo = new ConfigurationInfo();
|
||||
confInfo.setName(configuration.getClass().getName());
|
||||
if (annotation.descBundle() == null
|
||||
|| 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();
|
||||
for (final Field field : fields) {
|
||||
|
|
@ -313,7 +326,15 @@ public class ConfigurationManager {
|
|||
|
||||
final Configuration confAnnotation = configuration.getAnnotation(
|
||||
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;
|
||||
try {
|
||||
|
|
@ -356,7 +377,12 @@ public class ConfigurationManager {
|
|||
settingInfo.setConfClass(configuration.getName());
|
||||
|
||||
settingInfo.setDescBundle(descBundle);
|
||||
if (settingAnnotation.descKey() == null
|
||||
|| settingAnnotation.descKey().isEmpty()) {
|
||||
settingInfo.setDescKey(field.getName());
|
||||
} else {
|
||||
settingInfo.setDescKey(settingAnnotation.descKey());
|
||||
}
|
||||
|
||||
return settingInfo;
|
||||
}
|
||||
|
|
@ -778,4 +804,5 @@ public class ConfigurationManager {
|
|||
|
||||
return category;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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]
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue