Die Initalizer SciDepartmentWithPublicationsInitializer, SciOrganizationWithPublicationsInitializer und SciProjectWithPublicationsInitializer blieben bei einem mehrfachen Start von CCM (mehrere

Instanzen) bei der zweiten Instanz hängen.


git-svn-id: https://svn.libreccm.org/ccm/trunk@966 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-06-17 10:30:23 +00:00
parent 7d648db23a
commit 61171e5cdb
5 changed files with 23 additions and 18 deletions

View File

@ -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 {

View File

@ -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. " +

View File

@ -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,

View File

@ -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,

View File

@ -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",