From 61171e5cdbe79463816ac5cc851f2745dae3daa7 Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 17 Jun 2011 10:30:23 +0000 Subject: [PATCH] =?UTF-8?q?Die=20Initalizer=20SciDepartmentWithPublication?= =?UTF-8?q?sInitializer,=20SciOrganizationWithPublicationsInitializer=20un?= =?UTF-8?q?d=20SciProjectWithPublicationsInitializer=20blieben=20bei=20ein?= =?UTF-8?q?em=20mehrfachen=20Start=20von=20CCM=20(mehrere=20Instanzen)=20b?= =?UTF-8?q?ei=20der=20zweiten=20Instanz=20h=C3=A4ngen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@966 8810af33-2d31-482b-a856-94f89814c4df --- ccm-cms/src/com/arsdigita/cms/ContentType.java | 4 ++-- .../cms/contenttypes/ContentTypeInitializer.java | 16 +++++++--------- ...SciDepartmentWithPublicationsInitializer.java | 6 ++++-- ...iOrganizationWithPublicationsInitializer.java | 5 ++++- .../SciProjectWithPublicationsInitializer.java | 10 ++++++---- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/ContentType.java b/ccm-cms/src/com/arsdigita/cms/ContentType.java index 187a42494..05282a455 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentType.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentType.java @@ -482,14 +482,14 @@ public class ContentType extends ACSObject { */ public static ContentType findByAssociatedObjectType(String objType) throws DataObjectNotFoundException { - + ContentTypeCollection types = getAllContentTypes(); types.addFilter("associatedObjectType = :type").set("type", objType); if (types.next()) { ContentType type = types.getContentType(); types.close(); - + return type; } else { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeInitializer.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeInitializer.java index 474209719..16dbcdac6 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeInitializer.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentTypeInitializer.java @@ -67,11 +67,10 @@ public abstract class ContentTypeInitializer extends CompoundInitializer { * @param objectType Base Data Object Type of the content type */ protected ContentTypeInitializer(final String manifestFile, - final String objectType) { - final String url = RuntimeConfig.getConfig().getJDBCURL(); + final String objectType) { + final String url = RuntimeConfig.getConfig().getJDBCURL(); final int database = DbHelper.getDatabaseFromURL(url); - - + add(new PDLInitializer (new ManifestSource (manifestFile, @@ -90,18 +89,18 @@ public abstract class ContentTypeInitializer extends CompoundInitializer { @Override public void init(DomainInitEvent evt) { super.init(evt); - + // Register an optional traversal adapter for the content type final String traversal = getTraversalXML(); if (!StringUtils.emptyString(traversal)) { XML.parseResource (traversal, new TraversalHandler()); - } + } // Load and register stylesheets for the content type try { - + ContentType type = ContentType.findByAssociatedObjectType(m_objectType); MetadataProviderRegistry.registerAdapter( @@ -112,9 +111,8 @@ public abstract class ContentTypeInitializer extends CompoundInitializer { for (int i = 0; i < stylesheets.length; i++) { String stylesheet = stylesheets[i]; ContentType.registerXSLFile(type, stylesheet); - } - } catch (com.arsdigita.domain.DataObjectNotFoundException e) { + } catch (com.arsdigita.domain.DataObjectNotFoundException e) { s_log.debug("Unable to register the stylesheet for " + m_objectType + " because the content type was not found. " + diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java index cf775a603..243958060 100644 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java +++ b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java @@ -34,7 +34,7 @@ public class SciDepartmentWithPublicationsInitializer public SciDepartmentWithPublicationsInitializer() { super("empty.pdl.mf", - SciOrganizationWithPublications.BASE_DATA_OBJECT_TYPE); + SciDepartmentWithPublications.BASE_DATA_OBJECT_TYPE); } @Override @@ -44,7 +44,9 @@ public class SciDepartmentWithPublicationsInitializer ContentType departmentType = ContentType.findByAssociatedObjectType(SciDepartment.class. getName()); - departmentType.setMode("internal"); + if (!departmentType.isInternal()) { + departmentType.setMode("internal"); + } AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE, PublicationSciDepartmentStep.class, diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java index 9d1b0e1a4..c9da03a86 100644 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java +++ b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java @@ -44,7 +44,10 @@ public class SciOrganizationWithPublicationsInitializer ContentType orgaType = ContentType.findByAssociatedObjectType(SciOrganization.class. getName()); - orgaType.setMode("internal"); + if (!orgaType.isInternal()) { + orgaType.setMode("internal"); + } + System.out.println("Set mode to interal"); AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE, PublicationSciOrganizationStep.class, diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java index 60b05b772..edd8a5081 100644 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java +++ b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java @@ -34,7 +34,7 @@ public class SciProjectWithPublicationsInitializer public SciProjectWithPublicationsInitializer() { super("empty.pdl.mf", - SciOrganizationWithPublications.BASE_DATA_OBJECT_TYPE); + SciProjectWithPublications.BASE_DATA_OBJECT_TYPE); } @Override @@ -44,9 +44,11 @@ public class SciProjectWithPublicationsInitializer ContentType projectType = ContentType.findByAssociatedObjectType(SciProject.class. getName()); - projectType.setMode("internal"); - - AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE, + if (!projectType.isInternal()) { + projectType.setMode("internal"); + } + + AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE, PublicationSciProjectStep.class, new GlobalizedMessage( "sciorganizationpublication.ui.publication.projects.title",