diff --git a/ccm-core/application.xml b/ccm-core/application.xml index 11d4d6fe5..c41a22eeb 100755 --- a/ccm-core/application.xml +++ b/ccm-core/application.xml @@ -2,8 +2,8 @@ diff --git a/ccm-core/pdl/com/arsdigita/kernel/Package.pdl b/ccm-core/pdl/com/arsdigita/kernel/Package.pdl index 286e117ed..6abb62bd7 100755 --- a/ccm-core/pdl/com/arsdigita/kernel/Package.pdl +++ b/ccm-core/pdl/com/arsdigita/kernel/Package.pdl @@ -31,10 +31,11 @@ object type PackageType { // XXX: Deprecated. String servletPackage = apm_package_types.servlet_package VARCHAR(100); - Stylesheet[0..n] defaultStyle = join apm_package_types.package_type_id - to acs_stylesheet_type_map.package_type_id, - join acs_stylesheet_type_map.stylesheet_id - to acs_stylesheets.stylesheet_id; +// deprecated +// Stylesheet[0..n] defaultStyle = join apm_package_types.package_type_id +// to acs_stylesheet_type_map.package_type_id, +// join acs_stylesheet_type_map.stylesheet_id +// to acs_stylesheets.stylesheet_id; PackageListener[0..n] listener = join apm_package_types.package_type_id to apm_package_type_listener_map.package_type_id, diff --git a/ccm-core/pdl/com/arsdigita/kernel/SiteNode.pdl b/ccm-core/pdl/com/arsdigita/kernel/SiteNode.pdl index 1bdbc2c6d..689071f5b 100755 --- a/ccm-core/pdl/com/arsdigita/kernel/SiteNode.pdl +++ b/ccm-core/pdl/com/arsdigita/kernel/SiteNode.pdl @@ -47,10 +47,10 @@ object type SiteNode extends ACSObject { PackageInstance[0..1] mountedObject = join site_nodes.object_id to apm_packages.package_id; - Stylesheet[0..n] defaultStyle = join site_nodes.node_id - to acs_stylesheet_node_map.node_id, - join acs_stylesheet_node_map.stylesheet_id - to acs_stylesheets.stylesheet_id; +// Stylesheet[0..n] defaultStyle = join site_nodes.node_id +// to acs_stylesheet_node_map.node_id, +// join acs_stylesheet_node_map.stylesheet_id +// to acs_stylesheets.stylesheet_id; unique (parent, name); diff --git a/ccm-core/pdl/com/arsdigita/kernel/Stylesheet.pdl b/ccm-core/pdl/com/arsdigita/kernel/Stylesheet.pdl.nolongerInUse similarity index 100% rename from ccm-core/pdl/com/arsdigita/kernel/Stylesheet.pdl rename to ccm-core/pdl/com/arsdigita/kernel/Stylesheet.pdl.nolongerInUse diff --git a/ccm-core/sql/ccm-core/default/upgrade/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql b/ccm-core/sql/ccm-core/default/upgrade/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql new file mode 100644 index 000000000..cf1b35079 --- /dev/null +++ b/ccm-core/sql/ccm-core/default/upgrade/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql @@ -0,0 +1,20 @@ +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: drop_tables_acs_stylesheets.sql pboy $ + +drop table acs_stylesheet_node_map; +drop table acs_stylesheet_type_map; +drop table acs_stylesheets; \ No newline at end of file diff --git a/ccm-core/sql/ccm-core/oracle-se-create.sql b/ccm-core/sql/ccm-core/oracle-se-create.sql index 92adaecb7..1655a848e 100755 --- a/ccm-core/sql/ccm-core/oracle-se-create.sql +++ b/ccm-core/sql/ccm-core/oracle-se-create.sql @@ -130,9 +130,9 @@ @@ default/kernel/index-apm_package_type_listener_map.sql @@ default/kernel/view-object_package_map.sql -@@ default/kernel/index-acs_stylesheets.sql -@@ default/kernel/index-acs_stylesheet_type_map.sql -@@ default/kernel/index-acs_stylesheet_node_map.sql +-- @@ default/kernel/index-acs_stylesheets.sql +-- @@ default/kernel/index-acs_stylesheet_type_map.sql +-- @@ default/kernel/index-acs_stylesheet_node_map.sql @@ default/kernel/function-package_id_for_object_id.sql @@ default/kernel/constraint-email_addresses.sql diff --git a/ccm-core/sql/ccm-core/postgres-create.sql b/ccm-core/sql/ccm-core/postgres-create.sql index 32dd81457..287dbc0cd 100755 --- a/ccm-core/sql/ccm-core/postgres-create.sql +++ b/ccm-core/sql/ccm-core/postgres-create.sql @@ -45,8 +45,10 @@ begin; -\i default/kernel/sequence-acs_object_id_seq.sql \i postgres/kernel/package-hierarchy_denormalization.sql +\i default/kernel/sequence-acs_object_id_seq.sql + + \i default/kernel/table-group_subgroup_trans_index.sql \i default/kernel/index-group_subgroup_trans_index.sql @@ -57,6 +59,7 @@ begin; \i default/kernel/view-group_subgroup_trans_map.sql \i default/kernel/view-group_member_trans_map.sql \i default/kernel/view-party_member_trans_map.sql + \i default/kernel/index-party_email_map.sql \i default/kernel/index-users.sql \i default/kernel/index-user_authentication.sql diff --git a/ccm-core/sql/ccm-core/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-core/sql/ccm-core/upgrade/oracle-se-6.6.0-6.6.1.sql new file mode 100644 index 000000000..8368c7ad5 --- /dev/null +++ b/ccm-core/sql/ccm-core/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -0,0 +1,22 @@ +-- +-- Copyright (C) 2008 Peter Boy All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: oracle-se-6.6.0-6.6.1.sql 293 2011-01-07 15:10:39Z pboy $ + +PROMPT Red Hat Enterprise CORE 6.6.0 -> 6.6.1 Upgrade Script (Oracle) + +@@ ../default/upgrade/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql diff --git a/ccm-core/sql/ccm-core/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-core/sql/ccm-core/upgrade/postgres-6.6.0-6.6.1.sql new file mode 100644 index 000000000..ba5a977fe --- /dev/null +++ b/ccm-core/sql/ccm-core/upgrade/postgres-6.6.0-6.6.1.sql @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2008 Peter Boy All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $DateTime: 2010/11/10 23:15:09 $ + +\echo Red Hat Enterprise CORE 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.6.0-6.6.1/drop_tables_acs_stylesheets.sql + +commit; diff --git a/ccm-core/src/com/arsdigita/core/Initializer.java b/ccm-core/src/com/arsdigita/core/Initializer.java index 961b56da3..b12d2182a 100755 --- a/ccm-core/src/com/arsdigita/core/Initializer.java +++ b/ccm-core/src/com/arsdigita/core/Initializer.java @@ -82,7 +82,7 @@ public class Initializer extends CompoundInitializer { ("ccm-core.pdl.mf", new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); -// add(new com.arsdigita.ui.Initializer()); + // add(new com.arsdigita.ui.Initializer()); add(new com.arsdigita.portal.Initializer()); add(new com.arsdigita.search.Initializer()); add(new com.arsdigita.search.lucene.Initializer()); diff --git a/ccm-core/src/com/arsdigita/formbuilder/Initializer.java b/ccm-core/src/com/arsdigita/formbuilder/Initializer.java index c61dec854..8bf0be18e 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/Initializer.java +++ b/ccm-core/src/com/arsdigita/formbuilder/Initializer.java @@ -23,7 +23,7 @@ import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.PackageInstance; import com.arsdigita.kernel.SiteNode; -import com.arsdigita.kernel.Stylesheet; +// import com.arsdigita.kernel.Stylesheet; import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.TransactionContext; @@ -51,14 +51,18 @@ public class Initializer private static final Logger log = Logger.getLogger(Initializer.class); + /** + * Constructor + * + * @throws InitializationException + */ public Initializer() throws InitializationException { } /** * Returns the configuration object used by this initializer. - **/ - + */ public Configuration getConfiguration() { return m_conf; } @@ -72,10 +76,7 @@ public class Initializer * automitically calls the startup() method of any * class that implements com.arsdigita.util.initializer.Initializer * present in enterprise.ini - * - **/ - - + */ public void startup() { log.info("FormBuilder Initializer starting."); @@ -83,6 +84,7 @@ public class Initializer TransactionContext txn = SessionManager.getSession() .getTransactionContext(); txn.beginTxn(); + checkFormBuilderSetup(); txn.commitTxn(); @@ -131,20 +133,17 @@ public class Initializer /** Adding a style sheet */ - - Stylesheet FormBuilderSheet = Stylesheet.createStylesheet ("/packages/formbuilder/xsl/formbuilder.xsl"); - FormBuilderType.addStylesheet(FormBuilderSheet); +// Stylesheet FormBuilderSheet = Stylesheet.createStylesheet ("/packages/formbuilder/xsl/formbuilder.xsl"); +// FormBuilderType.addStylesheet(FormBuilderSheet); /** Mapping the package type to a dispatcher * class */ - FormBuilderType.setDispatcherClass("com.arsdigita.formbuilder.FormBuilderDispatcher"); /** Saving changes */ - FormBuilderType.save(); } @@ -153,7 +152,6 @@ public class Initializer * Called on shutdown. It's probably not a good idea to depend on this * being called. **/ - public void shutdown() { } diff --git a/ccm-core/src/com/arsdigita/kernel/PackageType.java b/ccm-core/src/com/arsdigita/kernel/PackageType.java index 8f03775ac..76d8df6b6 100755 --- a/ccm-core/src/com/arsdigita/kernel/PackageType.java +++ b/ccm-core/src/com/arsdigita/kernel/PackageType.java @@ -36,7 +36,6 @@ import java.math.BigDecimal; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; -import java.util.Locale; import org.apache.log4j.Logger; @@ -74,7 +73,9 @@ public class PackageType extends com.arsdigita.domain.DomainObject { * * @see com.arsdigita.persistence.DataObject * @see com.arsdigita.persistence.metadata.ObjectType - **/ + * @deprecated without direct replacement. Refactor to use + * {@link com.arsdigita.web.ApplicationType} instead. + */ public PackageType() { super(BASE_DATA_OBJECT_TYPE); } @@ -91,7 +92,9 @@ public class PackageType extends com.arsdigita.domain.DomainObject { * @see Party#Party(ObjectType) * @see com.arsdigita.persistence.DataObject * @see com.arsdigita.persistence.metadata.ObjectType - **/ + * @deprecated without direct replacement. Refactor to use + * {@link com.arsdigita.web.ApplicationType} instead. + */ public PackageType(DataObject dataObject) { super(dataObject); } @@ -107,7 +110,9 @@ public class PackageType extends com.arsdigita.domain.DomainObject { * @see com.arsdigita.domain.ObservableDomainObject#ObservableDomainObject(OID) * @see com.arsdigita.persistence.DataObject * @see com.arsdigita.persistence.OID - **/ + * @deprecated without direct replacement. Refactor to use + * {@link com.arsdigita.web.ApplicationType} instead. + */ public PackageType(OID oid) throws DataObjectNotFoundException { super(oid); } @@ -385,10 +390,10 @@ public class PackageType extends com.arsdigita.domain.DomainObject { * * @param sheet a stylesheet used for rendering this package */ - public void addStylesheet(Stylesheet sheet) { +/* public void addStylesheet(Stylesheet sheet) { sheet.addToAssociation((DataAssociation) get("defaultStyle")); } - +*/ /** * Gets all the stylesheets used for rendering this package. * @@ -404,11 +409,11 @@ public class PackageType extends com.arsdigita.domain.DomainObject { * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}. * So thes method is just not used anymore. (pboy) */ - public Stylesheet[] getStylesheets(Locale locale, String outputType) { +/* public Stylesheet[] getStylesheets(Locale locale, String outputType) { return StyleAssociation .getStylesheets(get("defaultStyle"), locale, outputType); } - +*/ /** * Gets the first stylesheet (best match) associated with this package. * @param locale the locale being used for rendering the package @@ -422,21 +427,21 @@ public class PackageType extends com.arsdigita.domain.DomainObject { * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}. * So thes method is just not used anymore. (pboy) */ - public Stylesheet getStylesheet(Locale locale, String outputType) { +/* public Stylesheet getStylesheet(Locale locale, String outputType) { return StyleAssociation .getStylesheet(get("defaultStyle"), locale, outputType); } - +*/ /** * Removes a stylesheet from the set of stylesheets used for rendering * this package. * * @param sheet the stylesheet to be removed */ - public void removeStylesheet(Stylesheet sheet) { +/* public void removeStylesheet(Stylesheet sheet) { sheet.removeFromAssociation((DataAssociation)get("defaultStyle")); } - +*/ /** * Adds a listener to the events for this package. * diff --git a/ccm-core/src/com/arsdigita/kernel/SiteNode.java b/ccm-core/src/com/arsdigita/kernel/SiteNode.java index e71cfe121..96a7a2f97 100755 --- a/ccm-core/src/com/arsdigita/kernel/SiteNode.java +++ b/ccm-core/src/com/arsdigita/kernel/SiteNode.java @@ -29,7 +29,7 @@ import com.arsdigita.util.HierarchyDenormalization; import com.arsdigita.web.PathMapCache; import java.math.BigDecimal; -import java.util.Locale; +// import java.util.Locale; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; @@ -106,6 +106,7 @@ public class SiteNode extends ACSObject { super(dataObject); } + @Override protected void initialize() { super.initialize(); if (isNew()) { @@ -243,6 +244,7 @@ public class SiteNode extends ACSObject { * * @see ACSObject#getDisplayName() */ + @Override public String getDisplayName() { return getURL(); } @@ -448,30 +450,31 @@ public class SiteNode extends ACSObject { return siteNode; } + @Override public String toString() { return "[url: " + getURL() + "]"; } - public void addStylesheet(Stylesheet sheet) { +/* public void addStylesheet(Stylesheet sheet) { sheet.addToAssociation((DataAssociation)get("defaultStyle")); } +*/ - - /** - * - * @param locale - * @param outputType - * @return - * @deprecated without direct replacement. It is designed to work with - * {@link com.arsdigita.templating.LegacyStylesheetResolver} which is - * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}. - * So thes method is just not used anymore. (pboy) - */ - public Stylesheet[] getStylesheets(Locale locale, String outputType) { - return StyleAssociation - .getStylesheets(get("defaultStyle"), locale, outputType); - } - +// /** +// * +// * @param locale +// * @param outputType +// * @return +// * @deprecated without direct replacement. It is designed to work with +// * {@link com.arsdigita.templating.LegacyStylesheetResolver} which is +// * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}. +// * So thes method is just not used anymore. (pboy) +// */ +// public Stylesheet[] getStylesheets(Locale locale, String outputType) { +// return StyleAssociation +// .getStylesheets(get("defaultStyle"), locale, outputType); +// } + /** * * @param locale @@ -482,15 +485,15 @@ public class SiteNode extends ACSObject { * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}. * So this method is just not used anymore. (pboy) */ - public Stylesheet getStylesheet(Locale locale, String outputType) { +/* public Stylesheet getStylesheet(Locale locale, String outputType) { return StyleAssociation .getStylesheet(get("defaultStyle"), locale, outputType); } - - public void removeStylesheet(Stylesheet sheet) { +*/ +/* public void removeStylesheet(Stylesheet sheet) { sheet.removeFromAssociation((DataAssociation)get("defaultStyle")); } - +*/ // the sole purpose of this class is to make site nodes hash the same across // multiple server instances. private static class SiteNodeWrapper { @@ -502,6 +505,7 @@ public class SiteNode extends ACSObject { m_node = node; } + @Override public boolean equals(Object obj) { if (obj==null) { return false; } @@ -510,10 +514,12 @@ public class SiteNode extends ACSObject { m_node.getURL().equals(snw.m_node.getURL()); } + @Override public int hashCode() { return m_node.getID().hashCode() + m_node.getURL().hashCode(); } + @Override public String toString() { return m_node.toString(); } diff --git a/ccm-core/src/com/arsdigita/kernel/StyleAssociation.java b/ccm-core/src/com/arsdigita/kernel/StyleAssociation.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/kernel/StyleAssociation.java rename to ccm-core/src/com/arsdigita/kernel/StyleAssociation.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/kernel/Stylesheet.java b/ccm-core/src/com/arsdigita/kernel/Stylesheet.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/kernel/Stylesheet.java rename to ccm-core/src/com/arsdigita/kernel/Stylesheet.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/loader/CoreLoader.java b/ccm-core/src/com/arsdigita/loader/CoreLoader.java index 5579089e9..eda11d20d 100755 --- a/ccm-core/src/com/arsdigita/loader/CoreLoader.java +++ b/ccm-core/src/com/arsdigita/loader/CoreLoader.java @@ -26,7 +26,7 @@ import com.arsdigita.kernel.PackageInstance; import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.ResourceType; import com.arsdigita.kernel.SiteNode; -import com.arsdigita.kernel.Stylesheet; +// import com.arsdigita.kernel.Stylesheet; import com.arsdigita.kernel.User; import com.arsdigita.kernel.UserAuthentication; import com.arsdigita.kernel.permissions.PermissionService; @@ -58,7 +58,7 @@ import com.arsdigita.web.Web; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.util.Locale; +// import java.util.Locale; import javax.mail.internet.InternetAddress; @@ -108,9 +108,6 @@ public class CoreLoader extends PackageLoader { private StringParameter m_answer = new StringParameter ("waf.admin.password.answer", Parameter.REQUIRED, null); - private StringParameter m_stylesheet = new StringParameter - ("waf.login.stylesheet", Parameter.OPTIONAL, "login_en.xsl"); - private StringParameter m_dispatcher = new StringParameter ("waf.login.dispatcher", Parameter.OPTIONAL, "com.arsdigita.ui.login.SubsiteDispatcher"); @@ -127,7 +124,6 @@ public class CoreLoader extends PackageLoader { register(m_password); register(m_question); register(m_answer); - register(m_stylesheet); register(m_dispatcher); register(m_resource); @@ -162,10 +158,6 @@ public class CoreLoader extends PackageLoader { return (String) get(m_answer); } - private String getStylesheet() { - return (String) get(m_stylesheet); - } - private String getDispatcher() { return (String) get(m_dispatcher); } @@ -297,7 +289,6 @@ public class CoreLoader extends PackageLoader { } private void loadSubsite(SiteNode rootNode) { - String stylesheetName = ""; String sDispatcher = ""; PackageInstance packageInstance = rootNode.getPackageInstance(); @@ -317,12 +308,6 @@ public class CoreLoader extends PackageLoader { ("Package Type with key \"" + packageKey + "\" was not found.\n"); } - // Create default stylesheet. - stylesheetName = "/packages/login/xsl/" + getStylesheet(); - - s_log.info("Adding stylesheet: " + stylesheetName); - subsite.addStylesheet(Stylesheet.createStylesheet(stylesheetName)); - // Set subsite dispatcher class. subsite.setDispatcherClass(getDispatcher()); } @@ -335,14 +320,6 @@ public class CoreLoader extends PackageLoader { "http://arsdigita.com/bebop/"); bebop.createInstance("Bebop Service"); - // Create and associate stylesheets. - // SF: Is there a better way to do this other than hardcoding - // these strings ? - String name = "/packages/bebop/xsl/bebop.xsl"; - Stylesheet partSheet = Stylesheet.createStylesheet(name); - - s_log.info("Adding stylesheet: " + name); - bebop.addStylesheet(partSheet); } private void loadWebDev() { @@ -360,7 +337,7 @@ public class CoreLoader extends PackageLoader { packType.setDispatcherClass("com.arsdigita.webdevsupport.Dispatcher"); } - private static final String XSL_ROOT = "/packages/acs-admin/xsl/"; +// private static final String XSL_ROOT = "/packages/acs-admin/xsl/"; private Application loadAdminApp() { ApplicationType adminType = ApplicationType @@ -370,10 +347,6 @@ public class CoreLoader extends PackageLoader { adminType.setDispatcherClass("com.arsdigita.ui.admin.AdminDispatcher"); adminType.setDescription("CCM user and group administration"); - Stylesheet adminXsl = Stylesheet.createStylesheet - (XSL_ROOT + "admin_en.xsl", Locale.ENGLISH); - adminType.addStylesheet(adminXsl); - Application admin = Application.createApplication(adminType, "admin", "CCM Admin", @@ -389,9 +362,6 @@ public class CoreLoader extends PackageLoader { SiteMap.BASE_DATA_OBJECT_TYPE); sitemapType.setDispatcherClass("com.arsdigita.ui.sitemap.SiteMapDispatcher"); sitemapType.setDescription("CCM sitemap administration"); - sitemapType.addStylesheet - (Stylesheet.createStylesheet - (XSL_ROOT + "sitemap_en.xsl", Locale.ENGLISH)); Application sitemap = Application.createApplication(sitemapType, @@ -411,10 +381,6 @@ public class CoreLoader extends PackageLoader { ("acs-permissions", "ACS Permissions Package", "ACS Permissions Packages", "http://arsdigita.com/acs-permissions"); } - // Add stylesheets - Stylesheet permissionsXsl = Stylesheet.createStylesheet - ("/packages/permissions/xsl/permissions.xsl"); - permissionsType.addStylesheet(permissionsXsl); permissionsType.setDispatcherClass ("com.arsdigita.ui.permissions.PermissionsDispatcher"); diff --git a/ccm-core/src/com/arsdigita/portal/Initializer.java b/ccm-core/src/com/arsdigita/portal/Initializer.java index 1aab2ac4a..47584c5d5 100755 --- a/ccm-core/src/com/arsdigita/portal/Initializer.java +++ b/ccm-core/src/com/arsdigita/portal/Initializer.java @@ -38,8 +38,8 @@ import org.apache.log4j.Logger; * @author pb * @version $Id: $ */ -// Not shure if this initializeris realy needed. In a short test - commenting -// the initializer out - made no difference. (pboy-2011-01-09) +// Not shure if this initializer is realy needed. In a short test - commenting +// the initializer out - it made no difference. (pboy-2011-01-09) public class Initializer extends CompoundInitializer { /** Creates a s_logging category with name = to the full name of class */ @@ -60,7 +60,7 @@ public class Initializer extends CompoundInitializer { * */ public void init(DomainInitEvent e) { - s_log.debug("publishToFile.Initializer.init(DomainInitEvent) invoked"); + s_log.debug("portal.Initializer.init(DomainInitEvent) invoked"); // Recursive invokation of init, is it really necessary?? // On the other hand: @@ -87,6 +87,6 @@ public class Initializer extends CompoundInitializer { } }); - s_log.debug("publishToFile.Initializer.init(DomainInitEvent) completed"); + s_log.debug("portal.Initializer.init(DomainInitEvent) completed"); } } diff --git a/ccm-core/src/com/arsdigita/templating/LegacyStylesheetResolver.java b/ccm-core/src/com/arsdigita/templating/LegacyStylesheetResolver.java.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/templating/LegacyStylesheetResolver.java rename to ccm-core/src/com/arsdigita/templating/LegacyStylesheetResolver.java.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/ui/Initializer.java b/ccm-core/src/com/arsdigita/ui/Initializer.java index 786033ece..ac0f27f38 100755 --- a/ccm-core/src/com/arsdigita/ui/Initializer.java +++ b/ccm-core/src/com/arsdigita/ui/Initializer.java @@ -63,6 +63,7 @@ public class Initializer extends com.arsdigita.runtime.GenericInitializer { * * @param evt The context init event. */ + @Override public void init(ContextInitEvent evt) { s_log.debug("UI context initialization started."); diff --git a/ccm-core/src/com/arsdigita/ui/UIConfig.java b/ccm-core/src/com/arsdigita/ui/UIConfig.java index 4f2b5cbd2..2c9a6fcf5 100644 --- a/ccm-core/src/com/arsdigita/ui/UIConfig.java +++ b/ccm-core/src/com/arsdigita/ui/UIConfig.java @@ -20,6 +20,7 @@ package com.arsdigita.ui; import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.ArrayOfStringArrayParameter; import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.Parameter; @@ -86,11 +87,11 @@ public class UIConfig extends AbstractConfig { "waf.ui.default_layout", Parameter.REQUIRED, new String[] - { "top:com.arsdigita.ui.UserBanner", - "bottom:com.arsdigita.ui.SiteBanner", - "bottom:com.arsdigita.ui.DebugPanel" - // "left,com.arsdigita.x.y.zl", - // "right,com.arsdigita.x.y.zr", + { "top:com.arsdigita.ui.UserBanner" + ,"bottom:com.arsdigita.ui.SiteBanner" + ,"bottom:com.arsdigita.ui.DebugPanel" + //,"left:com.arsdigita.x.y.zl", + //,"right:com.arsdigita.x.y.zr", } ); @@ -126,7 +127,15 @@ public class UIConfig extends AbstractConfig { * the default layout for SimplePage class. */ public List getDefaultLayout() { - String[] defaultLayoutArray = (String[]) get(m_defaultLayout); +// String[][] defaultLayoutArray = (String[]) get(m_defaultLayout); + String[][] defaultLayoutArray = + new String[][] + {{ "top","com.arsdigita.ui.UserBanner"} + ,{"bottom","com.arsdigita.ui.SiteBanner"} + ,{"bottom","com.arsdigita.ui.DebugPanel"} + //,{"left","com.arsdigita.x.y.zl"}, + //,{"right","com.arsdigita.x.y.zr"}, + }; return Arrays.asList(defaultLayoutArray); } diff --git a/ccm-core/src/com/arsdigita/util/parameter/ArrayOfStringArrayParameter.java b/ccm-core/src/com/arsdigita/util/parameter/ArrayOfStringArrayParameter.java new file mode 100644 index 000000000..5abf00756 --- /dev/null +++ b/ccm-core/src/com/arsdigita/util/parameter/ArrayOfStringArrayParameter.java @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package com.arsdigita.util.parameter; + +import com.arsdigita.util.StringUtils; + +/** + * + * @author pb + * @version $Id: $ + */ +public class ArrayOfStringArrayParameter extends StringParameter { + + /** + * Represents a 2-dimensional array of Strings. + * Methods convert between a literal representation and the object back and + * forth. + * + * Literal representation: + * 1. dimension: list of comma separated strings + * 2. dimension: list of colon separated strings + * + * Example: + * lit="exp00:exp01:exp02,exp10:exp11:exp12,exp20:exp21:exp22" + * converts to + * strArr = {{exp00,exp01,exp02},{exp10,exp11,exp12},{exp20,exp21,exp22}} + * @see com.arsdigita.util.parameter.StringArrayParameter unidimensional Par + * + * @param name literal representation of String[][] + * @param multiplicity + * @param defaalt + */ + public ArrayOfStringArrayParameter( final String name, + final int multiplicity, + final Object defaalt) { + super(name, multiplicity, defaalt); + + } + + /** + * Converts a String[][] Object into a literal representation. + * + * @param value + * @return + */ + @Override + protected String marshal(final Object value) { + if (value == null) { + return null; + } else { + return StringUtils.join((String[])value, ','); + } + } + + /** + * + * @param literal + * @param errors + * @return + */ + @Override + protected Object unmarshal(final String literal, + final ErrorList errors) { + + String[][] stringArrayArray = new String[0][0]; + + // Convert the first level of comma serapated literals into an array + String[] firstLevel = StringUtils.split(literal, ','); + + for (int i = 0; i < firstLevel.length; i++) { + + // Convert the firstLevel Element of colon separated literals into + // an array + String[] secondLevel = StringUtils.split(firstLevel[i], ':'); + + if (i == 0) { + // reinitialize with correct number of elements. + // @pre: rectangular 2-dim array, i.e. all elements of second + // dim of same number of elements + stringArrayArray = new String[firstLevel.length] + [secondLevel.length]; + } + + for (int j = 0; j < secondLevel.length; j++) { + final String elem = secondLevel[j]; + + stringArrayArray[i][j] = (String) super.unmarshal(elem, errors); + + if (!errors.isEmpty()) { + break; + } + } + + } + return stringArrayArray; + } + + @Override + protected void doValidate(final Object value, + final ErrorList errors) { + if (value != null) { + final String[] strings = (String[]) value; + + for (int i = 0; i < strings.length; i++) { + super.doValidate(strings[i], errors); + + if (!errors.isEmpty()) { + break; + } + } + } + } + +} diff --git a/ccm-core/src/com/arsdigita/util/parameter/ParameterRecord.java.nolongerInUse b/ccm-core/src/com/arsdigita/util/parameter/ParameterRecord.java.nolongerInUse deleted file mode 100755 index 732f9ac90..000000000 --- a/ccm-core/src/com/arsdigita/util/parameter/ParameterRecord.java.nolongerInUse +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.util.parameter; - -import org.apache.log4j.Logger; - -/** - * @deprecated Use {@link com.arsdigita.runtime.AbstractConfig} - * instead. - */ -public abstract class ParameterRecord extends AbstractParameterContext { - public final static String versionId = - "$Id: ParameterRecord.java 287 2005-02-22 00:29:02Z sskracic $" + - "$Author: sskracic $" + - "$DateTime: 2004/08/16 18:10:38 $"; - - private static final Logger s_log = Logger.getLogger - (ParameterRecord.class); - - protected ParameterRecord(final String name) { - super(); - } -} diff --git a/ccm-core/src/com/arsdigita/util/parameter/ParameterValue.java.nolongerInUse b/ccm-core/src/com/arsdigita/util/parameter/ParameterValue.java.nolongerInUse deleted file mode 100755 index b1baff717..000000000 --- a/ccm-core/src/com/arsdigita/util/parameter/ParameterValue.java.nolongerInUse +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.util.parameter; - - - -/** - * @deprecated The parameter APIs no longer need this class. - */ -public final class ParameterValue { - public final static String versionId = - "$Id: ParameterValue.java 287 2005-02-22 00:29:02Z sskracic $" + - "$Author: sskracic $" + - "$DateTime: 2004/08/16 18:10:38 $"; - - private final ErrorList m_errors; - private String m_string; - private Object m_object; - - public ParameterValue() { - m_errors = new ErrorList(); - } - - public final ErrorList getErrors() { - return m_errors; - } - - public final String getString() { - return m_string; - } - - public final void setString(final String string) { - m_string = string; - } - - public final Object getObject() { - return m_object; - } - - public final void setObject(final Object value) { - m_object = value; - } -} diff --git a/ccm-core/src/com/arsdigita/util/parameter/SpecificClassParameter.java b/ccm-core/src/com/arsdigita/util/parameter/SpecificClassParameter.java index d20c62346..841016959 100644 --- a/ccm-core/src/com/arsdigita/util/parameter/SpecificClassParameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/SpecificClassParameter.java @@ -34,6 +34,13 @@ public class SpecificClassParameter extends ClassParameter { private Class m_requiredClass; + /** + * Constructor + * @param name + * @param multiplicity + * @param defaultObj + * @param requiredClass + */ public SpecificClassParameter(final String name, final int multiplicity, final Object defaultObj, @@ -42,7 +49,13 @@ public class SpecificClassParameter extends ClassParameter { m_requiredClass = requiredClass; } - // value != null + /** + * Unmarshals a string representation of the parameter. + * + * @param value string representation of class, must be value != null + * @param errors + * @return + */ @Override protected Object unmarshal(String value, ErrorList errors) { Class theClass = (Class) super.unmarshal(value,errors); diff --git a/ccm-core/src/com/arsdigita/util/parameter/StringArrayParameter.java b/ccm-core/src/com/arsdigita/util/parameter/StringArrayParameter.java index af04032c4..48b521697 100755 --- a/ccm-core/src/com/arsdigita/util/parameter/StringArrayParameter.java +++ b/ccm-core/src/com/arsdigita/util/parameter/StringArrayParameter.java @@ -52,6 +52,12 @@ public class StringArrayParameter extends StringParameter { } + /** + * Converts a String[] object into a literal representation. + * + * @param value + * @return + */ @Override protected String marshal(final Object value) { if (value == null) { @@ -61,6 +67,12 @@ public class StringArrayParameter extends StringParameter { } } + /** + * + * @param literal + * @param errors + * @return + */ @Override protected Object unmarshal(final String literal, final ErrorList errors) { diff --git a/ccm-core/src/com/arsdigita/util/parameter/SymbolicNameParameter.java.nolongerInUse b/ccm-core/src/com/arsdigita/util/parameter/SymbolicNameParameter.java.nolongerInUse deleted file mode 100755 index 227bb944c..000000000 --- a/ccm-core/src/com/arsdigita/util/parameter/SymbolicNameParameter.java.nolongerInUse +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.util.parameter; - -/** - * @deprecated This class will be supplanted by other classes in other - * locations in the near future. - * - * @author Justin Ross <jross@redhat.com> - * @version $Id: SymbolicNameParameter.java 287 2005-02-22 00:29:02Z sskracic $ - */ -public class SymbolicNameParameter extends StringParameter { - public final static String versionId = - "$Id: SymbolicNameParameter.java 287 2005-02-22 00:29:02Z sskracic $" + - "$Author: sskracic $" + - "$DateTime: 2004/08/16 18:10:38 $"; - - public SymbolicNameParameter(final String name) { - super(name); - } - - protected void doValidate(final Object value, final ErrorList errors) { - super.doValidate(value, errors); - - final String string = (String) value; - - for (int i = 0; i < string.length(); i++) { - if (!Character.isJavaIdentifierPart(string.charAt(i))) { - final ParameterError error = new ParameterError - (this, "The value may contain letters, digits, " + - "and underscores only"); - break; - } - } - } -} diff --git a/ccm-core/src/com/arsdigita/web/Application.java b/ccm-core/src/com/arsdigita/web/Application.java index 12721f10e..4d96b9815 100755 --- a/ccm-core/src/com/arsdigita/web/Application.java +++ b/ccm-core/src/com/arsdigita/web/Application.java @@ -188,8 +188,9 @@ public class Application extends Resource { private static Application make(final ApplicationType type, final String fragment, final String title, - final Application parent, - final boolean createContainerGroup) { + final Application parent, + final boolean createContainerGroup) { + final Application app = (Application) Resource.createResource(type, title, parent); if (createContainerGroup) { app.createGroup(); @@ -635,10 +636,6 @@ public class Application extends Resource { return URL.SERVLET_DIR + "/legacy-adapter"; } - public String getStylesheetPath() { - return URL.XSL_DIR + "/core-platform.xsl"; - } - protected void beforeSave() { if (isPropertyModified(PRIMARY_URL) || isNew()) { BaseDispatcher.scheduleRefresh(); diff --git a/ccm-core/src/com/arsdigita/web/ApplicationSetup.java b/ccm-core/src/com/arsdigita/web/ApplicationSetup.java index 9d12b37a3..66f2f26ce 100755 --- a/ccm-core/src/com/arsdigita/web/ApplicationSetup.java +++ b/ccm-core/src/com/arsdigita/web/ApplicationSetup.java @@ -19,7 +19,6 @@ package com.arsdigita.web; import com.arsdigita.kernel.PackageType; -import com.arsdigita.kernel.Stylesheet; import com.arsdigita.domain.DomainObjectInstantiator; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DataObjectNotFoundException; @@ -75,7 +74,6 @@ public class ApplicationSetup { protected PackageType m_packageType = null; protected boolean m_isWorkspaceApplication = true; protected boolean m_isSingleton = false; - protected String m_stylesheet = null; protected String m_dispatcherClass = null; public ApplicationSetup(Category category) { @@ -166,13 +164,6 @@ public class ApplicationSetup { m_isSingleton = isSingleton; } - /** - * Sets the stylesheet to use for applications of this type. - */ - public void setStylesheet(String stylesheet) { - m_stylesheet = stylesheet; - } - /** * Sets the dispatcher to use for appliactions of this type. */ @@ -266,8 +257,6 @@ public class ApplicationSetup { (m_typeName); applicationType.setPackageType(packageType); - applicationType.addStylesheet - (Stylesheet.createStylesheet(m_stylesheet)); applicationType.setDispatcherClass(m_dispatcherClass); packageType.save(); @@ -293,7 +282,6 @@ public class ApplicationSetup { notice(" IsSingleton: " + m_isSingleton); notice(" Key: " + m_key); notice(" PackageType: " + m_packageType); - notice(" Stylesheet: " + m_stylesheet); notice(" DispatcherClass: " + m_dispatcherClass); if (m_key == null && m_packageType == null) { @@ -309,11 +297,6 @@ public class ApplicationSetup { applicationType = ApplicationType.createApplicationType (m_key, m_title, m_typeName); - if (m_stylesheet != null) { - applicationType.addStylesheet - (Stylesheet.createStylesheet(m_stylesheet)); - } - if (m_dispatcherClass != null) { applicationType.setDispatcherClass(m_dispatcherClass); } diff --git a/ccm-core/src/com/arsdigita/web/ApplicationType.java b/ccm-core/src/com/arsdigita/web/ApplicationType.java index d5197c5de..2b461ca8d 100755 --- a/ccm-core/src/com/arsdigita/web/ApplicationType.java +++ b/ccm-core/src/com/arsdigita/web/ApplicationType.java @@ -20,7 +20,6 @@ package com.arsdigita.web; import com.arsdigita.kernel.Group; import com.arsdigita.kernel.ResourceType; -import com.arsdigita.kernel.Stylesheet; import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.persistence.DataObject; @@ -125,6 +124,7 @@ public class ApplicationType extends ResourceType { // circumstances) // Method overwrtes a (overwritable) method provided by the super class to // process a created (empty) data object. + @Override public void initialize() { super.initialize(); s_log.debug("initialising application type "); @@ -371,25 +371,6 @@ public class ApplicationType extends ResourceType { setAssociation("packageType", packageType); } - /** - * @deprecated with no replacement. - * @throws UnsupportedOperationException when this method is - * called for an application type without a corresponding package - * type. - */ - public void addStylesheet(Stylesheet stylesheet) { - if (m_legacyFree == true) { - throw new UnsupportedOperationException - ("This method is only supported for legacy application types"); - } - - if (m_packageType == null) { - m_packageType = getPackageType(); - } - - m_packageType.addStylesheet(stylesheet); - } - /** * @deprecated with no replacement. * @throws UnsupportedOperationException when this method is @@ -636,9 +617,6 @@ public class ApplicationType extends ResourceType { return id; } - public String getStylesheet() { - return "/__ccm__/xsl/default.xsl"; - } // // Other