diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemLoader.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemLoader.java index 97dcf8dd0..4f939fb20 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemLoader.java +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/formbuilder/FormItemLoader.java @@ -31,22 +31,21 @@ import java.util.List; * @author Rafael H. Schloming <rhs@mit.edu> * @version $Revision: #9 $ $Date: 2004/08/17 $ * @version $Id: FormItemLoader.java 755 2005-09-02 13:42:47Z sskracic $ - **/ - + * + */ public class FormItemLoader extends AbstractContentTypeLoader { - /** List of content sections to install Forms. An empty list installs - * Forms into the default (first) content section only. + /** + * List of content sections to install Forms. An empty list installs Forms into the default (first) content section + * only. */ - private final Parameter m_contentSections = new StringParameter - ("com.arsdigita.cms.formbuilder.FormItem.sections", - Parameter.REQUIRED, ""); + private final Parameter m_contentSections = new StringParameter("com.arsdigita.cms.formbuilder.FormItem.sections", + Parameter.REQUIRED, ""); { register(m_contentSections); loadInfo(); } - private static final String[] TYPES = { "/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormItem.xml" }; @@ -56,17 +55,18 @@ public class FormItemLoader extends AbstractContentTypeLoader { } /** - * Overwrites parents class's method to predefine into which content sections - * Forms should get installed. - * An empty list (the default parents's implementation) gets Forms installed - * into the default section only. - * - * @return Array of content sections Forms should be installed into + * Overwrites parents class's method to predefine into which content sections Forms should get installed. An empty + * list (the default parents's implementation) gets Forms installed into the default section only. + * + * @return Array of content sections Forms should be installed into */ @Override public List getContentSections() { - List result = new ArrayList(1); - result.add(get(m_contentSections)); + final List result = new ArrayList(); + if (!(get(m_contentSections).toString() != null) + && !get(m_contentSections).toString().isEmpty()) { + result.add(get(m_contentSections)); + } return result; } } diff --git a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemLoader.java b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemLoader.java index f20abf3a3..24538d7f9 100755 --- a/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemLoader.java +++ b/ccm-cms-types-formsectionitem/src/com/arsdigita/cms/formbuilder/FormSectionItemLoader.java @@ -31,20 +31,20 @@ import java.util.List; * @author Rafael H. Schloming <rhs@mit.edu> * @version $Revision: #9 $ $Date: 2004/08/17 $ * @version $Id: FormSectionItemLoader.java 755 2005-09-02 13:42:47Z sskracic $ - **/ - + * + */ public class FormSectionItemLoader extends AbstractContentTypeLoader { private static final String[] TYPES = { "/WEB-INF/content-types/com/arsdigita/cms/formbuilder/FormSectionItem.xml" }; - - /** List of content sections to install FormSection. An empty list installs - * Forms into the default (first) content section only. + /** + * List of content sections to install FormSection. An empty list installs Forms into the default (first) content + * section only. */ - private final Parameter m_contentSections = new StringParameter - ("com.arsdigita.cms.formbuilder.FormSectionItem.sections", - Parameter.REQUIRED, ""); + private final Parameter m_contentSections = new StringParameter( + "com.arsdigita.cms.formbuilder.FormSectionItem.sections", + Parameter.REQUIRED, ""); { register(m_contentSections); @@ -56,17 +56,18 @@ public class FormSectionItemLoader extends AbstractContentTypeLoader { } /** - * Overwrites parents class's method to predefine into which content sections - * Forms should get installed. - * An empty list (the default parents's implementation) gets Forms installed - * into the default section only. - * - * @return Array of content sections Forms should be installed into + * Overwrites parents class's method to predefine into which content sections Forms should get installed. An empty + * list (the default parents's implementation) gets Forms installed into the default section only. + * + * @return Array of content sections Forms should be installed into */ @Override public List getContentSections() { - List result = new ArrayList(1); - result.add(get(m_contentSections)); + List result = new ArrayList(); + if (!(get(m_contentSections).toString() != null) + && !get(m_contentSections).toString().isEmpty()) { + result.add(get(m_contentSections)); + } return result; } } diff --git a/ccm-cms-types-xmlfeed/src/com/arsdigita/cms/contenttypes/xmlfeed/Loader.java b/ccm-cms-types-xmlfeed/src/com/arsdigita/cms/contenttypes/xmlfeed/Loader.java index cd2281e31..2ff6764a8 100755 --- a/ccm-cms-types-xmlfeed/src/com/arsdigita/cms/contenttypes/xmlfeed/Loader.java +++ b/ccm-cms-types-xmlfeed/src/com/arsdigita/cms/contenttypes/xmlfeed/Loader.java @@ -15,7 +15,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - package com.arsdigita.cms.contenttypes.xmlfeed; import com.arsdigita.util.parameter.Parameter; @@ -32,15 +31,13 @@ import java.util.List; */ public class Loader extends AbstractContentTypeLoader { - private final Parameter m_contentSections = new StringParameter - ("com.arsdigita.cms.contenttypes.xmlfeed.sections", - Parameter.REQUIRED, "forms"); + private final Parameter m_contentSections = new StringParameter("com.arsdigita.cms.contenttypes.xmlfeed.sections", + Parameter.REQUIRED, "forms"); public Loader() { register(m_contentSections); loadInfo(); } - private static final String[] TYPES = { "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/XMLFeed.xml" }; @@ -48,11 +45,13 @@ public class Loader extends AbstractContentTypeLoader { public String[] getTypes() { return TYPES; } - + public List getContentSections() { - List result = new ArrayList(1); - result.add(get(m_contentSections)); + List result = new ArrayList(); + if (!(get(m_contentSections).toString() != null) + && !get(m_contentSections).toString().isEmpty()) { + result.add(get(m_contentSections)); + } return result; } - }