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-94f89814c4dfmaster
parent
7d648db23a
commit
61171e5cdb
|
|
@ -482,14 +482,14 @@ public class ContentType extends ACSObject {
|
||||||
*/
|
*/
|
||||||
public static ContentType findByAssociatedObjectType(String objType)
|
public static ContentType findByAssociatedObjectType(String objType)
|
||||||
throws DataObjectNotFoundException {
|
throws DataObjectNotFoundException {
|
||||||
|
|
||||||
ContentTypeCollection types = getAllContentTypes();
|
ContentTypeCollection types = getAllContentTypes();
|
||||||
types.addFilter("associatedObjectType = :type").set("type", objType);
|
types.addFilter("associatedObjectType = :type").set("type", objType);
|
||||||
|
|
||||||
if (types.next()) {
|
if (types.next()) {
|
||||||
ContentType type = types.getContentType();
|
ContentType type = types.getContentType();
|
||||||
types.close();
|
types.close();
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -67,11 +67,10 @@ public abstract class ContentTypeInitializer extends CompoundInitializer {
|
||||||
* @param objectType Base Data Object Type of the content type
|
* @param objectType Base Data Object Type of the content type
|
||||||
*/
|
*/
|
||||||
protected ContentTypeInitializer(final String manifestFile,
|
protected ContentTypeInitializer(final String manifestFile,
|
||||||
final String objectType) {
|
final String objectType) {
|
||||||
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
final String url = RuntimeConfig.getConfig().getJDBCURL();
|
||||||
final int database = DbHelper.getDatabaseFromURL(url);
|
final int database = DbHelper.getDatabaseFromURL(url);
|
||||||
|
|
||||||
|
|
||||||
add(new PDLInitializer
|
add(new PDLInitializer
|
||||||
(new ManifestSource
|
(new ManifestSource
|
||||||
(manifestFile,
|
(manifestFile,
|
||||||
|
|
@ -90,18 +89,18 @@ public abstract class ContentTypeInitializer extends CompoundInitializer {
|
||||||
@Override
|
@Override
|
||||||
public void init(DomainInitEvent evt) {
|
public void init(DomainInitEvent evt) {
|
||||||
super.init(evt);
|
super.init(evt);
|
||||||
|
|
||||||
// Register an optional traversal adapter for the content type
|
// Register an optional traversal adapter for the content type
|
||||||
final String traversal = getTraversalXML();
|
final String traversal = getTraversalXML();
|
||||||
if (!StringUtils.emptyString(traversal)) {
|
if (!StringUtils.emptyString(traversal)) {
|
||||||
XML.parseResource
|
XML.parseResource
|
||||||
(traversal,
|
(traversal,
|
||||||
new TraversalHandler());
|
new TraversalHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load and register stylesheets for the content type
|
// Load and register stylesheets for the content type
|
||||||
try {
|
try {
|
||||||
|
|
||||||
ContentType type = ContentType.findByAssociatedObjectType(m_objectType);
|
ContentType type = ContentType.findByAssociatedObjectType(m_objectType);
|
||||||
|
|
||||||
MetadataProviderRegistry.registerAdapter(
|
MetadataProviderRegistry.registerAdapter(
|
||||||
|
|
@ -112,9 +111,8 @@ public abstract class ContentTypeInitializer extends CompoundInitializer {
|
||||||
for (int i = 0; i < stylesheets.length; i++) {
|
for (int i = 0; i < stylesheets.length; i++) {
|
||||||
String stylesheet = stylesheets[i];
|
String stylesheet = stylesheets[i];
|
||||||
ContentType.registerXSLFile(type, stylesheet);
|
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 " +
|
s_log.debug("Unable to register the stylesheet for " +
|
||||||
m_objectType +
|
m_objectType +
|
||||||
" because the content type was not found. " +
|
" because the content type was not found. " +
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class SciDepartmentWithPublicationsInitializer
|
||||||
|
|
||||||
public SciDepartmentWithPublicationsInitializer() {
|
public SciDepartmentWithPublicationsInitializer() {
|
||||||
super("empty.pdl.mf",
|
super("empty.pdl.mf",
|
||||||
SciOrganizationWithPublications.BASE_DATA_OBJECT_TYPE);
|
SciDepartmentWithPublications.BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -44,7 +44,9 @@ public class SciDepartmentWithPublicationsInitializer
|
||||||
ContentType departmentType =
|
ContentType departmentType =
|
||||||
ContentType.findByAssociatedObjectType(SciDepartment.class.
|
ContentType.findByAssociatedObjectType(SciDepartment.class.
|
||||||
getName());
|
getName());
|
||||||
departmentType.setMode("internal");
|
if (!departmentType.isInternal()) {
|
||||||
|
departmentType.setMode("internal");
|
||||||
|
}
|
||||||
|
|
||||||
AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE,
|
AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE,
|
||||||
PublicationSciDepartmentStep.class,
|
PublicationSciDepartmentStep.class,
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,10 @@ public class SciOrganizationWithPublicationsInitializer
|
||||||
ContentType orgaType =
|
ContentType orgaType =
|
||||||
ContentType.findByAssociatedObjectType(SciOrganization.class.
|
ContentType.findByAssociatedObjectType(SciOrganization.class.
|
||||||
getName());
|
getName());
|
||||||
orgaType.setMode("internal");
|
if (!orgaType.isInternal()) {
|
||||||
|
orgaType.setMode("internal");
|
||||||
|
}
|
||||||
|
System.out.println("Set mode to interal");
|
||||||
|
|
||||||
AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE,
|
AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE,
|
||||||
PublicationSciOrganizationStep.class,
|
PublicationSciOrganizationStep.class,
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class SciProjectWithPublicationsInitializer
|
||||||
|
|
||||||
public SciProjectWithPublicationsInitializer() {
|
public SciProjectWithPublicationsInitializer() {
|
||||||
super("empty.pdl.mf",
|
super("empty.pdl.mf",
|
||||||
SciOrganizationWithPublications.BASE_DATA_OBJECT_TYPE);
|
SciProjectWithPublications.BASE_DATA_OBJECT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -44,9 +44,11 @@ public class SciProjectWithPublicationsInitializer
|
||||||
ContentType projectType =
|
ContentType projectType =
|
||||||
ContentType.findByAssociatedObjectType(SciProject.class.
|
ContentType.findByAssociatedObjectType(SciProject.class.
|
||||||
getName());
|
getName());
|
||||||
projectType.setMode("internal");
|
if (!projectType.isInternal()) {
|
||||||
|
projectType.setMode("internal");
|
||||||
AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE,
|
}
|
||||||
|
|
||||||
|
AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE,
|
||||||
PublicationSciProjectStep.class,
|
PublicationSciProjectStep.class,
|
||||||
new GlobalizedMessage(
|
new GlobalizedMessage(
|
||||||
"sciorganizationpublication.ui.publication.projects.title",
|
"sciorganizationpublication.ui.publication.projects.title",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue