From 4ab614055a12bd926caff3e2e1bd14d1c40e86b0 Mon Sep 17 00:00:00 2001
From: pb
Date: Sat, 7 Feb 2009 22:44:11 +0000
Subject: [PATCH] Integrate vendor release r1795: First part of the
conversion of CCM to be deployed in a standard way r1796: Multilanguage
categorization (already local, but upgrade script added, comments
and translation added)
First part of the conversion of CCM / APLAWS to be deployed in a standard way
by a *.war file.
Backwards compatible to the procedures so far. The ccm scripts can be used
as used to. Only difference is the location of some files (see below).
As an alternative the webapps directory created by the ccm scripts can be
moved into a standard tomcat container or can be added as a virtual host.
APLAWS no longer depends on all the environment variables. For detailed
instructions see documentation on the WIKI. This is a temporary solution,
further enhancements are on the way!
No update script required for this part.
Modifications:
- Creation of a c.ad.runtime.CCMResourceManager class, which currently
handles just the file locations. It replaces the dependency from the
CCM_HOME environment variable. It is initialized during startup of the
servlet container or by the entry point of the installation tools (i.e.
c.ad.packaging.mastertool). It replaces the c.ad.packaging.CCM class
as well. Currently contains backwards compatibility code to check the
runtime environment just in case the initialization is missing (will be
removed later).
- Creation of c.ad.web.CCMApplicationContextListener class which is
notified by the servlet container at the beginning of the startup procedure.
Initialises CCMResourceManager. Must be configured by web.xml (if a contributed
package overwrites the trunk values)!
- File location changes:
- Configuration registry moved to [appbase]/WEB-INF/conf/registry
- ps2fs files moved to [appbase]/ps2fs
(can be modified by configuration parameter)
- lucene index files moved to [appbase]/WEB-INF/work/lucene
(can be modified by configuration parameter)
Developers watch out! ant clean now removes these files, too (esp. registry)!
- XML factory classes are now determined by configuration parameters
- waf.xml.xsl_transformer=[saxon (default)|jd.xslt|resin|xalan|xsltc]
- waf.xml.dom_builder=[xerces (default) | resin]
- waf.xml.sax_parser=[xerces (default) | resin]
- Package c.ad.packaging reorganized so it contains just installation
related code. Runtime configuration related code moved to c.ad.runtime.
Code is not part of the API.
- log4j configuration file is still at the old location, but is not used
anymore! It will be moved to [appbase]/WEB-INF/conf/ in the future.
Developers, modify the file ~/webapps/WEB-INF//classes/log4j.properties
in the meantime.
- While working on the code some deprecated classes and method invocations
replaced by supported API. If a class is no longer used by any module in
trunk, the class has been removed by appending "nolongerInUse" to the file
name. If any of the contributed modules is still depending on deprecated code
it is easy to find and to follow the recommended replacement instructions. Do
not re-incorporate deprecated code! We have to clean up the code base!
Second part: Multilanguage categories
Added update script
Translation of some comments, added comments
version number bumped to reflect the major changes
git-svn-id: https://svn.libreccm.org/ccm/trunk@73 8810af33-2d31-482b-a856-94f89814c4df
---
ccm-cms/application.xml | 2 +-
.../cms/dispatcher/AbstractItemResolver.java | 40 +-
.../cms/dispatcher/CMSDispatcher.java | 13 +-
.../dispatcher/CategoryItemResolverImpl.java | 67 ++--
...ltItemTemplateResolver.java.nolongerInUse} | 0
.../dispatcher/DefaultTemplateResolver.java | 12 +-
...> ItemTemplateResolver.java.nolongerInUse} | 0
.../dispatcher/MultilingualItemResolver.java | 75 ++--
ccm-cms/src/com/arsdigita/cms/enterprise.init | 16 +-
.../cms/publishToFile/Initializer.java | 33 +-
.../cms/publishToFile/PublishToFile.java | 27 +-
.../com/arsdigita/cms/ui/SortableList.java | 2 +-
.../cms/ui/category/CategoryAdminPane.java | 14 +-
.../category/CategoryCollectionListModel.java | 13 +-
.../cms/ui/category/CategoryEditForm.java | 6 +
.../cms/ui/category/CategoryItemPane.java | 96 +++--
.../category/CategoryLocalizationAddForm.java | 56 ++-
.../CategoryLocalizationEditForm.java | 70 ++--
.../ui/category/CategoryLocalizationForm.java | 58 ++-
.../category/CategoryLocalizationTable.java | 88 +++--
.../ui/lifecycle/ItemLifecycleSelectForm.java | 6 +-
.../com/arsdigita/cms/workflow/CMSTask.java | 2 +-
ccm-core/application.xml | 2 +-
.../com/arsdigita/categorization/Category.pdl | 2 +-
ccm-core/sql/ccm-core/oracle-se-create.sql | 2 +-
.../oracle-se/messaging/table-messages.sql | 2 +-
ccm-core/sql/ccm-core/postgres-create.sql | 2 +-
.../ccm-core/upgrade/postgres-6.5.5-6.5.6.sql | 2 +-
ccm-core/src/ccm-core.checklist | 5 +
ccm-core/src/ccm-core.upgrade | 4 +-
ccm-core/src/com/arsdigita/bebop/Bebop.java | 5 +-
... => BebopMapDispatcher.java.nolongerInUse} | 0
.../com/arsdigita/bebop/PropertyEditor.java | 2 +-
ccm-core/src/com/arsdigita/bebop/Table.java | 4 +-
.../arsdigita/bebop/demo/AutoDispatcher.java | 7 +-
.../bebop/demo/MinimalDispatcher.java | 7 +-
.../arsdigita/bebop/demo/OtherDispatcher.java | 7 +-
.../arsdigita/bebop/page/PageTransformer.java | 6 +-
.../FileSizeValidationListener.java | 13 +-
.../NotEmptyValidationListener.java | 14 +-
.../arsdigita/bebop/table/TableHeader.java | 4 +-
.../categorization/CategorizationConfig.java | 64 ++--
.../CategorizationConfig_parameter.properties | 6 +-
.../arsdigita/categorization/Category.java | 2 -
.../categorization/CategoryLocalization.java | 22 +-
.../CategoryLocalizationCollection.java | 26 +-
.../src/com/arsdigita/core/Initializer.java | 173 ---------
ccm-core/src/com/arsdigita/core/LibCheck.java | 26 +-
ccm-core/src/com/arsdigita/core/Loader.java | 25 --
.../src/com/arsdigita/core/enterprise.init | 8 +-
.../arsdigita/core/libcheck.messages_linux | 43 +++
.../SampleUpgrade.java.nolongerInUse} | 0
.../TroikaRickshawUpgrade.java.nolongerInUse} | 0
...TroikaRickshawUpgrade2.java.nolongerInUse} | 0
.../src/com/arsdigita/initializer/Script.java | 5 +-
ccm-core/src/com/arsdigita/kernel/Kernel.java | 8 +-
.../kernel/security/SecurityConfig.java | 3 +
.../kernel/security/UserContext.java | 8 +-
.../src/com/arsdigita/loader/MimeTypeRow.java | 17 +-
.../com/arsdigita/loader/PackageLoader.java | 44 ++-
...dapter.java => Adapter.java.nolongerInUse} | 0
...h.java => LuceneSearch.java.nolongerInUse} | 0
...va => ObjectTypeFilter.java.nolongerInUse} | 0
...istry.java => Registry.java.nolongerInUse} | 0
...ava => StandardAdapter.java.nolongerInUse} | 0
... => TypeSpecificFilter.java.nolongerInUse} | 0
.../arsdigita/notification/Notification.java | 2 +-
.../{core => packaging}/BaseCheck.java | 56 ++-
.../src/com/arsdigita/packaging/Check.java | 6 +-
.../DBCheck.java => packaging/CheckDB.java} | 73 +++-
.../com/arsdigita/packaging/Checklist.java | 5 +-
.../src/com/arsdigita/packaging/Clear.java | 4 +
.../src/com/arsdigita/packaging/Command.java | 11 +-
.../src/com/arsdigita/packaging/Config.java | 46 ++-
.../{Files.java => Files.java.deprecated} | 0
ccm-core/src/com/arsdigita/packaging/Get.java | 13 +-
.../src/com/arsdigita/packaging/Help.java | 5 +-
.../src/com/arsdigita/packaging/HostInit.java | 15 +-
.../src/com/arsdigita/packaging/Load.java | 58 ++-
.../src/com/arsdigita/packaging/Loader.java | 21 +-
.../com/arsdigita/packaging/LoaderInfo.java | 7 +-
.../com/arsdigita/packaging/MasterTool.java | 26 +-
.../src/com/arsdigita/packaging/Menu.java | 5 +-
.../{core => packaging}/MessageMap.java | 7 +-
.../arsdigita/packaging/ParameterEditor.java | 7 +-
.../com/arsdigita/packaging/ParameterMap.java | 5 +-
ccm-core/src/com/arsdigita/packaging/Set.java | 11 +-
.../src/com/arsdigita/packaging/Status.java | 6 +-
.../src/com/arsdigita/packaging/Unload.java | 10 +-
.../src/com/arsdigita/packaging/Usage.java | 5 +-
.../basecheck.messages_linux} | 0
.../packaging/checkdb.messages_linux | 84 +++++
.../src/com/arsdigita/packaging/package.html | 14 +
.../com/arsdigita/runtime/AbstractConfig.java | 1 -
ccm-core/src/com/arsdigita/runtime/CCM.java | 117 ------
.../arsdigita/runtime/CCMResourceManager.java | 353 ++++++++++++++++++
.../ConfigRegistry.java | 33 +-
.../runtime/InteractiveParameterLoader.java | 4 +-
.../runtime/InteractiveParameterReader.java | 108 ++++++
.../arsdigita/runtime/LegacyInitializer.java | 1 -
.../RegistryConfig.java | 7 +-
....java => RuntimeClassLoader.java.notInUse} | 11 +
.../com/arsdigita/runtime/RuntimeConfig.java | 25 +-
...=> RuntimeConfigLoader.java.nolongerInUse} | 0
.../com/arsdigita/runtime/ScriptContext.java | 23 +-
.../src/com/arsdigita/runtime/package.html | 14 +-
.../src/com/arsdigita/search/Initializer.java | 1 +
.../com/arsdigita/search/lucene/Index.java | 5 +-
.../arsdigita/search/lucene/LuceneConfig.java | 11 +-
.../arsdigita/toolbox/ui/ComponentMap.java | 6 +-
.../arsdigita/ui/admin/SubsiteDispatcher.java | 2 +-
.../arsdigita/ui/login/SubsiteDispatcher.java | 15 +-
.../ui/login/SubsiteResources.properties | 62 +++
.../ui/login/SubsiteResources_de.properties | 62 +++
.../ui/permissions/PermissionsDispatcher.java | 2 +-
.../ui/sitemap/SiteMapDispatcher.java | 12 +-
... AliasedClassParameter.java.nolongerInUse} | 10 +
ccm-core/src/com/arsdigita/util/Assert.java | 120 +++++-
.../arsdigita/util/JavaPropertyReader.java | 4 +-
.../com/arsdigita/util/ResourceManager.java | 29 +-
... => JavaPropertyLoader.java.nolongerInUse} | 0
.../parameter/CompoundParameterReader.java | 4 +-
.../util/parameter/ParameterLoader.java | 6 +
...ava => ParameterRecord.java.nolongerInUse} | 0
.../util/protocol/resource/Handler.java | 21 +-
.../util/servlet/HttpParameterMap.java | 6 +-
.../com/arsdigita/util/xml/DOMBuilder.java | 12 +-
.../src/com/arsdigita/util/xml/SAXParser.java | 12 +-
ccm-core/src/com/arsdigita/util/xml/XML.java | 56 ++-
.../src/com/arsdigita/util/xml/XMLConfig.java | 120 ++++--
.../util/xml/XMLConfig_parameter.properties | 12 +-
.../arsdigita/util/xml/XSLTransformer.java | 16 +-
.../com/arsdigita/versioning/Versioning.java | 13 +-
.../versioning/VersioningConfig.java | 16 +-
.../src/com/arsdigita/web/BaseServlet.java | 21 +-
.../web/CCMApplicationContextListener.java | 102 +++++
.../web/ContextRegistrationServlet.java | 4 +-
.../com/arsdigita/web/DispatcherServlet.java | 3 +
.../arsdigita/webdevsupport/Dispatcher.java | 53 ++-
.../webdevsupport/config/ConfigList.java | 2 +-
.../com/arsdigita/workflow/simple/Task.java | 49 +--
.../arsdigita/workflow/simple/UserTask.java | 14 +-
.../workflow/simple/WorkflowConfig.java | 5 +-
ccm-core/src/com/arsdigita/xml/Document.java | 22 +-
ccm-core/src/com/arsdigita/xml/XML.java | 6 +
ccm-core/src/com/arsdigita/xml/XMLConfig.java | 20 +-
.../src/com/redhat/persistence/pdl/PDL.java | 1 +
.../profiler/rdbms/SQLSummary.java | 2 +
.../arsdigita/search/lucene/LuceneTest.java | 2 +-
.../junit/framework/PackageTestSuite.java | 2 +-
ccm-core/web/WEB-INF/web.xml-default | 7 +
.../src/com/arsdigita/forum/Initializer.java | 173 +++++----
ccm-ldn-aplaws/bundles/complete/cfg/web.xml | 6 +
ccm-ldn-aplaws/bundles/demo/cfg/web.xml | 6 +
ccm-ldn-aplaws/bundles/devel/cfg/web.xml | 6 +
ccm-ldn-aplaws/bundles/standard/cfg/web.xml | 6 +
ccm-ldn-aplaws/web/WEB-INF/web.xml-aplaws | 6 +
ccm-ldn-navigation/application.xml | 2 +-
.../navigation/NavigationFileResolver.java | 31 +-
.../navigation/ui/admin/CategoryTree.java | 9 +-
ccm-ldn-search/application.xml | 2 +-
ccm-shp-aplaws/bundles/devel/cfg/web.xml | 6 +
ccm-shp-aplaws/bundles/standard/cfg/web.xml | 6 +
ccm-shp-aplaws/web/WEB-INF/web.xml-aplaws | 8 +-
164 files changed, 2624 insertions(+), 1058 deletions(-)
rename ccm-cms/src/com/arsdigita/cms/dispatcher/{DefaultItemTemplateResolver.java => DefaultItemTemplateResolver.java.nolongerInUse} (100%)
rename ccm-cms/src/com/arsdigita/cms/dispatcher/{ItemTemplateResolver.java => ItemTemplateResolver.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/bebop/{BebopMapDispatcher.java => BebopMapDispatcher.java.nolongerInUse} (100%)
delete mode 100755 ccm-core/src/com/arsdigita/core/Initializer.java
delete mode 100755 ccm-core/src/com/arsdigita/core/Loader.java
create mode 100755 ccm-core/src/com/arsdigita/core/libcheck.messages_linux
rename ccm-core/src/com/arsdigita/core/{SampleUpgrade.java => upgrade/SampleUpgrade.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/core/{TroikaRickshawUpgrade.java => upgrade/TroikaRickshawUpgrade.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/core/{TroikaRickshawUpgrade2.java => upgrade/TroikaRickshawUpgrade2.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/lucene/{Adapter.java => Adapter.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/lucene/{LuceneSearch.java => LuceneSearch.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/lucene/{ObjectTypeFilter.java => ObjectTypeFilter.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/lucene/{Registry.java => Registry.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/lucene/{StandardAdapter.java => StandardAdapter.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/lucene/{TypeSpecificFilter.java => TypeSpecificFilter.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/{core => packaging}/BaseCheck.java (74%)
rename ccm-core/src/com/arsdigita/{core/DBCheck.java => packaging/CheckDB.java} (66%)
rename ccm-core/src/com/arsdigita/packaging/{Files.java => Files.java.deprecated} (100%)
rename ccm-core/src/com/arsdigita/{core => packaging}/MessageMap.java (92%)
rename ccm-core/src/com/arsdigita/{core/checks.messages_linux => packaging/basecheck.messages_linux} (100%)
create mode 100755 ccm-core/src/com/arsdigita/packaging/checkdb.messages_linux
create mode 100644 ccm-core/src/com/arsdigita/packaging/package.html
delete mode 100755 ccm-core/src/com/arsdigita/runtime/CCM.java
create mode 100755 ccm-core/src/com/arsdigita/runtime/CCMResourceManager.java
rename ccm-core/src/com/arsdigita/{packaging => runtime}/ConfigRegistry.java (91%)
create mode 100755 ccm-core/src/com/arsdigita/runtime/InteractiveParameterReader.java
rename ccm-core/src/com/arsdigita/{packaging => runtime}/RegistryConfig.java (93%)
rename ccm-core/src/com/arsdigita/runtime/{RuntimeClassLoader.java => RuntimeClassLoader.java.notInUse} (82%)
rename ccm-core/src/com/arsdigita/runtime/{RuntimeConfigLoader.java => RuntimeConfigLoader.java.nolongerInUse} (100%)
create mode 100755 ccm-core/src/com/arsdigita/ui/login/SubsiteResources.properties
create mode 100755 ccm-core/src/com/arsdigita/ui/login/SubsiteResources_de.properties
rename ccm-core/src/com/arsdigita/util/{AliasedClassParameter.java => AliasedClassParameter.java.nolongerInUse} (90%)
rename ccm-core/src/com/arsdigita/util/config/{JavaPropertyLoader.java => JavaPropertyLoader.java.nolongerInUse} (100%)
rename ccm-core/src/com/arsdigita/util/parameter/{ParameterRecord.java => ParameterRecord.java.nolongerInUse} (100%)
create mode 100644 ccm-core/src/com/arsdigita/web/CCMApplicationContextListener.java
diff --git a/ccm-cms/application.xml b/ccm-cms/application.xml
index 56005f928..d8109643f 100755
--- a/ccm-cms/application.xml
+++ b/ccm-cms/application.xml
@@ -2,7 +2,7 @@
diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/AbstractItemResolver.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/AbstractItemResolver.java
index 95822c6d1..3940bd2e9 100755
--- a/ccm-cms/src/com/arsdigita/cms/dispatcher/AbstractItemResolver.java
+++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/AbstractItemResolver.java
@@ -35,7 +35,8 @@ public abstract class AbstractItemResolver implements ItemResolver {
protected static final String TEMPLATE_CONTEXT_PREFIX = "tem_";
/* (non-Javadoc)
- * @see com.arsdigita.cms.dispatcher.ItemResolver#getItem(com.arsdigita.cms.ContentSection, java.lang.String, java.lang.String)
+ * @see com.arsdigita.cms.dispatcher.ItemResolver#getItem(
+ * com.arsdigita.cms.ContentSection, java.lang.String, java.lang.String)
*/
public abstract ContentItem getItem(
ContentSection section,
@@ -43,12 +44,16 @@ public abstract class AbstractItemResolver implements ItemResolver {
String context);
/* (non-Javadoc)
- * @see com.arsdigita.cms.dispatcher.ItemResolver#getCurrentContext(com.arsdigita.bebop.PageState)
+ * @see com.arsdigita.cms.dispatcher.ItemResolver#getCurrentContext(
+ * com.arsdigita.bebop.PageState)
*/
public abstract String getCurrentContext(PageState state);
/* (non-Javadoc)
- * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(com.arsdigita.bebop.PageState, java.math.BigDecimal, java.lang.String, com.arsdigita.cms.ContentSection, java.lang.String)
+ * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(
+ * com.arsdigita.bebop.PageState, java.math.BigDecimal,
+ * java.lang.String, com.arsdigita.cms.ContentSection,
+ * java.lang.String)
*/
public abstract String generateItemURL(
PageState state,
@@ -58,7 +63,12 @@ public abstract class AbstractItemResolver implements ItemResolver {
String context);
/* (non-Javadoc)
- * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(com.arsdigita.bebop.PageState, java.math.BigDecimal, java.lang.String, com.arsdigita.cms.ContentSection, java.lang.String, java.lang.String)
+ * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(
+ * com.arsdigita.bebop.PageState,
+ * java.math.BigDecimal,
+ * java.lang.String,
+ * com.arsdigita.cms.ContentSection,
+ * java.lang.String, java.lang.String)
*/
public abstract String generateItemURL(
PageState state,
@@ -69,7 +79,11 @@ public abstract class AbstractItemResolver implements ItemResolver {
String templateContext);
/* (non-Javadoc)
- * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(com.arsdigita.bebop.PageState, com.arsdigita.cms.ContentItem, com.arsdigita.cms.ContentSection, java.lang.String)
+ * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(
+ * com.arsdigita.bebop.PageState,
+ * com.arsdigita.cms.ContentItem,
+ * com.arsdigita.cms.ContentSection,
+ * java.lang.String)
*/
public abstract String generateItemURL(
PageState state,
@@ -78,7 +92,11 @@ public abstract class AbstractItemResolver implements ItemResolver {
String context);
/* (non-Javadoc)
- * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(com.arsdigita.bebop.PageState, com.arsdigita.cms.ContentItem, com.arsdigita.cms.ContentSection, java.lang.String, java.lang.String)
+ * @see com.arsdigita.cms.dispatcher.ItemResolver#generateItemURL(
+ * com.arsdigita.bebop.PageState,
+ * com.arsdigita.cms.ContentItem,
+ * com.arsdigita.cms.ContentSection,
+ * java.lang.String, java.lang.String)
*/
public abstract String generateItemURL(
PageState state,
@@ -88,9 +106,12 @@ public abstract class AbstractItemResolver implements ItemResolver {
String templateContext);
/* (non-Javadoc)
- * @see com.arsdigita.cms.dispatcher.ItemResolver#getMasterPage(com.arsdigita.cms.ContentItem, javax.servlet.http.HttpServletRequest)
+ * @see com.arsdigita.cms.dispatcher.ItemResolver#getMasterPage(
+ * com.arsdigita.cms.ContentItem,
+ * javax.servlet.http.HttpServletRequest)
*/
- public abstract CMSPage getMasterPage(ContentItem item, HttpServletRequest request) throws ServletException;
+ public abstract CMSPage getMasterPage(ContentItem item, HttpServletRequest request)
+ throws ServletException;
/**
* Finds the template context from the URL and returns it, if it is there.
@@ -115,7 +136,8 @@ public abstract class AbstractItemResolver implements ItemResolver {
templateContext = tokenizer.nextToken();
}
- if (templateContext != null && templateContext.startsWith(TEMPLATE_CONTEXT_PREFIX)) {
+ if (templateContext != null && templateContext.startsWith(
+ TEMPLATE_CONTEXT_PREFIX)) {
return templateContext.substring(TEMPLATE_CONTEXT_PREFIX.length());
} else {
return null;
diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java
index 9d77fb8ba..349f7b937 100755
--- a/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java
+++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java
@@ -105,7 +105,10 @@ import org.apache.log4j.Logger;
*/
public class CMSDispatcher implements Dispatcher, ChainedDispatcher {
- public static final String versionId = "$Id: CMSDispatcher.java 754 2005-09-02 13:26:17Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/17 23:15:09 $";
+ public static final String versionId =
+ "$Id: CMSDispatcher.java 1795 2009-02-07 10:47:32Z pboy $" +
+ " by $Author: pboy $, " +
+ "$DateTime: 2004/08/17 23:15:09 $";
private static Logger s_log =
Logger.getLogger(CMSDispatcher.class);
@@ -385,8 +388,8 @@ public class CMSDispatcher implements Dispatcher, ChainedDispatcher {
}
if ( !sm.canAccess(user, SecurityManager.ADMIN_PAGES ) ) {
throw new AccessDeniedException(
- "You do not have access to the administrative pages for the " +
- section.getName() + " content section.");
+ "You do not have access to the administrative pages for the " +
+ section.getName() + " content section.");
}
} else {
@@ -395,8 +398,8 @@ public class CMSDispatcher implements Dispatcher, ChainedDispatcher {
if ( !sm.canAccess(user, SecurityManager.PUBLIC_PAGES) &&
!LocalRequestPassword.validLocalRequest(request)) {
throw new AccessDeniedException(
- "You do not have access to the public pages for the " +
- section.getName() + " content section.");
+ "You do not have access to the public pages for the " +
+ section.getName() + " content section.");
}
}
}
diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/CategoryItemResolverImpl.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/CategoryItemResolverImpl.java
index 734cac8f3..e4ab01229 100755
--- a/ccm-cms/src/com/arsdigita/cms/dispatcher/CategoryItemResolverImpl.java
+++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/CategoryItemResolverImpl.java
@@ -44,13 +44,13 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
/**
- * Resolves items to URLs and URLs to items with category-based URLs for multiple language
- * variants.
+ * Resolves items to URLs and URLs to items with category-based URLs for
+ * multiple language variants.
*
* Created Mon Jan 20 14:30:03 2003.
*
* @author Scott Seago
- * @version $Id: CategoryItemResolverImpl.java 287 2005-02-22 00:29:02Z sskracic $
+ * @version $Id: CategoryItemResolverImpl.java 1795 2009-02-07 10:47:32Z pboy $
*/
public class CategoryItemResolverImpl extends MultilingualItemResolver
implements CategoryItemResolver, TemplateResolver {
@@ -138,6 +138,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
* #getCurrentContext}.
* @return The content item, or null if no such item exists
*/
+ @Override
public ContentItem getItem(final ContentSection section,
String url,
final String context) {
@@ -146,9 +147,9 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
" at URL '" + url + "' for context " + context);
}
- Assert.assertNotNull(section, "ContentSection section");
- Assert.assertNotNull(url, "String url");
- Assert.assertNotNull(context, "String context");
+ Assert.exists(section, "ContentSection section");
+ Assert.exists(url, "String url");
+ Assert.exists(context, "String context");
url = stripTemplateFromURL(url);
if ( ContentItem.DRAFT.equals(context) ||
@@ -158,7 +159,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
}
String categoryURL = url.substring(("/"+CATEGORIES_PREFIX).length());
Category root = section.getRootCategory();
- Assert.assertNotNull (root);
+ Assert.exists(root);
String file = null;
@@ -191,7 +192,9 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
cats = root.getChildrenByURL (path + "/" + file);
if (cats == null) {
// final element wasn't category. assume an item.
- if (path == "") {
+ // Really object identity? Don't think so.
+ // if (path == "") {
+ if (path.equals("")) {
cats = new Category[1];
cats[0] = root;
} else {
@@ -204,7 +207,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
return null;
}
- Assert.assertTrue (cats.length >= 1);
+ Assert.isTrue (cats.length >= 1);
Category cat = cats[cats.length-1];
s_log.debug ("Category is " + cat.getDisplayName());
String lang = null;
@@ -312,9 +315,9 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
"' in category '" + category + "'");
}
- Assert.assertNotNull(itemId, "BigDecimal itemId");
- Assert.assertNotNull(context, "Sring context");
- Assert.assertNotNull(section, "ContentSection section");
+ Assert.exists(itemId, "BigDecimal itemId");
+ Assert.exists(context, "Sring context");
+ Assert.exists(section, "ContentSection section");
if (ContentItem.DRAFT.equals(context)) {
// No template context here.
@@ -332,11 +335,11 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
.newInstance(new OID(ContentItem.BASE_DATA_OBJECT_TYPE,
itemId));
- if (Assert.isAssertEnabled()) {
- Assert.assertNotNull(item, "item");
- Assert.assertTrue(ContentItem.LIVE.equals(item.getVersion()),
- "Generating " + ContentItem.LIVE + " " +
- "URL; this item must be the live version");
+ if (Assert.isEnabled()) {
+ Assert.exists(item, "item");
+ Assert.isTrue(ContentItem.LIVE.equals(item.getVersion()),
+ "Generating " + ContentItem.LIVE + " " +
+ "URL; this item must be the live version");
}
return generateLiveURL(section, item, templateContext, category);
@@ -392,18 +395,18 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
context + " in category " + category);
}
- Assert.assertNotNull(item, "ContentItem item");
- Assert.assertNotNull(context, "String context");
+ Assert.exists(item, "ContentItem item");
+ Assert.exists(context, "String context");
if (section == null) {
section = item.getContentSection();
}
if (ContentItem.DRAFT.equals(context)) {
- if (Assert.isAssertEnabled()) {
- Assert.assertTrue(ContentItem.DRAFT.equals(item.getVersion()),
- "Generating " + ContentItem.DRAFT +
- " url: item must be draft version");
+ if (Assert.isEnabled()) {
+ Assert.isTrue(ContentItem.DRAFT.equals(item.getVersion()),
+ "Generating " + ContentItem.DRAFT +
+ " url: item must be draft version");
}
// CategoryItemResolver doesn't change resolution of
// back-end URLs
@@ -411,10 +414,10 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
} else if (CMSDispatcher.PREVIEW.equals(context)) {
return generatePreviewURL(section, item, templateContext, category);
} else if (ContentItem.LIVE.equals(context)) {
- if (Assert.isAssertEnabled()) {
- Assert.assertTrue(ContentItem.LIVE.equals(item.getVersion()),
- "Generating " + ContentItem.LIVE +
- " url: item must be live version");
+ if (Assert.isEnabled()) {
+ Assert.isTrue(ContentItem.LIVE.equals(item.getVersion()),
+ "Generating " + ContentItem.LIVE +
+ " url: item must be live version");
}
return generateLiveURL(section, item, templateContext, category);
@@ -436,6 +439,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
* @return The URL of the item
* @see #getCurrentContext
*/
+ @Override
public String generateItemURL(final PageState state,
final BigDecimal itemId,
final String name,
@@ -459,6 +463,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
* @return The URL of the item
* @see #getCurrentContext
*/
+ @Override
public String generateItemURL(final PageState state,
final BigDecimal itemId,
final String name,
@@ -481,6 +486,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
* @return The URL of the item
* @see #getCurrentContext
*/
+ @Override
public String generateItemURL(final PageState state,
final ContentItem item,
final ContentSection section,
@@ -502,6 +508,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
* @return The URL of the item
* @see #getCurrentContext
*/
+ @Override
public String generateItemURL(final PageState state,
final ContentItem item,
ContentSection section,
@@ -638,8 +645,8 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
ContentItem item,
String templateContext,
Category category) {
- Assert.assertNotNull(section, "ContentSection section");
- Assert.assertNotNull(item, "ContentItem item");
+ Assert.exists(section, "ContentSection section");
+ Assert.exists(item, "ContentItem item");
Category urlCategory = getURLCategory(item,category);
// Use passed-in category, if item is in it, else use default
@@ -771,6 +778,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
/**
* Returns the template associated with the item (if any)
*/
+ @Override
protected String getItemTemplate(ContentSection section,
ContentItem item,
HttpServletRequest request) {
@@ -838,6 +846,7 @@ public class CategoryItemResolverImpl extends MultilingualItemResolver
return encodeAsString().equals(obj.encodeAsString());
}
+ @Override
public int hashCode() {
return encodeAsString().hashCode();
}
diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultItemTemplateResolver.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultItemTemplateResolver.java.nolongerInUse
similarity index 100%
rename from ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultItemTemplateResolver.java
rename to ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultItemTemplateResolver.java.nolongerInUse
diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultTemplateResolver.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultTemplateResolver.java
index 872efcef3..a9d03360e 100755
--- a/ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultTemplateResolver.java
+++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/DefaultTemplateResolver.java
@@ -32,9 +32,12 @@ import org.apache.log4j.Logger;
import javax.servlet.http.HttpServletRequest;
/**
+ * ------- May be outdated. TemplateResolver has been reworked. ----------
* Resolves the JSP template to use for dispatching an
* item. This replaces TemplateResolver since the latter
* has a useless API.
+ * ------------------------------------------------------------------------
+ *
* In general, the process for resolving a template involves two
* steps:
*
@@ -58,8 +61,8 @@ import javax.servlet.http.HttpServletRequest;
*
*/
-public class DefaultTemplateResolver extends AbstractTemplateResolver
- implements TemplateResolver {
+public class DefaultTemplateResolver extends AbstractTemplateResolver
+ implements TemplateResolver {
private static Logger s_log = Logger.getLogger(DefaultTemplateResolver.class);
@@ -93,7 +96,7 @@ public class DefaultTemplateResolver extends AbstractTemplateResolver
template = getDefaultTemplate(section, item, request);
- Assert.assertNotNull(template, "default template");
+ Assert.exists(template, "default template");
}
if (s_log.isInfoEnabled()) {
@@ -174,7 +177,8 @@ public class DefaultTemplateResolver extends AbstractTemplateResolver
template = manager.getDefaultTemplate(section, type, context, mimeType);
} else {
if (s_log.isDebugEnabled()) {
- s_log.debug("Item has no content type, not looking for a content type specific template");
+ s_log.debug("Item has no content type, not looking for a " +
+ "content type specific template");
}
}
diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/ItemTemplateResolver.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/ItemTemplateResolver.java.nolongerInUse
similarity index 100%
rename from ccm-cms/src/com/arsdigita/cms/dispatcher/ItemTemplateResolver.java
rename to ccm-cms/src/com/arsdigita/cms/dispatcher/ItemTemplateResolver.java.nolongerInUse
diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/MultilingualItemResolver.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/MultilingualItemResolver.java
index 8cdaf1603..5aac15497 100755
--- a/ccm-cms/src/com/arsdigita/cms/dispatcher/MultilingualItemResolver.java
+++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/MultilingualItemResolver.java
@@ -48,12 +48,12 @@ import java.util.StringTokenizer;
* Created Mon Jan 20 14:30:03 2003.
*
* @author Michael Hanisch
- * @version $Id: MultilingualItemResolver.java 1160 2006-06-13 16:42:30Z apevec $
+ * @version $Id: MultilingualItemResolver.java 1795 2009-02-07 10:47:32Z pboy $
*/
public class MultilingualItemResolver extends AbstractItemResolver implements ItemResolver {
public static final String versionId =
- "$Id: MultilingualItemResolver.java 1160 2006-06-13 16:42:30Z apevec $" +
- "$Author: apevec $" +
+ "$Id: MultilingualItemResolver.java 1795 2009-02-07 10:47:32Z pboy $" +
+ "$Author: pboy $" +
"$DateTime: 2004/08/17 23:15:09 $";
private static final Logger s_log = Logger.getLogger
@@ -98,12 +98,12 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
" at URL '" + url + "' for context " + context);
}
- Assert.assertNotNull(section, "ContentSection section");
- Assert.assertNotNull(url, "String url");
- Assert.assertNotNull(context, "String context");
+ Assert.exists(section, "ContentSection section");
+ Assert.exists(url, "String url");
+ Assert.exists(context, "String context");
Folder rootFolder = section.getRootFolder();
- url = stripTemplateFromURL(url);
+ url = stripTemplateFromURL(url);
// nothing to do, if root folder is null
if (rootFolder == null) {
@@ -164,8 +164,8 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
// and return FIXME: Please hack this if there is
// more graceful solution. [aavetyan]
- if (Assert.isAssertEnabled()) {
- Assert.assertTrue
+ if (Assert.isEnabled()) {
+ Assert.isTrue
(url.indexOf(ITEM_ID) >= 0,
"url must contain parameter " + ITEM_ID);
}
@@ -300,9 +300,9 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
context + "' with name '" + name + "'");
}
- Assert.assertNotNull(itemId, "BigDecimal itemId");
- Assert.assertNotNull(context, "Sring context");
- Assert.assertNotNull(section, "ContentSection section");
+ Assert.exists(itemId, "BigDecimal itemId");
+ Assert.exists(context, "String context");
+ Assert.exists(section, "ContentSection section");
if (ContentItem.DRAFT.equals(context)) {
// No template context here.
@@ -314,9 +314,9 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
} else if (ContentItem.LIVE.equals(context)) {
ContentItem item = new ContentItem(itemId);
- if (Assert.isAssertEnabled()) {
- Assert.assertNotNull(item, "item");
- Assert.assertTrue(ContentItem.LIVE.equals(item.getVersion()),
+ if (Assert.isEnabled()) {
+ Assert.exists(item, "item");
+ Assert.isTrue(ContentItem.LIVE.equals(item.getVersion()),
"Generating " + ContentItem.LIVE + " " +
"URL; this item must be the live version");
}
@@ -370,16 +370,16 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
context);
}
- Assert.assertNotNull(item, "ContentItem item");
- Assert.assertNotNull(context, "String context");
+ Assert.exists(item, "ContentItem item");
+ Assert.exists(context, "String context");
if (section == null) {
section = item.getContentSection();
}
if (ContentItem.DRAFT.equals(context)) {
- if (Assert.isAssertEnabled()) {
- Assert.assertTrue(ContentItem.DRAFT.equals(item.getVersion()),
+ if (Assert.isEnabled()) {
+ Assert.isTrue(ContentItem.DRAFT.equals(item.getVersion()),
"Generating " + ContentItem.DRAFT +
" url: item must be draft version");
}
@@ -388,8 +388,8 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
} else if (CMSDispatcher.PREVIEW.equals(context)) {
return generatePreviewURL(section, item, templateContext);
} else if (ContentItem.LIVE.equals(context)) {
- if (Assert.isAssertEnabled()) {
- Assert.assertTrue(ContentItem.LIVE.equals(item.getVersion()),
+ if (Assert.isEnabled()) {
+ Assert.isTrue(ContentItem.LIVE.equals(item.getVersion()),
"Generating " + ContentItem.LIVE +
" url: item must be live version");
}
@@ -442,10 +442,10 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
" and section " + section);
}
- if (Assert.isAssertEnabled()) {
- Assert.assertTrue(section != null && itemId != null,
- "get draft url: neither secion nor item " +
- "can be null");
+ if (Assert.isEnabled()) {
+ Assert.isTrue(section != null && itemId != null,
+ "get draft url: neither secion nor item " +
+ "can be null");
}
final String url = ContentItemPage.getItemURL
@@ -495,7 +495,7 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
* add template context, if one is given
*/
// This is breaking URL's...not sure why it's here. XXX
- // this should work with the appropriate logic. trying again.
+ // this should work with the appropriate logic. trying again.
if (!(templateContext == null || templateContext.length() == 0)) {
url.append(TEMPLATE_CONTEXT_PREFIX + templateContext + "/");
}
@@ -569,8 +569,8 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
protected String generatePreviewURL(ContentSection section,
ContentItem item,
String templateContext) {
- Assert.assertNotNull(section, "ContentSection section");
- Assert.assertNotNull(item, "ContentItem item");
+ Assert.exists(section, "ContentSection section");
+ Assert.exists(item, "ContentItem item");
final StringBuffer url = new StringBuffer(100);
url.append(section.getPath());
@@ -644,9 +644,9 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
// XXX this is wrong: here we abort on not finding the
// parameter; below we return null.
- if (Assert.isAssertEnabled()) {
- Assert.assertTrue(pos >= 0,
- "Draft URL must contain parameter " + ITEM_ID);
+ if (Assert.isEnabled()) {
+ Assert.isTrue(pos >= 0,
+ "Draft URL must contain parameter " + ITEM_ID);
}
String item_id = url.substring(pos); // item_id == ITEM_ID=.... ?
@@ -720,7 +720,12 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
// will have deal with 'foo' folder.
String name = index > 0 ? url.substring(0, index) : "";
- parentFolder = name != "" ? (Folder) parentFolder.getItem(URLEncoder.encode(name), true) : parentFolder;
+ parentFolder =
+ // really object identity? Don't think so
+ // name != "" ? (Folder) parentFolder.getItem(URLEncoder.encode(name), true)
+ // : parentFolder;
+ name.isEmpty() ? parentFolder
+ : (Folder) parentFolder.getItem(URLEncoder.encode(name), true);
url = index + 1 < len ? url.substring(index + 1) : "";
return getItemFromLiveURL(url, parentFolder);
@@ -833,9 +838,9 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
lang = null; // no extension, so we cannot guess the language
}
- if (Assert.isAssertEnabled()) {
- Assert.assertNotNull(name, "String name");
- Assert.assertTrue(lang == null || lang.length() == 2);
+ if (Assert.isEnabled()) {
+ Assert.exists(name, "String name");
+ Assert.exists(lang == null || lang.length() == 2);
}
if (s_log.isDebugEnabled()) {
diff --git a/ccm-cms/src/com/arsdigita/cms/enterprise.init b/ccm-cms/src/com/arsdigita/cms/enterprise.init
index f19712f7a..ab35a2faf 100755
--- a/ccm-cms/src/com/arsdigita/cms/enterprise.init
+++ b/ccm-cms/src/com/arsdigita/cms/enterprise.init
@@ -22,17 +22,25 @@ init com.arsdigita.cms.publishToFile.Initializer {
// "url stub" }'.
// "Content type" is the object type of the content type.
// "Root directory" must be a path to a writable directory, relative
- // to the file-system root. "Shared storage" must be _true_ if the root
+ // to the file-system root.
+ // (pboy): "Root directory here is relative to application base!
+ // "Shared storage" must be _true_ if the root
// directory is shared NFS storage, _false_ otherwise. "URL stub"
// must be the path component of the URL from which the live server
// will serve from this directory.
destination = {
{ "com.arsdigita.cms.ContentItem",
- "data/p2fs",
+ "p2fs",
false,
"/p2fs" },
- { "com.arsdigita.cms.Template",
- "webapps/ROOT/packages/content-section/templates",
+ // (pboy): starting with webapps refers to the CCM_HOME env variable which
+ // points to the installation root of the servlet container. This is not
+ // used anymore, all specifications are relative to webapplication base.
+ // So the following may have to be changed to "packages/content-section/templates"
+ // if someone tries to use p2fs
+ { "com.arsdigita.cms.Template",
+ // "webapps/ROOT/packages/content-section/templates",
+ "packages/content-section/templates",
false,
"/templates" }
};
diff --git a/ccm-cms/src/com/arsdigita/cms/publishToFile/Initializer.java b/ccm-cms/src/com/arsdigita/cms/publishToFile/Initializer.java
index dea08cb68..ebb97bb20 100755
--- a/ccm-cms/src/com/arsdigita/cms/publishToFile/Initializer.java
+++ b/ccm-cms/src/com/arsdigita/cms/publishToFile/Initializer.java
@@ -33,12 +33,13 @@ import com.arsdigita.persistence.SessionManager;
import com.arsdigita.persistence.TransactionContext;
import com.arsdigita.persistence.metadata.MetadataRoot;
import com.arsdigita.persistence.metadata.ObjectType;
-import com.arsdigita.runtime.CCM;
+import com.arsdigita.runtime.CCMResourceManager;
import org.apache.log4j.Logger;
-import java.io.File;
+import java.io.*;
+// import java.io.File;
import java.util.List;
import java.util.Iterator;
@@ -47,6 +48,9 @@ import java.util.Iterator;
* Initializes the publish-to-file service. The configuration is described in
* the {@link com.arsdigita.cms.publishToFile} page.
*
+ * (pboy) ToDo: Adjusting the initialisation to the new configuration method
+ * without enterprise.init file.
+ *
* @author Jeff Teeters (teeters@arsdigita.com)
* @version $Revision: #24 $ $Date: 2004/08/17 $
*/
@@ -242,6 +246,7 @@ public class Initializer implements com.arsdigita.initializer.Initializer {
}
String contentType = (String)entry.get(0);
+ // destRoot is here relative to webapp root!
String destRoot = (String) entry.get(1);
Boolean sharedRoot = (Boolean) entry.get(2);
String destURL = (String) entry.get(3);
@@ -267,8 +272,11 @@ public class Initializer implements com.arsdigita.initializer.Initializer {
"' must not end with a '/'");
}
- destRoot = new File(System.getProperty("ccm.home"),
+ // Does destRoot really now turns into an absolute fully pathname?!
+ destRoot = new File(CCMResourceManager.getBaseDirectory().getPath(),
destRoot).getPath();
+ s_log.info("Destination Root is set to : " + destRoot);
+
if (sharedRoot == null) {
@@ -299,10 +307,24 @@ public class Initializer implements com.arsdigita.initializer.Initializer {
File file = dest.getFile();
if (!file.exists()) {
file.mkdirs();
+ s_log.info(file.getPath() + " created");
}
boolean writable = false;
+ FileWriter fl;
+ File fname = new File(file.getPath(),"placeholder.txt");
+ s_log.info("Try to create : " + destRoot);
try {
writable = file.canWrite() && file.isDirectory();
+ try {
+ fl = new FileWriter(fname.getPath());
+ fl.write("Location for the p2fs module to store static content. \n");
+ fl.close();
+ } catch ( IOException e ) {
+ // Will be reported as an initalization error
+ s_log.warn("Fehler beim Erstellen der Datei " + fname.getPath());
+ }
+
+
} catch ( SecurityException ex ) {
// Will be reported as an initalization error
}
@@ -310,7 +332,7 @@ public class Initializer implements com.arsdigita.initializer.Initializer {
// HACK: Let's see if we can write to the config directory. If we can,
// then we're running as ccmadmin inside of ccm load, and there is no
// need to thrown an exception.
- File conf = CCM.getConfigDirectory();
+ File conf = CCMResourceManager.getConfigDirectory();
if (conf.isDirectory() && conf.canWrite()) {
// we're ok
} else {
@@ -319,7 +341,8 @@ public class Initializer implements com.arsdigita.initializer.Initializer {
}
}
- if (Template.BASE_DATA_OBJECT_TYPE.equals(contentType) || !ContentSection.getConfig().getDisableItemPfs()) {
+ if (Template.BASE_DATA_OBJECT_TYPE.equals(contentType) ||
+ !ContentSection.getConfig().getDisableItemPfs()) {
PublishToFile.addDestination(contentType,
dest);
}
diff --git a/ccm-cms/src/com/arsdigita/cms/publishToFile/PublishToFile.java b/ccm-cms/src/com/arsdigita/cms/publishToFile/PublishToFile.java
index 9f6035944..27046c536 100755
--- a/ccm-cms/src/com/arsdigita/cms/publishToFile/PublishToFile.java
+++ b/ccm-cms/src/com/arsdigita/cms/publishToFile/PublishToFile.java
@@ -72,6 +72,9 @@ public class PublishToFile implements PublishToFileListener {
private final PublishedHTMLProvider m_provider;
+ /**
+ * Default Constructor
+ */
public PublishToFile() {
m_provider = new HttpHTMLProvider(s_timeout);
}
@@ -357,8 +360,10 @@ public class PublishToFile implements PublishToFileListener {
}
/**
- * Returns an extension given a content type.if the content-type is null assume "html".
- * @param contentType Content-Type returned from the request, e.g. text/html;charset=ISO-8859-1
+ * Returns an extension given a content type. If the content-type is null
+ * assume "html".
+ * @param contentType Content-Type returned from the request,
+ * e.g. text/html;charset=ISO-8859-1
**/
private static String getFileExtension(String contentType) {
if ( contentType == null || contentType == "" )
@@ -371,11 +376,13 @@ public class PublishToFile implements PublishToFileListener {
MimeType type = MimeType.loadMimeType(contentType);
if (type == null) {
- s_log.error("Unknown content type in published item: " + contentType + " assuming extension 'html'");
+ s_log.error("Unknown content type in published item: " +
+ contentType + " assuming extension 'html'");
return ".html";
} else {
if (s_log.isDebugEnabled()) {
- s_log.debug("File extension for " + contentType + " is " + type.getFileExtension());
+ s_log.debug("File extension for " + contentType + " is " +
+ type.getFileExtension());
}
return "." + type.getFileExtension();
}
@@ -383,7 +390,8 @@ public class PublishToFile implements PublishToFileListener {
/***
- * Publish the page that is at url source to the file system and also any streamed assets that it references.
+ * Publish the page that is at url source to the file system and also any
+ * streamed assets that it references.
* @param item ContentItem being published.
* @param where Location Folder, where item will be published
***/
@@ -394,7 +402,8 @@ public class PublishToFile implements PublishToFileListener {
// Read 'public' Template in HTML format and write to FS
// It can be either 'deault' or specified template
- String publicUrl = url + '?' + ContentSectionServlet.MEDIA_TYPE + '=' + TemplateManager.PUBLIC_CONTEXT;
+ String publicUrl = url + '?' + ContentSectionServlet.MEDIA_TYPE + '=' +
+ TemplateManager.PUBLIC_CONTEXT;
if ( !publishPageAtDocRoot(readHTML(publicUrl), where, item, null, host) )
return false;
@@ -470,7 +479,8 @@ public class PublishToFile implements PublishToFileListener {
final String fileExt = getFileExtension(rf.contentType);
final String html = rf.body;
if (s_log.isDebugEnabled()) {
- s_log.debug("content item before getting bundle is " + item.getName() + " with id " + item.getID());
+ s_log.debug("content item before getting bundle is " + item.getName() +
+ " with id " + item.getID());
}
@@ -526,7 +536,8 @@ public class PublishToFile implements PublishToFileListener {
scanner.transform(out);
out.close();
} catch ( IOException ex ) {
- throw new PublishToFileException("Unable to write item " + item + " to filesystem.", ex);
+ throw new PublishToFileException("Unable to write item " + item +
+ " to filesystem.", ex);
}
if (s_log.isDebugEnabled()) {
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/SortableList.java b/ccm-cms/src/com/arsdigita/cms/ui/SortableList.java
index f1e2261e4..7743d76dc 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/SortableList.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/SortableList.java
@@ -49,7 +49,7 @@ import java.io.IOException;
*/
public abstract class SortableList extends List {
- public static final String versionId = "$Id: SortableList.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/17 23:15:09 $";
+ public static final String versionId = "$Id: SortableList.java 1618 2007-09-13 12:14:51Z chrisg23 $ by $Author: chrisg23 $, $DateTime: 2004/08/17 23:15:09 $";
private static final org.apache.log4j.Logger s_log =
org.apache.log4j.Logger.getLogger(SortableList.class);
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAdminPane.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAdminPane.java
index b266b383f..8b7853ed7 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAdminPane.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAdminPane.java
@@ -63,12 +63,12 @@ import org.apache.log4j.Logger;
* A split pane for the Category Administration UI.
*
* @author Justin Ross <jross@redhat.com>
- * @version $Id: CategoryAdminPane.java 287 2005-02-22 00:29:02Z sskracic $
+ * @version $Id: CategoryAdminPane.java 1795 2009-02-07 10:47:32Z pboy $
*/
public final class CategoryAdminPane extends BaseAdminPane {
public static final String versionId =
- "$Id: CategoryAdminPane.java 287 2005-02-22 00:29:02Z sskracic $" +
- "$Author: sskracic $" +
+ "$Id: CategoryAdminPane.java 1795 2009-02-07 10:47:32Z pboy $" +
+ "$Author: pboy $" +
"$DateTime: 2004/08/17 23:15:09 $";
public static final String CONTEXT_SELECTED="sel_context";
@@ -91,6 +91,7 @@ public final class CategoryAdminPane extends BaseAdminPane {
m_contextModel = new UseContextSelectionModel(new StringParameter(CONTEXT_SELECTED));
+
/* Left column */
/* Use context section */
List list = new List(new CategoryUseContextModelBuilder());
@@ -102,6 +103,7 @@ public final class CategoryAdminPane extends BaseAdminPane {
m_categoryTree.addChangeListener(new SelectionListener());
m_model = m_categoryTree.getSelectionModel();
+
setSelectionModel(m_model);
setSelector(m_categoryTree);
@@ -111,8 +113,6 @@ public final class CategoryAdminPane extends BaseAdminPane {
ActionGroup contextGroup = new ActionGroup();
contextSection.setBody(contextGroup);
contextGroup.setSubject(list);
-
- /* Add use context form to pane */
ActionLink addContextAction = new ActionLink(new Label(gz("cms.ui.category.add_use_context")));
Form addContextForm = new AddUseContextForm(m_contextModel);
getBody().add(addContextForm);
@@ -135,10 +135,6 @@ public final class CategoryAdminPane extends BaseAdminPane {
m_parent = new ParentRequestLocal();
m_category = new SelectionRequestLocal();
- /* Right column */
- /* Context section aka category details */
-
- /* Action links */
setAdd(gz("cms.ui.category.add"),
new CategoryAddForm(m_category, m_model));
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryCollectionListModel.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryCollectionListModel.java
index f3765d775..114a35234 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryCollectionListModel.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryCollectionListModel.java
@@ -74,13 +74,12 @@ public final class CategoryCollectionListModel implements ListModel {
}
/**
- * Liest den Namen der Kategorie aus. Angepaßt, damit hier immer
- * der Wert aus Category gelesen wird und nicht die lokalisierte
- * Version. Ist hier sinnvoll, da es Teil der Adminoberfläche für
- * Kategorien ist. Eine lokalisierte Anzeige würde hier nur zu
- * Verwirrung führen.
- *
- * Quasimodo
+ * Reads the name of the category.
+ *
+ * Quasimodo:
+ * Modified to ensure that the value is read from Category (and not the
+ * localized version). This is necessary because we are in the admin GUI,
+ * a localized version would be confusing.
*/
public Object getElement() {
return getCategory().getName("");
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryEditForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryEditForm.java
index 882c179ae..0dd48c7f8 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryEditForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryEditForm.java
@@ -28,6 +28,8 @@ import com.arsdigita.dispatcher.AccessDeniedException;
import org.apache.log4j.Logger;
/**
+ * XXX
+ *
* @author Justin Ross <jross@redhat.com>
* @version $Id: CategoryEditForm.java 287 2005-02-22 00:29:02Z sskracic $
*/
@@ -61,6 +63,10 @@ final class CategoryEditForm extends BaseCategoryForm {
final PageState state = e.getPageState();
final Category category = m_category.getCategory(state);
+ // Quasimodo:
+ // Modified to ensure that the value is read from Category (and not the
+ // localized version). This is necessary because we are in the admin GUI,
+ // a localized version would be confusing.
m_name.setValue(state, category.getName(""));
m_description.setValue(state, category.getDescription(""));
m_url.setValue(state, category.getURL(""));
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java
index a9df661fa..a88433d7f 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java
@@ -71,6 +71,7 @@ import org.apache.log4j.Logger;
* Edits a single category.
*
* @author Justin Ross <jross@redhat.com>
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
* @version $Id: CategoryItemPane.java 1329 2006-09-27 11:47:05Z sskracic $
*/
class CategoryItemPane extends BaseItemPane {
@@ -101,7 +102,8 @@ class CategoryItemPane extends BaseItemPane {
add(m_detailPane);
setDefault(m_detailPane);
- final ActionLink orderItemsLink = new ActionLink(new Label(gz("cms.ui.category.categorized_objects"))) {
+ final ActionLink orderItemsLink = new ActionLink(new Label(
+ gz("cms.ui.category.categorized_objects"))) {
public boolean isVisible(PageState state) {
// update for live items only
if (!super.isVisible(state)) {
@@ -123,23 +125,32 @@ class CategoryItemPane extends BaseItemPane {
add(orderItemsForm2);
// Change index item
- final ActionLink indexLink = new ActionLink(new Label(gz("cms.ui.category.change_index_item")));
+ final ActionLink indexLink = new ActionLink(new Label(gz(
+ "cms.ui.category.change_index_item")));
final Form indexForm = new IndexItemSelectionForm(m_category);
add(indexForm);
- ViewItemLink viewIndexLink = new ViewItemLink(new Label(gz("cms.ui.category.view_index_item")),"");
- EditItemLink editIndexLink = new EditItemLink(new Label(gz("cms.ui.category.edit_index_item")),"");
+ ViewItemLink viewIndexLink = new ViewItemLink(new Label(gz(
+ "cms.ui.category.view_index_item")),"");
+ EditItemLink editIndexLink = new EditItemLink(new Label(gz(
+ "cms.ui.category.edit_index_item")),"");
// Summary
- m_detailPane.add(new SummarySection(editLink, deleteLink, indexLink, viewIndexLink, editIndexLink, orderItemsLink));
+ m_detailPane.add(new SummarySection(editLink, deleteLink, indexLink,
+ viewIndexLink, editIndexLink, orderItemsLink));
// Quasimodo: BEGIN
// Localizations
- ActionLink addCategoryLocalizationLink = new ActionLink(new Label(gz("cms.ui.category.localization.add"))) {
+ ActionLink addCategoryLocalizationLink = new ActionLink(new Label(gz(
+ "cms.ui.category.localization.add"))) {
public boolean isVisible(PageState state) {
// Only show addLanguage button, if there are langauges to add
- int countSupportedLanguages = (new CategorizationConfig()).getSupportedLanguages().countTokens();
- long countLanguages = m_category.getCategory(state).getCategoryLocalizationCollection().size();
+ int countSupportedLanguages = (
+ new CategorizationConfig()).getSupportedLanguages()
+ .countTokens();
+ long countLanguages =
+ m_category.getCategory(state)
+ .getCategoryLocalizationCollection().size();
if(countLanguages < countSupportedLanguages) {
return true;
@@ -149,7 +160,8 @@ class CategoryItemPane extends BaseItemPane {
}
};
- CategoryLocalizationAddForm addCategoryLocalizationForm = new CategoryLocalizationAddForm(m_category);
+ CategoryLocalizationAddForm addCategoryLocalizationForm =
+ new CategoryLocalizationAddForm(m_category);
m_detailPane.add(new CategoryLocalizationSection(addCategoryLocalizationLink));
add(addCategoryLocalizationForm);
connect(addCategoryLocalizationLink, addCategoryLocalizationForm);
@@ -225,8 +237,8 @@ class CategoryItemPane extends BaseItemPane {
}
/*
- * This alternative constructor sets two additional links, allowing the user to view and
- * edit the content index item.
+ * This alternative constructor sets two additional links, allowing
+ * the user to view and edit the content index item.
*/
SummarySection(final ActionLink editLink,
final ActionLink deleteLink,
@@ -373,14 +385,16 @@ class CategoryItemPane extends BaseItemPane {
}
};
- final ActionLink restoreDefault = new ActionLink(new Label(gz("cms.ui.restore_default_permissions"))) {
+ final ActionLink restoreDefault = new ActionLink(new Label(gz(
+ "cms.ui.restore_default_permissions"))) {
public boolean isVisible(PageState ps) {
Category cat = m_category.getCategory(ps);
return PermissionService.getContext(cat) == null;
}
};
- final ActionLink useCustom = new ActionLink(new Label(gz("cms.ui.use_custom_permissions"))) {
+ final ActionLink useCustom = new ActionLink(new Label(gz(
+ "cms.ui.use_custom_permissions"))) {
public boolean isVisible(PageState ps) {
Category cat = m_category.getCategory(ps);
return PermissionService.getContext(cat) != null;
@@ -466,11 +480,13 @@ class CategoryItemPane extends BaseItemPane {
super(c,s);
}
- // Build the preview link. This uses a standard redirect link to find the content.
- // The prepareURL method is called by the printwriter
+ // Build the preview link. This uses a standard redirect link to find
+ // the content. The prepareURL method is called by the printwriter
protected String prepareURL(final PageState state, String location) {
- ContentItem indexItem = ((ContentBundle)(m_category.getCategory(state).getDirectIndexObject())).getPrimaryInstance();
+ ContentItem indexItem = ((ContentBundle)(m_category.getCategory(state)
+ .getDirectIndexObject()))
+ .getPrimaryInstance();
if(indexItem==null) {
return "";
} else {
@@ -496,12 +512,18 @@ class CategoryItemPane extends BaseItemPane {
EditItemLink(Component c, String s) {
super(c,s);
}
-
- // Build the preview link. This is based on code in the ContentSoonExpiredPane class.
- // The prepareURL method of the parent is overwritten. This method is called by the printwriter
+
+ /**
+ * Build the preview link. This is based on code in the
+ * ContentSoonExpiredPane class. The prepareURL method of the parent
+ * is overwritten. This method is called by the printwriter
+ */
+ @Override
protected String prepareURL(final PageState state, String location) {
boolean canEdit = false;
- ContentItem indexItem = ((ContentBundle)(m_category.getCategory(state).getDirectIndexObject())).getPrimaryInstance();
+ ContentItem indexItem = ((ContentBundle)(m_category.getCategory(state)
+ .getDirectIndexObject()))
+ .getPrimaryInstance();
if(indexItem==null) {
return "";
}
@@ -509,12 +531,18 @@ class CategoryItemPane extends BaseItemPane {
return "";
} else {
BigDecimal draftID = indexItem.getDraftVersion().getID();
- return "item.jsp?item_id=" + draftID + "&set_tab=" + ContentItemPage.AUTHORING_TAB;
+ return "item.jsp?item_id=" + draftID + "&set_tab=" +
+ ContentItemPage.AUTHORING_TAB;
}
}
-
- // We only show this link when an index item exists for this category and
- // the user is allowed to edit this item.
+
+ /**
+ * We only show this link when an index item exists for this category
+ * and the user is allowed to edit this item.
+ * @param state
+ * @return
+ */
+ @Override
public boolean isVisible(PageState state) {
if (!super.isVisible(state)) {
return false;
@@ -526,16 +554,26 @@ class CategoryItemPane extends BaseItemPane {
return isItemEditable((ContentItem)indexItem,state);
}
}
-
- // This method checks whether a usern is allowed to edit a particular item
+
+ /**
+ * This method checks whether a usern is allowed to edit a
+ * particular item.
+ *
+ * @param item
+ * @param state
+ * @return
+ */
private boolean isItemEditable(ContentItem item, PageState state) {
BigDecimal id = item.getID();
User user = Web.getContext().getUser();
- ContentItem ci = new ContentItem(new OID(ContentItem.class.getName(), Integer.parseInt(id.toString())));
- Iterator permissions = PermissionService.getImpliedPrivileges(ci.getOID(), user.getOID());
+ ContentItem ci = new ContentItem(new OID(ContentItem.class.getName(),
+ Integer.parseInt(id.toString())));
+ Iterator permissions = PermissionService.getImpliedPrivileges(
+ ci.getOID(), user.getOID());
while (permissions.hasNext()) {
PrivilegeDescriptor permission = (PrivilegeDescriptor)permissions.next();
- if (permission.equals(PrivilegeDescriptor.ADMIN) || permission.equals(PrivilegeDescriptor.EDIT)) {
+ if (permission.equals(PrivilegeDescriptor.ADMIN) ||
+ permission.equals(PrivilegeDescriptor.EDIT)) {
return true;
}
}
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java
index 50a68e80c..bb94a55c9 100644
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationAddForm.java
@@ -1,12 +1,21 @@
/*
- * CategoryLocalizationAddForm.java
+ * Copyright (C) 2008 Sören Bernstein All Rights Reserved.
*
- * Created on 18. April 2008, 12:03
+ * 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
*
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
*/
-
package com.arsdigita.cms.ui.category;
@@ -27,18 +36,19 @@ import java.util.StringTokenizer;
import org.apache.log4j.Logger;
/**
- * Erzeugt ein Formular zum Anlegen einer neuen Lokalisierungen zu der aktuellen Kategorie.
- * Diese Klasse ist Teil der Admin-Oberfläche von APLAWS+ und erweitert die Standardformulare
- * um die Formulare für die Bearbeitung der neuen, mehrsprachigen Kategorien.
+ * Generates a form for creating new localisations for the given category.
*
- * @author quasi
+ * This class is part of the admin GUI of CCM and extends the standard form
+ * in order to present forms for managing the multi-language categories.
+ *
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
*/
public class CategoryLocalizationAddForm extends CategoryLocalizationForm {
public static final String versionId =
- "$Id: CategoryLocalizationAddForm.java 287 2005-02-22 00:29:02Z sskracic $" +
- "$Author: sskracic $" +
- "$DateTime: 2004/08/17 23:15:09 $";
+ "$Id: CategoryLocalizationAddForm.java 287 2005-02-22 00:29:02Z sskracic $" +
+ "$Author: sskracic $" +
+ "$DateTime: 2004/08/17 23:15:09 $";
private static final Logger s_log = Logger.getLogger
(CategoryAddForm.class);
@@ -46,7 +56,8 @@ public class CategoryLocalizationAddForm extends CategoryLocalizationForm {
/** Creates a new instance of CategoryLocalizationAddForm */
public CategoryLocalizationAddForm(final CategoryRequestLocal category) {
- super("AddCategoryLocalization", gz("cms.ui.category.localization.add"), category);
+ super("AddCategoryLocalization",
+ gz("cms.ui.category.localization.add"), category);
addInitListener(new InitListener());
addProcessListener(new ProcessListener());
@@ -66,19 +77,23 @@ public class CategoryLocalizationAddForm extends CategoryLocalizationForm {
final Category category = m_category.getCategory(state);
// Select one entry
- m_locale.addOption(new Option("", new Label((String) GlobalizationUtil.globalize("cms.ui.select_one").localize())), state);
+ m_locale.addOption(new Option("",
+ new Label((String) GlobalizationUtil.globalize(
+ "cms.ui.select_one").localize())), state);
- // Für alle Sprachen, die unterstützt werden (registry-Eintrag)
+ // all supported languages (by registry entry)
CategorizationConfig catConfig = new CategorizationConfig();
StringTokenizer strTok = catConfig.getSupportedLanguages();
while(strTok.hasMoreTokens()) {
String code = strTok.nextToken();
-
- // Wenn die Sprache bereits existiert, dann entferne sie aus der Auswahlliste
- if(!category.getCategoryLocalizationCollection().localizationExists(code)) {
- m_locale.addOption(new Option(code, new Locale(code).getDisplayLanguage()), state);
+
+ // If lanuage exists, remove it from the selection list
+ if(!category.getCategoryLocalizationCollection().
+ localizationExists(code)) {
+ m_locale.addOption(new Option(code,
+ new Locale(code).getDisplayLanguage()), state);
}
}
}
@@ -103,7 +118,8 @@ public class CategoryLocalizationAddForm extends CategoryLocalizationForm {
//Assert.assertNotNull(parent, "Category parent");
if (s_log.isDebugEnabled()) {
- s_log.debug("Adding localization for locale " + locale + " to category " + category);
+ s_log.debug("Adding localization for locale " + locale +
+ " to category " + category);
}
if (category.canEdit()) {
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java
index 016fc0e51..58ce135f6 100644
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java
@@ -1,12 +1,21 @@
/*
- * CategoryLocalizationEditForm.java
+ * Copyright (C) 2008 Sören Bernstein All Rights Reserved.
*
- * Created on 18. April 2008, 12:03
+ * 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
*
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
*/
-
package com.arsdigita.cms.ui.category;
import com.arsdigita.bebop.FormProcessException;
@@ -22,18 +31,19 @@ import java.util.Locale;
import org.apache.log4j.Logger;
/**
- * Erzeugt ein Formular zum Bearbeiten einer vorhandenen Lokalisierungen zu der aktuellen Kategorie.
- * Diese Klasse ist Teil der Admin-Oberfläche von APLAWS+ und erweitert die Standardformulare
- * um die Formulare für die Bearbeitung der neuen, mehrsprachigen Kategorien.
+ * Generates a form for editing an existing localisation for the given category.
*
- * @author quasi
+ * This class is part of the admin GUI of CCM and extends the standard form
+ * in order to present forms for managing the multi-language categories.
+ *
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
*/
public class CategoryLocalizationEditForm extends CategoryLocalizationForm {
public static final String versionId =
- "$Id: CategoryLocalizationEditForm.java 287 2005-02-22 00:29:02Z sskracic $" +
- "$Author: sskracic $" +
- "$DateTime: 2004/08/17 23:15:09 $";
+ "$Id: CategoryLocalizationEditForm.java 287 2005-02-22 00:29:02Z sskracic $" +
+ "$Author: sskracic $" +
+ "$DateTime: 2004/08/17 23:15:09 $";
private static final Logger s_log = Logger.getLogger
(CategoryLocalizationEditForm.class);
@@ -46,7 +56,8 @@ public class CategoryLocalizationEditForm extends CategoryLocalizationForm {
public CategoryLocalizationEditForm(final CategoryRequestLocal category,
final String locale) {
- super("EditCategoryLocalization", gz("cms.ui.category.localization.edit"), category);
+ super("EditCategoryLocalization", gz(
+ "cms.ui.category.localization.edit"), category);
// Speichere Locale ab
m_categoryLocalizationLocale = locale;
@@ -55,7 +66,10 @@ public class CategoryLocalizationEditForm extends CategoryLocalizationForm {
addProcessListener(new ProcessListener());
}
-
+
+ /**
+ * please add: purpose of this class
+ */
private class InitListener implements FormInitListener {
public final void init(final FormSectionEvent e)
throws FormProcessException {
@@ -63,15 +77,18 @@ public class CategoryLocalizationEditForm extends CategoryLocalizationForm {
final PageState state = e.getPageState();
final Category category = m_category.getCategory(state);
- // Verstecke Locale-Widget und sperre es (read-only)
- m_locale.addOption(new Option(m_categoryLocalizationLocale, new Locale(m_categoryLocalizationLocale).getDisplayLanguage()), state);
+ // Hide Locale-Widget and lock it (read-only)
+ m_locale.addOption(new Option(m_categoryLocalizationLocale,
+ new Locale(m_categoryLocalizationLocale).getDisplayLanguage()), state);
// m_locale.setValue(state, m_categoryLocalizationLocale);
// m_locale.setVisible(state, false);
m_locale.lock();
m_name.setValue(state, category.getName((String) m_locale.getValue(state)));
- m_description.setValue(state, category.getDescription((String) m_locale.getValue(state)));
+ m_description.setValue(state, category.getDescription(
+ (String) m_locale.getValue(state)));
m_url.setValue(state, category.getURL((String) m_locale.getValue(state)));
+
if (category.isEnabled((String) m_locale.getValue(state))) {
m_isEnabled.setValue(state, "yes");
} else {
@@ -80,6 +97,9 @@ public class CategoryLocalizationEditForm extends CategoryLocalizationForm {
}
}
+ /**
+ * ##todo: document purpose of this
+ */
private class ProcessListener implements FormProcessListener {
public final void process(final FormSectionEvent e)
throws FormProcessException {
@@ -88,14 +108,20 @@ public class CategoryLocalizationEditForm extends CategoryLocalizationForm {
final Category category = m_category.getCategory(state);
if (s_log.isDebugEnabled()) {
- s_log.debug("Editing localization for locale " + m_locale + " for category " + category);
+ s_log.debug("Editing localization for locale " + m_locale +
+ " for category " + category);
}
if (category.canEdit()) {
- category.setName((String) m_name.getValue(state), (String) m_locale.getValue(state));
- category.setDescription((String) m_description.getValue(state), (String) m_locale.getValue(state));
- category.setURL((String) m_url.getValue(state), (String) m_locale.getValue(state));
- category.setEnabled("yes".equals((String) m_isEnabled.getValue(state)), (String) m_locale.getValue(state));
+ category.setName((String) m_name.getValue(state),
+ (String) m_locale.getValue(state));
+ category.setDescription((String) m_description.getValue(state),
+ (String) m_locale.getValue(state));
+ category.setURL((String) m_url.getValue(state),
+ (String) m_locale.getValue(state));
+ category.setEnabled("yes".equals(
+ (String) m_isEnabled.getValue(state)),
+ (String) m_locale.getValue(state));
category.save();
} else {
throw new AccessDeniedException();
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java
index ba4d66c0a..28c979602 100644
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationForm.java
@@ -1,12 +1,21 @@
/*
- * CategoryLocalizationForm.java
+ * Copyright (C) 2008 Sören Bernstein All Rights Reserved.
*
- * Created on 18. April 2008, 12:04
+ * 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
*
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
*/
-
package com.arsdigita.cms.ui.category;
import com.arsdigita.bebop.FormProcessException;
@@ -34,11 +43,12 @@ import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.xml.Element;
/**
- * Basisklasse für CategoryLocalizationAddForm und CategoryLocalizationEditForm.
- * Diese Klasse ist Teil der Admin-Oberfläche von APLAWS+ und erweitert die Standardformulare
- * um die Formulare für die Bearbeitung der neuen, mehrsprachigen Kategorien.
+ * Base class for CategoryLocalizationAddForm and CategoryLocalizationEditForm.
*
- * @author quasi
+ * This class is part of the admin GUI of CCM and extends the standard form
+ * in order to present forms for managing the multi-language categories.
+ *
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
*/
public class CategoryLocalizationForm extends BaseForm {
@@ -48,7 +58,9 @@ public class CategoryLocalizationForm extends BaseForm {
final TextArea m_description;
final TextField m_url;
final RadioGroup m_isEnabled;
- private Label m_script = new Label("", false);
+ private Label m_script = new Label(
+ "", false);
private final static String LOCALE = "locale";
private final static String NAME = "name";
@@ -56,7 +68,10 @@ public class CategoryLocalizationForm extends BaseForm {
private final static String URL = "url";
private final static String IS_ENABLED = "isEnabled";
- /** Creates a new instance of CategoryLocalizationForm */
+ /**
+ * Creates a new instance of CategoryLocalizationForm.
+ *
+ */
public CategoryLocalizationForm(final String key,
final GlobalizedMessage heading,
final CategoryRequestLocal category) {
@@ -65,7 +80,7 @@ public class CategoryLocalizationForm extends BaseForm {
m_category = category;
- // Parameter-Model für den SingleSelect
+ // Parameter-Model for SingleSelect
ParameterModel localeParam = new StringParameter(LOCALE);
localeParam.addParameterListener(new StringInRangeValidationListener(0, 2));
@@ -145,8 +160,12 @@ public class CategoryLocalizationForm extends BaseForm {
super.generateXML(ps, parent);
}
- // Muß erweitert werden um folgende Funktion: Die Namen müssen eindeutig sein in der
- // gewählten Sprache
+ /**
+ * Purpose:
+ *
+ * XXXToDo: Should be extended with the function:
+ * Names have to be unambiguous in the selected language
+ */
class NameUniqueListener implements ParameterListener {
private final CategoryRequestLocal m_category;
private final Widget m_widget;
@@ -164,8 +183,15 @@ public class CategoryLocalizationForm extends BaseForm {
m_type = type;
}
-
- // XXX Muß noch angepaßt werden
+
+ /**
+ * Purpose:
+ *
+ * XXX provisional, has to be adapted
+ *
+ * @param e
+ * @throws com.arsdigita.bebop.FormProcessException
+ */
public final void validate(final ParameterEvent e)
throws FormProcessException {
final PageState state = e.getPageState();
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java
index e0a6ac90a..25e6c9057 100644
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java
@@ -1,12 +1,21 @@
/*
- * CategortyLocalizationTable.java
+ * Copyright (C) 2008 Sören Bernstein All Rights Reserved.
*
- * Created on 18. April 2008, 12:03
+ * 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
*
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
*/
-
package com.arsdigita.cms.ui.category;
import com.arsdigita.bebop.Component;
@@ -33,11 +42,12 @@ import java.math.BigDecimal;
import java.util.Locale;
/**
- * Listet alle vorhandenen Lokalisierungen zu der aktuellen Kategorie auf. Diese Klasse ist Teil
- * der Admin-Oberfläche von APLAWS+ und erweitert die Standardformulare um die Formulare für die
- * Bearbeitung der neuen, mehrsprachigen Kategorien.
+ * Lists all existing localizations for a selected category.
*
- * @author quasi
+ * This class is part of the admin GUI of CCM and extends the standard form
+ * in order to present forms for managing the multi-language categories.
+ *
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
*/
public class CategoryLocalizationTable extends Table implements TableActionListener {
@@ -58,17 +68,23 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
m_category = category;
m_model = model;
- // Falls die Tabelle leer ist
- setEmptyView(new Label(GlobalizationUtil.globalize("cms.ui.category.localization.none")));
+ // if table is empty:
+ setEmptyView(new Label(GlobalizationUtil.globalize(
+ "cms.ui.category.localization.none")));
TableColumnModel tab_model = getColumnModel();
- // Spalten definieren
- // XXX Globalisieren
- tab_model.add(new TableColumn(0, GlobalizationUtil.globalize("cms.ui.category.localization.locale").localize(), TABLE_COL_LANG));
- tab_model.add(new TableColumn(1, GlobalizationUtil.globalize("cms.ui.category.localization.name").localize()));
- tab_model.add(new TableColumn(2, GlobalizationUtil.globalize("cms.ui.category.localization.description").localize()));
- tab_model.add(new TableColumn(3, GlobalizationUtil.globalize("cms.ui.category.localization.url").localize()));
- tab_model.add(new TableColumn(4, GlobalizationUtil.globalize("cms.ui.category.localization.action").localize(), TABLE_COL_DEL));
+ // define columns
+ // XXX globalize
+ tab_model.add(new TableColumn(0, GlobalizationUtil.globalize(
+ "cms.ui.category.localization.locale").localize(), TABLE_COL_LANG));
+ tab_model.add(new TableColumn(1, GlobalizationUtil.globalize(
+ "cms.ui.category.localization.name").localize()));
+ tab_model.add(new TableColumn(2, GlobalizationUtil.globalize(
+ "cms.ui.category.localization.description").localize()));
+ tab_model.add(new TableColumn(3, GlobalizationUtil.globalize(
+ "cms.ui.category.localization.url").localize()));
+ tab_model.add(new TableColumn(4, GlobalizationUtil.globalize(
+ "cms.ui.category.localization.action").localize(), TABLE_COL_DEL));
setModelBuilder(new CategoryLocalizationTableModelBuilder());
@@ -78,8 +94,13 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
addTableActionListener(this);
}
-
- private class CategoryLocalizationTableModelBuilder extends LockableImpl implements TableModelBuilder {
+
+ /**
+ * XXXX
+ *
+ */
+ private class CategoryLocalizationTableModelBuilder extends LockableImpl
+ implements TableModelBuilder {
public TableModel makeModel(Table table, PageState state) {
final Category category = m_category.getCategory(state);
@@ -91,7 +112,11 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
}
}
}
-
+
+ /**
+ * XXX
+ *
+ */
private class CategoryLocalizationTableModel implements TableModel {
final private int MAX_DESC_LENGTH = 25;
@@ -110,8 +135,10 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
}
/**
- * check collection for the existence of another row.If it has fetch the
- * value of current CategoryLocalization object into m_categoryLocalization class variable.
+ * Check collection for the existence of another row.
+ *
+ * If exists, fetch the value of current CategoryLocalization object
+ * into m_categoryLocalization class variable.
*/
public boolean nextRow() {
@@ -139,7 +166,8 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
return m_categoryLocalization.getName();
case 2:
String desc = m_categoryLocalization.getDescription();
- if(desc != null && desc.length() > MAX_DESC_LENGTH) desc = desc.substring(MAX_DESC_LENGTH - 3).concat("...");
+ if(desc != null && desc.length() > MAX_DESC_LENGTH)
+ desc = desc.substring(MAX_DESC_LENGTH - 3).concat("...");
return desc;
case 3:
return m_categoryLocalization.getURL();
@@ -172,7 +200,8 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
int row, int column) {
SecurityManager sm = Utilities.getSecurityManager(state);
-// CategoryLocalization cl = (CategoryLocalization) m_clSel.getSelectedObject(state);
+// CategoryLocalization cl =
+// (CategoryLocalization) m_clSel.getSelectedObject(state);
// boolean canEdit = sm.canAccess(state.getRequest(),
// SecurityManager.DELETE_ITEM,
@@ -198,7 +227,8 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
int row, int column) {
// SecurityManager sm = Utilities.getSecurityManager(state);
-// CategoryLocalization categoryLocalization = new CategoryLocalization(new BigDecimal(evt.getRowKey().toString()));
+// CategoryLocalization categoryLocalization =
+// new CategoryLocalization(new BigDecimal(evt.getRowKey().toString()));
// boolean canDelete = sm.canAccess(state.getRequest(),
// SecurityManager.DELETE_ITEM,
@@ -206,7 +236,8 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
// if (canDelete) {
if (true) {
ControlLink link = new ControlLink(value.toString());
- link.setConfirmation((String) GlobalizationUtil.globalize("cms.ui.category.localization.confirm_delete").localize());
+ link.setConfirmation((String) GlobalizationUtil.globalize(
+ "cms.ui.category.localization.confirm_delete").localize());
// link.setConfirmation("Delete this localization?");
return link;
} else {
@@ -225,7 +256,8 @@ public class CategoryLocalizationTable extends Table implements TableActionListe
PageState state = evt.getPageState();
// Get selected CategoryLocalization
- CategoryLocalization categoryLocalization = new CategoryLocalization(new BigDecimal(evt.getRowKey().toString()));
+ CategoryLocalization categoryLocalization =
+ new CategoryLocalization(new BigDecimal(evt.getRowKey().toString()));
// Get Category
Category category = m_category.getCategory(state);
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java
index 340a7681a..538d35885 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java
@@ -85,12 +85,12 @@ import com.arsdigita.workflow.simple.WorkflowTemplate;
* @author Michael Pih
* @author Xixi D'moon <xdmoon@redhat.com>
* @author Justin Ross <jross@redhat.com>
- * @version $Id: ItemLifecycleSelectForm.java 1563 2007-04-18 15:58:17Z apevec $
+ * @version $Id: ItemLifecycleSelectForm.java 1643 2007-09-17 14:19:06Z chrisg23 $
*/
class ItemLifecycleSelectForm extends BaseForm {
public static final String versionId =
- "$Id: ItemLifecycleSelectForm.java 1563 2007-04-18 15:58:17Z apevec $" +
- "$Author: apevec $" +
+ "$Id: ItemLifecycleSelectForm.java 1643 2007-09-17 14:19:06Z chrisg23 $" +
+ "$Author: chrisg23 $" +
"$DateTime: $";
private static final Logger s_log = Logger.getLogger
diff --git a/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java b/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java
index 18a781be4..4840d52be 100755
--- a/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java
+++ b/ccm-cms/src/com/arsdigita/cms/workflow/CMSTask.java
@@ -73,7 +73,7 @@ import java.util.Set;
**/
public class CMSTask extends UserTask {
- public static final String versionId = "$Id: CMSTask.java 1583 2007-05-25 15:32:13Z chrisgilbert23 $ by $Author: chrisgilbert23 $, $DateTime: 2004/08/17 23:15:09 $";
+ public static final String versionId = "$Id: CMSTask.java 1637 2007-09-17 10:14:27Z chrisg23 $ by $Author: chrisg23 $, $DateTime: 2004/08/17 23:15:09 $";
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.workflow.CMSTask";
diff --git a/ccm-core/application.xml b/ccm-core/application.xml
index 19ed9ec6c..310be2a36 100755
--- a/ccm-core/application.xml
+++ b/ccm-core/application.xml
@@ -2,7 +2,7 @@
diff --git a/ccm-core/pdl/com/arsdigita/categorization/Category.pdl b/ccm-core/pdl/com/arsdigita/categorization/Category.pdl
index 8252b5966..3e31834a9 100755
--- a/ccm-core/pdl/com/arsdigita/categorization/Category.pdl
+++ b/ccm-core/pdl/com/arsdigita/categorization/Category.pdl
@@ -23,7 +23,7 @@ import com.arsdigita.kernel.*;
object type Category extends ACSObject {
- // Hier werden die Default-Werte gespeichert ???
+ // Default values are stored here ???
String[0..1] description = cat_categories.description VARCHAR(4000);
String[1..1] name = cat_categories.name VARCHAR(200);
String[0..1] url = cat_categories.url VARCHAR(200);
diff --git a/ccm-core/sql/ccm-core/oracle-se-create.sql b/ccm-core/sql/ccm-core/oracle-se-create.sql
index 39f9130fa..d0cf97c6e 100755
--- a/ccm-core/sql/ccm-core/oracle-se-create.sql
+++ b/ccm-core/sql/ccm-core/oracle-se-create.sql
@@ -15,7 +15,7 @@
-- 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-create.sql 725 2005-08-23 16:56:33Z sskracic $
+-- $Id: oracle-se-create.sql 1704 2008-06-08 14:45:43Z pboy $
-- $DateTime: 2004/08/16 18:10:38 $
@@ oracle-se/function-currentDate.sql
diff --git a/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql b/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql
index 93aade6e2..ebb0e9288 100755
--- a/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql
+++ b/ccm-core/sql/ccm-core/oracle-se/messaging/table-messages.sql
@@ -15,7 +15,7 @@
-- 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: table-messages.sql 287 2005-02-22 00:29:02Z sskracic $
+-- $Id: table-messages.sql 1704 2008-06-08 14:45:43Z pboy $
-- $DateTime: 2004/08/16 18:10:38 $
create table messages (
diff --git a/ccm-core/sql/ccm-core/postgres-create.sql b/ccm-core/sql/ccm-core/postgres-create.sql
index 2ec765bd4..32dd81457 100755
--- a/ccm-core/sql/ccm-core/postgres-create.sql
+++ b/ccm-core/sql/ccm-core/postgres-create.sql
@@ -15,7 +15,7 @@
-- 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: postgres-create.sql 725 2005-08-23 16:56:33Z sskracic $
+-- $Id: postgres-create.sql 1704 2008-06-08 14:45:43Z pboy $
-- $DateTime: 2004/08/16 18:10:38 $
begin;
diff --git a/ccm-core/sql/ccm-core/upgrade/postgres-6.5.5-6.5.6.sql b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.5-6.5.6.sql
index 353ae240c..5f671face 100644
--- a/ccm-core/sql/ccm-core/upgrade/postgres-6.5.5-6.5.6.sql
+++ b/ccm-core/sql/ccm-core/upgrade/postgres-6.5.5-6.5.6.sql
@@ -1,5 +1,5 @@
--
--- Copyright (C) 2008 pb@zes.uni-bremen.de All Rights Reserved.
+-- 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
diff --git a/ccm-core/src/ccm-core.checklist b/ccm-core/src/ccm-core.checklist
index cbd13b318..f535ca906 100755
--- a/ccm-core/src/ccm-core.checklist
+++ b/ccm-core/src/ccm-core.checklist
@@ -1,4 +1,9 @@
+
+
diff --git a/ccm-core/src/ccm-core.upgrade b/ccm-core/src/ccm-core.upgrade
index 1e2ef05e0..934c12fdd 100755
--- a/ccm-core/src/ccm-core.upgrade
+++ b/ccm-core/src/ccm-core.upgrade
@@ -3,9 +3,9 @@
-
+
-
+
diff --git a/ccm-core/src/com/arsdigita/bebop/Bebop.java b/ccm-core/src/com/arsdigita/bebop/Bebop.java
index c53248b79..9d8ec7b63 100755
--- a/ccm-core/src/com/arsdigita/bebop/Bebop.java
+++ b/ccm-core/src/com/arsdigita/bebop/Bebop.java
@@ -40,7 +40,10 @@ public final class Bebop {
public static final BebopConfig getConfig() {
if (s_config == null) {
s_config = new BebopConfig();
- s_config.load("ccm-core/bebop.properties");
+ // deprecated, use load() instead, load the default config db,
+ // which is ccm-core /bebop.properties for BebogConfig by definition
+ // s_config.load("ccm-core/bebop.properties");
+ s_config.load();
}
return s_config;
}
diff --git a/ccm-core/src/com/arsdigita/bebop/BebopMapDispatcher.java b/ccm-core/src/com/arsdigita/bebop/BebopMapDispatcher.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/bebop/BebopMapDispatcher.java
rename to ccm-core/src/com/arsdigita/bebop/BebopMapDispatcher.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/bebop/PropertyEditor.java b/ccm-core/src/com/arsdigita/bebop/PropertyEditor.java
index d539cd92e..50fdb3e26 100755
--- a/ccm-core/src/com/arsdigita/bebop/PropertyEditor.java
+++ b/ccm-core/src/com/arsdigita/bebop/PropertyEditor.java
@@ -142,7 +142,7 @@ import java.util.Map;
*/
public class PropertyEditor extends SimpleContainer {
- public static final String versionId = "$Id: PropertyEditor.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId = "$Id: PropertyEditor.java 1638 2007-09-17 11:48:34Z chrisg23 $ by $Author: chrisg23 $, $DateTime: 2004/08/16 18:10:38 $";
private SequentialMap m_forms;
private SequentialMap m_labels;
diff --git a/ccm-core/src/com/arsdigita/bebop/Table.java b/ccm-core/src/com/arsdigita/bebop/Table.java
index 4304040a2..37ae56400 100755
--- a/ccm-core/src/com/arsdigita/bebop/Table.java
+++ b/ccm-core/src/com/arsdigita/bebop/Table.java
@@ -85,12 +85,12 @@ import javax.servlet.ServletException;
* is identified by an integer.
*
* @author David Lutterkort
- * @version $Id: Table.java 287 2005-02-22 00:29:02Z sskracic $
+ * @version $Id: Table.java 1638 2007-09-17 11:48:34Z chrisg23 $
* @see TableModel
* @see TableColumnModel */
public class Table extends BlockStylable implements BebopConstants {
- public static final String versionId = "$Id: Table.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId = "$Id: Table.java 1638 2007-09-17 11:48:34Z chrisg23 $ by $Author: chrisg23 $, $DateTime: 2004/08/16 18:10:38 $";
// Names for HTML Attributes
private static final String WIDTH = "width";
diff --git a/ccm-core/src/com/arsdigita/bebop/demo/AutoDispatcher.java b/ccm-core/src/com/arsdigita/bebop/demo/AutoDispatcher.java
index 482584c29..94e62d953 100755
--- a/ccm-core/src/com/arsdigita/bebop/demo/AutoDispatcher.java
+++ b/ccm-core/src/com/arsdigita/bebop/demo/AutoDispatcher.java
@@ -18,7 +18,7 @@
*/
package com.arsdigita.bebop.demo;
-import com.arsdigita.bebop.BebopMapDispatcher;
+import com.arsdigita.bebop.page.BebopMapDispatcher;
import com.arsdigita.bebop.Link;
import com.arsdigita.bebop.Page;
import com.arsdigita.util.UncheckedWrapperException;
@@ -36,7 +36,10 @@ import org.apache.log4j.Logger;
* */
public class AutoDispatcher extends BebopMapDispatcher {
- public static final String versionId = "$Id: AutoDispatcher.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId =
+ "$Id: AutoDispatcher.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Logger s_log =
Logger.getLogger(AutoDispatcher.class);
diff --git a/ccm-core/src/com/arsdigita/bebop/demo/MinimalDispatcher.java b/ccm-core/src/com/arsdigita/bebop/demo/MinimalDispatcher.java
index 30d9c2fd1..a5bfe6a57 100755
--- a/ccm-core/src/com/arsdigita/bebop/demo/MinimalDispatcher.java
+++ b/ccm-core/src/com/arsdigita/bebop/demo/MinimalDispatcher.java
@@ -18,7 +18,7 @@
*/
package com.arsdigita.bebop.demo;
-import com.arsdigita.bebop.BebopMapDispatcher;
+import com.arsdigita.bebop.page.BebopMapDispatcher;
import com.arsdigita.bebop.Page;
import java.util.HashMap;
@@ -28,7 +28,10 @@ import java.util.HashMap;
*/
public class MinimalDispatcher extends BebopMapDispatcher {
- public static final String versionId = "$Id: MinimalDispatcher.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId =
+ "$Id: MinimalDispatcher.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
/** Constructor. Instantiates the subsite url/page mapping. */
public MinimalDispatcher() {
diff --git a/ccm-core/src/com/arsdigita/bebop/demo/OtherDispatcher.java b/ccm-core/src/com/arsdigita/bebop/demo/OtherDispatcher.java
index cea8f9760..88b3e9599 100755
--- a/ccm-core/src/com/arsdigita/bebop/demo/OtherDispatcher.java
+++ b/ccm-core/src/com/arsdigita/bebop/demo/OtherDispatcher.java
@@ -18,7 +18,7 @@
*/
package com.arsdigita.bebop.demo;
-import com.arsdigita.bebop.BebopMapDispatcher;
+import com.arsdigita.bebop.page.BebopMapDispatcher;
import com.arsdigita.db.ConnectionManager;
import com.arsdigita.dispatcher.Dispatcher;
import com.arsdigita.dispatcher.RequestContext;
@@ -41,7 +41,10 @@ import javax.servlet.http.HttpServletResponse;
*/
public class OtherDispatcher extends BebopMapDispatcher {
- public static final String versionId = "$Id: OtherDispatcher.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId =
+ "$Id: OtherDispatcher.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public OtherDispatcher() {
super();
diff --git a/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java b/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java
index 7287779ba..35d5481c8 100755
--- a/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java
+++ b/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java
@@ -75,12 +75,12 @@ import org.apache.log4j.Logger;
* associated with the package mounted on each site node.
*
* @author Bill Schneider
- * @version $Id: PageTransformer.java 1314 2006-09-06 15:47:44Z apevec $
+ * @version $Id: PageTransformer.java 1655 2007-09-18 11:16:54Z chrisg23 $
*/
public class PageTransformer implements PresentationManager {
public static final String versionId =
- "$Id: PageTransformer.java 1314 2006-09-06 15:47:44Z apevec $" +
- "$Author: apevec $" +
+ "$Id: PageTransformer.java 1655 2007-09-18 11:16:54Z chrisg23 $" +
+ "$Author: chrisg23 $" +
"$DateTime: 2004/08/16 18:10:38 $";
private static final Logger s_log = Logger.getLogger
diff --git a/ccm-core/src/com/arsdigita/bebop/parameters/FileSizeValidationListener.java b/ccm-core/src/com/arsdigita/bebop/parameters/FileSizeValidationListener.java
index 813626727..215fd3351 100755
--- a/ccm-core/src/com/arsdigita/bebop/parameters/FileSizeValidationListener.java
+++ b/ccm-core/src/com/arsdigita/bebop/parameters/FileSizeValidationListener.java
@@ -18,20 +18,21 @@
*/
package com.arsdigita.bebop.parameters;
-import java.awt.Image;
+// pboy: unused imports, to be deleted
+// import java.awt.Image;
import java.io.File;
import javax.servlet.http.HttpServletRequest;
-import javax.swing.ImageIcon;
+// import javax.swing.ImageIcon;
-import org.apache.bcel.generic.INSTANCEOF;
+// import org.apache.bcel.generic.INSTANCEOF;
-import com.arsdigita.bebop.FormProcessException;
-import com.arsdigita.bebop.event.ParameterListener;
+// import com.arsdigita.bebop.FormProcessException;
+// import com.arsdigita.bebop.event.ParameterListener;
import com.arsdigita.bebop.event.ParameterEvent;
import com.arsdigita.dispatcher.MultipartHttpServletRequest;
import com.arsdigita.globalization.GlobalizedMessage;
-import com.arsdigita.util.Assert;
+// import com.arsdigita.util.Assert;
/**
* Verifies that the File is smaller than the specified size in bytes
diff --git a/ccm-core/src/com/arsdigita/bebop/parameters/NotEmptyValidationListener.java b/ccm-core/src/com/arsdigita/bebop/parameters/NotEmptyValidationListener.java
index 0c62fa514..f6e5caeda 100755
--- a/ccm-core/src/com/arsdigita/bebop/parameters/NotEmptyValidationListener.java
+++ b/ccm-core/src/com/arsdigita/bebop/parameters/NotEmptyValidationListener.java
@@ -24,11 +24,10 @@ import com.arsdigita.bebop.event.ParameterEvent;
import com.arsdigita.globalization.GlobalizedMessage;
/**
- * Verifies that the
- * parameter's value is non-empty. A value is considererd non-empty
- * if it exists in the page state, and it contains some data besides
- * whitespace.
- *
+ * Verifies that the parameter's value is non-empty.
+ * A value is considererd non-empty if it exists in the page state,
+ * and it contains some data besides whitespace.
+ *
* @author Karl Goldstein
* @author Uday Mathur
* @author Stas Freidin
@@ -37,7 +36,10 @@ import com.arsdigita.globalization.GlobalizedMessage;
*/
public class NotEmptyValidationListener extends GlobalizedParameterListener {
- public static final String versionId = "$Id: NotEmptyValidationListener.java 1502 2007-03-20 11:38:53Z chrisgilbert23 $ by $Author: chrisgilbert23 $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId =
+ "$Id: NotEmptyValidationListener.java 1502 2007-03-20 11:38:53Z chrisgilbert23 $" +
+ "by $Author: chrisgilbert23 $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public NotEmptyValidationListener(String label) {
setError(new GlobalizedMessage(label, getBundleBaseName()));
diff --git a/ccm-core/src/com/arsdigita/bebop/table/TableHeader.java b/ccm-core/src/com/arsdigita/bebop/table/TableHeader.java
index 3b9dbdc09..b6a36b0b0 100755
--- a/ccm-core/src/com/arsdigita/bebop/table/TableHeader.java
+++ b/ccm-core/src/com/arsdigita/bebop/table/TableHeader.java
@@ -40,11 +40,11 @@ import com.arsdigita.xml.Element;
* of the column headers is clicked.
*
* @author David Lutterkort
- * @version $Id: TableHeader.java 287 2005-02-22 00:29:02Z sskracic $
+ * @version $Id: TableHeader.java 1638 2007-09-17 11:48:34Z chrisg23 $
*/
public class TableHeader extends SimpleComponent {
- public static final String versionId = "$Id: TableHeader.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId = "$Id: TableHeader.java 1638 2007-09-17 11:48:34Z chrisg23 $ by $Author: chrisg23 $, $DateTime: 2004/08/16 18:10:38 $";
/**
* The control event when the user clicks on a column header.
diff --git a/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java b/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java
index bac75912a..a94ae95ea 100644
--- a/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java
+++ b/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java
@@ -1,39 +1,46 @@
/*
- * CategorizationConfig.java
+ * Copyright (C) 2008 Sören Bernstein All Rights Reserved.
*
- * Created on 17. Januar 2008, 15:29
+ * 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
*
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
*/
-
package com.arsdigita.categorization;
-/**
- *
- * @author quasi
- */
-
import com.arsdigita.runtime.AbstractConfig;
-import com.arsdigita.runtime.RuntimeConfig;
-import com.arsdigita.util.Assert;
+// unused imports
+// import com.arsdigita.runtime.RuntimeConfig;
+// import com.arsdigita.util.Assert;
import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.StringParameter;
-import com.arsdigita.util.parameter.ErrorList;
-import com.arsdigita.util.parameter.IntegerParameter;
+// import com.arsdigita.util.parameter.ErrorList;
+// import com.arsdigita.util.parameter.IntegerParameter;
import com.arsdigita.util.parameter.Parameter;
-import com.arsdigita.util.parameter.ParameterError;
+// import com.arsdigita.util.parameter.ParameterError;
import java.util.StringTokenizer;
import org.apache.log4j.Logger;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Set;
-import java.util.HashSet;
+// import java.util.Map;
+// import java.util.HashMap;
+// import java.util.Set;
+// import java.util.HashSet;
/**
- * Stores the configuration record for the Categorization functionality
+ * Stores the configuration record for the Categorization functionality.
+ *
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
*/
public final class CategorizationConfig extends AbstractConfig {
public static final String versionId =
@@ -46,13 +53,28 @@ public final class CategorizationConfig extends AbstractConfig {
private final Parameter m_showInternalName;
private final Parameter m_supportedLanguages;
+ /**
+ * Public Constructor
+ */
public CategorizationConfig() {
+ /**
+ * If set to false for a given category id its label (name) is taken
+ * from the language bundle for the language preference declared by
+ * the browser (of the default, if the requested language is not supported).
+ * If no language bundle exist for that id, the category will be
+ * excluded from the category tree (or navigation tree is used in
+ * navigation).
+ */
m_showInternalName = new BooleanParameter
("waf.categorization.show_internal_name",
Parameter.REQUIRED,
- new Boolean(false));
+ new Boolean(true));
+ /**
+ * String containing the supported languages. The first one is considered
+ * as default.
+ */
m_supportedLanguages = new StringParameter
("waf.categorization.supported_languages",
Parameter.REQUIRED,
diff --git a/ccm-core/src/com/arsdigita/categorization/CategorizationConfig_parameter.properties b/ccm-core/src/com/arsdigita/categorization/CategorizationConfig_parameter.properties
index af8f40e5e..3e674d54e 100644
--- a/ccm-core/src/com/arsdigita/categorization/CategorizationConfig_parameter.properties
+++ b/ccm-core/src/com/arsdigita/categorization/CategorizationConfig_parameter.properties
@@ -1,6 +1,6 @@
-waf.categorization.show_internal_name.title=Activate output of internal keys for categorization
-waf.categorization.show_internal_name.purpose=Activate this setting to output internal keys for categories without the requested locale. This is usually for debugging.
-waf.categorization.show_internal_name.example=false
+waf.categorization.show_internal_name.title=Activate output of internal keys (labels) for categorization.
+waf.categorization.show_internal_name.purpose=Activate it to output internal keys for categories without the requested locale. This is usually for debugging. It is set to true here to preserve backwards compatibility to version 1.0.4 and prior.
+waf.categorization.show_internal_name.example=true
waf.categorization.show_internal_name.format=[boolean]
waf.categorization.supported_languages.title=Set the supported languages for categorization
waf.categorization.supported_languages.purpose=Set the supported languages for categorization. First entry is the default language
diff --git a/ccm-core/src/com/arsdigita/categorization/Category.java b/ccm-core/src/com/arsdigita/categorization/Category.java
index 9051f86aa..ac1b208e6 100755
--- a/ccm-core/src/com/arsdigita/categorization/Category.java
+++ b/ccm-core/src/com/arsdigita/categorization/Category.java
@@ -418,7 +418,6 @@ public class Category extends ACSObject {
return getName(this.getNegotiatedLocale());
}
-
/**
* Returns the display name of the category. This overrides the parent
* implementation.
@@ -729,7 +728,6 @@ public class Category extends ACSObject {
return isEnabled(this.getNegotiatedLocale());
}
-
/**
* Sets whether the category is enabled.
*
diff --git a/ccm-core/src/com/arsdigita/categorization/CategoryLocalization.java b/ccm-core/src/com/arsdigita/categorization/CategoryLocalization.java
index 2713afd89..b234a5c85 100644
--- a/ccm-core/src/com/arsdigita/categorization/CategoryLocalization.java
+++ b/ccm-core/src/com/arsdigita/categorization/CategoryLocalization.java
@@ -1,14 +1,24 @@
/*
- * CategoryLocalization.java
+ * Copyright (C) 2008 Sören Bernstein All Rights Reserved.
*
- * Created on 17. Januar 2008, 14:36
+ * 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
*
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
*/
-
package com.arsdigita.categorization;
+import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.kernel.ACSObject;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID;
@@ -17,7 +27,7 @@ import java.math.BigDecimal;
/**
*
- * @author quasi
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
*/
public class CategoryLocalization extends ACSObject {
diff --git a/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java b/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java
index 450c0b84b..11f3005b3 100644
--- a/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java
+++ b/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java
@@ -1,18 +1,30 @@
/*
- * CategoryLocalizationCollection.java
+ * Copyright (C) 2008 Sören Bernstein All Rights Reserved.
*
- * Created on 19. Januar 2008, 13:24
+ * 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
*
- * Author: Quasimodo
*/
package com.arsdigita.categorization;
import com.arsdigita.kernel.ACSObject;
import com.arsdigita.kernel.ACSObjectCollection;
-import com.arsdigita.persistence.DataAssociation;
+// unused imports
+// import com.arsdigita.persistence.DataAssociation;
import com.arsdigita.persistence.DataCollection;
-import com.arsdigita.persistence.DataObject;
+// import com.arsdigita.persistence.DataObject;
/**
* Represents a collection of categoryLocalizations.
@@ -21,6 +33,7 @@ import com.arsdigita.persistence.DataObject;
* Category} and other classes. See, for example, {@link Category#getChildren()}
* or {@link Category#getDescendants()}.
*
+ * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
* @author Randy Graebner (randyg@alum.mit.edu)
* @version $Revision: #15 $ $DateTime: 2004/08/16 18:10:38 $
**/
@@ -107,7 +120,8 @@ public class CategoryLocalizationCollection extends ACSObjectCollection {
*/
public boolean localizationExists(String locale) {
- //
+ // Really string comparison using != ??
+ // && !locale.isEmpty() ?
if(!m_dataCollection.isEmpty() && locale != "") {
// First check, if we are already at the right position. This will speed up repeated access for the same locale
diff --git a/ccm-core/src/com/arsdigita/core/Initializer.java b/ccm-core/src/com/arsdigita/core/Initializer.java
deleted file mode 100755
index 719879c56..000000000
--- a/ccm-core/src/com/arsdigita/core/Initializer.java
+++ /dev/null
@@ -1,173 +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.core;
-
-import com.arsdigita.auditing.BasicAuditTrail;
-import com.arsdigita.db.DbHelper;
-import com.arsdigita.domain.DomainObject;
-import com.arsdigita.domain.DomainObjectInstantiator;
-import com.arsdigita.kernel.ACSObjectInstantiator;
-import com.arsdigita.loader.CoreLoader;
-import com.arsdigita.persistence.DataObject;
-import com.arsdigita.persistence.Session;
-import com.arsdigita.persistence.SessionManager;
-import com.arsdigita.persistence.TransactionContext;
-import com.arsdigita.persistence.pdl.ManifestSource;
-import com.arsdigita.persistence.pdl.NameFilter;
-import com.arsdigita.runtime.CompoundInitializer;
-import com.arsdigita.runtime.DomainInitEvent;
-import com.arsdigita.runtime.LegacyInitEvent;
-import com.arsdigita.runtime.LegacyInitializer;
-import com.arsdigita.runtime.OptionalLegacyInitializer;
-import com.arsdigita.runtime.PDLInitializer;
-import com.arsdigita.runtime.RuntimeConfig;
-import com.arsdigita.ui.admin.Admin;
-import com.arsdigita.ui.sitemap.SiteMap;
-import com.arsdigita.util.xml.XML;
-import com.arsdigita.web.Host;
-import com.arsdigita.web.WebApp;
-import com.arsdigita.web.ApplicationType;
-import com.arsdigita.workflow.simple.TaskComment;
-import com.arsdigita.search.converter.Converter;
-import com.arsdigita.search.converter.ConverterRegistry;
-import com.arsdigita.search.converter.PDFConverter;
-import com.arsdigita.search.converter.ExcelConverter;
-import com.arsdigita.search.converter.OOConverter;
-import com.arsdigita.search.converter.WordConverter;
-import com.arsdigita.search.converter.TextConverter;
-
-
-/**
- * CoreInitializer
- *
- * @author Rafael H. Schloming <rhs@mit.edu>
- * @version $Revision: #15 $ $Date: 2004/08/16 $
- **/
-
-public class Initializer extends CompoundInitializer {
-
- public final static String versionId = "$Id: Initializer.java 1547 2007-03-29 14:24:57Z chrisgilbert23 $ by $Author: chrisgilbert23 $, $DateTime: 2004/08/16 18:10:38 $";
-
- public Initializer() {
- final String url = RuntimeConfig.getConfig().getJDBCURL();
- final int database = DbHelper.getDatabaseFromURL(url);
-
- add(new com.arsdigita.persistence.Initializer());
-
- add(new PDLInitializer
- (new ManifestSource
- ("ccm-core.pdl.mf",
- new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
-
- add(new LegacyInitializer("com/arsdigita/core/enterprise.init"));
- add(new OptionalLegacyInitializer("enterprise.init"));
- }
-
- public final void init(final DomainInitEvent e) {
- super.init(e);
-
- e.getFactory().registerInstantiator
- (Host.BASE_DATA_OBJECT_TYPE,
- new DomainObjectInstantiator() {
- public DomainObject doNewInstance(DataObject dobj) {
- return new Host(dobj);
- }
- });
-
- e.getFactory().registerInstantiator
- (ApplicationType.BASE_DATA_OBJECT_TYPE,
- new DomainObjectInstantiator() {
- public DomainObject doNewInstance(DataObject dobj) {
- return new ApplicationType(dobj);
- }
- });
-
- e.getFactory().registerInstantiator
- (WebApp.BASE_DATA_OBJECT_TYPE,
- new DomainObjectInstantiator() {
- public DomainObject doNewInstance(final DataObject data) {
- return new WebApp(data);
- }
- });
-
- e.getFactory().registerInstantiator
- (TaskComment.BASE_DATA_OBJECT_TYPE,
- new DomainObjectInstantiator() {
- public DomainObject doNewInstance(final DataObject data) {
- return new TaskComment(data);
- }
- });
-
- e.getFactory().registerInstantiator
- (Admin.BASE_DATA_OBJECT_TYPE,
- new ACSObjectInstantiator() {
- public DomainObject doNewInstance(final DataObject data) {
- return new Admin(data);
- }
- });
-
- e.getFactory().registerInstantiator
- (SiteMap.BASE_DATA_OBJECT_TYPE,
- new ACSObjectInstantiator() {
- public DomainObject doNewInstance(final DataObject data) {
- return new SiteMap(data);
- }
- });
-
- e.getFactory().registerInstantiator
- (BasicAuditTrail.BASE_DATA_OBJECT_TYPE,
- new DomainObjectInstantiator() {
- public DomainObject doNewInstance(final DataObject data) {
- return new BasicAuditTrail(data);
- }
- });
- // register the document converters
- Converter converter = new PDFConverter();
- ConverterRegistry.registerConverter(converter,
- converter.getMimeTypes());
-
- converter = new ExcelConverter();
- ConverterRegistry.registerConverter(converter,
- converter.getMimeTypes());
-
- converter = new WordConverter();
- ConverterRegistry.registerConverter(converter,
- converter.getMimeTypes());
-
- converter = new OOConverter();
- ConverterRegistry.registerConverter(converter,
- converter.getMimeTypes());
-
- converter = new TextConverter();
- ConverterRegistry.registerConverter(converter,
- converter.getMimeTypes());
- }
-
- public final void init(final LegacyInitEvent e) {
- super.init(e);
-
- Session session = SessionManager.getSession();
- TransactionContext txn = session.getTransactionContext();
- txn.beginTxn();
- CoreLoader.loadHost();
- txn.commitTxn();
-
- XML.setupFactories();
- }
-}
diff --git a/ccm-core/src/com/arsdigita/core/LibCheck.java b/ccm-core/src/com/arsdigita/core/LibCheck.java
index d07b42ed5..c65bfbcc1 100755
--- a/ccm-core/src/com/arsdigita/core/LibCheck.java
+++ b/ccm-core/src/com/arsdigita/core/LibCheck.java
@@ -18,18 +18,38 @@
*/
package com.arsdigita.core;
+import com.arsdigita.packaging.BaseCheck;
import com.arsdigita.runtime.ScriptContext;
+import com.arsdigita.util.Assert;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
/**
- * LibCheck
+ * LibCheck uses the checklist mechanism to perform additional checks for
+ * libraries specifically required by ccm-core.
+ * (@see com.arsdigita.packaging.Check.java)
+ * The check is activated during initial setup by the file /ccm-core.checklist!
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #5 $ $Date: 2004/08/16 $
- **/
+ */
public class LibCheck extends BaseCheck {
- public final static String versionId = "$Id: LibCheck.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: LibCheck.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
+
+ // Integrating the packaging.MessageMap service class providing a
+ // package specific message file by overriding the variable in BaseCheck.
+ static {
+ final InputStream in = LibCheck.class.getResourceAsStream
+ ("libcheck.messages_linux");
+ Assert.exists(in, InputStream.class);
+ s_messages.load(new InputStreamReader(in));
+ }
private boolean checkJAAS() {
final String classname = "javax.security.auth.Policy";
diff --git a/ccm-core/src/com/arsdigita/core/Loader.java b/ccm-core/src/com/arsdigita/core/Loader.java
deleted file mode 100755
index 3149b6773..000000000
--- a/ccm-core/src/com/arsdigita/core/Loader.java
+++ /dev/null
@@ -1,25 +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.core;
-
-import com.arsdigita.loader.CoreLoader;
-
-public final class Loader extends CoreLoader {
- // Empty
-}
diff --git a/ccm-core/src/com/arsdigita/core/enterprise.init b/ccm-core/src/com/arsdigita/core/enterprise.init
index 58d836e97..eff8394d5 100755
--- a/ccm-core/src/com/arsdigita/core/enterprise.init
+++ b/ccm-core/src/com/arsdigita/core/enterprise.init
@@ -1,4 +1,4 @@
-init com.arsdigita.versioning.Initializer { }
+// init com.arsdigita.versioning.Initializer { }
init com.arsdigita.globalization.Initializer {
// See http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc
@@ -40,8 +40,9 @@ init com.arsdigita.kernel.security.Initializer {
}
-init com.arsdigita.search.Initializer {}
+// init com.arsdigita.search.Initializer {}
+// As of version 6.5.x still in use!
init com.arsdigita.search.intermedia.Initializer {
timerDelay = 60; // Parameters for search timer/indexing
syncDelay = 60; // All units are time in seconds
@@ -50,8 +51,9 @@ init com.arsdigita.search.intermedia.Initializer {
indexingRetryDelay = 60;
}
-init com.arsdigita.search.lucene.Initializer {}
+// init com.arsdigita.search.lucene.Initializer {}
+// As of version 6.5.x still in use!
init com.arsdigita.notification.Initializer {
RequestManagerDelay = 900; // in seconds
RequestManagerPeriod = 900; // in seconds
diff --git a/ccm-core/src/com/arsdigita/core/libcheck.messages_linux b/ccm-core/src/com/arsdigita/core/libcheck.messages_linux
new file mode 100755
index 000000000..158d7731f
--- /dev/null
+++ b/ccm-core/src/com/arsdigita/core/libcheck.messages_linux
@@ -0,0 +1,43 @@
+[security_jars]
+Users of Java 1.3.x must place the following jars from the CCM tools
+RPM in the system classpath:
+
+ $CCM_TOOLS_HOME/lib/security/local_policy.jar
+ $CCM_TOOLS_HOME/lib/security/jce.jar
+ $CCM_TOOLS_HOME/lib/security/US_export_policy.jar
+ $CCM_TOOLS_HOME/lib/security/jaas.jar
+ $CCM_TOOLS_HOME/lib/security/sunjce_provider.jar
+
+Add symbolic links to these files to the /usr/local/share/java
+directory or add them directly to the CLASSPATH environment variable.
+
+[jaas_found]
+CHECK: JAAS is available
+
+[jaas_not_found]
+WARNING: JAAS not found
+
+JAAS is the Java Authentication and Authorization Service and is
+required for CCM authentication. Check your classpath.
+
+[jce_found]
+CHECK: JCE is available
+
+[jce_not_found]
+WARNING: JCE not found
+
+JCE is the Java Cryptography Extension and is required for CCM
+authentication. Check your classpath.
+
+[classpath]
+The classpath of the CCM runtime includes
+
+ * jar files in JAVA_HOME/jre/lib/ext
+
+ * jars, zips, or class files under one of the paths listed in
+ CCM_HOME/ccm.classpath if it exists or /etc/ccm/ccm.classpath
+ otherwise
+
+ * the CLASSPATH environment variable.
+
+
diff --git a/ccm-core/src/com/arsdigita/core/SampleUpgrade.java b/ccm-core/src/com/arsdigita/core/upgrade/SampleUpgrade.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/core/SampleUpgrade.java
rename to ccm-core/src/com/arsdigita/core/upgrade/SampleUpgrade.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/core/TroikaRickshawUpgrade.java b/ccm-core/src/com/arsdigita/core/upgrade/TroikaRickshawUpgrade.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/core/TroikaRickshawUpgrade.java
rename to ccm-core/src/com/arsdigita/core/upgrade/TroikaRickshawUpgrade.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/core/TroikaRickshawUpgrade2.java b/ccm-core/src/com/arsdigita/core/upgrade/TroikaRickshawUpgrade2.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/core/TroikaRickshawUpgrade2.java
rename to ccm-core/src/com/arsdigita/core/upgrade/TroikaRickshawUpgrade2.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/initializer/Script.java b/ccm-core/src/com/arsdigita/initializer/Script.java
index 2d957099b..52dd0add8 100755
--- a/ccm-core/src/com/arsdigita/initializer/Script.java
+++ b/ccm-core/src/com/arsdigita/initializer/Script.java
@@ -41,7 +41,10 @@ import java.util.Set;
public class Script {
- public final static String versionId = "$Id: Script.java 738 2005-09-01 12:36:52Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Script.java 738 2005-09-01 12:36:52Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Logger s_log =
Logger.getLogger(Script.class);
diff --git a/ccm-core/src/com/arsdigita/kernel/Kernel.java b/ccm-core/src/com/arsdigita/kernel/Kernel.java
index df025ce8f..fa18decf3 100755
--- a/ccm-core/src/com/arsdigita/kernel/Kernel.java
+++ b/ccm-core/src/com/arsdigita/kernel/Kernel.java
@@ -70,8 +70,12 @@ public class Kernel {
s_securityConfig = new SecurityConfig();
s_initialContext.setLocale(Locale.getDefault());
- s_config.load("ccm-core/kernel.properties");
- s_securityConfig.load("ccm-core/security.properties");
+ // deprecated, use load() instead which loads ccm-core/kernel.properties
+ // by default for KernelConfig / SecurityConfig
+ // s_config.load("ccm-core/kernel.properties");
+ s_config.load();
+ // s_securityConfig.load("ccm-core/security.properties");
+ s_securityConfig.load();
s_context = new ThreadLocal() {
public Object initialValue() {
return s_initialContext;
diff --git a/ccm-core/src/com/arsdigita/kernel/security/SecurityConfig.java b/ccm-core/src/com/arsdigita/kernel/security/SecurityConfig.java
index 0c4941869..d83cc67d7 100755
--- a/ccm-core/src/com/arsdigita/kernel/security/SecurityConfig.java
+++ b/ccm-core/src/com/arsdigita/kernel/security/SecurityConfig.java
@@ -87,6 +87,9 @@ public class SecurityConfig extends AbstractConfig {
private final Parameter m_userBanOn = new BooleanParameter
("waf.user_ban_on", Parameter.REQUIRED, Boolean.FALSE);
+ /**
+ * Constructs an empty SecurityConfig object
+ */
public SecurityConfig() {
register(m_rootPage);
register(m_loginPage);
diff --git a/ccm-core/src/com/arsdigita/kernel/security/UserContext.java b/ccm-core/src/com/arsdigita/kernel/security/UserContext.java
index edbbb512c..2b1cf7b59 100755
--- a/ccm-core/src/com/arsdigita/kernel/security/UserContext.java
+++ b/ccm-core/src/com/arsdigita/kernel/security/UserContext.java
@@ -23,15 +23,15 @@ import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.dispatcher.RedirectException;
import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.kernel.Kernel;
-import com.arsdigita.kernel.KernelHelper;
+// import com.arsdigita.kernel.KernelHelper;
import com.arsdigita.kernel.User;
import com.arsdigita.kernel.UserAuthentication;
import com.arsdigita.kernel.permissions.PermissionDescriptor;
import com.arsdigita.kernel.permissions.PermissionService;
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
-import com.arsdigita.kernel.security.HTTPRequestCallback;
-import com.arsdigita.kernel.security.HTTPResponseCallback;
-import com.arsdigita.kernel.security.LifetimeCallback;
+// import com.arsdigita.kernel.security.HTTPRequestCallback;
+// import com.arsdigita.kernel.security.HTTPResponseCallback;
+// import com.arsdigita.kernel.security.LifetimeCallback;
import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.web.LoginSignal;
import com.arsdigita.web.Web;
diff --git a/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java b/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java
index 5002fbdd9..0429618be 100755
--- a/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java
+++ b/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java
@@ -18,20 +18,29 @@
*/
package com.arsdigita.loader;
+import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.parameter.Parameter;
-import com.arsdigita.util.parameter.ParameterRecord;
+// deprecated: import com.arsdigita.util.parameter.ParameterRecord;
+// replaced by c.ad.rt.AbstractConfig, should be deleted after testing
import com.arsdigita.util.parameter.StringParameter;
+import org.apache.log4j.Logger;
/**
* MimeTypeRow
+ * A configuration record for MimeTypes
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #5 $ $Date: 2004/08/16 $
**/
-class MimeTypeRow extends ParameterRecord {
+class MimeTypeRow extends AbstractConfig {
- public final static String versionId = "$Id: MimeTypeRow.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: MimeTypeRow.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
+
+ private static final Logger s_log = Logger.getLogger(MimeTypeRow.class);
private StringParameter m_type = new StringParameter
("waf.mime.type", Parameter.REQUIRED, null);
@@ -49,7 +58,7 @@ class MimeTypeRow extends ParameterRecord {
("waf.mime.sizer_or_inso", Parameter.OPTIONAL, null);
public MimeTypeRow() {
- super("mime-type-row");
+ // super();
register(m_type);
register(m_label);
register(m_extensions);
diff --git a/ccm-core/src/com/arsdigita/loader/PackageLoader.java b/ccm-core/src/com/arsdigita/loader/PackageLoader.java
index 9250a4b29..317c4fc8d 100755
--- a/ccm-core/src/com/arsdigita/loader/PackageLoader.java
+++ b/ccm-core/src/com/arsdigita/loader/PackageLoader.java
@@ -22,11 +22,21 @@ import com.arsdigita.installer.SQLLoader;
import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.Session;
import com.arsdigita.runtime.AbstractScript;
-import com.arsdigita.runtime.InteractiveParameterLoader;
+// pboy (Jan.09):
+// deprecated without recommended replacement
+// created Interactive ParameterReader as a replacement
+// import com.arsdigita.runtime.InteractiveParameterLoader;
+import com.arsdigita.runtime.InteractiveParameterReader;
import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.util.config.JavaPropertyLoader;
-import com.arsdigita.util.parameter.CompoundParameterLoader;
-import com.arsdigita.util.parameter.ParameterLoader;
+// deprecated, use c.ad.util.JavaPropertyReader instead
+// import com.arsdigita.util.config.JavaPropertyLoader;
+import com.arsdigita.util.JavaPropertyReader;
+// deprecated, use c.ad.util.parameter.CompoundParameterReader instead
+// import com.arsdigita.util.parameter.CompoundParameterLoader;
+import com.arsdigita.util.parameter.CompoundParameterReader;
+// deprecated, use c.ad.util.parameter.ParameterReader instead
+// import com.arsdigita.util.parameter.ParameterLoader;
+import com.arsdigita.util.parameter.ParameterReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -54,7 +64,10 @@ public abstract class PackageLoader extends AbstractScript {
public final static Logger s_log = Logger.getLogger(PackageLoader.class);
- public final static String versionId = "$Id: PackageLoader.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: PackageLoader.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public static boolean exists(Connection conn, String table) {
try {
@@ -118,10 +131,23 @@ public abstract class PackageLoader extends AbstractScript {
s_log.info("Loading: Done");
}
- public static ParameterLoader loader(String[] args) {
- CompoundParameterLoader result = new CompoundParameterLoader();
- result.add(new JavaPropertyLoader(props(args)));
- result.add(new InteractiveParameterLoader(System.in, System.out));
+ /**
+ *
+ * @param args
+ * @return
+ * //@deprecated use reader() instead
+ * but seems not to be used by any module
+ */
+ //public static ParameterLoader loader(String[] args) {
+ // return ( this.reader(args) );
+ // return null;
+ // }
+
+
+ public static ParameterReader reader(String[] args) {
+ CompoundParameterReader result = new CompoundParameterReader();
+ result.add(new JavaPropertyReader(props(args)));
+ result.add(new InteractiveParameterReader(System.in, System.out));
return result;
}
diff --git a/ccm-core/src/com/arsdigita/lucene/Adapter.java b/ccm-core/src/com/arsdigita/lucene/Adapter.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/lucene/Adapter.java
rename to ccm-core/src/com/arsdigita/lucene/Adapter.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/lucene/LuceneSearch.java b/ccm-core/src/com/arsdigita/lucene/LuceneSearch.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/lucene/LuceneSearch.java
rename to ccm-core/src/com/arsdigita/lucene/LuceneSearch.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/lucene/ObjectTypeFilter.java b/ccm-core/src/com/arsdigita/lucene/ObjectTypeFilter.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/lucene/ObjectTypeFilter.java
rename to ccm-core/src/com/arsdigita/lucene/ObjectTypeFilter.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/lucene/Registry.java b/ccm-core/src/com/arsdigita/lucene/Registry.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/lucene/Registry.java
rename to ccm-core/src/com/arsdigita/lucene/Registry.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/lucene/StandardAdapter.java b/ccm-core/src/com/arsdigita/lucene/StandardAdapter.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/lucene/StandardAdapter.java
rename to ccm-core/src/com/arsdigita/lucene/StandardAdapter.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/lucene/TypeSpecificFilter.java b/ccm-core/src/com/arsdigita/lucene/TypeSpecificFilter.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/lucene/TypeSpecificFilter.java
rename to ccm-core/src/com/arsdigita/lucene/TypeSpecificFilter.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/notification/Notification.java b/ccm-core/src/com/arsdigita/notification/Notification.java
index 34083d8a6..78b1962de 100755
--- a/ccm-core/src/com/arsdigita/notification/Notification.java
+++ b/ccm-core/src/com/arsdigita/notification/Notification.java
@@ -79,7 +79,7 @@ import java.util.Date;
*
* @author Ron Henderson
* @author David Dao
- * @version $Id: Notification.java 287 2005-02-22 00:29:02Z sskracic $ */
+ * @version $Id: Notification.java 1641 2007-09-17 13:46:27Z chrisg23 $ */
public class Notification extends ACSObject implements NotificationConstants {
// Base DataObject type
diff --git a/ccm-core/src/com/arsdigita/core/BaseCheck.java b/ccm-core/src/com/arsdigita/packaging/BaseCheck.java
similarity index 74%
rename from ccm-core/src/com/arsdigita/core/BaseCheck.java
rename to ccm-core/src/com/arsdigita/packaging/BaseCheck.java
index 0e5d31b82..374314411 100755
--- a/ccm-core/src/com/arsdigita/core/BaseCheck.java
+++ b/ccm-core/src/com/arsdigita/packaging/BaseCheck.java
@@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.core;
+package com.arsdigita.packaging;
-import com.arsdigita.packaging.Check;
+// import com.arsdigita.packaging.Check;
import com.arsdigita.util.Assert;
import com.arsdigita.util.UncheckedWrapperException;
import java.io.IOException;
@@ -32,38 +32,51 @@ import java.util.Iterator;
import java.util.List;
/**
- * BaseCheck
+ * BaseCheck: Extension of the Check abstract class, which can be used as a
+ * starting point by packages which have to perform additional checks during
+ * the installation step. (@see Checklist machinery)
+ *
+ * Provides some methods to print out classes and classnames, which can be
+ * used in the run() method of derived classes.
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #4 $ $Date: 2004/08/16 $
- **/
+ */
-abstract class BaseCheck extends Check {
+abstract public class BaseCheck extends Check {
- public final static String versionId = "$Id: BaseCheck.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public static final String versionId =
+ "$Id: BaseCheck.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
- private static final MessageMap s_messages = new MessageMap();
+ public static final MessageMap s_messages = new MessageMap();
static {
final InputStream in = BaseCheck.class.getResourceAsStream
- ("checks.messages_linux");
+ ("basecheck.messages_linux");
Assert.exists(in, InputStream.class);
s_messages.load(new InputStreamReader(in));
}
- static String message(final String key) {
+ public static String message(final String key) {
Assert.exists(key, String.class);
return s_messages.get(key);
}
- PrintStream m_out = System.out;
+ public PrintStream m_out = System.out;
ClassLoader m_loader =
Thread.currentThread().getContextClassLoader();
boolean m_verbose = false;
+ /**
+ * Prints the ...
+ *
+ * @param classname
+ */
void printClassLocations(final String classname) {
final Iterator urls = getClassURLs(classname).iterator();
@@ -84,10 +97,20 @@ abstract class BaseCheck extends Check {
}
}
+ /**
+ *
+ * @param classname
+ * @return
+ */
List getClassURLs(final String classname) {
return getResourceURLs(classname.replace('.', '/') + ".class");
}
+ /**
+ *
+ * @param resource
+ * @return
+ */
List getResourceURLs(final String resource) {
final ArrayList list = new ArrayList();
@@ -104,7 +127,12 @@ abstract class BaseCheck extends Check {
return list;
}
- boolean isClassFound(final String classname) {
+ /**
+ *
+ * @param classname
+ * @return
+ */
+ public boolean isClassFound(final String classname) {
if (m_verbose) {
m_out.println("Looking for class " + classname);
}
@@ -125,7 +153,11 @@ abstract class BaseCheck extends Check {
}
}
- void checkDuplicates(final String classname) {
+ /**
+ *
+ * @param classname
+ */
+ public void checkDuplicates(final String classname) {
if (m_verbose) {
m_out.println("Checking for duplicates of " + classname);
}
diff --git a/ccm-core/src/com/arsdigita/packaging/Check.java b/ccm-core/src/com/arsdigita/packaging/Check.java
index 4be70564c..bfb8df9d3 100755
--- a/ccm-core/src/com/arsdigita/packaging/Check.java
+++ b/ccm-core/src/com/arsdigita/packaging/Check.java
@@ -69,7 +69,10 @@ import com.arsdigita.runtime.AbstractScript;
public abstract class Check extends AbstractScript {
- public final static String versionId = "$Id: Check.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Check.java 736 2005-09-01 10:46:05Z sskracic $" +
+ "by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public static final class Status {
@@ -79,6 +82,7 @@ public abstract class Check extends AbstractScript {
m_name = name;
}
+ @Override
public String toString() {
return m_name;
}
diff --git a/ccm-core/src/com/arsdigita/core/DBCheck.java b/ccm-core/src/com/arsdigita/packaging/CheckDB.java
similarity index 66%
rename from ccm-core/src/com/arsdigita/core/DBCheck.java
rename to ccm-core/src/com/arsdigita/packaging/CheckDB.java
index 9f6f82c1c..4b7ea1ce4 100755
--- a/ccm-core/src/com/arsdigita/core/DBCheck.java
+++ b/ccm-core/src/com/arsdigita/packaging/CheckDB.java
@@ -16,26 +16,55 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.core;
+package com.arsdigita.packaging;
import com.arsdigita.db.DbHelper;
-import com.arsdigita.packaging.ConfigRegistry;
+import com.arsdigita.runtime.ConfigRegistry;
import com.arsdigita.runtime.RuntimeConfig;
import com.arsdigita.runtime.ScriptContext;
import com.arsdigita.util.jdbc.Connections;
+import com.arsdigita.util.Assert;
import java.sql.Connection;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+
/**
- * DBCheck
+ * CheckDB
+ * helper class for the load command worker class Load, checks for
+ * existence of a database and verifies accessibility
+ *
+ * Subject to change!
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #7 $ $Date: 2004/08/16 $
- **/
+ */
-public class DBCheck extends BaseCheck {
+public class CheckDB extends BaseCheck {
- public final static String versionId = "$Id: DBCheck.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: DBCheck.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
+ // Integration of service class packaging.MessageMap.
+ // Specifies a package specific message file overriding BaseCheck
+ static {
+ final InputStream in = CheckDB.class.getResourceAsStream
+ ("checkdb.messages_linux");
+ Assert.exists(in, InputStream.class);
+ s_messages.load(new InputStreamReader(in));
+ }
+
+
+ /**
+ * Checks the classpath for the Oracle JDBC driver. The driver is no
+ * longer included in the CCM distribution but must be achieved and
+ * installed separately.
+ *
+ * @return true if driver is in the classpath
+ */
private boolean checkOracleJDBC() {
final String classname = "oracle.jdbc.driver.OracleDriver";
@@ -52,6 +81,27 @@ public class DBCheck extends BaseCheck {
}
}
+ /**
+ * Checks the classpath for the PostgreSQL JDBC driver. The driver is no
+ * longer included in the CCM distribution,too, but must be achieved and
+ * installed separately.
+ *
+ * @ToDo: An equivalent method for postgres. The driver in not
+ * included anymore, too.
+ *
+ * @return true if driver is in the classpath
+ */
+ private boolean checkPostgresqlJDBC() {
+ return true;
+ }
+
+ /**
+ * Checks, if the runtime related registry is properly set up and checks
+ * the stored initial parameter for database access (which had been asked
+ * for by the installation script).
+ *
+ * @return true if database access is granted
+ */
private boolean checkDatabaseConnection() {
if (m_verbose) {
m_out.println("Checking that RuntimeConfig is configured");
@@ -108,6 +158,12 @@ public class DBCheck extends BaseCheck {
}
}
+ /**
+ * Checks if the database belongs to the set of supported DBs.
+ *
+ * @param db
+ * @return
+ */
private boolean checkSupportedDatabase(int db) {
if ( db == DbHelper.DB_DEFAULT ) {
m_out.println(message("unsupported_database"));
@@ -120,6 +176,11 @@ public class DBCheck extends BaseCheck {
return true;
}
+ /**
+ * Run method required by the script machinery to make things happen.
+ *
+ * @param ctx
+ */
public void run(ScriptContext ctx) {
int db = DbHelper.getDatabaseFromURL(RuntimeConfig.
getConfig().getJDBCURL());
diff --git a/ccm-core/src/com/arsdigita/packaging/Checklist.java b/ccm-core/src/com/arsdigita/packaging/Checklist.java
index da5754823..46df0a12d 100755
--- a/ccm-core/src/com/arsdigita/packaging/Checklist.java
+++ b/ccm-core/src/com/arsdigita/packaging/Checklist.java
@@ -39,7 +39,10 @@ import org.xml.sax.helpers.DefaultHandler;
class Checklist {
- public final static String versionId = "$Id: Checklist.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Checklist.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public static Checklist get(String pkg) {
ClassLoader ldr = Checklist.class.getClassLoader();
diff --git a/ccm-core/src/com/arsdigita/packaging/Clear.java b/ccm-core/src/com/arsdigita/packaging/Clear.java
index bd6c44c11..82fe21b7d 100755
--- a/ccm-core/src/com/arsdigita/packaging/Clear.java
+++ b/ccm-core/src/com/arsdigita/packaging/Clear.java
@@ -18,6 +18,7 @@
*/
package com.arsdigita.packaging;
+import com.arsdigita.runtime.ConfigRegistry;
import com.arsdigita.util.parameter.Parameter;
import java.io.IOException;
import java.util.ArrayList;
@@ -31,6 +32,9 @@ import org.apache.commons.cli.PosixParser;
/**
* Clear
*
+ * Implements the command line interface to clear one or more values
+ * in a CCM configuration database (registry)
+
* @author Justin Ross <jross@redhat.com>
* @version $Id: Clear.java 736 2005-09-01 10:46:05Z sskracic $
*/
diff --git a/ccm-core/src/com/arsdigita/packaging/Command.java b/ccm-core/src/com/arsdigita/packaging/Command.java
index c56fceed3..f36b4f4fa 100755
--- a/ccm-core/src/com/arsdigita/packaging/Command.java
+++ b/ccm-core/src/com/arsdigita/packaging/Command.java
@@ -33,7 +33,10 @@ import org.apache.commons.cli.Options;
abstract class Command {
- public final static String versionId = "$Id: Command.java 1324 2006-09-21 22:13:16Z apevec $ by $Author: apevec $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Command.java 1324 2006-09-21 22:13:16Z apevec $" +
+ " by $Author: apevec $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private String m_name;
private String m_summary;
@@ -72,7 +75,8 @@ abstract class Command {
static void usage(Options options, PrintStream out, String command,String args) {
String str;
- final String debugVar = "To show debugging output set the CCM_TOOLS_DEBUG environmental variable";
+ final String debugVar =
+ "To show debugging output set the CCM_TOOLS_DEBUG environmental variable";
if (args == null) {
str = command;
} else {
@@ -81,7 +85,8 @@ abstract class Command {
HelpFormatter fmt = new HelpFormatter();
PrintWriter w = new PrintWriter(out);
- fmt.printHelp(w, 80, str, "\n"+debugVar+"\n\nOptions:", options, 2, 4, null, true);
+ fmt.printHelp(w, 80, str, "\n"+debugVar+"\n\nOptions:",
+ options, 2, 4, null, true);
w.flush();
}
diff --git a/ccm-core/src/com/arsdigita/packaging/Config.java b/ccm-core/src/com/arsdigita/packaging/Config.java
index 660b27e5f..fe5f299c9 100755
--- a/ccm-core/src/com/arsdigita/packaging/Config.java
+++ b/ccm-core/src/com/arsdigita/packaging/Config.java
@@ -18,7 +18,8 @@
*/
package com.arsdigita.packaging;
-import com.arsdigita.runtime.CCM;
+import com.arsdigita.runtime.ConfigRegistry;
+import com.arsdigita.runtime.CCMResourceManager;
import com.arsdigita.util.Classes;
import com.arsdigita.util.JavaPropertyWriter;
import com.arsdigita.util.parameter.ErrorList;
@@ -34,8 +35,12 @@ import java.util.Map;
import java.util.Properties;
/**
- * Config
+ * PackageTool helper class: Writes a config database to its physical storage
+ * in file system.
*
+ * Used by some command worker classes of the packaging package, which handle
+ * configuration tasks, esp. the "load", "clear", "set" and "get" commands.
+ *
* This class is not supported API.
*
* @author Rafael H. Schloming <rhs@mit.edu>
@@ -44,10 +49,17 @@ import java.util.Properties;
public final class Config extends ParameterMap {
- public final static String versionId = "$Id: Config.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Config.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private ConfigRegistry m_reg;
+ /**
+ * Constructor, creates an Config object
+ * @param reg
+ **/
public Config(ConfigRegistry reg) {
m_reg = reg;
@@ -59,6 +71,10 @@ public final class Config extends ParameterMap {
}
}
+ /**
+ *
+ * @param errs
+ **/
void load(ErrorList errs) {
for (Iterator it = getContexts().iterator(); it.hasNext(); ) {
ParameterContext ctx = (ParameterContext) it.next();
@@ -79,20 +95,26 @@ public final class Config extends ParameterMap {
}
public final void save() throws IOException {
- save(CCM.getConfigDirectory());
+ save(CCMResourceManager.getConfigDirectory());
}
- void save(File conf) throws IOException {
- if (!conf.exists()) {
- throw new IOException("no such directory: " + conf);
+ /**
+ * Write the config parameter to the file system.
+ *
+ * @param confDir full path of the config directory location in the file system
+ * @throws java.io.IOException
+ **/
+ void save(File confDir) throws IOException {
+ if (!confDir.exists()) {
+ throw new IOException("no such directory: " + confDir);
}
- if (conf.isFile()) {
- throw new IOException("expecting directory: " + conf);
+ if (confDir.isFile()) {
+ throw new IOException("expecting directory: " + confDir);
}
- if (!conf.canWrite()) {
- throw new IOException("cannot write to directory: " + conf);
+ if (!confDir.canWrite()) {
+ throw new IOException("cannot write to directory: " + confDir);
}
HashMap stores = new HashMap();
@@ -113,7 +135,7 @@ public final class Config extends ParameterMap {
String storage = (String) me.getKey();
Properties props = (Properties) me.getValue();
if (props.size() == 0) { continue; }
- File file = new File(conf, storage);
+ File file = new File(confDir, storage);
File dir = file.getParentFile();
dir.mkdirs();
if (!(dir.exists() && dir.isDirectory())) {
diff --git a/ccm-core/src/com/arsdigita/packaging/Files.java b/ccm-core/src/com/arsdigita/packaging/Files.java.deprecated
similarity index 100%
rename from ccm-core/src/com/arsdigita/packaging/Files.java
rename to ccm-core/src/com/arsdigita/packaging/Files.java.deprecated
diff --git a/ccm-core/src/com/arsdigita/packaging/Get.java b/ccm-core/src/com/arsdigita/packaging/Get.java
index ad6b5773b..561c5d859 100755
--- a/ccm-core/src/com/arsdigita/packaging/Get.java
+++ b/ccm-core/src/com/arsdigita/packaging/Get.java
@@ -18,6 +18,7 @@
*/
package com.arsdigita.packaging;
+import com.arsdigita.runtime.ConfigRegistry;
import com.arsdigita.util.JavaPropertyWriter;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.ParameterWriter;
@@ -39,14 +40,22 @@ import org.apache.commons.cli.PosixParser;
/**
* Get
- *
+ *
+ * Implements the command line interface to list one or more values
+ * from a CCM configuration database (registry)
+ *
+ * Called by ccm get command
+ *
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #6 $ $Date: 2004/08/16 $
**/
class Get extends Command {
- public final static String versionId = "$Id: Get.java 1324 2006-09-21 22:13:16Z apevec $ by $Author: apevec $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Get.java 1324 2006-09-21 22:13:16Z apevec $" +
+ " by $Author: apevec $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Options OPTIONS = getOptions();
diff --git a/ccm-core/src/com/arsdigita/packaging/Help.java b/ccm-core/src/com/arsdigita/packaging/Help.java
index acbb65891..2ce55fcd5 100755
--- a/ccm-core/src/com/arsdigita/packaging/Help.java
+++ b/ccm-core/src/com/arsdigita/packaging/Help.java
@@ -27,7 +27,10 @@ package com.arsdigita.packaging;
class Help extends Command {
- public final static String versionId = "$Id: Help.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Help.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public Help() {
super("--help", "Print generic help");
diff --git a/ccm-core/src/com/arsdigita/packaging/HostInit.java b/ccm-core/src/com/arsdigita/packaging/HostInit.java
index 9611cb9e5..71fcf96b4 100755
--- a/ccm-core/src/com/arsdigita/packaging/HostInit.java
+++ b/ccm-core/src/com/arsdigita/packaging/HostInit.java
@@ -18,6 +18,7 @@
*/
package com.arsdigita.packaging;
+import com.arsdigita.runtime.ConfigRegistry;
import com.arsdigita.util.Files;
import com.arsdigita.util.StringUtils;
import java.io.BufferedReader;
@@ -37,7 +38,12 @@ import org.apache.commons.cli.PosixParser;
import org.apache.log4j.Logger;
/**
- * HostInit
+ * PackageTool worker class, implements the "hostinit" command.
+ *
+ * Populates the CCM application directory in webapps.
+ * Does not create the database nor the config registry.
+ *
+ * Called by the ccm hostinit / ccm hostinit-bundle command
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #16 $ $Date: 2004/08/16 $
@@ -45,7 +51,10 @@ import org.apache.log4j.Logger;
public class HostInit {
- public final static String versionId = "$Id: HostInit.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: HostInit.java 736 2005-09-01 10:46:05Z sskracic $" +
+ "by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Logger s_log =
Logger.getLogger(HostInit.class);
@@ -141,6 +150,8 @@ public class HostInit {
err("unable to create system: " + system);
}
+ // check the configuration database (registry) for packages (modules)
+ // retrieve a list of packages to deal with
ConfigRegistry reg = new ConfigRegistry();
List packages = reg.getPackages();
try {
diff --git a/ccm-core/src/com/arsdigita/packaging/Load.java b/ccm-core/src/com/arsdigita/packaging/Load.java
index eeca81443..6f71af562 100755
--- a/ccm-core/src/com/arsdigita/packaging/Load.java
+++ b/ccm-core/src/com/arsdigita/packaging/Load.java
@@ -18,7 +18,6 @@
*/
package com.arsdigita.packaging;
-import com.arsdigita.core.DBCheck;
import com.arsdigita.loader.PackageLoader;
import com.arsdigita.persistence.ConnectionSource;
import com.arsdigita.persistence.DedicatedConnectionSource;
@@ -27,14 +26,24 @@ import com.arsdigita.persistence.Session;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.persistence.metadata.MetadataRoot;
import com.arsdigita.persistence.pdl.PDLCompiler;
-import com.arsdigita.runtime.InteractiveParameterLoader;
+// pboy (Jan.09): deprecated classes and methods removed,
+// comments should be deleted after extensiv testing
+// deprecated, no replacement specified by author,
+// created InteractiveParameterReader analogous to CompoundParameterReader
+//import com.arsdigita.runtime.InteractiveParameterLoader;
+import com.arsdigita.runtime.InteractiveParameterReader;
+import com.arsdigita.runtime.ConfigRegistry;
+import com.arsdigita.runtime.RegistryConfig;
import com.arsdigita.runtime.RuntimeConfig;
import com.arsdigita.runtime.Startup;
-import com.arsdigita.util.JavaPropertyReader;
import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.util.config.JavaPropertyLoader;
+// deprecated, use c.ad.util.JavaPropertyReader instead
+// import com.arsdigita.util.config.JavaPropertyLoader;
+import com.arsdigita.util.JavaPropertyReader;
import com.arsdigita.util.jdbc.Connections;
-import com.arsdigita.util.parameter.CompoundParameterLoader;
+// deprecated:
+// import com.arsdigita.util.parameter.CompoundParameterLoader;
+import com.arsdigita.util.parameter.CompoundParameterReader;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.ParameterContext;
import java.io.ByteArrayInputStream;
@@ -64,7 +73,11 @@ import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
/**
- * PackageTool
+ * PackageTool worker class, implements the "load" command.
+ *
+ * Loads the database schema and initial content.
+ *
+ * Called by PackageTool
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #29 $ $Date: 2004/08/16 $
@@ -72,7 +85,10 @@ import org.apache.commons.cli.PosixParser;
class Load extends Command {
- public final static String versionId = "$Id: Load.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Load.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Options OPTIONS = getOptions();
@@ -216,7 +232,7 @@ class Load extends Command {
ParameterMap contexts = new ParameterMap();
Properties parameters = new Properties();
- CompoundParameterLoader loader = new CompoundParameterLoader();
+ CompoundParameterReader cpr = new CompoundParameterReader();
if (line.hasOption("parameter-file")) {
String file = line.getOptionValue("parameter-file");
try {
@@ -227,15 +243,19 @@ class Load extends Command {
System.err.println(e.getMessage());
return false;
}
- loader.add(new JavaPropertyLoader(parameters));
+ // deprecated, use JavaPropertyReader instead
+ // cpr.add(new JavaPropertyLoader(parameters));
+ cpr.add(new JavaPropertyReader(parameters));
}
if (line.hasOption("parameters")) {
Properties props = props(line.getOptionValues("parameters"));
- loader.add(new JavaPropertyLoader(props));
+ // deprecated, use JavaPropertyReader instead
+ // cpr.add(new JavaPropertyLoader(props));
+ cpr.add(new JavaPropertyReader(props));
parameters.putAll(props);
}
if (line.hasOption("interactive")) {
- loader.add(new InteractiveParameterLoader(System.in, System.out));
+ cpr.add(new InteractiveParameterReader(System.in, System.out));
}
Config config = null;
@@ -288,9 +308,10 @@ class Load extends Command {
Session ssn = null;
if (all || line.hasOption("schema") || line.hasOption("data")) {
- Check dbcheck = new DBCheck();
- dbcheck.run(null);
- if (dbcheck.getStatus() == null || dbcheck.getStatus().equals(Check.FAIL)) {
+ Check checkdb = new CheckDB();
+ checkdb.run(null);
+ if (checkdb.getStatus() == null
+ || checkdb.getStatus().equals(Check.FAIL)) {
rollbackConfig(config,packages);
return false;
}
@@ -377,7 +398,7 @@ class Load extends Command {
}
for (int i = 0; i < sorted.length; i++) {
- sorted[i].loadData(ssn, loader);
+ sorted[i].loadData(ssn, cpr);
}
}
}
@@ -443,7 +464,12 @@ class Load extends Command {
for (int i = 0; i < pkgs.length; i++) {
boolean isnew = false;
for (int j = 0; j < packages.size(); j++) {
- if (pkgs[i].toString() == packages.get(j).toString()) {
+ // Operator == compares object identity.
+ // comparison here refers to package names, so an
+ // object comparison will never be true.
+ // instead: equals()
+ // if (pkgs[i].toString() == packages.get(j).toString()) {
+ if (pkgs[i].toString().equals(packages.get(j).toString())) {
isnew = true;
}
}
diff --git a/ccm-core/src/com/arsdigita/packaging/Loader.java b/ccm-core/src/com/arsdigita/packaging/Loader.java
index 12970ade5..bb6707e37 100755
--- a/ccm-core/src/com/arsdigita/packaging/Loader.java
+++ b/ccm-core/src/com/arsdigita/packaging/Loader.java
@@ -34,7 +34,9 @@ import com.arsdigita.runtime.ScriptContext;
import com.arsdigita.runtime.Startup;
import com.arsdigita.util.Classes;
import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.util.parameter.ParameterLoader;
+// ParameterLoader is deprecated
+// import com.arsdigita.util.parameter.ParameterLoader;
+import com.arsdigita.util.parameter.ParameterReader;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
@@ -48,6 +50,9 @@ import org.apache.log4j.Logger;
/**
* Loader
*
+ * Helper class for load which actually performs the loading of
+ * the database schema and of the initial content.
+ *
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #13 $ $Date: 2004/08/16 $
**/
@@ -56,7 +61,10 @@ class Loader {
private static final Logger s_log = Logger.getLogger(Loader.class);
- public final static String versionId = "$Id: Loader.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Loader.java 736 2005-09-01 10:46:05Z sskracic $" +
+ "by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final String INIT = "com.arsdigita.runtime.Initializer";
@@ -127,7 +135,10 @@ class Loader {
}
}
- public void loadData(Session ssn, ParameterLoader loader) {
+
+ // deprecated:
+ // public void loadData(Session ssn, ParameterLoader loader) {
+ public void loadData(Session ssn, ParameterReader prd) {
final List inits = m_info.getProvidedInitializers();
CompoundInitializer ini = new CompoundInitializer();
for (Iterator it = inits.iterator(); it.hasNext(); ) {
@@ -140,7 +151,8 @@ class Loader {
TransactionContext txn = ssn.getTransactionContext();
txn.beginTxn();
- final ScriptContext ctx = new ScriptContext(ssn, loader);
+ // final ScriptContext ctx = new ScriptContext(ssn, loader);
+ final ScriptContext ctx = new ScriptContext(ssn, prd);
new KernelExcursion() {
protected void excurse() {
setEffectiveParty(Kernel.getSystemParty());
@@ -194,6 +206,7 @@ class Loader {
return result;
}
+ @Override
public String toString() {
return "";
}
diff --git a/ccm-core/src/com/arsdigita/packaging/LoaderInfo.java b/ccm-core/src/com/arsdigita/packaging/LoaderInfo.java
index df4a4c640..309668075 100755
--- a/ccm-core/src/com/arsdigita/packaging/LoaderInfo.java
+++ b/ccm-core/src/com/arsdigita/packaging/LoaderInfo.java
@@ -27,6 +27,8 @@ import org.xml.sax.helpers.DefaultHandler;
/**
* LoaderInfo
+ *
+ * Helper class:
*
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #6 $ $Date: 2004/08/16 $
@@ -34,7 +36,10 @@ import org.xml.sax.helpers.DefaultHandler;
class LoaderInfo {
- public final static String versionId = "$Id: LoaderInfo.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: LoaderInfo.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private List m_requiredTables = new ArrayList();
private List m_providedTables = new ArrayList();
diff --git a/ccm-core/src/com/arsdigita/packaging/MasterTool.java b/ccm-core/src/com/arsdigita/packaging/MasterTool.java
index 905009e14..a29b95914 100755
--- a/ccm-core/src/com/arsdigita/packaging/MasterTool.java
+++ b/ccm-core/src/com/arsdigita/packaging/MasterTool.java
@@ -28,8 +28,18 @@ import java.util.Map;
import org.apache.log4j.Logger;
/**
- * Implements the ccm command line tool.
- *
+ * Main entry point: Implements the ccm command line tool.
+ *
+ * Analyses the parameters, esp. the command part (1. parameter), and delegates
+ * the actual work to specializied classes for each command.
+ *
+ * The main purpose is to be called from an operation system specific script
+ * (or program) which is responsible for delivering the required parameters
+ * and additional information (e.g. the location where to install the
+ * application files via environment variable CCM_HOME). The currently
+ * provided script implementation is ccm, a shell script (sh and bat) backed
+ * by some PERL scripts, located in the tools directory of CCM trunk.
+ *
* @author Justin Ross <jross@redhat.com>
* @version $Id: MasterTool.java 1169 2006-06-14 13:08:25Z fabrice $
*/
@@ -56,9 +66,19 @@ public class MasterTool {
/**
* Entry point for the the ccm command line tool.
+ *
+ * Available commands:
+ * - load: loads the database schema and initial content
+ * - hostinit:populates the applications directors (jsp, classes, etc)
+ * - get: retrieves a configuration parameter
+ * - set: stores a configuration parameeter
+ * - upgrade: upgrades database (schema & content) and/or application files
+ * - status: execution status of the application
+ * - which: searches for a resource or class
+ * - unload:
*
* @param args the command line arguments
- **/
+ */
public static final void main(final String[] args) {
final PrintStream out = System.out;
diff --git a/ccm-core/src/com/arsdigita/packaging/Menu.java b/ccm-core/src/com/arsdigita/packaging/Menu.java
index 65fb6bdc3..89c100640 100755
--- a/ccm-core/src/com/arsdigita/packaging/Menu.java
+++ b/ccm-core/src/com/arsdigita/packaging/Menu.java
@@ -37,7 +37,10 @@ import java.util.Map;
class Menu {
- public final static String versionId = "$Id: Menu.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Menu.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
static final class Layout {
private Layout() {}
diff --git a/ccm-core/src/com/arsdigita/core/MessageMap.java b/ccm-core/src/com/arsdigita/packaging/MessageMap.java
similarity index 92%
rename from ccm-core/src/com/arsdigita/core/MessageMap.java
rename to ccm-core/src/com/arsdigita/packaging/MessageMap.java
index 74fbdb3f7..044f5e616 100755
--- a/ccm-core/src/com/arsdigita/core/MessageMap.java
+++ b/ccm-core/src/com/arsdigita/packaging/MessageMap.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.core;
+package com.arsdigita.packaging;
import com.arsdigita.util.Assert;
import com.arsdigita.util.UncheckedWrapperException;
@@ -27,12 +27,15 @@ import java.util.HashMap;
import org.apache.log4j.Logger;
/**
+ * Helper class which can be used by the packaging classes and others. Manages
+ * messages to be printed and makes it easier to handle multi line messages.
+ *
* Subject to change.
*
* @author Justin Ross <jross@redhat.com>
* @version $Id: MessageMap.java 287 2005-02-22 00:29:02Z sskracic $
*/
-final class MessageMap {
+public final class MessageMap {
public static final String versionId =
"$Id: MessageMap.java 287 2005-02-22 00:29:02Z sskracic $" +
"$Author: sskracic $" +
diff --git a/ccm-core/src/com/arsdigita/packaging/ParameterEditor.java b/ccm-core/src/com/arsdigita/packaging/ParameterEditor.java
index 87d5e68e7..c918d5d93 100755
--- a/ccm-core/src/com/arsdigita/packaging/ParameterEditor.java
+++ b/ccm-core/src/com/arsdigita/packaging/ParameterEditor.java
@@ -48,7 +48,10 @@ import java.util.Properties;
class ParameterEditor {
- public final static String versionId = "$Id: ParameterEditor.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: ParameterEditor.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private ParameterMap m_map;
private BufferedReader m_in;
@@ -352,7 +355,7 @@ class ParameterEditor {
// XXX: for testing
public static final void main(String[] args) {
ParameterMap map = new ParameterMap();
- map.addContext(new com.arsdigita.runtime.RuntimeConfig());
+ map.addContext( com.arsdigita.runtime.RuntimeConfig.getConfig());
map.addContext(new com.arsdigita.web.WebConfig());
map.addContext(new com.arsdigita.kernel.KernelConfig());
ParameterEditor pe = new ParameterEditor(map, System.in, System.out);
diff --git a/ccm-core/src/com/arsdigita/packaging/ParameterMap.java b/ccm-core/src/com/arsdigita/packaging/ParameterMap.java
index b6082cb30..04eff4bf3 100755
--- a/ccm-core/src/com/arsdigita/packaging/ParameterMap.java
+++ b/ccm-core/src/com/arsdigita/packaging/ParameterMap.java
@@ -40,7 +40,10 @@ import java.util.Map;
class ParameterMap {
- public final static String versionId = "$Id: ParameterMap.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: ParameterMap.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private List m_contexts = new ArrayList();
private List m_parameters = new ArrayList();
diff --git a/ccm-core/src/com/arsdigita/packaging/Set.java b/ccm-core/src/com/arsdigita/packaging/Set.java
index 3dd5d5b0b..f0a08cb12 100755
--- a/ccm-core/src/com/arsdigita/packaging/Set.java
+++ b/ccm-core/src/com/arsdigita/packaging/Set.java
@@ -18,6 +18,7 @@
*/
package com.arsdigita.packaging;
+import com.arsdigita.runtime.ConfigRegistry;
import com.arsdigita.util.JavaPropertyReader;
import java.io.IOException;
import java.util.Iterator;
@@ -31,13 +32,21 @@ import org.apache.commons.cli.PosixParser;
/**
* Set
*
+ * Implements the command line interface to modify one or more values
+ * in a CCM configuration database (registry)
+ *
+ * Called by ccm set command
+ *
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #7 $ $Date: 2004/08/16 $
**/
class Set extends Command {
- public final static String versionId = "$Id: Set.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Set.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Options OPTIONS = getOptions();
diff --git a/ccm-core/src/com/arsdigita/packaging/Status.java b/ccm-core/src/com/arsdigita/packaging/Status.java
index 15efedd04..7b65efcb9 100755
--- a/ccm-core/src/com/arsdigita/packaging/Status.java
+++ b/ccm-core/src/com/arsdigita/packaging/Status.java
@@ -18,6 +18,7 @@
*/
package com.arsdigita.packaging;
+import com.arsdigita.runtime.RegistryConfig;
import com.arsdigita.persistence.Session;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.runtime.ScriptContext;
@@ -32,7 +33,10 @@ import com.arsdigita.runtime.Startup;
class Status extends Command {
- public final static String versionId = "$Id: Status.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Status.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public Status() {
super("status", "Report on the status of a CCM instance");
diff --git a/ccm-core/src/com/arsdigita/packaging/Unload.java b/ccm-core/src/com/arsdigita/packaging/Unload.java
index e63f6abd8..b221f5d33 100755
--- a/ccm-core/src/com/arsdigita/packaging/Unload.java
+++ b/ccm-core/src/com/arsdigita/packaging/Unload.java
@@ -18,7 +18,8 @@
*/
package com.arsdigita.packaging;
-import com.arsdigita.runtime.CCM;
+import com.arsdigita.runtime.CCMResourceManager;
+import com.arsdigita.util.Files;
import java.io.File;
import java.io.FileFilter;
import java.util.HashSet;
@@ -38,7 +39,10 @@ import org.apache.commons.cli.PosixParser;
class Unload extends Command {
- public final static String versionId = "$Id: Unload.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Unload.java 736 2005-09-01 10:46:05Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Options OPTIONS = new Options();
@@ -80,7 +84,7 @@ class Unload extends Command {
if (line.hasOption("config")) {
// XXX: This just deletes everything.
- File conf = CCM.getConfigDirectory();
+ File conf = CCMResourceManager.getConfigDirectory();
File[] files = conf.listFiles(new FileFilter() {
public boolean accept(File file) {
return !EXCLUDE.contains(file.getName());
diff --git a/ccm-core/src/com/arsdigita/packaging/Usage.java b/ccm-core/src/com/arsdigita/packaging/Usage.java
index 9a5785863..a70b8b47b 100755
--- a/ccm-core/src/com/arsdigita/packaging/Usage.java
+++ b/ccm-core/src/com/arsdigita/packaging/Usage.java
@@ -27,7 +27,10 @@ package com.arsdigita.packaging;
class Usage extends Command {
- public final static String versionId = "$Id: Usage.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: Usage.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
public Usage() {
super("--usage", "Print this message");
diff --git a/ccm-core/src/com/arsdigita/core/checks.messages_linux b/ccm-core/src/com/arsdigita/packaging/basecheck.messages_linux
similarity index 100%
rename from ccm-core/src/com/arsdigita/core/checks.messages_linux
rename to ccm-core/src/com/arsdigita/packaging/basecheck.messages_linux
diff --git a/ccm-core/src/com/arsdigita/packaging/checkdb.messages_linux b/ccm-core/src/com/arsdigita/packaging/checkdb.messages_linux
new file mode 100755
index 000000000..ed047cbb8
--- /dev/null
+++ b/ccm-core/src/com/arsdigita/packaging/checkdb.messages_linux
@@ -0,0 +1,84 @@
+[classpath]
+The classpath of the CCM runtime includes
+
+ * jar files in JAVA_HOME/jre/lib/ext
+
+ * jars, zips, or class files under one of the paths listed in
+ CCM_HOME/ccm.classpath if it exists or /etc/ccm/ccm.classpath
+ otherwise
+
+ * the CLASSPATH environment variable.
+
+[supported_database]
+CHECK: The database type is recognized
+
+[unsupported_database]
+WARNING: The database type is not recognized
+
+The database that you are trying to use in not recognized. Make sure
+you spelled the JDBC URL correctly. The driver name should be
+"oracle" or "postgresql".
+
+[oracle_jdbc_found]
+CHECK: The Oracle JDBC driver is available
+
+[oracle_jdbc_not_found]
+WARNING: Oracle JDBC driver not found
+
+The CCM persistence layer requires the Oracle JDBC driver in order to
+function. The Oracle JDBC driver is typically in a file called
+"classes12.zip" or "classes12.jar". Check your classpath.
+
+[db_up]
+CHECK: The database is accepting connections
+
+[db_down]
+WARNING: The database is not accepting connections
+
+Possible explanations:
+
+ * The network connection to the database is down or the network is
+ not configured to permit connections. Try to reach the database
+ host and connect to the database's port to verify.
+
+ For instance, to test a connection to a running PostgreSQL
+ instance on a remote host:
+
+ $ host www.example.com
+ www.example.com has address 192.0.34.166
+
+ $ ping -c 1 192.0.34.166
+ 1 packets transmitted, 1 received, 0% loss, time 0ms
+
+ $ telnet 192.0.34.166 5432 # 5432 is the port postgres uses
+ Trying 192.0.34.166...
+ telnet: connect to address 192.0.34.166: Connection refused
+
+ * The database is not yet started or is down. Verify that its
+ process is running. Check that it will accept local connections.
+
+ For example, to test a PostgreSQL instance:
+
+ $ su - postgres
+ $ pg_ctl status
+ pg_ctl: postmaster is running (pid: 20925)
+ $ psql -l
+ psql: could not connect to server: No such file or directory
+
+ * The database did not accept your user and password. Make sure
+ they appear correctly in your JDBC URL.
+
+ * The JDBC URL is malformed. Check the documentation for your
+ database. Use the ccm tool to find out what your JDBC URL is set
+ to:
+
+ $ ccm get waf.runtime.jdbc_url
+ jdbc:postgresql:justin-ccm-trunk?user=justin
+[runtime_configured]
+CHECK: The ccm-core package is configured.
+[runtime_unconfigured]
+ERROR: The ccm-core package has not been configured.
+[jdbc_set]
+CHECK: The JDBC URL parameter is set.
+[jdbc_unset]
+ERROR: The JDBC URL parameter has not been set.
diff --git a/ccm-core/src/com/arsdigita/packaging/package.html b/ccm-core/src/com/arsdigita/packaging/package.html
new file mode 100644
index 000000000..d102e5115
--- /dev/null
+++ b/ccm-core/src/com/arsdigita/packaging/package.html
@@ -0,0 +1,14 @@
+
+Set of classes which provide a command line interface to install, initialize
+and configure a CCM application instance with MasterTool.java as the central
+entry point.
+
+
+Mastertool.java is the central entry point. It delegates the different tasks
+to specialized worker classes.
+
+
+The classes of this package are meant not to be called from within the
+application running in a servlet container. They serve as a dedicated,
+separate external command line interface for set up and configuration.
+
\ No newline at end of file
diff --git a/ccm-core/src/com/arsdigita/runtime/AbstractConfig.java b/ccm-core/src/com/arsdigita/runtime/AbstractConfig.java
index 5fbf7324b..2935b18ff 100755
--- a/ccm-core/src/com/arsdigita/runtime/AbstractConfig.java
+++ b/ccm-core/src/com/arsdigita/runtime/AbstractConfig.java
@@ -18,7 +18,6 @@
*/
package com.arsdigita.runtime;
-import com.arsdigita.packaging.ConfigRegistry;
import com.arsdigita.util.parameter.AbstractParameterContext;
import com.arsdigita.util.parameter.ErrorList;
import org.apache.log4j.Logger;
diff --git a/ccm-core/src/com/arsdigita/runtime/CCM.java b/ccm-core/src/com/arsdigita/runtime/CCM.java
deleted file mode 100755
index 229d1e3e8..000000000
--- a/ccm-core/src/com/arsdigita/runtime/CCM.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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.runtime;
-
-import com.arsdigita.util.UncheckedWrapperException;
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.apache.log4j.Logger;
-
-/**
- * Subject to change.
- *
- * An entry-point class for functions of the CCM runtime package.
- *
- * @author Justin Ross <jross@redhat.com>
- * @version $Id: CCM.java 751 2005-09-02 12:52:23Z sskracic $
- */
-public final class CCM {
- private static final Logger s_log = Logger.getLogger(CCM.class);
-
- public static final URL getHomeURL() {
- try {
- return CCM.getHomeDirectory().toURL();
- } catch (MalformedURLException e) {
- throw new UncheckedWrapperException(e);
- }
- }
-
- static final File getHomeDirectory() {
- final String home = System.getProperty("ccm.home");
-
- if (home == null) {
- throw new IllegalStateException
- ("The ccm.home system property is null or not defined");
- }
-
- final File file = new File(home);
-
- if (!file.exists()) {
- throw new IllegalStateException
- ("The file given in the ccm.home system property " +
- "does not exist");
- }
-
- if (!file.isDirectory()) {
- throw new IllegalStateException
- ("The file given in the ccm.home system property " +
- "is not a directory");
- }
-
- return file;
- }
-
- public static final URL getConfigURL() {
- try {
- return CCM.getConfigDirectory().toURL();
- } catch (MalformedURLException e) {
- throw new UncheckedWrapperException(e);
- }
- }
-
- public static final File getConfigDirectory() {
- final String conf = System.getProperty("ccm.conf");
-
- File file;
- if (conf == null) {
- file = new File(new File(CCM.getHomeDirectory(),"conf"), "registry");
- } else {
- file = new File(conf);
- }
-
- if (!file.exists()) {
- if (!file.mkdirs()) {
- throw new IllegalStateException
- ("Could not create configuration directory: " + file);
- }
- }
- if (!file.isDirectory()) {
- throw new IllegalStateException
- ("Configuration directory value is not a directory: " + file);
- }
-
- return file;
- }
-
- public static final File getDataDirectory() {
- File file = new File(CCM.getHomeDirectory(),"data");
- if (!file.exists()) {
- if (!file.mkdirs()) {
- throw new IllegalStateException
- ("Could not create data directory: " + file);
- }
- }
- if (!file.isDirectory()) {
- throw new IllegalStateException
- ("Data directory value is not a directory: " + file);
- }
- return file;
- }
-}
diff --git a/ccm-core/src/com/arsdigita/runtime/CCMResourceManager.java b/ccm-core/src/com/arsdigita/runtime/CCMResourceManager.java
new file mode 100755
index 000000000..83c985380
--- /dev/null
+++ b/ccm-core/src/com/arsdigita/runtime/CCMResourceManager.java
@@ -0,0 +1,353 @@
+/*
+ * 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.runtime;
+
+import com.arsdigita.util.UncheckedWrapperException;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.log4j.Logger;
+
+/**
+ * CCMResourceManager Runtime environment repository object, stores essential
+ * properties of the runtime environment.
+ *
+ * Currently, is is limited to the
+ *
+ * - base directory of the running webapp
+ *
+ * It provides public methods to make the properties available.
+ *
+ * The singleton is initialised
+ *
+ * - either during startup of the container (called by BaseServlet, in future
+ * by a specialised ApplicationContextListener)
+ * - or by the command line system at the beginning of the processing (esp.
+ * package c.ad.packaging).
+ *
+ * Currently as a fall back mechanism the environmant Variable CCM_HOME is
+ * evaluated and used a last resort, if no initialisation has been done when
+ * a getter is first called.
+ *
+ * It is essential for the proper working of CCM that CCMResourceManager is
+ * initialised before any operation starts, as it is the case with the Startup
+ * class of the runtime package, which is responsible for organising database
+ * assess.
+ *
+ *
+ * Subject to change!
+ *
+ * @author Justin Ross <jross@redhat.com>
+ * rewritten by
+ * @author pboy <pboy@barkhof.uni-bremen.de>
+ * @version $Id: CCMResourceManager.java 751 2005-09-02 12:52:23Z sskracic $
+ */
+public final class CCMResourceManager {
+ public final static String versionId =
+ "$Id: CCM.java 1393 2006-11-28 09:12:32Z sskracic $" +
+ "$Author: pboy $" +
+ "$DateTime: 2009/01/10 18:10:38 $";
+
+ private static final Logger s_log = Logger.getLogger(CCMResourceManager.class);
+
+ private static CCMResourceManager s_ccm;
+
+ /**
+ * Full Pathname of the application base directory
+ * (document root in apache terminology)
+ */
+ private static File m_baseDir;
+
+
+ /**
+ * Location of the registry in the applications directory tree
+ * as offset from the base directory
+ */
+ // currently not used, should be refactored as File object for the sake of
+ // operating system independency!
+ // public static final String registryPath = "/WEB-INF/conf/registry";
+ // public static final File registryPath = null; // currently not used, work in progress
+
+ /* ************ Section singleton handlers ***************** */
+
+ /**
+ * Sets the singleton configuration property for the runtime
+ * environment.
+ *
+ */
+ public static final synchronized void setBaseDirectory(String baseDirName) {
+ if (s_ccm == null) {
+ s_ccm = new CCMResourceManager();
+ s_ccm.storeBaseDir(baseDirName);
+ }
+ else {
+ // baseDir already set, silently discard
+ s_log.info("baseDir already set as " + m_baseDir + ". Discarded.");
+ }
+ }
+
+ /**
+ * Returns the singleton configuration property for the runtime
+ * environment.
+ *
+ * @return The RuntimeConfig record; it cannot be null
+ */
+ public static final synchronized File getBaseDirectory() {
+ if (s_ccm == null) {
+ // should never happen, setBaseDirectory has to be executed first
+ // we try to resolve the problem in fetchBaseDir by search for
+ // a runtime environment variable (the old way).
+ s_ccm = new CCMResourceManager();
+ }
+
+ return s_ccm.fetchBaseDir();
+ }
+
+ /* ************ Section singleton handlers END ************** */
+
+
+ /* ************ Constructors Section ************** */
+
+ /**
+ * Following the singleton pattern: Private constructor to prevent other
+ * clients from instantiating the class (and the compiler from generating
+ * a default public constructor).
+ */
+ private CCMResourceManager() { }
+
+ /* ************ Constructors Section END ************** */
+
+
+ /* ************ Public getter/setter Section *************** */
+
+ /**
+ * Retrieve the homeDir as URL.
+ *
+ * Note! API changed. @see getHomeDirectory()
+ * May be removed in the future!
+ *
+ * @return Directory location in the servers file system as URL object.
+ */
+ public static final URL getHomeURL() {
+ try {
+ return CCMResourceManager.getHomeDirectory().toURL();
+ } catch (MalformedURLException e) {
+ throw new UncheckedWrapperException(e);
+ }
+ }
+
+ /**
+ * Retrieve the homeDir, which is the location of the servlet server's
+ * servlet container directory in the file system of the server machine,
+ * as File object.
+ *
+ * Note! API changed!
+ *
+ * Originally it is used to determine all file object locations of a
+ * CCMResourceManager installation, during the installation step as well as
+ * while running the application inside a servlet container. The CCM installation
+ * of a servlet container used to use a non-standard layout. It is based upon a
+ * system wide environment variable CCM_HOME to determine the home directory.
+ *
+ * The dependence from a system wide environment variable prevents a servlet
+ * container to run multiple instances of CCM. In addition to it CCM will
+ * be migrated to be installable in a standard way to a standard container.
+ * Therefore all file locations will be given to the applications
+ * directory (the baseDirectory @see m_baseDir).
+ *
+ *
+ * Method getHomeDirectory() is preserved during the transition phase.
+ * It may be removed in the future! Or it may be moved to
+ * c.ad.packaging for assistence of the installation step only.
+ *
+ * @return Directory location in the servers file system as File object.
+ */
+ static final File getHomeDirectory() {
+ final String home = System.getProperty("ccm.home");
+
+ if (home == null) {
+ throw new IllegalStateException
+ ("The ccm.home system property is null or not defined");
+ }
+
+ final File file = new File(home);
+
+ if (!file.exists()) {
+ throw new IllegalStateException
+ ("The file given in the ccm.home system property " +
+ "does not exist");
+ }
+
+ if (!file.isDirectory()) {
+ throw new IllegalStateException
+ ("The file given in the ccm.home system property " +
+ "is not a directory");
+ }
+
+ return file;
+ }
+
+ /**
+ * Provide the configDirectory as URL.
+ *
+ * @see getConfigDirectory() for details.
+ *
+ * Note! API changed!
+ *
+ * @return Directory location in the servers file system as URL object.
+ */
+ public static final URL getConfigURL() {
+ try {
+ return CCMResourceManager.getConfigDirectory().toURL();
+ } catch (MalformedURLException e) {
+ throw new UncheckedWrapperException(e);
+ }
+ }
+
+ /**
+ * Retrieve the configDir, which is the location of the configuration
+ * database root (registry) in the file system tree of the server machine,
+ * as File object.
+
+ *
+ * @return Directory location in the servers file system as File object.
+ */
+ public static final File getConfigDirectory() {
+
+ // Keep this in sync with informational attribut @see registryPath !
+ File confdir = new File(new File(new File(CCMResourceManager.getBaseDirectory(),
+ "WEB-INF"),"conf"), "registry");
+
+ if (!confdir.exists()) {
+ if (!confdir.mkdirs()) {
+ throw new IllegalStateException
+ ("Could not create configuration directory: " + confdir);
+ }
+ }
+ if (!confdir.isDirectory()) {
+ throw new IllegalStateException
+ ("Configuration directory value is not a directory: " + confdir);
+ }
+
+ return confdir;
+ }
+
+ /**
+ * getWorkDirectory retrieves and eventually creates an internal directory
+ * in the servlet container for temporary files (work files), where subsystems
+ * may create subdirectories for internal use (e.g. Lucene search enginge or
+ * the PublishToFile machinery).
+ *
+ * The containers work file directory could be used as well, but may be
+ * inappropriate in case of confidential data.
+ *
+ * @return Directory location in the servers file system as File object.
+ */
+ public static final File getWorkDirectory() {
+ File file = new File(new File(CCMResourceManager.getBaseDirectory(),
+ "WEB-INF"),"work");
+ if (!file.exists()) {
+ if (!file.mkdirs()) {
+ throw new IllegalStateException
+ ("Could not create work directory: " + file);
+ }
+ }
+ if (!file.isDirectory()) {
+ throw new IllegalStateException
+ ("Work directory value is not a directory: " + file);
+ }
+ return file;
+ }
+
+ /* ************ Public getter/setter Section END *************** */
+
+
+ /* ************ Private Worker Section *************** */
+
+ /**
+ * Stores the passed in String as File object.
+ *
+ * XXX contemporary Hack: checks if the last part of the dir is ROOT,
+ * otherwise replaces the ccm- part. Must be removed as soon as all
+ * CCMResourceManager modules are relocated in one single context (app directory)
+ * instead of spreaded as separate applications.
+ * @param baseDirName String containing the path, must not be null
+ */
+ private final void storeBaseDir(String baseDirName) {
+
+ s_log.info("storeBaseDir: BaseDir name is given as " + baseDirName );
+ m_baseDir = new File(baseDirName);
+
+
+ // temporary: enforce that BaseDir is ROOT!
+ m_baseDir.renameTo(new File(m_baseDir.getParent(),"ROOT"));
+
+ // eventually: check if dir exists, create it if not.
+ if (!m_baseDir.exists()) {
+ if (!m_baseDir.mkdirs()) {
+ throw new IllegalStateException
+ ("Could not create base directory: " + m_baseDir);
+ }
+ }
+ if (!m_baseDir.isDirectory()) {
+ throw new IllegalStateException
+ ("Base directory value is not a directory: " + m_baseDir);
+ }
+
+ s_log.info("storeBaseDir: BaseDir is stored as " + m_baseDir );
+
+ }
+
+ /**
+ * Retrieves the stored BaseDir File object.
+ *
+ * @return Base directory location in the servers file system as File object.
+ */
+ private final File fetchBaseDir() {
+
+ if (m_baseDir == null) {
+ // should never happen, but we try to cope with it anyway by
+ // falling back to getHomeDirectory() and the system wide
+ // environment variable.
+ // During transition phase only! Must be removed when the new
+ // standard compliant installation method is fully in place
+ m_baseDir = new File(new File(CCMResourceManager.getHomeDirectory(),
+ "webapps"), "ROOT");
+
+ // eventually: check if dir exists, create it if not.
+ if (!m_baseDir.exists()) {
+ if (!m_baseDir.mkdirs()) {
+ throw new IllegalStateException
+ ("Could not create base directory: " + m_baseDir);
+ }
+ }
+ if (!m_baseDir.isDirectory()) {
+ throw new IllegalStateException
+ ("Base directory value is not a directory: " + m_baseDir);
+ }
+ }
+
+ return m_baseDir;
+
+ }
+
+ /* ************ Private Worker Section END *************** */
+
+
+}
diff --git a/ccm-core/src/com/arsdigita/packaging/ConfigRegistry.java b/ccm-core/src/com/arsdigita/runtime/ConfigRegistry.java
similarity index 91%
rename from ccm-core/src/com/arsdigita/packaging/ConfigRegistry.java
rename to ccm-core/src/com/arsdigita/runtime/ConfigRegistry.java
index 6c43e6d05..9ec8fda36 100755
--- a/ccm-core/src/com/arsdigita/packaging/ConfigRegistry.java
+++ b/ccm-core/src/com/arsdigita/runtime/ConfigRegistry.java
@@ -16,9 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.packaging;
+package com.arsdigita.runtime;
-import com.arsdigita.runtime.CCM;
+// import com.arsdigita.runtime.RegistryConfig;
+import com.arsdigita.runtime.CCMResourceManager;
import com.arsdigita.util.Classes;
import com.arsdigita.util.JavaPropertyReader;
import com.arsdigita.util.UncheckedWrapperException;
@@ -43,11 +44,13 @@ import org.xml.sax.helpers.DefaultHandler;
/**
* The ConfigRegistry class maps between config classes (subclasses of
* {@link com.arsdigita.runtime.AbstractConfig}), and a location used
- * for persisting the values in a config class. The ConfigRegistry
- * also stores the set of configured packages for a particular CCM
- * instance, and a list of URLs for parent configurations that are
+ * for persisting the values in a config class.
+ *
+ * The ConfigRegistry also stores the set of configured packages for a
+ * particular CCMResourceManager instance.
+ * Additionally it stores a list of URLs for parent configurations that are
* used for defaulting values not present in the local configuration.
- * This mapping is maintained and extended by CCM developers through
+ * This mapping is maintained and extended by CCMResourceManager developers through
* the use of an XML configuration file placed in the src tree for a
* particular package. If a particular package is configured, the
* ConfigRegistry class will look in the classpath for a registry
@@ -64,18 +67,20 @@ import org.xml.sax.helpers.DefaultHandler;
* </registry>
*
*
- * The mappings stored by this ConfigRegistry will then be extended to
- * include the classes and storage locations specified in the
- * configuration file. These mappings are then used by the
- * ConfigRegistry instance to load config objects.
- *
+ * The mappings stored by this ConfigRegistry will then be extended to include
+ * the classes and storage locations specified in the configuration file. These
+ * mappings are then used by the ConfigRegistry instance to load config objects.
+ *
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #15 $ $Date: 2004/08/16 $
**/
public class ConfigRegistry {
- public final static String versionId = "$Id: ConfigRegistry.java 736 2005-09-01 10:46:05Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: ConfigRegistry.java 736 2005-09-01 10:46:05Z sskracic $ " +
+ "by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static final Logger s_log = Logger.getLogger(ConfigRegistry.class);
private URL m_url;
@@ -127,7 +132,7 @@ public class ConfigRegistry {
**/
public ConfigRegistry(ClassLoader loader) {
- this(CCM.getConfigURL(), loader);
+ this(CCMResourceManager.getConfigURL(), loader);
}
/**
@@ -136,7 +141,7 @@ public class ConfigRegistry {
* ccm.conf system property may or may not include a trailing slash.
**/
public ConfigRegistry() {
- this(CCM.getConfigURL());
+ this(CCMResourceManager.getConfigURL());
}
private void initialize(URL url, ErrorList errs) {
diff --git a/ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java b/ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java
index 4a634a49d..95fb8ef9e 100755
--- a/ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java
+++ b/ccm-core/src/com/arsdigita/runtime/InteractiveParameterLoader.java
@@ -34,10 +34,10 @@ import java.util.Iterator;
/**
* InteractiveParameterLoader
*
- * @deprecated
- *
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #7 $ $Date: 2004/08/16 $
+ *
+ * @deprecated use {@link InteractiveParameterReader } instead
**/
public final class InteractiveParameterLoader implements ParameterLoader {
diff --git a/ccm-core/src/com/arsdigita/runtime/InteractiveParameterReader.java b/ccm-core/src/com/arsdigita/runtime/InteractiveParameterReader.java
new file mode 100755
index 000000000..9eecbf2b3
--- /dev/null
+++ b/ccm-core/src/com/arsdigita/runtime/InteractiveParameterReader.java
@@ -0,0 +1,108 @@
+/*
+ * 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.runtime;
+
+import com.arsdigita.util.UncheckedWrapperException;
+import com.arsdigita.util.parameter.ErrorList;
+import com.arsdigita.util.parameter.Parameter;
+import com.arsdigita.util.parameter.ParameterInfo;
+import com.arsdigita.util.parameter.ParameterReader;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+
+import org.apache.log4j.Logger;
+
+/**
+ * InteractiveParameterReader, implementation o ParameterReader which
+ *
+ *
+ * @author Peter Boy <pboy@barkhof.uni-bremen.de> using code by
+ * @author Rafael H. Schloming <rhs@mit.edu>
+ * @version $Revision: #7 $ $Date: 2004/08/16 $
+ **/
+
+public final class InteractiveParameterReader implements ParameterReader {
+
+ public final static String versionId =
+ "$Id: InteractiveParameterReader.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
+
+ private static final Logger s_log = Logger.getLogger
+ (InteractiveParameterReader.class);
+
+ private final InputStream m_in;
+ private final PrintStream m_out;
+ private final BufferedReader m_lines;
+
+ public InteractiveParameterReader(InputStream in, PrintStream out) {
+ m_in = in;
+ m_out = out;
+ m_lines = new BufferedReader(new InputStreamReader(m_in));
+ }
+
+ public final String read(final Parameter param, final ErrorList errors) {
+ if (!param.isRequired()) { return null; }
+ final Object dephault = param.getDefaultValue();
+ if (dephault != null) { return null; }
+
+ m_out.println("Parameter: " + param.getName());
+
+ final ParameterInfo info = param.getInfo();
+
+ if (info != null) {
+ String str = info.getTitle();
+ if (str != null) {
+ m_out.println("Title: " + str);
+ }
+ str = info.getPurpose();
+ if (str != null) {
+ m_out.println("Purpose: " + str);
+ }
+ str = info.getExample();
+ if (str != null) {
+ m_out.println("Example: " + str);
+ }
+ str = info.getFormat();
+ if (str != null) {
+ m_out.println("Format: " + str);
+ }
+ }
+
+ while (true) {
+ m_out.print("Value: ");
+ m_out.flush();
+
+ try {
+ final String line = m_lines.readLine();
+
+ if (line.equals("")) {
+ continue;
+ } else {
+ return line;
+ }
+ } catch (IOException e) {
+ throw new UncheckedWrapperException(e);
+ }
+ }
+ }
+}
diff --git a/ccm-core/src/com/arsdigita/runtime/LegacyInitializer.java b/ccm-core/src/com/arsdigita/runtime/LegacyInitializer.java
index 59ecbe1c4..ad567c4c0 100755
--- a/ccm-core/src/com/arsdigita/runtime/LegacyInitializer.java
+++ b/ccm-core/src/com/arsdigita/runtime/LegacyInitializer.java
@@ -19,7 +19,6 @@
package com.arsdigita.runtime;
import com.arsdigita.initializer.Script;
-import com.arsdigita.packaging.ConfigRegistry;
import com.arsdigita.util.UncheckedWrapperException;
import java.io.IOException;
import java.io.InputStream;
diff --git a/ccm-core/src/com/arsdigita/packaging/RegistryConfig.java b/ccm-core/src/com/arsdigita/runtime/RegistryConfig.java
similarity index 93%
rename from ccm-core/src/com/arsdigita/packaging/RegistryConfig.java
rename to ccm-core/src/com/arsdigita/runtime/RegistryConfig.java
index bb026b762..801962b4d 100755
--- a/ccm-core/src/com/arsdigita/packaging/RegistryConfig.java
+++ b/ccm-core/src/com/arsdigita/runtime/RegistryConfig.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.packaging;
+package com.arsdigita.runtime;
import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.StringUtils;
@@ -38,7 +38,10 @@ import java.net.URL;
public class RegistryConfig extends AbstractConfig {
- public final static String versionId = "$Id: RegistryConfig.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: RegistryConfig.java 287 2005-02-22 00:29:02Z sskracic $" +
+ " by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private static String[] array(String str) {
if (str == null) {
diff --git a/ccm-core/src/com/arsdigita/runtime/RuntimeClassLoader.java b/ccm-core/src/com/arsdigita/runtime/RuntimeClassLoader.java.notInUse
similarity index 82%
rename from ccm-core/src/com/arsdigita/runtime/RuntimeClassLoader.java
rename to ccm-core/src/com/arsdigita/runtime/RuntimeClassLoader.java.notInUse
index 6f18d4149..06f85a105 100755
--- a/ccm-core/src/com/arsdigita/runtime/RuntimeClassLoader.java
+++ b/ccm-core/src/com/arsdigita/runtime/RuntimeClassLoader.java.notInUse
@@ -25,10 +25,21 @@ import java.net.URLClassLoader;
import org.apache.log4j.Logger;
/**
+ * RuntimeClassLoader
+ *
+ * URLClassLoader inherited from is used to load classes and resources from
+ * a search path of URLs referring to both JAR files and directories.
+ *
+ * Obviously unfinished work.
+ * As of CCM version 6.5 no element of trunk uses this class! Should be made
+ * deprecated.
+ *
* Subject to change.
*
* @author Justin Ross <jross@redhat.com>
* @version $Id: RuntimeClassLoader.java 738 2005-09-01 12:36:52Z sskracic $
+ *
+ * @deprecated
*/
class RuntimeClassLoader extends URLClassLoader {
public final static String versionId =
diff --git a/ccm-core/src/com/arsdigita/runtime/RuntimeConfig.java b/ccm-core/src/com/arsdigita/runtime/RuntimeConfig.java
index 770b4070c..e84b42af4 100755
--- a/ccm-core/src/com/arsdigita/runtime/RuntimeConfig.java
+++ b/ccm-core/src/com/arsdigita/runtime/RuntimeConfig.java
@@ -25,8 +25,8 @@ import com.arsdigita.util.parameter.Parameter;
import org.apache.log4j.Logger;
/**
- * A configuration record for configuration of the runtime
- * environment.
+ * A configuration record for configuration of the runtime environment itself.
+ * (Which database to use, database user and password, etc)
*
* @author Justin Ross <jross@redhat.com>
* @version $Id: RuntimeConfig.java 1393 2006-11-28 09:12:32Z sskracic $
@@ -50,7 +50,11 @@ public final class RuntimeConfig extends AbstractConfig {
public static final synchronized RuntimeConfig getConfig() {
if (s_config == null) {
s_config = new RuntimeConfig();
- s_config.require("ccm-core/runtime.properties");
+ // deprecated
+ // s_config.require("ccm-core/runtime.properties");
+ // use instead:
+ // read values from the persistent storage
+ s_config.load();
}
return s_config;
@@ -66,9 +70,14 @@ public final class RuntimeConfig extends AbstractConfig {
/**
* Constructs an empty RuntimeConfig object.
- **/
+ *
+ */
public RuntimeConfig() {
+ // pboy: According to the comment for the getConfig() method a singleton
+ // pattern is to be used. Therefore the constructor must be changed to
+ // private!
+ // private RuntimeConfig() {
m_url = new JDBCURLParameter("waf.runtime.jdbc_url");
m_poolSize = new IntegerParameter
("waf.runtime.jdbc_pool_size", Parameter.OPTIONAL,
@@ -86,10 +95,10 @@ public final class RuntimeConfig extends AbstractConfig {
m_resultSetWindowSize = new IntegerParameter
("waf.runtime.jdbc_resultset_windowsize", Parameter.REQUIRED,
new Integer(1));
- m_runBackgroundTasks = new BooleanParameter
- ("waf.runtime.run_background_tasks",
- Parameter.REQUIRED,
- Boolean.TRUE);
+ m_runBackgroundTasks = new BooleanParameter
+ ("waf.runtime.run_background_tasks",
+ Parameter.REQUIRED,
+ Boolean.TRUE);
register(m_url);
register(m_poolSize);
diff --git a/ccm-core/src/com/arsdigita/runtime/RuntimeConfigLoader.java b/ccm-core/src/com/arsdigita/runtime/RuntimeConfigLoader.java.nolongerInUse
similarity index 100%
rename from ccm-core/src/com/arsdigita/runtime/RuntimeConfigLoader.java
rename to ccm-core/src/com/arsdigita/runtime/RuntimeConfigLoader.java.nolongerInUse
diff --git a/ccm-core/src/com/arsdigita/runtime/ScriptContext.java b/ccm-core/src/com/arsdigita/runtime/ScriptContext.java
index 1380f60a7..7f07eb7dc 100755
--- a/ccm-core/src/com/arsdigita/runtime/ScriptContext.java
+++ b/ccm-core/src/com/arsdigita/runtime/ScriptContext.java
@@ -19,7 +19,7 @@
package com.arsdigita.runtime;
import com.arsdigita.persistence.Session;
-import com.arsdigita.util.parameter.ParameterLoader;
+import com.arsdigita.util.parameter.ParameterReader;
/**
* The ScriptContext class is passed into the {@link
@@ -33,23 +33,26 @@ import com.arsdigita.util.parameter.ParameterLoader;
public class ScriptContext {
- public final static String versionId = "$Id: ScriptContext.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
+ public final static String versionId =
+ "$Id: ScriptContext.java 287 2005-02-22 00:29:02Z sskracic $" +
+ "by $Author: sskracic $, " +
+ "$DateTime: 2004/08/16 18:10:38 $";
private final Session m_ssn;
- private final ParameterLoader m_params;
+ private final ParameterReader m_params;
/**
* Constructs a new ScriptContext object with the given Session
- * and ParameterLoader.
+ * and ParameterReader.
*
* @param ssn The persistent session to provide to the executing
* script.
*
- * @param params The parameter loader to provide to the executing
+ * @param params The parameter reader to provide to the executing
* script.
**/
- public ScriptContext(Session ssn, ParameterLoader params) {
+ public ScriptContext(Session ssn, ParameterReader params) {
m_ssn = ssn;
m_params = params;
}
@@ -65,10 +68,14 @@ public class ScriptContext {
}
/**
- * @deprecated Use {@link com.arsdigita.util.parameter.ParameterContext#load(com.arsdigita.util.parameter.ParameterReader, com.arsdigita.util.parameter.ErrorList)} instead.
+ * The original ParameterLoader is deprecated now. As an alternative
+ * was recommended here:
+ * Use {@link com.arsdigita.util.parameter.ParameterContext#load(
+ * com.arsdigita.util.parameter.ParameterReader,
+ * com.arsdigita.util.parameter.ErrorList )} instead.
**/
- public ParameterLoader getParameterLoader() {
+ public ParameterReader getParams() {
return m_params;
}
diff --git a/ccm-core/src/com/arsdigita/runtime/package.html b/ccm-core/src/com/arsdigita/runtime/package.html
index 56c4b07f4..47f8116f3 100755
--- a/ccm-core/src/com/arsdigita/runtime/package.html
+++ b/ccm-core/src/com/arsdigita/runtime/package.html
@@ -6,7 +6,19 @@
The com.arsdigita.runtime package provides classses and interfaces
-for bootstrapping the CCM runtime environment.
+for bootstrapping and manage the CCM runtime environment.
+
+The tasks include:
+
+ - maintain the location of the base directory of the application in the
+ servers file system.
+ - maintain the location of the configuration database (registry).
+ - maintain the database connection
+
+
+The classes in this package are used by the application running in a
+servlet container as well as by the installation and maintenance command line
+utilities outside a servlet container. They don't rely on a servlet context.