|
From: <pb...@fe...> - 2013-02-02 17:32:30
|
Author: pboy
Date: 2013-02-02 17:32:18 +0000 (Sat, 02 Feb 2013)
New Revision: 2465
Added:
trunk/ccm-core/src/com/arsdigita/core/Loader_parameter.properties
trunk/ccm-core/src/com/arsdigita/core/MimeTypeRow.java
trunk/ccm-core/src/com/arsdigita/core/mimetypes.properties
Removed:
trunk/ccm-core/src/com/arsdigita/core/Loader.java
trunk/ccm-core/src/com/arsdigita/core/enterprise.init.nolongerInUse
trunk/ccm-core/src/com/arsdigita/core/enterpriseold.init.nolongerInUse
trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java
trunk/ccm-core/src/com/arsdigita/loader/CoreLoader_parameter.properties
trunk/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java
trunk/ccm-core/src/com/arsdigita/loader/mimetypes.properties
trunk/ccm-core/src/com/arsdigita/web/WebApp.java.nolongerInUse
Modified:
trunk/ccm-core/src/com/arsdigita/core/Initializer.java
trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java
trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java
trunk/ccm-core/src/com/arsdigita/runtime/RegistryConfig.java
Log:
Relocated core loader to the proper directory, various formatting and documentation.
Modified: trunk/ccm-core/src/com/arsdigita/core/Initializer.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/Initializer.java 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/core/Initializer.java 2013-02-02 17:32:18 UTC (rev 2465)
@@ -23,7 +23,6 @@
import com.arsdigita.domain.DomainObject;
import com.arsdigita.domain.DomainObjectInstantiator;
import com.arsdigita.kernel.ACSObjectInstantiator;
-import com.arsdigita.loader.CoreLoader;
import com.arsdigita.mimetypes.MimeType;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.Session;
@@ -35,25 +34,24 @@
import com.arsdigita.runtime.DomainInitEvent;
import com.arsdigita.runtime.PDLInitializer;
import com.arsdigita.runtime.RuntimeConfig;
-import com.arsdigita.toolbox.CharsetEncodingProvider;
-import com.arsdigita.ui.admin.Admin;
-import com.arsdigita.util.URLRewriter;
-import com.arsdigita.xml.FactoriesSetup;
-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.PDFConverter;
import com.arsdigita.search.converter.TextConverter;
-
+import com.arsdigita.search.converter.WordConverter;
+import com.arsdigita.toolbox.CharsetEncodingProvider;
+import com.arsdigita.ui.admin.Admin;
import com.arsdigita.ui.login.Login;
import com.arsdigita.ui.permissions.Permissions;
+import com.arsdigita.util.URLRewriter;
+import com.arsdigita.web.ApplicationType;
+import com.arsdigita.web.Host;
import com.arsdigita.webdevsupport.WebDevSupport;
+import com.arsdigita.workflow.simple.TaskComment;
+import com.arsdigita.xml.FactoriesSetup;
+
import org.apache.log4j.Logger;
@@ -123,16 +121,7 @@
}
});
-/* Status Experimental - not used anywhere in code base.
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) {
@@ -233,7 +222,7 @@
Session session = SessionManager.getSession();
TransactionContext txn = session.getTransactionContext();
txn.beginTxn();
- CoreLoader.loadHost();
+ Loader.loadHost();
txn.commitTxn();
s_log.info("Core init(DomainInitEvent) done");
Deleted: trunk/ccm-core/src/com/arsdigita/core/Loader.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/Loader.java 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/core/Loader.java 2013-02-02 17:32:18 UTC (rev 2465)
@@ -1,40 +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;
-
-/**
- * Loader used during the initial setup to load the database, used by
- * c.ad.packaging.Load (invoked via "ccm load ..." command)
- *
- * The loader is specified in the file "/ccm-core.load" (which follows the
- * general naming scheme <package-key>.load).
- *
- * Currently just a wrapper for Class CoreLoader which does the actual work.
- *
- * ToDo: Should we move CoreLoader into Loader here for systematic reasons? All
- * modules use a class Loader (or sometimes <package>Loader) located in the
- * base package of the module. Alternatively: put all Loader classes into a
- * package "loader".
- *
- */
-public final class Loader extends CoreLoader {
- // Empty
-}
Added: trunk/ccm-core/src/com/arsdigita/core/Loader_parameter.properties
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/Loader_parameter.properties (rev 0)
+++ trunk/ccm-core/src/com/arsdigita/core/Loader_parameter.properties 2013-02-02 17:32:18 UTC (rev 2465)
@@ -0,0 +1,49 @@
+waf.admin.email.title=Administrator Email Address
+waf.admin.email.purpose=Creation of the system administrator account.
+waf...@ex...
+waf.admin.email.format=<user>@<domain>
+
+waf.admin.name.screen.title=Administrator Screen Name
+waf.admin.name.screen.purpose=Creation of the system administrator account.
+waf.admin.name.screen.example=joe
+
+waf.admin.name.given.title=Administrator First Name
+waf.admin.name.given.purpose=Creation of the system administrator account.
+waf.admin.name.given.example=John
+
+waf.admin.name.family.title=Administrator Last Name
+waf.admin.name.family.purpose=Creation of the system administrator account.
+waf.admin.name.family.example=Dough
+
+waf.admin.password.title=Administrator Password
+waf.admin.password.purpose=Creation of the system administrator account.
+
+waf.admin.password.question.title=Administrator Password Question
+waf.admin.password.question.purpose=Asked when the password to the system \
+ administrator account is lost and access \
+ must be recovered.
+waf.admin.password.question.example=Your mother's maiden name.
+
+waf.admin.password.answer.title=Administrator Password Answer
+waf.admin.password.answer.purpose=The correct answer to the \
+ Administrator Password Question.
+waf.admin.password.answer.example=Dough
+
+waf.login.stylesheet.title=Login Stylesheet
+waf.login.stylesheet.purpose=Styles the login ui.
+
+waf.login.dispatcher.title=Login Dispatcher
+waf.login.dispatcher.purpose=Implements the login ui.
+
+waf.mime.resource.title=Mime Types Resource
+waf.mime.resource.purpose=Mime types are loaded from this resource
+
+waf.globalization.charsets.title=Recognized Character Sets
+waf.globalization.charsets.purpose=List containing the recognized character sets.
+waf.globalization.charsets.example="ISO-8859-1,UTF-8"
+waf.globalization.charsets.format=[StringArray]
+
+waf.globalization.locales.title=Locales
+waf.globalization.locales.purpose=List of locales, each local is a UNIQUE 4-tuple of the form language:country:variant:charset
+waf.globalization.locales.example="en: : :UTF-8, en:GB: :UTF-8, de: : :UTF-8, de:DE: :UTF-8"
+waf.globalization.locales.format=[StringArray]
Added: trunk/ccm-core/src/com/arsdigita/core/MimeTypeRow.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/MimeTypeRow.java (rev 0)
+++ trunk/ccm-core/src/com/arsdigita/core/MimeTypeRow.java 2013-02-02 17:32:18 UTC (rev 2465)
@@ -0,0 +1,104 @@
+/*
+ * 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.runtime.AbstractConfig;
+import com.arsdigita.util.parameter.Parameter;
+import com.arsdigita.util.parameter.StringParameter;
+import org.apache.log4j.Logger;
+
+/**
+ * MimeTypeRow
+ * A configuration record for MimeTypes
+ *
+ * @author Rafael H. Schloming <rh...@mi...>
+ * @version $Revision: #5 $ $Date: 2004/08/16 $
+ * @version $Id: MimeTypeRow.java 2070 2010-01-28 08:47:41Z pboy $
+ */
+class MimeTypeRow extends AbstractConfig {
+
+ private static final Logger s_log = Logger.getLogger(MimeTypeRow.class);
+
+ private StringParameter m_type = new StringParameter
+ ("waf.mime.type", Parameter.REQUIRED, null);
+
+ private StringParameter m_label = new StringParameter
+ ("waf.mime.label", Parameter.REQUIRED, null);
+
+ private StringParameter m_extensions = new StringParameter
+ ("waf.mime.extensions", Parameter.REQUIRED, null);
+
+ private StringParameter m_objectType = new StringParameter
+ ("waf.mime.object_type", Parameter.REQUIRED, null);
+
+ private StringParameter m_sizerOrINSO = new StringParameter
+ ("waf.mime.sizer_or_inso", Parameter.OPTIONAL, null);
+
+ public MimeTypeRow() {
+ // super();
+ register(m_type);
+ register(m_label);
+ register(m_extensions);
+ register(m_objectType);
+ register(m_sizerOrINSO);
+ }
+
+ public String getType() {
+ return (String) get(m_type);
+ }
+
+ public String getLabel() {
+ return (String) get(m_label);
+ }
+
+ public String getExtensions() {
+ return (String) get(m_extensions);
+ }
+
+ /**
+ * Get default Extension (first one in list)
+ **/
+
+ public String getDefaultExtension() {
+ String exts = getExtensions();
+ int index = exts.indexOf(',', 0);
+ if (index < 0) {
+ return exts;
+ } else {
+ return exts.substring(0, index);
+ }
+ }
+
+ private String typeName() {
+ return (String) get(m_objectType);
+ }
+
+ public String getObjectType() {
+ return "com.arsdigita.cms." + typeName();
+ }
+
+ public String getJavaClass() {
+ return "com.arsdigita.mimetypes." + typeName();
+ }
+
+ public String getSizerOrINSO() {
+ return (String) get(m_sizerOrINSO);
+ }
+
+}
Deleted: trunk/ccm-core/src/com/arsdigita/core/enterprise.init.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/enterprise.init.nolongerInUse 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/core/enterprise.init.nolongerInUse 2013-02-02 17:32:18 UTC (rev 2465)
@@ -1,177 +0,0 @@
-// ccm.core.enterprise.init
-//
-// Old initialization prozess configuration file.
-//
-
-
-// // init com.arsdigita.globalization.Initializer {
-// init com.arsdigita.globalization.LegacyInitializer {
-// // See http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc
-// charsets = {
-// "ISO-8859-1",
-// "UTF-8"
-// };
-//
-// // Each entry in the "locales" list is a 4-tuple of the form
-// // {language, country, variant, charset}
-// // The charset must be one of the values specified in the "charsets"
-// // parameter above.
-// locales = {
-// {"en", "", "", "UTF-8"},
-// {"en", "GB", "", "UTF-8"},
-// {"en", "US", "", "UTF-8"},
-// {"es", "", "", "UTF-8"},
-// {"es", "ES", "", "UTF-8"},
-// {"da", "", "", "UTF-8"},
-// {"da", "DK", "", "UTF-8"},
-// {"de", "", "", "UTF-8"},
-// {"de", "DE", "", "UTF-8"},
-// {"fr", "", "", "UTF-8"},
-// {"fr", "FR", "", "UTF-8"},
-// {"ru", "", "", "UTF-8"}
-// };
-//
-// // Default character set for locales not explicitly listed above.
-// defaultCharset = "UTF-8";
-// }
-//
-
-//- init com.arsdigita.kernel.LegacyInitializer {}
-
-// Should get integrated into the same configuration file as parameter
-// waf.debug, i.e. ccm-core/kernel.properties.
-//- init com.arsdigita.webdevsupport.LegacyInitializer {
-//- active = false;
-//- }
-
-
-
-// /////////////////////////////////////////////////////////////////
-//
-// Initializer definitely replaced by new initialization system
-//
-// /////////////////////////////////////////////////////////////////
-
-// Move configuration options to enterprise.init.nolongerInUse
-
-// -init com.arsdigita.kernel.security.LegacyInitializer {
-// - securityHelperClass = "com.arsdigita.kernel.security.DefaultSecurityHelper";
-// - sessionTrackingMethod = "cookie";
-// -
-// - excludedExtensions = { ".jpg", ".gif", ".png", ".pdf" };
-// -
-// -}
-
-
-// Set to true when using intermedia search
-//-init com.arsdigita.mimetypes.LegacyMimeTypeInitializer {
-//- INSOFilterEnabled = false;
-//-}
-
-
-
-// init com.arsdigita.toolbox.CharsetEncodingProviderInitializer { }
-
-// init com.arsdigita.ui.LegacyInitializer {
-// If using the default SimplePage class, the following
-// two parameters specify the class names of the bebop
-// components to (optionally) add to margins of pages
-
-// The is default set of page components
-// defaultLayout = {
-// { "top", "com.arsdigita.ui.UserBanner" },
-// { "bottom", "com.arsdigita.ui.SiteBanner" },
-// { "bottom", "com.arsdigita.ui.DebugPanel" }
-// // { "left", "com.arsdigita.x.y.z" },
-// // { "right", "com.arsdigita.x.y.z" }
-// };
-
-// }
-
-// init com.arsdigita.portal.Initializer { }
-// init com.arsdigita.portal.LegacyInitializer { }
-
-
-// The formbuilder application is now deprecated and will
-// be removed in the next release. Use the FormItem content
-// type instead
-// Method commend says:
-// /**
-// * Called on startup. Note. As you can not find a call
-// * to this method in enterprise.ini, this method
-// * may appear to execute mysteriously.
-// * However, the process that runs through enterprise.ini
-// * automitically calls the startup() method of any
-// * class that implements com.arsdigita.util.initializer.Initializer
-// * present in enterprise.ini
-// **/
-// Has to be checked in detail. As of version 6.5 a lot of packages nevertheless
-// are using it!
-//
-// init com.arsdigita.formbuilder.Initializer { }
-
-// This is an example initializer for populating
-// the BebopObjectType & MetaObject stores
-//init com.arsdigita.formbuilder.installer.Initializer {
-// widgetTypes = {
-// { "forms", "Checkbox group", "Checkbox groups",
-// "com.arsdigita.formbuilder.PersistentCheckboxGroup",
-// "com.arsdigita.formbuilder.ui.editors.CheckboxGroupEditor" },
-// { "forms", "Date field", "Date fields",
-// "com.arsdigita.formbuilder.PersistentDate",
-// "com.arsdigita.formbuilder.ui.editors.DateForm" }
-// };
-// processListenerTypes = {
-// { "forms", "Confirmation email", "Confirmation emails",
-// "com.arsdigita.formbuilder.actions.ConfirmEmailListener",
-// "com.arsdigita.formbuilder.ui.editors.ConfirmEmailForm" },
-// { "forms", "URL redirect", "URL redirects",
-// "com.arsdigita.formbuilder.actions.ConfirmRedirectListener",
-// "com.arsdigita.formbuilder.ui.editors.ConfirmRedirectForm" }
-// };
-// dataQueries = {
-// { "forms", "com.arsdigita.formbuilder.DataQueryUsers",
-// "List of all registered users" },
-// { "forms", "com.arsdigita.formbuilder.DataQueryPackages",
-// "List of all installed packages" }
-// };
-//}
-
-// init com.arsdigita.populate.apps.Initializer {
-// numApps=3;
-// PopulateAppPair = {
-// //populateForum args: numPosts, numMsgs per post
-// { "com.arsdigita.forum.PopulateForum", {3, 5}},
-// //populateDocmgr args: numFolderLevels, numFolders, numFiles
-// { "com.arsdigita.docmgr.PopulateDocmgr", {3, 2, 2}},
-// //populateFaq args: numQuestions
-// { "com.arsdigita.faq.PopulateFaq", {5}},
-// //populateGlossary args: numWords
-// { "com.arsdigita.glossary.PopulateGlossary", {5}},
-// //populateBookmarks args: numBookmarks
-// { "com.arsdigita.bookmarks.PopulateBookmarks", {5}}
-// };
-// }
-
-// no longer used - old versioning system?
-// init com.arsdigita.versioning.Initializer { }
-
-// Application specific page components
-// applicationLayouts = {
-// { "forums",
-// {
-// { "top", "com.arsdigita.x.y.z" },
-// { "left", "com.arsdigita.x.y.z" },
-// { "bottom", "com.arsdigita.x.y.z" },
-// { "right", "com.arsdigita.x.y.z" }
-// }
-// },
-// { "search",
-// {
-// { "top", "com.arsdigita.x.y.z" },
-// { "left", "com.arsdigita.x.y.z" },
-// { "bottom", "com.arsdigita.x.y.z" },
-// { "right", "com.arsdigita.x.y.z" }
-// }
-// }
-// };
Deleted: trunk/ccm-core/src/com/arsdigita/core/enterpriseold.init.nolongerInUse
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/enterpriseold.init.nolongerInUse 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/core/enterpriseold.init.nolongerInUse 2013-02-02 17:32:18 UTC (rev 2465)
@@ -1,83 +0,0 @@
-// ccm.core.enterprise.init.nolongerInUse
-//
-// Old initialization prozess configuration file.
-// configurations definitely no longer used (refactored into new initializser system)
-//
-
-
-
-
-// /////////////////////////////////////////////////////////////////
-//
-// Initializer definitely replaced by new initialization system
-//
-// /////////////////////////////////////////////////////////////////
-
-
-// -- As of version 6.6.0 release 12 refactored into the new initializer system
-// -- and no longer in use.
-// -- As of version 6.5.x still in use!
-//init com.arsdigita.notification.LegacyInitializer {
-// RequestManagerDelay = 900; // in seconds
-// RequestManagerPeriod = 900; // in seconds
-// SimpleQueueDelay = 900; // in seconds
-// SimpleQueuePeriod = 900; // in seconds
-// DigestQueueDelay = 900; // in seconds
-// DigestQueuePeriod = 900; // in seconds
-//}
-
-
-// As of version 6.5.x still in use!
-// May be ommitted if ccm-ldn-search is used which sets the search engine
-// by its own (Lucene)
-// As of version 6.6.0 release 2 refactored into the new initializer system.
-// Lucene is now initialized as a sub-initializer of ccm-core initializer.
-// init com.arsdigita.search.LegacyInitializer {}
-
-// As of version 6.5.x still in use!
-// As of version 6.6.0 release 2 refactored into the new initializer system.
-// Lucene is now initialized as a sub-initializer of ccm-core initializer.
-//-- init com.arsdigita.search.lucene.LegacyInitializer {}
-
-// As of version 6.5.x still in use!
-// Comment in to use intermedia search
-// As of version 6.6.0 release 2 refactored into the new initializer system.
-// Intermedia is now initialized as a sub-initializer of ccm-core initializer.
-// It is configured via waf.search.indexer Parameter (may be lucene or intermedia).
-// If not enabled, initialization is skipped.
-//init com.arsdigita.search.intermedia.LegacyInitializer {
-// timerDelay = 60; // Parameters for search timer/indexing
-// syncDelay = 60; // All units are time in seconds
-// maxSyncDelay = 7200; // see com.arsdigita.search.BuildIndex.java
-// maxIndexingTime = 7200; // for definitions
-// indexingRetryDelay = 60;
-//}
-
-// Package does no longer exist.
-// init com.arsdigita.categorization.dispatch.Initializer { }
-
-// Application specific page components
-// applicationLayouts = {
-// { "forums",
-// {
-// { "top", "com.arsdigita.x.y.z" },
-// { "left", "com.arsdigita.x.y.z" },
-// { "bottom", "com.arsdigita.x.y.z" },
-// { "right", "com.arsdigita.x.y.z" }
-// }
-// },
-// { "search",
-// {
-// { "top", "com.arsdigita.x.y.z" },
-// { "left", "com.arsdigita.x.y.z" },
-// { "bottom", "com.arsdigita.x.y.z" },
-// { "right", "com.arsdigita.x.y.z" }
-// }
-// }
-// };
-
-
-// init com.arsdigita.localization.demo.Initializer { }
-
-// Class no longer part of source code
-// init com.arsdigita.bebop.jsp.Initializer { }
Added: trunk/ccm-core/src/com/arsdigita/core/mimetypes.properties
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/mimetypes.properties (rev 0)
+++ trunk/ccm-core/src/com/arsdigita/core/mimetypes.properties 2013-02-02 17:32:18 UTC (rev 2465)
@@ -0,0 +1,60 @@
+"application/octet-stream", "binary data", "bin,uu,saveme,dump,hqx,arc,o,a,exe,z,jar", "MimeType"
+"application/x-dvi", "dvi file", "dvi", "MimeType"
+"application/x-latex", "latex file", "latex", "MimeType"
+"application/x-tex", "tex file", "tex", "MimeType"
+"application/x-texinfo", "texinfo file", "texinfo,texi", "MimeType"
+"application/x-troff", "troff file", "tr,t,troff", "MimeType"
+"application/x-troff-man", "troff-man file", "man", "MimeType"
+"application/x-troff-me", "troff-me file", "me", "MimeType"
+"application/x-troff-ms", "troff-ms file", "ms", "MimeType"
+"application/x-wais-source", "wais source file", "src,wsrc", "MimeType"
+"application/zip", "zip file", "zip", "MimeType"
+"application/gzip", "gzip file", "gz", "MimeType"
+"application/x-tar", "tar file", "tar", "MimeType"
+"audio/basic", "basic sound file", "snd,au", "MimeType"
+"audio/x-aiff", "aif sound file", "sound,aifc,aif,aiff", "MimeType"
+"audio/x-wav", "wav audio file", "wav", "MimeType"
+"video/mpeg", "mpg video", "mpg,mpe", "MimeType"
+"video/quicktime", "quicktime video", "mov,qt", "MimeType"
+"application/x-msvideo", "avi movie", "avi", "MimeType"
+"video/x-sgi-movie", "mv movie", "mv,movie", "MimeType"
+"application/vnd.visio", "visio file", "vsd,vst,vsw,vss", "MimeType"
+"application/pdf", "Adobe Acrobat", "pdf", "TextMimeType", "1"
+"application/msword", "Microsoft Word document formatted", "doc", "TextMimeType", "1"
+"application/msaccess", "Microsoft Access Database file", "mdb", "MimeType"
+"application/msexcel", "Microsoft Excel document", "xls", "TextMimeType", "1"
+"application/ms-powerpoint", "Microsoft Powerpoint file", "ppt,pps,pot", "MimeType"
+"application/postscript", "encapsulated PostScript", "ps,eps,ai", "TextMimeType","1"
+"application/rtf", "rich text format", "rtf", "TextMimeType", "1"
+"application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Microsoft Office Open XML Word Document", "docx", "TextMimeType", "1""application/vnd.sun.xml.writer", "OpenOffice Writer", "sxw", "TextMimeType", "1"
+"application/vnd.openxmlformats-officedocument.presentationml.presentation", "Microsoft Office Open XML Powerpoint Document", "pptx", "MimeType"
+"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Microsoft Office Open XML Excel Document", "xlsx", "TextMimeType", "1"
+"application/vnd.sun.xml.writer.template", "OpenOffice Writer Template", "stw", "TextMimeType", "1"
+"application/vnd.sun.xml.calc", "OpenOffice SpreadSheets", "sxc", "TextMimeType", "1"
+"application/vnd.sun.xml.calc.template", "OpenOffice SpreadSheets Template", "stc", "TextMimeType", "1"
+"application/vnd.sun.xml.draw", "OpenOffice Draw", "sxd", "MimeType"
+"application/vnd.sun.xml.draw.template", "OpenOffice Draw Template", "std", "MimeType"
+"application/vnd.sun.xml.impress", "OpenOffice Impress", "sxi", "MimeType"
+"application/vnd.sun.xml.impress.template", "OpenOffice Impress Template", "sti", "MimeType"
+"application/vnd.sun.xml.writer.global", "OpenOffice Writer Global", "sxg", "TextMimeType", "1"
+"application/vnd.sun.xml.math", "OpenOffice Math", "sxm", "TextMimeType", "1"
+"text/xml", "xml", "xml,xsl,xsd", "TextMimeType", "0"
+"text/html", "HTML text", "html,htm", "TextMimeType", "0"
+"text/css", "Cascading Style Sheet", "css", "TextMimeType", "0"
+"text/plain", "Plain text", "txt,text,c,cc,c++,h,pl,java", "TextMimeType", "0"
+"text/sgml", "sgml text", "sgm,sgml", "TextMimeType", "0"
+"text/x-jsp", "JSP code", "jsp", "TextMimeType", "0"
+"image/gif", "GIF image", "gif", "ImageMimeType", "com.arsdigita.mimetypes.image.GIFImageSizer"
+"image/ief", "ief image", "ief", "ImageMimeType", ""
+"image/jpeg", "JPG image", "jpg,jpe,jpeg", "ImageMimeType", "com.arsdigita.mimetypes.image.JPEGImageSizer"
+"image/tiff", "tif image", "tif,tiff", "ImageMimeType", ""
+"image/x-cmu-rast", "raster image", "ras", "ImageMimeType", ""
+"image/x-portable-anymap", "anymap image", "pnm", "ImageMimeType", ""
+"image/x-portable-bitmap", "bitmap image", "pbm", "ImageMimeType", ""
+"image/x-portable-graymap", "graymap image", "pgm", "ImageMimeType", ""
+"image/x-portable-pixmap", "pixmap image", "ppm", "ImageMimeType", ""
+"image/x-rgb", "rgb image", "rgb", "ImageMimeType", ""
+"image/x-xbitmap", "xbm image", "xbm", "ImageMimeType", ""
+"image/x-xwindowdump", "x-windowdump", "xwd", "ImageMimeType", ""
+"image/bmp", "Windows BMP", "bmp", "ImageMimeType", "com.arsdigita.mimetypes.image.BMPImageSizer"
+"image/png", "PNG image", "png", "ImageMimeType", ""
Modified: trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java 2013-02-02 17:32:18 UTC (rev 2465)
@@ -19,7 +19,7 @@
package com.arsdigita.core.upgrade;
-import com.arsdigita.loader.CoreLoader;
+import com.arsdigita.core.Loader;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
import com.arsdigita.util.cmd.Program;
@@ -90,28 +90,28 @@
// Previously login had been managed by a (virtual) root
// sitenode with login dispatcher associated.
// Login application is newly created, old sitenote deactivated.
- CoreLoader.loadLoginApp();
+ Loader.loadLoginApp();
// Update core Admin application
// Old style package type already removed by sql script.
// Create a (new type, legacy free) web.ApplicationType type
// application
- CoreLoader.loadAdminApp();
+ Loader.loadAdminApp();
// Update core permission support
// Old style package type already removed by sql script.
// Create a (new type, legacy free) web.ApplicationType type
// application
- CoreLoader.loadPermissionsApp();
+ Loader.loadPermissionsApp();
// Update core WebDeveloperSupport
// Old style package type already removed by sql script.
// Create a (new type, legacy free) web.ApplicationType type
// application
- CoreLoader.loadWebDev();
+ Loader.loadWebDev();
// Note: Old PackageType sitenode removed. It's useless now
Modified: trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/kernel/Initializer.java 2013-02-02 17:32:18 UTC (rev 2465)
@@ -20,8 +20,8 @@
import com.arsdigita.developersupport.DeveloperSupport;
import com.arsdigita.domain.DomainObject;
+import com.arsdigita.kernel.permissions.PermissionManager;
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
-import com.arsdigita.kernel.permissions.PermissionManager;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID;
import com.arsdigita.runtime.ContextInitEvent;
Deleted: trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2013-02-02 17:32:18 UTC (rev 2465)
@@ -1,690 +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.loader;
-
-import com.arsdigita.domain.DataObjectNotFoundException;
-import com.arsdigita.globalization.Charset;
-import com.arsdigita.globalization.Locale;
-import com.arsdigita.kernel.EmailAddress;
-import com.arsdigita.kernel.Group;
-import com.arsdigita.kernel.GroupCollection;
-import com.arsdigita.kernel.Kernel;
-import com.arsdigita.kernel.KernelExcursion;
-import com.arsdigita.kernel.PackageInstance;
-import com.arsdigita.kernel.PackageType;
-import com.arsdigita.kernel.ResourceType;
-import com.arsdigita.kernel.SiteNode;
-import com.arsdigita.kernel.User;
-import com.arsdigita.kernel.UserAuthentication;
-import com.arsdigita.kernel.permissions.PermissionService;
-import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
-import com.arsdigita.kernel.permissions.UniversalPermissionDescriptor;
-import com.arsdigita.kernel.security.KeyStorage;
-import com.arsdigita.mimetypes.ImageMimeType;
-import com.arsdigita.mimetypes.MimeType;
-import com.arsdigita.mimetypes.MimeTypeExtension;
-import com.arsdigita.mimetypes.TextMimeType;
-import com.arsdigita.portal.Portal;
-import com.arsdigita.runtime.ConfigError;
-import com.arsdigita.runtime.ScriptContext;
-import com.arsdigita.ui.admin.Admin;
-import com.arsdigita.ui.login.Login;
-import com.arsdigita.ui.permissions.Permissions;
-import com.arsdigita.util.Assert;
-import com.arsdigita.util.StringUtils;
-import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.util.parameter.CSVParameterReader;
-import com.arsdigita.util.parameter.EmailParameter;
-import com.arsdigita.util.parameter.Parameter;
-import com.arsdigita.util.parameter.StringArrayParameter;
-import com.arsdigita.util.parameter.StringParameter;
-import com.arsdigita.util.servlet.HttpHost;
-import com.arsdigita.web.Application;
-import com.arsdigita.web.ApplicationType;
-import com.arsdigita.web.Host;
-import com.arsdigita.web.Web;
-import com.arsdigita.webdevsupport.WebDevSupport;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.mail.internet.InternetAddress;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * CoreLoader
- *
- * @author Rafael H. Schloming <rh...@mi...>
- * @version $Revision: #15 $ $Date: 2004/08/16 $
- * @version $Id$
- */
-public class CoreLoader extends PackageLoader {
-
- private static final Logger s_log = Logger.getLogger(CoreLoader.class);
-
- private EmailParameter m_email = new EmailParameter("waf.admin.email");
-
- private StringParameter m_screen = new StringParameter
- ("waf.admin.name.screen", Parameter.OPTIONAL, null) {
- @Override
- public Object getDefaultValue() {
- String email = getEmail();
- if (email == null) {
- return null;
- } else {
- int index = email.indexOf("@");
- if (index > 0) {
- return email.substring(0, index);
- } else {
- return email;
- }
- }
- }
- };
-
- private StringParameter m_given = new StringParameter
- ("waf.admin.name.given", Parameter.REQUIRED, null);
-
- private StringParameter m_family = new StringParameter
- ("waf.admin.name.family", Parameter.REQUIRED, null);
-
- private StringParameter m_password = new StringParameter
- ("waf.admin.password", Parameter.REQUIRED, null);
-
- private StringParameter m_question = new StringParameter
- ("waf.admin.password.question", Parameter.REQUIRED, null);
-
- private StringParameter m_answer = new StringParameter
- ("waf.admin.password.answer", Parameter.REQUIRED, null);
-
- private StringParameter m_dispatcher = new StringParameter
- ("waf.login.dispatcher", Parameter.OPTIONAL,
- "com.arsdigita.ui.login.DummyDispatcher");
- // "com.arsdigita.ui.login.SubsiteDispatcher");
-
- private StringParameter m_resource = new StringParameter
- ("waf.mime.resource", Parameter.OPTIONAL,
- "com/arsdigita/loader/mimetypes.properties");
-
- /**
- * Recognized character sets
- */
- // In Old Initializer: CHARSETS as List.class
- // charsets = {"ISO-8859-1","UTF-8"};
- private final Parameter m_charsets =
- new StringArrayParameter(
- "waf.globalization.charsets",
- Parameter.REQUIRED,
- new String[] { "ISO-8859-1","UTF-8" }
- );
-
- /**
- * Each entry in the "locales" list is a 4-tuple of the form
- * {language, country, variant, charset}
- * The charset must be one of the values specified in the "charsets"
- * parameter above.
- *
- * This parameter is only read once in the initial loading step and stored
- * in the database (g11n_locales). Subsequent modifications will have no effect!
- *
- */
- // In OLD Initializer: LOCALES as List.class
- private final Parameter m_locales =
- new StringArrayParameter(
- "waf.globalization.locales",
- Parameter.REQUIRED,
- new String[] {"en: : :UTF-8","en:GB: :UTF-8","en:US: :UTF-8"
- ,"es: : :UTF-8","es:ES: :UTF-8"
- ,"da: : :UTF-8","da:DK: :UTF-8"
- ,"de: : :UTF-8","de:DE: :UTF-8"
- ,"fr: : :UTF-8","fr:FR: :UTF-8"
- ,"ru: : :UTF-8"
- }
- );
-
- public CoreLoader() {
- register(m_email);
- register(m_screen);
- register(m_given);
- register(m_family);
- register(m_password);
- register(m_question);
- register(m_answer);
- register(m_dispatcher);
- register(m_resource);
- register(m_charsets);
- register(m_locales);
-
- loadInfo();
- }
-
- private String getEmail() {
- return ((InternetAddress) get(m_email)).toString();
- }
-
- private String getScreen() {
- return (String) get(m_screen);
- }
-
- private String getGiven() {
- return (String) get(m_given);
- }
-
- private String getFamily() {
- return (String) get(m_family);
- }
-
- private String getPassword() {
- return (String) get(m_password);
- }
-
- private String getQuestion() {
- return (String) get(m_question);
- }
-
- private String getAnswer() {
- return (String) get(m_answer);
- }
-
- private String getDispatcher() {
- return (String) get(m_dispatcher);
- }
-
- private String getResource() {
- return (String) get(m_resource);
- }
-
- /**
- * Retrieve systems recognized character sets.
- *
- * @return List of recognized character sets.
- */
- private List getCharsets() {
- String[] charsets = (String[]) get(m_charsets) ;
- return (List) Arrays.asList(charsets) ;
- }
-
- /**
- * Retrieve the list of supported locales
- *
- */
- private List getLocales() {
-
- /** Value of the locales parameter, a string array of
- 4-tuple of locale values (see above) */
- String[] locales = (String[]) get(m_locales) ;
-
- if (locales != null) {
- ArrayList localeTupel = new ArrayList();
- for (int i = 0; i < locales.length ; ++i) {
- String[] localeSet = StringUtils.split(locales[i],':');
- localeTupel.add(Arrays.asList(localeSet));
- }
- return localeTupel;
- } else {
-
- return null;
-
- }
- }
-
- public void run(final ScriptContext ctx) {
- s_log.debug("CoreLoader run method started.");
- new KernelExcursion() {
- public void excurse() {
- setEffectiveParty(Kernel.getSystemParty());
-
- s_log.debug("CoreLoader: Going to init KeyStorage.");
- KeyStorage.KERNEL_KEY_STORE.init();
-
- s_log.debug("CoreLoader: Going to execute loadHost().");
- loadHost();
-
- s_log.debug("CoreLoader: Going to execute loadSubsite().");
- loadSubsite(loadKernel());
-
- s_log.debug("CoreLoader: Going to execute loadLoginApp().");
- loadLoginApp();
-
- s_log.debug("CoreLoader: Going to execute loadAdminApp().");
- loadAdminApp();
-
- s_log.debug("CoreLoader: Going to execute loadPermissionsApp().");
- loadPermissionsApp(); // new style legacy free
-
- s_log.debug("CoreLoader: Going to execute loadWebDev().");
- loadWebDev(); // new style legacy free
-
- s_log.debug("CoreLoader: Going to execute loadPortal().");
- loadPortal();
-
- s_log.debug("CoreLoader: Going to execute loadMimeTypes().");
- loadMimeTypes();
-
- s_log.debug("CoreLoader: Going to execute loadGlobalization().");
- loadGlobalization();
-
- }
- }.run();
- s_log.debug("CoreLoader run method completed.");
- }
-
- /**
- * Subject to change.
- */
- public static void loadHost() {
-
- final HttpHost hhost = Web.getConfig().getHost();
- Assert.exists(hhost, HttpHost.class);
-
- final Host host = Host.retrieve(hhost);
-
- if (host == null) {
- Host.create(hhost.getName(), hhost.getPort());
- }
-
- // Loader for lucene search engine.
- // Used to invoke static class LoaderImpl - method load() in
- // com.arsdigita.search.lucene.IndexId. Same procedure is invoked by
- // the initializer each time the system starts. So it's redundant here.
- // Using initializer code is favourable because it may be conditionally
- // performed, depending on configuration (Lucene or Intermedia).
- // But the currently given implementation requires the loader
- // instruction here to let the code initialization time (i.e. at each
- // startup) work properly. If left out here instantiation in
- // c.ad.search.lucene.Initializer (public final static Loader LOADER)
- // doesn't work!
- com.arsdigita.search.lucene.Initializer.LOADER.load();
-
- }
-
- /**
- *
- * @param rootNode
- * @deprecated will be removed without replacement. Naot needed anymore
- */
- private void loadSubsite(SiteNode rootNode) {
- s_log.debug("CoreLoader: Going to execute method loadSubsite().");
- String sDispatcher = "";
-
- PackageInstance packageInstance = rootNode.getPackageInstance();
- if (packageInstance == null) {
- throw new IllegalStateException
- ("No package instance mounted at the root node");
- }
- PackageType subsite = packageInstance.getType();
-
- // getType() returns a disconnected object. To get a connected object
- // we do a findByKey(key).
- String packageKey = subsite.getKey();
- try {
- subsite = PackageType.findByKey(packageKey);
- } catch (DataObjectNotFoundException e) {
- throw new IllegalStateException
- ("Package Type with key \"" + packageKey + "\" was not found.\n");
- }
-
- // Set subsite dispatcher class.
- subsite.setDispatcherClass(getDispatcher());
- }
-
- /**
- * Create Root Site Node for loadSubsite()
- * @return root node
- * @deprecated will be removed without replacement. Naot needed anymore
- */
- private SiteNode loadKernel() {
- // Create Root Site Node
- s_log.debug("CoreLoader: Going to execute method loadKernel().");
-
- final SiteNode rootNode = SiteNode.createSiteNode(null, null);
- s_log.debug("loadKernel: creating system administrator.");
- createSystemAdministrator();
-
- // Create Package Types and Instances
- s_log.debug("loadKernel: creating Package Types and Instances.");
- PackageType subsite = PackageType.create
- ("acs-subsite", "ACS Subsite", "ACS Subsites",
- "http://arsdigita.com/acs-subsite/");
- PackageInstance subsiteInstance = subsite.createInstance("Main Site");
-
- // Mount instances.
- s_log.debug("loadKernel: mount Instances.");
- rootNode.mountPackage(subsiteInstance);
-
- s_log.debug("CoreLoader: Going to complete method loadKernel().");
- return rootNode;
- }
-
-
-
- /**
- * Ensure that at least one User with universal "admin" permission exists
- * after installation.
- */
- private void createSystemAdministrator() {
- s_log.debug("CoreLoader: execution of method createSystemAdministrator().");
- final String DO_NOT_CREATE = "*do not create*";
-
- String emailAddress = getEmail();
- String screenName = getScreen();
- String givenName = getGiven();
- String familyName = getFamily();
- String password = getPassword();
- String passwordQuestion = getQuestion();
- String passwordAnswer = getAnswer();
- s_log.debug("createSystemAdministrator: EmailAddr: " + emailAddress +
- "\n screenName: " + screenName +
- "\n givenName: " + givenName );
-
- // Allow not creating system administrator account.
- // (Specified by setting parameter
- // systemAdministratorEmailAddress = "*do not create*").
- // This enables the administrator account to be made using
- // other initializers (e.g. LDAP).
-
- if (emailAddress.equals(DO_NOT_CREATE)) {
- s_log.warn("WARNING: System administrator account not created "
- + "because email set to '*do not create*'.\n This "
- + "will cause problems *unless* account is setup "
- + "another way (for example, by an LDAP initializer).");
- return;
- }
-
- // Create the system administrator user.
-
- s_log.debug("createSystemAdministrator(): going to create new User.");
- User sa = new User();
- sa.setPrimaryEmail(new EmailAddress(emailAddress));
- if (screenName != null &&
- screenName.length() > 0) {
- sa.setScreenName(screenName);
- }
- sa.getPersonName().setGivenName(givenName);
- sa.getPersonName().setFamilyName(familyName);
-
- // Save the system administrator's authentication credentials.
- s_log.debug("createSystemAdministrator(): going to save credentials.");
- UserAuthentication auth = UserAuthentication.createForUser(sa);
- auth.setPassword(password);
- auth.setPasswordQuestion(passwordQuestion);
- auth.setPasswordAnswer(passwordAnswer);
-
- // Grant the system administrator universal "admin" permission.
-
- s_log.debug("createSystemAdministrator(): going to grant admin perms.");
- PermissionService.grantPermission
- (new UniversalPermissionDescriptor
- (PrivilegeDescriptor.ADMIN, sa));
-
- // Add system administrator to site-wide administrator group
- GroupCollection groupColl = Group.retrieveAll();
- // FIXME: String for Site-wide Admininistrators is hardcoded because
- // this group in inserted via sql-command during setup
- groupColl.filter("Site-wide Administrators");
- if(groupColl.next()) {
- groupColl.getGroup().addMember(sa);
- }
- groupColl.close();
-
- s_log.debug("Adding administrator: \"" + givenName + " " +
- familyName + "\" <" + emailAddress + ">");
- s_log.debug("CoreLoader: method createSystemAdministrator() completed.");
-
- }
-
- /**
- * Setup Login application. Loads type into database and instances the
- * single default instance.
- * Has to be public access in order to enable script Upgrade664 to use it.
- * @return
- */
- public static void loadLoginApp() {
-
- ApplicationType loginType =
- new ApplicationType("login",
- Login.BASE_DATA_OBJECT_TYPE );
- loginType.setDescription("CCM user login application");
- loginType.save();
-
-
- Application login = Application.createApplication(loginType,
- "register",
- "CCM Login",
- null);
- login.setDescription("CCM login instance");
-
- }
-
-
- /**
- * Setup core Admin application. Loads type into database and instances the
- * single default instance.
- * Has to be public access in order to enable script Upgrade664 to use it.
- */
- public static void loadAdminApp() {
-
- ApplicationType adminType =
- new ApplicationType("admin",
- Admin.BASE_DATA_OBJECT_TYPE );
- adminType.setDescription("CCM user and group administration");
- adminType.save();
-
-
- Application admin = Application.createApplication(adminType,
- "admin",
- "CCM Admin",
- null);
- admin.setDescription("CCM user and group administration instance");
-
- }
-
- /**
- * Setup core Admin application. Loads type into database and instances the
- * single default instance.
- * Has to be public access in order to enable script Upgrade664 to use it.
- */
- public static void loadPermissionsApp() {
-
- /* NOTE:
- * The wording in the title parameter of ApplicationType determines
- * the name of the subdirectory for the XSL stylesheets.
- * It gets "urlized", i.e. trimming leading and trailing blanks and
- * replacing blanks between words and illegal characters with an hyphen
- * and converted to lower case.
- * Example: "Permissions" will become "permissions".
- */
- ApplicationType type =
- new ApplicationType("Permissions",
- Permissions.BASE_DATA_OBJECT_TYPE );
- type.setDescription("CCM permissions administration");
- type.save();
-
- Application app = Application.createApplication(type,
- "permissions",
- "CCM Permissions",
- null);
- app.setDescription("CCM permissions administration instance");
- app.save();
-
- return;
- }
-
- /**
- * Loads WebDeveloperSupport as a new style, legacy free application into
- * database and instantiate the (only) application instance.
- *
- * Public static access needed by upgrade script Upgrade664
- * @return webDevType ApplicationType
- */
- public static void loadWebDev() {
-
- ApplicationType webDevType =
- new ApplicationType("WebDev Support",
- WebDevSupport.BASE_DATA_OBJECT_TYPE );
- webDevType.setDescription("WebDeveloper Support application");
- webDevType.save();
-
- Application webDev = Application.createApplication(webDevType,
- "ds",
- "WebDeveloper Support",
- null);
- webDev.setDescription("The default WEB developer service instance.");
- webDev.save();
-
- return;
- }
-
- /**
- * Load core's basic portal infrastructure.
- */
- private void loadPortal() {
- s_log.info("Adding resource type: portal");
- // ResourceType manages the entries in table application_types and
- // therefore actually creates a sort of new style legacy free
- // application type
- ResourceType type = ResourceType.createResourceType
- ("Portal", Portal.BASE_DATA_OBJECT_TYPE);
- type.setDescription("A Portal!");
- }
-
- /**
- * Reads supported mime types from a file and ???.
- *
- * Run once during initial load.
- */
- private void loadMimeTypes() {
- ClassLoader cload = Thread.currentThread().getContextClassLoader();
- // get filename containing supported mime types as comma separated list
- String resource = getResource();
- InputStream is = cload.getResourceAsStream(resource);
- if (is == null) {
- throw new IllegalStateException("no such resource: " + resource);
- }
-
- try {
- MimeTypeRow row = new MimeTypeRow();
- CSVParameterReader loader = new CSVParameterReader
- (new InputStreamReader(is), row.getParameters());
-
- while (loader.next()) {
-
- row.load(loader);
-
- s_log.info("Adding mimetype: " + row.getType() + " (" +
- row.getLabel() + ")");
- MimeType mime = MimeType.createMimeType
- (row.getType(), row.getJavaClass(), row.getObjectType());
- mime.setLabel(row.getLabel());
- mime.setFileExtension(row.getDefaultExtension());
-
- if (mime instanceof TextMimeType) {
- ((TextMimeType) mime).setAllowINSOConvert
- ("1".equals(row.getSizerOrINSO()));
- }
- if (mime instanceof ImageMimeType) {
- ((ImageMimeType) mime).setImageSizer(row.getSizerOrINSO());
- }
- String[] extensions =
- StringUtils.split(row.getExtensions(), ',');
- for (int i = 0; i < extensions.length; i++) {
- MimeTypeExtension ext =
- MimeTypeExtension.create(extensions[i],
- mime.getMimeType());
- ext.save();
- }
- }
- } finally {
- try { is.close(); }
- catch (IOException e) { throw new UncheckedWrapperException(e); }
- }
- }
-
- private void loadGlobalization() throws ConfigError {
- List charsets = (List) getCharsets();
- if ( charsets == null ) {
- throw new ConfigError
- ("You must specify at least one charset in the m_charsets " +
- "parameter of the core loader parameter section. " +
- "UTF-8 would be a good first choice.");
- }
-
- Map charsetMap = new HashMap();
-
- for (Iterator i=charsets.iterator(); i.hasNext(); ) {
- String charsetName = (String) i.next();
- s_log.debug("Dealing with charset name: " + charsetName );
-
- // Check if this is a valid charset. Is there a better way to do
- // this? - va...@re..., Mon 2002-07-29 14:47:41 -0400
- try {
- new OutputStreamWriter(new ByteArrayOutputStream(), charsetName);
- } catch (UnsupportedEncodingException ex) {
- throw new ConfigError
- (charsetName + " is not a supported charset");
- }
- Charset charset = new Charset();
- charset.setCharset(charsetName);
- charset.save();
- charsetMap.put(charsetName, charset);
- }
-
- List locales = (List) getLocales();
-
- if ( locales == null ) {
- throw new ConfigError
- ("You must specify at least one locale in the m_locales " +
- "parameter of core loader parameter section. " +
- "The \"en\" locale is probably required.");
- }
-
- for (Iterator i=locales.iterator(); i.hasNext(); ) {
- List localeData = (List) i.next();
- String language = (String) localeData.get(0);
- String country = (String) localeData.get(1);
- String variant = (String) localeData.get(2);
- String charsetName = (String) localeData.get(3);
- Locale locale = new Locale(language, country, variant);
-
- Charset defaultCharset = (Charset) charsetMap.get(charsetName);
- if ( defaultCharset == null ) {
- throw new ConfigError
- ("You must list " + charsetName + " in the \"m_charsets\" " +
- "parameter before using it in the \"m_locales\" " +
- "\" parameter.");
- }
- locale.setDefaultCharset(defaultCharset);
- locale.save();
- }
- }
-
-}
Deleted: trunk/ccm-core/src/com/arsdigita/loader/CoreLoader_parameter.properties
===================================================================
--- trunk/ccm-core/src/com/arsdigita/loader/CoreLoader_parameter.properties 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/loader/CoreLoader_parameter.properties 2013-02-02 17:32:18 UTC (rev 2465)
@@ -1,49 +0,0 @@
-waf.admin.email.title=Administrator Email Address
-waf.admin.email.purpose=Creation of the system administrator account.
-waf...@ex...
-waf.admin.email.format=<user>@<domain>
-
-waf.admin.name.screen.title=Administrator Screen Name
-waf.admin.name.screen.purpose=Creation of the system administrator account.
-waf.admin.name.screen.example=joe
-
-waf.admin.name.given.title=Administrator First Name
-waf.admin.name.given.purpose=Creation of the system administrator account.
-waf.admin.name.given.example=John
-
-waf.admin.name.family.title=Administrator Last Name
-waf.admin.name.family.purpose=Creation of the system administrator account.
-waf.admin.name.family.example=Dough
-
-waf.admin.password.title=Administrator Password
-waf.admin.password.purpose=Creation of the system administrator account.
-
-waf.admin.password.question.title=Administrator Password Question
-waf.admin.password.question.purpose=Asked when the password to the system \
- administrator account is lost and access \
- must be recovered.
-waf.admin.password.question.example=Your mother's maiden name.
-
-waf.admin.password.answer.title=Administrator Password Answer
-waf.admin.password.answer.purpose=The correct answer to the \
- Administrator Password Question.
-waf.admin.password.answer.example=Dough
-
-waf.login.stylesheet.title=Login Stylesheet
-waf.login.stylesheet.purpose=Styles the login ui.
-
-waf.login.dispatcher.title=Login Dispatcher
-waf.login.dispatcher.purpose=Implements the login ui.
-
-waf.mime.resource.title=Mime Types Resource
-waf.mime.resource.purpose=Mime types are loaded from this resource
-
-waf.globalization.charsets.title=Recognized Character Sets
-waf.globalization.charsets.purpose=List containing the recognized character sets.
-waf.globalization.charsets.example="ISO-8859-1,UTF-8"
-waf.globalization.charsets.format=[StringArray]
-
-waf.globalization.locales.title=Locales
-waf.globalization.locales.purpose=List of locales, each local is a UNIQUE 4-tuple of the form language:country:variant:charset
-waf.globalization.locales.example="en: : :UTF-8, en:GB: :UTF-8, de: : :UTF-8, de:DE: :UTF-8"
-waf.globalization.locales.format=[StringArray]
Deleted: trunk/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java
===================================================================
--- trunk/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java 2013-02-02 17:23:03 UTC (rev 2464)
+++ trunk/ccm-core/src/com/arsdigita/loader/MimeTypeRow.java 2013-02-02 17:32:18 UTC (rev 2465)
@@ -1,106 +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.loader;
-
-import com.arsdigita.runtime.AbstractConfig;
-import com.arsdigita.util.parameter.Param...
[truncated message content] |