Deprecated and unused classes for handling style sheets removed.

git-svn-id: https://svn.libreccm.org/ccm/trunk@683 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2011-01-16 09:25:48 +00:00
parent bc166abc1f
commit c2a22ad67e
29 changed files with 327 additions and 306 deletions

View File

@ -2,8 +2,8 @@
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-core" name="ccm-core"
prettyName="Core" prettyName="Core"
version="6.6.0" version="6.6.1"
release="2" release="1"
shared="true" shared="true"
webapp="ROOT" webapp="ROOT"
buildHooks="build-hooks.xml"> buildHooks="build-hooks.xml">

View File

@ -31,10 +31,11 @@ object type PackageType {
// XXX: Deprecated. // XXX: Deprecated.
String servletPackage = apm_package_types.servlet_package VARCHAR(100); String servletPackage = apm_package_types.servlet_package VARCHAR(100);
Stylesheet[0..n] defaultStyle = join apm_package_types.package_type_id // deprecated
to acs_stylesheet_type_map.package_type_id, // Stylesheet[0..n] defaultStyle = join apm_package_types.package_type_id
join acs_stylesheet_type_map.stylesheet_id // to acs_stylesheet_type_map.package_type_id,
to acs_stylesheets.stylesheet_id; // join acs_stylesheet_type_map.stylesheet_id
// to acs_stylesheets.stylesheet_id;
PackageListener[0..n] listener = PackageListener[0..n] listener =
join apm_package_types.package_type_id join apm_package_types.package_type_id
to apm_package_type_listener_map.package_type_id, to apm_package_type_listener_map.package_type_id,

View File

@ -47,10 +47,10 @@ object type SiteNode extends ACSObject {
PackageInstance[0..1] mountedObject = PackageInstance[0..1] mountedObject =
join site_nodes.object_id to apm_packages.package_id; join site_nodes.object_id to apm_packages.package_id;
Stylesheet[0..n] defaultStyle = join site_nodes.node_id // Stylesheet[0..n] defaultStyle = join site_nodes.node_id
to acs_stylesheet_node_map.node_id, // to acs_stylesheet_node_map.node_id,
join acs_stylesheet_node_map.stylesheet_id // join acs_stylesheet_node_map.stylesheet_id
to acs_stylesheets.stylesheet_id; // to acs_stylesheets.stylesheet_id;
unique (parent, name); unique (parent, name);

View File

@ -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;

View File

@ -130,9 +130,9 @@
@@ default/kernel/index-apm_package_type_listener_map.sql @@ default/kernel/index-apm_package_type_listener_map.sql
@@ default/kernel/view-object_package_map.sql @@ default/kernel/view-object_package_map.sql
@@ default/kernel/index-acs_stylesheets.sql -- @@ default/kernel/index-acs_stylesheets.sql
@@ default/kernel/index-acs_stylesheet_type_map.sql -- @@ default/kernel/index-acs_stylesheet_type_map.sql
@@ default/kernel/index-acs_stylesheet_node_map.sql -- @@ default/kernel/index-acs_stylesheet_node_map.sql
@@ default/kernel/function-package_id_for_object_id.sql @@ default/kernel/function-package_id_for_object_id.sql
@@ default/kernel/constraint-email_addresses.sql @@ default/kernel/constraint-email_addresses.sql

View File

@ -45,8 +45,10 @@ begin;
\i default/kernel/sequence-acs_object_id_seq.sql
\i postgres/kernel/package-hierarchy_denormalization.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/table-group_subgroup_trans_index.sql
\i default/kernel/index-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_subgroup_trans_map.sql
\i default/kernel/view-group_member_trans_map.sql \i default/kernel/view-group_member_trans_map.sql
\i default/kernel/view-party_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-party_email_map.sql
\i default/kernel/index-users.sql \i default/kernel/index-users.sql
\i default/kernel/index-user_authentication.sql \i default/kernel/index-user_authentication.sql

View File

@ -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

View File

@ -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;

View File

@ -82,7 +82,7 @@ public class Initializer extends CompoundInitializer {
("ccm-core.pdl.mf", ("ccm-core.pdl.mf",
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); 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.portal.Initializer());
add(new com.arsdigita.search.Initializer()); add(new com.arsdigita.search.Initializer());
add(new com.arsdigita.search.lucene.Initializer()); add(new com.arsdigita.search.lucene.Initializer());

View File

@ -23,7 +23,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.PackageType;
import com.arsdigita.kernel.PackageInstance; import com.arsdigita.kernel.PackageInstance;
import com.arsdigita.kernel.SiteNode; import com.arsdigita.kernel.SiteNode;
import com.arsdigita.kernel.Stylesheet; // import com.arsdigita.kernel.Stylesheet;
import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.SessionManager;
import com.arsdigita.persistence.TransactionContext; import com.arsdigita.persistence.TransactionContext;
@ -51,14 +51,18 @@ public class Initializer
private static final Logger log = private static final Logger log =
Logger.getLogger(Initializer.class); Logger.getLogger(Initializer.class);
/**
* Constructor
*
* @throws InitializationException
*/
public Initializer() throws InitializationException { public Initializer() throws InitializationException {
} }
/** /**
* Returns the configuration object used by this initializer. * Returns the configuration object used by this initializer.
**/ */
public Configuration getConfiguration() { public Configuration getConfiguration() {
return m_conf; return m_conf;
} }
@ -72,10 +76,7 @@ public class Initializer
* automitically calls the startup() method of any * automitically calls the startup() method of any
* class that implements com.arsdigita.util.initializer.Initializer * class that implements com.arsdigita.util.initializer.Initializer
* present in enterprise.ini * present in enterprise.ini
* */
**/
public void startup() { public void startup() {
log.info("FormBuilder Initializer starting."); log.info("FormBuilder Initializer starting.");
@ -83,6 +84,7 @@ public class Initializer
TransactionContext txn = SessionManager.getSession() TransactionContext txn = SessionManager.getSession()
.getTransactionContext(); .getTransactionContext();
txn.beginTxn(); txn.beginTxn();
checkFormBuilderSetup(); checkFormBuilderSetup();
txn.commitTxn(); txn.commitTxn();
@ -131,20 +133,17 @@ public class Initializer
/** Adding a style sheet /** Adding a style sheet
*/ */
// Stylesheet FormBuilderSheet = Stylesheet.createStylesheet ("/packages/formbuilder/xsl/formbuilder.xsl");
Stylesheet FormBuilderSheet = Stylesheet.createStylesheet ("/packages/formbuilder/xsl/formbuilder.xsl"); // FormBuilderType.addStylesheet(FormBuilderSheet);
FormBuilderType.addStylesheet(FormBuilderSheet);
/** Mapping the package type to a dispatcher /** Mapping the package type to a dispatcher
* class * class
*/ */
FormBuilderType.setDispatcherClass("com.arsdigita.formbuilder.FormBuilderDispatcher"); FormBuilderType.setDispatcherClass("com.arsdigita.formbuilder.FormBuilderDispatcher");
/** Saving changes /** Saving changes
*/ */
FormBuilderType.save(); FormBuilderType.save();
} }
@ -153,7 +152,6 @@ public class Initializer
* Called on shutdown. It's probably not a good idea to depend on this * Called on shutdown. It's probably not a good idea to depend on this
* being called. * being called.
**/ **/
public void shutdown() { public void shutdown() {
} }

View File

@ -36,7 +36,6 @@ import java.math.BigDecimal;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
import org.apache.log4j.Logger; 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.DataObject
* @see com.arsdigita.persistence.metadata.ObjectType * @see com.arsdigita.persistence.metadata.ObjectType
**/ * @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationType} instead.
*/
public PackageType() { public PackageType() {
super(BASE_DATA_OBJECT_TYPE); super(BASE_DATA_OBJECT_TYPE);
} }
@ -91,7 +92,9 @@ public class PackageType extends com.arsdigita.domain.DomainObject {
* @see Party#Party(ObjectType) * @see Party#Party(ObjectType)
* @see com.arsdigita.persistence.DataObject * @see com.arsdigita.persistence.DataObject
* @see com.arsdigita.persistence.metadata.ObjectType * @see com.arsdigita.persistence.metadata.ObjectType
**/ * @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationType} instead.
*/
public PackageType(DataObject dataObject) { public PackageType(DataObject dataObject) {
super(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.domain.ObservableDomainObject#ObservableDomainObject(OID)
* @see com.arsdigita.persistence.DataObject * @see com.arsdigita.persistence.DataObject
* @see com.arsdigita.persistence.OID * @see com.arsdigita.persistence.OID
**/ * @deprecated without direct replacement. Refactor to use
* {@link com.arsdigita.web.ApplicationType} instead.
*/
public PackageType(OID oid) throws DataObjectNotFoundException { public PackageType(OID oid) throws DataObjectNotFoundException {
super(oid); super(oid);
} }
@ -385,10 +390,10 @@ public class PackageType extends com.arsdigita.domain.DomainObject {
* *
* @param sheet a stylesheet used for rendering this package * @param sheet a stylesheet used for rendering this package
*/ */
public void addStylesheet(Stylesheet sheet) { /* public void addStylesheet(Stylesheet sheet) {
sheet.addToAssociation((DataAssociation) get("defaultStyle")); sheet.addToAssociation((DataAssociation) get("defaultStyle"));
} }
*/
/** /**
* Gets all the stylesheets used for rendering this package. * 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}. * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}.
* So thes method is just not used anymore. (pboy) * 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 return StyleAssociation
.getStylesheets(get("defaultStyle"), locale, outputType); .getStylesheets(get("defaultStyle"), locale, outputType);
} }
*/
/** /**
* Gets the first stylesheet (best match) associated with this package. * Gets the first stylesheet (best match) associated with this package.
* @param locale the locale being used for rendering the 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}. * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}.
* So thes method is just not used anymore. (pboy) * 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 return StyleAssociation
.getStylesheet(get("defaultStyle"), locale, outputType); .getStylesheet(get("defaultStyle"), locale, outputType);
} }
*/
/** /**
* Removes a stylesheet from the set of stylesheets used for rendering * Removes a stylesheet from the set of stylesheets used for rendering
* this package. * this package.
* *
* @param sheet the stylesheet to be removed * @param sheet the stylesheet to be removed
*/ */
public void removeStylesheet(Stylesheet sheet) { /* public void removeStylesheet(Stylesheet sheet) {
sheet.removeFromAssociation((DataAssociation)get("defaultStyle")); sheet.removeFromAssociation((DataAssociation)get("defaultStyle"));
} }
*/
/** /**
* Adds a listener to the events for this package. * Adds a listener to the events for this package.
* *

View File

@ -29,7 +29,7 @@ import com.arsdigita.util.HierarchyDenormalization;
import com.arsdigita.web.PathMapCache; import com.arsdigita.web.PathMapCache;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Locale; // import java.util.Locale;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -106,6 +106,7 @@ public class SiteNode extends ACSObject {
super(dataObject); super(dataObject);
} }
@Override
protected void initialize() { protected void initialize() {
super.initialize(); super.initialize();
if (isNew()) { if (isNew()) {
@ -243,6 +244,7 @@ public class SiteNode extends ACSObject {
* *
* @see ACSObject#getDisplayName() * @see ACSObject#getDisplayName()
*/ */
@Override
public String getDisplayName() { public String getDisplayName() {
return getURL(); return getURL();
} }
@ -448,29 +450,30 @@ public class SiteNode extends ACSObject {
return siteNode; return siteNode;
} }
@Override
public String toString() { public String toString() {
return "[url: " + getURL() + "]"; return "[url: " + getURL() + "]";
} }
public void addStylesheet(Stylesheet sheet) { /* public void addStylesheet(Stylesheet sheet) {
sheet.addToAssociation((DataAssociation)get("defaultStyle")); sheet.addToAssociation((DataAssociation)get("defaultStyle"));
} }
*/
// /**
/** // *
* // * @param locale
* @param locale // * @param outputType
* @param outputType // * @return
* @return // * @deprecated without direct replacement. It is designed to work with
* @deprecated without direct replacement. It is designed to work with // * {@link com.arsdigita.templating.LegacyStylesheetResolver} which is
* {@link com.arsdigita.templating.LegacyStylesheetResolver} which is // * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}.
* replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}. // * So thes method is just not used anymore. (pboy)
* 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
return StyleAssociation // .getStylesheets(get("defaultStyle"), locale, outputType);
.getStylesheets(get("defaultStyle"), locale, outputType); // }
}
/** /**
* *
@ -482,15 +485,15 @@ public class SiteNode extends ACSObject {
* replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}. * replaced by {@link com.arsdigita.templating.PatternStylesheetResolver}.
* So this method is just not used anymore. (pboy) * 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 return StyleAssociation
.getStylesheet(get("defaultStyle"), locale, outputType); .getStylesheet(get("defaultStyle"), locale, outputType);
} }
*/
public void removeStylesheet(Stylesheet sheet) { /* public void removeStylesheet(Stylesheet sheet) {
sheet.removeFromAssociation((DataAssociation)get("defaultStyle")); sheet.removeFromAssociation((DataAssociation)get("defaultStyle"));
} }
*/
// the sole purpose of this class is to make site nodes hash the same across // the sole purpose of this class is to make site nodes hash the same across
// multiple server instances. // multiple server instances.
private static class SiteNodeWrapper { private static class SiteNodeWrapper {
@ -502,6 +505,7 @@ public class SiteNode extends ACSObject {
m_node = node; m_node = node;
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj==null) { return false; } if (obj==null) { return false; }
@ -510,10 +514,12 @@ public class SiteNode extends ACSObject {
m_node.getURL().equals(snw.m_node.getURL()); m_node.getURL().equals(snw.m_node.getURL());
} }
@Override
public int hashCode() { public int hashCode() {
return m_node.getID().hashCode() + m_node.getURL().hashCode(); return m_node.getID().hashCode() + m_node.getURL().hashCode();
} }
@Override
public String toString() { public String toString() {
return m_node.toString(); return m_node.toString();
} }

View File

@ -26,7 +26,7 @@ import com.arsdigita.kernel.PackageInstance;
import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.PackageType;
import com.arsdigita.kernel.ResourceType; import com.arsdigita.kernel.ResourceType;
import com.arsdigita.kernel.SiteNode; import com.arsdigita.kernel.SiteNode;
import com.arsdigita.kernel.Stylesheet; // import com.arsdigita.kernel.Stylesheet;
import com.arsdigita.kernel.User; import com.arsdigita.kernel.User;
import com.arsdigita.kernel.UserAuthentication; import com.arsdigita.kernel.UserAuthentication;
import com.arsdigita.kernel.permissions.PermissionService; import com.arsdigita.kernel.permissions.PermissionService;
@ -58,7 +58,7 @@ import com.arsdigita.web.Web;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.Locale; // import java.util.Locale;
import javax.mail.internet.InternetAddress; import javax.mail.internet.InternetAddress;
@ -108,9 +108,6 @@ public class CoreLoader extends PackageLoader {
private StringParameter m_answer = new StringParameter private StringParameter m_answer = new StringParameter
("waf.admin.password.answer", Parameter.REQUIRED, null); ("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 private StringParameter m_dispatcher = new StringParameter
("waf.login.dispatcher", Parameter.OPTIONAL, ("waf.login.dispatcher", Parameter.OPTIONAL,
"com.arsdigita.ui.login.SubsiteDispatcher"); "com.arsdigita.ui.login.SubsiteDispatcher");
@ -127,7 +124,6 @@ public class CoreLoader extends PackageLoader {
register(m_password); register(m_password);
register(m_question); register(m_question);
register(m_answer); register(m_answer);
register(m_stylesheet);
register(m_dispatcher); register(m_dispatcher);
register(m_resource); register(m_resource);
@ -162,10 +158,6 @@ public class CoreLoader extends PackageLoader {
return (String) get(m_answer); return (String) get(m_answer);
} }
private String getStylesheet() {
return (String) get(m_stylesheet);
}
private String getDispatcher() { private String getDispatcher() {
return (String) get(m_dispatcher); return (String) get(m_dispatcher);
} }
@ -297,7 +289,6 @@ public class CoreLoader extends PackageLoader {
} }
private void loadSubsite(SiteNode rootNode) { private void loadSubsite(SiteNode rootNode) {
String stylesheetName = "";
String sDispatcher = ""; String sDispatcher = "";
PackageInstance packageInstance = rootNode.getPackageInstance(); PackageInstance packageInstance = rootNode.getPackageInstance();
@ -317,12 +308,6 @@ public class CoreLoader extends PackageLoader {
("Package Type with key \"" + packageKey + "\" was not found.\n"); ("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. // Set subsite dispatcher class.
subsite.setDispatcherClass(getDispatcher()); subsite.setDispatcherClass(getDispatcher());
} }
@ -335,14 +320,6 @@ public class CoreLoader extends PackageLoader {
"http://arsdigita.com/bebop/"); "http://arsdigita.com/bebop/");
bebop.createInstance("Bebop Service"); 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() { private void loadWebDev() {
@ -360,7 +337,7 @@ public class CoreLoader extends PackageLoader {
packType.setDispatcherClass("com.arsdigita.webdevsupport.Dispatcher"); 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() { private Application loadAdminApp() {
ApplicationType adminType = ApplicationType ApplicationType adminType = ApplicationType
@ -370,10 +347,6 @@ public class CoreLoader extends PackageLoader {
adminType.setDispatcherClass("com.arsdigita.ui.admin.AdminDispatcher"); adminType.setDispatcherClass("com.arsdigita.ui.admin.AdminDispatcher");
adminType.setDescription("CCM user and group administration"); 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, Application admin = Application.createApplication(adminType,
"admin", "admin",
"CCM Admin", "CCM Admin",
@ -389,9 +362,6 @@ public class CoreLoader extends PackageLoader {
SiteMap.BASE_DATA_OBJECT_TYPE); SiteMap.BASE_DATA_OBJECT_TYPE);
sitemapType.setDispatcherClass("com.arsdigita.ui.sitemap.SiteMapDispatcher"); sitemapType.setDispatcherClass("com.arsdigita.ui.sitemap.SiteMapDispatcher");
sitemapType.setDescription("CCM sitemap administration"); sitemapType.setDescription("CCM sitemap administration");
sitemapType.addStylesheet
(Stylesheet.createStylesheet
(XSL_ROOT + "sitemap_en.xsl", Locale.ENGLISH));
Application sitemap = Application.createApplication(sitemapType, Application sitemap = Application.createApplication(sitemapType,
@ -411,10 +381,6 @@ public class CoreLoader extends PackageLoader {
("acs-permissions", "ACS Permissions Package", ("acs-permissions", "ACS Permissions Package",
"ACS Permissions Packages", "http://arsdigita.com/acs-permissions"); "ACS Permissions Packages", "http://arsdigita.com/acs-permissions");
} }
// Add stylesheets
Stylesheet permissionsXsl = Stylesheet.createStylesheet
("/packages/permissions/xsl/permissions.xsl");
permissionsType.addStylesheet(permissionsXsl);
permissionsType.setDispatcherClass permissionsType.setDispatcherClass
("com.arsdigita.ui.permissions.PermissionsDispatcher"); ("com.arsdigita.ui.permissions.PermissionsDispatcher");

View File

@ -38,8 +38,8 @@ import org.apache.log4j.Logger;
* @author pb * @author pb
* @version $Id: $ * @version $Id: $
*/ */
// Not shure if this initializeris realy needed. In a short test - commenting // Not shure if this initializer is realy needed. In a short test - commenting
// the initializer out - made no difference. (pboy-2011-01-09) // the initializer out - it made no difference. (pboy-2011-01-09)
public class Initializer extends CompoundInitializer { public class Initializer extends CompoundInitializer {
/** Creates a s_logging category with name = to the full name of class */ /** 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) { 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?? // Recursive invokation of init, is it really necessary??
// On the other hand: // 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");
} }
} }

View File

@ -63,6 +63,7 @@ public class Initializer extends com.arsdigita.runtime.GenericInitializer {
* *
* @param evt The context init event. * @param evt The context init event.
*/ */
@Override
public void init(ContextInitEvent evt) { public void init(ContextInitEvent evt) {
s_log.debug("UI context initialization started."); s_log.debug("UI context initialization started.");

View File

@ -20,6 +20,7 @@
package com.arsdigita.ui; package com.arsdigita.ui;
import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.parameter.ArrayOfStringArrayParameter;
import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringArrayParameter;
import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.Parameter;
@ -86,11 +87,11 @@ public class UIConfig extends AbstractConfig {
"waf.ui.default_layout", "waf.ui.default_layout",
Parameter.REQUIRED, Parameter.REQUIRED,
new String[] new String[]
{ "top:com.arsdigita.ui.UserBanner", { "top:com.arsdigita.ui.UserBanner"
"bottom:com.arsdigita.ui.SiteBanner", ,"bottom:com.arsdigita.ui.SiteBanner"
"bottom:com.arsdigita.ui.DebugPanel" ,"bottom:com.arsdigita.ui.DebugPanel"
// "left,com.arsdigita.x.y.zl", //,"left:com.arsdigita.x.y.zl",
// "right,com.arsdigita.x.y.zr", //,"right:com.arsdigita.x.y.zr",
} }
); );
@ -126,7 +127,15 @@ public class UIConfig extends AbstractConfig {
* the default layout for SimplePage class. * the default layout for SimplePage class.
*/ */
public List getDefaultLayout() { 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); return Arrays.asList(defaultLayoutArray);
} }

View File

@ -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;
}
}
}
}
}

View File

@ -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();
}
}

View File

@ -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;
}
}

View File

@ -34,6 +34,13 @@ public class SpecificClassParameter extends ClassParameter {
private Class m_requiredClass; private Class m_requiredClass;
/**
* Constructor
* @param name
* @param multiplicity
* @param defaultObj
* @param requiredClass
*/
public SpecificClassParameter(final String name, public SpecificClassParameter(final String name,
final int multiplicity, final int multiplicity,
final Object defaultObj, final Object defaultObj,
@ -42,7 +49,13 @@ public class SpecificClassParameter extends ClassParameter {
m_requiredClass = requiredClass; 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 @Override
protected Object unmarshal(String value, ErrorList errors) { protected Object unmarshal(String value, ErrorList errors) {
Class theClass = (Class) super.unmarshal(value,errors); Class theClass = (Class) super.unmarshal(value,errors);

View File

@ -52,6 +52,12 @@ public class StringArrayParameter extends StringParameter {
} }
/**
* Converts a String[] object into a literal representation.
*
* @param value
* @return
*/
@Override @Override
protected String marshal(final Object value) { protected String marshal(final Object value) {
if (value == null) { if (value == null) {
@ -61,6 +67,12 @@ public class StringArrayParameter extends StringParameter {
} }
} }
/**
*
* @param literal
* @param errors
* @return
*/
@Override @Override
protected Object unmarshal(final String literal, protected Object unmarshal(final String literal,
final ErrorList errors) { final ErrorList errors) {

View File

@ -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 &lt;jross@redhat.com&gt;
* @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;
}
}
}
}

View File

@ -188,8 +188,9 @@ public class Application extends Resource {
private static Application make(final ApplicationType type, private static Application make(final ApplicationType type,
final String fragment, final String fragment,
final String title, final String title,
final Application parent, final Application parent,
final boolean createContainerGroup) { final boolean createContainerGroup) {
final Application app = (Application) Resource.createResource(type, title, parent); final Application app = (Application) Resource.createResource(type, title, parent);
if (createContainerGroup) { if (createContainerGroup) {
app.createGroup(); app.createGroup();
@ -635,10 +636,6 @@ public class Application extends Resource {
return URL.SERVLET_DIR + "/legacy-adapter"; return URL.SERVLET_DIR + "/legacy-adapter";
} }
public String getStylesheetPath() {
return URL.XSL_DIR + "/core-platform.xsl";
}
protected void beforeSave() { protected void beforeSave() {
if (isPropertyModified(PRIMARY_URL) || isNew()) { if (isPropertyModified(PRIMARY_URL) || isNew()) {
BaseDispatcher.scheduleRefresh(); BaseDispatcher.scheduleRefresh();

View File

@ -19,7 +19,6 @@
package com.arsdigita.web; package com.arsdigita.web;
import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.PackageType;
import com.arsdigita.kernel.Stylesheet;
import com.arsdigita.domain.DomainObjectInstantiator; import com.arsdigita.domain.DomainObjectInstantiator;
import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;
@ -75,7 +74,6 @@ public class ApplicationSetup {
protected PackageType m_packageType = null; protected PackageType m_packageType = null;
protected boolean m_isWorkspaceApplication = true; protected boolean m_isWorkspaceApplication = true;
protected boolean m_isSingleton = false; protected boolean m_isSingleton = false;
protected String m_stylesheet = null;
protected String m_dispatcherClass = null; protected String m_dispatcherClass = null;
public ApplicationSetup(Category category) { public ApplicationSetup(Category category) {
@ -166,13 +164,6 @@ public class ApplicationSetup {
m_isSingleton = isSingleton; 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. * Sets the dispatcher to use for appliactions of this type.
*/ */
@ -266,8 +257,6 @@ public class ApplicationSetup {
(m_typeName); (m_typeName);
applicationType.setPackageType(packageType); applicationType.setPackageType(packageType);
applicationType.addStylesheet
(Stylesheet.createStylesheet(m_stylesheet));
applicationType.setDispatcherClass(m_dispatcherClass); applicationType.setDispatcherClass(m_dispatcherClass);
packageType.save(); packageType.save();
@ -293,7 +282,6 @@ public class ApplicationSetup {
notice(" IsSingleton: " + m_isSingleton); notice(" IsSingleton: " + m_isSingleton);
notice(" Key: " + m_key); notice(" Key: " + m_key);
notice(" PackageType: " + m_packageType); notice(" PackageType: " + m_packageType);
notice(" Stylesheet: " + m_stylesheet);
notice(" DispatcherClass: " + m_dispatcherClass); notice(" DispatcherClass: " + m_dispatcherClass);
if (m_key == null && m_packageType == null) { if (m_key == null && m_packageType == null) {
@ -309,11 +297,6 @@ public class ApplicationSetup {
applicationType = ApplicationType.createApplicationType applicationType = ApplicationType.createApplicationType
(m_key, m_title, m_typeName); (m_key, m_title, m_typeName);
if (m_stylesheet != null) {
applicationType.addStylesheet
(Stylesheet.createStylesheet(m_stylesheet));
}
if (m_dispatcherClass != null) { if (m_dispatcherClass != null) {
applicationType.setDispatcherClass(m_dispatcherClass); applicationType.setDispatcherClass(m_dispatcherClass);
} }

View File

@ -20,7 +20,6 @@ package com.arsdigita.web;
import com.arsdigita.kernel.Group; import com.arsdigita.kernel.Group;
import com.arsdigita.kernel.ResourceType; import com.arsdigita.kernel.ResourceType;
import com.arsdigita.kernel.Stylesheet;
import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.PackageType;
import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.DataObject;
@ -125,6 +124,7 @@ public class ApplicationType extends ResourceType {
// circumstances) // circumstances)
// Method overwrtes a (overwritable) method provided by the super class to // Method overwrtes a (overwritable) method provided by the super class to
// process a created (empty) data object. // process a created (empty) data object.
@Override
public void initialize() { public void initialize() {
super.initialize(); super.initialize();
s_log.debug("initialising application type "); s_log.debug("initialising application type ");
@ -371,25 +371,6 @@ public class ApplicationType extends ResourceType {
setAssociation("packageType", packageType); 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. * @deprecated with no replacement.
* @throws UnsupportedOperationException when this method is * @throws UnsupportedOperationException when this method is
@ -636,9 +617,6 @@ public class ApplicationType extends ResourceType {
return id; return id;
} }
public String getStylesheet() {
return "/__ccm__/xsl/default.xsl";
}
// //
// Other // Other