diff --git a/ccm-core/pdl/com/arsdigita/web/WebApp.pdl b/ccm-core/pdl/com/arsdigita/web/WebApp.pdl
index 66e006a39..f55a94243 100755
--- a/ccm-core/pdl/com/arsdigita/web/WebApp.pdl
+++ b/ccm-core/pdl/com/arsdigita/web/WebApp.pdl
@@ -24,8 +24,12 @@ model com.arsdigita.web;
// @author Justin Ross (justin@arsdigita.com)
// @version $Id: WebApp.pdl 287 2005-02-22 00:29:02Z sskracic $
+// Class WebApp seems to be quit unfinisched work and is commented out.
+// So we need no table for it.
+// We leave igt hefre vofr further reference.
+// pboy April 2011
object type WebApp {
- String[1..1] name = webapps.name VARCHAR(200);
+// String[1..1] name = webapps.name VARCHAR(200);
- object key (name);
+// object key (name);
}
diff --git a/ccm-core/src/com/arsdigita/core/Initializer.java b/ccm-core/src/com/arsdigita/core/Initializer.java
index 5b7a85608..75eb1d7a9 100755
--- a/ccm-core/src/com/arsdigita/core/Initializer.java
+++ b/ccm-core/src/com/arsdigita/core/Initializer.java
@@ -44,7 +44,7 @@ import com.arsdigita.ui.sitemap.SiteMap;
import com.arsdigita.util.URLRewriter;
import com.arsdigita.xml.FactoriesSetup;
import com.arsdigita.web.Host;
-import com.arsdigita.web.WebApp;
+// import com.arsdigita.web.WebApp;
import com.arsdigita.web.ApplicationType;
import com.arsdigita.workflow.simple.TaskComment;
import com.arsdigita.search.converter.Converter;
@@ -94,8 +94,6 @@ public class Initializer extends CompoundInitializer {
add(new com.arsdigita.search.intermedia.Initializer());
add(new com.arsdigita.notification.Initializer());
- // add(new LegacyInitializer("com/arsdigita/core/enterprise.init"));
- // add(new OptionalLegacyInitializer("enterprise.init"));
}
/**
@@ -126,6 +124,7 @@ public class Initializer extends CompoundInitializer {
}
});
+/* Status Experimental - not used anywhere in code base.
e.getFactory().registerInstantiator
(WebApp.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() {
@@ -133,7 +132,7 @@ public class Initializer extends CompoundInitializer {
return new WebApp(data);
}
});
-
+*/
e.getFactory().registerInstantiator
(TaskComment.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() {
@@ -145,6 +144,7 @@ public class Initializer extends CompoundInitializer {
e.getFactory().registerInstantiator
(Admin.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() {
+ @Override
public DomainObject doNewInstance(final DataObject data) {
return new Admin(data);
}
@@ -153,6 +153,7 @@ public class Initializer extends CompoundInitializer {
e.getFactory().registerInstantiator
(SiteMap.BASE_DATA_OBJECT_TYPE,
new ACSObjectInstantiator() {
+ @Override
public DomainObject doNewInstance(final DataObject data) {
return new SiteMap(data);
}
@@ -192,6 +193,7 @@ public class Initializer extends CompoundInitializer {
public DomainObject doNewInstance(DataObject dataObject) {
return new MimeType(dataObject);
}
+ @Override
public DomainObjectInstantiator
resolveInstantiator(DataObject obj) {
return this;
diff --git a/ccm-core/src/com/arsdigita/kernel/Resource.java b/ccm-core/src/com/arsdigita/kernel/Resource.java
index f9672dffe..a5814ae07 100755
--- a/ccm-core/src/com/arsdigita/kernel/Resource.java
+++ b/ccm-core/src/com/arsdigita/kernel/Resource.java
@@ -111,6 +111,7 @@ public class Resource extends ACSObject {
return resource;
}
+ @Override
protected void beforeSave() {
if (isNew() || isPropertyModified("parentResource")) {
m_parentModified = true;
@@ -123,6 +124,7 @@ public class Resource extends ACSObject {
}
}
+ @Override
protected void afterSave() {
super.afterSave();
diff --git a/ccm-core/src/com/arsdigita/templating/ApplicationOIDPatternGenerator.java b/ccm-core/src/com/arsdigita/templating/ApplicationOIDPatternGenerator.java
index e0b84edac..7b1e026d5 100755
--- a/ccm-core/src/com/arsdigita/templating/ApplicationOIDPatternGenerator.java
+++ b/ccm-core/src/com/arsdigita/templating/ApplicationOIDPatternGenerator.java
@@ -33,7 +33,9 @@ public class ApplicationOIDPatternGenerator implements PatternGenerator {
public String[] generateValues(String key,
HttpServletRequest req) {
- Application application = Web.getContext().getApplication();
+
+ final Application application = Web.getContext().getApplication();
+
if (application != null) {
String[] oid = new String[1];
// FR: better URLEncode this
diff --git a/ccm-core/src/com/arsdigita/templating/ApplicationPatternGenerator.java b/ccm-core/src/com/arsdigita/templating/ApplicationPatternGenerator.java
index 56cfcea7a..34da4bddd 100755
--- a/ccm-core/src/com/arsdigita/templating/ApplicationPatternGenerator.java
+++ b/ccm-core/src/com/arsdigita/templating/ApplicationPatternGenerator.java
@@ -28,6 +28,8 @@ import com.arsdigita.web.Application;
import javax.servlet.http.HttpServletRequest;
+import org.apache.log4j.Logger;
+
/**
@@ -35,16 +37,34 @@ import javax.servlet.http.HttpServletRequest;
* key, eg content-center, content-section.
*/
public class ApplicationPatternGenerator implements PatternGenerator {
+
+ /** Private logger instance for debugging purpose */
+ private static final Logger s_log = Logger.getLogger(PatternGenerator.class);
+
+ /**
+ * Implementation iof the Interface class.
+ *
+ * @param key
+ * @param req
+ * @return
+ */
public String[] generateValues(String key,
HttpServletRequest req) {
+
final Application app = Web.getContext().getApplication();
if (app != null) {
return new String[] {
- app.getPackageType().getKey()
+ app.getApplicationType().getName()
};
}
+ // SiteNodeRequestContext is deprecated and replaced by web.WebContext
+ // used in the code above (Web.getContext().
+ // This code should never be executed.
+ s_log.error("Application not found in WebApplication context!");
+
+
SiteNodeRequestContext ctx = (SiteNodeRequestContext)
DispatcherHelper.getRequestContext(req);
diff --git a/ccm-core/src/com/arsdigita/templating/LocalePatternGenerator.java b/ccm-core/src/com/arsdigita/templating/LocalePatternGenerator.java
index 9435db117..b6adb10d5 100755
--- a/ccm-core/src/com/arsdigita/templating/LocalePatternGenerator.java
+++ b/ccm-core/src/com/arsdigita/templating/LocalePatternGenerator.java
@@ -22,8 +22,8 @@ import com.arsdigita.kernel.Kernel;
import javax.servlet.http.HttpServletRequest;
/**
- * Generates a pattern for based on the request negotiated
- * locale in com.arsdigita.kernel.KernelContext
+ * Generates a pattern based on the request negotiated locale
+ * in com.arsdigita.kernel.KernelContext
*/
public class LocalePatternGenerator implements PatternGenerator {
public String[] generateValues(String key,
diff --git a/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java b/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java
index 930c6e8ed..e7e13dccb 100755
--- a/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java
+++ b/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java
@@ -115,9 +115,12 @@ import org.apache.log4j.Logger;
* @author Richard W.M. Jones
*/
public class PatternStylesheetResolver implements StylesheetResolver {
+
+ /** Logger instance for debugging. */
private static final Logger s_log = Logger.getLogger
(PatternStylesheetResolver.class);
+ /** List of registered pattern generators which are queried in turn. */
private static final HashMap s_generators = new HashMap();
/**
diff --git a/ccm-core/src/com/arsdigita/templating/StylesheetResolver.java b/ccm-core/src/com/arsdigita/templating/StylesheetResolver.java
index 5a079add5..7821264a8 100755
--- a/ccm-core/src/com/arsdigita/templating/StylesheetResolver.java
+++ b/ccm-core/src/com/arsdigita/templating/StylesheetResolver.java
@@ -22,15 +22,12 @@ import java.net.URL;
import javax.servlet.http.HttpServletRequest;
/**
- * The various PresentationManager classes resolve
- * requests into stylesheets using classes derived from this
- * interface.
+ * The various PresentationManager classes resolve requests
+ * into stylesheets using classes derived from this interface.
+ *
+ * @version $Id: StylesheetResolver.java 287 2005-02-22 00:29:02Z sskracic $
*/
public interface StylesheetResolver {
- public static final String versionId =
- "$Id: StylesheetResolver.java 287 2005-02-22 00:29:02Z sskracic $" +
- "$Author: sskracic $" +
- "$DateTime: 2004/08/16 18:10:38 $";
/**
* Resolves a template for the request.
diff --git a/ccm-core/src/com/arsdigita/templating/URLPatternGenerator.java b/ccm-core/src/com/arsdigita/templating/URLPatternGenerator.java
index 9f116bab8..bfde13290 100755
--- a/ccm-core/src/com/arsdigita/templating/URLPatternGenerator.java
+++ b/ccm-core/src/com/arsdigita/templating/URLPatternGenerator.java
@@ -33,8 +33,8 @@ import org.apache.log4j.Logger;
/**
- * Generates a set of pattern values based on the URL path
- * info for the current request. Slashes in the request are
+ * Generates a set of pattern values based on the URL path info
+ * for the current request. Slashes in the request are
* translated into hyphens; the file extension is stripped;
* the any 'index' is removed, except for the top level.
*
@@ -140,7 +140,7 @@ public class URLPatternGenerator implements PatternGenerator {
return url.substring(base.length()-1);
}
- // XXX fix me, why vcan't we get this from Web.getConfig.getRequestURL
+ // XXX fix me, why can't we get this from Web.getConfig.getRequestURL
private String getBasePath() {
SiteNodeRequestContext ctx = (SiteNodeRequestContext)
DispatcherHelper.getRequestContext(Web.getRequest());
diff --git a/ccm-core/src/com/arsdigita/web/Application.java b/ccm-core/src/com/arsdigita/web/Application.java
index 625ae9f74..bcb04ee27 100755
--- a/ccm-core/src/com/arsdigita/web/Application.java
+++ b/ccm-core/src/com/arsdigita/web/Application.java
@@ -74,7 +74,9 @@ import org.apache.log4j.Logger;
*/
public class Application extends Resource {
+ /** Logger instance for debugging */
private static final Logger s_log = Logger.getLogger(Application.class);
+
public static final String PRIMARY_URL = "primaryURL";
private static final String SLASH = "/";
@@ -215,7 +217,7 @@ public class Application extends Resource {
Assert.isTrue(!fragment.equals(""),
"The URL fragment must not be the empty string");
}
-
+ s_log.debug("Application type legacy free: " + type.m_legacyFree );
if (type.m_legacyFree) {
return Application.make(type,fragment,title,parent,createContainerGroup);
} else {
@@ -250,14 +252,29 @@ public class Application extends Resource {
"slashes; I got '" + fragment + "'");
}
+ /* Problem with "slash or not slash"
+ * String fragment (=url) is expected without any slash, just the name.
+ * Given the original code below the fragment appears in database as
+ * "/[fragment]" but all of the other code expects "/[fragment]/" and
+ * all other applications created as legacy compatible have a trailing
+ * slash!
+ * So I experimentally changed the code to have a trailing slash.
+ * Because no other code uses legacy free applications I suppose the
+ * original code here is less tested.
+ * pboy April 2011 see method setPath() as well!
+ */
if (parent == null) {
if (fragment == null) {
- app.setPath("");
+ // app.setPath(""); original code modified see above
+ app.setPath(SLASH);
} else {
- app.setPath(SLASH + fragment);
+ // app.setPath(SLASH + fragment); original code modified see above
+ app.setPath(SLASH + fragment + SLASH);
}
} else {
- app.setPath(parent.getPath() + SLASH + fragment);
+ // app.setPath(parent.getPath() + SLASH + fragment); original code
+ // modified see above
+ app.setPath(parent.getPath() + SLASH + fragment + SLASH);
}
return app;
@@ -276,14 +293,14 @@ public class Application extends Resource {
private static Application legacyMake(final ApplicationType type,
final String fragment,
final String title,
- final Application parent,
- final boolean createContainerGroup) {
+ final Application parent,
+ final boolean createContainerGroup) {
final Application application = (Application) Resource.createResource(
type, title, parent);
- if (createContainerGroup) {
- s_log.debug("Creating Group for application");
- application.createGroup();
- }
+ if (createContainerGroup) {
+ s_log.debug("Creating Group for application");
+ application.createGroup();
+ }
final DataObject dataObject =
DomainServiceInterfaceExposer.getDataObject(application);
@@ -382,6 +399,8 @@ public class Application extends Resource {
// Can return null.
public static Application retrieveApplicationForPath(String path) {
+
+ s_log.debug("retrieveApplicationForPath: " + path);
DataCollection dataCollection =
SessionManager.getSession().retrieve(BASE_DATA_OBJECT_TYPE);
@@ -392,6 +411,7 @@ public class Application extends Resource {
dataCollection.close();
return Application.retrieveApplication(dataObject);
} else {
+ s_log.debug("retrieveApplicationForPath: No application found on " + path);
return null;
}
}
@@ -577,13 +597,24 @@ public class Application extends Resource {
public final void setPath(String path) {
if (Assert.isEnabled()) {
Assert.exists(path, String.class);
- Assert.isTrue
- (path.equals("") || (path.startsWith(SLASH)
- && !path.endsWith(SLASH)),
- "The path must either be the empty string (for the " +
- "default application) or it must start with '/' and *not* " +
- "end in '/'; I got '" + path + "'");
- }
+/* Modified by pboy April 2011
+ * This Assert statement prevents a trailing slash. setPath is currently called
+ * only by Applicatiom#make which creates a LEGACY FREE application.
+ * Legacy compatible applications are currently created WITH a trailing slash
+ * (see e.g. SiteNode#setURL oder SiteNode#getURLFromParent.) Therefore for the
+ * time beeing if we must support legacy free and legacy compatible applications
+ * in parallel we have to use a trailing slash for legacy free applications,
+ * otherwise they will not be found by methods like retrieveApplicationForPath()
+ * which is called by legacy compatible apps including a trailing slash. If
+ * legacy free apps are store without trailing slash the search will never match.
+ */
+// Assert.isTrue
+// (path.equals("") || (path.startsWith(SLASH)
+// && !path.endsWith(SLASH)),
+// "The path must either be the empty string (for the " +
+// "default application) or it must start with '/' and *not* " +
+// "end in '/'; I got '" + path + "'");
+ }
set(PRIMARY_URL, path);
}
diff --git a/ccm-core/src/com/arsdigita/web/ApplicationType.java b/ccm-core/src/com/arsdigita/web/ApplicationType.java
index cab869cc3..63d5f9117 100755
--- a/ccm-core/src/com/arsdigita/web/ApplicationType.java
+++ b/ccm-core/src/com/arsdigita/web/ApplicationType.java
@@ -33,6 +33,8 @@ import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.db.Sequences;
import com.arsdigita.util.Assert;
+import com.arsdigita.util.StringUtils;
+
import java.util.LinkedList;
import java.util.Collection;
import java.math.BigDecimal;
@@ -95,9 +97,9 @@ public class ApplicationType extends ResourceType {
* @param createContainerGroup
*/
protected ApplicationType(final String objectType,
- final String title,
- final String applicationObjectType,
- final boolean createContainerGroup) {
+ final String title,
+ final String applicationObjectType,
+ final boolean createContainerGroup) {
this(objectType); // creates and returns an empty data object
Assert.exists(title, "String title");
@@ -107,12 +109,13 @@ public class ApplicationType extends ResourceType {
setApplicationObjectType(applicationObjectType);
setDefaults();
- if (createContainerGroup) {
- createGroup();
- }
+ if (createContainerGroup) {
+ createGroup();
+ }
m_legacyFree = true;
}
+ @Override
protected String getBaseDataObjectType() {
return BASE_DATA_OBJECT_TYPE;
}
@@ -169,11 +172,19 @@ public class ApplicationType extends ResourceType {
}
+ /**
+ * Legacy compatible application type
+ * @param dataObjectType
+ * @param packageType
+ * @param title
+ * @param applicationObjectType
+ * @param createContainerGroup
+ */
protected ApplicationType(final String dataObjectType,
- final PackageType packageType,
- final String title,
- final String applicationObjectType,
- boolean createContainerGroup) {
+ final PackageType packageType,
+ final String title,
+ final String applicationObjectType,
+ boolean createContainerGroup) {
this(dataObjectType);
Assert.exists(title, "title");
@@ -187,9 +198,9 @@ public class ApplicationType extends ResourceType {
setApplicationObjectType(applicationObjectType);
setDefaults();
- if (createContainerGroup) {
- createGroup();
- }
+ if (createContainerGroup) {
+ createGroup();
+ }
}
/**
@@ -561,6 +572,12 @@ public class ApplicationType extends ResourceType {
remove("relevantPrivileges", privDO);
}
+ /**
+ * Retrieve the attribute object type from database, which is the fully
+ * qualified classname of the applications domain class.
+ *
+ * @return object typ (fully qualified classname) as string
+ */
public String getApplicationObjectType() {
String objectType = (String)get("objectType");
@@ -575,6 +592,38 @@ public class ApplicationType extends ResourceType {
set("objectType", objectType);
}
+ /**
+ * Provides an "urlized" name for an application, especially needed by
+ * PatternStyleSheetResolver to locate the xsl templates for an application
+ * in the local file system tree.
+ *
+ * We use the developer provided title value as name stripping off all white
+ * spaces. So developer has some influence on the term.
+ *
+ * The name may not be unique! Uniqueness is by no way technically
+ * guaranteed! This is developer's responsibility.
+ *
+ * This method has been added to enable legacy-free types of applications to
+ * work in CCM. Class ApplicationType is meant to replace the deprecated
+ * class PackageType which provide this facility by its packageKey property.
+ * So wwe have to provide this functionality by ApplicationType as well
+ * which has no kind of "key" by design.
+ */
+ public String getName() {
+
+ // m_legacyFree seems sometimes not set correctly!
+// if (m_legacyFree == true ) {
+ if (getPackageType() == null) { // indicates a legacy free ApplicationType
+ // XXX we need a better way to determine a name, probably using
+ // the class name without leading package name.
+ s_log.debug("Expect XSL templates at " + StringUtils.urlize(getTitle()));
+ return StringUtils.urlize(getTitle());
+ } else {
+ return this.getPackageType().getKey();
+ }
+
+ }
+
/**
* Declare this ApplicationType to be a singleton. That is to
* say, there ought to only ever be one Application of this type
diff --git a/ccm-core/src/com/arsdigita/web/Web.java b/ccm-core/src/com/arsdigita/web/Web.java
index 3469d0939..0150b9101 100755
--- a/ccm-core/src/com/arsdigita/web/Web.java
+++ b/ccm-core/src/com/arsdigita/web/Web.java
@@ -81,7 +81,7 @@ public class Web {
*
* @return A WebContext object; it cannot be null
*/
- public static final WebContext getContext() {
+ public static WebContext getContext() {
if (s_context == null) {
s_context = new WebContextLocal();
}
@@ -94,7 +94,7 @@ public class Web {
* @return A WebConfig configuration record; it
* cannot be null
*/
- public static final WebConfig getConfig() {
+ public static WebConfig getConfig() {
if (s_config == null) {
s_config = new WebConfig();
s_config.require("ccm-core/web.properties");
@@ -108,7 +108,7 @@ public class Web {
* @return The current HttpServletRequest; it can be
* null
*/
- public static final HttpServletRequest getRequest() {
+ public static HttpServletRequest getRequest() {
return (HttpServletRequest) s_request.get();
}
diff --git a/ccm-core/src/com/arsdigita/web/WebApp.java b/ccm-core/src/com/arsdigita/web/WebApp.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/web/WebApp.java
rename to ccm-core/src/com/arsdigita/web/WebApp.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/web/WebContext.java b/ccm-core/src/com/arsdigita/web/WebContext.java
index e688a166c..dd8f97bf9 100755
--- a/ccm-core/src/com/arsdigita/web/WebContext.java
+++ b/ccm-core/src/com/arsdigita/web/WebContext.java
@@ -18,7 +18,7 @@
*/
package com.arsdigita.web;
-import com.arsdigita.web.Application;
+// import com.arsdigita.web.Application;
import com.arsdigita.kernel.User;
import com.arsdigita.kernel.security.UserContext;
import com.arsdigita.util.Assert;
@@ -39,17 +39,22 @@ import org.apache.log4j.Logger;
*/
public final class WebContext extends Record {
+ /** Logger instance for debugging */
private static final Logger s_log = Logger.getLogger(WebContext.class);
private Application m_application = null;
private URL m_requestURL = null;
+ /** List of properties making up a Web Context */
private static String[] s_fields = new String[] {
"User",
"Application",
"RequestURL"
};
+ /**
+ * Constructor
+ */
WebContext() {
super(WebContext.class, s_log, s_fields);
}
diff --git a/ccm-ldn-navigation/src/com/arsdigita/london/navigation/AddNavigation.java b/ccm-ldn-navigation/src/com/arsdigita/london/navigation/AddNavigation.java
index f6f615774..0a010c3e2 100755
--- a/ccm-ldn-navigation/src/com/arsdigita/london/navigation/AddNavigation.java
+++ b/ccm-ldn-navigation/src/com/arsdigita/london/navigation/AddNavigation.java
@@ -1,32 +1,19 @@
package com.arsdigita.london.navigation;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.log4j.Logger;
-
-import com.arsdigita.categorization.Category;
-import com.arsdigita.categorization.RootCategoryCollection;
-import com.arsdigita.cms.ContentSection;
-import com.arsdigita.cms.SecurityManager;
-import com.arsdigita.cms.ui.role.RoleFactory;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.domain.DomainObjectInstantiator;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
-import com.arsdigita.kernel.Role;
-import com.arsdigita.kernel.RoleCollection;
-import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
import com.arsdigita.london.terms.Domain;
import com.arsdigita.london.util.Program;
import com.arsdigita.london.util.Transaction;
import com.arsdigita.persistence.DataObject;
-import com.arsdigita.persistence.DataQuery;
import com.arsdigita.web.Application;
+import org.apache.commons.cli.CommandLine;
+import org.apache.log4j.Logger;
+
public class AddNavigation extends Program {
private static final Logger LOG = Logger.getLogger(AddNavigation.class);
@@ -37,6 +24,7 @@ public class AddNavigation extends Program {
private void addNavigation(String navURL, String navTitle, String defaultDomain) {
if (!Application.isInstalled(Navigation.BASE_DATA_OBJECT_TYPE, "/"+navURL+"/")) {
+
DomainObjectFactory.registerInstantiator(
Navigation.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
public DomainObject doNewInstance(DataObject dataObject) {
diff --git a/ccm-portalworkspace/application.xml b/ccm-portalworkspace/application.xml
index e150d5f89..853e9c255 100755
--- a/ccm-portalworkspace/application.xml
+++ b/ccm-portalworkspace/application.xml
@@ -2,7 +2,7 @@
diff --git a/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql b/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql
new file mode 100644
index 000000000..206f6c7e5
--- /dev/null
+++ b/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql
@@ -0,0 +1,44 @@
+--
+-- Copyright (C) 2011 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: upd_system_tables.sql pboy $
+
+-- adjust various system tables to the new name of application
+
+
+update application_types
+ set title='Portal Workspace',
+ package_type_id=null
+ where object_type='com.arsdigita.portalworkspace.Workspace' ;
+
+update applications
+ set package_id=null
+ where primary_url = '/portal/' ;
+
+-- table site_nodes
+delete from site_nodes
+ where name like '%portal%' ;
+
+-- table apm_packages
+delete from apm_packages
+ where pretty_name like '%Portal%' ;
+
+-- table apm_package_types doesn't require an update
+delete from apm_package_types
+ where pretty_name like '%Workspace%' ;
+
+
diff --git a/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/oracle-se-6.6.1-6.6.2.sql b/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/oracle-se-6.6.1-6.6.2.sql
new file mode 100644
index 000000000..762f3431a
--- /dev/null
+++ b/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/oracle-se-6.6.1-6.6.2.sql
@@ -0,0 +1,22 @@
+--
+-- Copyright (C) 2011 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: 2011/03/27 23:15:09 $
+-- $Id: oracle-se-6.6.0-6.6.1 pboy $
+
+
+@@ default/6.6.1-6.6.2/upd_system_tables.sql
diff --git a/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/postgres-6.6.1-6.6.2.sql b/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/postgres-6.6.1-6.6.2.sql
new file mode 100644
index 000000000..e6d9b0d89
--- /dev/null
+++ b/ccm-portalworkspace/sql/ccm-portalworkspace/upgrade/postgres-6.6.1-6.6.2.sql
@@ -0,0 +1,26 @@
+--
+-- Copyright (C) 2011 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 ccm-portalworkspace 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL)
+
+begin;
+
+\i default/6.6.1-6.6.2/upd_system_tables.sql
+
+commit;
diff --git a/ccm-portalworkspace/src/ccm-portalworkspace.upgrade b/ccm-portalworkspace/src/ccm-portalworkspace.upgrade
index 3ab9d61c8..a3da43e2b 100755
--- a/ccm-portalworkspace/src/ccm-portalworkspace.upgrade
+++ b/ccm-portalworkspace/src/ccm-portalworkspace.upgrade
@@ -22,4 +22,7 @@
+
+
+
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java
index ebfae2408..1b913727a 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Loader.java
@@ -18,12 +18,13 @@
package com.arsdigita.portalworkspace;
-import org.apache.log4j.Logger;
-
+// import com.arsdigita.domain.DomainObject;
+// import com.arsdigita.kernel.ACSObjectInstantiator;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
import com.arsdigita.kernel.ResourceType;
import com.arsdigita.loader.PackageLoader;
+// import com.arsdigita.persistence.DataObject;
import com.arsdigita.portalworkspace.portlet.ApplicationDirectoryPortlet;
import com.arsdigita.portalworkspace.portlet.ContentDirectoryPortlet;
import com.arsdigita.portalworkspace.portlet.FreeformHTMLPortlet;
@@ -40,8 +41,11 @@ import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.StringParameter;
import com.arsdigita.web.Application;
+// import com.arsdigita.web.ApplicationSetup;
import com.arsdigita.web.ApplicationType;
+import org.apache.log4j.Logger;
+
/**
* Executes nonrecurring at install time and loads (and configures ) a default
* workspace instance (i.e. instance of ccm-portalworkspace) in a default
@@ -86,7 +90,7 @@ public class Loader extends PackageLoader {
}
/**
- * Run script invoked by the loader script.
+ * Run script invoked by com.arsdigita.packing loader script.
*
* @param ctx
*/
@@ -128,9 +132,9 @@ public class Loader extends PackageLoader {
if (url != null) {
// check weather the url parameter is properly formatted
- s_log.debug("process url " + url);
- Assert.isTrue(url.startsWith("/"), "url starts with /");
- Assert.isTrue(url.endsWith("/"), "url ends with /");
+ s_log.error("process url " + url);
+ Assert.isTrue(url.startsWith("/"), "url starts not with /");
+ Assert.isTrue(url.endsWith("/"), "url ends not with /");
Assert.isTrue(!url.equals("/"), "url is not /");
int last = url.lastIndexOf("/", url.length() - 2);
@@ -145,36 +149,52 @@ public class Loader extends PackageLoader {
} else {
name = url.substring(1, url.length() - 1);
}
- s_log.debug("node name is " + name);
+ s_log.error("node name is " + name);
// set up the portal node
- Workspace workspace = Workspace.createWorkspace(name, title,
- parent, Boolean.TRUE.equals(isPublic));
+ // Workspace workspace = Workspace.createWorkspace(name, title,
+ // parent, Boolean.TRUE.equals(isPublic));
+ Workspace workspace = Workspace.createWorkspace(type, name, title,
+ null, parent, Boolean.TRUE.equals(isPublic));
}
}
/**
- * Creates a workspace application type as a legacy-compatible application
- * type.
+ * Creates a workspace application type as a legacy-free application type.
*
* No localization here because it is an invariant configuration.
*
+ * NOTE: The wording in the title parameter of ApplicationType determines
+ * the name of the subdirectory for the XSL stylesheets.
+ * It gets "urlized", i.e. trimming leading and trailing blanks and replacing
+ * blanks between words and illegal characters with an hyphen and converted
+ * to lower case.
+ * "Portal Workspace" will become "portal-workspace".
+ *
* Creates an entry in table application_types and a corresponding entry in
* apm_package_types
*
* @return
*/
private ApplicationType setupWorkspaceType() {
+
+ s_log.debug("Creating an application type for portal workspace. " +
+ "Base Data Object Type: " + Workspace.BASE_DATA_OBJECT_TYPE);
// The first string is a key parameter used to create a
// legacy package type to back the new application type.
- ApplicationType type = ApplicationType.createApplicationType(
- "portalworkspace",
- "Portal Workspace",
- Workspace.BASE_DATA_OBJECT_TYPE);
+ // ApplicationType type = ApplicationType.createApplicationType(
+ // "portalworkspace",
+ // "Portal Workspace",
+ // Workspace.BASE_DATA_OBJECT_TYPE);
+
+
+ ApplicationType type = new ApplicationType( "Portal Workspace",
+ Workspace.BASE_DATA_OBJECT_TYPE );
type.setDescription("Portal based collaborative workspaces");
type.createGroup();
return type;
+
}
/**
@@ -182,6 +202,9 @@ public class Loader extends PackageLoader {
*
* Creates an entry for class (=type) c.ad.portalworkspace.WorkspacePage in
* table application_types, but not in apm_package_types.
+ *
+ * Uses the legacy free type of application Information (i.e. a title string
+ * and the object type = fully qualified domain class name) for creation
* @return
*/
private ResourceType setupWorkspacePageType() {
diff --git a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
index 23a8604f1..00bcc84bf 100755
--- a/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
+++ b/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java
@@ -45,6 +45,7 @@ import com.arsdigita.util.Assert;
import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.web.Application;
import com.arsdigita.web.ApplicationCollection;
+import com.arsdigita.web.ApplicationType;
import com.arsdigita.web.Web;
import java.util.Iterator;
@@ -150,7 +151,8 @@ public class Workspace extends Application {
}
/**
- * Does the real work to create a workspace in the storage (db)
+ * Does the real work to create a workspace as a legacy compatible
+ * applicationin the storage (db)
*
* NOTE: Parameter isPublic may be a misnomer, the actual usage of it in the
* process of application creation uses it as createGroupContainer
@@ -179,6 +181,39 @@ public class Workspace extends Application {
return workspace;
}
+ /**
+ * Does the real work to create a workspace as a legacy free application
+ * in the storage (db)
+ *
+ * NOTE: Parameter isPublic may be a misnomer, the actual usage of it in the
+ * process of application creation uses it as createGroupContainer
+ *
+ * @param url
+ * @param title
+ * @param layout
+ * @param parent
+ * @param isPublic whether to create a workspace group
+ * @return
+ */
+ public static Workspace createWorkspace(ApplicationType type,
+ String url, String title,
+ PageLayout layout,
+ Application parent,
+ boolean isPublic) {
+ if (s_log.isDebugEnabled()) {
+ s_log.debug("Creating group workspace, isPublic:" + isPublic
+ + " on " + url + " with parent "
+ + (parent == null ? "none" : parent.getOID().toString()));
+ }
+ if (layout==null) layout = PageLayout.getDefaultLayout();
+
+ Workspace workspace = (Workspace) Application.createApplication(
+ type, url, title, parent, isPublic );
+ workspace.setupGroups(title, isPublic);
+ workspace.setDefaultLayout(layout);
+ return workspace;
+ }
+
/**
* Does the real work to create a workspace in the storage (db)
*
diff --git a/ccm-portalworkspace/web/__ccm__/apps/portalworkspace/xsl/admin.xsl b/ccm-portalworkspace/web/__ccm__/apps/portal-workspace/xsl/admin.xsl
similarity index 100%
rename from ccm-portalworkspace/web/__ccm__/apps/portalworkspace/xsl/admin.xsl
rename to ccm-portalworkspace/web/__ccm__/apps/portal-workspace/xsl/admin.xsl
diff --git a/ccm-portalworkspace/web/__ccm__/apps/portalworkspace/xsl/edit.xsl b/ccm-portalworkspace/web/__ccm__/apps/portal-workspace/xsl/edit.xsl
similarity index 100%
rename from ccm-portalworkspace/web/__ccm__/apps/portalworkspace/xsl/edit.xsl
rename to ccm-portalworkspace/web/__ccm__/apps/portal-workspace/xsl/edit.xsl
diff --git a/ccm-portalworkspace/web/__ccm__/apps/portalworkspace/xsl/index.xsl b/ccm-portalworkspace/web/__ccm__/apps/portal-workspace/xsl/index.xsl
similarity index 100%
rename from ccm-portalworkspace/web/__ccm__/apps/portalworkspace/xsl/index.xsl
rename to ccm-portalworkspace/web/__ccm__/apps/portal-workspace/xsl/index.xsl
diff --git a/ccm-themedirector/application.xml b/ccm-themedirector/application.xml
index f503dc0db..c8cc77c97 100755
--- a/ccm-themedirector/application.xml
+++ b/ccm-themedirector/application.xml
@@ -2,7 +2,7 @@
diff --git a/ccm-themedirector/sql/ccm-themedirector/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql b/ccm-themedirector/sql/ccm-themedirector/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql
new file mode 100644
index 000000000..45bb561f8
--- /dev/null
+++ b/ccm-themedirector/sql/ccm-themedirector/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql
@@ -0,0 +1,44 @@
+--
+-- Copyright (C) 2011 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: upd_system_tables.sql pboy $
+
+-- adjust various system tables to the new name of application
+
+
+update application_types
+ set title='Theme Director',
+ package_type_id=null
+ where object_type='com.arsdigita.themedirector.ThemeDirector' ;
+
+update applications
+ set package_id=null
+ where primary_url = '/admin/themes/' ;
+
+-- table site_nodes
+delete from site_nodes
+ where name like '%theme%' ;
+
+-- table apm_packages
+delete from apm_packages
+ where pretty_name like '%Theme%' ;
+
+-- table apm_package_types doesn't require an update
+delete from apm_package_types
+ where pretty_name like '%Theme%' ;
+
+
diff --git a/ccm-themedirector/sql/ccm-themedirector/upgrade/oracle-se-6.6.1-6.6.2.sql b/ccm-themedirector/sql/ccm-themedirector/upgrade/oracle-se-6.6.1-6.6.2.sql
new file mode 100644
index 000000000..4e916a1b4
--- /dev/null
+++ b/ccm-themedirector/sql/ccm-themedirector/upgrade/oracle-se-6.6.1-6.6.2.sql
@@ -0,0 +1,22 @@
+--
+-- Copyright (C) 2011 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: 2011/03/27 23:15:09 $
+-- $Id: oracle-se-6.6.0-6.6.1 pboy $
+
+@@ default/6.6.0-6.6.1/upd_theme_app_table.sql
+@@ default/6.6.0-6.6.1/upd_system_tables.sql
diff --git a/ccm-themedirector/sql/ccm-themedirector/upgrade/postgres-6.6.1-6.6.2.sql b/ccm-themedirector/sql/ccm-themedirector/upgrade/postgres-6.6.1-6.6.2.sql
new file mode 100644
index 000000000..38b95bfe4
--- /dev/null
+++ b/ccm-themedirector/sql/ccm-themedirector/upgrade/postgres-6.6.1-6.6.2.sql
@@ -0,0 +1,26 @@
+--
+-- Copyright (C) 2011 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 ccm-themedirector 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL)
+
+begin;
+
+\i default/6.6.1-6.6.2/upd_system_tables.sql
+
+commit;
diff --git a/ccm-themedirector/src/ccm-themedirector.upgrade b/ccm-themedirector/src/ccm-themedirector.upgrade
index e146253a5..de1de9273 100755
--- a/ccm-themedirector/src/ccm-themedirector.upgrade
+++ b/ccm-themedirector/src/ccm-themedirector.upgrade
@@ -11,4 +11,7 @@
+
+
+
diff --git a/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java b/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java
index 7e941bcd6..bc0f67c8a 100755
--- a/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java
+++ b/ccm-themedirector/src/com/arsdigita/themedirector/Loader.java
@@ -49,26 +49,45 @@ public class Loader extends PackageLoader implements ThemeDirectorConstants {
/**
- * Creates theme manager as a legacy-compatible application type.
+ * Creates theme manager as a legacy-free application type.
*
+ * NOTE: The wording in the title parameter of ApplicationType determines
+ * the name of the subdirectory for the XSL stylesheets.
+ * It gets "urlized", i.e. trimming leading and trailing blanks and replacing
+ * blanks between words and illegal characters with an hyphen and converted
+ * to lower case.
+ * Example: "Theme Director" will become "theme-director".
+ *
+ * Creates an entry in table application_types and a corresponding entry in
+ * apm_package_types
*/
private void setupThemeDirector() {
// create application type
- ApplicationType type = ApplicationType.createApplicationType(
- "themedirector",
- "CCM Themes Administration",
- ThemeDirector.BASE_DATA_OBJECT_TYPE);
+ // legacy compatible style of creation
+ // ApplicationType type = ApplicationType.createApplicationType(
+ // "themedirector",
+ // "CCM Themes Administration",
+ // ThemeDirector.BASE_DATA_OBJECT_TYPE);
+ // EXPERIMENTAL legacy free style of creation
+ ApplicationType type =
+ new ApplicationType( "Theme Director",
+ ThemeDirector.BASE_DATA_OBJECT_TYPE );
+
type.setDescription("CCM themes administration");
Application admin = Application.retrieveApplicationForPath("/admin/");
- // create application instance
+ // create application instance as a legacy compatible app
+ // Whether a legacy compatible or a legacy free application is
+ // created depends on the type of ApplicationType above. No need to
+ // modify anything here
Application app =
- Application.createApplication(type,
- "themes",
- "CCM Themes Administration",
- admin);
+ Application.createApplication(type,
+ "themes",
+ "CCM Themes Administration",
+ admin);
+
app.setDescription("CCM themes administration");
}
}
diff --git a/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorConstants.java b/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorConstants.java
index abf43c8b2..34bac690c 100755
--- a/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorConstants.java
+++ b/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorConstants.java
@@ -31,10 +31,10 @@ public interface ThemeDirectorConstants {
/** Name of the directory for themes under development (sub-dir of THEMES_DIR) */
public final static String DEV_DIR_STUB = "devel-themedir";
- public final static String PROD_THEMES_BASE_DIR =
- THEMES_DIR + "/" + PROD_DIR_STUB+ "/";
- public final static String DEV_THEMES_BASE_DIR =
- THEMES_DIR + "/" + DEV_DIR_STUB + "/";
+ public final static String
+ PROD_THEMES_BASE_DIR = THEMES_DIR + "/" + PROD_DIR_STUB+ "/";
+ public final static String
+ DEV_THEMES_BASE_DIR = THEMES_DIR + "/" + DEV_DIR_STUB + "/";
// ccm-themedirector (formerly ccm-ldn-theme) is no longer installed in its
// own web context (ROOT or ccm-ldn-theme/ccm-themedirector) so it is not
diff --git a/ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/action-group.xsl b/ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/action-group.xsl
similarity index 100%
rename from ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/action-group.xsl
rename to ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/action-group.xsl
diff --git a/ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/index.xsl b/ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/index.xsl
similarity index 100%
rename from ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/index.xsl
rename to ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/index.xsl
diff --git a/ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/layout-panel.xsl b/ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/layout-panel.xsl
similarity index 100%
rename from ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/layout-panel.xsl
rename to ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/layout-panel.xsl
diff --git a/ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/section.xsl b/ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/section.xsl
similarity index 100%
rename from ccm-themedirector/web/themes/heirloom/apps/themedirector/xsl/section.xsl
rename to ccm-themedirector/web/themes/heirloom/apps/theme-director/xsl/section.xsl