Letzte Reste des old initializers entfernt. Erstaunlicherweise läuft das System bei mir noch :-)
git-svn-id: https://svn.libreccm.org/ccm/trunk@931 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
3416f9262b
commit
f9e93351e6
|
|
@ -5,7 +5,7 @@
|
||||||
<initializer class="com.arsdigita.core.Initializer"/>
|
<initializer class="com.arsdigita.core.Initializer"/>
|
||||||
</requires>
|
</requires>
|
||||||
<provides>
|
<provides>
|
||||||
<initializer class="com.arsdigita.bookmarks.installer.Initializer"/>
|
<initializer class="com.arsdigita.bookmarks.Initializer"/>
|
||||||
</provides>
|
</provides>
|
||||||
<scripts>
|
<scripts>
|
||||||
<schema directory="ccm-bookmarks"/>
|
<schema directory="ccm-bookmarks"/>
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,22 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved.
|
* Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the CCM Public
|
* This library is free software; you can redistribute it and/or
|
||||||
* License (the "License"); you may not use this file except in
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* compliance with the License. You may obtain a copy of
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
* the License at http://www.redhat.com/licenses/ccmpl.html
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS
|
* This library is distributed in the hope that it will be useful,
|
||||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* implied. See the License for the specific language governing
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* rights and limitations under the License.
|
* 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.bookmarks.installer;
|
package com.arsdigita.bookmarks;
|
||||||
|
|
||||||
import com.arsdigita.db.DbHelper;
|
import com.arsdigita.db.DbHelper;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
|
@ -27,7 +30,7 @@ import com.arsdigita.bookmarks.*;
|
||||||
import com.arsdigita.bookmarks.ui.*;
|
import com.arsdigita.bookmarks.ui.*;
|
||||||
// unused import com.arsdigita.domain.DomainObjectFactory;
|
// unused import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.initializer.Configuration;
|
// import com.arsdigita.initializer.Configuration;
|
||||||
// unused import com.arsdigita.initializer.InitializationException;
|
// unused import com.arsdigita.initializer.InitializationException;
|
||||||
// unused import com.arsdigita.domain.DataObjectNotFoundException;
|
// unused import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.persistence.pdl.ManifestSource;
|
import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
|
|
@ -53,7 +56,8 @@ public class Initializer extends CompoundInitializer {
|
||||||
private static final Logger s_log = Logger.getLogger
|
private static final Logger s_log = Logger.getLogger
|
||||||
(Initializer.class);
|
(Initializer.class);
|
||||||
|
|
||||||
private Configuration m_conf = new Configuration();
|
// required by Old Initializer.
|
||||||
|
// private Configuration m_conf = new Configuration();
|
||||||
|
|
||||||
public Initializer() {
|
public Initializer() {
|
||||||
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
||||||
|
|
@ -66,6 +70,7 @@ public class Initializer extends CompoundInitializer {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init(DomainInitEvent e) {
|
public void init(DomainInitEvent e) {
|
||||||
s_log.info("Bookmarks app is initializing using .init(DomainInitEvent e)");
|
s_log.info("Bookmarks app is initializing using .init(DomainInitEvent e)");
|
||||||
// setupDomainFactory();
|
// setupDomainFactory();
|
||||||
|
|
@ -24,7 +24,6 @@ import com.arsdigita.cms.contenttypes.ui.mparticle.ArticleSectionPanel;
|
||||||
// import com.arsdigita.cms.search.ContentPageMetadataProvider;
|
// import com.arsdigita.cms.search.ContentPageMetadataProvider;
|
||||||
import com.arsdigita.kernel.URLService;
|
import com.arsdigita.kernel.URLService;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
|
||||||
import com.arsdigita.search.MetadataProviderRegistry;
|
import com.arsdigita.search.MetadataProviderRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
// import com.arsdigita.runtime.LegacyInitEvent;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -25,8 +25,8 @@ public class ResearchNetworkInitializer extends ContentTypeInitializer {
|
||||||
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/ResearchNetwork.xml";
|
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/ResearchNetwork.xml";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void init(LegacyInitEvent evt) {
|
// public void init(LegacyInitEvent evt) {
|
||||||
super.init(evt);
|
// super.init(evt);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,21 +26,21 @@ import com.arsdigita.cms.portlet.ContentItemPortlet;
|
||||||
import com.arsdigita.cms.portlet.ContentSectionsPortlet;
|
import com.arsdigita.cms.portlet.ContentSectionsPortlet;
|
||||||
import com.arsdigita.cms.portlet.TaskPortlet;
|
import com.arsdigita.cms.portlet.TaskPortlet;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
// import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.formbuilder.util.FormbuilderSetup;
|
import com.arsdigita.formbuilder.util.FormbuilderSetup;
|
||||||
import com.arsdigita.kernel.ACSObjectInstantiator;
|
import com.arsdigita.kernel.ACSObjectInstantiator;
|
||||||
import com.arsdigita.kernel.Kernel;
|
import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.KernelExcursion;
|
import com.arsdigita.kernel.KernelExcursion;
|
||||||
import com.arsdigita.kernel.PackageInstance;
|
// import com.arsdigita.kernel.PackageInstance;
|
||||||
import com.arsdigita.kernel.PackageType;
|
// import com.arsdigita.kernel.PackageType;
|
||||||
import com.arsdigita.kernel.SiteNode;
|
// import com.arsdigita.kernel.SiteNode;
|
||||||
// import com.arsdigita.kernel.Stylesheet;
|
// import com.arsdigita.kernel.Stylesheet;
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
import com.arsdigita.loader.PackageLoader;
|
import com.arsdigita.loader.PackageLoader;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.DataQuery;
|
import com.arsdigita.persistence.DataQuery;
|
||||||
import com.arsdigita.persistence.SessionManager;
|
import com.arsdigita.persistence.SessionManager;
|
||||||
import com.arsdigita.runtime.ConfigError;
|
// import com.arsdigita.runtime.ConfigError;
|
||||||
import com.arsdigita.runtime.ScriptContext;
|
import com.arsdigita.runtime.ScriptContext;
|
||||||
import com.arsdigita.web.Application;
|
import com.arsdigita.web.Application;
|
||||||
import com.arsdigita.web.ApplicationSetup;
|
import com.arsdigita.web.ApplicationSetup;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ package com.arsdigita.cms;
|
||||||
import com.arsdigita.cms.util.PageClassConfigHandler;
|
import com.arsdigita.cms.util.PageClassConfigHandler;
|
||||||
// import com.arsdigita.domain.DataObjectNotFoundException;
|
// import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.runtime.ConfigError;
|
import com.arsdigita.runtime.ConfigError;
|
||||||
import com.arsdigita.initializer.InitializationException;
|
|
||||||
// import com.arsdigita.kernel.PackageInstance;
|
// import com.arsdigita.kernel.PackageInstance;
|
||||||
// import com.arsdigita.kernel.PackageType;
|
// import com.arsdigita.kernel.PackageType;
|
||||||
// import com.arsdigita.kernel.Stylesheet;
|
// import com.arsdigita.kernel.Stylesheet;
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,13 @@ import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.cms.workflow.CMSTask;
|
import com.arsdigita.cms.workflow.CMSTask;
|
||||||
import com.arsdigita.cms.workflow.CMSTaskType;
|
import com.arsdigita.cms.workflow.CMSTaskType;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.initializer.InitializationException;
|
//import com.arsdigita.initializer.InitializationException;
|
||||||
import com.arsdigita.kernel.Party;
|
import com.arsdigita.kernel.Party;
|
||||||
import com.arsdigita.kernel.PartyCollection;
|
import com.arsdigita.kernel.PartyCollection;
|
||||||
import com.arsdigita.kernel.Role;
|
import com.arsdigita.kernel.Role;
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
import com.arsdigita.kernel.permissions.PermissionService;
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
|
import com.arsdigita.runtime.ConfigError;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
import com.arsdigita.workflow.simple.WorkflowTemplate;
|
import com.arsdigita.workflow.simple.WorkflowTemplate;
|
||||||
|
|
@ -96,14 +97,16 @@ public final class ContentSectionSetup {
|
||||||
* Method needs a transaction to proceed successfully.
|
* Method needs a transaction to proceed successfully.
|
||||||
* {@link com.arsdigita.cms.contentsection.Initializer#checkForNewContentSection() }
|
* {@link com.arsdigita.cms.contentsection.Initializer#checkForNewContentSection() }
|
||||||
*/
|
*/
|
||||||
public static void setupContentSectionAppInstance(String name,
|
public static void setupContentSectionAppInstance(
|
||||||
List staffGroup,
|
String name,
|
||||||
Boolean isPubliclyViewable,
|
List staffGroup,
|
||||||
String itemResolverClassName,
|
Boolean isPubliclyViewable,
|
||||||
String templateResolverClassName,
|
String itemResolverClassName,
|
||||||
List sectionContentTypes,
|
String templateResolverClassName,
|
||||||
Boolean useSectionCategories,
|
List sectionContentTypes,
|
||||||
List categoryFileList) {
|
Boolean useSectionCategories,
|
||||||
|
List categoryFileList) {
|
||||||
|
|
||||||
s_log.info("Creating content section on /" + name);
|
s_log.info("Creating content section on /" + name);
|
||||||
|
|
||||||
ContentSection section = ContentSection.create(name);
|
ContentSection section = ContentSection.create(name);
|
||||||
|
|
@ -229,7 +232,7 @@ public final class ContentSectionSetup {
|
||||||
|
|
||||||
Party viewer = retrieveParty(email);
|
Party viewer = retrieveParty(email);
|
||||||
if (viewer == null) {
|
if (viewer == null) {
|
||||||
throw new InitializationException((String) GlobalizationUtil.globalize(
|
throw new ConfigError((String) GlobalizationUtil.globalize(
|
||||||
"cms.installer.cannot_find_group_for_email").localize() + email);
|
"cms.installer.cannot_find_group_for_email").localize() + email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -300,7 +303,7 @@ public final class ContentSectionSetup {
|
||||||
* @throws InitializationException
|
* @throws InitializationException
|
||||||
*/
|
*/
|
||||||
public void registerPublicationCycles()
|
public void registerPublicationCycles()
|
||||||
throws InitializationException {
|
throws ConfigError {
|
||||||
|
|
||||||
// The feature lifecycle.
|
// The feature lifecycle.
|
||||||
LifecycleDefinition lcd = new LifecycleDefinition();
|
LifecycleDefinition lcd = new LifecycleDefinition();
|
||||||
|
|
@ -329,7 +332,7 @@ public final class ContentSectionSetup {
|
||||||
* @throws InitializationException
|
* @throws InitializationException
|
||||||
*/
|
*/
|
||||||
public void registerWorkflowTemplates()
|
public void registerWorkflowTemplates()
|
||||||
throws InitializationException {
|
throws ConfigError {
|
||||||
|
|
||||||
// The 3-step production workflow.
|
// The 3-step production workflow.
|
||||||
WorkflowTemplate wf = new WorkflowTemplate();
|
WorkflowTemplate wf = new WorkflowTemplate();
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
import com.arsdigita.runtime.RuntimeConfig;
|
||||||
import com.arsdigita.runtime.PDLInitializer;
|
import com.arsdigita.runtime.PDLInitializer;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
/* import com.arsdigita.runtime.LegacyInitEvent; Legacy Init removed */
|
|
||||||
import com.arsdigita.db.DbHelper;
|
import com.arsdigita.db.DbHelper;
|
||||||
import com.arsdigita.domain.xml.TraversalHandler;
|
import com.arsdigita.domain.xml.TraversalHandler;
|
||||||
import com.arsdigita.persistence.pdl.ManifestSource;
|
import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,9 @@ import org.apache.log4j.Logger;
|
||||||
* @author Aizaz Ahmed
|
* @author Aizaz Ahmed
|
||||||
*/
|
*/
|
||||||
public class ContentBundleHelper extends ContentItemHelper {
|
public class ContentBundleHelper extends ContentItemHelper {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(ContentBundleHelper.class);
|
private static final Logger s_log = Logger.getLogger(ContentBundleHelper.class);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All Items are saved as content bundles. we need to keep the content
|
* All Items are saved as content bundles. we need to keep the content
|
||||||
* bundles around because sometimes we only want to save at the very end
|
* bundles around because sometimes we only want to save at the very end
|
||||||
|
|
@ -55,6 +57,7 @@ public class ContentBundleHelper extends ContentItemHelper {
|
||||||
* <P> Note: If the create (or one of it's variants) has already been
|
* <P> Note: If the create (or one of it's variants) has already been
|
||||||
* called, setting the parent implicitly saves the object </P>
|
* called, setting the parent implicitly saves the object </P>
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setParent(Folder parent) {
|
public void setParent(Folder parent) {
|
||||||
super.setParent ( parent );
|
super.setParent ( parent );
|
||||||
if (m_bundle != null ) {
|
if (m_bundle != null ) {
|
||||||
|
|
@ -66,6 +69,7 @@ public class ContentBundleHelper extends ContentItemHelper {
|
||||||
/*
|
/*
|
||||||
* FIXME: need to know how to handle bundles in this scenario
|
* FIXME: need to know how to handle bundles in this scenario
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setContentItem(ContentItem item) {
|
public void setContentItem(ContentItem item) {
|
||||||
super.setContentItem ( item );
|
super.setContentItem ( item );
|
||||||
m_bundle = null;
|
m_bundle = null;
|
||||||
|
|
@ -75,6 +79,7 @@ public class ContentBundleHelper extends ContentItemHelper {
|
||||||
/**
|
/**
|
||||||
* <P>Saves the Item and it's associated ContentBundle</P>
|
* <P>Saves the Item and it's associated ContentBundle</P>
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void save() {
|
public void save() {
|
||||||
s_log.debug ( "About to save bundle" );
|
s_log.debug ( "About to save bundle" );
|
||||||
//getParent().addItem(m_bundle);
|
//getParent().addItem(m_bundle);
|
||||||
|
|
@ -92,6 +97,7 @@ public class ContentBundleHelper extends ContentItemHelper {
|
||||||
* new ContentItem is added to it. If this bundle already contains
|
* new ContentItem is added to it. If this bundle already contains
|
||||||
* an instance of this language, it will fail on Assert. </P>
|
* an instance of this language, it will fail on Assert. </P>
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected ContentItem createContentItem( boolean save ) {
|
protected ContentItem createContentItem( boolean save ) {
|
||||||
|
|
||||||
// if it exists, m_item gets set here.
|
// if it exists, m_item gets set here.
|
||||||
|
|
@ -118,7 +124,7 @@ public class ContentBundleHelper extends ContentItemHelper {
|
||||||
if ( save ) {
|
if ( save ) {
|
||||||
save ();
|
save ();
|
||||||
}
|
}
|
||||||
s_log.warn ( "Created bundled Item: " + getName() + " " + m_item );
|
s_log.warn ( "Created bundled Item: " + getName() + " " + m_item );
|
||||||
return m_item;
|
return m_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,6 +133,7 @@ s_log.warn ( "Created bundled Item: " + getName() + " " + m_item );
|
||||||
* <P>Sets the title of the ContentItem returned by the super method
|
* <P>Sets the title of the ContentItem returned by the super method
|
||||||
* to be the same as the item name </P>
|
* to be the same as the item name </P>
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected ContentItem createNewContentItem () {
|
protected ContentItem createNewContentItem () {
|
||||||
ContentItem toReturn = super.createNewContentItem();
|
ContentItem toReturn = super.createNewContentItem();
|
||||||
((ContentPage)toReturn).setTitle ( toReturn.getName() );
|
((ContentPage)toReturn).setTitle ( toReturn.getName() );
|
||||||
|
|
@ -140,6 +147,7 @@ s_log.warn ( "Created bundled Item: " + getName() + " " + m_item );
|
||||||
* it will only clone this language instance and create a new ( or
|
* it will only clone this language instance and create a new ( or
|
||||||
* retrieve the appropriate) content bundle to add it to.
|
* retrieve the appropriate) content bundle to add it to.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ContentItem cloneItem(String name, Folder parent, boolean save) {
|
public ContentItem cloneItem(String name, Folder parent, boolean save) {
|
||||||
ContentBundle originalBundle = ((ContentPage)m_item).getContentBundle();
|
ContentBundle originalBundle = ((ContentPage)m_item).getContentBundle();
|
||||||
s_log.debug ("Original bundle before cloning: "
|
s_log.debug ("Original bundle before cloning: "
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import java.lang.reflect.Method;
|
||||||
* @author Nobuko Asakai (nasakai@redhat.com)
|
* @author Nobuko Asakai (nasakai@redhat.com)
|
||||||
* @see com.arsdigita.cms.installer.xml.XMLContentItemHandler
|
* @see com.arsdigita.cms.installer.xml.XMLContentItemHandler
|
||||||
* @see com.arsdigita.cms.installer.xml.ContentItemLoader
|
* @see com.arsdigita.cms.installer.xml.ContentItemLoader
|
||||||
* */
|
*/
|
||||||
public class ContentItemHelper {
|
public class ContentItemHelper {
|
||||||
private static final Logger s_log = Logger.getLogger(ContentItemHelper.class);
|
private static final Logger s_log = Logger.getLogger(ContentItemHelper.class);
|
||||||
/* Default language for this item instance */
|
/* Default language for this item instance */
|
||||||
|
|
@ -52,6 +52,10 @@ public class ContentItemHelper {
|
||||||
private String m_contentType;
|
private String m_contentType;
|
||||||
private Class m_contentTypeClass;
|
private Class m_contentTypeClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param section
|
||||||
|
*/
|
||||||
public ContentItemHelper(ContentSection section) {
|
public ContentItemHelper(ContentSection section) {
|
||||||
m_section = section;
|
m_section = section;
|
||||||
m_parent = section.getRootFolder();
|
m_parent = section.getRootFolder();
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,13 @@ import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.ui.authoring.PageCreateDynamic;
|
import com.arsdigita.cms.ui.authoring.PageCreateDynamic;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.formbuilder.PersistentForm;
|
import com.arsdigita.formbuilder.PersistentForm;
|
||||||
import com.arsdigita.initializer.InitializationException;
|
//import com.arsdigita.initializer.InitializationException;
|
||||||
import com.arsdigita.metadata.DynamicObjectType;
|
import com.arsdigita.metadata.DynamicObjectType;
|
||||||
import com.arsdigita.persistence.SessionManager;
|
import com.arsdigita.persistence.SessionManager;
|
||||||
import com.arsdigita.persistence.metadata.MetadataRoot;
|
import com.arsdigita.persistence.metadata.MetadataRoot;
|
||||||
import com.arsdigita.persistence.metadata.Model;
|
import com.arsdigita.persistence.metadata.Model;
|
||||||
import com.arsdigita.persistence.metadata.ObjectType;
|
import com.arsdigita.persistence.metadata.ObjectType;
|
||||||
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.oro.text.perl.Perl5Util;
|
import org.apache.oro.text.perl.Perl5Util;
|
||||||
|
|
||||||
|
|
@ -77,13 +78,13 @@ public class UDCTHelper extends ContentTypeHelperImpl implements ContentTypeHelp
|
||||||
return m_parentType;
|
return m_parentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentType getParentContentType() throws InitializationException {
|
public ContentType getParentContentType() throws UncheckedWrapperException {
|
||||||
ContentType parent;
|
ContentType parent;
|
||||||
try {
|
try {
|
||||||
parent = ContentType.findByAssociatedObjectType(m_parent);
|
parent = ContentType.findByAssociatedObjectType(m_parent);
|
||||||
return parent;
|
return parent;
|
||||||
} catch (DataObjectNotFoundException e) {
|
} catch (DataObjectNotFoundException e) {
|
||||||
throw new InitializationException("Parent Type not found" , e);
|
throw new UncheckedWrapperException("Parent Type not found" , e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.Folder;
|
import com.arsdigita.cms.Folder;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.initializer.InitializationException;
|
import com.arsdigita.runtime.ConfigError;
|
||||||
import com.arsdigita.persistence.DataAssociation;
|
import com.arsdigita.persistence.DataAssociation;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.util.StringUtils;
|
import com.arsdigita.util.StringUtils;
|
||||||
|
|
@ -341,7 +341,7 @@ public class XMLContentItemHandler extends DefaultHandler {
|
||||||
Perl5Util util = new Perl5Util();
|
Perl5Util util = new Perl5Util();
|
||||||
String pattern = "/[^A-Za-z_0-9\\-]+ /";
|
String pattern = "/[^A-Za-z_0-9\\-]+ /";
|
||||||
if (util.match(pattern, name)) {
|
if (util.match(pattern, name)) {
|
||||||
throw new InitializationException(
|
throw new ConfigError(
|
||||||
"The \"" + name +
|
"The \"" + name +
|
||||||
"\" name parameter must contain only alpha-numeric " +
|
"\" name parameter must contain only alpha-numeric " +
|
||||||
"characters, underscores, and/or hyphens.");
|
"characters, underscores, and/or hyphens.");
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,12 @@ public class ContentDirectoryPortlet extends Portlet {
|
||||||
super(dataObject);
|
super(dataObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getBaseDataObjectType() {
|
protected String getBaseDataObjectType() {
|
||||||
return BASE_DATA_OBJECT_TYPE;
|
return BASE_DATA_OBJECT_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected AbstractPortletRenderer doGetPortletRenderer() {
|
protected AbstractPortletRenderer doGetPortletRenderer() {
|
||||||
return new ContentDirectoryPortletRenderer(this);
|
return new ContentDirectoryPortletRenderer(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public class ContentDirectoryPortletRenderer extends AbstractPortletRenderer {
|
||||||
element.addAttribute("id",getIdAttr());
|
element.addAttribute("id",getIdAttr());
|
||||||
|
|
||||||
DataQuery categories = SessionManager.getSession().retrieveQuery
|
DataQuery categories = SessionManager.getSession().retrieveQuery
|
||||||
("com.arsdigita.portal.portlet.getContentDirectory");
|
("com.arsdigita.cms.portlet.getContentDirectory");
|
||||||
// ("com.arsdigita.london.portal.portlet.getContentDirectory");
|
// ("com.arsdigita.london.portal.portlet.getContentDirectory");
|
||||||
|
|
||||||
while (categories.next()) {
|
while (categories.next()) {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.util;
|
package com.arsdigita.cms.util;
|
||||||
|
|
||||||
import com.arsdigita.initializer.InitializationException;
|
import com.arsdigita.runtime.ConfigError;
|
||||||
import org.apache.oro.text.perl.Perl5Util;
|
import org.apache.oro.text.perl.Perl5Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,12 +30,12 @@ import org.apache.oro.text.perl.Perl5Util;
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
public static void validateURLParameter(String name, String value)
|
public static void validateURLParameter(String name, String value)
|
||||||
throws InitializationException {
|
throws ConfigError {
|
||||||
|
|
||||||
final String pattern = "/[^A-Za-z_0-9\\-]+/";
|
final String pattern = "/[^A-Za-z_0-9\\-]+/";
|
||||||
Perl5Util util = new Perl5Util();
|
Perl5Util util = new Perl5Util();
|
||||||
if ( util.match(pattern, value) ) {
|
if ( util.match(pattern, value) ) {
|
||||||
throw new InitializationException
|
throw new ConfigError
|
||||||
("The \"" + name + "\" parameter must contain only " +
|
("The \"" + name + "\" parameter must contain only " +
|
||||||
" alpha-numeric characters, underscores, and/or hyphens.");
|
" alpha-numeric characters, underscores, and/or hyphens.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
<target name="compile-hook">
|
<target name="compile-hook">
|
||||||
<mkdir dir="${build.src.dir}/com/arsdigita/installer"/>
|
<mkdir dir="${build.src.dir}/com/arsdigita/installer"/>
|
||||||
<mkdir dir="${build.src.dir}/com/arsdigita/initializer"/>
|
<!-- Old style initializer completely removed. -->
|
||||||
|
<!-- <mkdir dir="${build.src.dir}/com/arsdigita/initializer"/> -->
|
||||||
<mkdir dir="${build.src.dir}/com/redhat/persistence/pdl"/>
|
<mkdir dir="${build.src.dir}/com/redhat/persistence/pdl"/>
|
||||||
<mkdir dir="${build.src.dir}/com/redhat/persistence/common"/>
|
<mkdir dir="${build.src.dir}/com/redhat/persistence/common"/>
|
||||||
<mkdir dir="${build.src.dir}/com/redhat/persistence/oql"/>
|
<mkdir dir="${build.src.dir}/com/redhat/persistence/oql"/>
|
||||||
|
|
@ -14,11 +15,13 @@
|
||||||
outputdirectory="${build.src.dir}/com/arsdigita/installer"
|
outputdirectory="${build.src.dir}/com/arsdigita/installer"
|
||||||
javacchome="${javacc.home.dir}"
|
javacchome="${javacc.home.dir}"
|
||||||
/>
|
/>
|
||||||
|
<!-- Old style initializer completely removed.
|
||||||
<javacc
|
<javacc
|
||||||
target="${src.dir}/com/arsdigita/initializer/ScriptParser.jj"
|
target="${src.dir}/com/arsdigita/initializer/ScriptParser.jj"
|
||||||
outputdirectory="${build.src.dir}/com/arsdigita/initializer"
|
outputdirectory="${build.src.dir}/com/arsdigita/initializer"
|
||||||
javacchome="${javacc.home.dir}"
|
javacchome="${javacc.home.dir}"
|
||||||
/>
|
/>
|
||||||
|
-->
|
||||||
<javacc
|
<javacc
|
||||||
target="${src.dir}/com/redhat/persistence/pdl/PDLParser.jj"
|
target="${src.dir}/com/redhat/persistence/pdl/PDLParser.jj"
|
||||||
outputdirectory="${build.src.dir}/com/redhat/persistence/pdl"
|
outputdirectory="${build.src.dir}/com/redhat/persistence/pdl"
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@
|
||||||
-- $Id: remove_legacy_portal.sql pboy $
|
-- $Id: remove_legacy_portal.sql pboy $
|
||||||
|
|
||||||
-- delete core portals legacy entry in apm_package_types
|
-- delete core portals legacy entry in apm_package_types
|
||||||
-- there es no entry in acs_objects!
|
-- there is no entry in application_types bot package_type_id and there are
|
||||||
|
-- no entries for instances in apm_packages / sitenodes / APPLICATIONS nor
|
||||||
|
-- there is any entry in acs_objects!
|
||||||
|
|
||||||
delete from apm_package_types
|
delete from apm_package_types
|
||||||
where package_key like 'portal' ;
|
where package_key like 'portal' ;
|
||||||
|
|
@ -33,9 +33,6 @@ import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
import com.arsdigita.persistence.pdl.NameFilter;
|
import com.arsdigita.persistence.pdl.NameFilter;
|
||||||
import com.arsdigita.runtime.CompoundInitializer;
|
import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
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.PDLInitializer;
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
import com.arsdigita.runtime.RuntimeConfig;
|
||||||
import com.arsdigita.toolbox.CharsetEncodingProvider;
|
import com.arsdigita.toolbox.CharsetEncodingProvider;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<title>com.arsdigita.installer</title>
|
<title>com.arsdigita.installer</title>
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="white">
|
<body>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,10 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.kernel.security;
|
package com.arsdigita.kernel.security;
|
||||||
|
|
||||||
import com.arsdigita.initializer.InitializationException;
|
// import com.arsdigita.initializer.InitializationException;
|
||||||
|
import com.arsdigita.runtime.ConfigError;
|
||||||
import com.arsdigita.util.StringUtils;
|
import com.arsdigita.util.StringUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -86,7 +88,8 @@ public class LoginConfig extends Configuration {
|
||||||
*
|
*
|
||||||
* @throws InitializationException if there is a parsing error.
|
* @throws InitializationException if there is a parsing error.
|
||||||
**/
|
**/
|
||||||
public LoginConfig(List config) throws InitializationException {
|
// public LoginConfig(List config) throws InitializationException {
|
||||||
|
public LoginConfig(List config) {
|
||||||
Map contextConfigs = new HashMap();
|
Map contextConfigs = new HashMap();
|
||||||
for (int i = 0; i < config.size(); i++) {
|
for (int i = 0; i < config.size(); i++) {
|
||||||
String tuple = (String) config.get(i);
|
String tuple = (String) config.get(i);
|
||||||
|
|
@ -106,8 +109,9 @@ public class LoginConfig extends Configuration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAppConfig(String name, List entries)
|
// private void addAppConfig(String name, List entries)
|
||||||
throws InitializationException {
|
// throws InitializationException {
|
||||||
|
private void addAppConfig(String name, List entries) {
|
||||||
AppConfigurationEntry[] array =
|
AppConfigurationEntry[] array =
|
||||||
new AppConfigurationEntry[entries.size()];
|
new AppConfigurationEntry[entries.size()];
|
||||||
for (int i = 0; i < array.length; i++) {
|
for (int i = 0; i < array.length; i++) {
|
||||||
|
|
@ -117,8 +121,9 @@ public class LoginConfig extends Configuration {
|
||||||
m_appConfigs.put(name, array);
|
m_appConfigs.put(name, array);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AppConfigurationEntry loadAppConfigEntry(List list)
|
// private AppConfigurationEntry loadAppConfigEntry(List list)
|
||||||
throws InitializationException {
|
// throws InitializationException {
|
||||||
|
private AppConfigurationEntry loadAppConfigEntry(List list) {
|
||||||
Iterator iter = list.iterator();
|
Iterator iter = list.iterator();
|
||||||
String name = getString(iter, "module class name");
|
String name = getString(iter, "module class name");
|
||||||
AppConfigurationEntry.LoginModuleControlFlag flag
|
AppConfigurationEntry.LoginModuleControlFlag flag
|
||||||
|
|
@ -130,8 +135,10 @@ public class LoginConfig extends Configuration {
|
||||||
return new AppConfigurationEntry(name, flag, options);
|
return new AppConfigurationEntry(name, flag, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AppConfigurationEntry.LoginModuleControlFlag
|
// private AppConfigurationEntry.LoginModuleControlFlag
|
||||||
getFlag(String flag) throws InitializationException {
|
// getFlag(String flag) throws InitializationException {
|
||||||
|
private AppConfigurationEntry.LoginModuleControlFlag getFlag(String flag)
|
||||||
|
throws ConfigError {
|
||||||
if (flag.equalsIgnoreCase("requisite")) {
|
if (flag.equalsIgnoreCase("requisite")) {
|
||||||
return AppConfigurationEntry.LoginModuleControlFlag.REQUISITE;
|
return AppConfigurationEntry.LoginModuleControlFlag.REQUISITE;
|
||||||
}
|
}
|
||||||
|
|
@ -144,18 +151,18 @@ public class LoginConfig extends Configuration {
|
||||||
if (flag.equalsIgnoreCase("optional")) {
|
if (flag.equalsIgnoreCase("optional")) {
|
||||||
return AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL;
|
return AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL;
|
||||||
}
|
}
|
||||||
throw new InitializationException
|
throw new ConfigError
|
||||||
("Control flag must be one of \"required\", "
|
("Control flag must be one of \"required\", "
|
||||||
+"\"requisite\", \"sufficient\", or \"optional\", "
|
+"\"requisite\", \"sufficient\", or \"optional\", "
|
||||||
+"but got: \""+flag+"\"");
|
+"but got: \""+flag+"\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addOption(Iterator iter, Map map)
|
private void addOption(Iterator iter, Map map)
|
||||||
throws InitializationException {
|
throws ConfigError {
|
||||||
String option = getString(iter, "option");
|
String option = getString(iter, "option");
|
||||||
int index = option.indexOf('=');
|
int index = option.indexOf('=');
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
throw new InitializationException
|
throw new ConfigError
|
||||||
("Option must be \"key=value\", but got: \""
|
("Option must be \"key=value\", but got: \""
|
||||||
+option+"\"");
|
+option+"\"");
|
||||||
}
|
}
|
||||||
|
|
@ -165,10 +172,10 @@ public class LoginConfig extends Configuration {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getString(Iterator iter, String name)
|
private String getString(Iterator iter, String name)
|
||||||
throws InitializationException {
|
throws ConfigError {
|
||||||
Object temp = getObject(iter, name);
|
Object temp = getObject(iter, name);
|
||||||
if (!(temp instanceof String)) {
|
if (!(temp instanceof String)) {
|
||||||
throw new InitializationException
|
throw new ConfigError
|
||||||
("Expected String "+name
|
("Expected String "+name
|
||||||
+", but got: \""+temp+"\"");
|
+", but got: \""+temp+"\"");
|
||||||
}
|
}
|
||||||
|
|
@ -176,9 +183,9 @@ public class LoginConfig extends Configuration {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object getObject(Iterator iter, String name)
|
private Object getObject(Iterator iter, String name)
|
||||||
throws InitializationException {
|
throws ConfigError {
|
||||||
if (!iter.hasNext()) {
|
if (!iter.hasNext()) {
|
||||||
throw new InitializationException
|
throw new ConfigError
|
||||||
("Missing "+name);
|
("Missing "+name);
|
||||||
}
|
}
|
||||||
return iter.next();
|
return iter.next();
|
||||||
|
|
@ -190,6 +197,7 @@ public class LoginConfig extends Configuration {
|
||||||
}
|
}
|
||||||
|
|
||||||
// overrides Configuration
|
// overrides Configuration
|
||||||
|
@Override
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ package com.arsdigita.metadata;
|
||||||
|
|
||||||
import com.arsdigita.db.ConnectionManager;
|
import com.arsdigita.db.ConnectionManager;
|
||||||
import com.arsdigita.db.Sequences;
|
import com.arsdigita.db.Sequences;
|
||||||
import com.arsdigita.initializer.Startup;
|
// import com.arsdigita.initializer.Startup;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.PersistenceException;
|
import com.arsdigita.persistence.PersistenceException;
|
||||||
|
|
@ -63,12 +63,11 @@ import java.util.Map;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DynamicObjectType is a class that can be used to dynamically
|
* DynamicObjectType is a class that can be used to dynamically create and
|
||||||
* create and modify {@link
|
* modify {@link com.arsdigita.persistence.metadata.ObjectType}.
|
||||||
* com.arsdigita.persistence.metadata.ObjectType}. It can be used to
|
* It can be used to create the subtype, add and remove Attributes and
|
||||||
* create the subtype, add and remove Attributes and RoleReferences as
|
* RoleReferences as well as perform many other tasks related to the new
|
||||||
* well as perform many other tasks related to the new object type.
|
* object type. When the application is done creating the object type, it should
|
||||||
* When the application is done creating the object type, it should
|
|
||||||
* call {@link #save()} to persist the information about the newly created
|
* call {@link #save()} to persist the information about the newly created
|
||||||
* object type.
|
* object type.
|
||||||
*
|
*
|
||||||
|
|
@ -977,9 +976,11 @@ public class DynamicObjectType extends DynamicElement {
|
||||||
String startupScript = args[3];
|
String startupScript = args[3];
|
||||||
String webAppRoot = args[4];
|
String webAppRoot = args[4];
|
||||||
|
|
||||||
Startup startup = new Startup(webAppRoot, startupScript);
|
// Old Initializer system is not workable anymore.
|
||||||
startup.setLastInitializer("com.arsdigita.persistence.Initializer");
|
// Eventually TODO: refactor to use the new Initializer system.
|
||||||
startup.init();
|
// Startup startup = new Startup(webAppRoot, startupScript);
|
||||||
|
// startup.setLastInitializer("com.arsdigita.persistence.Initializer");
|
||||||
|
// startup.init();
|
||||||
|
|
||||||
TransactionContext txn = SessionManager.getSession()
|
TransactionContext txn = SessionManager.getSession()
|
||||||
.getTransactionContext();
|
.getTransactionContext();
|
||||||
|
|
@ -1068,6 +1069,7 @@ public class DynamicObjectType extends DynamicElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
txn.commitTxn();
|
txn.commitTxn();
|
||||||
startup.destroy();
|
// Old Initializer is not usable anymore, see above
|
||||||
|
// startup.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,25 +114,25 @@ public class CompoundInitializer implements Initializer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Implementation of the {@link Initializer#init(LegacyInitEvent)} method.
|
// * Implementation of the {@link Initializer#init(LegacyInitEvent)} method.
|
||||||
* This implementation proceeds through the list of sub initializers in
|
// * This implementation proceeds through the list of sub initializers in
|
||||||
* order and invokes the init(LegacyInitEvent) method of each sub initializer
|
// * order and invokes the init(LegacyInitEvent) method of each sub initializer
|
||||||
* in turn.
|
// * in turn.
|
||||||
*
|
// *
|
||||||
* @param evt The legacy init event.
|
// * @param evt The legacy init event.
|
||||||
*/
|
// */
|
||||||
public void init(LegacyInitEvent evt) {
|
// public void init(LegacyInitEvent evt) {
|
||||||
int i = 1;
|
// int i = 1;
|
||||||
for (Iterator it = m_inits.iterator(); it.hasNext(); i++) {
|
// for (Iterator it = m_inits.iterator(); it.hasNext(); i++) {
|
||||||
Initializer init = (Initializer) it.next();
|
// Initializer init = (Initializer) it.next();
|
||||||
if (m_log.isInfoEnabled()) {
|
// if (m_log.isInfoEnabled()) {
|
||||||
m_log.info("Running Legacy Init for " + init.getClass() +
|
// m_log.info("Running Legacy Init for " + init.getClass() +
|
||||||
" (" + i + " out of " + m_inits.size() + ")");
|
// " (" + i + " out of " + m_inits.size() + ")");
|
||||||
}
|
// }
|
||||||
init.init(evt);
|
// init.init(evt);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of the {@link Initializer#init(ContextInitEvent)} method.
|
* Implementation of the {@link Initializer#init(ContextInitEvent)} method.
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,14 @@ public abstract class GenericInitializer implements Initializer {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* An empty implementation of {@link Initializer#init(LegacyInitEvent)}
|
// * An empty implementation of {@link Initializer#init(LegacyInitEvent)}
|
||||||
* method.
|
// * method.
|
||||||
*
|
// *
|
||||||
* @param evt The legacy init event.
|
// * @param evt The legacy init event.
|
||||||
**/
|
// **/
|
||||||
public void init(LegacyInitEvent evt) {
|
// public void init(LegacyInitEvent evt) {
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An empty implementation of {@link Initializer#init(ContextInitEvent)}
|
* An empty implementation of {@link Initializer#init(ContextInitEvent)}
|
||||||
|
|
|
||||||
|
|
@ -70,15 +70,15 @@ public interface Initializer {
|
||||||
*/
|
*/
|
||||||
void init(DomainInitEvent e);
|
void init(DomainInitEvent e);
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* A hook for free-form initialization as existed in the older
|
// * A hook for free-form initialization as existed in the older
|
||||||
* initialization scheme.
|
// * initialization scheme.
|
||||||
*
|
// *
|
||||||
* @deprecated with no replacement; code that uses this hook
|
// * @deprecated with no replacement; code that uses this hook
|
||||||
* should be refactored to use {@link #init(DataInitEvent)} and
|
// * should be refactored to use {@link #init(DataInitEvent)} and
|
||||||
* {@link #init(DomainInitEvent)}
|
// * {@link #init(DomainInitEvent)}
|
||||||
*/
|
// */
|
||||||
void init(LegacyInitEvent e);
|
// void init(LegacyInitEvent e);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,9 @@ public class PDLInitializer implements Initializer {
|
||||||
* An empty implementation of {@link Initializer#init(LegacyInitEvent)}.
|
* An empty implementation of {@link Initializer#init(LegacyInitEvent)}.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
public void init(LegacyInitEvent evt) {
|
// public void init(LegacyInitEvent evt) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An empty implementation of {@link Initializer#init(ContextInitEvent)}.
|
* An empty implementation of {@link Initializer#init(ContextInitEvent)}.
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,7 @@ public class Runtime extends CompoundInitializer {
|
||||||
|
|
||||||
init.init(new DomainInitEvent(new DomainObjectFactory()));
|
init.init(new DomainInitEvent(new DomainObjectFactory()));
|
||||||
|
|
||||||
init.init(new LegacyInitEvent(session));
|
// init.init(new LegacyInitEvent(session));
|
||||||
|
|
||||||
if(evt != null) {
|
if(evt != null) {
|
||||||
init.init(evt);
|
init.init(evt);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,16 @@ import com.arsdigita.initializer.Initializer;
|
||||||
import com.arsdigita.util.URLRewriter;
|
import com.arsdigita.util.URLRewriter;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
|
// ////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Migration Status:
|
||||||
|
// Moved into main ~/core/initializer
|
||||||
|
// Nolonger used
|
||||||
|
//
|
||||||
|
// ////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Add the character set encoding provider.
|
* Add the character set encoding provider.
|
||||||
|
|
@ -132,6 +132,7 @@ public class UncheckedWrapperException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Get a string representing this exception and the root cause.
|
* Get a string representing this exception and the root cause.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return toString(this.getClass());
|
return toString(this.getClass());
|
||||||
}
|
}
|
||||||
|
|
@ -163,6 +164,7 @@ public class UncheckedWrapperException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* This exception's message and the root cause's.
|
* This exception's message and the root cause's.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
if (m_rootCause != null) {
|
if (m_rootCause != null) {
|
||||||
return super.getMessage() + " (root cause: " + m_rootCause.
|
return super.getMessage() + " (root cause: " + m_rootCause.
|
||||||
|
|
@ -175,6 +177,7 @@ public class UncheckedWrapperException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Stack trace for the root cause.
|
* Stack trace for the root cause.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void printStackTrace() {
|
public void printStackTrace() {
|
||||||
super.printStackTrace();
|
super.printStackTrace();
|
||||||
if (m_rootCause != null) {
|
if (m_rootCause != null) {
|
||||||
|
|
@ -186,6 +189,7 @@ public class UncheckedWrapperException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Stack trace for the root cause.
|
* Stack trace for the root cause.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void printStackTrace(java.io.PrintStream s) {
|
public void printStackTrace(java.io.PrintStream s) {
|
||||||
super.printStackTrace(s);
|
super.printStackTrace(s);
|
||||||
if (m_rootCause != null) {
|
if (m_rootCause != null) {
|
||||||
|
|
@ -197,6 +201,7 @@ public class UncheckedWrapperException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Stack trace for the root cause.
|
* Stack trace for the root cause.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void printStackTrace(java.io.PrintWriter s) {
|
public void printStackTrace(java.io.PrintWriter s) {
|
||||||
super.printStackTrace(s);
|
super.printStackTrace(s);
|
||||||
if (m_rootCause != null) {
|
if (m_rootCause != null) {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,15 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.web;
|
package com.arsdigita.web;
|
||||||
|
|
||||||
|
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Old initializer system based on enterprise.init scripts is no longer
|
||||||
|
// available.
|
||||||
|
//
|
||||||
|
// //////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.developersupport.Debug;
|
import com.arsdigita.developersupport.Debug;
|
||||||
import com.arsdigita.initializer.Script;
|
import com.arsdigita.initializer.Script;
|
||||||
import com.arsdigita.util.ResourceManager;
|
import com.arsdigita.util.ResourceManager;
|
||||||
|
|
@ -36,6 +45,7 @@ public final class LegacyInitializerServlet extends BaseServlet {
|
||||||
* Starts up the web environment for the ACS by loading the specified
|
* Starts up the web environment for the ACS by loading the specified
|
||||||
* initializer script.
|
* initializer script.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected final void doInit() throws ServletException {
|
protected final void doInit() throws ServletException {
|
||||||
Debug.setLevel("com.arsdigita.initializer.Script", "info");
|
Debug.setLevel("com.arsdigita.initializer.Script", "info");
|
||||||
|
|
||||||
|
|
@ -54,6 +64,7 @@ public final class LegacyInitializerServlet extends BaseServlet {
|
||||||
m_initializer.startup();
|
m_initializer.startup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void doDestroy() {
|
protected final void doDestroy() {
|
||||||
m_initializer.shutdown();
|
m_initializer.shutdown();
|
||||||
m_initializer = null;
|
m_initializer = null;
|
||||||
|
|
@ -8,7 +8,7 @@ import com.arsdigita.cms.docmgr.Document;
|
||||||
/*
|
/*
|
||||||
* Instantiates the Document content type
|
* Instantiates the Document content type
|
||||||
*
|
*
|
||||||
* @version $Id: PrescriptiveInitializer.java,v 1.3 2003/06/30 21:47:31 cwolfe Exp $
|
* @version $Id: DocumentInitializer.java $
|
||||||
*/
|
*/
|
||||||
public class DocumentInitializer extends ContentTypeInitializer {
|
public class DocumentInitializer extends ContentTypeInitializer {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import com.arsdigita.cms.docmgr.ui.LegacyCategoryDocsNavigatorPortlet;
|
||||||
import com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortlet;
|
import com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortlet;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.initializer.Configuration;
|
// import com.arsdigita.initializer.Configuration;
|
||||||
import com.arsdigita.kernel.ACSObjectInstantiator;
|
import com.arsdigita.kernel.ACSObjectInstantiator;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.SessionManager;
|
import com.arsdigita.persistence.SessionManager;
|
||||||
|
|
@ -53,7 +53,7 @@ import com.arsdigita.web.ApplicationType;
|
||||||
|
|
||||||
public class Initializer extends CompoundInitializer {
|
public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
private Configuration m_conf = new Configuration();
|
// private Configuration m_conf = new Configuration();
|
||||||
|
|
||||||
private static final String SEPARATOR = java.io.File.separator;
|
private static final String SEPARATOR = java.io.File.separator;
|
||||||
|
|
||||||
|
|
@ -74,9 +74,9 @@ public class Initializer extends CompoundInitializer {
|
||||||
/**
|
/**
|
||||||
* Returns the configuration object used by this initializer.
|
* Returns the configuration object used by this initializer.
|
||||||
*/
|
*/
|
||||||
public Configuration getConfiguration() {
|
// public Configuration getConfiguration() {
|
||||||
return m_conf;
|
// return m_conf;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void init(DomainInitEvent e) {
|
public void init(DomainInitEvent e) {
|
||||||
s_log.debug("Document (CCM) Manager is initializing using .init(DomainInitEvent e)");
|
s_log.debug("Document (CCM) Manager is initializing using .init(DomainInitEvent e)");
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.arsdigita.initializer.Configuration;
|
//Bimport com.arsdigita.initializer.Configuration;
|
||||||
import com.arsdigita.initializer.InitializationException;
|
// import com.arsdigita.initializer.InitializationException;
|
||||||
import com.arsdigita.mimetypes.MimeType;
|
import com.arsdigita.mimetypes.MimeType;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -33,9 +33,9 @@ import com.arsdigita.mimetypes.MimeType;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MimeIconInitializer implements com.arsdigita.initializer.Initializer {
|
public class MimeIconInitializer { // implements com.arsdigita.initializer.Initializer {
|
||||||
|
|
||||||
private Configuration m_conf = new Configuration();
|
// private Configuration m_conf = new Configuration();
|
||||||
|
|
||||||
private static final String SEPARATOR = java.io.File.separator;
|
private static final String SEPARATOR = java.io.File.separator;
|
||||||
|
|
||||||
|
|
@ -51,23 +51,23 @@ public class MimeIconInitializer implements com.arsdigita.initializer.Initialize
|
||||||
private static String m_defaultIcon = null;
|
private static String m_defaultIcon = null;
|
||||||
|
|
||||||
public MimeIconInitializer() {
|
public MimeIconInitializer() {
|
||||||
m_conf.initParameter(ICON_URL_ROOT,
|
// m_conf.initParameter(ICON_URL_ROOT,
|
||||||
"location of mime-type icons",
|
// "location of mime-type icons",
|
||||||
String.class);
|
// String.class);
|
||||||
m_conf.initParameter(DEFAULT_ICON,
|
// m_conf.initParameter(DEFAULT_ICON,
|
||||||
"icon to use if no match found",
|
// "icon to use if no match found",
|
||||||
String.class);
|
// String.class);
|
||||||
m_conf.initParameter(MIME_ICON_MAP,
|
// m_conf.initParameter(MIME_ICON_MAP,
|
||||||
"mime-type to icon map",
|
// "mime-type to icon map",
|
||||||
List.class);
|
// List.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the configuration object used by this initializer.
|
* Returns the configuration object used by this initializer.
|
||||||
*/
|
*/
|
||||||
public Configuration getConfiguration() {
|
// public Configuration getConfiguration() {
|
||||||
return m_conf;
|
// return m_conf;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called on startup.
|
* Called on startup.
|
||||||
|
|
@ -75,15 +75,15 @@ public class MimeIconInitializer implements com.arsdigita.initializer.Initialize
|
||||||
public void startup() {
|
public void startup() {
|
||||||
s_log.warn("Mime Icon Initializer beginning");
|
s_log.warn("Mime Icon Initializer beginning");
|
||||||
|
|
||||||
m_iconUrlRoot = (String) m_conf.getParameter
|
// m_iconUrlRoot = (String) m_conf.getParameter
|
||||||
(ICON_URL_ROOT);
|
// (ICON_URL_ROOT);
|
||||||
m_defaultIcon = (String) m_conf.getParameter
|
// m_defaultIcon = (String) m_conf.getParameter
|
||||||
(DEFAULT_ICON);
|
// (DEFAULT_ICON);
|
||||||
|
|
||||||
List mimeTypes = (List) m_conf.getParameter
|
// List mimeTypes = (List) m_conf.getParameter
|
||||||
(MIME_ICON_MAP);
|
// (MIME_ICON_MAP);
|
||||||
|
|
||||||
Iterator i = mimeTypes.iterator();
|
/* Iterator i = mimeTypes.iterator();
|
||||||
while(i.hasNext()) {
|
while(i.hasNext()) {
|
||||||
List values = (List) i.next();
|
List values = (List) i.next();
|
||||||
if(values.size() != 2) {
|
if(values.size() != 2) {
|
||||||
|
|
@ -105,20 +105,20 @@ public class MimeIconInitializer implements com.arsdigita.initializer.Initialize
|
||||||
}
|
}
|
||||||
m_iconMap.put(mimeTypeName, m_iconUrlRoot + iconName);
|
m_iconMap.put(mimeTypeName, m_iconUrlRoot + iconName);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
s_log.info("Mime Icon Initializer completed.");
|
s_log.info("Mime Icon Initializer completed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getMimeIconURL(String mimeTypeName) {
|
/* public static String getMimeIconURL(String mimeTypeName) {
|
||||||
if (m_iconMap.get(mimeTypeName) != null) {
|
if (m_iconMap.get(mimeTypeName) != null) {
|
||||||
return (String) m_iconMap.get(mimeTypeName);
|
return (String) m_iconMap.get(mimeTypeName);
|
||||||
}
|
}
|
||||||
return m_iconUrlRoot + m_defaultIcon;
|
return m_iconUrlRoot + m_defaultIcon;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* Shutdown the document manager.
|
* Shutdown the document manager.
|
||||||
*/
|
*/
|
||||||
public void shutdown() { }
|
// public void shutdown() { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
init com.arsdigita.docmgr.installer.Initializer { }
|
|
||||||
|
|
@ -1,188 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2001-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.docrepo.installer;
|
|
||||||
|
|
||||||
import com.arsdigita.docrepo.ui.RecentUpdatedDocsPortlet;
|
|
||||||
import com.arsdigita.docrepo.File;
|
|
||||||
import com.arsdigita.docrepo.Folder;
|
|
||||||
import com.arsdigita.docrepo.ResourceImpl;
|
|
||||||
import com.arsdigita.docrepo.DocBlobject;
|
|
||||||
import com.arsdigita.docrepo.Repository;
|
|
||||||
import com.arsdigita.docrepo.Constants;
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
|
||||||
import com.arsdigita.domain.DomainObjectInstantiator;
|
|
||||||
import com.arsdigita.initializer.Configuration;
|
|
||||||
import com.arsdigita.kernel.ACSObjectInstantiator;
|
|
||||||
import com.arsdigita.persistence.DataObject;
|
|
||||||
import com.arsdigita.persistence.SessionManager;
|
|
||||||
import com.arsdigita.persistence.TransactionContext;
|
|
||||||
//import com.arsdigita.util.ResourceManager;
|
|
||||||
import com.arsdigita.web.ApplicationSetup;
|
|
||||||
import com.arsdigita.web.ApplicationType;
|
|
||||||
import com.arsdigita.portal.apportlet.AppPortletSetup;
|
|
||||||
import com.arsdigita.portal.PortletType;
|
|
||||||
|
|
||||||
//import java.io.FileInputStream;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the document manager package, sets up the
|
|
||||||
* DomainFactory, registers knowledge types and portlets.
|
|
||||||
*
|
|
||||||
* @author Stefan Deusch
|
|
||||||
* @author David Dao
|
|
||||||
*
|
|
||||||
* @version $Revision: #10 $ $Date: 2004/08/17 $
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class Initializer implements com.arsdigita.initializer.Initializer {
|
|
||||||
|
|
||||||
private Configuration m_conf = new Configuration();
|
|
||||||
|
|
||||||
private static final String SEPARATOR = java.io.File.separator;
|
|
||||||
|
|
||||||
private static String PACKAGE_TYPE_NAME = "docs";
|
|
||||||
|
|
||||||
private static Logger s_log =
|
|
||||||
Logger.getLogger(Initializer.class);
|
|
||||||
|
|
||||||
public Initializer() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the configuration object used by this initializer.
|
|
||||||
*/
|
|
||||||
public Configuration getConfiguration() {
|
|
||||||
return m_conf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called on startup.
|
|
||||||
*/
|
|
||||||
public void startup() {
|
|
||||||
s_log.info("Document Manager is initializing.");
|
|
||||||
|
|
||||||
setupDomainFactory();
|
|
||||||
|
|
||||||
TransactionContext txn = SessionManager.getSession()
|
|
||||||
.getTransactionContext();
|
|
||||||
txn.beginTxn();
|
|
||||||
|
|
||||||
ApplicationType docsAppType = setupDocs();
|
|
||||||
setupDocManagerPortlet(docsAppType);
|
|
||||||
|
|
||||||
txn.commitTxn();
|
|
||||||
s_log.info("Document Manager Initializer completed.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up the document manager. Checks to see if the necessary
|
|
||||||
* package exists, and if not it creates it for the first time.
|
|
||||||
*/
|
|
||||||
|
|
||||||
private ApplicationType setupDocs() {
|
|
||||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
|
||||||
setup.setApplicationObjectType(Repository.BASE_DATA_OBJECT_TYPE);
|
|
||||||
setup.setKey(PACKAGE_TYPE_NAME);
|
|
||||||
setup.setTitle("Document Manager Application");
|
|
||||||
setup.setSingleton(true);
|
|
||||||
setup.setDescription
|
|
||||||
("The document manager empowers users to share documents.");
|
|
||||||
setup.setDispatcherClass("com.arsdigita.docmgr.ui.DMDispatcher");
|
|
||||||
// setup.setStylesheet("/packages/docmgr/xsl/docs.xsl");
|
|
||||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
|
||||||
@Override
|
|
||||||
public DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new Repository(dataObject);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return setup.run();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupDocManagerPortlet(ApplicationType provider) {
|
|
||||||
// Create the document manager portlet
|
|
||||||
AppPortletSetup setup = new AppPortletSetup(s_log);
|
|
||||||
|
|
||||||
setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE);
|
|
||||||
setup.setTitle("Recently Updated Documents");
|
|
||||||
setup.setDescription("Displays the most recent documents in the document manager.");
|
|
||||||
setup.setProfile(PortletType.WIDE_PROFILE);
|
|
||||||
setup.setProviderApplicationType(provider);
|
|
||||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
|
||||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new RecentUpdatedDocsPortlet(dataObject);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
setup.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up domain object factories for basic document manager
|
|
||||||
* object types.
|
|
||||||
*/
|
|
||||||
private void setupDomainFactory() {
|
|
||||||
DomainObjectFactory.registerInstantiator
|
|
||||||
(ResourceImpl.BASE_DATA_OBJECT_TYPE,
|
|
||||||
new ACSObjectInstantiator() {
|
|
||||||
public DomainObject doNewInstance(DataObject obj) {
|
|
||||||
Boolean isFolder = (Boolean) obj.get(Constants.IS_FOLDER);
|
|
||||||
if (isFolder != null && isFolder.booleanValue()) {
|
|
||||||
return new Folder(obj);
|
|
||||||
} else {
|
|
||||||
return new File(obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// File
|
|
||||||
DomainObjectFactory.registerInstantiator(
|
|
||||||
File.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
|
||||||
public DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new File(dataObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Folder
|
|
||||||
DomainObjectFactory.registerInstantiator(
|
|
||||||
Folder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() {
|
|
||||||
public DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new Folder(dataObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
DomainObjectFactory.registerInstantiator(
|
|
||||||
DocBlobject.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
|
|
||||||
public DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new DocBlobject(dataObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shutdown the document manager.
|
|
||||||
*/
|
|
||||||
public void shutdown() { }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,223 +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.faq;
|
|
||||||
|
|
||||||
import com.arsdigita.faq.ui.FaqQuestionsPortlet;
|
|
||||||
|
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
|
||||||
import com.arsdigita.domain.DomainObjectInstantiator;
|
|
||||||
import com.arsdigita.initializer.Configuration;
|
|
||||||
import com.arsdigita.initializer.InitializationException;
|
|
||||||
import com.arsdigita.kernel.*;
|
|
||||||
import com.arsdigita.persistence.*;
|
|
||||||
import com.arsdigita.web.Application;
|
|
||||||
import com.arsdigita.web.ApplicationType;
|
|
||||||
import com.arsdigita.portal.apportlet.AppPortletType;
|
|
||||||
import com.arsdigita.dispatcher.ObjectNotFoundException;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OldInitializer
|
|
||||||
*
|
|
||||||
* Initializes the faq package.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:teadams@arsdigita.com">Tracy Adams</a>
|
|
||||||
* @version $Revision: #8 $ $Date: 2004/08/17 $
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class OldInitializer
|
|
||||||
|
|
||||||
implements com.arsdigita.initializer.Initializer {
|
|
||||||
|
|
||||||
private Configuration m_conf = new Configuration();
|
|
||||||
public static final String versionId = "$Id: //apps/faq/dev/src/com/arsdigita/faq/Initializer.java#8 $ by $Author: dennis $, $DateTime: 2004/08/17 23:26:27 $";
|
|
||||||
|
|
||||||
private static Logger s_log =
|
|
||||||
Logger.getLogger(OldInitializer.class);
|
|
||||||
|
|
||||||
public OldInitializer() throws InitializationException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the configuration object used by this initializer.
|
|
||||||
**/
|
|
||||||
|
|
||||||
public Configuration getConfiguration() {
|
|
||||||
return m_conf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.OldInitializer
|
|
||||||
* present in enterprise.ini
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
public void startup() {
|
|
||||||
|
|
||||||
s_log.info("Faq Initializer starting.");
|
|
||||||
|
|
||||||
|
|
||||||
TransactionContext txn = SessionManager.getSession()
|
|
||||||
.getTransactionContext();
|
|
||||||
txn.beginTxn();
|
|
||||||
|
|
||||||
// Register Faq domain object
|
|
||||||
|
|
||||||
DomainObjectInstantiator instantiator;
|
|
||||||
|
|
||||||
instantiator = new ACSObjectInstantiator() {
|
|
||||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new Faq(dataObject);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
DomainObjectFactory.registerInstantiator
|
|
||||||
(Faq.BASE_DATA_OBJECT_TYPE, instantiator);
|
|
||||||
|
|
||||||
checkFaqSetup();
|
|
||||||
|
|
||||||
|
|
||||||
// Register the portlets
|
|
||||||
instantiator = new ACSObjectInstantiator() {
|
|
||||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new FaqQuestionsPortlet(dataObject);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
DomainObjectFactory.registerInstantiator
|
|
||||||
(FaqQuestionsPortlet.BASE_DATA_OBJECT_TYPE, instantiator);
|
|
||||||
|
|
||||||
txn.commitTxn();
|
|
||||||
|
|
||||||
URLFinder faqFinder = new URLFinder() {
|
|
||||||
public String find(OID oid, String context) throws NoValidURLException {
|
|
||||||
return find(oid);
|
|
||||||
}
|
|
||||||
public String find(OID oid) throws NoValidURLException {
|
|
||||||
QAPair pair;
|
|
||||||
try {
|
|
||||||
pair = (QAPair) DomainObjectFactory.newInstance(oid);
|
|
||||||
} catch (DataObjectNotFoundException e) {
|
|
||||||
throw new ObjectNotFoundException("No such FAQ item: " + oid + " .may have been deleted.");
|
|
||||||
}
|
|
||||||
|
|
||||||
String url = pair.getFaq().getPrimaryURL() + "#" + pair.getID();
|
|
||||||
return url;
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
URLService.registerFinder(QAPair.BASE_DATA_OBJECT_TYPE, faqFinder);
|
|
||||||
|
|
||||||
s_log.debug("Faq Initializer done.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkFaqSetup() {
|
|
||||||
/* This checks to see if a package by this name
|
|
||||||
* is present. If it isn't, setupFaq
|
|
||||||
* will do the necessary setup such as add the
|
|
||||||
* package type, package instance, site node
|
|
||||||
* and style sheet.
|
|
||||||
*/
|
|
||||||
try {
|
|
||||||
s_log.debug("Faq Initializer - verifying setup.");
|
|
||||||
PackageType FaqType = PackageType.findByKey("faq");
|
|
||||||
} catch (DataObjectNotFoundException e) {
|
|
||||||
setupFaq();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void setupFaq() {
|
|
||||||
s_log.info("Faq Initializer - setting up new package");
|
|
||||||
|
|
||||||
/** Adding the package type to the installation
|
|
||||||
*/
|
|
||||||
|
|
||||||
PackageType FaqType = PackageType.create(
|
|
||||||
"faq", "FAQ ", "FAQ s",
|
|
||||||
"http://arsdigita.com/faq");
|
|
||||||
s_log.debug("Just added package type FAQ ");
|
|
||||||
|
|
||||||
/** Adding a style sheet
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Stylesheet FaqSheet =
|
|
||||||
// Stylesheet.createStylesheet("/packages/faq/xsl/faq.xsl");
|
|
||||||
// FaqType.addStylesheet(FaqSheet);
|
|
||||||
|
|
||||||
|
|
||||||
/** Mapping the package type to a dispatcher
|
|
||||||
* class
|
|
||||||
*/
|
|
||||||
|
|
||||||
FaqType.setDispatcherClass("com.arsdigita.faq.FaqDispatcher");
|
|
||||||
|
|
||||||
/** Saving changes
|
|
||||||
*/
|
|
||||||
|
|
||||||
FaqType.save();
|
|
||||||
|
|
||||||
final ApplicationType faqAppType = ApplicationType.createApplicationType
|
|
||||||
(FaqType, "FAQ Application", Faq.BASE_DATA_OBJECT_TYPE);
|
|
||||||
faqAppType.save();
|
|
||||||
|
|
||||||
KernelExcursion ex = new KernelExcursion() {
|
|
||||||
protected void excurse() {
|
|
||||||
setParty(Kernel.getSystemParty());
|
|
||||||
Application faqApp = Application.createApplication
|
|
||||||
(faqAppType, "faq", "FAQ", null);
|
|
||||||
faqApp.save();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ex.run();
|
|
||||||
|
|
||||||
|
|
||||||
// register the faq portlet
|
|
||||||
AppPortletType portletType = AppPortletType.createAppPortletType
|
|
||||||
("Faq Questions Portlet", AppPortletType.WIDE_PROFILE,
|
|
||||||
FaqQuestionsPortlet.BASE_DATA_OBJECT_TYPE);
|
|
||||||
portletType.setProviderApplicationType(faqAppType);
|
|
||||||
portletType.setPortalApplication(true);
|
|
||||||
portletType.save();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called on shutdown. It's probably not a good idea to depend on this
|
|
||||||
* being called.
|
|
||||||
**/
|
|
||||||
|
|
||||||
public void shutdown() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -17,47 +17,13 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.forum.categorised;
|
package com.arsdigita.forum.categorised;
|
||||||
// import com.arsdigita.db.DbHelper;
|
|
||||||
// import com.arsdigita.bebop.RequestLocal;
|
|
||||||
|
|
||||||
// import com.arsdigita.domain.xml.TraversalHandler;
|
|
||||||
|
|
||||||
import com.arsdigita.persistence.pdl.ManifestSource;
|
|
||||||
import com.arsdigita.persistence.pdl.NameFilter;
|
|
||||||
|
|
||||||
import com.arsdigita.runtime.CompoundInitializer;
|
import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
|
||||||
import com.arsdigita.runtime.PDLInitializer;
|
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
|
|
||||||
import com.arsdigita.xml.XML;
|
|
||||||
|
|
||||||
import com.arsdigita.kernel.Group;
|
|
||||||
import com.arsdigita.kernel.URLFinder;
|
|
||||||
import com.arsdigita.kernel.URLService;
|
|
||||||
import com.arsdigita.kernel.NoValidURLException;
|
|
||||||
import com.arsdigita.kernel.ACSObjectInstantiator;
|
|
||||||
import com.arsdigita.kernel.ResourceTypeConfig;
|
|
||||||
import com.arsdigita.kernel.ResourceType;
|
|
||||||
import com.arsdigita.kernel.ui.ResourceConfigFormSection;
|
|
||||||
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
|
||||||
|
|
||||||
import com.arsdigita.persistence.DataCollection;
|
|
||||||
import com.arsdigita.persistence.DataObject;
|
|
||||||
import com.arsdigita.persistence.OID;
|
|
||||||
import com.arsdigita.persistence.SessionManager;
|
|
||||||
import com.arsdigita.web.Application;
|
|
||||||
import com.arsdigita.messaging.ThreadedMessage;
|
|
||||||
|
|
||||||
import com.arsdigita.forum.Forum;
|
import com.arsdigita.forum.Forum;
|
||||||
import com.arsdigita.forum.ForumPageFactory;
|
import com.arsdigita.forum.ForumPageFactory;
|
||||||
import com.arsdigita.forum.portlet.RecentPostingsPortlet;
|
import com.arsdigita.kernel.URLService;
|
||||||
import com.arsdigita.forum.ui.portlet.RecentPostingsPortletEditor;
|
|
||||||
import com.arsdigita.web.ui.ApplicationConfigFormSection;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
@ -71,7 +37,8 @@ public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(Initializer.class);
|
private static final Logger s_log = Logger.getLogger(Initializer.class);
|
||||||
|
|
||||||
public void init(LegacyInitEvent e) {
|
@Override
|
||||||
|
public void init(DomainInitEvent e) {
|
||||||
|
|
||||||
super.init(e);
|
super.init(e);
|
||||||
ForumPageFactory.registerPageBuilder(
|
ForumPageFactory.registerPageBuilder(
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.ContextCloseEvent;
|
import com.arsdigita.runtime.ContextCloseEvent;
|
||||||
import com.arsdigita.runtime.DataInitEvent;
|
import com.arsdigita.runtime.DataInitEvent;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.arsdigita.templating.PatternStylesheetResolver;
|
import com.arsdigita.templating.PatternStylesheetResolver;
|
||||||
|
|
@ -43,12 +42,14 @@ public class Initializer extends CompoundInitializer {
|
||||||
/**
|
/**
|
||||||
* An empty implementation of {@link Initializer#init(DataInitEvent)}.
|
* An empty implementation of {@link Initializer#init(DataInitEvent)}.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(DataInitEvent evt) {}
|
public void init(DataInitEvent evt) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param evt
|
* @param evt
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(DomainInitEvent evt) {
|
public void init(DomainInitEvent evt) {
|
||||||
super.init(evt);
|
super.init(evt);
|
||||||
|
|
||||||
|
|
@ -60,18 +61,11 @@ public class Initializer extends CompoundInitializer {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of the {@link Initializer#init(LegacyInitEvent)}
|
|
||||||
* method.
|
|
||||||
*
|
|
||||||
* @param evt The legacy init event.
|
|
||||||
**/
|
|
||||||
public void init(LegacyInitEvent evt) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An empty implementation of {@link Initializer#close()}.
|
* An empty implementation of {@link Initializer#close()}.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void close(ContextCloseEvent evt) {}
|
public void close(ContextCloseEvent evt) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
import com.arsdigita.persistence.pdl.NameFilter;
|
import com.arsdigita.persistence.pdl.NameFilter;
|
||||||
import com.arsdigita.runtime.CompoundInitializer;
|
import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
|
||||||
import com.arsdigita.runtime.PDLInitializer;
|
import com.arsdigita.runtime.PDLInitializer;
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
import com.arsdigita.runtime.RuntimeConfig;
|
||||||
import com.arsdigita.xml.XML;
|
import com.arsdigita.xml.XML;
|
||||||
|
|
@ -50,7 +49,6 @@ import com.arsdigita.xml.XML;
|
||||||
* @version $Id: Initializer.java 1741 2008-09-01 15:38:21Z clasohm $
|
* @version $Id: Initializer.java 1741 2008-09-01 15:38:21Z clasohm $
|
||||||
*/
|
*/
|
||||||
public class Initializer extends CompoundInitializer {
|
public class Initializer extends CompoundInitializer {
|
||||||
public final static String versionId = "$Id: Initializer.java 1741 2008-09-01 15:38:21Z clasohm $";
|
|
||||||
|
|
||||||
public Initializer() {
|
public Initializer() {
|
||||||
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
||||||
|
|
@ -60,10 +58,17 @@ public class Initializer extends CompoundInitializer {
|
||||||
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO - one the core initializers are ported this should be moved
|
@Override
|
||||||
// to be a DomainEvent instead of a LegacyInitEvent
|
public void init(DomainInitEvent evt) {
|
||||||
public void init(LegacyInitEvent evt) {
|
super.init(evt);
|
||||||
super.init(evt);
|
|
||||||
|
DomainObjectFactory f = evt.getFactory();
|
||||||
|
f.registerInstantiator(AtoZCategoryAlias.BASE_DATA_OBJECT_TYPE,
|
||||||
|
new DomainObjectInstantiator() {
|
||||||
|
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||||
|
return new AtoZCategoryAlias(dataObject);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
XML.parse(AtoZ.getConfig().getTraversalAdapters(),
|
XML.parse(AtoZ.getConfig().getTraversalAdapters(),
|
||||||
new TraversalHandler());
|
new TraversalHandler());
|
||||||
|
|
@ -98,14 +103,4 @@ public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(DomainInitEvent evt) {
|
|
||||||
super.init(evt);
|
|
||||||
|
|
||||||
DomainObjectFactory f = evt.getFactory();
|
|
||||||
f.registerInstantiator(AtoZCategoryAlias.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
|
|
||||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
|
||||||
return new AtoZCategoryAlias(dataObject);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import com.arsdigita.domain.xml.TraversalHandler;
|
||||||
import com.arsdigita.persistence.pdl.ManifestSource;
|
import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
import com.arsdigita.persistence.pdl.NameFilter;
|
import com.arsdigita.persistence.pdl.NameFilter;
|
||||||
import com.arsdigita.runtime.CompoundInitializer;
|
import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
import com.arsdigita.runtime.PDLInitializer;
|
import com.arsdigita.runtime.PDLInitializer;
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
import com.arsdigita.runtime.RuntimeConfig;
|
||||||
import com.arsdigita.xml.XML;
|
import com.arsdigita.xml.XML;
|
||||||
|
|
@ -45,7 +45,8 @@ public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
// TODO - one the core initializers are ported this should be moved
|
// TODO - one the core initializers are ported this should be moved
|
||||||
// to be a DomainEvent instead of a LegacyInitEvent
|
// to be a DomainEvent instead of a LegacyInitEvent
|
||||||
public void init(LegacyInitEvent evt) {
|
@Override
|
||||||
|
public void init(DomainInitEvent evt) {
|
||||||
super.init(evt);
|
super.init(evt);
|
||||||
|
|
||||||
XML.parse(Exporter.getConfig().getTraversalAdapters(),
|
XML.parse(Exporter.getConfig().getTraversalAdapters(),
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,6 @@ import com.arsdigita.search.IndexerType;
|
||||||
import com.arsdigita.search.FilterType;
|
import com.arsdigita.search.FilterType;
|
||||||
import com.arsdigita.search.QueryEngineRegistry;
|
import com.arsdigita.search.QueryEngineRegistry;
|
||||||
import com.arsdigita.search.filters.ObjectTypeFilterType;
|
import com.arsdigita.search.filters.ObjectTypeFilterType;
|
||||||
import com.arsdigita.london.search.RemoteQueryEngine;
|
|
||||||
import com.arsdigita.london.search.HostFilterType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Search initializer.
|
* The Search initializer.
|
||||||
|
|
@ -60,6 +58,7 @@ public class Initializer extends CompoundInitializer {
|
||||||
* This starts up the search threads according to the values in the
|
* This starts up the search threads according to the values in the
|
||||||
* properties file
|
* properties file
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(DomainInitEvent e) {
|
public void init(DomainInitEvent e) {
|
||||||
super.init(e);
|
super.init(e);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@ public class DocumentManager implements HttpDocManager {
|
||||||
* "Borrowed" from com.arsdigita.dispatcher.DispatcherHelper.
|
* "Borrowed" from com.arsdigita.dispatcher.DispatcherHelper.
|
||||||
* TO DO: Move this into an appropriate utility class!
|
* TO DO: Move this into an appropriate utility class!
|
||||||
*/
|
*/
|
||||||
public static final SimpleDateFormat rfc1123_formatter = new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss z");
|
public static final SimpleDateFormat rfc1123_formatter =
|
||||||
|
new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss z");
|
||||||
|
|
||||||
private static final org.apache.log4j.Logger s_log =
|
private static final org.apache.log4j.Logger s_log =
|
||||||
org.apache.log4j.Logger.getLogger(DocumentManager.class);
|
org.apache.log4j.Logger.getLogger(DocumentManager.class);
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ public class Scheduler {
|
||||||
|
|
||||||
s_timer = new Timer(true); // start timer as daemon thread
|
s_timer = new Timer(true); // start timer as daemon thread
|
||||||
if (s_log.isInfoEnabled()) {
|
if (s_log.isInfoEnabled()) {
|
||||||
s_log.info("Starting timer with delay= " + s_timerDelay + ", frequency= " + s_timerFrequency
|
s_log.info("Starting timer with delay= " + s_timerDelay
|
||||||
|
+ ", frequency= " + s_timerFrequency
|
||||||
+ ", maxDepth= " + s_maxDepth);
|
+ ", maxDepth= " + s_maxDepth);
|
||||||
}
|
}
|
||||||
s_timer.schedule(new Scheduler.SpiderTask(),
|
s_timer.schedule(new Scheduler.SpiderTask(),
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,10 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A record containing search spider configuration properties.
|
* A record containing search spider configuration properties.
|
||||||
|
*
|
||||||
|
* @version $Id: SpiderConfig.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
public final class SpiderConfig extends AbstractConfig {
|
public final class SpiderConfig extends AbstractConfig {
|
||||||
public static final String versionId =
|
|
||||||
"$Id: SpiderConfig.java 287 2005-02-22 00:29:02Z sskracic $" +
|
|
||||||
"$Author: sskracic $" +
|
|
||||||
"$DateTime: 2003/11/27 11:55:32 $";
|
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(SpiderConfig.class);
|
private static final Logger s_log = Logger.getLogger(SpiderConfig.class);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import com.arsdigita.domain.DomainObject;
|
||||||
|
|
||||||
import com.arsdigita.kernel.ACSObjectInstantiator;
|
import com.arsdigita.kernel.ACSObjectInstantiator;
|
||||||
|
|
||||||
import com.arsdigita.persistence.pdl.ManifestSource;
|
// import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
import com.arsdigita.persistence.pdl.NameFilter;
|
import com.arsdigita.persistence.pdl.NameFilter;
|
||||||
import com.arsdigita.persistence.pdl.ManifestSource;
|
import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
|
@ -33,7 +33,7 @@ import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
import com.arsdigita.runtime.RuntimeConfig;
|
||||||
import com.arsdigita.runtime.PDLInitializer;
|
import com.arsdigita.runtime.PDLInitializer;
|
||||||
import com.arsdigita.runtime.CompoundInitializer;
|
import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
// import com.arsdigita.runtime.LegacyInitEvent;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
|
|
||||||
import com.arsdigita.templating.PatternStylesheetResolver;
|
import com.arsdigita.templating.PatternStylesheetResolver;
|
||||||
|
|
@ -56,23 +56,19 @@ public class Initializer extends CompoundInitializer {
|
||||||
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init(DomainInitEvent e) {
|
public void init(DomainInitEvent e) {
|
||||||
super.init(e);
|
super.init(e);
|
||||||
|
|
||||||
e.getFactory().registerInstantiator(
|
e.getFactory().registerInstantiator(
|
||||||
Subsite.BASE_DATA_OBJECT_TYPE,
|
Subsite.BASE_DATA_OBJECT_TYPE,
|
||||||
new ACSObjectInstantiator() {
|
new ACSObjectInstantiator() {
|
||||||
|
@Override
|
||||||
public DomainObject doNewInstance(DataObject dataObject) {
|
public DomainObject doNewInstance(DataObject dataObject) {
|
||||||
return new Subsite(dataObject);
|
return new Subsite(dataObject);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// TODO - once the core initializers are ported this should be moved
|
|
||||||
// to be a DomainEvent instead of a LegacyInitEvent
|
|
||||||
public void init(LegacyInitEvent evt) {
|
|
||||||
super.init(evt);
|
|
||||||
|
|
||||||
XML.parse(Subsite.getConfig().getTraversalAdapters(),
|
XML.parse(Subsite.getConfig().getTraversalAdapters(),
|
||||||
new TraversalHandler());
|
new TraversalHandler());
|
||||||
|
|
||||||
|
|
@ -81,4 +77,18 @@ public class Initializer extends CompoundInitializer {
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO - once the core initializers are ported this should be moved
|
||||||
|
// to be a DomainEvent instead of a LegacyInitEvent
|
||||||
|
// public void init(LegacyInitEvent evt) {
|
||||||
|
// super.init(evt);
|
||||||
|
|
||||||
|
// XML.parse(Subsite.getConfig().getTraversalAdapters(),
|
||||||
|
// new TraversalHandler());
|
||||||
|
|
||||||
|
// PatternStylesheetResolver.registerPatternGenerator(
|
||||||
|
// "subsite", new SubsitePatternGenerator()
|
||||||
|
// );
|
||||||
|
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ import com.arsdigita.portalserver.ui.admin.PortalSiteMap;
|
||||||
import com.arsdigita.runtime.CompoundInitializer;
|
import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
import com.arsdigita.runtime.RuntimeConfig;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
import com.arsdigita.runtime.LegacyInitializer;
|
|
||||||
import com.arsdigita.runtime.PDLInitializer;
|
import com.arsdigita.runtime.PDLInitializer;
|
||||||
// import com.arsdigita.web.*;
|
// import com.arsdigita.web.*;
|
||||||
import com.arsdigita.web.Application;
|
import com.arsdigita.web.Application;
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,11 @@ import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @version $Id: com/arsdigita/portalserver/permissions/Grant.java $
|
||||||
|
*/
|
||||||
class Grant {
|
class Grant {
|
||||||
public static final String versionId =
|
|
||||||
"$Id: //portalserver/dev/src/com/arsdigita/portalserver/permissions/Grant.java#5 $" +
|
|
||||||
"$Author: dennis $" +
|
|
||||||
"$DateTime: 2004/08/17 23:19:25 $";
|
|
||||||
|
|
||||||
private static Logger s_log = Logger.getLogger(Grant.class.getName());
|
private static Logger s_log = Logger.getLogger(Grant.class.getName());
|
||||||
|
|
||||||
|
|
@ -82,6 +82,7 @@ class Grant {
|
||||||
public String objectTypeDisplayName = null;
|
public String objectTypeDisplayName = null;
|
||||||
public int level;
|
public int level;
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
if (objectType == null) {
|
if (objectType == null) {
|
||||||
return granteeID.hashCode() + objectID.hashCode();
|
return granteeID.hashCode() + objectID.hashCode();
|
||||||
|
|
@ -92,6 +93,7 @@ class Grant {
|
||||||
objectType.hashCode();
|
objectType.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -122,6 +124,7 @@ class Grant {
|
||||||
return objectType.equals(otherGrant.objectType);
|
return objectType.equals(otherGrant.objectType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return marshal(granteeID, objectID, basePrivilege, objectType);
|
return marshal(granteeID, objectID, basePrivilege, objectType);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,14 @@ import com.arsdigita.portalserver.*;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
|
// ///////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Everything moved into central initializer
|
||||||
|
//
|
||||||
|
// ///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
//public class Initializer extends BaseInitializer {
|
//public class Initializer extends BaseInitializer {
|
||||||
public class Initializer {
|
public class Initializer {
|
||||||
public static final String versionId = "$Id: //portalserver/dev/src/com/arsdigita/portalserver/ui/admin/Initializer.java#9 $ by $Author: dennis $, $DateTime: 2004/08/17 23:19:25 $";
|
public static final String versionId = "$Id: //portalserver/dev/src/com/arsdigita/portalserver/ui/admin/Initializer.java#9 $ by $Author: dennis $, $DateTime: 2004/08/17 23:19:25 $";
|
||||||
|
|
@ -37,8 +37,27 @@ delete from site_nodes
|
||||||
delete from apm_packages
|
delete from apm_packages
|
||||||
where pretty_name like '%Portal%' ;
|
where pretty_name like '%Portal%' ;
|
||||||
|
|
||||||
-- table apm_package_types doesn't require an update
|
-- table apm_package_types
|
||||||
delete from apm_package_types
|
delete from apm_package_types
|
||||||
where pretty_name like '%Workspace%' ;
|
where pretty_name like '%Workspace%' ;
|
||||||
|
|
||||||
|
delete from object_context
|
||||||
|
where object_id = (select acs_objects.object_id from acs_objects
|
||||||
|
where acs_objects.object_type
|
||||||
|
like '%com.arsdigita.kernel%'
|
||||||
|
AND acs_objects.display_name like '/portal/') ;
|
||||||
|
|
||||||
|
delete from object_context
|
||||||
|
where object_id = (select acs_objects.object_id from acs_objects
|
||||||
|
where acs_objects.object_type
|
||||||
|
like '%com.arsdigita.kernel%'
|
||||||
|
AND acs_objects.display_name like 'Portal Workspace') ;
|
||||||
|
|
||||||
|
delete from acs_objects
|
||||||
|
where object_type like '%com.arsdigita.kernel%'
|
||||||
|
AND display_name like '/portal/' ;
|
||||||
|
|
||||||
|
delete from acs_objects
|
||||||
|
where object_type like '%com.arsdigita.kernel%'
|
||||||
|
AND display_name like 'Portal Workspace' ;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ class Grant {
|
||||||
public String objectTypeDisplayName = null;
|
public String objectTypeDisplayName = null;
|
||||||
public int level;
|
public int level;
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
if (objectType == null) {
|
if (objectType == null) {
|
||||||
return granteeID.hashCode() + objectID.hashCode();
|
return granteeID.hashCode() + objectID.hashCode();
|
||||||
|
|
@ -92,6 +93,7 @@ class Grant {
|
||||||
objectType.hashCode();
|
objectType.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -122,6 +124,7 @@ class Grant {
|
||||||
return objectType.equals(otherGrant.objectType);
|
return objectType.equals(otherGrant.objectType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return marshal(granteeID, objectID, basePrivilege, objectType);
|
return marshal(granteeID, objectID, basePrivilege, objectType);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,6 @@ import com.arsdigita.kernel.ACSObject;
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
import com.arsdigita.kernel.permissions.PermissionService;
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||||
//import com.arsdigita.kernel.permissions.ParameterizedPrivilege;
|
|
||||||
import com.arsdigita.portalworkspace.util.GlobalizationUtil;
|
|
||||||
import com.arsdigita.portalworkspace.ui.Icons;
|
import com.arsdigita.portalworkspace.ui.Icons;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
|
|
||||||
|
|
@ -45,8 +43,9 @@ import org.apache.log4j.Category;
|
||||||
/**
|
/**
|
||||||
* GrantsTable.
|
* GrantsTable.
|
||||||
*
|
*
|
||||||
|
* Reimplementation using Ardigita portal server code.
|
||||||
* @author dennis (2003/08/15)
|
* @author dennis (2003/08/15)
|
||||||
* @version $Id: //portalserver/dev/src/com/arsdigita/portalserver/permissions/GrantsTable.java#2 $
|
* @version $Id: com/arsdigita/portalserver/permissions/GrantsTable.java $
|
||||||
*/
|
*/
|
||||||
abstract class GrantsTable extends Table {
|
abstract class GrantsTable extends Table {
|
||||||
|
|
||||||
|
|
@ -74,6 +73,7 @@ abstract class GrantsTable extends Table {
|
||||||
final String eventName = privilege.getName();
|
final String eventName = privilege.getName();
|
||||||
|
|
||||||
m_link = new ControlLink(Icons.RADIO_EMPTY_16) {
|
m_link = new ControlLink(Icons.RADIO_EMPTY_16) {
|
||||||
|
@Override
|
||||||
public void setControlEvent(PageState ps) {
|
public void setControlEvent(PageState ps) {
|
||||||
ps.setControlEvent((Component) s_targetRL.get(ps),
|
ps.setControlEvent((Component) s_targetRL.get(ps),
|
||||||
eventName,
|
eventName,
|
||||||
|
|
@ -140,10 +140,11 @@ abstract class GrantsTable extends Table {
|
||||||
|
|
||||||
// Per-request label for renderer getComponent calls
|
// Per-request label for renderer getComponent calls
|
||||||
private final static RequestLocal s_dynamicLabel = new RequestLocal() {
|
private final static RequestLocal s_dynamicLabel = new RequestLocal() {
|
||||||
public Object initialValue(PageState ps) {
|
@Override
|
||||||
return new Label();
|
public Object initialValue(PageState ps) {
|
||||||
}
|
return new Label();
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public GrantsTable(final RequestLocal grantsRL,
|
public GrantsTable(final RequestLocal grantsRL,
|
||||||
final RequestLocal typesRL,
|
final RequestLocal typesRL,
|
||||||
|
|
@ -279,6 +280,7 @@ abstract class GrantsTable extends Table {
|
||||||
setHeader(new TableHeader(columnModel));
|
setHeader(new TableHeader(columnModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void respond(PageState ps) {
|
public void respond(PageState ps) {
|
||||||
String controlEventName = ps.getControlEventName();
|
String controlEventName = ps.getControlEventName();
|
||||||
String controlEventValue = ps.getControlEventValue();
|
String controlEventValue = ps.getControlEventValue();
|
||||||
|
|
@ -380,8 +382,10 @@ abstract class GrantsTable extends Table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private PermissionDescriptor getPermissionDescriptorHelper
|
private PermissionDescriptor getPermissionDescriptorHelper(Grant grant,
|
||||||
(Grant grant, int privLevel, OID objectOID, OID partyOID) {
|
int privLevel,
|
||||||
|
OID objectOID,
|
||||||
|
OID partyOID) {
|
||||||
PrivilegeDescriptor priv;
|
PrivilegeDescriptor priv;
|
||||||
|
|
||||||
// if (grant.objectType != null) {
|
// if (grant.objectType != null) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import com.arsdigita.runtime.CompoundInitializer;
|
||||||
import com.arsdigita.runtime.ContextCloseEvent;
|
import com.arsdigita.runtime.ContextCloseEvent;
|
||||||
import com.arsdigita.runtime.DataInitEvent;
|
import com.arsdigita.runtime.DataInitEvent;
|
||||||
import com.arsdigita.runtime.DomainInitEvent;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
import com.arsdigita.runtime.LegacyInitEvent;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.arsdigita.templating.PatternStylesheetResolver;
|
import com.arsdigita.templating.PatternStylesheetResolver;
|
||||||
|
|
@ -62,14 +61,6 @@ public class Initializer extends CompoundInitializer {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of the {@link Initializer#init(LegacyInitEvent)}
|
|
||||||
* method.
|
|
||||||
*
|
|
||||||
* @param evt The legacy init event.
|
|
||||||
**/
|
|
||||||
public void init(LegacyInitEvent evt) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An empty implementation of {@link Initializer#close()}.
|
* An empty implementation of {@link Initializer#close()}.
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
|
|
||||||
update application_types
|
update application_types
|
||||||
set title='Theme Director',
|
set title='Theme Director',
|
||||||
package_type_id=null
|
package_type_id=null
|
||||||
where object_type='com.arsdigita.themedirector.ThemeDirector' ;
|
where object_type='com.arsdigita.themedirector.ThemeDirector' ;
|
||||||
|
|
||||||
|
|
@ -37,8 +37,23 @@ delete from site_nodes
|
||||||
delete from apm_packages
|
delete from apm_packages
|
||||||
where pretty_name like '%Theme%' ;
|
where pretty_name like '%Theme%' ;
|
||||||
|
|
||||||
-- table apm_package_types doesn't require an update
|
-- table apm_package_types
|
||||||
delete from apm_package_types
|
delete from apm_package_types
|
||||||
where pretty_name like '%Theme%' ;
|
where pretty_name like '%Theme%' ;
|
||||||
|
|
||||||
|
delete from object_context
|
||||||
|
where object_id = (select acs_objects.object_id from acs_objects
|
||||||
|
where acs_objects.object_type
|
||||||
|
like '%com.arsdigita.kernel%'
|
||||||
|
AND acs_objects.display_name like '/admin/themes/') ;
|
||||||
|
|
||||||
|
delete from object_context
|
||||||
|
where object_id = (select acs_objects.object_id from acs_objects
|
||||||
|
where acs_objects.object_type
|
||||||
|
like '%com.arsdigita.kernel%'
|
||||||
|
AND acs_objects.display_name like 'CCM Themes Admin') ;
|
||||||
|
|
||||||
|
delete from acs_objects
|
||||||
|
where object_type like '%com.arsdigita.kernel%'
|
||||||
|
AND display_name like '%hemes%' ;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.domain.DomainObjectInstantiator;
|
import com.arsdigita.domain.DomainObjectInstantiator;
|
||||||
import com.arsdigita.initializer.InitializationException;
|
// import com.arsdigita.initializer.InitializationException;
|
||||||
import com.arsdigita.kernel.ACSObjectInstantiator;
|
import com.arsdigita.kernel.ACSObjectInstantiator;
|
||||||
import com.arsdigita.kernel.PackageType;
|
import com.arsdigita.kernel.PackageType;
|
||||||
// import com.arsdigita.kernel.Stylesheet;
|
// import com.arsdigita.kernel.Stylesheet;
|
||||||
|
|
@ -32,7 +32,8 @@ public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(Initializer.class);
|
private static final Logger s_log = Logger.getLogger(Initializer.class);
|
||||||
|
|
||||||
public Initializer() throws InitializationException {
|
//ublic Initializer() throws InitializationException {
|
||||||
|
public Initializer() {
|
||||||
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
||||||
final int database = DbHelper.getDatabaseFromURL(url);
|
final int database = DbHelper.getDatabaseFromURL(url);
|
||||||
|
|
||||||
|
|
@ -40,6 +41,7 @@ public class Initializer extends CompoundInitializer {
|
||||||
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init(DomainInitEvent e) {
|
public void init(DomainInitEvent e) {
|
||||||
s_log.info("WebLog Initializer starting.");
|
s_log.info("WebLog Initializer starting.");
|
||||||
|
|
||||||
|
|
@ -53,6 +55,7 @@ public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
// register application
|
// register application
|
||||||
DomainObjectInstantiator instantiator = new ACSObjectInstantiator() {
|
DomainObjectInstantiator instantiator = new ACSObjectInstantiator() {
|
||||||
|
@Override
|
||||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||||
return new WebLogApplication(dataObject);
|
return new WebLogApplication(dataObject);
|
||||||
}
|
}
|
||||||
|
|
@ -63,6 +66,7 @@ public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
// Register the portlets
|
// Register the portlets
|
||||||
instantiator = new ACSObjectInstantiator() {
|
instantiator = new ACSObjectInstantiator() {
|
||||||
|
@Override
|
||||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||||
return new WebLogPortlet(dataObject);
|
return new WebLogPortlet(dataObject);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@
|
||||||
<!-- <ccm:application name="ccm-auth-http"/> -->
|
<!-- <ccm:application name="ccm-auth-http"/> -->
|
||||||
<!-- <ccm:application name="ccm-bookmarks"/> -->
|
<!-- <ccm:application name="ccm-bookmarks"/> -->
|
||||||
<ccm:application name="ccm-docmgr"/>
|
<ccm:application name="ccm-docmgr"/>
|
||||||
|
<ccm:application name="ccm-docrepo"/>
|
||||||
|
<ccm:application name="ccm-faq"/>
|
||||||
<!-- <ccm:application name="ccm-formbuilder-pdf"/> -->
|
<!-- <ccm:application name="ccm-formbuilder-pdf"/> -->
|
||||||
<ccm:application name="ccm-forum"/>
|
<ccm:application name="ccm-forum"/>
|
||||||
<!-- <ccm:application name="ccm-forum-categorised"/> -->
|
<!-- <ccm:application name="ccm-forum-categorised"/> -->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue