diff --git a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleLoader.java b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleLoader.java index 2a71f0d30..b64189bab 100755 --- a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleLoader.java +++ b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleLoader.java @@ -21,12 +21,13 @@ package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.URLParameter; +import com.arsdigita.util.parameter.ResourceParameter; import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.net.MalformedURLException; -import java.net.URL; + +import java.io.InputStream; + +import org.apache.log4j.Logger; /** * Loader. @@ -35,11 +36,14 @@ import java.net.URL; * @version $Id: MultiPartArticleLoader.java 1561 2007-04-16 15:37:21Z apevec $ */ public class MultiPartArticleLoader extends AbstractContentTypeLoader { + public final static String versionId = "$Id: MultiPartArticleLoader.java 1561 2007-04-16 15:37:21Z apevec $" + "$Author: apevec $" + "$DateTime: 2004/08/17 23:15:09 $"; + private static final Logger s_log = Logger.getLogger(MultiPartArticleLoader.class); + private static final String[] TYPES = { "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/MultiPartArticle.xml" }; @@ -48,23 +52,20 @@ public class MultiPartArticleLoader extends AbstractContentTypeLoader { return TYPES; } - private URLParameter m_template; + private ResourceParameter m_template; public MultiPartArticleLoader() { - try { - m_template = new URLParameter - ("com.arsdigita.cms.contenttypes.mparticle.template", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes" + - "/mparticle-item.jsp")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("cannot parse url", ex); - } + + m_template = new ResourceParameter + ("com.arsdigita.cms.contenttypes.mparticle.template", + Parameter.REQUIRED, + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes" + + "/mparticle-item.jsp"); register(m_template); } + @Override protected void prepareSection(final ContentSection section, final ContentType type, final LifecycleDefinition ld, @@ -73,7 +74,7 @@ public class MultiPartArticleLoader extends AbstractContentTypeLoader { setDefaultTemplate("MultiPartArticle-mparticle-item", "mparticle-item", - (URL)get(m_template), + (InputStream)get(m_template), section, type,ld, wf); } diff --git a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleTroikaRickshawUpgrade.java b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleTroikaRickshawUpgrade.java.nolongerInUse similarity index 94% rename from ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleTroikaRickshawUpgrade.java rename to ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleTroikaRickshawUpgrade.java.nolongerInUse index 8629c9978..b8b075d76 100755 --- a/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleTroikaRickshawUpgrade.java +++ b/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/MultiPartArticleTroikaRickshawUpgrade.java.nolongerInUse @@ -60,8 +60,12 @@ public class MultiPartArticleTroikaRickshawUpgrade { final ContentType type = ContentType.findByAssociatedObjectType (MultiPartArticle.BASE_DATA_OBJECT_TYPE); + // URL resource: protocol extension no longer supported! + // Replace by ResourceParameter (if applicable) or ordinary string + // and open as this.getclass().getResourceAsStream() final URL templateURL = new URL (null, "resource:WEB-INF/content-types/com/arsdigita/cms" + + // ^^^^^^^^^ no longer supperted !! "/contenttypes/mparticle-item.jsp"); final ContentSectionCollection coll = ContentSection.getAllSections(); diff --git a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/SiteProxyLoader.java b/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/SiteProxyLoader.java index 9f55b6b4a..1c84a147d 100755 --- a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/SiteProxyLoader.java +++ b/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/SiteProxyLoader.java @@ -18,16 +18,16 @@ */ package com.arsdigita.cms.contenttypes; -import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader; +// import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import com.arsdigita.util.UncheckedWrapperException; -import java.net.URL; -import java.net.MalformedURLException; import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.URLParameter; +import com.arsdigita.util.parameter.ResourceParameter; +// import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.workflow.simple.WorkflowTemplate; +import java.io.InputStream; +// import java.net.MalformedURLException; /** @@ -46,19 +46,14 @@ public class SiteProxyLoader extends AbstractContentTypeLoader { "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SiteProxy.xml" }; - private URLParameter m_template; + private ResourceParameter m_template; public SiteProxyLoader() { - try { - m_template = new URLParameter - ("com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes" + - "/siteproxy-item.jsp")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("cannot parse url", ex); - } + m_template = new ResourceParameter + ("com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate", + Parameter.REQUIRED, + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes" + + "/siteproxy-item.jsp"); register(m_template); } @@ -67,6 +62,7 @@ public class SiteProxyLoader extends AbstractContentTypeLoader { return TYPES; } + @Override protected void prepareSection(final ContentSection section, final ContentType type, final LifecycleDefinition ld, @@ -75,7 +71,7 @@ public class SiteProxyLoader extends AbstractContentTypeLoader { setDefaultTemplate("SiteProxyDefaultTemplate", "siteproxy-item", - (URL)get(m_template), + (InputStream)get(m_template), section, type,ld, wf); } diff --git a/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java b/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java index 45c57eaf7..6e4e09664 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig.java @@ -18,19 +18,16 @@ */ package com.arsdigita.cms; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.apache.log4j.Logger; +/* May 2009: + * This file serves as an information for developers how to replace + * the URL resource: protocol extension (which is a application specific, + * non-standard extension of the Java URL protocol) by supported, + * standard compliant API. + * + * Look for: + * // URL resource: protocol handler removal: START + * Will be removed as soon as a stable release 6.6 is created. + */ import com.arsdigita.bebop.SimpleComponent; import com.arsdigita.bebop.form.DHTMLEditor; @@ -45,7 +42,10 @@ import com.arsdigita.cms.publishToFile.PublishToFileListener; import com.arsdigita.cms.ui.authoring.ItemCategoryExtension; import com.arsdigita.cms.ui.authoring.ItemCategoryForm; import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.UncheckedWrapperException; +// URL resource: protocol handler removal: START +// remove +// import com.arsdigita.util.UncheckedWrapperException; +// URL resource: protocol handler removal: END import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.ClassParameter; import com.arsdigita.util.parameter.EnumerationParameter; @@ -53,10 +53,35 @@ import com.arsdigita.util.parameter.ErrorList; import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.ParameterError; +// URL resource: protocol handler removal: START +// new: import: +import com.arsdigita.util.parameter.ResourceParameter; +// URL resource: protocol handler removal: END import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; -import com.arsdigita.util.parameter.URLParameter; +// URL resource: protocol handler removal: START +// remove: +// import com.arsdigita.util.parameter.URLParameter; +// new: import: import com.arsdigita.util.StringUtils; +// URL resource: protocol handler removal: END + +// URL resource: protocol handler removal: START +// remove: +// import java.io.IOException; +// import java.net.MalformedURLException; +// import java.net.URL; +// URL resource: protocol handler removal: END +import java.io.InputStream; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; /** * A record containing server-session scoped configuration properties. @@ -197,16 +222,24 @@ public final class ContentSectionConfig extends AbstractConfig { m_useSectionCategories = new BooleanParameter ("com.arsdigita.cms.use_section_categories", Parameter.REQUIRED, new Boolean(true)); - - try { - m_itemAdapters = new URLParameter - ("com.arsdigita.cms.item_adapters", - Parameter.REQUIRED, - new URL("resource:WEB-INF/resources/cms-item-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } - + + // URL resource: protocol handler removal: START + // remove: + // try { + // m_itemAdapters = new URLParameter + // ("com.arsdigita.cms.item_adapters", + // Parameter.REQUIRED, + // new URL("resource:WEB-INF/resources/cms-item-adapters.xml")); + // } catch (MalformedURLException ex) { + // throw new UncheckedWrapperException("Cannot parse URL", ex); + // } + // ADD: + m_itemAdapters = new ResourceParameter + ("com.arsdigita.cms.item_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/cms-item-adapters.xml"); + // URL resource: protocol handler removal: END + m_defaultSection = new StringParameter ("com.arsdigita.cms.default_content_section", Parameter.REQUIRED, "content"); @@ -456,11 +489,15 @@ public final class ContentSectionConfig extends AbstractConfig { } public final InputStream getItemAdapters() { - try { - return ((URL)get(m_itemAdapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + // URL resource: protocol handler removal: START + // remove: + // try { + // return ((URL)get(m_itemAdapters)).openStream(); + // } catch (IOException ex) { + // throw new UncheckedWrapperException("Cannot read stream", ex); + // } + // ADD: + return (InputStream)get(m_itemAdapters); } public final String getDefaultContentSection() { @@ -576,6 +613,7 @@ public final class ContentSectionConfig extends AbstractConfig { } // value != null + @Override protected Object unmarshal(String value, ErrorList errors) { Class theClass = (Class) super.unmarshal(value,errors); if (theClass != null) { @@ -597,6 +635,7 @@ public final class ContentSectionConfig extends AbstractConfig { super(name, multiplicity, defaultObj); } + @Override protected Object unmarshal(String value, ErrorList errors) { return DHTMLEditor.Config.valueOf(value); } diff --git a/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties b/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties index 3bfe1350e..871ae5902 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties +++ b/ccm-cms/src/com/arsdigita/cms/ContentSectionConfig_parameter.properties @@ -49,9 +49,9 @@ com.arsdigita.cms.use_section_categories.example=true com.arsdigita.cms.use_section_categories.format=[boolean] com.arsdigita.cms.item_adapters.title=Item Adapters File -com.arsdigita.cms.item_adapters.purpose=The URL to an XML resource containing adapter specifications. -com.arsdigita.cms.item_adapters.example=resource:WEB-INF/resources/cms-item-adapters.xml -com.arsdigita.cms.item_adapters.format=[url] +com.arsdigita.cms.item_adapters.purpose=Path to an XML resource containing adapter specifications. Path is relative to webapp root. +com.arsdigita.cms.item_adapters.example=/WEB-INF/resources/cms-item-adapters.xml +com.arsdigita.cms.item_adapters.format=[string] com.arsdigita.cms.default_content_section.title = Default Content Section com.arsdigita.cms.default_content_section.purpose = The name of the default content section diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java index 6420f416b..3e948bd0f 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/AbstractContentTypeLoader.java @@ -45,7 +45,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Date; -import java.net.URL; import java.util.Iterator; import java.util.List; @@ -61,7 +60,10 @@ import java.util.List; public abstract class AbstractContentTypeLoader extends PackageLoader { - public final static String versionId = "$Id: AbstractContentTypeLoader.java 754 2005-09-02 13:26:17Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/17 23:15:09 $"; + public final static String versionId = + "$Id: AbstractContentTypeLoader.java 754 2005-09-02 13:26:17Z sskracic $" + + " by $Author: sskracic $, " + + "$DateTime: 2004/08/17 23:15:09 $"; public void run(final ScriptContext ctx) { new KernelExcursion() { @@ -161,7 +163,7 @@ public abstract class AbstractContentTypeLoader extends PackageLoader { */ protected Template setDefaultTemplate(final String name, final String label, - final URL templateURL, + final InputStream templateIs, final ContentSection section, final ContentType type, final LifecycleDefinition ld, @@ -172,17 +174,10 @@ public abstract class AbstractContentTypeLoader extends PackageLoader { template.setContentSection(section); template.setParent(section.getTemplatesFolder()); - InputStream stream; - try { - stream = templateURL.openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } - - Assert.truth(stream != null, "Template not found"); + Assert.isTrue(templateIs != null, "Template not found"); final BufferedReader input = new BufferedReader - (new InputStreamReader(stream)); + (new InputStreamReader(templateIs)); final StringBuffer body = new StringBuffer(); diff --git a/ccm-core/application.xml b/ccm-core/application.xml index 05230d399..6698010dd 100755 --- a/ccm-core/application.xml +++ b/ccm-core/application.xml @@ -16,14 +16,19 @@ - + + + diff --git a/ccm-core/build-hooks.xml b/ccm-core/build-hooks.xml index 2d4f103b3..30ce532dc 100755 --- a/ccm-core/build-hooks.xml +++ b/ccm-core/build-hooks.xml @@ -45,19 +45,14 @@ - + - + diff --git a/ccm-core/src/com/arsdigita/loader/CoreLoader.java b/ccm-core/src/com/arsdigita/loader/CoreLoader.java index dc16a264e..260f5b0ef 100755 --- a/ccm-core/src/com/arsdigita/loader/CoreLoader.java +++ b/ccm-core/src/com/arsdigita/loader/CoreLoader.java @@ -18,15 +18,6 @@ */ package com.arsdigita.loader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.Locale; - -import javax.mail.internet.InternetAddress; - -import org.apache.log4j.Logger; - import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.kernel.EmailAddress; import com.arsdigita.kernel.Kernel; @@ -53,7 +44,7 @@ import com.arsdigita.ui.sitemap.SiteMap; import com.arsdigita.util.Assert; import com.arsdigita.util.StringUtils; import com.arsdigita.util.UncheckedWrapperException; -import com.arsdigita.util.parameter.CSVParameterLoader; +import com.arsdigita.util.parameter.CSVParameterReader; import com.arsdigita.util.parameter.EmailParameter; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringParameter; @@ -63,6 +54,15 @@ import com.arsdigita.web.ApplicationType; import com.arsdigita.web.Host; import com.arsdigita.web.Web; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Locale; + +import javax.mail.internet.InternetAddress; + +import org.apache.log4j.Logger; /** * CoreLoader * @@ -441,7 +441,7 @@ public class CoreLoader extends PackageLoader { try { MimeTypeRow row = new MimeTypeRow(); - CSVParameterLoader loader = new CSVParameterLoader + CSVParameterReader loader = new CSVParameterReader (new InputStreamReader(is), row.getParameters()); while (loader.next()) { diff --git a/ccm-core/src/com/arsdigita/mail/MailConfig.java b/ccm-core/src/com/arsdigita/mail/MailConfig.java index 921b67b2c..8a05445fd 100755 --- a/ccm-core/src/com/arsdigita/mail/MailConfig.java +++ b/ccm-core/src/com/arsdigita/mail/MailConfig.java @@ -27,6 +27,7 @@ import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.util.parameter.URLParameter; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.web.Web; + import java.io.IOException; import java.net.URL; import java.util.Properties; @@ -40,7 +41,10 @@ import java.util.Properties; public final class MailConfig extends AbstractConfig { - public final static String versionId = "$Id: MailConfig.java 1513 2007-03-22 09:09:03Z chrisgilbert23 $ by $Author: chrisgilbert23 $, $DateTime: 2004/08/16 18:10:38 $"; + public final static String versionId = + "$Id: MailConfig.java 1513 2007-03-22 09:09:03Z chrisgilbert23 $" + + " by $Author: chrisgilbert23 $, "+ + "$DateTime: 2004/08/16 18:10:38 $"; private Properties m_props; diff --git a/ccm-core/src/com/arsdigita/mail/MailConfig_parameter.properties b/ccm-core/src/com/arsdigita/mail/MailConfig_parameter.properties index 83a59ab26..375cde059 100755 --- a/ccm-core/src/com/arsdigita/mail/MailConfig_parameter.properties +++ b/ccm-core/src/com/arsdigita/mail/MailConfig_parameter.properties @@ -2,10 +2,12 @@ waf.mail.debug.title=Mail debug flag waf.mail.debug.purpose=Enables or disables debugging for the mail component waf.mail.debug.example=true waf.mail.debug.format=true|false + waf.mail.javamail.configuration.title=JavaMail properties URL waf.mail.javamail.configuration.purpose=URL of properties file used to create JavaMail session for outgoing mail waf.mail.javamail.configuration.example=file:///etc/javamail.properties waf.mail.javamail.configuration.format=[url] + waf.mail.send_html_mail.title=Send html messages as html emails waf.mail.send_html_mail.purpose=Determine whether to send html messages as html, or convert to plain mail waf.mail.send_html_mail.example=true|false diff --git a/ccm-core/src/com/arsdigita/runtime/ConfigRegistry.java b/ccm-core/src/com/arsdigita/runtime/ConfigRegistry.java index 9ec8fda36..ac8eede71 100755 --- a/ccm-core/src/com/arsdigita/runtime/ConfigRegistry.java +++ b/ccm-core/src/com/arsdigita/runtime/ConfigRegistry.java @@ -19,7 +19,7 @@ package com.arsdigita.runtime; // import com.arsdigita.runtime.RegistryConfig; -import com.arsdigita.runtime.CCMResourceManager; +// import com.arsdigita.runtime.CCMResourceManager; import com.arsdigita.util.Classes; import com.arsdigita.util.JavaPropertyReader; import com.arsdigita.util.UncheckedWrapperException; diff --git a/ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java b/ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java rename to ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/util/parameter/AbstractParameter.java b/ccm-core/src/com/arsdigita/util/parameter/AbstractParameter.java index cb5bdcc82..46885ef64 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/AbstractParameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/AbstractParameter.java @@ -22,15 +22,16 @@ import com.arsdigita.util.Assert; import org.apache.commons.beanutils.ConversionException; /** - * Subject to change. + * A base implementation of the Parameter interface. * - * A base implementation of the Parameter interface. It - * offers subclasses use of the Apache BeanUtils framework, should + * It offers subclasses use of the Apache BeanUtils framework, should * they opt to use it. * - * Methods of the form doXXX are extension points for - * subclasses. The isRequired() and - * getDefaultValue() methods may also be overriden. + * Methods of the form doXXX are extension points for subclasses. + * The isRequired() and getDefaultValue() + * methods may also be overriden. + * + * Subject to change. * * @see Parameter * @author Justin Ross <jross@redhat.com> @@ -105,10 +106,9 @@ public abstract class AbstractParameter implements Parameter { } /** - * Parameter users may override this method to make the - * multiplicity of the parameter dependent on the multiplicity of - * related parameters. - * + * Parameter users may override this method to make the multiplicity of + * the parameter dependent on the multiplicity of related parameters. + * * @see Parameter#isRequired() */ public boolean isRequired() { @@ -151,13 +151,10 @@ public abstract class AbstractParameter implements Parameter { // /** - * Calls {@link #doRead(ParameterReader,ErrorList)}. - * - * @see Parameter#read(ParameterReader,ErrorList) - * - * From Parameter#read(ParameterReader,ErrorList): - * Gets the parameter value as a Java object. The value will have - * a specific runtime type and so may be appropriately cast. + * Gets the parameter value as a Java object. + * + * The value will have a specific runtime type and so may be + * appropriately cast. * * Reading typically follows the following procedure: * @@ -173,6 +170,8 @@ public abstract class AbstractParameter implements Parameter { * added to errors. Callers of this method will * typically construct an ErrorList in which to * collect errors. + * Actually calls {@link #doRead(ParameterReader,ErrorList)} (as an + * extension point for subclasses). * * @param reader The ParameterReader from which to * recover a string literal value; it cannot be null @@ -192,14 +191,14 @@ public abstract class AbstractParameter implements Parameter { } /** - * Reads the value of the parameter from reader, - * unmarshals it, and returns it. If any errors are encountered, + * Extension point to read the value of the parameter from reader. + * + * It unmarshals the value, and returns it. If any errors are encountered, * they are added to errors. * - * If the literal string value from reader is not - * null, this method delegates to {@link - * #unmarshal(String,ErrorList)}. - * + * If the literal string value from reader is not null, + * this method delegates to {@link #unmarshal(String,ErrorList)}. + * * This implementation is suited to a parameter with a singular * scalar value. Subclasses that are compound parameters should * override this method to delegate to child parameters. diff --git a/ccm-core/src/com/arsdigita/util/parameter/AbstractParameterContext.java b/ccm-core/src/com/arsdigita/util/parameter/AbstractParameterContext.java index adf729996..08e6d98ff 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/AbstractParameterContext.java +++ b/ccm-core/src/com/arsdigita/util/parameter/AbstractParameterContext.java @@ -32,11 +32,11 @@ import java.util.Properties; import org.apache.log4j.Logger; /** - * Subject to change. - * * A base implementation of the ParameterContext * interface. * + * Subject to change. + * * @see com.arsdigita.util.parameter.ParameterContext * @author Justin Ross <jross@redhat.com> * @version $Id: AbstractParameterContext.java 287 2005-02-22 00:29:02Z sskracic $ @@ -98,10 +98,10 @@ public abstract class AbstractParameterContext implements ParameterContext { } /** - * From ParameterContext#get(Parameter): - * Gets the unmarshaled value of param. If the - * loaded value is null, param.getDefaultValue() is - * returned. + * Gets the unmarshaled value of param. + * + * If the loaded value is null, param.getDefaultValue() + * is returned. * * @param param The named Parameter whose value to * retrieve; it cannot be null @@ -112,7 +112,6 @@ public abstract class AbstractParameterContext implements ParameterContext { } /** - * From ParameterContext#get(Parameter,Object) * Gets the unmarshaled value of param, returning * dephalt if param's value is null. * @@ -154,8 +153,6 @@ public abstract class AbstractParameterContext implements ParameterContext { } /** - * - * * Reads and unmarshals all values associated with the registered * parameters from reader. Any errors are returned. * @@ -173,7 +170,6 @@ public abstract class AbstractParameterContext implements ParameterContext { } /** - * From ParameterContext#load(ParameterReader,ErrorList): * Reads and unmarshals all values associated with the registered * parameters from reader. If any errors are * encountered, they are added to errors. diff --git a/ccm-core/src/com/arsdigita/util/parameter/CSV.java.example b/ccm-core/src/com/arsdigita/util/parameter/CSV.java.example index 01cd2d51e..dc2392e1d 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/CSV.java.example +++ b/ccm-core/src/com/arsdigita/util/parameter/CSV.java.example @@ -31,6 +31,9 @@ import javax.mail.internet.InternetAddress; /** * Demonstrates how to use the CSVParameterLoader class. * + * OUTDATED! CSVParameterLoader has become CSVParameterReader + * see CoreLoader as an example how to use CSVParamegterReader + * * @author Justin Ross <jross@redhat.com> * @version $Id: CSV.java 287 2005-02-22 00:29:02Z sskracic $ */ diff --git a/ccm-core/src/com/arsdigita/util/parameter/CSVParameterLoader.java b/ccm-core/src/com/arsdigita/util/parameter/CSVParameterReader.java similarity index 94% rename from ccm-core/src/com/arsdigita/util/parameter/CSVParameterLoader.java rename to ccm-core/src/com/arsdigita/util/parameter/CSVParameterReader.java index 459964b36..1aca506e0 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/CSVParameterLoader.java +++ b/ccm-core/src/com/arsdigita/util/parameter/CSVParameterReader.java @@ -35,9 +35,9 @@ import java.util.List; * list of parameter values) and .... * * @author Justin Ross <jross@redhat.com> - * @version $Id: CSVParameterLoader.java 287 2005-02-22 00:29:02Z sskracic $ + * @version $Id: CSVParameterReader.java 287 2005-02-22 00:29:02Z sskracic $ */ -public final class CSVParameterLoader implements ParameterReader { +public final class CSVParameterReader implements ParameterReader { public final static String versionId = "$Id: CSVParameterLoader.java 287 2005-02-22 00:29:02Z sskracic $" + "$Author: sskracic $" + @@ -53,7 +53,7 @@ public final class CSVParameterLoader implements ParameterReader { * @param reader: input stream to read values * @param params: array of parameter objects to store procecced values */ - public CSVParameterLoader(final Reader reader, final Parameter[] params) { + public CSVParameterReader(final Reader reader, final Parameter[] params) { m_reader = new LineNumberReader(reader); // input stream m_params = params; // array of parameters m_line = new HashMap(params.length); // @@ -72,6 +72,12 @@ public final class CSVParameterLoader implements ParameterReader { return (String) m_line.get(param); } /* + * May 2009: Obviously a reminiscence from previous versions of code. This class + * is currently used by coreloader only and it does not use the load method + * and it works with load commented out. + * + * Code should be removed after extensive testing. + * public final ParameterValue load(final Parameter param) { final ParameterValue value = new ParameterValue(); diff --git a/ccm-core/src/com/arsdigita/util/parameter/ClassParameter.java b/ccm-core/src/com/arsdigita/util/parameter/ClassParameter.java index 078c84854..4ffea0b09 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/ClassParameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/ClassParameter.java @@ -21,10 +21,10 @@ package com.arsdigita.util.parameter; import org.apache.commons.beanutils.converters.ClassConverter; /** - * Subject to change. - * * A parameter representing a Java Class. * + * Subject to change. + * * @see java.lang.Class * @see Parameter * @author Justin Ross <jross@redhat.com> diff --git a/ccm-core/src/com/arsdigita/util/parameter/IntegerParameter.java b/ccm-core/src/com/arsdigita/util/parameter/IntegerParameter.java index 866e60980..372d18cec 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/IntegerParameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/IntegerParameter.java @@ -21,10 +21,10 @@ package com.arsdigita.util.parameter; import org.apache.commons.beanutils.converters.IntegerConverter; /** - * Subject to change. - * * A parameter representing a Java Integer. * + * Subject to change. + * * @see java.lang.Integer * @see Parameter * @author Justin Ross <jross@redhat.com> diff --git a/ccm-core/src/com/arsdigita/util/parameter/Parameter.java b/ccm-core/src/com/arsdigita/util/parameter/Parameter.java index 13bd119b3..02cb13550 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/Parameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/Parameter.java @@ -19,11 +19,13 @@ package com.arsdigita.util.parameter; /** + * Describes a named property that can read, write, and validate its + * own value. + * * Subject to change. * - * Describes a named property that can read, write, and validate its - * own value. See the documentation on {@link #read}, {@link #write}, - * and {@link #validate} for details. + * See the documentation on {@link #read}, {@link #write}, and {@link #validate} + * for details. * They have the following features as well: * @@ -49,9 +51,9 @@ package com.arsdigita.util.parameter; * successfully or fail outright. * * Parameters are stateless "messages". They do not store their own - * values. Instead, a {@link - * com.arsdigita.util.parameter.ParameterContext} manages a set of - * parameters and keeps their values. + * values. Instead, a {@link com.arsdigita.util.parameter.ParameterContext} + * manages a set of parameters and keeps their values. + * * * Here's what it typically looks like to use a parameter: * @@ -174,7 +176,7 @@ public interface Parameter { /** * Writes the parameter value as a string literal. The parameter - * marshals he object value to a string and sends it + * marshals the object value to a string and sends it * to writer. * * @param writer The ParameterWriter that will take diff --git a/ccm-core/src/com/arsdigita/util/parameter/ParameterContext.java b/ccm-core/src/com/arsdigita/util/parameter/ParameterContext.java index 641fe03ab..554b4f4e9 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/ParameterContext.java +++ b/ccm-core/src/com/arsdigita/util/parameter/ParameterContext.java @@ -19,10 +19,12 @@ package com.arsdigita.util.parameter; /** - * Subject to change. + * A container of parameters. + * + * A parameter context binds together a set of parameters and keeps their values. + * * - * A container of parameters. A parameter context binds together a - * set of parameters and keeps their values. + * Subject to change. * * @see com.arsdigita.util.parameter.Parameter * @author Justin Ross <jross@redhat.com> diff --git a/ccm-core/src/com/arsdigita/util/parameter/ParameterLoader.java b/ccm-core/src/com/arsdigita/util/parameter/ParameterLoader.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/util/parameter/ParameterLoader.java rename to ccm-core/src/com/arsdigita/util/parameter/ParameterLoader.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/util/parameter/ParameterValue.java b/ccm-core/src/com/arsdigita/util/parameter/ParameterValue.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/util/parameter/ParameterValue.java rename to ccm-core/src/com/arsdigita/util/parameter/ParameterValue.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/util/parameter/ResourceParameter.java b/ccm-core/src/com/arsdigita/util/parameter/ResourceParameter.java index 15cae35f2..2cf4a686e 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/ResourceParameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/ResourceParameter.java @@ -23,22 +23,32 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.net.URL; +import java.util.Iterator; + import org.apache.log4j.Logger; +import com.arsdigita.util.UncheckedWrapperException; + /** + * A parameter representing a JEE Resource (input stream). + * * This takes in a path and makes sure that the resource exists either * as a File or an actual resource. If it does, it returns the * InputStream for the given Resource. If it does not, and if it is * required, it logs an error. Otherwise, it returns null. * + * Development note / CHANGELOG * Had been deprecated for a while in favour of an URLParameter and a * application specific resource: protocol extension (c.ad.util.protocol.resource). * As of version 6.5 reverted to ResourceParameter to avoid non-standard extensions. * * @author Justin Ross <jross@redhat.com> + * @author Brett <bprucha@users.sourceforge net> + * @author PBoy <pboy@users.sourceforge net> * @version $Id: ResourceParameter.java 287 2005-02-22 00:29:02Z sskracic $ */ -public class ResourceParameter extends StringParameter { +public class ResourceParameter extends AbstractParameter { + public final static String versionId = "$Id: ResourceParameter.java 287 2005-02-22 00:29:02Z sskracic $" + "$Author: sskracic $" + @@ -46,17 +56,71 @@ public class ResourceParameter extends StringParameter { private static final Logger s_log = Logger.getLogger(ResourceParameter.class); + private Object m_default = null; + public ResourceParameter(final String name) { - super(name); + super(name, InputStream.class); } public ResourceParameter(final String name, - final int multiplicity, - final Object defaalt) { - super(name, multiplicity, defaalt); + final int multiplicity, + final Object defaultValue) { + + super(name, multiplicity, defaultValue, InputStream.class); + m_default = defaultValue; } + /** + * Get default value and return it as InputStream. + * + * Developers note: + * This makes the trick to use Parameter.java interface rsp AbstractParameter + * for other types of parameter as Strint. If you don't overwrite this + * method, you will always get a casting error, because the parameter + * returns a string instead of the intended object! + * + * @return default value as InputStream + */ + public Object getDefaultValue() { + + if(m_default instanceof String) { + ErrorList errors = new ErrorList(); + InputStream stream = (InputStream)unmarshal((String)m_default, errors); + + if(!errors.isEmpty()) { + String strErrors = ""; + for(Iterator i = errors.iterator(); i.hasNext(); ) { + ParameterError pe = (ParameterError)i.next(); + strErrors += pe.getMessage() + "\r\n"; + } + throw new UncheckedWrapperException(strErrors); + } + + return stream; + } else + return m_default; + } + + /** + * Unmarshals the encoded string value of the parameter to get the intended + * object type. It tries first to find a file of the specified name in the + * file system. If not successful it uses the classloader to find the file + * in the class path / jar files. + * + * @param value + * @param errors + * @return parameter value as an InputStream + */ + @Override protected Object unmarshal(String value, final ErrorList errors) { + + // NOTE: + // This implementation will never find the file in the file system. + // The name has to be specified relativ to document root. So we must + // precede value with the context path, e.g. using + // c.ad.runtime.CCMResourceManager as soon as it's implementation is + // fixed / stable (when all modifications of the runtime environment + // are done). File file = new File(value); if (!file.exists()) { diff --git a/ccm-core/src/com/arsdigita/util/parameter/StringParameter.java b/ccm-core/src/com/arsdigita/util/parameter/StringParameter.java index 1f2101360..a32731910 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/StringParameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/StringParameter.java @@ -21,10 +21,10 @@ package com.arsdigita.util.parameter; import org.apache.commons.beanutils.converters.StringConverter; /** - * Subject to change. - * * A parameter representing a Java String. * + * Subject to change. + * * @see java.lang.String * @see Parameter * @author Justin Ross <jross@redhat.com> diff --git a/ccm-core/src/com/arsdigita/util/parameter/SymbolicNameParameter.java b/ccm-core/src/com/arsdigita/util/parameter/SymbolicNameParameter.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/util/parameter/SymbolicNameParameter.java rename to ccm-core/src/com/arsdigita/util/parameter/SymbolicNameParameter.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/util/parameter/package.html b/ccm-core/src/com/arsdigita/util/parameter/package.html new file mode 100644 index 000000000..feb9554fb --- /dev/null +++ b/ccm-core/src/com/arsdigita/util/parameter/package.html @@ -0,0 +1,158 @@ + + + + + +com.arsdigita.util.parameter + + + + +

+Provides a framework to handle different types of configuration parameters, +held in a registry (configuration database), in a transparent +and easy to use way - not to be confused with other kind of parameters as +command line parameters. +

+

Interface ParameterContext

+

+ +Key element is ParameterContext (Interface) which describes a +container of parameters. A parameter context binds together a set of +parameters and keeps their values. + +Among it's most important methods are

+
    +
  • get(param) to get the unmarshaled parameter value as an object, +converted from the encoded (marshaled) representation used for storing the +value
  • +
  • getParameters() to list all included parameters
  • +
+

Interface Parameter

+

+Each parameter is described by the Parameter.java +interface. It is designed as a named property that can read, +write, and validate its own value. Parameters are +stateless "messages". They do not store their own values. +Instead, a {@link com.arsdigita.util.parameter.ParameterContext} +manages a set of parameters and keeps their values. +

+Among it's most important methods are

+
    +
  • read to read the literal (encoded / marshaled) value (usually +a String type) from the storage and convert (unmarshal) it to the +appropriate Java object.
  • +
+

Interface Implementations

+

+The classes AbstractParameterContext and +AbstractParameter provide a basic implementation of both +interfaces. It's most important feature is the marshal / unmarshal mechanism. +

+

+Any specific parameter which inherits from these implementation must override +at least:

+
    +
  • unmarshal()
  • +
  • getDefaultValue()
  • +
+ +

How To Use

+

+See package com.arsdigita.cms as an example. The class +ContextSectionConfig provides a configuration registry for the +package.

+
    +
  • ContextSectionConfig provides the actual registry
  • +
  • extends AbstractConfig
  • +
  • extends AbstractParameterContext
  • +
  • implements ParameterContext
  • +
+

+[More details comming soon :-) ] +

+ + + + + + + + + + + + + + +
+

Developers Comment

+

+There is some weakness in the current design and implementation of the package. +

+
    +
  • The Parameter Interface collects errors during processing in an +ErrorList object, "in lieu of throwing exceptions that are not +useful in creating error-recovery UIs". +
      +
    • This is just another time where APLAWS uses a non standard, application +specific extension
    • +
    • There is no systematik application code which makes use of this feature to +avoid exceptions. Practically it is just a devious route to an exception.
    • +
    • It makes usage of the package unnecessary complicated, cumbersome and +results in bloated code.
    • +
    +
  • +
  • The class hierarchy is unneccessary compless and fine granulated. At least +the classes AbstractConfig and AbstractParameterContext +could be combined.
  • +
  • The AbstractParameterContext implementation is weak. Several +parameters are not able to convert to the intended object type, but need +external support, e.g BoleanParameter, where the get() method must be assisted +by the asBoolean() method of the Boolean class.
  • +
+

+Therefore the project should consider to redesign the package and reimplement it +in the long run. +

+
+ + + + + diff --git a/ccm-core/src/com/arsdigita/util/protocol/resource/Handler.java b/ccm-core/src/com/arsdigita/util/protocol/resource/Handler.java index b8c5d0055..58d9ae768 100755 --- a/ccm-core/src/com/arsdigita/util/protocol/resource/Handler.java +++ b/ccm-core/src/com/arsdigita/util/protocol/resource/Handler.java @@ -29,7 +29,7 @@ import java.net.URLStreamHandler; * Handler * pboy: * - * Handler for the URL resource:// protocoll. + * Handler for the URL resource:// protocol. * * To make it work it must be loaded by the system classloader. (Part of the * "java.ext.dirs" system property). @@ -41,11 +41,13 @@ import java.net.URLStreamHandler; * If it is not properly done, you will get a MalformedURLException: unknown * protocol: resource * - * ToDo: replace the resource: protokoll by use of the Class or ClassLoader - * getResource() and/or getResourceAsStream() methods (system wide). - * * @author Rafael H. Schloming <rhs@mit.edu> * @version $Revision: #2 $ $Date: 2004/08/16 $ + * + * ToDo: replace the resource: protokoll by use of the Class or ClassLoader + * getResource() and/or getResourceAsStream() methods (system wide). + * @deprecated Use ResourceParameter instead. + * See c.ad.cms.ContentSectionConfig.java as an example how to modify code. **/ public class Handler extends URLStreamHandler { diff --git a/ccm-core/src/com/arsdigita/util/servlet/HttpResourceLocator.java b/ccm-core/src/com/arsdigita/util/servlet/HttpResourceLocator.java index 05df8570d..a1d0d8e29 100755 --- a/ccm-core/src/com/arsdigita/util/servlet/HttpResourceLocator.java +++ b/ccm-core/src/com/arsdigita/util/servlet/HttpResourceLocator.java @@ -173,20 +173,20 @@ public class HttpResourceLocator { final String servletPath, final String pathInfo, final HttpParameterMap params) { - if (Assert.isAssertEnabled()) { + if (Assert.isEnabled()) { Assert.exists(host, HttpHost.class); Assert.exists(contextPath, String.class); Assert.exists(servletPath, String.class); if (contextPath.startsWith("/")) { - Assert.truth + Assert.isTrue (!contextPath.endsWith("/"), "A contextPath starting with '/' must not end in '/'; " + "I got '" + contextPath + "'"); } if (pathInfo != null) { - Assert.truth(pathInfo.startsWith("/"), + Assert.isTrue(pathInfo.startsWith("/"), "I expected a pathInfo starting with '/' " + "and got '" + pathInfo + "' instead"); } diff --git a/ccm-core/src/com/arsdigita/web/HostLoader.java b/ccm-core/src/com/arsdigita/web/HostLoader.java index 3a73bf951..cb7b2bfe4 100755 --- a/ccm-core/src/com/arsdigita/web/HostLoader.java +++ b/ccm-core/src/com/arsdigita/web/HostLoader.java @@ -22,14 +22,19 @@ import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.TransactionContext; import com.arsdigita.runtime.AbstractScript; -import com.arsdigita.runtime.InteractiveParameterLoader; +// InteractiveParameterLoader extents ParameterLoader, which is deprecated. +// InteractiveParameterReader should be used instead. +// import com.arsdigita.runtime.InteractiveParameterLoader; +import com.arsdigita.runtime.InteractiveParameterReader; import com.arsdigita.runtime.Script; import com.arsdigita.runtime.ScriptContext; import com.arsdigita.runtime.Startup; import com.arsdigita.util.parameter.ErrorList; import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.ParameterLoader; +// ParameterLoader is deprecated, use ParameterReader instead. +// import com.arsdigita.util.parameter.ParameterLoader; +import com.arsdigita.util.parameter.ParameterReader; import com.arsdigita.util.parameter.StringParameter; import org.apache.log4j.Logger; @@ -72,15 +77,19 @@ public final class HostLoader extends AbstractScript { new Startup().run(); final Session session = SessionManager.getSession(); - final ParameterLoader loader = new InteractiveParameterLoader + // final ParameterLoader loader = new InteractiveParameterLoader + // (System.in, System.out); + final ParameterReader reader = new InteractiveParameterReader (System.in, System.out); final TransactionContext transaction = session.getTransactionContext(); transaction.beginTxn(); Script script = new HostLoader(); - script.load(loader, new ErrorList()); - script.run(new ScriptContext(session, loader)); + // script.load(loader, new ErrorList()); + // script.run(new ScriptContext(session, loader)); + script.load(reader, new ErrorList()); + script.run(new ScriptContext(session, reader)); transaction.commitTxn(); } diff --git a/ccm-forum/src/com/arsdigita/forum/ForumConfig.java b/ccm-forum/src/com/arsdigita/forum/ForumConfig.java index 95a5150fa..2d4984985 100755 --- a/ccm-forum/src/com/arsdigita/forum/ForumConfig.java +++ b/ccm-forum/src/com/arsdigita/forum/ForumConfig.java @@ -18,34 +18,34 @@ */ package com.arsdigita.forum; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; - -import org.apache.log4j.Logger; - -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.UserCollection; +import com.arsdigita.kernel.User; +import com.arsdigita.kernel.UserCollection; import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.UncheckedWrapperException; +// import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.parameter.BooleanParameter; -import com.arsdigita.util.parameter.IntegerParameter; +import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringParameter; -import com.arsdigita.util.parameter.URLParameter; +import com.arsdigita.util.parameter.ResourceParameter; import com.arsdigita.web.Web; +import java.io.IOException; +import java.io.InputStream; +// import java.net.MalformedURLException; +// import java.net.URL; + +import org.apache.log4j.Logger; + /** * A set of configuration parameters for forums. * * @author Justin Ross <jross@redhat.com> - * @version $Id: ForumConfig.java 1628 2007-09-17 08:10:40Z chrisg23 $ + * @version $Id: ForumConfig.java 1628 2007-09-17 08:10:40Z chrisg23 $ */ public class ForumConfig extends AbstractConfig { public final static String versionId = - "$Id: ForumConfig.java 1628 2007-09-17 08:10:40Z chrisg23 $" + - "$Author: chrisg23 $" + + "$Id: ForumConfig.java 1628 2007-09-17 08:10:40Z chrisg23 $" + + "$Author: chrisg23 $" + "$DateTime: 2004/08/17 23:26:27 $"; private static final Logger s_log = Logger.getLogger(ForumConfig.class); @@ -54,20 +54,21 @@ public class ForumConfig extends AbstractConfig { private Parameter m_authorEditPosts; private Parameter m_digestUserEmail; private Parameter m_replyHostName; - private Parameter m_disablePageCaching; - private Parameter m_adminOnlyCreateTopics; - private Parameter m_maxImageSize; - private Parameter m_maxFileSize; + private Parameter m_disablePageCaching; + private Parameter m_adminOnlyCreateTopics; + private Parameter m_maxImageSize; + private Parameter m_maxFileSize; private final Parameter m_adapters; - private Parameter m_showAllThreadAlerts; - private Parameter m_showNewTabs; - private Parameter m_useWysiwygEditor; - private Parameter m_rejectionMessage; - private Parameter m_threadPageSize; - private Parameter m_quickFinish; - private Parameter m_deleteSentSubscriptionNotifications; + private Parameter m_showAllThreadAlerts; + private Parameter m_showNewTabs; + private Parameter m_useWysiwygEditor; + private Parameter m_rejectionMessage; + private Parameter m_threadPageSize; + private Parameter m_quickFinish; + private Parameter m_deleteSentSubscriptionNotifications; public ForumConfig() { + m_adminEditPosts = new BooleanParameter( "com.arsdigita.forum.admin_can_edit_posts", Parameter.REQUIRED, @@ -84,85 +85,76 @@ public class ForumConfig extends AbstractConfig { "com.arsdigita.forum.digest_user_email", Parameter.OPTIONAL, null); - m_disablePageCaching = new BooleanParameter ( - "com.arsdigita.forum.disable_page_caching", - Parameter.REQUIRED, - Boolean.FALSE); - - m_adminOnlyCreateTopics = new BooleanParameter ( - "com.arsdigita.forum.admin_only_to_create_topics", - Parameter.REQUIRED, - Boolean.FALSE); - m_maxImageSize = new IntegerParameter ( - "com.arsdigita.forum.maximum_image_size", - Parameter.OPTIONAL, null); - m_maxFileSize = new IntegerParameter ( - "com.arsdigita.forum.maximum_file_size", - Parameter.OPTIONAL, null); - - m_showNewTabs = new BooleanParameter( - "com.arsdigita.forum.show_new_tabs", - Parameter.OPTIONAL, - Boolean.FALSE); - m_showAllThreadAlerts = new BooleanParameter( - "com.arsdigita.forum.show_all_forum_thread_alerts", - Parameter.OPTIONAL, - Boolean.TRUE); - m_useWysiwygEditor = new BooleanParameter( - "com.arsdigita.forum.use_wysiwyg_editor", - Parameter.OPTIONAL, - Boolean.FALSE); - m_rejectionMessage = new StringParameter( - "com.arsdigita.forum.rejection_form_message.example", - Parameter.OPTIONAL, - null); - m_threadPageSize = new IntegerParameter ( - "com.arsdigita.forum.thread_page_size", - Parameter.REQUIRED, new Integer(10)); - m_quickFinish = new BooleanParameter( - "com.arsdigita.forum.allow_quick_finish", - Parameter.OPTIONAL, - Boolean.FALSE); - m_deleteSentSubscriptionNotifications = new BooleanParameter( - "com.arsdigita.forum.delete_sent_subscription_notifications", - Parameter.OPTIONAL, - Boolean.FALSE); + m_disablePageCaching = new BooleanParameter ( + "com.arsdigita.forum.disable_page_caching", + Parameter.REQUIRED, + Boolean.FALSE); + + m_adminOnlyCreateTopics = new BooleanParameter ( + "com.arsdigita.forum.admin_only_to_create_topics", + Parameter.REQUIRED, + Boolean.FALSE); + m_maxImageSize = new IntegerParameter ( + "com.arsdigita.forum.maximum_image_size", + Parameter.OPTIONAL, null); + m_maxFileSize = new IntegerParameter ( + "com.arsdigita.forum.maximum_file_size", + Parameter.OPTIONAL, null); + + m_showNewTabs = new BooleanParameter( + "com.arsdigita.forum.show_new_tabs", + Parameter.OPTIONAL, + Boolean.FALSE); + m_showAllThreadAlerts = new BooleanParameter( + "com.arsdigita.forum.show_all_forum_thread_alerts", + Parameter.OPTIONAL, + Boolean.TRUE); + m_useWysiwygEditor = new BooleanParameter( + "com.arsdigita.forum.use_wysiwyg_editor", + Parameter.OPTIONAL, + Boolean.FALSE); + m_rejectionMessage = new StringParameter( + "com.arsdigita.forum.rejection_form_message.example", + Parameter.OPTIONAL, + null); + m_threadPageSize = new IntegerParameter ( + "com.arsdigita.forum.thread_page_size", + Parameter.REQUIRED, new Integer(10)); + m_quickFinish = new BooleanParameter( + "com.arsdigita.forum.allow_quick_finish", + Parameter.OPTIONAL, + Boolean.FALSE); + m_deleteSentSubscriptionNotifications = new BooleanParameter( + "com.arsdigita.forum.delete_sent_subscription_notifications", + Parameter.OPTIONAL, + Boolean.FALSE); - try { - m_adapters = new URLParameter - ("com.arsdigita.forum.traversal_adapters", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/resources/forum-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } + m_adapters = new ResourceParameter + ("com.arsdigita.forum.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/forum-adapters.xml"); register(m_digestUserEmail); register(m_adminEditPosts); register(m_authorEditPosts); register(m_replyHostName); register(m_adapters); - register(m_disablePageCaching); - register(m_adminOnlyCreateTopics); - register(m_maxImageSize); - register(m_maxFileSize); - register(m_showAllThreadAlerts); - register(m_showNewTabs); - register(m_useWysiwygEditor); - register(m_rejectionMessage); - register(m_threadPageSize); - register(m_quickFinish); - register(m_deleteSentSubscriptionNotifications); + register(m_disablePageCaching); + register(m_adminOnlyCreateTopics); + register(m_maxImageSize); + register(m_maxFileSize); + register(m_showAllThreadAlerts); + register(m_showNewTabs); + register(m_useWysiwygEditor); + register(m_rejectionMessage); + register(m_threadPageSize); + register(m_quickFinish); + register(m_deleteSentSubscriptionNotifications); loadInfo(); } InputStream getTraversalAdapters() { - try { - return ((URL)get(m_adapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + return (InputStream)get(m_adapters); } public boolean canAdminEditPosts() { @@ -189,28 +181,28 @@ public class ForumConfig extends AbstractConfig { return hostName; } - /** - * Supports prevention of client and middleware caching - - * use in situations where users with different - * permissions share machines - * @return - */ - public boolean disableClientPageCaching () { - return ((Boolean)get(m_disablePageCaching)).booleanValue(); - } - - /** - * if true, disables topic tab for non admin users. Topic - * tab does not access control topic creation, so set this - * to true to maintain control of the topics on the forum. - * - * - * - * @return - */ - public boolean topicCreationByAdminOnly () { - return ((Boolean)get(m_adminOnlyCreateTopics)).booleanValue(); - } + /** + * Supports prevention of client and middleware caching - + * use in situations where users with different + * permissions share machines + * @return + */ + public boolean disableClientPageCaching () { + return ((Boolean)get(m_disablePageCaching)).booleanValue(); + } + + /** + * if true, disables topic tab for non admin users. Topic + * tab does not access control topic creation, so set this + * to true to maintain control of the topics on the forum. + * + * + * + * @return + */ + public boolean topicCreationByAdminOnly () { + return ((Boolean)get(m_adminOnlyCreateTopics)).booleanValue(); + } public User getDigestUser() { String email = getDigestUserEmail(); @@ -226,85 +218,85 @@ public class ForumConfig extends AbstractConfig { users.close(); return user; } - /** - * returns the maximum allowed size (in bytes) of - * image files attached to posts. Any larger - * files are rejected by UI validation - * @return - */ - public long getMaxImageSize() { - Integer size = (Integer)get(m_maxImageSize); - long longSize = Long.MAX_VALUE; - if (size != null) { - longSize = size.longValue(); - } - return longSize; - } - /** - * returns the maximum allowed size (in bytes) of - * files attached to posts. Any larger - * files are rejected by UI validation - * @return - */ - public long getMaxFileSize() { - Integer size = (Integer)get(m_maxFileSize); - long longSize = Long.MAX_VALUE; - if (size != null) { - longSize = size.longValue(); - } - return longSize; - } - - - /** - * if true, alerts tab displays thread alerts for this and all other - * forums. If false, only display thread subscriptions for current - * forum. - * @return - */ - /* - * If true, the thread alert page lists thread alerts from - * all forums - alerts not from the current forum have - * links to the thread displayed within the context of - * the current forum. Looks weird and needs to be sorted out - * presumably the correct forum needs to be set in the ForumContext - * when a link is selected - */ - public boolean showThreadAlertsForAllForums () { - return ((Boolean)get(m_showAllThreadAlerts)).booleanValue(); - } - /** - * if true, displays setup and permissions tabs - * @return - */ - public boolean showNewTabs () { - return ((Boolean)get(m_showNewTabs)).booleanValue(); - } - - public boolean useWysiwygEditor () { - return ((Boolean)get(m_useWysiwygEditor)).booleanValue(); - } - - /** - * message added to the bottom of the moderation reection email. - * May give details about what the poster can do if not happy - * with rejection - * @return - */ - public String getRejectionMessage () { - return (String)get(m_rejectionMessage); - } - - public int getThreadPageSize () { - return ((Integer)get(m_threadPageSize)).intValue(); - } - - public boolean quickFinishAllowed () { - return ((Boolean)get(m_quickFinish)).booleanValue(); - } - - public boolean deleteNotifications () { - return ((Boolean)get(m_deleteSentSubscriptionNotifications)).booleanValue(); - } - + /** + * returns the maximum allowed size (in bytes) of + * image files attached to posts. Any larger + * files are rejected by UI validation + * @return + */ + public long getMaxImageSize() { + Integer size = (Integer)get(m_maxImageSize); + long longSize = Long.MAX_VALUE; + if (size != null) { + longSize = size.longValue(); + } + return longSize; + } + /** + * returns the maximum allowed size (in bytes) of + * files attached to posts. Any larger + * files are rejected by UI validation + * @return + */ + public long getMaxFileSize() { + Integer size = (Integer)get(m_maxFileSize); + long longSize = Long.MAX_VALUE; + if (size != null) { + longSize = size.longValue(); + } + return longSize; + } + + + /** + * if true, alerts tab displays thread alerts for this and all other + * forums. If false, only display thread subscriptions for current + * forum. + * @return + */ + /* + * If true, the thread alert page lists thread alerts from + * all forums - alerts not from the current forum have + * links to the thread displayed within the context of + * the current forum. Looks weird and needs to be sorted out + * presumably the correct forum needs to be set in the ForumContext + * when a link is selected + */ + public boolean showThreadAlertsForAllForums () { + return ((Boolean)get(m_showAllThreadAlerts)).booleanValue(); + } + /** + * if true, displays setup and permissions tabs + * @return + */ + public boolean showNewTabs () { + return ((Boolean)get(m_showNewTabs)).booleanValue(); + } + + public boolean useWysiwygEditor () { + return ((Boolean)get(m_useWysiwygEditor)).booleanValue(); + } + + /** + * message added to the bottom of the moderation reection email. + * May give details about what the poster can do if not happy + * with rejection + * @return + */ + public String getRejectionMessage () { + return (String)get(m_rejectionMessage); + } + + public int getThreadPageSize () { + return ((Integer)get(m_threadPageSize)).intValue(); + } + + public boolean quickFinishAllowed () { + return ((Boolean)get(m_quickFinish)).booleanValue(); + } + + public boolean deleteNotifications () { + return ((Boolean)get(m_deleteSentSubscriptionNotifications)).booleanValue(); + } + } diff --git a/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties b/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties index e6ecda2c6..9628cd504 100755 --- a/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties +++ b/ccm-forum/src/com/arsdigita/forum/ForumConfig_parameter.properties @@ -1,7 +1,7 @@ com.arsdigita.forum.traversal_adapters.title=XML renderer rules com.arsdigita.forum.traversal_adapters.purpose=Rules for configuring information in generated XML -com.arsdigita.forum.traversal_adapters.format=[url] -com.arsdigita.forum.traversal_adapters.example=resource:WEB-INF/resources/forum-adapters.xml +com.arsdigita.forum.traversal_adapters.format=[string] +com.arsdigita.forum.traversal_adapters.example=/WEB-INF/resources/forum-adapters.xml com.arsdigita.forum.digest_user_email.title=Digest user email address com.arsdigita.forum.digest_user_email.purpose=Email address of the user sending digest emails @@ -18,62 +18,62 @@ com.arsdigita.forum.admin_can_edit_posts.purpose=Whether administrators can edit com.arsdigita.forum.admin_can_edit_posts.format=[boolean] com.arsdigita.forum.admin_can_edit_posts.example=true|false -com.arsdigita.forum.admin_only_to_create_topics.title=Prevent other users creating new topics -com.arsdigita.forum.admin_only_to_create_topics.purpose=Whether only admin can create (true) topics or all users (false) -com.arsdigita.forum.admin_only_to_create_topics.format=[boolean] -com.arsdigita.forum.admin_only_to_create_topics.example=true|false - +com.arsdigita.forum.admin_only_to_create_topics.title=Prevent other users creating new topics +com.arsdigita.forum.admin_only_to_create_topics.purpose=Whether only admin can create (true) topics or all users (false) +com.arsdigita.forum.admin_only_to_create_topics.format=[boolean] +com.arsdigita.forum.admin_only_to_create_topics.example=true|false + com.arsdigita.forum.author_can_edit_posts.title=Authors can edit posts com.arsdigita.forum.author_can_edit_posts.purpose=Whether authors can edijt their posts com.arsdigita.forum.author_can_edit_posts.format=[boolean] com.arsdigita.forum.author_can_edit_posts.example=true|false -com.arsdigita.forum.disable_page_caching.title=Disable client & middleware page caching -com.arsdigita.forum.disable_page_caching.purpose=Disable caching, particularly for situations where users share PCs -com.arsdigita.forum.disable_page_caching.format=[boolean] -com.arsdigita.forum.disable_page_caching.example=true|false - -com.arsdigita.forum.maximum_image_size.title=Maximum size of image uploads in bytes -com.arsdigita.forum.maximum_image_size.purpose=Prevent huge images from being uploaded -com.arsdigita.forum.maximum_image_size.format=[integer] -com.arsdigita.forum.maximum_image_size.example=1048576 - -com.arsdigita.forum.maximum_file_size.title=Maximum size of file uploads in bytes -com.arsdigita.forum.maximum_file_size.purpose=prevent huge files from being uploaded -com.arsdigita.forum.maximum_file_size.format=[integer] -com.arsdigita.forum.maximum_file_size.example=1048576 - -com.arsdigita.forum.show_all_forum_thread_alerts.title=Display thread alerts from all forums -com.arsdigita.forum.show_all_forum_thread_alerts.purpose=decide whether to display thread alerts for this forum only or all alerts for user -com.arsdigita.forum.show_all_forum_thread_alerts.format=[boolean] -com.arsdigita.forum.show_all_forum_thread_alerts.example=true|false - -com.arsdigita.forum.show_new_tabs.title=Display permissions and setup tabs -com.arsdigita.forum.show_new_tabs.purpose=to allow forum users to completely hide new functionality -com.arsdigita.forum.show_new_tabs.format=[boolean] -com.arsdigita.forum.show_new_tabs.example=true|false - -com.arsdigita.forum.use_wysiwyg_editor.title=Use HTML Editor, or stick with legacy version -com.arsdigita.forum.use_wysiwyg_editor.purpose=to allow legacy implementations to stick with existing stylesheets -com.arsdigita.forum.use_wysiwyg_editor.format=[boolean] -com.arsdigita.forum.use_wysiwyg_editor.example=true|false - -com.arsdigita.forum.rejection_form_message.title=Instructions to poster added to bottom of email -com.arsdigita.forum.rejection_form_message.purpose=tail of email that may contain site specific information - who to contact etc -com.arsdigita.forum.rejection_form_message.format=[string] -com.arsdigita.forum.rejection_form_message.example=Please do not reply to this email. If you have any comments, please email webmaster@example.com - -com.arsdigita.forum.thread_page_size.title=Number of threads displayed per page -com.arsdigita.forum.thread_page_size.purpose=balance page loading time against number of key preses -com.arsdigita.forum.thread_page_size.format=[integer] -com.arsdigita.forum.thread_page_size.example=10 - -com.arsdigita.forum.allow_quick_finish.title=Allow quick finish on posts -com.arsdigita.forum.allow_quick_finish.purpose=To give users the option of omitting post steps if they have a quick text post -com.arsdigita.forum.allow_quick_finish.format=[boolean] -com.arsdigita.forum.allow_quick_finish.example=true|false - -com.arsdigita.forum.delete_sent_subscription_notifications.title=Delete Sent Subscription Notifications -com.arsdigita.forum.delete_sent_subscription_notifications.purpose=Enable deletion of successfully sent notifications to save space in DB -com.arsdigita.forum.delete_sent_subscription_notifications.format=[boolean] -com.arsdigita.forum.delete_sent_subscription_notifications.example=true|false +com.arsdigita.forum.disable_page_caching.title=Disable client & middleware page caching +com.arsdigita.forum.disable_page_caching.purpose=Disable caching, particularly for situations where users share PCs +com.arsdigita.forum.disable_page_caching.format=[boolean] +com.arsdigita.forum.disable_page_caching.example=true|false + +com.arsdigita.forum.maximum_image_size.title=Maximum size of image uploads in bytes +com.arsdigita.forum.maximum_image_size.purpose=Prevent huge images from being uploaded +com.arsdigita.forum.maximum_image_size.format=[integer] +com.arsdigita.forum.maximum_image_size.example=1048576 + +com.arsdigita.forum.maximum_file_size.title=Maximum size of file uploads in bytes +com.arsdigita.forum.maximum_file_size.purpose=prevent huge files from being uploaded +com.arsdigita.forum.maximum_file_size.format=[integer] +com.arsdigita.forum.maximum_file_size.example=1048576 + +com.arsdigita.forum.show_all_forum_thread_alerts.title=Display thread alerts from all forums +com.arsdigita.forum.show_all_forum_thread_alerts.purpose=decide whether to display thread alerts for this forum only or all alerts for user +com.arsdigita.forum.show_all_forum_thread_alerts.format=[boolean] +com.arsdigita.forum.show_all_forum_thread_alerts.example=true|false + +com.arsdigita.forum.show_new_tabs.title=Display permissions and setup tabs +com.arsdigita.forum.show_new_tabs.purpose=to allow forum users to completely hide new functionality +com.arsdigita.forum.show_new_tabs.format=[boolean] +com.arsdigita.forum.show_new_tabs.example=true|false + +com.arsdigita.forum.use_wysiwyg_editor.title=Use HTML Editor, or stick with legacy version +com.arsdigita.forum.use_wysiwyg_editor.purpose=to allow legacy implementations to stick with existing stylesheets +com.arsdigita.forum.use_wysiwyg_editor.format=[boolean] +com.arsdigita.forum.use_wysiwyg_editor.example=true|false + +com.arsdigita.forum.rejection_form_message.title=Instructions to poster added to bottom of email +com.arsdigita.forum.rejection_form_message.purpose=tail of email that may contain site specific information - who to contact etc +com.arsdigita.forum.rejection_form_message.format=[string] +com.arsdigita.forum.rejection_form_message.example=Please do not reply to this email. If you have any comments, please email webmaster@example.com + +com.arsdigita.forum.thread_page_size.title=Number of threads displayed per page +com.arsdigita.forum.thread_page_size.purpose=balance page loading time against number of key preses +com.arsdigita.forum.thread_page_size.format=[integer] +com.arsdigita.forum.thread_page_size.example=10 + +com.arsdigita.forum.allow_quick_finish.title=Allow quick finish on posts +com.arsdigita.forum.allow_quick_finish.purpose=To give users the option of omitting post steps if they have a quick text post +com.arsdigita.forum.allow_quick_finish.format=[boolean] +com.arsdigita.forum.allow_quick_finish.example=true|false + +com.arsdigita.forum.delete_sent_subscription_notifications.title=Delete Sent Subscription Notifications +com.arsdigita.forum.delete_sent_subscription_notifications.purpose=Enable deletion of successfully sent notifications to save space in DB +com.arsdigita.forum.delete_sent_subscription_notifications.format=[boolean] +com.arsdigita.forum.delete_sent_subscription_notifications.example=true|false diff --git a/ccm-ldn-aplaws/bundles/complete/cfg/integration.properties b/ccm-ldn-aplaws/bundles/complete/cfg/integration.properties index 217e0dac7..7fa79b182 100755 --- a/ccm-ldn-aplaws/bundles/complete/cfg/integration.properties +++ b/ccm-ldn-aplaws/bundles/complete/cfg/integration.properties @@ -21,8 +21,8 @@ com.arsdigita.cms.dhtml_editor_config=HTMLArea.Config.CMSStyled,/assets/htmlarea com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker com.arsdigita.cms.contenttypes.newsitem.hide_homepage=true -com.arsdigita.cms.contenttypes.mparticle.template=resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp -com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate=resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-siteproxy-item.jsp +com.arsdigita.cms.contenttypes.mparticle.template=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp +com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-siteproxy-item.jsp com.arsdigita.cms.hide_udct_ui=true com.arsdigita.cms.hide_folder_index_checkbox=true diff --git a/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties b/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties index 6e5566d56..1058886ba 100755 --- a/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties +++ b/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties @@ -21,7 +21,7 @@ com.arsdigita.cms.dhtml_editor_config=HTMLArea.Config.CMSStyled,/assets/htmlarea com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker com.arsdigita.cms.contenttypes.newsitem.hide_homepage=true -com.arsdigita.cms.contenttypes.mparticle.template=resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp +com.arsdigita.cms.contenttypes.mparticle.template=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp com.arsdigita.cms.hide_udct_ui=true com.arsdigita.cms.hide_folder_index_checkbox=true diff --git a/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties b/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties index a0ec0b0ca..298fcaacd 100755 --- a/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties +++ b/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties @@ -21,7 +21,7 @@ com.arsdigita.cms.dhtml_editor_config=HTMLArea.Config.CMSStyled,/assets/htmlarea com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker com.arsdigita.cms.contenttypes.newsitem.hide_homepage=true -com.arsdigita.cms.contenttypes.mparticle.template=resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp +com.arsdigita.cms.contenttypes.mparticle.template=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp com.arsdigita.cms.hide_udct_ui=true com.arsdigita.cms.hide_folder_index_checkbox=true diff --git a/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties b/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties index 4e96b08bc..4283e42bb 100755 --- a/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties +++ b/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties @@ -21,7 +21,7 @@ com.arsdigita.cms.dhtml_editor_config=HTMLArea.Config.CMSStyled,/assets/htmlarea com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker com.arsdigita.cms.contenttypes.newsitem.hide_homepage=true -com.arsdigita.cms.contenttypes.mparticle.template=resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp +com.arsdigita.cms.contenttypes.mparticle.template=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp com.arsdigita.cms.hide_udct_ui=true com.arsdigita.cms.hide_folder_index_checkbox=true diff --git a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java b/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java index d3278dd82..2eeae7281 100755 --- a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java +++ b/ccm-ldn-aplaws/src/com/arsdigita/aplaws/Loader.java @@ -18,14 +18,6 @@ package com.arsdigita.aplaws; -import com.arsdigita.london.navigation.Navigation; -import com.arsdigita.london.navigation.Template; -import com.arsdigita.london.navigation.TemplateMapping; -import com.arsdigita.london.terms.Domain; -import com.arsdigita.london.terms.importer.Parser; -import com.arsdigita.london.portal.PageLayout; -import com.arsdigita.london.portal.Workspace; - import com.arsdigita.categorization.Category; import com.arsdigita.categorization.RootCategoryCollection; import com.arsdigita.cms.ContentSection; @@ -45,7 +37,13 @@ import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.util.parameter.URLParameter; import com.arsdigita.web.Application; -import org.apache.log4j.Logger; +import com.arsdigita.london.navigation.Navigation; +import com.arsdigita.london.navigation.Template; +import com.arsdigita.london.navigation.TemplateMapping; +import com.arsdigita.london.terms.Domain; +import com.arsdigita.london.terms.importer.Parser; +import com.arsdigita.london.portal.PageLayout; +import com.arsdigita.london.portal.Workspace; import java.net.URL; import java.net.MalformedURLException; @@ -54,6 +52,8 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import org.apache.log4j.Logger; + /** * Loader. * diff --git a/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java b/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java index e286619a7..82f0f6f9b 100755 --- a/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java +++ b/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig.java @@ -19,19 +19,16 @@ package com.arsdigita.london.atoz; import com.arsdigita.runtime.AbstractConfig; - -import com.arsdigita.london.util.ui.ApplicationCategoryPicker; - import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.ClassParameter; import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.URLParameter; +import com.arsdigita.util.parameter.ResourceParameter; import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.london.util.ui.ApplicationCategoryPicker; + import java.io.InputStream; import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; import java.util.Set; import java.util.HashSet; @@ -49,15 +46,11 @@ public class AtoZConfig extends AbstractConfig { public AtoZConfig() { m_types = new HashSet(); - try { - m_adapters = new URLParameter - ("com.arsdigita.london.atoz.traversal_adapters", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/resources/atoz-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } + + m_adapters = new ResourceParameter + ("com.arsdigita.london.atoz.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/atoz-adapters.xml"); m_rootCategoryPicker = new ClassParameter( "com.arsdigita.london.atoz.root_category_picker", @@ -84,11 +77,7 @@ public class AtoZConfig extends AbstractConfig { InputStream getTraversalAdapters() { - try { - return ((URL)get(m_adapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + return (InputStream)get(m_adapters); } public Class getRootCategoryPicker() { diff --git a/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties b/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties index 4fcb7bb83..e636c7647 100755 --- a/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties +++ b/ccm-ldn-atoz/src/com/arsdigita/london/atoz/AtoZConfig_parameter.properties @@ -1,15 +1,18 @@ com.arsdigita.london.atoz.traversal_adapters.title=XML renderer rules com.arsdigita.london.atoz.traversal_adapters.purpose=Rules for configuring information in generated XML -com.arsdigita.london.atoz.traversal_adapters.format=[url] -com.arsdigita.london.atoz.traversal_adapters.example=resource:WEB-INF/resources/atoz-adapters.xml +com.arsdigita.london.atoz.traversal_adapters.format=[string] +com.arsdigita.london.atoz.traversal_adapters.example=/WEB-INF/resources/atoz-adapters.xml + com.arsdigita.london.atoz.root_category_picker.title=Root Category Picker com.arsdigita.london.atoz.root_category_picker.purpose=The UI widget for the Root Category Picker com.arsdigita.london.atoz.root_category_picker.format=[class] com.arsdigita.london.atoz.root_category_picker.example=com.arsdigita.london.util.ui.ApplicationCategoryPicker + com.arsdigita.london.atoz.use_subsite_specific_navigation_category.title=Make AtoZ use subsite-specific navigation categories com.arsdigita.london.atoz.use_subsite_specific_navigation_category.purpose=Set this to yes, and the AtoZ will use the subsite-specific navigation categories if you define *any* CategoryProvider com.arsdigita.london.atoz.use_subsite_specific_navigation_category.format=[boolean] com.arsdigita.london.atoz.use_subsite_specific_navigation_category.example=true + com.arsdigita.london.atoz.filterCategoryProviders.title=To filter out category without published items com.arsdigita.london.atoz.filterCategoryProviders.purpose=if TRUE, the AtoZ category providers will only return Categories with published items com.arsdigita.london.atoz.filterCategoryProviders.format=[boolean] diff --git a/ccm-ldn-exporter/src/com/arsdigita/london/exporter/ExporterConfig.java b/ccm-ldn-exporter/src/com/arsdigita/london/exporter/ExporterConfig.java index 565079a39..258a1900e 100755 --- a/ccm-ldn-exporter/src/com/arsdigita/london/exporter/ExporterConfig.java +++ b/ccm-ldn-exporter/src/com/arsdigita/london/exporter/ExporterConfig.java @@ -18,30 +18,21 @@ package com.arsdigita.london.exporter; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; - import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.URLParameter; +import com.arsdigita.util.parameter.ResourceParameter; + +import java.io.InputStream; public class ExporterConfig extends AbstractConfig { private Parameter m_adapters; public ExporterConfig() { - try { - m_adapters = new URLParameter - ("com.arsdigita.london.exporter.traversal_adapters", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/resources/exporter-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } + m_adapters = new ResourceParameter + ("com.arsdigita.london.exporter.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/exporter-adapters.xml"); register(m_adapters); @@ -49,11 +40,11 @@ public class ExporterConfig extends AbstractConfig { } + /** + * + * @return InputStream + */ InputStream getTraversalAdapters() { - try { - return ((URL)get(m_adapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + return (InputStream)get(m_adapters); } } diff --git a/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java b/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java index 902155df4..d4e21bb17 100755 --- a/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java +++ b/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig.java @@ -35,22 +35,20 @@ import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.util.parameter.ClassParameter; -import com.arsdigita.util.parameter.URLParameter; +import com.arsdigita.util.parameter.ResourceParameter; import com.arsdigita.web.Application; -import org.apache.log4j.Logger; - import java.io.InputStream; import java.io.IOException; import java.math.BigDecimal; -import java.net.MalformedURLException; -import java.net.URL; import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.lang.reflect.Constructor; +import org.apache.log4j.Logger; + /** * Configuration record for the navigation app * @author Daniel Berrange @@ -105,9 +103,9 @@ public final class NavigationConfig extends AbstractConfig { ("com.arsdigita.london.navigation.default_template", Parameter.REQUIRED, "/packages/navigation/templates/default.jsp"); // not desirable default value (IMHO) but retains existing behaviour - m_inheritTemplates = new BooleanParameter - ("com.arsdigita.london.navigation.inherit_templates", - Parameter.REQUIRED, new Boolean(true)); + m_inheritTemplates = new BooleanParameter + ("com.arsdigita.london.navigation.inherit_templates", + Parameter.REQUIRED, new Boolean(true)); m_defaultContentSectionURL = new StringParameter ("com.arsdigita.london.navigation.default_content_section_url", Parameter.REQUIRED, "/content/"); @@ -123,15 +121,10 @@ public final class NavigationConfig extends AbstractConfig { m_relatedItemsFactory = new ClassParameter ("com.arsdigita.london.navigation.related_items_factory", Parameter.REQUIRED, RelatedItemsQueryFactoryImpl.class); - try { - m_traversalAdapters = new URLParameter - ("com.arsdigita.london.navigation.traversal_adapters", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/resources/navigation-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } + m_traversalAdapters = new ResourceParameter + ("com.arsdigita.london.navigation.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/navigation-adapters.xml"); m_categoryMenuShowNephews = new BooleanParameter ("com.arsdigita.london.navigation.category_menu_show_nephews", Parameter.OPTIONAL, new Boolean(false)); @@ -149,21 +142,21 @@ public final class NavigationConfig extends AbstractConfig { m_categoryMenuShowGrandChildrenLimit = new IntegerParameter ("com.arsdigita.london.navigation.category_menu_show_grand_children_limit", Parameter.OPTIONAL, new Integer(1)); - // Quasimodo: End - m_dateOrderCategories = new StringArrayParameter - ("com.arsdigita.london.navigation.date_order_categories", - Parameter.OPTIONAL, new String[0]); - m_topLevelDateOrderCategories = new StringArrayParameter - ("com.arsdigita.london.navigation.top_level_date_order_categories", - Parameter.OPTIONAL, new String[0]); - m_defaultMenuCatProvider = new ClassParameter - ("com.arsdigita.london.navigation.default_menu_cat_provider", - Parameter.OPTIONAL, null); + // Quasimodo: End + m_dateOrderCategories = new StringArrayParameter + ("com.arsdigita.london.navigation.date_order_categories", + Parameter.OPTIONAL, new String[0]); + m_topLevelDateOrderCategories = new StringArrayParameter + ("com.arsdigita.london.navigation.top_level_date_order_categories", + Parameter.OPTIONAL, new String[0]); + m_defaultMenuCatProvider = new ClassParameter + ("com.arsdigita.london.navigation.default_menu_cat_provider", + Parameter.OPTIONAL, null); register(m_indexPageCacheLifetime); register(m_generateItemURL); register(m_defaultTemplate); - register(m_inheritTemplates); + register(m_inheritTemplates); register(m_defaultContentSectionURL); register(m_relatedItemsContext); register(m_defaultModelClass); @@ -177,9 +170,9 @@ public final class NavigationConfig extends AbstractConfig { register(m_categoryMenuShowGrandChildrenMin); register(m_categoryMenuShowGrandChildrenLimit); // Quasimodo: End - register(m_dateOrderCategories); - register(m_topLevelDateOrderCategories); - register(m_defaultMenuCatProvider); + register(m_dateOrderCategories); + register(m_topLevelDateOrderCategories); + register(m_defaultMenuCatProvider); loadInfo(); // Quasimodo: Begin @@ -263,11 +256,7 @@ public final class NavigationConfig extends AbstractConfig { } InputStream getTraversalAdapters() { - try { - return ((URL)get(m_traversalAdapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + return (InputStream)get(m_traversalAdapters); } public final boolean getCategoryMenuShowNephews() { diff --git a/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties b/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties index 445fee53b..fe0e78cd0 100755 --- a/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties +++ b/ccm-ldn-navigation/src/com/arsdigita/london/navigation/NavigationConfig_parameter.properties @@ -44,9 +44,9 @@ com.arsdigita.london.navigation.default_nav_model.example=com.arsdigita.london.n com.arsdigita.london.navigation.default_nav_model.format=[class] com.arsdigita.london.navigation.traversal_adapters.title=XML renderer rules -com.arsdigita.london.navigation.traversal_adapters.purpose=Rules for configuring information in generated XML -com.arsdigita.london.navigation.traversal_adapters.format=[url] -com.arsdigita.london.navigation.traversal_adapters.example=resource:WEB-INF/resources/navigation-adapters.xml +com.arsdigita.london.navigation.traversal_adapters.purpose=Name of file with rules for configuring information in generated XML +com.arsdigita.london.navigation.traversal_adapters.format=[string] +com.arsdigita.london.navigation.traversal_adapters.example=/WEB-INF/resources/navigation-adapters.xml com.arsdigita.london.navigation.category_menu_show_nephews.title=Show nephew categories in CategoryMenu com.arsdigita.london.navigation.category_menu_show_nephews.purpose=Whether CategoryMenu should display the categories who are nephews to the current category diff --git a/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java b/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java index 00fef3e37..bf8ac1d6f 100755 --- a/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java +++ b/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig.java @@ -20,17 +20,13 @@ package com.arsdigita.london.portal; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; -import com.arsdigita.util.parameter.URLParameter; +import com.arsdigita.util.parameter.ResourceParameter; -import java.io.IOException; import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; import java.util.Arrays; import java.util.List; @@ -40,7 +36,7 @@ public class WorkspaceConfig extends AbstractConfig { private static final Logger s_log = Logger.getLogger(WorkspaceConfig.class); - private URLParameter m_adapters; + private ResourceParameter m_adapters; private StringParameter m_defaultLayout; @@ -50,22 +46,18 @@ public class WorkspaceConfig extends AbstractConfig { private Parameter m_adminPortletTypes; - private BooleanParameter m_htmlPortletWysiwygEditor; + private BooleanParameter m_htmlPortletWysiwygEditor; private StringParameter m_workspacePartyPrivilege; private BooleanParameter m_checkWorkspaceReadPermissions; public WorkspaceConfig() { - try { - m_adapters = new URLParameter( - "com.arsdigita.london.portal.traversal_adapters", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/resources/portal-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } + + m_adapters = new ResourceParameter( + "com.arsdigita.london.portal.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/portal-adapters.xml"); m_defaultLayout = new StringParameter( "com.arsdigita.london.portal.default_layout", @@ -108,11 +100,7 @@ public class WorkspaceConfig extends AbstractConfig { } InputStream getTraversalAdapters() { - try { - return ((URL) get(m_adapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + return (InputStream) get(m_adapters); } public String getDefaultLayout() { diff --git a/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties b/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties index aec044942..0382d39f3 100755 --- a/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties +++ b/ccm-ldn-portal/src/com/arsdigita/london/portal/WorkspaceConfig_parameter.properties @@ -1,7 +1,7 @@ com.arsdigita.london.portal.traversal_adapters.title=XML renderer rules -com.arsdigita.london.portal.traversal_adapters.purpose=Rules for configuring information in generated XML -com.arsdigita.london.portal.traversal_adapters.format=[url] -com.arsdigita.london.portal.traversal_adapters.example=resource:WEB-INF/resources/portal-adapters.xml +com.arsdigita.london.portal.traversal_adapters.purpose=Name of File with rules for configuring information in generated XML +com.arsdigita.london.portal.traversal_adapters.format=[string] +com.arsdigita.london.portal.traversal_adapters.example=/WEB-INF/resources/portal-adapters.xml com.arsdigita.london.portal.default_layout.title=Default workspace layout com.arsdigita.london.portal.default_layout.purpose=Default column layout for workspace portals diff --git a/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig.java b/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig.java index 070e2584b..e2f1b1461 100755 --- a/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig.java +++ b/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig.java @@ -20,21 +20,21 @@ package com.arsdigita.london.subsite; import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.URLParameter; -import com.arsdigita.util.parameter.StringParameter; import com.arsdigita.util.parameter.ClassParameter; -import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.ResourceParameter; +import com.arsdigita.util.parameter.StringParameter; +// import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.london.util.ui.ApplicationCategoryPicker; import java.io.InputStream; import java.io.IOException; -import java.net.URL; -import java.net.MalformedURLException; - -import org.apache.log4j.Logger; +// import java.net.URL; +// import java.net.MalformedURLException; import java.util.Map; import java.util.HashMap; +import org.apache.log4j.Logger; + public class SubsiteConfig extends AbstractConfig { @@ -42,21 +42,17 @@ public class SubsiteConfig extends AbstractConfig { private Map m_themes = new HashMap(); - private URLParameter m_adapters; + private ResourceParameter m_adapters; private StringParameter m_frontPageApplicationTypeParameter; private StringParameter m_frontPageParentURLParameter; private Parameter m_rootCategoryPicker; public SubsiteConfig() { - try { - m_adapters = new URLParameter - ("com.arsdigita.london.subsite.traversal_adapters", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/resources/subsite-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } + + m_adapters = new ResourceParameter + ("com.arsdigita.london.subsite.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/subsite-adapters.xml"); m_frontPageApplicationTypeParameter = new StringParameter ("com.arsdigita.london.subsite.front_page_application", @@ -81,11 +77,7 @@ public class SubsiteConfig extends AbstractConfig { } InputStream getTraversalAdapters() { - try { - return ((URL)get(m_adapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + return (InputStream) get(m_adapters); } public String getFrontPageApplicationType() { diff --git a/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig_parameter.properties b/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig_parameter.properties index 486c70d05..296b0c8f9 100755 --- a/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig_parameter.properties +++ b/ccm-ldn-subsite/src/com/arsdigita/london/subsite/SubsiteConfig_parameter.properties @@ -1,7 +1,7 @@ com.arsdigita.london.subsite.traversal_adapters.title=XML renderer rules -com.arsdigita.london.subsite.traversal_adapters.purpose=Rules for configuring information in generated XML -com.arsdigita.london.subsite.traversal_adapters.format=[url] -com.arsdigita.london.subsite.traversal_adapters.example=resource:WEB-INF/resources/subsite-adapters.xml +com.arsdigita.london.subsite.traversal_adapters.purpose=Name of file with rules for configuring information in generated XML +com.arsdigita.london.subsite.traversal_adapters.format=[string] +com.arsdigita.london.subsite.traversal_adapters.example=/WEB-INF/resources/subsite-adapters.xml com.arsdigita.london.subsite.front_page_application.title=Front Page Application (Subsite) com.arsdigita.london.subsite.front_page_application.purpose=The Application to use as the front (home) page for a subsite diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig.java index d6ac71e21..b63bc47e8 100755 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig.java +++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig.java @@ -19,16 +19,12 @@ package com.arsdigita.london.terms; import com.arsdigita.runtime.AbstractConfig; - import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.ResourceParameter; import com.arsdigita.util.parameter.StringParameter; -import com.arsdigita.util.parameter.URLParameter; -import com.arsdigita.util.UncheckedWrapperException; import java.io.InputStream; import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; import org.apache.log4j.Logger; @@ -41,15 +37,10 @@ public class TermsConfig extends AbstractConfig { private Parameter m_defaultDomain; public TermsConfig() { - try { - m_adapters = new URLParameter - ("com.arsdigita.london.terms.traversal_adapters", - Parameter.REQUIRED, - new URL(null, - "resource:WEB-INF/resources/terms-adapters.xml")); - } catch (MalformedURLException ex) { - throw new UncheckedWrapperException("Cannot parse URL", ex); - } + m_adapters = new ResourceParameter + ("com.arsdigita.london.terms.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/terms-adapters.xml"); m_defaultDomain = new StringParameter( "com.arsdigita.london.terms.default_domain", @@ -62,11 +53,7 @@ public class TermsConfig extends AbstractConfig { } InputStream getTraversalAdapters() { - try { - return ((URL)get(m_adapters)).openStream(); - } catch (IOException ex) { - throw new UncheckedWrapperException("Cannot read stream", ex); - } + return (InputStream) get(m_adapters); } public String getDefaultDomainKey() { diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig_parameter.properties b/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig_parameter.properties index a16cc5b16..056b23e0d 100755 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig_parameter.properties +++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/TermsConfig_parameter.properties @@ -1,7 +1,7 @@ com.arsdigita.london.terms.traversal_adapters.title=XML renderer rules -com.arsdigita.london.terms.traversal_adapters.purpose=Rules for configuring information in generated XML -com.arsdigita.london.terms.traversal_adapters.format=[url] -com.arsdigita.london.terms.traversal_adapters.example=resource:WEB-INF/resources/terms-adapters.xml +com.arsdigita.london.terms.traversal_adapters.purpose=Name of file containing rules for configuring information in generated XML +com.arsdigita.london.terms.traversal_adapters.format=[string] +com.arsdigita.london.terms.traversal_adapters.example=/WEB-INF/resources/terms-adapters.xml com.arsdigita.london.terms.default_domain.title=Default domain com.arsdigita.london.terms.default_domain.purpose=The default navigation domain diff --git a/ccm-ldn-theme/src/com/arsdigita/london/theme/ui/ThemeForm.java b/ccm-ldn-theme/src/com/arsdigita/london/theme/ui/ThemeForm.java index eb58dfbc3..bed45a89e 100755 --- a/ccm-ldn-theme/src/com/arsdigita/london/theme/ui/ThemeForm.java +++ b/ccm-ldn-theme/src/com/arsdigita/london/theme/ui/ThemeForm.java @@ -30,19 +30,15 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormValidationListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.GridPanel; +import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.parameters.NotEmptyValidationListener; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.Label; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.SessionManager; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.GridPanel; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.IO; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; import com.arsdigita.london.theme.ThemeConstants; import com.arsdigita.london.theme.ThemeApplication; import com.arsdigita.london.theme.util.GlobalizationUtil; @@ -51,6 +47,12 @@ import com.arsdigita.london.subsite.Subsite; import com.arsdigita.london.subsite.Site; import com.arsdigita.toolbox.ui.Cancellable; import com.arsdigita.web.Web; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; + import org.apache.log4j.Logger; diff --git a/ccm-shp-aplaws/bundles/devel/cfg/integration.properties b/ccm-shp-aplaws/bundles/devel/cfg/integration.properties index 24c95f15b..a464ae431 100755 --- a/ccm-shp-aplaws/bundles/devel/cfg/integration.properties +++ b/ccm-shp-aplaws/bundles/devel/cfg/integration.properties @@ -45,9 +45,9 @@ com.arsdigita.cms.use_streamlined_creation=true com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker com.arsdigita.cms.contenttypes.newsitem.hide_homepage=true -com.arsdigita.cms.contenttypes.mparticle.template=resource:WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp +com.arsdigita.cms.contenttypes.mparticle.template=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp ; shp nutzt kein siteproxy -; com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate=resource:///WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-siteproxy-item.jsp +; com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-siteproxy-item.jsp com.arsdigita.cms.contenttypes.event.hide_main_contributor=true com.arsdigita.cms.contenttypes.event.use_html_date_description=false diff --git a/ccm-zes-aplaws/bundles/devel/cfg/integration.properties b/ccm-zes-aplaws/bundles/devel/cfg/integration.properties index 1dab6047e..4c704dba7 100644 --- a/ccm-zes-aplaws/bundles/devel/cfg/integration.properties +++ b/ccm-zes-aplaws/bundles/devel/cfg/integration.properties @@ -58,9 +58,9 @@ com.arsdigita.cms.contenttypes.event.use_html_date_description=false com.arsdigita.cms.contenttypes.newsitem.hide_homepage=true -com.arsdigita.cms.contenttypes.mparticle.template=resource:///WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp +com.arsdigita.cms.contenttypes.mparticle.template=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp -com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate=resource:///WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-siteproxy-item.jsp +com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-siteproxy-item.jsp ; atoz currently not in use diff --git a/environment/project.xml.shp b/environment/project.xml.shp index caad4290d..a12b00b7b 100644 --- a/environment/project.xml.shp +++ b/environment/project.xml.shp @@ -6,10 +6,12 @@ xmlns:ccm="http://ccm.redhat.com/ccm-project" ccmVersion="6.1" name="aplaws" - version="2.9.2" - release="1" + prettyName="APLAWS plus" + version="1-0-5" + release="alpha-1" webxml="web.xml-aplaws" - xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:///usr/share/ccm-devel/xsd/project.xsd"> + webapp="ROOT" + xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd"> diff --git a/tools-ng/common/xsl/build-template.xsl b/tools-ng/common/xsl/build-template.xsl index 83bc44c28..899be2d42 100755 --- a/tools-ng/common/xsl/build-template.xsl +++ b/tools-ng/common/xsl/build-template.xsl @@ -12,13 +12,16 @@ indent="yes" xalan:indent-amount="4"/> + + - + @@ -27,12 +30,14 @@ - + + - + @@ -54,10 +59,12 @@ - - - + + + + + - @@ -155,17 +157,22 @@ + - + + + @@ -188,12 +195,13 @@ - + @@ -204,9 +212,12 @@ - + + + + - + + - + - + @@ -265,6 +277,7 @@ + + + @@ -317,9 +334,9 @@ - - tests - + + tests + @@ -334,7 +351,7 @@ server tests - + @@ -355,7 +372,7 @@ - + @@ -380,10 +397,12 @@ - + + @@ -474,23 +493,26 @@
+ - + - + + - + @@ -504,6 +526,7 @@ + @@ -515,14 +538,19 @@ select="/ccm:project/ccm:application[@name=$fullname]/ccm:dependencies/ccm:requires"/> + description="Compiles the Java code for the '{$name}' application" + depends="init"> + + - + + + @@ -540,7 +568,7 @@ - + @@ -555,8 +583,9 @@ - - + + + - + @@ -645,6 +674,7 @@
+ @@ -655,6 +685,10 @@ + + @@ -665,7 +699,9 @@ + + @@ -676,16 +712,18 @@ value="${{apps.{$name}.name}}-${{apps.{$name}.version}}-pdl.jar ${{apps.{$name}.name}}-${{apps.{$name}.version}}-sql.jar"/> - + - + + + @@ -695,6 +733,7 @@ + + @@ -734,6 +774,7 @@ select="$application/ccm:directories/ccm:directory[@name='pdl'] or not($application/ccm:directories)"/> + @@ -824,7 +865,9 @@ + + @@ -837,6 +880,7 @@ + @@ -847,6 +891,7 @@ + @@ -857,6 +902,7 @@ webXmlFragment="${{build.dir}}/generated_web.xml" outputDir="${{build.dir}}/jsp-java" /> + + + - + + + @@ -935,27 +992,35 @@ + - + + @@ -1067,14 +1132,22 @@ + + @@ -1138,7 +1211,8 @@ - + Builds and deploys all applications, also deploys prebuilt applications and config files @@ -1186,14 +1260,16 @@ - + --> @@ -1300,8 +1376,7 @@ - + Creates a WAR file of the deployed application. @@ -1314,7 +1389,7 @@ - Creating a WAR file from directory ${{deploy.dir}}/webapps/ROOT + Creating a WAR file from directory ${{this.deploy.dir}}/webapps/ROOT REMEMBER: You have to perform the load-bundle step first if you would like to have a valid web.xml file and a basic configuration! @@ -1901,13 +1976,18 @@ - - - - - + + + @@ -1920,10 +2000,12 @@ --> + + -->