diff --git a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java index d1343f35c..5349b864f 100755 --- a/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java +++ b/ccm-cms-types-formitem/src/com/arsdigita/cms/ui/formbuilder/FormProperties.java @@ -30,17 +30,17 @@ import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.domain.DomainObject; import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.formbuilder.FormItem; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.util.GlobalizationUtil; -import com.arsdigita.formbuilder.PersistentForm; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; +import com.arsdigita.cms.util.GlobalizationUtil; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.formbuilder.PersistentForm; +import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; public class FormProperties extends SimpleEditStep { diff --git a/ccm-cms/src/com/arsdigita/cms/Initializer.java b/ccm-cms/src/com/arsdigita/cms/Initializer.java index 2ddfe25d3..33027d424 100755 --- a/ccm-cms/src/com/arsdigita/cms/Initializer.java +++ b/ccm-cms/src/com/arsdigita/cms/Initializer.java @@ -170,7 +170,7 @@ public class Initializer extends CompoundInitializer { // Old type initializer "com.arsdigita.formbuilder.installer.Initializer" // Used to initialize CMS forms using the forms in ccm-core // Can be replaced in ccm after ccm-core is migrated to new initializer. - add(new LegacyInitializer("com/arsdigita/cms/enterprise.init")); + // add(new LegacyInitializer("com/arsdigita/cms/enterprise.init")); s_log.debug("CMS.Initializer.(Constructor) completed"); } diff --git a/ccm-cms/src/com/arsdigita/cms/Loader.java b/ccm-cms/src/com/arsdigita/cms/Loader.java index a3a845458..f0e3c835d 100755 --- a/ccm-cms/src/com/arsdigita/cms/Loader.java +++ b/ccm-cms/src/com/arsdigita/cms/Loader.java @@ -34,6 +34,7 @@ import com.arsdigita.domain.DomainObject; // import com.arsdigita.domain.DomainObjectFactory; // import com.arsdigita.domain.DomainObjectInstantiator; import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.formbuilder.util.FormbuilderSetup; import com.arsdigita.kernel.ACSObjectInstantiator; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; @@ -223,6 +224,12 @@ public class Loader extends PackageLoader { //ContentSectionsPortlet.loadPortletType(); TaskPortlet.loadPortletType(); + // Loading forms widget into database + FormbuilderSetup fbs = new FormbuilderSetup(); + fbs.setup(s_conf.getWidgetTypes(), + s_conf.getProcessListenerTypes(), + s_conf.getDataQueries()); + } }.run(); diff --git a/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java b/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java index 597cadab3..7b4664d0e 100644 --- a/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java @@ -276,6 +276,110 @@ public final class LoaderConfig extends AbstractConfig { new String[] {"/WEB-INF/resources/article-categories.xml", "/WEB-INF/resources/navigation-categories.xml"} ); +// private final Parameter +// m_widgetTypes = new StringArrayParameter( +// "com.arsdigita.cms.loader.widget_types", +// Parameter.REQUIRED, +// new String[] {"/WEB-INF/resources/article-categories.xml", +// "/WEB-INF/resources/navigation-categories.xml"} ); + + + /** List of widgets used in applications forms. Each widget is described by + application indicator, widget name (singular & plural), model class name + and model ui class name. These are really not user or administrator + configurabel and therefore not implemented as ccm parameter. */ + private static List widgetTypes = Arrays.asList( + Arrays.asList("forms-cms", "Checkbox group", "Checkbox groups", + "com.arsdigita.formbuilder.PersistentCheckboxGroup", + "com.arsdigita.formbuilder.ui.editors.CheckboxGroupEditor"), + Arrays.asList("forms-cms", "Date field", "Date fields", + "com.arsdigita.formbuilder.PersistentDate", + "com.arsdigita.formbuilder.ui.editors.DateForm"), + Arrays.asList("forms-cms", "Hidden field", "Hidden fields", + "com.arsdigita.formbuilder.PersistentHidden", + "com.arsdigita.formbuilder.ui.editors.HiddenForm"), + Arrays.asList( "forms-cms", "Hidden ID Generator field", + "Hidden ID Generator fields", + "com.arsdigita.formbuilder.HiddenIDGenerator", + "com.arsdigita.formbuilder.ui.editors.HiddenIDGeneratorForm"), + Arrays.asList("forms-cms", "Multiple select box", + "Multiple select boxes", + "com.arsdigita.formbuilder.PersistentMultipleSelect", + "com.arsdigita.formbuilder.ui.editors.MultipleSelectEditor"), + Arrays.asList("forms-cms", "Password field", "Password fields", + "com.arsdigita.formbuilder.PersistentPassword", + "com.arsdigita.formbuilder.ui.editors.PasswordForm"), + Arrays.asList("forms-cms", "Radio group", "Radio groups", + "com.arsdigita.formbuilder.PersistentRadioGroup", + "com.arsdigita.formbuilder.ui.editors.RadioGroupEditor"), + Arrays.asList("forms-cms", "Single select box", + "Single select boxes", + "com.arsdigita.formbuilder.PersistentSingleSelect", + "com.arsdigita.formbuilder.ui.editors.SingleSelectEditor"), + Arrays.asList("forms-cms", "Submit button", "Submit buttons", + "com.arsdigita.formbuilder.PersistentSubmit", + "com.arsdigita.formbuilder.ui.editors.SubmitForm"), + Arrays.asList("forms-cms", "Text area", "Text areas", + "com.arsdigita.formbuilder.PersistentTextArea", + "com.arsdigita.formbuilder.ui.editors.TextAreaForm"), + Arrays.asList("forms-cms", "Text field", "Text fields", + "com.arsdigita.formbuilder.PersistentTextField", + "com.arsdigita.formbuilder.ui.editors.TextFieldForm"), + Arrays.asList("forms-cms", "Data Driven Select Box", + "Data Driven Select Boxes", + "com.arsdigita.formbuilder.DataDrivenSelect", + "com.arsdigita.formbuilder.ui.editors.DataDrivenSelectForm"), + Arrays.asList("forms-cms", "Text Description","Text Descriptions", + "com.arsdigita.formbuilder.PersistentText", + "com.arsdigita.formbuilder.ui.editors.TextForm"), + Arrays.asList("forms-cms", "Text Heading", "Text Headings", + "com.arsdigita.formbuilder.PersistentHeading", + "com.arsdigita.formbuilder.ui.editors.HeadingForm"), + Arrays.asList("forms-cms", "Section Break", "Section Break", + "com.arsdigita.formbuilder.PersistentHorizontalRule", + "com.arsdigita.formbuilder.ui.editors.HorizontalRuleForm"), + Arrays.asList("forms-cms", "User Email Field","User Email Fields", + "com.arsdigita.formbuilder.PersistentEmailField", + "com.arsdigita.formbuilder.ui.editors.EmailFieldForm") + ); + + /** List of process listeners used in applications forms. Each listener is + described by application indicator, process name (singular & plural), + action class name and action ui class name. These are really not user + or administrator configurabel and therefore not implemented as ccm + parameter. */ + private static List processListenerTypes = Arrays.asList( + Arrays.asList("forms-cms", "Confirmation email", + "Confirmation emails", + "com.arsdigita.formbuilder.actions.ConfirmEmailListener", + "com.arsdigita.formbuilder.ui.editors.ConfirmEmailForm"), + Arrays.asList("forms-cms", "URL redirect", "URL redirects", + "com.arsdigita.formbuilder.actions.ConfirmRedirectListener", + "com.arsdigita.formbuilder.ui.editors.ConfirmRedirectForm"), + Arrays.asList("forms-cms", "Simple email", "Simple emails", + "com.arsdigita.formbuilder.actions.SimpleEmailListener", + "com.arsdigita.formbuilder.ui.editors.SimpleEmailForm"), + Arrays.asList("forms-cms", "Templated email", "Templated emails", + "com.arsdigita.formbuilder.actions.TemplateEmailListener", + "com.arsdigita.formbuilder.ui.editors.TemplateEmailForm"), + Arrays.asList( "forms-cms", "Remote Server POST", + "Remote Server POSTs", + "com.arsdigita.formbuilder.actions.RemoteServerPostListener", + "com.arsdigita.formbuilder.ui.editors.RemoteServerPostForm" ), + Arrays.asList( "forms-cms", "XML email", "XML emails", + "com.arsdigita.formbuilder.actions.XMLEmailListener", + "com.arsdigita.formbuilder.ui.editors.XMLEmailForm" ) + ); + + + private static List dataQueries = Arrays.asList( + Arrays.asList("forms-cms", + "com.arsdigita.formbuilder.DataQueryUsers", + "List of all registered users"), + Arrays.asList("forms-cms", + "com.arsdigita.formbuilder.DataQueryPackages", + "List of all installed packages") + ); // Currently not a Loader task. There is no way to persist tasks preferences // on a per section base. @@ -549,6 +653,17 @@ public final class LoaderConfig extends AbstractConfig { return Arrays.asList(catFiles); } + public List getWidgetTypes() { + return widgetTypes; + } + + public List getProcessListenerTypes() { + return processListenerTypes; + } + + public List getDataQueries() { + return dataQueries; + } /** * Retrieve the */ diff --git a/ccm-cms/src/com/arsdigita/cms/enterprise.init b/ccm-cms/src/com/arsdigita/cms/enterprise.init.nolongerInUse similarity index 100% rename from ccm-cms/src/com/arsdigita/cms/enterprise.init rename to ccm-cms/src/com/arsdigita/cms/enterprise.init.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/core/Initializer.java b/ccm-core/src/com/arsdigita/core/Initializer.java index 8f87920f6..5b7a85608 100755 --- a/ccm-core/src/com/arsdigita/core/Initializer.java +++ b/ccm-core/src/com/arsdigita/core/Initializer.java @@ -106,7 +106,7 @@ public class Initializer extends CompoundInitializer { public final void init(final DomainInitEvent e) { super.init(e); - s_log.error("Running core init(DomainInitEvent) ..."); + s_log.debug("Running core init(DomainInitEvent) ..."); FactoriesSetup.setupFactories(); diff --git a/ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java b/ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java.nolongerInUse similarity index 96% rename from ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java rename to ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java.nolongerInUse index aa823c88b..3ccbe1863 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java +++ b/ccm-core/src/com/arsdigita/formbuilder/installer/Initializer.java.nolongerInUse @@ -34,6 +34,15 @@ import java.util.List; import com.arsdigita.formbuilder.PersistentDataQuery; import com.arsdigita.formbuilder.PersistentComponent; + +// ///////////////////////////////////////////////////////////////// +// +// REPLACED by formbuilder.util.FormbuilderSetup +// Not a initializer tast bud a loader task +// +// ///////////////////////////////////////////////////////////////// + + /** * Initializer * @@ -141,6 +150,7 @@ public class Initializer extends BaseInitializer { throws InitializationException { // If the objects list is not null, load the object list into the database + // pboy: Obviously, this is a Loader task. if (objects != null) { // XXX we don't yet delete types which are no longer in the list diff --git a/ccm-core/src/com/arsdigita/formbuilder/installer/package.html b/ccm-core/src/com/arsdigita/formbuilder/installer/package.html.nolongerInUse similarity index 100% rename from ccm-core/src/com/arsdigita/formbuilder/installer/package.html rename to ccm-core/src/com/arsdigita/formbuilder/installer/package.html.nolongerInUse diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java b/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java index 63e7a9dd4..edb2b8a27 100755 --- a/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java +++ b/ccm-core/src/com/arsdigita/formbuilder/util/FormBuilderUtil.java @@ -19,29 +19,19 @@ package com.arsdigita.formbuilder.util; -import com.arsdigita.formbuilder.util.GlobalizationUtil ; +// import com.arsdigita.formbuilder.util.GlobalizationUtil ; import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.form.TextArea; import com.arsdigita.bebop.FormData; - - import com.arsdigita.formbuilder.PersistentWidget; import com.arsdigita.formbuilder.parameters.PersistentParameterListener; - +import com.arsdigita.util.UncheckedWrapperException; import java.util.Iterator; -// Classes needed when when retrieving a Component DataObject - - - - -import com.arsdigita.util.UncheckedWrapperException; - -// ACS 5 uses Log4J for logging import org.apache.log4j.Logger; @@ -85,55 +75,9 @@ public class FormBuilderUtil { form.add(new TextArea(name)); } - /* - /** - * Return true if testClass implements the interfaceClass interface, false otherwise. - public static boolean classImplementsInterface(Class testClass, Class interfaceClass) { - Class[] classInterfaces = testClass.getInterfaces(); - for (int i = 0; i < classInterfaces.length; ++i) { - if (interfaceClass.getName().equals(classInterfaces[i].getName())) { - return true; - } - } - - return false; - } - - public static PersistentComponentFactory instantiateFactory(BigDecimal componentID) { - - Session session = SessionManager.getSession(); - - String factoryClassName = null; - - // Retrieve the component DataObject - OID oid = new OID("com.arsdigita.formbuilder.Component", componentID); - DataObject componentObject = session.retrieve(oid); - if (componentObject == null) { - throw new RuntimeException("could not retrieve DataObject with id " + oid.toString()); - } - - // Get the class name of the PersistentComponentFactory from the DataObject - factoryClassName = (String)componentObject.get("defaultDomainClass"); - - return (PersistentComponentFactory)instantiateObjectOneArg(factoryClassName, componentID); - } - - public static ACSObject instantiateObject(BigDecimal id) { - s_log.info("instantiate object with id " + id); - OID oid = new OID(ACSObject.BASE_DATA_OBJECT_TYPE, id); - Session s = SessionManager.getSession(); - DataObject o = s.retrieve(oid); - - ACSObject obj = - (ACSObject)FormBuilderUtil.instantiateObject((String)o.get(ACSObject.DEFAULT_DOMAIN_CLASS), - new Class[] { BigDecimal.class }, - new Object[] { id }); - return obj; - } - */ - - public static Object invokeMethod(java.lang.reflect.Method method, Object object, Object[] argumentList) { + public static Object invokeMethod(java.lang.reflect.Method method, + Object object, Object[] argumentList) { try { return method.invoke(object, argumentList); @@ -206,8 +150,8 @@ public class FormBuilderUtil { } /** - * Check if an integer argument is in range. The limits are inclusive so that an argument - * on the limit is allowed + * Check if an integer argument is in range. The limits are inclusive + * so that an argument on the limit is allowed */ public static void assertArgumentInRange(int argument, int lowerLimit, diff --git a/ccm-core/src/com/arsdigita/formbuilder/util/FormbuilderSetup.java b/ccm-core/src/com/arsdigita/formbuilder/util/FormbuilderSetup.java new file mode 100644 index 000000000..46db902f9 --- /dev/null +++ b/ccm-core/src/com/arsdigita/formbuilder/util/FormbuilderSetup.java @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2010 pboy (pboy@barkhof.uni-bremen.de) 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.formbuilder.util; + + +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.formbuilder.BebopObjectType; +import com.arsdigita.formbuilder.MetaObject; +import com.arsdigita.formbuilder.PersistentProcessListener; +import com.arsdigita.formbuilder.PersistentDataQuery; +import com.arsdigita.formbuilder.PersistentComponent; +//__import com.arsdigita.kernel.BaseInitializer; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.TransactionContext; +import com.arsdigita.runtime.ConfigError; + +import java.util.Iterator; + +import java.util.List; + +import org.apache.log4j.Logger; + + +/** + * + * @author pb + */ +public class FormbuilderSetup { + + /** A logger instance. */ + private static final Logger s_log = Logger.getLogger(FormbuilderSetup.class); + + /** + * Used by package loader of an application which uses formbuilder + * infrastructure to load its set of widget descriptions, process listeners, + * and dataqueries into database. + */ + public void setup(List widgets, + List processListeners, + List dataQueries) { + + // No transaction permitted here, handled by parent class! + // (usually PackageLoader or a child thereof) + loadMetaObjects(widgets, PersistentComponent.class); + loadMetaObjects(processListeners, PersistentProcessListener.class); + loadDataQueries(dataQueries); + + } + + public BebopObjectType getObjectType(String name, + Class type) { + BebopObjectType objectType = null; + try { + objectType = BebopObjectType.findByClass(name, type); + } catch (DataObjectNotFoundException ex) { + objectType = BebopObjectType.create(name, type); + objectType.save(); + } + return objectType; + } + + protected void loadMetaObjects(List objects, Class type) + throws ConfigError { + + // If the objects list is not null, load the object list into the database + // pboy: Obviously, this is a Loader task. + if (objects != null) { + + // XXX we don't yet delete types which are no longer in the list + Iterator objects_i = objects.iterator(); + while (objects_i.hasNext()) { + List object = (List) objects_i.next(); + + String appName = (String) object.get(0); + String prettyName = (String) object.get(1); + String prettyPlural = (String) object.get(2); + String className = (String) object.get(3); + String propertiesForm = (String) object.get(4); + + try { + Class.forName(className); + } catch (ClassNotFoundException ex) { + throw new ConfigError("cannot find class " + className); + } + try { + Class.forName(propertiesForm); + } catch (ClassNotFoundException ex) { + throw new ConfigError("cannot find class " + propertiesForm); + } + + try { + MetaObject mo = MetaObject.findByClassName( + getObjectType(appName, type), + className); + + mo.setPrettyName(prettyName); + mo.setPrettyPlural(prettyPlural); + mo.setWidgetClassName(className); + mo.setPropertiesFormName(propertiesForm); + + mo.save(); + } catch (DataObjectNotFoundException ex) { + MetaObject mo = MetaObject.create(getObjectType(appName, + type), + prettyName, + prettyPlural, + className, + propertiesForm); + mo.save(); + } + } + } + } + + protected void loadDataQueries(List objects) + throws ConfigError { + + // If the objects list is not null, load the object list into the database + if (objects != null) { + + // XXX we don't yet delete types which are no longer in the list + Iterator objects_i = objects.iterator(); + while (objects_i.hasNext()) { + List object = (List) objects_i.next(); + + String appName = (String) object.get(0); + String name = (String) object.get(1); + String description = (String) object.get(2); + + try { + PersistentDataQuery q = + PersistentDataQuery.findByName( + getObjectType(appName, + PersistentDataQuery.class), + name); + + q.setName(name); + q.setDescription(description); + + q.save(); + } catch (DataObjectNotFoundException ex) { + PersistentDataQuery q = + PersistentDataQuery.create( + getObjectType(appName, + PersistentDataQuery.class), + description, name); + q.save(); + } + } + } + } + +} diff --git a/ccm-core/src/com/arsdigita/globalization/GlobalizationConfig.java b/ccm-core/src/com/arsdigita/globalization/GlobalizationConfig.java index 4eb2e69be..0aa468cba 100644 --- a/ccm-core/src/com/arsdigita/globalization/GlobalizationConfig.java +++ b/ccm-core/src/com/arsdigita/globalization/GlobalizationConfig.java @@ -20,15 +20,9 @@ package com.arsdigita.globalization; import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.StringUtils; import com.arsdigita.util.parameter.StringParameter; -import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.Parameter; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; - import org.apache.log4j.Logger; diff --git a/ccm-core/src/com/arsdigita/kernel/Initializer.java b/ccm-core/src/com/arsdigita/kernel/Initializer.java index 444b3fa66..d60ccb6ba 100755 --- a/ccm-core/src/com/arsdigita/kernel/Initializer.java +++ b/ccm-core/src/com/arsdigita/kernel/Initializer.java @@ -145,12 +145,12 @@ public class Initializer extends GenericInitializer { // .getTransactionContext(); //txn.beginTxn(); - s_log.error("c.ad.kernel.Initializer: Initializing privilege descriptors..."); + s_log.debug("c.ad.kernel.Initializer: Initializing privilege descriptors..."); // Initialize privilege descriptors used in permissions service // Recurring task, reads from database and stores in an internal Map // field. PrivilegeDescriptor.initialize(); - s_log.error("Done."); + s_log.debug("Done."); //txn.commitTxn(); diff --git a/ccm-core/src/com/arsdigita/loader/CoreLoader.java b/ccm-core/src/com/arsdigita/loader/CoreLoader.java index 604aadba6..a8cf8c577 100755 --- a/ccm-core/src/com/arsdigita/loader/CoreLoader.java +++ b/ccm-core/src/com/arsdigita/loader/CoreLoader.java @@ -253,34 +253,34 @@ public class CoreLoader extends PackageLoader { } public void run(final ScriptContext ctx) { - s_log.error("CoreLoader run method started."); + s_log.debug("CoreLoader run method started."); new KernelExcursion() { public void excurse() { setEffectiveParty(Kernel.getSystemParty()); - s_log.error("CoreLoader: Going to init KeyStorage."); + s_log.debug("CoreLoader: Going to init KeyStorage."); KeyStorage.KERNEL_KEY_STORE.init(); - s_log.error("CoreLoader: Going to execute loadHost()."); + s_log.debug("CoreLoader: Going to execute loadHost()."); loadHost(); - s_log.error("CoreLoader: Going to execute loadSubsite()."); + s_log.debug("CoreLoader: Going to execute loadSubsite()."); loadSubsite(loadKernel()); - s_log.error("CoreLoader: Going to execute loadBebop()."); + s_log.debug("CoreLoader: Going to execute loadBebop()."); loadBebop(); - s_log.error("CoreLoader: Going to execute loadWebDev()."); + s_log.debug("CoreLoader: Going to execute loadWebDev()."); loadWebDev(); - s_log.error("CoreLoader: Going to execute loadSiteMapAdminApp()."); + s_log.debug("CoreLoader: Going to execute loadSiteMapAdminApp()."); loadSiteMapAdminApp(loadAdminApp()); - s_log.error("CoreLoader: Going to execute loadPermissionsSiteNode()."); + s_log.debug("CoreLoader: Going to execute loadPermissionsSiteNode()."); loadPermissionsSiteNode(); - s_log.error("CoreLoader: Going to execute loadPortal()."); + s_log.debug("CoreLoader: Going to execute loadPortal()."); loadPortal(); - s_log.error("CoreLoader: Going to execute loadMimeTypes()."); + s_log.debug("CoreLoader: Going to execute loadMimeTypes()."); loadMimeTypes(); - s_log.error("CoreLoader: Going to execute loadGlobalization()."); + s_log.debug("CoreLoader: Going to execute loadGlobalization()."); loadGlobalization(); } }.run(); - s_log.error("CoreLoader run method completed."); + s_log.debug("CoreLoader run method completed."); } /** @@ -320,24 +320,24 @@ public class CoreLoader extends PackageLoader { */ private SiteNode loadKernel() { // Create Root Site Node - s_log.error("CoreLoader: Going to execute method loadKernel()."); + s_log.debug("CoreLoader: Going to execute method loadKernel()."); final SiteNode rootNode = SiteNode.createSiteNode(null, null); - s_log.error("loadKernel: creating system administrator."); + s_log.debug("loadKernel: creating system administrator."); createSystemAdministrator(); // Create Package Types and Instances - s_log.error("loadKernel: creating 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.error("loadKernel: mount Instances."); + s_log.debug("loadKernel: mount Instances."); rootNode.mountPackage(subsiteInstance); - s_log.error("CoreLoader: Going to complete method loadKernel()."); + s_log.debug("CoreLoader: Going to complete method loadKernel()."); return rootNode; } @@ -345,7 +345,7 @@ public class CoreLoader extends PackageLoader { // exists after installation. private void createSystemAdministrator() { - s_log.error("CoreLoader: execution of method createSystemAdministrator()."); + s_log.debug("CoreLoader: execution of method createSystemAdministrator()."); final String DO_NOT_CREATE = "*do not create*"; String emailAddress = getEmail(); @@ -355,7 +355,7 @@ public class CoreLoader extends PackageLoader { String password = getPassword(); String passwordQuestion = getQuestion(); String passwordAnswer = getAnswer(); - s_log.error("createSystemAdministrator: EmailAddr: " + emailAddress + + s_log.debug("createSystemAdministrator: EmailAddr: " + emailAddress + "\n screenName: " + screenName + "\n givenName: " + givenName ); @@ -375,7 +375,7 @@ public class CoreLoader extends PackageLoader { // Create the system administrator user. - s_log.error("createSystemAdministrator(): going to create new User."); + s_log.debug("createSystemAdministrator(): going to create new User."); User sa = new User(); sa.setPrimaryEmail(new EmailAddress(emailAddress)); if (screenName != null && @@ -386,7 +386,7 @@ public class CoreLoader extends PackageLoader { sa.getPersonName().setFamilyName(familyName); // Save the system administrator's authentication credentials. - s_log.error("createSystemAdministrator(): going to save credentials."); + s_log.debug("createSystemAdministrator(): going to save credentials."); UserAuthentication auth = UserAuthentication.createForUser(sa); auth.setPassword(password); auth.setPasswordQuestion(passwordQuestion); @@ -394,19 +394,19 @@ public class CoreLoader extends PackageLoader { // Grant the system administrator universal "admin" permission. - s_log.error("createSystemAdministrator(): going to grant admin perms."); + s_log.debug("createSystemAdministrator(): going to grant admin perms."); PermissionService.grantPermission (new UniversalPermissionDescriptor (PrivilegeDescriptor.ADMIN, sa)); - s_log.error("Adding administrator: \"" + givenName + " " + + s_log.debug("Adding administrator: \"" + givenName + " " + familyName + "\" <" + emailAddress + ">"); - s_log.error("CoreLoader: method createSystemAdministrator() completed."); + s_log.debug("CoreLoader: method createSystemAdministrator() completed."); } private void loadSubsite(SiteNode rootNode) { - s_log.error("CoreLoader: Going to execute method loadSubsite()."); + s_log.debug("CoreLoader: Going to execute method loadSubsite()."); String sDispatcher = ""; PackageInstance packageInstance = rootNode.getPackageInstance();