From 81be5540dc0534d349ae048a924e2f161a7b78a1 Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 27 Sep 2017 19:45:02 +0000 Subject: [PATCH] CCM NG: - Removed class WorkflowTemplate, replaced by property abstractWorkflow in class workflow - Fixed several test failures git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5015 8810af33-2d31-482b-a856-94f89814c4df --- .../ui/authoring/ApplyWorkflowController.java | 13 +- .../authoring/ApplyWorkflowFormSection.java | 10 +- .../cms/ui/authoring/BasicPageForm.java | 8 +- .../ui/authoring/BasicPageFormController.java | 10 +- .../cms/ui/authoring/PageCreateForm.java | 16 +- .../ui/lifecycle/ItemLifecycleSelectForm.java | 3 +- .../type/ContentTypeAdminPaneController.java | 8 +- .../cms/ui/type/ContentTypePropertyList.java | 2 - .../com/arsdigita/cms/ui/type/EditType.java | 21 +- .../ui/workflow/ItemWorkflowSelectForm.java | 14 +- .../cms/ui/workflow/WorkflowAddForm.java | 24 +- .../cms/ui/workflow/WorkflowAdminPane.java | 5 +- .../workflow/WorkflowAdminPaneController.java | 61 +- .../ui/workflow/WorkflowListModelBuilder.java | 7 +- .../WorkflowsOptionPrintListener.java | 8 +- ...orkflowsOptionPrintListenerController.java | 4 +- .../contentsection/ContentItemManager.java | 15 +- .../contentsection/ContentSection.java | 160 +- .../contentsection/ContentSectionManager.java | 215 +- .../librecms/contentsection/ContentType.java | 14 +- .../contentsection/ContentTypeManager.java | 16 +- .../privileges/AdminPrivileges.java | 4 +- .../h2/V7_0_0_15__abstract_workflow.sql | 17 + .../pgsql/V7_0_0_15__abstract_workflow.sql | 17 + .../contentsection/AssetManagerTest.java | 399 ++- .../contentsection/AssetRepositoryTest.java | 29 +- .../ContentItemManagerTest.java | 30 +- .../ContentItemPermissionTest.java | 2 +- .../ContentSectionManagerTest.java | 34 +- .../ContentTypeRepositoryTest.java | 2 +- .../contentsection/EqualsAndHashCodeTest.java | 21 +- .../scripts/cleanup.sql | 2 - .../scripts/create_ccm_cms_schema.sql | 918 +++++- .../scripts/cleanup.sql | 2 - .../scripts/create_ccm_cms_schema.sql | 2782 +++++++++++++++++ .../workflow/AbstractWorkflowException.java | 67 + .../java/org/libreccm/workflow/Workflow.java | 36 +- .../libreccm/workflow/WorkflowManager.java | 32 +- .../libreccm/workflow/WorkflowTemplate.java | 98 - .../workflow/WorkflowTemplateIdResolver.java | 62 - .../workflow/WorkflowTemplateMarshaller.java | 50 - .../workflow/WorkflowTemplateRepository.java | 80 - .../h2/V7_0_0_14__abstract_workflow.sql | 13 + .../pgsql/V7_0_0_14__abstract_workflow.sql | 13 + .../portation/CoreDataImportTest.java | 2 +- .../org/libreccm/portation/ImportHelper.java | 15 - .../security/PermissionManagerTest.java | 240 +- .../workflow/EqualsAndHashCodeTest.java | 10 +- .../scripts/create_ccm_core_schema.sql | 72 +- .../scripts/create_ccm_core_schema.sql | 30 +- .../scripts/create_ccm_docrepo_schema.sql | 1080 ++++--- .../scripts/create_ccm_docrepo_schema.sql | 1364 ++++---- .../scripts/create_ccm_shortcuts_schema.sql | 98 +- .../scripts/create_ccm_shortcuts_schema.sql | 55 +- 54 files changed, 5950 insertions(+), 2360 deletions(-) create mode 100644 ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_15__abstract_workflow.sql create mode 100644 ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_15__abstract_workflow.sql create mode 100644 ccm-core/src/main/java/org/libreccm/workflow/AbstractWorkflowException.java delete mode 100644 ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplate.java delete mode 100644 ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplateIdResolver.java delete mode 100644 ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplateMarshaller.java delete mode 100644 ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplateRepository.java create mode 100644 ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/h2/V7_0_0_14__abstract_workflow.sql create mode 100644 ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_14__abstract_workflow.sql diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowController.java index 5615bec31..0000eccd4 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowController.java @@ -23,8 +23,7 @@ import org.libreccm.workflow.AssignableTask; import org.libreccm.workflow.AssignableTaskManager; import org.libreccm.workflow.Workflow; import org.libreccm.workflow.WorkflowManager; -import org.libreccm.workflow.WorkflowTemplate; -import org.libreccm.workflow.WorkflowTemplateRepository; +import org.libreccm.workflow.WorkflowRepository; import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionRepository; @@ -56,7 +55,7 @@ class ApplyWorkflowController { private ContentSectionRepository sectionRepo; @Inject - private WorkflowTemplateRepository templateRepo; + private WorkflowRepository templateRepo; @Inject private WorkflowManager workflowManager; @@ -68,7 +67,7 @@ class ApplyWorkflowController { private PermissionChecker permissionChecker; @Transactional(Transactional.TxType.REQUIRED) - protected WorkflowTemplate getDefaultWorkflow(final ContentType contentType) { + protected Workflow getDefaultWorkflow(final ContentType contentType) { Objects.requireNonNull(contentType); @@ -83,7 +82,7 @@ class ApplyWorkflowController { @Transactional(Transactional.TxType.REQUIRED) Long getDefaultWorkflowId(final ContentType contentType) { - final WorkflowTemplate workflowTemplate + final Workflow workflowTemplate = getDefaultWorkflow(contentType); if (workflowTemplate == null) { return null; @@ -93,7 +92,7 @@ class ApplyWorkflowController { } @Transactional(Transactional.TxType.REQUIRED) - protected List getWorkflowTemplates( + protected List getWorkflowTemplates( final ContentSection section) { final ContentSection contentSection = sectionRepo @@ -115,7 +114,7 @@ class ApplyWorkflowController { Objects.requireNonNull(folder); Objects.requireNonNull(workflowTemplateId); - final WorkflowTemplate workflowTemplate; + final Workflow workflowTemplate; if (workflowTemplateId == null && permissionChecker .isPermitted(ItemPrivileges.APPLY_ALTERNATE_WORKFLOW, folder)) { diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowFormSection.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowFormSection.java index ff7889c33..ad1cd176f 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowFormSection.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/ApplyWorkflowFormSection.java @@ -43,7 +43,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.security.PermissionChecker; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.CmsConstants; import org.librecms.contentsection.privileges.ItemPrivileges; @@ -111,7 +111,7 @@ public class ApplyWorkflowFormSection LOGGER.error("Too many listeners", ex); } - add(new Label(new GlobalizedMessage("cms.ui.authoring.workflow", + super.add(new Label(new GlobalizedMessage("cms.ui.authoring.workflow", CmsConstants.CMS_BUNDLE))); radioGroup.addValidationListener(new NotNullValidationListener() { @@ -125,8 +125,8 @@ public class ApplyWorkflowFormSection } }); - add(radioGroup); - addInitListener(this); + super.add(radioGroup); + super.addInitListener(this); } /** @@ -280,7 +280,7 @@ public class ApplyWorkflowFormSection } @Override - protected List getCollection(final PageState state) { + protected List getCollection(final PageState state) { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); final ApplyWorkflowController controller = cdiUtil .findBean(ApplyWorkflowController.class); diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageForm.java index 3a969e3e5..95f3c1f6c 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageForm.java @@ -21,7 +21,6 @@ package com.arsdigita.cms.ui.authoring; import com.arsdigita.bebop.ColumnPanel; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormSectionEvent; @@ -38,16 +37,13 @@ import org.librecms.contentsection.Folder; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.globalization.GlobalizedMessage; -import com.arsdigita.kernel.KernelConfig; import com.arsdigita.util.Assert; import org.arsdigita.cms.CMSConfig; import org.libreccm.cdi.utils.CdiUtil; -import org.libreccm.l10n.GlobalizationHelper; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.CmsConstants; import org.librecms.contentsection.ContentItemInitializer; -import org.librecms.contentsection.ContentItemManager; import org.librecms.contentsection.ContentType; import java.util.Date; @@ -293,7 +289,7 @@ public abstract class BasicPageForm extends BasicItemForm { final String name, final ContentSection section, final Folder folder, - final WorkflowTemplate workflowTemplate, + final Workflow workflowTemplate, final ContentItemInitializer initializer, final Locale locale) throws FormProcessException { diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageFormController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageFormController.java index bb0a911e6..4dade5733 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageFormController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/BasicPageFormController.java @@ -18,8 +18,8 @@ */ package com.arsdigita.cms.ui.authoring; -import org.libreccm.workflow.WorkflowTemplate; -import org.libreccm.workflow.WorkflowTemplateRepository; +import org.libreccm.workflow.Workflow; +import org.libreccm.workflow.WorkflowRepository; import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItemInitializer; import org.librecms.contentsection.ContentItemManager; @@ -56,7 +56,7 @@ class BasicPageFormController { private FolderRepository folderRepo; @Inject - private WorkflowTemplateRepository workflowTemplateRepo; + private WorkflowRepository workflowRepo; @Transactional(Transactional.TxType.REQUIRED) protected T createContentItem( @@ -81,7 +81,7 @@ class BasicPageFormController { final String name, final ContentSection section, final Folder folder, - final WorkflowTemplate workflowTemplate, + final Workflow workflowTemplate, final Class clazz, final ContentItemInitializer initializer, final Locale locale) { @@ -109,7 +109,7 @@ class BasicPageFormController { locale); } else { - final WorkflowTemplate itemWorkflowTemplate = workflowTemplateRepo + final Workflow itemWorkflowTemplate = workflowRepo .findById(workflowTemplate.getWorkflowId()) .orElseThrow(() -> new IllegalArgumentException(String .format("No WorkflowTemplate with ID %d in the database.", diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageCreateForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageCreateForm.java index 5fff620aa..afb4d1e66 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageCreateForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/PageCreateForm.java @@ -39,8 +39,8 @@ import com.arsdigita.util.Assert; import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.l10n.GlobalizationHelper; -import org.libreccm.workflow.WorkflowTemplate; -import org.libreccm.workflow.WorkflowTemplateRepository; +import org.libreccm.workflow.Workflow; +import org.libreccm.workflow.WorkflowRepository; import org.librecms.CmsConstants; import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItemInitializer; @@ -100,9 +100,9 @@ public class PageCreateForm this.selectedLanguageParam = selectedLanguageParam; workflowSection.setCreationSelector(creationSelector); - addSubmissionListener(this); + super.addSubmissionListener(this); - getSaveCancelSection().getSaveButton() + super.getSaveCancelSection().getSaveButton() .setButtonLabel(new GlobalizedMessage("cms.ui.create", CmsConstants.CMS_BUNDLE)); } @@ -239,9 +239,9 @@ public class PageCreateForm getItemInitializer(data, state), locale); } else { - final WorkflowTemplateRepository workflowTemplateRepo = cdiUtil - .findBean(WorkflowTemplateRepository.class); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo + final WorkflowRepository workflowRepo = cdiUtil + .findBean(WorkflowRepository.class); + final Workflow workflowTemplate = workflowRepo .findById(selectedWorkflowTemplateId) .orElseThrow(() -> new IllegalArgumentException(String.format( "No WorkflowTemplate with ID %d in the database.", @@ -262,7 +262,7 @@ public class PageCreateForm final ContentItemRepository itemRepo = cdiUtil .findBean(ContentItemRepository.class); itemRepo.save(item); - + state.setValue(selectedLanguageParam, locale.toString()); creationSelector.editItem(state, item); diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java index 0b85fe247..07519963a 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java @@ -64,7 +64,6 @@ import org.libreccm.workflow.TaskManager; import org.libreccm.workflow.Workflow; import org.libreccm.workflow.WorkflowManager; import org.libreccm.workflow.WorkflowRepository; -import org.libreccm.workflow.WorkflowTemplate; import org.librecms.CmsConstants; import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItemManager; @@ -823,7 +822,7 @@ class ItemLifecycleSelectForm extends BaseForm { } else { // restart the workflow by recreating it // from the same workflow template - final WorkflowTemplate template = workflow.getTemplate(); + final Workflow template = workflow.getTemplate(); workflowRepo.delete(workflow); final Workflow restarted = workflowManager.createWorkflow( template, item); diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypeAdminPaneController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypeAdminPaneController.java index 3aa403a9f..432d79b44 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypeAdminPaneController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypeAdminPaneController.java @@ -18,7 +18,7 @@ */ package com.arsdigita.cms.ui.type; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionRepository; import org.librecms.contentsection.ContentType; @@ -130,7 +130,7 @@ class ContentTypeAdminPaneController { } @Transactional(Transactional.TxType.REQUIRED) - public WorkflowTemplate getWorkflowTemplate(final ContentType type) { + public Workflow getWorkflowTemplate(final ContentType type) { final ContentType contentType = typeRepo .findById(type.getObjectId()) @@ -146,7 +146,7 @@ class ContentTypeAdminPaneController { public Optional getWorkflowTemplateName(final ContentType type, final Locale locale) { - final WorkflowTemplate workflowTemplate = getWorkflowTemplate(type); + final Workflow workflowTemplate = getWorkflowTemplate(type); if (workflowTemplate == null) { return Optional.empty(); @@ -170,7 +170,7 @@ class ContentTypeAdminPaneController { } @Transactional(Transactional.TxType.REQUIRED) - public List getWorkflowTemplates( + public List getWorkflowTemplates( final ContentSection section) { final ContentSection contentSection = sectionRepo diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypePropertyList.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypePropertyList.java index 539d4d414..2dafd940e 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypePropertyList.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/ContentTypePropertyList.java @@ -23,7 +23,6 @@ import com.arsdigita.cms.CMS; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentType; -import org.librecms.lifecycle.LifecycleDefinition; import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.kernel.KernelConfig; @@ -34,7 +33,6 @@ import org.libreccm.cdi.utils.CdiUtil; import java.util.Locale; -import org.libreccm.workflow.WorkflowTemplate; import org.librecms.CmsConstants; import org.librecms.contenttypes.ContentTypeInfo; import org.librecms.contenttypes.ContentTypesManager; diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/EditType.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/EditType.java index 0e891577b..6a7249b82 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/EditType.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/type/EditType.java @@ -42,10 +42,8 @@ import com.arsdigita.cms.CMS; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentType; import org.librecms.lifecycle.LifecycleDefinition; -import org.libreccm.workflow.WorkflowTemplate; import com.arsdigita.cms.ui.CMSForm; -import com.arsdigita.cms.ui.GlobalNavigation; import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.kernel.KernelConfig; import com.arsdigita.util.UncheckedWrapperException; @@ -53,7 +51,8 @@ import com.arsdigita.util.UncheckedWrapperException; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; import org.libreccm.cdi.utils.CdiUtil; -import org.libreccm.workflow.WorkflowTemplateRepository; +import org.libreccm.workflow.Workflow; +import org.libreccm.workflow.WorkflowRepository; import org.librecms.CmsConstants; import org.librecms.contentsection.ContentTypeManager; import org.librecms.contentsection.ContentTypeRepository; @@ -204,7 +203,7 @@ public class EditType extends CMSForm data.put(m_lcSelect.getName(), cycle.getDefinitionId()); } - WorkflowTemplate template = type.getDefaultWorkflow(); + Workflow template = type.getDefaultWorkflow(); if (template != null) { data.put(m_wfSelect.getName(), template.getWorkflowId()); } @@ -215,7 +214,7 @@ public class EditType extends CMSForm * model. */ private ContentType getContentType(final PageState state) { - final String key = (String) m_types.getSelectedKey(state); + final String key = m_types.getSelectedKey(state); final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); final ContentTypeRepository typeRepo = cdiUtil.findBean( @@ -226,7 +225,7 @@ public class EditType extends CMSForm result = typeRepo.findById(Long.parseLong(key)); } catch (NumberFormatException ex) { throw new UncheckedWrapperException(String.format( - "The provided key \"%d\" is not a long.", key), + "The provided key \"%s\" is not a long.", key), ex); } @@ -265,8 +264,8 @@ public class EditType extends CMSForm ContentTypeRepository.class); final LifecycleDefinitionRepository lifecycleDefRepo = cdiUtil.findBean( LifecycleDefinitionRepository.class); - final WorkflowTemplateRepository workflowTemplateRepo = cdiUtil - .findBean(WorkflowTemplateRepository.class); + final WorkflowRepository workflowRepo = cdiUtil + .findBean(WorkflowRepository.class); final ContentTypeManager typeManager = cdiUtil.findBean( ContentTypeManager.class); @@ -292,11 +291,11 @@ public class EditType extends CMSForm } else { defaultLifecycle = lifecycleDefRepo.findById(lifecycleId).get(); } - final WorkflowTemplate defaultWorkflow; + final Workflow defaultWorkflow; if (workflowId == 0) { defaultWorkflow = null; } else { - defaultWorkflow = workflowTemplateRepo.findById(workflowId).get(); + defaultWorkflow = workflowRepo.findById(workflowId).get(); } @@ -367,7 +366,7 @@ public class EditType extends CMSForm final ContentTypeAdminPaneController controller = cdiUtil .findBean(ContentTypeAdminPaneController.class); - final List templates = controller + final List templates = controller .getWorkflowTemplates(section); final Locale defaultLocale = KernelConfig.getConfig() .getDefaultLocale(); diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/ItemWorkflowSelectForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/ItemWorkflowSelectForm.java index 2257020b3..a9d2972d5 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/ItemWorkflowSelectForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/ItemWorkflowSelectForm.java @@ -30,16 +30,19 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.cms.CMS; import com.arsdigita.cms.ui.CMSForm; import com.arsdigita.web.Web; + import org.libreccm.workflow.Workflow; -import org.libreccm.workflow.WorkflowTemplate; + import org.apache.logging.log4j.Logger; import java.math.BigDecimal; import java.util.TooManyListenersException; + import org.apache.logging.log4j.LogManager; import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.workflow.WorkflowManager; -import org.libreccm.workflow.WorkflowTemplateRepository; +import org.libreccm.workflow.WorkflowRepository; + import org.librecms.contentsection.ContentItem; /** @@ -97,12 +100,13 @@ class ItemWorkflowSelectForm extends CMSForm { if (item.getWorkflow() == null) { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); - final WorkflowTemplateRepository templateRepo = cdiUtil. - findBean(WorkflowTemplateRepository.class); + final WorkflowRepository templateRepo = cdiUtil. + findBean(WorkflowRepository.class); final WorkflowManager workflowManager = cdiUtil.findBean( WorkflowManager.class); - final WorkflowTemplate template = templateRepo.findById(flowId) + final Workflow template = templateRepo + .findById(flowId) .get(); workflowManager.createWorkflow(template, item); } diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAddForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAddForm.java index 1ba91ecc0..d59fe7a1a 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAddForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAddForm.java @@ -25,8 +25,8 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.cms.CMS; -import org.libreccm.workflow.WorkflowTemplate; import org.libreccm.cdi.utils.CdiUtil; +import org.libreccm.workflow.Workflow; /** * @author Uday Mathur @@ -60,28 +60,8 @@ class WorkflowAddForm extends BaseWorkflowForm { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); final WorkflowAdminPaneController controller = cdiUtil.findBean( WorkflowAdminPaneController.class); -// final WorkflowTemplateRepository workflowTemplateRepository -// = cdiUtil.findBean( -// WorkflowTemplateRepository.class); -// final ContentSectionManager sectionManager = cdiUtil.findBean( -// ContentSectionManager.class); -// final ConfigurationManager confManager = cdiUtil.findBean( -// ConfigurationManager.class); -// final KernelConfig kernelConfig = confManager.findConfiguration( -// KernelConfig.class); -// final Locale defaultLocale = kernelConfig.getDefaultLocale(); -// -// final WorkflowTemplate workflow = new WorkflowTemplate(); -// workflow.getName().addValue(defaultLocale, label); -// workflow.getDescription().addValue(defaultLocale, description); -// -// workflowTemplateRepository.save(workflow); -// -// final ContentSection section = CMS.getContext().getContentSection(); -// sectionManager -// .addWorkflowTemplateToContentSection(workflow, section); - final WorkflowTemplate workflow = controller.createWorkflow( + final Workflow workflow = controller.createWorkflow( CMS.getContext().getContentSection(), label, description); diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java index fb0663d18..66bf9b690 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java @@ -29,7 +29,6 @@ import com.arsdigita.cms.ui.VisibilityComponent; import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.workflow.Workflow; import org.libreccm.workflow.WorkflowRepository; -import org.libreccm.workflow.WorkflowTemplateRepository; import org.librecms.contentsection.privileges.AdminPrivileges; @@ -92,8 +91,8 @@ public final class WorkflowAdminPane extends BaseAdminPane { .toString(); final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); - final WorkflowTemplateRepository templateRepo = cdiUtil.findBean( - WorkflowTemplateRepository.class); + final WorkflowRepository templateRepo = cdiUtil.findBean( + WorkflowRepository.class); return templateRepo.findById(Long.parseLong(id)); } diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPaneController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPaneController.java index 4aca1a35c..6f1c0eeaa 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPaneController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPaneController.java @@ -35,8 +35,6 @@ import org.libreccm.workflow.TaskManager; import org.libreccm.workflow.TaskRepository; import org.libreccm.workflow.Workflow; import org.libreccm.workflow.WorkflowRepository; -import org.libreccm.workflow.WorkflowTemplate; -import org.libreccm.workflow.WorkflowTemplateRepository; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionManager; import org.librecms.contentsection.ContentSectionRepository; @@ -54,7 +52,6 @@ import java.util.stream.Collectors; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; -import javax.management.relation.RoleInfo; import javax.transaction.Transactional; /** @@ -79,9 +76,6 @@ public class WorkflowAdminPaneController { @Inject private WorkflowRepository workflowRepo; - @Inject - private WorkflowTemplateRepository workflowTemplateRepo; - @Inject private TaskRepository taskRepo; @@ -95,7 +89,7 @@ public class WorkflowAdminPaneController { private RoleRepository roleRepo; @Transactional(Transactional.TxType.REQUIRED) - public List retrieveWorkflows(final ContentSection section) { + public List retrieveWorkflows(final ContentSection section) { final ContentSection contentSection = sectionRepo .findById(section.getObjectId()) @@ -108,9 +102,9 @@ public class WorkflowAdminPaneController { } @Transactional(Transactional.TxType.REQUIRED) - public WorkflowTemplate createWorkflow(final ContentSection section, - final String name, - final String desc) { + public Workflow createWorkflow(final ContentSection section, + final String name, + final String desc) { final KernelConfig kernelConfig = confManager.findConfiguration( KernelConfig.class); @@ -123,11 +117,12 @@ public class WorkflowAdminPaneController { + "Where did that ID come from?", section.getObjectId()))); - final WorkflowTemplate workflowTemplate = new WorkflowTemplate(); + final Workflow workflowTemplate = new Workflow(); + workflowTemplate.setAbstractWorkflow(true); workflowTemplate.getName().addValue(defaultLocale, name); workflowTemplate.getDescription().addValue(defaultLocale, desc); - workflowTemplateRepo.save(workflowTemplate); + workflowRepo.save(workflowTemplate); sectionManager.addWorkflowTemplateToContentSection(workflowTemplate, contentSection); @@ -355,38 +350,38 @@ public class WorkflowAdminPaneController { .retractTask(theTask, assignment.getRole())); if (roleIds != null) { - final List roles = Arrays - .stream(roleIds) - .map(roleId -> Long.parseLong(roleId)) - .map(roleId -> roleRepo.findById(roleId).orElseThrow( - () -> new IllegalArgumentException(String.format( - "No role with ID %d in the database. " - + "Where did that ID come from?", roleId)))) - .collect(Collectors.toList()); - + final List roles = Arrays + .stream(roleIds) + .map(roleId -> Long.parseLong(roleId)) + .map(roleId -> roleRepo.findById(roleId).orElseThrow( + () -> new IllegalArgumentException(String.format( + "No role with ID %d in the database. " + + "Where did that ID come from?", roleId)))) + .collect(Collectors.toList()); + roles.forEach(role -> assignableTaskManager .assignTask(theTask, role)); - } - + } + } - + @Transactional(Transactional.TxType.REQUIRED) - public void removeAssignment(final Task task, final String roleId ) { - + public void removeAssignment(final Task task, final String roleId) { + final Role role = roleRepo - .findById(Long.parseLong(roleId)) - .orElseThrow(() -> new IllegalArgumentException(String.format( + .findById(Long.parseLong(roleId)) + .orElseThrow(() -> new IllegalArgumentException(String.format( "No Role with ID %s in the database. Where did that ID come from?", roleId))); - - final CmsTask theTask = (CmsTask) taskRepo + + final CmsTask theTask = (CmsTask) taskRepo .findById(task.getTaskId()) .orElseThrow(() -> new IllegalArgumentException(String.format( "No Task with ID %d in the database. Where did that ID come from?", task.getTaskId()))); - - assignableTaskManager.retractTask(theTask, role); - + + assignableTaskManager.retractTask(theTask, role); + } } diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowListModelBuilder.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowListModelBuilder.java index fa717c573..db26b8ca1 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowListModelBuilder.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowListModelBuilder.java @@ -26,8 +26,7 @@ import com.arsdigita.cms.CMS; import com.arsdigita.kernel.KernelConfig; import org.libreccm.cdi.utils.CdiUtil; -import org.librecms.contentsection.ContentSection; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import java.util.Iterator; import java.util.Locale; @@ -49,8 +48,8 @@ class WorkflowListModelBuilder extends AbstractListModelBuilder { private class Model implements ListModel { - private final Iterator templates; - private WorkflowTemplate currentTemplate; + private final Iterator templates; + private Workflow currentTemplate; public Model() { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListener.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListener.java index 6b3bd9a86..36cfd4c3e 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListener.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListener.java @@ -29,8 +29,8 @@ import com.arsdigita.kernel.KernelConfig; import java.util.List; import org.libreccm.cdi.utils.CdiUtil; +import org.libreccm.workflow.Workflow; import org.librecms.contentsection.ContentSection; -import org.libreccm.workflow.WorkflowTemplate; /** * Builds a list of workflow templates registered to the current content @@ -41,7 +41,7 @@ import org.libreccm.workflow.WorkflowTemplate; */ public class WorkflowsOptionPrintListener implements PrintListener { - protected List getCollection(final PageState state) { + protected List getCollection(final PageState state) { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); final WorkflowsOptionPrintListenerController controller = cdiUtil @@ -62,9 +62,9 @@ public class WorkflowsOptionPrintListener implements PrintListener { final OptionGroup target = (OptionGroup) event.getTarget(); target.clearOptions(); - final List templates = getCollection(state); + final List templates = getCollection(state); - for (final WorkflowTemplate template : templates) { + for (final Workflow template : templates) { target.addOption(new Option( Long.toString(template.getWorkflowId()), template.getName().getValue(KernelConfig diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListenerController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListenerController.java index ef1541a5c..b95dccb86 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListenerController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowsOptionPrintListenerController.java @@ -19,7 +19,7 @@ package com.arsdigita.cms.ui.workflow; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionRepository; @@ -41,7 +41,7 @@ class WorkflowsOptionPrintListenerController { private ContentSectionRepository sectionRepo; @Transactional(Transactional.TxType.REQUIRED) - protected List getWorkflowTemplates( + protected List getWorkflowTemplates( final ContentSection section) { Objects.requireNonNull(section); diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java index af0dd7f79..75ffdd71b 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Collections; import org.libreccm.categorization.Category; -import org.libreccm.workflow.WorkflowTemplate; import org.librecms.lifecycle.LifecycleDefinition; import java.util.List; @@ -38,7 +37,6 @@ import javax.inject.Inject; import org.libreccm.categorization.Categorization; import org.libreccm.categorization.CategoryManager; import org.libreccm.categorization.ObjectNotAssignedToCategoryException; -import org.libreccm.configuration.ConfigurationManager; import org.libreccm.core.UnexpectedErrorException; import org.libreccm.l10n.LocalizedString; import org.libreccm.security.AuthorizationRequired; @@ -212,7 +210,7 @@ public class ContentItemManager { * {@link ContentSection#rootDocumentsFolder} of the provided content * section. Otherwise an {@link IllegalArgumentException} is thrown. * - * Likewise the provided {@link WorkflowTemplate} must be defined in the + * Likewise the provided abstract {@link Workflow} must be defined in the * provided content section. Otherwise an {@link IllegalArgumentException} * is thrown. * @@ -235,7 +233,7 @@ public class ContentItemManager { final ContentSection section, @RequiresPrivilege(ItemPrivileges.CREATE_NEW) final Folder folder, - final WorkflowTemplate workflowTemplate, + final Workflow workflowTemplate, final Class type, final Locale locale) { @@ -258,7 +256,7 @@ public class ContentItemManager { * {@link ContentSection#rootDocumentsFolder} of the provided content * section. Otherwise an {@link IllegalArgumentException} is thrown. * - * Likewise the provided {@link WorkflowTemplate} must be defined in the + * Likewise the provided abstract {@link Workflow} must be defined in the * provided content section. Otherwise an {@link IllegalArgumentException} * is thrown. * @@ -283,7 +281,7 @@ public class ContentItemManager { final ContentSection section, @RequiresPrivilege(ItemPrivileges.CREATE_NEW) final Folder folder, - final WorkflowTemplate workflowTemplate, + final Workflow workflowTemplate, final Class type, final ContentItemInitializer initializer, final Locale locale) { @@ -490,13 +488,10 @@ public class ContentItemManager { throw new RuntimeException(ex); } -// final String uuid = UUID.randomUUID().toString(); -// copy.setUuid(uuid); -// copy.setItemUuid(uuid); copy.setContentType(contentType.get()); if (draftItem.getWorkflow() != null) { - final WorkflowTemplate template = draftItem.getWorkflow() + final Workflow template = draftItem.getWorkflow() .getTemplate(); final Workflow copyWorkflow = workflowManager.createWorkflow( template, item); diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentSection.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentSection.java index 710e1d3e3..37e8c4fbe 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentSection.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentSection.java @@ -21,6 +21,7 @@ package org.librecms.contentsection; import org.libreccm.security.RecursivePermissions; import org.libreccm.security.Role; import org.libreccm.web.CcmApplication; +import org.libreccm.workflow.Workflow; import java.io.Serializable; import java.util.Collections; @@ -42,7 +43,6 @@ import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; -import org.libreccm.workflow.WorkflowTemplate; import org.librecms.contentsection.privileges.AssetPrivileges; import org.librecms.contentsection.privileges.ItemPrivileges; import org.librecms.contentsection.privileges.TypePrivileges; @@ -58,53 +58,53 @@ import static org.librecms.CmsConstants.*; @Table(name = "CONTENT_SECTIONS", schema = DB_SCHEMA) @NamedQueries({ @NamedQuery( - name = "ContentSection.findById", - query = "SELECT S FROM ContentSection s WHERE s.objectId = :objectId") + name = "ContentSection.findById", + query = "SELECT S FROM ContentSection s WHERE s.objectId = :objectId") , @NamedQuery( - name = "ContentSection.findByLabel", - query = "SELECT s FROM ContentSection s WHERE s.label = :label") + name = "ContentSection.findByLabel", + query = "SELECT s FROM ContentSection s WHERE s.label = :label") , @NamedQuery( - name = "ContentSection.findUsableContentTypes", - query = "SELECT t FROM ContentType t " - + "WHERE t.contentSection = :section " - + "AND " - + "(t IN (SELECT p.object FROM Permission p " - + "WHERE p.grantedPrivilege = '" - + TypePrivileges.USE_TYPE + "' " - + "AND p.grantee in :roles) " - + "OR true = :isSysAdmin)") + name = "ContentSection.findUsableContentTypes", + query = "SELECT t FROM ContentType t " + + "WHERE t.contentSection = :section " + + "AND " + + "(t IN (SELECT p.object FROM Permission p " + + "WHERE p.grantedPrivilege = '" + + TypePrivileges.USE_TYPE + "' " + + "AND p.grantee in :roles) " + + "OR true = :isSysAdmin)") , @NamedQuery( - name = "ContentSection.countUsableContentTypes", - query = "SELECT COUNT(t) FROM ContentType t " - + "WHERE t.contentSection = :section " - + "AND " - + "(t IN (SELECT p.object FROM Permission p " - + "WHERE p.grantedPrivilege = '" - + TypePrivileges.USE_TYPE + "' " - + "AND p.grantee IN :roles) " - + "OR true = :isSysAdmin)") + name = "ContentSection.countUsableContentTypes", + query = "SELECT COUNT(t) FROM ContentType t " + + "WHERE t.contentSection = :section " + + "AND " + + "(t IN (SELECT p.object FROM Permission p " + + "WHERE p.grantedPrivilege = '" + + TypePrivileges.USE_TYPE + "' " + + "AND p.grantee IN :roles) " + + "OR true = :isSysAdmin)") , @NamedQuery( - name = "ContentSection.hasUsableContentTypes", - query = "SELECT (CASE WHEN COUNT(t) > 0 THEN true ELSE false END)" - + "FROM ContentType t " - + "WHERE t.contentSection = :section " - + "AND " - + "(t IN (SELECT p.object FROM Permission p " - + "WHERE p.grantedPrivilege = '" - + TypePrivileges.USE_TYPE + "' " - + "AND p.grantee IN :roles) " - + "OR true = :isSysAdmin)") + name = "ContentSection.hasUsableContentTypes", + query = "SELECT (CASE WHEN COUNT(t) > 0 THEN true ELSE false END)" + + "FROM ContentType t " + + "WHERE t.contentSection = :section " + + "AND " + + "(t IN (SELECT p.object FROM Permission p " + + "WHERE p.grantedPrivilege = '" + + TypePrivileges.USE_TYPE + "' " + + "AND p.grantee IN :roles) " + + "OR true = :isSysAdmin)") , @NamedQuery( - name = "ContentSection.findPermissions", - query = "SELECT p FROM Permission p " - + "WHERE (p.object = :section " - + " OR p.object = :rootDocumentsFolder" - + " OR p.object = :rootAssetsFolder) " + name = "ContentSection.findPermissions", + query = "SELECT p FROM Permission p " + + "WHERE (p.object = :section " + + " OR p.object = :rootDocumentsFolder" + + " OR p.object = :rootAssetsFolder) " + "AND p.grantee = :role") }) //@ApplicationType( @@ -184,29 +184,29 @@ public class ContentSection extends CcmApplication implements Serializable { @OneToMany @JoinTable( - name = "CONTENT_SECTION_LIFECYCLE_DEFINITIONS", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "CONTENT_SECTION_ID") - }, - inverseJoinColumns = { - @JoinColumn(name = "LIFECYCLE_DEFINITION_ID") - } + name = "CONTENT_SECTION_LIFECYCLE_DEFINITIONS", + schema = DB_SCHEMA, + joinColumns = { + @JoinColumn(name = "CONTENT_SECTION_ID") + }, + inverseJoinColumns = { + @JoinColumn(name = "LIFECYCLE_DEFINITION_ID") + } ) private List lifecycleDefinitions = new ArrayList<>(); @OneToMany @JoinTable( - name = "CONTENT_SECTION_WORKFLOW_TEMPLATES", - schema = DB_SCHEMA, - joinColumns = { - @JoinColumn(name = "CONTENT_SECTION_ID") - }, - inverseJoinColumns = { - @JoinColumn(name = "WORKFLOW_TEMPLATE_ID") - } + name = "CONTENT_SECTION_WORKFLOW_TEMPLATES", + schema = DB_SCHEMA, + joinColumns = { + @JoinColumn(name = "CONTENT_SECTION_ID") + }, + inverseJoinColumns = { + @JoinColumn(name = "WORKFLOW_TEMPLATE_ID") + } ) - private List workflowTemplates = new ArrayList<>(); + private List workflowTemplates = new ArrayList<>(); public ContentSection() { roles = new ArrayList<>(); @@ -326,7 +326,7 @@ public class ContentSection extends CcmApplication implements Serializable { } protected void setLifecycleDefinitions( - final List lifecycleDefinitions) { + final List lifecycleDefinitions) { this.lifecycleDefinitions = lifecycleDefinitions; } @@ -335,24 +335,28 @@ public class ContentSection extends CcmApplication implements Serializable { } protected void removeLifecycleDefinition( - final LifecycleDefinition definition) { + final LifecycleDefinition definition) { lifecycleDefinitions.remove(definition); } - public List getWorkflowTemplates() { + public List getWorkflowTemplates() { return Collections.unmodifiableList(workflowTemplates); } protected void setWorkflowTemplates( - final List workflowTemplates) { + final List workflowTemplates) { this.workflowTemplates = workflowTemplates; } - protected void addWorkflowTemplate(final WorkflowTemplate template) { + protected void addWorkflowTemplate(final Workflow template) { + if (!template.isAbstractWorkflow()) { + throw new IllegalArgumentException( + "The provided workflow is not an abstract workflow."); + } workflowTemplates.add(template); } - protected void removeWorkflowTemplate(final WorkflowTemplate template) { + protected void removeWorkflowTemplate(final Workflow template) { workflowTemplates.remove(template); } @@ -422,23 +426,23 @@ public class ContentSection extends CcmApplication implements Serializable { @Override public String toString(final String data) { return super.toString(String.format( - ", label = \"%s\", " - + "rootDocumentsFolder = \"%s\", " - + "rootAssetsFolder = \"%s\", " - + "pageResolverClass = \"%s\", " - + "itemResolverClass = \"%s\", " - + "templateResolverClass = \"%s\", " - + "xmlGeneratorClass = \"%s\", " - + "defaultLocale = \"%s\"%s", - label, - Objects.toString(rootDocumentsFolder), - Objects.toString(rootAssetsFolder), - pageResolverClass, - itemResolverClass, - templateResolverClass, - xmlGeneratorClass, - Objects.toString(defaultLocale), - data)); + ", label = \"%s\", " + + "rootDocumentsFolder = \"%s\", " + + "rootAssetsFolder = \"%s\", " + + "pageResolverClass = \"%s\", " + + "itemResolverClass = \"%s\", " + + "templateResolverClass = \"%s\", " + + "xmlGeneratorClass = \"%s\", " + + "defaultLocale = \"%s\"%s", + label, + Objects.toString(rootDocumentsFolder), + Objects.toString(rootAssetsFolder), + pageResolverClass, + itemResolverClass, + templateResolverClass, + xmlGeneratorClass, + Objects.toString(defaultLocale), + data)); } } diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionManager.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionManager.java index 3254d45b9..3a241d7ab 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionManager.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentSectionManager.java @@ -30,7 +30,7 @@ import org.libreccm.security.PermissionManager; import org.libreccm.security.RequiresPrivilege; import org.libreccm.security.Role; import org.libreccm.security.RoleRepository; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import java.util.List; import java.util.Locale; @@ -54,6 +54,8 @@ import java.util.Optional; import org.librecms.contentsection.privileges.TypePrivileges; import org.librecms.dispatcher.ItemResolver; +import java.util.Objects; + import javax.enterprise.inject.Instance; import static org.librecms.contentsection.ContentSection.*; @@ -86,7 +88,7 @@ public class ContentSectionManager { @Inject private ConfigurationManager confManager; - + @Inject private Instance itemResolvers; @@ -104,11 +106,11 @@ public class ContentSectionManager { public ContentSection createContentSection(final String name) { if (name == null || name.isEmpty()) { throw new IllegalArgumentException( - "The name of a ContentSection can't be blank."); + "The name of a ContentSection can't be blank."); } final KernelConfig kernelConfig = confManager.findConfiguration( - KernelConfig.class); + KernelConfig.class); final Locale defautLocale = kernelConfig.getDefaultLocale(); final ContentSection section = new ContentSection(); @@ -257,21 +259,21 @@ public class ContentSectionManager { * {@link CmsConstants#AdminPrivileges.ADMINISTER_ROLES} for the provided * content section. * - * @param section The {@link ContentSection} to which the role is added. - * @param roleName The name of the new role. + * @param section The {@link ContentSection} to which the role is added. + * @param roleName The name of the new role. * @param privileges The privileges of the new role. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void addRoleToContentSection( - @RequiresPrivilege(AdminPrivileges.ADMINISTER_ROLES) - final ContentSection section, - final String roleName, - final String... privileges) { + @RequiresPrivilege(AdminPrivileges.ADMINISTER_ROLES) + final ContentSection section, + final String roleName, + final String... privileges) { if (section == null) { throw new IllegalArgumentException("Can't add a role to " - + "section null."); + + "section null."); } if (roleName == null || roleName.trim().isEmpty()) { @@ -296,24 +298,24 @@ public class ContentSectionManager { * requires {@link CmsConstants#AdminPrivileges.ADMINISTER_ROLES} for the * provided content section. * - * @param role The role to add. + * @param role The role to add. * @param section The section the role is associated with. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void addRoleToContentSection( - final Role role, - @RequiresPrivilege(AdminPrivileges.ADMINISTER_ROLES) - final ContentSection section) { + final Role role, + @RequiresPrivilege(AdminPrivileges.ADMINISTER_ROLES) + final ContentSection section) { if (section == null) { throw new IllegalArgumentException("Can't add a role to " - + "section null."); + + "section null."); } if (role == null) { throw new IllegalArgumentException("Can't add role null to a " - + "content section."); + + "content section."); } section.addRole(role); @@ -329,18 +331,18 @@ public class ContentSectionManager { * content section. * * @param contentSection The section from which the role is removed. - * @param role The role to remove from the content section. + * @param role The role to remove from the content section. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void removeRoleFromContentSection( - @RequiresPrivilege(AdminPrivileges.ADMINISTER_ROLES) - final ContentSection contentSection, - final Role role) { + @RequiresPrivilege(AdminPrivileges.ADMINISTER_ROLES) + final ContentSection contentSection, + final Role role) { if (contentSection == null) { throw new IllegalArgumentException( - "Can't remove role from ContentSection null"); + "Can't remove role from ContentSection null"); } if (role == null) { @@ -349,10 +351,10 @@ public class ContentSectionManager { contentSection.removeRole(role); sectionRepo.save(contentSection); - + final TypedQuery query = entityManager - .createNamedQuery("ContentSection.findPermissions", - Permission.class); + .createNamedQuery("ContentSection.findPermissions", + Permission.class); query.setParameter("section", contentSection); query.setParameter("rootDocumentsFolder", contentSection.getRootDocumentsFolder()); @@ -370,14 +372,14 @@ public class ContentSectionManager { * provided content section. * * @param definition The lifecycle definition to add. - * @param section The section to which the definition is added. + * @param section The section to which the definition is added. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void addLifecycleDefinitionToContentSection( - final LifecycleDefinition definition, - @RequiresPrivilege(AdminPrivileges.ADMINISTER_LIFECYLES) - final ContentSection section) { + final LifecycleDefinition definition, + @RequiresPrivilege(AdminPrivileges.ADMINISTER_LIFECYLES) + final ContentSection section) { section.addLifecycleDefinition(definition); sectionRepo.save(section); @@ -389,14 +391,14 @@ public class ContentSectionManager { * the provided content section. * * @param definition The definition to remove. - * @param section The section from which the definition is removed. + * @param section The section from which the definition is removed. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void removeLifecycleDefinitionFromContentSection( - final LifecycleDefinition definition, - @RequiresPrivilege(AdminPrivileges.ADMINISTER_LIFECYLES) - final ContentSection section) { + final LifecycleDefinition definition, + @RequiresPrivilege(AdminPrivileges.ADMINISTER_LIFECYLES) + final ContentSection section) { section.removeLifecycleDefinition(definition); sectionRepo.save(section); @@ -408,14 +410,22 @@ public class ContentSectionManager { * content section. * * @param template The template to add. - * @param section The content section to which the template is added. + * @param section The content section to which the template is added. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void addWorkflowTemplateToContentSection( - final WorkflowTemplate template, - @RequiresPrivilege(AdminPrivileges.ADMINISTER_WORKFLOW) - final ContentSection section) { + final Workflow template, + @RequiresPrivilege(AdminPrivileges.ADMINISTER_WORKFLOW) + final ContentSection section) { + + Objects.requireNonNull(template); + Objects.requireNonNull(section); + + if (!template.isAbstractWorkflow()) { + throw new IllegalArgumentException( + "The provided workflow is not abstract workflow."); + } section.addWorkflowTemplate(template); sectionRepo.save(section); @@ -427,14 +437,14 @@ public class ContentSectionManager { * provided content section. * * @param template The template to remove. - * @param section The section from which the template is removed. + * @param section The section from which the template is removed. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void removeWorkflowTemplateFromContentSection( - final WorkflowTemplate template, - @RequiresPrivilege(AdminPrivileges.ADMINISTER_WORKFLOW) - final ContentSection section) { + final Workflow template, + @RequiresPrivilege(AdminPrivileges.ADMINISTER_WORKFLOW) + final ContentSection section) { section.removeWorkflowTemplate(template); sectionRepo.save(section); @@ -444,7 +454,7 @@ public class ContentSectionManager { * Retrieves the {@link ItemResolver} for the provided content section. * * @param section The section for which the {@link ItemResolver} is - * retrieved. + * retrieved. * * @return The {@link ItemResolver} for the provided content section. */ @@ -452,15 +462,15 @@ public class ContentSectionManager { try { @SuppressWarnings("unchecked") final Class itemResolverClazz - = (Class) Class. - forName(section.getItemResolverClass()); - + = (Class) Class. + forName(section.getItemResolverClass()); + final Instance instance = itemResolvers.select( itemResolverClazz); - + if (instance.isUnsatisfied()) { throw new UnexpectedErrorException(String.format( - "No ItemResolver \"{}\" found.", + "No ItemResolver \"{}\" found.", itemResolverClazz.getName())); } else { return instance.get(); @@ -476,72 +486,80 @@ public class ContentSectionManager { * {@link CmsConstants#AdminPrivileges.ADMINISTER_CONTENT_TYPES} for the * provided content section. * - * @param type The type to add (a subclass of {@link ContentItem}. - * @param section The section to which the type is added. + * @param type The type to add (a subclass of + * {@link ContentItem}. + * @param section The section to which the type is added. * @param defaultLifecycle The default lifecycle for items of the provided - * type in the provided content section. The lifecycle must be part of the - * provided section. Otherwise an {@link IllegalArgumentException} is - * thrown. - * @param defaultWorkflow The default workflow for items of the provided - * type in the provided content section. The workflow must be part of the - * provided section. Otherwise an {@link IllegalArgumentException} is - * thrown. + * type in the provided content section. The + * lifecycle must be part of the provided section. + * Otherwise an {@link IllegalArgumentException} is + * thrown. + * @param defaultWorkflow The default workflow for items of the provided + * type in the provided content section. The + * workflow must be part of the provided section. + * Otherwise an {@link IllegalArgumentException} is + * thrown. * * @return The new {@link ContentType} instance. */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public ContentType addContentTypeToSection( - final Class type, - @RequiresPrivilege(AdminPrivileges.ADMINISTER_CONTENT_TYPES) - final ContentSection section, - final LifecycleDefinition defaultLifecycle, - final WorkflowTemplate defaultWorkflow) { + final Class type, + @RequiresPrivilege(AdminPrivileges.ADMINISTER_CONTENT_TYPES) + final ContentSection section, + final LifecycleDefinition defaultLifecycle, + final Workflow defaultWorkflow) { if (type == null) { throw new IllegalArgumentException("Can't add null as content type " - + "to a content section."); + + "to a content section."); } if (section == null) { throw new IllegalArgumentException("Can't add a content type" - + "to section null."); + + "to section null."); } if (defaultLifecycle == null) { throw new IllegalArgumentException("Can't create a content type " - + "without a default lifecycle."); + + "without a default lifecycle."); } if (defaultWorkflow == null) { throw new IllegalArgumentException("Can't create a content type " - + "without a default workflow."); + + "without a default workflow."); + } + + if (!defaultWorkflow.isAbstractWorkflow()) { + throw new IllegalArgumentException( + "The provided workflow is not an abstract workflow."); } if (!section.getLifecycleDefinitions().contains(defaultLifecycle)) { final KernelConfig kernelConfig = confManager.findConfiguration( - KernelConfig.class); + KernelConfig.class); final Locale defaultLocale = kernelConfig.getDefaultLocale(); throw new IllegalArgumentException(String.format( - "The provided default lifecycle %d\"%s\" is not part of the" - + "provided content section %d\"%s\".", - defaultLifecycle.getDefinitionId(), - defaultLifecycle.getLabel().getValue(defaultLocale), - section.getObjectId(), - section.getDisplayName())); + "The provided default lifecycle %d\"%s\" is not part of the" + + "provided content section %d\"%s\".", + defaultLifecycle.getDefinitionId(), + defaultLifecycle.getLabel().getValue(defaultLocale), + section.getObjectId(), + section.getDisplayName())); } if (!section.getWorkflowTemplates().contains(defaultWorkflow)) { final KernelConfig kernelConfig = confManager.findConfiguration( - KernelConfig.class); + KernelConfig.class); final Locale defaultLocale = kernelConfig.getDefaultLocale(); throw new IllegalArgumentException(String.format( - "The provided default workflow %d\"%s\" is not part of the" - + "provided content section %d\"%s\".", - defaultWorkflow.getWorkflowId(), - defaultWorkflow.getName().getValue(defaultLocale), - section.getObjectId(), - section.getDisplayName())); + "The provided default workflow %d\"%s\" is not part of the" + + "provided content section %d\"%s\".", + defaultWorkflow.getWorkflowId(), + defaultWorkflow.getName().getValue(defaultLocale), + section.getObjectId(), + section.getDisplayName())); } if (hasContentType(type, section)) { @@ -560,10 +578,10 @@ public class ContentSectionManager { sectionRepo.save(section); typeRepo.save(contentType); - + section.getRoles().stream() - .forEach(role -> permissionManager.grantPrivilege( - TypePrivileges.USE_TYPE, role, contentType)); + .forEach(role -> permissionManager.grantPrivilege( + TypePrivileges.USE_TYPE, role, contentType)); return contentType; } @@ -572,11 +590,11 @@ public class ContentSectionManager { * Checks if a content section has a {@link ContentType} for a specific * subclass {@link ContentItem}. * - * @param type The type to check for. + * @param type The type to check for. * @param section The section to check for the {@link ContentType}. * * @return {@code true} if the section has a {@link ContentType} for - * {@code type}, {@code false} if not. + * {@code type}, {@code false} if not. */ public boolean hasContentType(final Class type, final ContentSection section) { @@ -590,7 +608,7 @@ public class ContentSectionManager { } final Optional result = typeRepo - .findByContentSectionAndClass(section, type); + .findByContentSectionAndClass(section, type); return result.isPresent(); } @@ -601,20 +619,21 @@ public class ContentSectionManager { * {@link CmsConstants#AdminPrivileges.ADMINISTER_CONTENT_TYPES} for the * provided content section. * - * @param type The type to remove from the section. + * @param type The type to remove from the section. * @param section The section from which the type is removed. * * @throws IllegalArgumentException if the provided {@link ContentType} is - * in use or the parameters or otherwise illegal. + * in use or the parameters or otherwise + * illegal. * @see * ContentTypeRepository#delete(org.librecms.contentsection.ContentType) */ @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public void removeContentTypeFromSection( - final Class type, - @RequiresPrivilege(AdminPrivileges.ADMINISTER_CONTENT_TYPES) - final ContentSection section) { + final Class type, + @RequiresPrivilege(AdminPrivileges.ADMINISTER_CONTENT_TYPES) + final ContentSection section) { if (type == null) { throw new IllegalArgumentException("Can't remove content type null."); @@ -622,11 +641,11 @@ public class ContentSectionManager { if (section == null) { throw new IllegalArgumentException("Can't remove a content type " - + "from section null."); + + "from section null."); } final Optional contentType = typeRepo - .findByContentSectionAndClass(section, type); + .findByContentSectionAndClass(section, type); if (!contentType.isPresent()) { return; @@ -634,12 +653,12 @@ public class ContentSectionManager { if (typeRepo.isContentTypeInUse(contentType.get())) { throw new IllegalArgumentException(String.format( - "ContentType %d:\"%s\" is used by content section %d:\"%s\" and " - + "can't be deleted.", - contentType.get().getObjectId(), - contentType.get().getDisplayName(), - section.getObjectId(), - section.getDisplayName())); + "ContentType %d:\"%s\" is used by content section %d:\"%s\" and " + + "can't be deleted.", + contentType.get().getObjectId(), + contentType.get().getDisplayName(), + section.getObjectId(), + section.getDisplayName())); } typeRepo.delete(contentType.get()); diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentType.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentType.java index a73e2138e..91b75be09 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentType.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentType.java @@ -25,7 +25,7 @@ import static org.librecms.CmsConstants.*; import org.libreccm.core.CcmObject; import org.libreccm.l10n.LocalizedString; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.lifecycle.LifecycleDefinition; import java.io.Serializable; @@ -117,14 +117,14 @@ public class ContentType extends CcmObject implements Serializable { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "DEFAULT_WORKFLOW") - private WorkflowTemplate defaultWorkflow; + private Workflow defaultWorkflow; public ContentType() { super(); label = new LocalizedString(); description = new LocalizedString(); } - + public String getContentItemClass() { return contentItemClass; } @@ -192,11 +192,15 @@ public class ContentType extends CcmObject implements Serializable { this.defaultLifecycle = defaultLifecycle; } - public WorkflowTemplate getDefaultWorkflow() { + public Workflow getDefaultWorkflow() { return defaultWorkflow; } - protected void setDefaultWorkflow(final WorkflowTemplate defaultWorkflow) { + protected void setDefaultWorkflow(final Workflow defaultWorkflow) { + if (!defaultWorkflow.isAbstractWorkflow()) { + throw new IllegalArgumentException( + "The provided workflow is not an abstract workflow."); + } this.defaultWorkflow = defaultWorkflow; } diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java index 5b5d99ac6..d81c36328 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java @@ -24,10 +24,12 @@ import org.libreccm.security.AuthorizationRequired; import org.libreccm.security.PermissionManager; import org.libreccm.security.RequiresPrivilege; import org.libreccm.security.Role; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.contentsection.privileges.AdminPrivileges; import org.librecms.lifecycle.LifecycleDefinition; +import java.util.Objects; + import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import javax.transaction.Transactional; @@ -98,7 +100,7 @@ public class ContentTypeManager { * Sets the default workflow to use for new items of a content type. * * @param type - * @param template The {@link WorkflowTemplate} for the workflow to use for + * @param template The abstract {@link Workflow} for the workflow to use for * new items of the provided {@code type}. */ @Transactional(Transactional.TxType.REQUIRED) @@ -106,7 +108,15 @@ public class ContentTypeManager { public void setDefaultWorkflow( @RequiresPrivilege(AdminPrivileges.ADMINISTER_CONTENT_TYPES) final ContentType type, - final WorkflowTemplate template) { + final Workflow template) { + + Objects.requireNonNull(type); + Objects.requireNonNull(template); + + if (!template.isAbstractWorkflow()) { + throw new IllegalArgumentException( + "The provided workflow is not an abstract workflow."); + } type.setDefaultWorkflow(template); diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/privileges/AdminPrivileges.java b/ccm-cms/src/main/java/org/librecms/contentsection/privileges/AdminPrivileges.java index bd46b944b..b4d5891e1 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/privileges/AdminPrivileges.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/privileges/AdminPrivileges.java @@ -22,7 +22,7 @@ import org.libreccm.categorization.Category; import org.libreccm.categorization.Domain; import org.libreccm.security.Role; import org.libreccm.web.CcmApplication; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentType; import org.librecms.lifecycle.LifecycleDefinition; @@ -66,7 +66,7 @@ public final class AdminPrivileges { */ public static final String ADMINISTER_ROLES = "administer_roles"; /** - * Allows manipulation of the {@link WorkflowTemplate}s assigned to a + * Allows manipulation of the (abstract) {@link Workflow}s assigned to a * {@link ContentSection}. * * @see ContentSection#workflowTemplates diff --git a/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_15__abstract_workflow.sql b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_15__abstract_workflow.sql new file mode 100644 index 000000000..5536b3da8 --- /dev/null +++ b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_15__abstract_workflow.sql @@ -0,0 +1,17 @@ +drop constraint FKrx08cdjm9tutrp5lvfhgslw48; + +alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES + add constraint FK1t85m4jehnhd6tyx5dtpavr15 + foreign key (WORKFLOW_TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; + +alter table CCM_CMS.CONTENT_TYPES +drop constraint if exists FKhnu9oikw8rpf22lt5fmk41t7k; + +alter table CCM_CMS.CONTENT_TYPES + add constraint FKpgeccqsr50xwb268ypmfx0r66 + foreign key (DEFAULT_WORKFLOW) + references CCM_CORE.WORKFLOWS; + +alter table if exists FKeixdxau4jebw682gd49tdbsjy +drop constraint FKeixdxau4jebw682gd49tdbsjy; diff --git a/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_15__abstract_workflow.sql b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_15__abstract_workflow.sql new file mode 100644 index 000000000..5536b3da8 --- /dev/null +++ b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_15__abstract_workflow.sql @@ -0,0 +1,17 @@ +drop constraint FKrx08cdjm9tutrp5lvfhgslw48; + +alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES + add constraint FK1t85m4jehnhd6tyx5dtpavr15 + foreign key (WORKFLOW_TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; + +alter table CCM_CMS.CONTENT_TYPES +drop constraint if exists FKhnu9oikw8rpf22lt5fmk41t7k; + +alter table CCM_CMS.CONTENT_TYPES + add constraint FKpgeccqsr50xwb268ypmfx0r66 + foreign key (DEFAULT_WORKFLOW) + references CCM_CORE.WORKFLOWS; + +alter table if exists FKeixdxau4jebw682gd49tdbsjy +drop constraint FKeixdxau4jebw682gd49tdbsjy; diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/AssetManagerTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/AssetManagerTest.java index 4962c21aa..f3bf87b66 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/AssetManagerTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/AssetManagerTest.java @@ -23,6 +23,7 @@ import java.util.Optional; import static org.libreccm.testutils.DependenciesHelpers.*; +import org.apache.shiro.subject.ExecutionException; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.ShouldThrowException; import org.jboss.arquillian.junit.Arquillian; @@ -51,10 +52,13 @@ import java.util.Locale; import javax.activation.MimeType; import javax.activation.MimeTypeParseException; + import org.jboss.arquillian.persistence.CleanupUsingScript; import org.librecms.assets.FileAsset; +import java.util.concurrent.Callable; + import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @@ -212,19 +216,24 @@ public class AssetManagerTest { "timestamp", "uuid"}) public void shareAsset() throws MimeTypeParseException { - final Folder folder = folderRepo.findById(-420L).get(); - assertThat(folder, is(not(nullValue()))); - final FileAsset file = new FileAsset(); - file.setDisplayName("datasheet.pdf"); - file.setFileName("datasheet.pdf"); - file.setMimeType(new MimeType("application/pdf")); - file.getTitle().addValue(Locale.ENGLISH, "datasheet.pdf"); - assetRepo.save(file); + shiro.getSystemUser().execute(() -> { + final Folder folder = folderRepo.findById(-420L).get(); + assertThat(folder, is(not(nullValue()))); - assetManager.shareAsset(file, folder); + final FileAsset file = new FileAsset(); + file.setDisplayName("datasheet.pdf"); + file.setFileName("datasheet.pdf"); + file.setMimeType(new MimeType("application/pdf")); + file.getTitle().addValue(Locale.ENGLISH, "datasheet.pdf"); + assetRepo.save(file); + + assetManager.shareAsset(file, folder); + assertThat(file.getDisplayName(), is(equalTo("datasheet.pdf"))); + + return null; + }); - assertThat(file.getDisplayName(), is(equalTo("datasheet.pdf"))); } /** @@ -241,9 +250,12 @@ public class AssetManagerTest { "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) public void shareAssetNull() { - final Folder folder = folderRepo.findById(-420L).get(); - assetManager.shareAsset(null, folder); + shiro.getSystemUser().execute(() -> { + final Folder folder = folderRepo.findById(-420L).get(); + + assetManager.shareAsset(null, folder); + }); } /** @@ -261,13 +273,22 @@ public class AssetManagerTest { @ShouldMatchDataSet( "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) - public void shareAssetFolderIsNull() throws MimeTypeParseException { - final FileAsset file = new FileAsset(); - file.setDisplayName("datasheet.pdf"); - file.setFileName("datasheet.pdf"); - file.setMimeType(new MimeType("application/pdf")); + public void shareAssetFolderIsNull() throws Throwable { - assetManager.shareAsset(file, null); + try { + shiro.getSystemUser().execute(() -> { + final FileAsset file = new FileAsset(); + file.setDisplayName("datasheet.pdf"); + file.setFileName("datasheet.pdf"); + file.setMimeType(new MimeType("application/pdf")); + + assetManager.shareAsset(file, null); + return null; + }); + } catch (ExecutionException ex) { + //We need the original exception + throw ex.getCause(); + } } /** @@ -284,11 +305,14 @@ public class AssetManagerTest { "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) public void shareAlreadySharedAsset() { - final Folder folder = folderRepo.findById(-420L).get(); - final Asset asset = assetRepo.findById(-700L).get(); + shiro.getSystemUser().execute(() -> { + final Folder folder = folderRepo.findById(-420L).get(); - assetManager.shareAsset(asset, folder); + final Asset asset = assetRepo.findById(-700L).get(); + + assetManager.shareAsset(asset, folder); + }); } /** @@ -304,7 +328,9 @@ public class AssetManagerTest { + "after-clean-orphaned.xml", excludeColumns = {"timestamp", "object_order"}) public void cleanOrphanedAssets() { - assetManager.cleanOrphanedAssets(); + shiro.getSystemUser().execute(() -> { + assetManager.cleanOrphanedAssets(); + }); } /** @@ -324,11 +350,17 @@ public class AssetManagerTest { "object_order", "uuid"}) public void moveAssetToOtherFolder() { - final Asset asset = assetRepo.findById(-900L).get(); - final Folder folder = folderRepo.findById(-410L).get(); + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-900L).get(); - assetManager.move(asset, folder); + shiro.getSystemUser().execute(() -> { + final Folder folder = folderRepo.findById(-410L).get(); + + assetManager.move(asset, folder); + }); + return null; + }); } /** @@ -348,11 +380,14 @@ public class AssetManagerTest { "object_order", "uuid"}) public void moveAssetToFolderInOtherContentSection() { - final Asset asset = assetRepo.findById(-900L).get(); - final Folder folder = folderRepo.findById(-1600L).get(); + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-900L).get(); - assetManager.move(asset, folder); + final Folder folder = folderRepo.findById(-1600L).get(); + + assetManager.move(asset, folder); + }); } /** @@ -371,9 +406,11 @@ public class AssetManagerTest { public void moveAssetNull() { final Asset asset = null; - final Folder folder = folderRepo.findById(-410L).get(); + shiro.getSystemUser().execute(() -> { + final Folder folder = folderRepo.findById(-410L).get(); - assetManager.move(asset, folder); + assetManager.move(asset, folder); + }); } /** @@ -390,11 +427,14 @@ public class AssetManagerTest { "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) public void moveAssetTargetFolderIsNull() { - final Asset asset = assetRepo.findById(-900L).get(); - final Folder targetFolder = null; + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-900L).get(); - assetManager.move(asset, targetFolder); + final Folder targetFolder = null; + + assetManager.move(asset, targetFolder); + }); } /** @@ -411,11 +451,14 @@ public class AssetManagerTest { "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) public void moveAssetTargetFolderIsNotAssetFolder() { - final Asset asset = assetRepo.findById(-900L).get(); - final Folder folder = folderRepo.findById(-200L).get(); + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-900L).get(); - assetManager.move(asset, folder); + final Folder folder = folderRepo.findById(-200L).get(); + + assetManager.move(asset, folder); + }); } /** @@ -438,11 +481,14 @@ public class AssetManagerTest { "categorization_id", "object_order"}) public void copyAssetToOtherFolder() { - final Asset asset = assetRepo.findById(-1100L).get(); - final Folder targetFolder = folderRepo.findById(-400L).get(); + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-1100L).get(); - assetManager.copy(asset, targetFolder); + final Folder targetFolder = folderRepo.findById(-400L).get(); + + assetManager.copy(asset, targetFolder); + }); } /** @@ -496,11 +542,14 @@ public class AssetManagerTest { "categorization_id", "object_order"}) public void copyAssetToOtherContentSection() { - final Asset asset = assetRepo.findById(-1100L).get(); - final Folder targetFolder = folderRepo.findById(-1600L).get(); + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-1100L).get(); - assetManager.copy(asset, targetFolder); + final Folder targetFolder = folderRepo.findById(-1600L).get(); + + assetManager.copy(asset, targetFolder); + }); } /** @@ -517,11 +566,14 @@ public class AssetManagerTest { "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) public void copyAssetNull() { - final Asset asset = null; - final Folder targetFolder = folderRepo.findById(-420L).get(); + shiro.getSystemUser().execute(() -> { + final Asset asset = null; - assetManager.copy(asset, targetFolder); + final Folder targetFolder = folderRepo.findById(-420L).get(); + + assetManager.copy(asset, targetFolder); + }); } /** @@ -538,11 +590,14 @@ public class AssetManagerTest { "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) public void copyAssetTargetFolderIsNull() { - final Asset asset = assetRepo.findById(-1100L).get(); - final Folder targetFolder = null; + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-1100L).get(); - assetManager.copy(asset, targetFolder); + final Folder targetFolder = null; + + assetManager.copy(asset, targetFolder); + }); } /** @@ -559,11 +614,14 @@ public class AssetManagerTest { "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") @ShouldThrowException(IllegalArgumentException.class) public void copyAssetTargetFolderIsNotAssetFolder() { - final Asset asset = assetRepo.findById(-1100L).get(); - final Folder targetFolder = folderRepo.findById(-200L).get(); + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-1100L).get(); - assetManager.copy(asset, targetFolder); + final Folder targetFolder = folderRepo.findById(-200L).get(); + + assetManager.copy(asset, targetFolder); + }); } /** @@ -578,17 +636,22 @@ public class AssetManagerTest { @ShouldMatchDataSet( "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") public void verifyIsAssetInUse() { - final Asset header = assetRepo.findById(-700L).get(); - final Asset phb = assetRepo.findById(-800L).get(); - final Asset servicesHeader = assetRepo.findById(-900L).get(); - final Asset product1Datasheet = assetRepo.findById(-1000L).get(); - final Asset catalog = assetRepo.findById(-1100L).get(); - assertThat(assetManager.isAssetInUse(header), is(true)); - assertThat(assetManager.isAssetInUse(phb), is(false)); - assertThat(assetManager.isAssetInUse(servicesHeader), is(true)); - assertThat(assetManager.isAssetInUse(product1Datasheet), is(true)); - assertThat(assetManager.isAssetInUse(catalog), is(true)); + shiro.getSystemUser().execute(() -> { + final Asset header = assetRepo.findById(-700L).get(); + final Asset phb = assetRepo.findById(-800L).get(); + final Asset servicesHeader = assetRepo.findById(-900L).get(); + final Asset product1Datasheet = assetRepo.findById(-1000L).get(); + final Asset catalog = assetRepo.findById(-1100L).get(); + + assertThat(assetManager.isAssetInUse(header), is(true)); + assertThat(assetManager.isAssetInUse(phb), is(false)); + assertThat(assetManager.isAssetInUse(servicesHeader), is(true)); + assertThat(assetManager.isAssetInUse(product1Datasheet), is(true)); + assertThat(assetManager.isAssetInUse(catalog), is(true)); + + return null; + }); } /** @@ -603,22 +666,25 @@ public class AssetManagerTest { @ShouldMatchDataSet( "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") public void verifyGetAssetPathWithoutContentSection() { - final Asset header = assetRepo.findById(-700L).get(); - final Asset phb = assetRepo.findById(-800L).get(); - final Asset servicesHeader = assetRepo.findById(-900L).get(); - final Asset product1Datasheet = assetRepo.findById(-1000L).get(); - final Asset catalog = assetRepo.findById(-1100L).get(); - assertThat(assetManager.getAssetPath(header), - is(equalTo("/media/images/header.png"))); - assertThat(assetManager.getAssetPath(phb), - is(equalTo("/media/images/the-phb.png"))); - assertThat(assetManager.getAssetPath(servicesHeader), - is(equalTo("/media/services-header.png"))); - assertThat(assetManager.getAssetPath(product1Datasheet), - is(equalTo(""))); - assertThat(assetManager.getAssetPath(catalog), - is(equalTo("/media/downloads/catalog.pdf"))); + shiro.getSystemUser().execute(() -> { + final Asset header = assetRepo.findById(-700L).get(); + final Asset phb = assetRepo.findById(-800L).get(); + final Asset servicesHeader = assetRepo.findById(-900L).get(); + final Asset product1Datasheet = assetRepo.findById(-1000L).get(); + final Asset catalog = assetRepo.findById(-1100L).get(); + + assertThat(assetManager.getAssetPath(header), + is(equalTo("/media/images/header.png"))); + assertThat(assetManager.getAssetPath(phb), + is(equalTo("/media/images/the-phb.png"))); + assertThat(assetManager.getAssetPath(servicesHeader), + is(equalTo("/media/services-header.png"))); + assertThat(assetManager.getAssetPath(product1Datasheet), + is(equalTo(""))); + assertThat(assetManager.getAssetPath(catalog), + is(equalTo("/media/downloads/catalog.pdf"))); + }); } /** @@ -633,22 +699,25 @@ public class AssetManagerTest { @ShouldMatchDataSet( "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") public void verifyGetAssetPathWithContentSection() { - final Asset header = assetRepo.findById(-700L).get(); - final Asset phb = assetRepo.findById(-800L).get(); - final Asset servicesHeader = assetRepo.findById(-900L).get(); - final Asset product1Datasheet = assetRepo.findById(-1000L).get(); - final Asset catalog = assetRepo.findById(-1100L).get(); - assertThat(assetManager.getAssetPath(header, true), - is(equalTo("info:/media/images/header.png"))); - assertThat(assetManager.getAssetPath(phb, true), - is(equalTo("info:/media/images/the-phb.png"))); - assertThat(assetManager.getAssetPath(servicesHeader, true), - is(equalTo("info:/media/services-header.png"))); - assertThat(assetManager.getAssetPath(product1Datasheet, true), - is(equalTo(""))); - assertThat(assetManager.getAssetPath(catalog, true), - is(equalTo("info:/media/downloads/catalog.pdf"))); + shiro.getSystemUser().execute(() -> { + final Asset header = assetRepo.findById(-700L).get(); + final Asset phb = assetRepo.findById(-800L).get(); + final Asset servicesHeader = assetRepo.findById(-900L).get(); + final Asset product1Datasheet = assetRepo.findById(-1000L).get(); + final Asset catalog = assetRepo.findById(-1100L).get(); + + assertThat(assetManager.getAssetPath(header, true), + is(equalTo("info:/media/images/header.png"))); + assertThat(assetManager.getAssetPath(phb, true), + is(equalTo("info:/media/images/the-phb.png"))); + assertThat(assetManager.getAssetPath(servicesHeader, true), + is(equalTo("info:/media/services-header.png"))); + assertThat(assetManager.getAssetPath(product1Datasheet, true), + is(equalTo(""))); + assertThat(assetManager.getAssetPath(catalog, true), + is(equalTo("info:/media/downloads/catalog.pdf"))); + }); } /** @@ -663,37 +732,40 @@ public class AssetManagerTest { @ShouldMatchDataSet( "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") public void verifyGetAssetFolder() { - final Asset header = assetRepo.findById(-700L).get(); - final Asset phb = assetRepo.findById(-800L).get(); - final Asset servicesHeader = assetRepo.findById(-900L).get(); - final Asset product1Datasheet = assetRepo.findById(-1000L).get(); - final Asset catalog = assetRepo.findById(-1100L).get(); - final Folder media = folderRepo.findById(-400L).get(); - final Folder images = folderRepo.findById(-410L).get(); - final Folder downloads = folderRepo.findById(-420L).get(); + shiro.getSystemUser().execute(() -> { + final Asset header = assetRepo.findById(-700L).get(); + final Asset phb = assetRepo.findById(-800L).get(); + final Asset servicesHeader = assetRepo.findById(-900L).get(); + final Asset product1Datasheet = assetRepo.findById(-1000L).get(); + final Asset catalog = assetRepo.findById(-1100L).get(); - final Optional headerFolder = assetManager - .getAssetFolder(header); - final Optional phbFolder = assetManager - .getAssetFolder(phb); - final Optional servicesHeaderFolder = assetManager - .getAssetFolder(servicesHeader); - final Optional product1DatasheetFolder = assetManager - .getAssetFolder(product1Datasheet); - final Optional catalogFolder = assetManager - .getAssetFolder(catalog); + final Folder media = folderRepo.findById(-400L).get(); + final Folder images = folderRepo.findById(-410L).get(); + final Folder downloads = folderRepo.findById(-420L).get(); - assertThat(headerFolder.isPresent(), is(true)); - assertThat(phbFolder.isPresent(), is(true)); - assertThat(servicesHeaderFolder.isPresent(), is(true)); - assertThat(product1DatasheetFolder.isPresent(), is(false)); - assertThat(catalogFolder.isPresent(), is(true)); + final Optional headerFolder = assetManager + .getAssetFolder(header); + final Optional phbFolder = assetManager + .getAssetFolder(phb); + final Optional servicesHeaderFolder = assetManager + .getAssetFolder(servicesHeader); + final Optional product1DatasheetFolder = assetManager + .getAssetFolder(product1Datasheet); + final Optional catalogFolder = assetManager + .getAssetFolder(catalog); - assertThat(headerFolder.get(), is(equalTo(images))); - assertThat(phbFolder.get(), is(equalTo(images))); - assertThat(servicesHeaderFolder.get(), is(equalTo(media))); - assertThat(catalogFolder.get(), is(equalTo(downloads))); + assertThat(headerFolder.isPresent(), is(true)); + assertThat(phbFolder.isPresent(), is(true)); + assertThat(servicesHeaderFolder.isPresent(), is(true)); + assertThat(product1DatasheetFolder.isPresent(), is(false)); + assertThat(catalogFolder.isPresent(), is(true)); + + assertThat(headerFolder.get(), is(equalTo(images))); + assertThat(phbFolder.get(), is(equalTo(images))); + assertThat(servicesHeaderFolder.get(), is(equalTo(media))); + assertThat(catalogFolder.get(), is(equalTo(downloads))); + }); } /** @@ -708,58 +780,63 @@ public class AssetManagerTest { @ShouldMatchDataSet( "datasets/org/librecms/contentsection/AssetManagerTest/data.xml") public void verifyGetAssetFolders() { - final Asset header = assetRepo.findById(-700L).get(); - final Asset phb = assetRepo.findById(-800L).get(); - final Asset servicesHeader = assetRepo.findById(-900L).get(); - final Asset product1Datasheet = assetRepo.findById(-1000L).get(); - final Asset catalog = assetRepo.findById(-1100L).get(); - final Folder infoAssets = folderRepo.findById(-300L).get(); - final Folder media = folderRepo.findById(-400L).get(); - final Folder images = folderRepo.findById(-410L).get(); - final Folder downloads = folderRepo.findById(-420L).get(); + shiro.getSystemUser().execute(() -> { + final Asset header = assetRepo.findById(-700L).get(); + final Asset phb = assetRepo.findById(-800L).get(); + final Asset servicesHeader = assetRepo.findById(-900L).get(); + final Asset product1Datasheet = assetRepo.findById(-1000L).get(); + final Asset catalog = assetRepo.findById(-1100L).get(); - final List headerFolders = assetManager.getAssetFolders(header); - final List phbFolders = assetManager.getAssetFolders(phb); - final List servicesHeaderFolders = assetManager.getAssetFolders( - servicesHeader); - final List product1DatasheetFolders = assetManager. - getAssetFolders(product1Datasheet); - final List catalogFolders = assetManager. - getAssetFolders(catalog); + final Folder infoAssets = folderRepo.findById(-300L).get(); + final Folder media = folderRepo.findById(-400L).get(); + final Folder images = folderRepo.findById(-410L).get(); + final Folder downloads = folderRepo.findById(-420L).get(); - assertThat(headerFolders, is(not(nullValue()))); - assertThat(phbFolders, is(not(nullValue()))); - assertThat(servicesHeaderFolders, is(not(nullValue()))); - assertThat(product1DatasheetFolders, is(not(nullValue()))); - assertThat(catalogFolders, is(not(nullValue()))); + final List headerFolders = assetManager.getAssetFolders( + header); + final List phbFolders = assetManager.getAssetFolders(phb); + final List servicesHeaderFolders = assetManager + .getAssetFolders( + servicesHeader); + final List product1DatasheetFolders = assetManager. + getAssetFolders(product1Datasheet); + final List catalogFolders = assetManager. + getAssetFolders(catalog); - assertThat(headerFolders.isEmpty(), is(false)); - assertThat(phbFolders.isEmpty(), is(false)); - assertThat(servicesHeaderFolders.isEmpty(), is(false)); - assertThat(product1DatasheetFolders.isEmpty(), is(true)); - assertThat(catalogFolders.isEmpty(), is(false)); + assertThat(headerFolders, is(not(nullValue()))); + assertThat(phbFolders, is(not(nullValue()))); + assertThat(servicesHeaderFolders, is(not(nullValue()))); + assertThat(product1DatasheetFolders, is(not(nullValue()))); + assertThat(catalogFolders, is(not(nullValue()))); - assertThat(headerFolders.size(), is(3)); - assertThat(phbFolders.size(), is(3)); - assertThat(servicesHeaderFolders.size(), is(2)); - assertThat(product1DatasheetFolders.size(), is(0)); - assertThat(catalogFolders.size(), is(3)); + assertThat(headerFolders.isEmpty(), is(false)); + assertThat(phbFolders.isEmpty(), is(false)); + assertThat(servicesHeaderFolders.isEmpty(), is(false)); + assertThat(product1DatasheetFolders.isEmpty(), is(true)); + assertThat(catalogFolders.isEmpty(), is(false)); - assertThat(headerFolders.get(0), is(equalTo(infoAssets))); - assertThat(headerFolders.get(1), is(equalTo(media))); - assertThat(headerFolders.get(2), is(equalTo(images))); + assertThat(headerFolders.size(), is(3)); + assertThat(phbFolders.size(), is(3)); + assertThat(servicesHeaderFolders.size(), is(2)); + assertThat(product1DatasheetFolders.size(), is(0)); + assertThat(catalogFolders.size(), is(3)); - assertThat(phbFolders.get(0), is(equalTo(infoAssets))); - assertThat(phbFolders.get(1), is(equalTo(media))); - assertThat(phbFolders.get(2), is(equalTo(images))); + assertThat(headerFolders.get(0), is(equalTo(infoAssets))); + assertThat(headerFolders.get(1), is(equalTo(media))); + assertThat(headerFolders.get(2), is(equalTo(images))); - assertThat(servicesHeaderFolders.get(0), is(equalTo(infoAssets))); - assertThat(servicesHeaderFolders.get(1), is(equalTo(media))); + assertThat(phbFolders.get(0), is(equalTo(infoAssets))); + assertThat(phbFolders.get(1), is(equalTo(media))); + assertThat(phbFolders.get(2), is(equalTo(images))); - assertThat(catalogFolders.get(0), is(equalTo(infoAssets))); - assertThat(catalogFolders.get(1), is(equalTo(media))); - assertThat(catalogFolders.get(2), is(equalTo(downloads))); + assertThat(servicesHeaderFolders.get(0), is(equalTo(infoAssets))); + assertThat(servicesHeaderFolders.get(1), is(equalTo(media))); + + assertThat(catalogFolders.get(0), is(equalTo(infoAssets))); + assertThat(catalogFolders.get(1), is(equalTo(media))); + assertThat(catalogFolders.get(2), is(equalTo(downloads))); + }); } diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/AssetRepositoryTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/AssetRepositoryTest.java index 0cdd77980..1e59ba90a 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/AssetRepositoryTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/AssetRepositoryTest.java @@ -20,6 +20,7 @@ package org.librecms.contentsection; import static org.libreccm.testutils.DependenciesHelpers.*; +import org.apache.shiro.subject.ExecutionException; import org.apache.shiro.subject.Subject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.ShouldThrowException; @@ -56,6 +57,8 @@ import org.librecms.assets.Image; import org.librecms.assets.VideoAsset; import org.librecms.contentsection.rs.Assets; +import java.util.concurrent.Callable; + import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @@ -202,15 +205,19 @@ public class AssetRepositoryTest { excludeColumns = {"timestamp", "object_order"} ) public void deleteUnusedAsset() { - final Asset asset = assetRepo.findById(-800L).get(); - assetRepo.delete(asset); + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-800L).get(); + + assetRepo.delete(asset); + }); } /** * Verifies that an {@link Asset} which is associated to at least one * {@link ContentItem} can't be deleted by using * {@link AssetRepository#delete(org.librecms.assets.Asset)}. + * @throws java.lang.Throwable */ @Test(expected = AssetInUseException.class) @InSequence(110) @@ -220,10 +227,18 @@ public class AssetRepositoryTest { "datasets/org/librecms/contentsection/AssetRepositoryTest/" + "data.xml") @ShouldThrowException(AssetInUseException.class) - public void deleteUsedAsset() { - final Asset asset = assetRepo.findById(-700L).get(); + public void deleteUsedAsset() throws Throwable { - assetRepo.delete(asset); + try { + shiro.getSystemUser().execute(() -> { + final Asset asset = assetRepo.findById(-700L).get(); + assetRepo.delete(asset); + + return null; + }); + } catch (ExecutionException ex) { + throw ex.getCause(); + } } /** @@ -234,6 +249,7 @@ public class AssetRepositoryTest { @InSequence(200) @UsingDataSet( "datasets/org/librecms/contentsection/AssetRepositoryTest/data.xml") + public void findAssetByUuid() { final Optional header = shiro @@ -341,7 +357,6 @@ public class AssetRepositoryTest { assertThat(images.get(1).getDisplayName(), is(equalTo("services-header.png"))); assertThat(images.get(2).getDisplayName(), is(equalTo("the-phb.png"))); - assertThat(files.get(0).getDisplayName(), is(equalTo("catalog.pdf"))); assertThat(files.get(1).getDisplayName(), @@ -487,7 +502,7 @@ public class AssetRepositoryTest { assertThat(files.get(0).getDisplayName(), is(equalTo("catalog.pdf"))); assertThat(files.get(1).getDisplayName(), is(equalTo("product1-datasheet.pdf"))); - + } /** diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemManagerTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemManagerTest.java index be87031b6..b0f13660f 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemManagerTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemManagerTest.java @@ -39,8 +39,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.libreccm.security.Shiro; import org.libreccm.tests.categories.IntegrationTest; -import org.libreccm.workflow.WorkflowTemplate; -import org.libreccm.workflow.WorkflowTemplateRepository; import org.librecms.contenttypes.Article; import org.librecms.contenttypes.Event; import org.librecms.lifecycle.LifecycleDefinition; @@ -52,6 +50,7 @@ import java.util.Optional; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.TypedQuery; + import org.jboss.arquillian.persistence.CleanupUsingScript; import org.jboss.arquillian.persistence.TestExecutionPhase; @@ -60,6 +59,9 @@ import static org.junit.Assert.*; import static org.libreccm.testutils.DependenciesHelpers.*; +import org.libreccm.workflow.Workflow; +import org.libreccm.workflow.WorkflowRepository; + /** * Tests for the {@link ContentItemManager}. * @@ -90,7 +92,7 @@ public class ContentItemManagerTest { private Shiro shiro; @Inject - private WorkflowTemplateRepository workflowTemplateRepo; + private WorkflowRepository workflowRepo; @Inject private LifecycleDefinitionRepository lifecycleDefinitionRepo; @@ -194,7 +196,7 @@ public class ContentItemManagerTest { assertThat(itemManager, is(not(nullValue()))); assertThat(folderRepo, is(not(nullValue()))); assertThat(shiro, is(not(nullValue()))); - assertThat(workflowTemplateRepo, is(not(nullValue()))); + assertThat(workflowRepo, is(not(nullValue()))); assertThat(lifecycleDefinitionRepo, is(not(nullValue()))); assertThat(entityManager, is(not(nullValue()))); } @@ -418,8 +420,9 @@ public class ContentItemManagerTest { .get(); final Folder folder = section.getRootDocumentsFolder(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo - .findById(-110L).get(); + final Workflow workflowTemplate = workflowRepo + .findById(-110L) + .get(); final Article article = itemManager.createContentItem( "new-article", @@ -466,8 +469,9 @@ public class ContentItemManagerTest { .get(); final Folder folder = section.getRootDocumentsFolder(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo - .findById(-110L).get(); + final Workflow workflowTemplate = workflowRepo + .findById(-110L) + .get(); itemManager.createContentItem("Test", section, @@ -499,8 +503,9 @@ public class ContentItemManagerTest { .get(); final Folder folder = section.getRootDocumentsFolder(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo - .findById(-110L).get(); + final Workflow workflowTemplate = workflowRepo + .findById(-110L) + .get(); itemManager.createContentItem(null, section, @@ -561,8 +566,9 @@ public class ContentItemManagerTest { .findByLabel("info") .get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo - .findById(-110L).get(); + final Workflow workflowTemplate = workflowRepo + .findById(-110L) + .get(); itemManager.createContentItem("Test", section, diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemPermissionTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemPermissionTest.java index 99986f3f3..aa7e98469 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemPermissionTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/ContentItemPermissionTest.java @@ -152,11 +152,11 @@ public class ContentItemPermissionTest { .addClass(org.libreccm.workflow.TaskComment.class) .addClass(org.libreccm.workflow.TaskState.class) .addClass(org.libreccm.workflow.Workflow.class) + .addClass(org.libreccm.workflow.AbstractWorkflowException.class) //Classes required by org.libreccm.categorization.Category .addClass(org.libreccm.security.RecursivePermissions.class) //Classes required by org.libreccm.workflow.Workflow.class .addClass(org.libreccm.workflow.WorkflowState.class) - .addClass(org.libreccm.workflow.WorkflowTemplate.class) //Classes required by org.librecms.contentsection.ContentItem .addClass(org.librecms.contentsection.AttachmentList.class) .addClass(org.librecms.contentsection.ContentItemVersion.class) diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/ContentSectionManagerTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/ContentSectionManagerTest.java index 66981d3ff..9894482ca 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/ContentSectionManagerTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/ContentSectionManagerTest.java @@ -57,8 +57,8 @@ import static org.libreccm.testutils.DependenciesHelpers.*; import org.jboss.arquillian.container.test.api.ShouldThrowException; import org.jboss.arquillian.persistence.CleanupUsingScript; import org.jboss.arquillian.persistence.TestExecutionPhase; -import org.libreccm.workflow.WorkflowTemplate; -import org.libreccm.workflow.WorkflowTemplateRepository; +import org.libreccm.workflow.Workflow; +import org.libreccm.workflow.WorkflowRepository; import org.librecms.contentsection.privileges.ItemPrivileges; import org.librecms.contenttypes.Article; import org.librecms.contenttypes.Event; @@ -102,7 +102,7 @@ public class ContentSectionManagerTest { private LifecycleDefinitionRepository lifecycleDefRepo; @Inject - private WorkflowTemplateRepository workflowTemplateRepo; + private WorkflowRepository workflowRepo; public ContentSectionManagerTest() { } @@ -198,7 +198,7 @@ public class ContentSectionManagerTest { assertThat(categoryRepo, is(not(nullValue()))); assertThat(typeRepo, is(not(nullValue()))); assertThat(lifecycleDefRepo, is(not(nullValue()))); - assertThat(workflowTemplateRepo, is(not(nullValue()))); + assertThat(workflowRepo, is(not(nullValue()))); } /** @@ -449,9 +449,11 @@ public class ContentSectionManagerTest { public void addContentTypeToSection() { final ContentSection section = repository.findById(-1100L).get(); final LifecycleDefinition lifecycleDef = lifecycleDefRepo - .findById(-13002L).get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo - .findById(-14001L).get(); + .findById(-13002L) + .get(); + final Workflow workflowTemplate = workflowRepo + .findById(-14001L) + .get(); manager.addContentTypeToSection(Event.class, section, @@ -474,9 +476,11 @@ public class ContentSectionManagerTest { public void addAlreadyAddedContentTypeToSection() { final ContentSection section = repository.findById(-1100L).get(); final LifecycleDefinition lifecycleDef = lifecycleDefRepo - .findById(-13002L).get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo - .findById(-14002L).get(); + .findById(-13002L) + .get(); + final Workflow workflowTemplate = workflowRepo + .findById(-14002L) + .get(); manager.addContentTypeToSection(News.class, section, @@ -501,7 +505,7 @@ public class ContentSectionManagerTest { final ContentSection section = repository.findById(-1100L).get(); final LifecycleDefinition lifecycleDef = lifecycleDefRepo .findById(-13002L).get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo + final Workflow workflowTemplate = workflowRepo .findById(-14002L).get(); manager.addContentTypeToSection(null, @@ -527,7 +531,7 @@ public class ContentSectionManagerTest { public void addContentTypeToSectionSectionIsNull() { final LifecycleDefinition lifecycleDef = lifecycleDefRepo .findById(-13002L).get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo + final Workflow workflowTemplate = workflowRepo .findById(-14002L).get(); manager.addContentTypeToSection(Event.class, @@ -551,7 +555,7 @@ public class ContentSectionManagerTest { @InSequence(800) public void addContentTypeToSectionLifecycleIsNull() { final ContentSection section = repository.findById(-1100L).get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo + final Workflow workflowTemplate = workflowRepo .findById(-14001L).get(); manager.addContentTypeToSection(Event.class, @@ -602,7 +606,7 @@ public class ContentSectionManagerTest { final ContentSection section = repository.findById(-1100L).get(); final LifecycleDefinition lifecycleDef = lifecycleDefRepo .findById(-13003L).get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo + final Workflow workflowTemplate = workflowRepo .findById(-14001L).get(); manager.addContentTypeToSection(Event.class, @@ -628,7 +632,7 @@ public class ContentSectionManagerTest { final ContentSection section = repository.findById(-1100L).get(); final LifecycleDefinition lifecycleDef = lifecycleDefRepo .findById(-13002L).get(); - final WorkflowTemplate workflowTemplate = workflowTemplateRepo + final Workflow workflowTemplate = workflowRepo .findById(-14003L).get(); manager.addContentTypeToSection(Event.class, diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/ContentTypeRepositoryTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/ContentTypeRepositoryTest.java index 8ffa467c1..41212a9a2 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/ContentTypeRepositoryTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/ContentTypeRepositoryTest.java @@ -388,7 +388,7 @@ public class ContentTypeRepositoryTest { .addClass(org.libreccm.workflow.TaskState.class) .addClass(org.libreccm.workflow.Workflow.class) .addClass(org.libreccm.workflow.WorkflowState.class) - .addClass(org.libreccm.workflow.WorkflowTemplate.class) + .addClass(org.libreccm.workflow.AbstractWorkflowException.class) .addClass(org.librecms.CmsConstants.class) .addClass(org.librecms.contentsection.Asset.class) .addClass(org.librecms.contentsection.AttachmentList.class) diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/EqualsAndHashCodeTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/EqualsAndHashCodeTest.java index f7b38af8e..c1f64db4e 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/EqualsAndHashCodeTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/EqualsAndHashCodeTest.java @@ -30,12 +30,11 @@ import org.libreccm.security.User; import org.libreccm.tests.categories.UnitTest; import org.libreccm.testutils.EqualsVerifier; import org.libreccm.web.CcmApplication; -import org.libreccm.workflow.WorkflowTemplate; +import org.libreccm.workflow.Workflow; import org.librecms.lifecycle.LifecycleDefinition; import java.util.Arrays; import java.util.Collection; -import java.util.Locale; /** * @@ -143,14 +142,12 @@ public class EqualsAndHashCodeTest extends EqualsVerifier { final LifecycleDefinition lifecycleDef2 = new LifecycleDefinition(); lifecycleDef2.setDefinitionId(-110); - - final WorkflowTemplate workflowTemplate1 = new WorkflowTemplate(); - workflowTemplate1.getName().addValue(Locale.ENGLISH, - "Workflow Template 1"); - - final WorkflowTemplate workflowTemplate2 = new WorkflowTemplate(); - workflowTemplate2.getName().addValue(Locale.ENGLISH, - "Workflow Template 2"); + + final Workflow workflow1 = new Workflow(); + workflow1.setAbstractWorkflow(true); + + final Workflow workflow2 = new Workflow(); + workflow2.setAbstractWorkflow(false); verifier .withPrefabValues(ContentItem.class, item1, item2) @@ -167,9 +164,7 @@ public class EqualsAndHashCodeTest extends EqualsVerifier { .withPrefabValues(LifecycleDefinition.class, lifecycleDef1, lifecycleDef2) - .withPrefabValues(WorkflowTemplate.class, - workflowTemplate1, - workflowTemplate2); + .withPrefabValues(Workflow.class, workflow1, workflow2); } /** diff --git a/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/cleanup.sql b/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/cleanup.sql index cc2fdf4ad..0cf352a13 100644 --- a/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/cleanup.sql +++ b/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/cleanup.sql @@ -82,8 +82,6 @@ DELETE FROM ccm_core.workflow_task_descriptions; DELETE FROM ccm_cms.content_section_workflow_templates; -DELETE FROM ccm_core.workflow_templates; - DELETE FROM ccm_core.workflows; DELETE FROM ccm_cms.lifecycle_phase_definition_labels; diff --git a/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_cms_schema.sql b/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_cms_schema.sql index e485d2bb5..f42d89b38 100644 --- a/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_cms_schema.sql +++ b/ccm-cms/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_cms_schema.sql @@ -8,7 +8,7 @@ create schema CCM_CORE; create table CCM_CMS.ARTICLE_TEXTS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -16,7 +16,7 @@ create schema CCM_CORE; create table CCM_CMS.ARTICLE_TEXTS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -36,7 +36,7 @@ create schema CCM_CORE; create table CCM_CMS.ASSET_TITLES ( ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ASSET_ID, LOCALE) ); @@ -44,7 +44,7 @@ create schema CCM_CORE; create table CCM_CMS.ASSET_TITLES_AUD ( REV integer not null, ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -64,7 +64,7 @@ create schema CCM_CORE; create table CCM_CMS.ATTACHMENT_LIST_CAPTIONS ( LIST_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (LIST_ID, LOCALE) ); @@ -72,7 +72,7 @@ create schema CCM_CORE; create table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD ( REV integer not null, LIST_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -81,7 +81,7 @@ create schema CCM_CORE; create table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS ( LIST_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (LIST_ID, LOCALE) ); @@ -89,7 +89,7 @@ create schema CCM_CORE; create table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD ( REV integer not null, LIST_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -153,7 +153,7 @@ create schema CCM_CORE; create table CCM_CMS.BINARY_ASSET_DESCRIPTIONS ( ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ASSET_ID, LOCALE) ); @@ -161,7 +161,7 @@ create schema CCM_CORE; create table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD ( REV integer not null, ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -170,8 +170,8 @@ create schema CCM_CORE; create table CCM_CMS.BINARY_ASSETS ( ASSET_DATA blob, - FILENAME varchar(512), - MIME_TYPE varchar(512), + FILENAME varchar(512) not null, + MIME_TYPE varchar(512) not null, DATA_SIZE bigint, OBJECT_ID bigint not null, primary key (OBJECT_ID) @@ -189,7 +189,7 @@ create schema CCM_CORE; create table CCM_CMS.BOOKMARK_DESCRIPTIONS ( ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ASSET_ID, LOCALE) ); @@ -197,7 +197,7 @@ create schema CCM_CORE; create table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD ( REV integer not null, ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -219,7 +219,7 @@ create schema CCM_CORE; create table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -227,7 +227,7 @@ create schema CCM_CORE; create table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -236,7 +236,7 @@ create schema CCM_CORE; create table CCM_CMS.CONTENT_ITEM_NAMES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -244,7 +244,7 @@ create schema CCM_CORE; create table CCM_CMS.CONTENT_ITEM_NAMES_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -253,7 +253,7 @@ create schema CCM_CORE; create table CCM_CMS.CONTENT_ITEM_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -261,7 +261,7 @@ create schema CCM_CORE; create table CCM_CMS.CONTENT_ITEM_TITLES_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -296,6 +296,7 @@ create schema CCM_CORE; WORKFLOW_ID bigint, primary key (OBJECT_ID, REV) ); + create table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS ( CONTENT_SECTION_ID bigint not null, LIFECYCLE_DEFINITION_ID bigint not null @@ -326,14 +327,14 @@ create schema CCM_CORE; create table CCM_CMS.CONTENT_TYPE_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CMS.CONTENT_TYPE_LABELS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -352,7 +353,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_COSTS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -360,7 +361,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_COSTS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -369,7 +370,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_DATES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -377,7 +378,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_DATES_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -386,7 +387,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_LOCATIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -394,7 +395,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_LOCATIONS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -403,7 +404,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_MAIN_CONTRIBUTORS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -411,7 +412,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -420,7 +421,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_TEXTS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -428,7 +429,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_TEXTS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -437,7 +438,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_TYPES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -445,7 +446,7 @@ create schema CCM_CORE; create table CCM_CMS.EVENT_TYPES_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -568,7 +569,7 @@ create schema CCM_CORE; create table CCM_CMS.LEGAL_METADATA_RIGHTS ( ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ASSET_ID, LOCALE) ); @@ -576,7 +577,7 @@ create schema CCM_CORE; create table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD ( REV integer not null, ASSET_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -585,28 +586,28 @@ create schema CCM_CORE; create table CCM_CMS.LIFECYCLE_DEFINITION_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CMS.LIFECYCLE_DEFINITION_LABELS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_LABELS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -651,7 +652,7 @@ create schema CCM_CORE; create table CCM_CMS.MPA_SECTION_TEXTS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -659,7 +660,7 @@ create schema CCM_CORE; create table CCM_CMS.MPA_SECTION_TEXTS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -668,7 +669,7 @@ create schema CCM_CORE; create table CCM_CMS.MPA_SECTION_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -676,7 +677,7 @@ create schema CCM_CORE; create table CCM_CMS.MPA_SECTION_TITLES_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -685,7 +686,7 @@ create schema CCM_CORE; create table CCM_CMS.MPA_SUMMARIES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -693,7 +694,7 @@ create schema CCM_CORE; create table CCM_CMS.MPA_SUMMARIES_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -755,7 +756,7 @@ create schema CCM_CORE; create table CCM_CMS.NEWS_TEXTS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -763,7 +764,7 @@ create schema CCM_CORE; create table CCM_CMS.NEWS_TEXTS_AUD ( REV integer not null, OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -787,7 +788,7 @@ create schema CCM_CORE; create table CCM_CMS.SIDE_NOTE_TEXTS ( SIDE_NOTE_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (SIDE_NOTE_ID, LOCALE) ); @@ -795,7 +796,7 @@ create schema CCM_CORE; create table CCM_CMS.SIDE_NOTE_TEXTS_AUD ( REV integer not null, SIDE_NOTE_ID bigint not null, - LOCALIZED_VALUE longvarchar not null, + LOCALIZED_VALUE varchar(2147483647) not null, LOCALE varchar(255) not null, REVTYPE tinyint, REVEND integer, @@ -884,7 +885,7 @@ create schema CCM_CORE; create table CCM_CORE.CATEGORY_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -901,7 +902,7 @@ create schema CCM_CORE; create table CCM_CORE.CATEGORY_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -949,7 +950,7 @@ create schema CCM_CORE; create table CCM_CORE.DOMAIN_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -966,14 +967,14 @@ create schema CCM_CORE; create table CCM_CORE.DOMAIN_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( COMPONENT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (COMPONENT_ID, LOCALE) ); @@ -1018,14 +1019,14 @@ create schema CCM_CORE; create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); @@ -1062,7 +1063,7 @@ create schema CCM_CORE; create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( OPTION_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OPTION_ID, LOCALE) ); @@ -1075,14 +1076,14 @@ create schema CCM_CORE; create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); @@ -1241,14 +1242,14 @@ create schema CCM_CORE; create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PAGE_MODEL_ID, LOCALE) ); create table CCM_CORE.PAGE_MODEL_TITLES ( PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PAGE_MODEL_ID, LOCALE) ); @@ -1274,7 +1275,7 @@ create schema CCM_CORE; PERMISSION_ID bigint not null, CREATION_DATE timestamp, CREATION_IP varchar(255), - granted_privilege varchar(255), + GRANTED_PRIVILEGE varchar(255), INHERITED boolean, CREATION_USER_ID bigint, GRANTEE_ID bigint, @@ -1311,21 +1312,21 @@ create schema CCM_CORE; create table CCM_CORE.RESOURCE_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( RESOURCE_TYPE_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (RESOURCE_TYPE_ID, LOCALE) ); @@ -1350,7 +1351,7 @@ create schema CCM_CORE; create table CCM_CORE.ROLE_DESCRIPTIONS ( ROLE_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ROLE_ID, LOCALE) ); @@ -1367,11 +1368,11 @@ create schema CCM_CORE; SETTING_ID bigint not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, - SETTING_VALUE_BIG_DECIMAL decimal(19,2), - SETTING_VALUE_BOOLEAN boolean, - SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_DOUBLE double, SETTING_VALUE_LONG bigint, + SETTING_VALUE_BOOLEAN boolean, + SETTING_VALUE_BIG_DECIMAL decimal(19,2), + SETTING_VALUE_STRING varchar(1024), primary key (SETTING_ID) ); @@ -1382,7 +1383,7 @@ create schema CCM_CORE; create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( ENTRY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ENTRY_ID, LOCALE) ); @@ -1431,14 +1432,14 @@ create schema CCM_CORE; create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_NAMES ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); @@ -1452,7 +1453,7 @@ create schema CCM_CORE; create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( COMMENT_ID bigint not null, - COMMENT longvarchar, + COMMENT varchar(2147483647), UUID varchar(255) not null, AUTHOR_ID bigint, TASK_ID bigint, @@ -1466,14 +1467,14 @@ create schema CCM_CORE; create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( TASK_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_TASK_LABELS ( TASK_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); @@ -1487,13 +1488,9 @@ create schema CCM_CORE; primary key (TASK_ID) ); - create table CCM_CORE.WORKFLOW_TEMPLATES ( - WORKFLOW_ID bigint not null, - primary key (WORKFLOW_ID) - ); - create table CCM_CORE.WORKFLOWS ( WORKFLOW_ID bigint not null, + abstract_workflow boolean, ACTIVE boolean, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), @@ -1529,7 +1526,753 @@ create schema CCM_CORE; alter table CCM_CORE.WORKFLOWS add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); -create sequence hibernate_sequence start with 1 increment by 1; + + create sequence hibernate_sequence start with 1 increment by 1; + + alter table CCM_CMS.ARTICLE_TEXTS + add constraint FK1pel1j53h3t3adh9o5cbje2d3 + foreign key (OBJECT_ID) + references CCM_CMS.ARTICLES; + + alter table CCM_CMS.ARTICLE_TEXTS_AUD + add constraint FKa06qks62tieeba607ykdrv3ry + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ARTICLE_TEXTS_AUD + add constraint FKljfof07259eofkub5g2dx0jlq + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ARTICLES + add constraint FK2pwvn9v2t2pikcw5hn2oq13q + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.ARTICLES_AUD + add constraint FKnevu4il5fu4vy2f5twh50kstr + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.ASSET_TITLES + add constraint FKj61sy509dv63u246wlau5f9pa + foreign key (ASSET_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.ASSET_TITLES_AUD + add constraint FK6yuimrre2oowjo0diw6b00nhe + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ASSET_TITLES_AUD + add constraint FKcaockxi21ve0irh06vegc77uu + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ASSETS + add constraint FKlbiojib44ujxv9eee1sjn67qk + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CMS.ASSETS_AUD + add constraint FKi5q560xg9357da8gc5sukqbw8 + foreign key (OBJECT_ID, REV) + references CCM_CORE.CCM_OBJECTS_AUD; + + alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS + add constraint FKeqcryerscpnmqpipwyrvd0lae + foreign key (LIST_ID) + references CCM_CMS.ATTACHMENT_LISTS; + + alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD + add constraint FK727detagt51wmejywhteq4jfs + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD + add constraint FK7589vpkxegxs8y3wqjx37tig3 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS + add constraint FKixgpo00r1cqq5jw1s7v6fchpn + foreign key (LIST_ID) + references CCM_CMS.ATTACHMENT_LISTS; + + alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD + add constraint FKqhqkm6tas9fdmggv4k1vj0nc7 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD + add constraint FKqv2o9jffgok4518fb5c85552l + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LISTS + add constraint FKqyj7ifjfyp7kmsj8fiyxn0am3 + foreign key (ITEM_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.ATTACHMENT_LISTS_AUD + add constraint FKgdt5p8huh1lhk299hkrytqmqc + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LISTS_AUD + add constraint FKdn502yobchapgcyj1bu00u67a + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENTS + add constraint FKmn0bm137vwr61iy5nb59cjm22 + foreign key (ASSET_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.ATTACHMENTS + add constraint FK3mqbt13sbed2ae0esrps4p0oh + foreign key (ATTACHMENT_LIST_ID) + references CCM_CMS.ATTACHMENT_LISTS; + + alter table CCM_CMS.ATTACHMENTS_AUD + add constraint FKl19663g6todb5d1e9lok7fl9e + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENTS_AUD + add constraint FK4n28sostn1hc8bf43qsp1pyuf + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.AUDIO_ASSETS + add constraint FKg9tos3it7lflk5o90jluonpev + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.AUDIO_ASSETS + add constraint FKgxpsfjlfsk609c0w2te18y90v + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.AUDIO_ASSETS_AUD + add constraint FKbt11nwbde1en1upceratct6s3 + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS + add constraint FK31kl9gu49nvhcku7gfsro6hqq + foreign key (ASSET_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD + add constraint FKhehi2pvqliq0s2jhv661lar7g + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD + add constraint FK9f5n81i6j0yopog1hvua2wmxc + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BINARY_ASSETS + add constraint FKltx0jq1u1aflrd20k1c77m8vh + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.BINARY_ASSETS_AUD + add constraint FK1qfap4mxprjk7gnjdcvdxr5mv + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.BOOKMARK_DESCRIPTIONS + add constraint FKmeydpwmlq0wqw3gab4auiyrqg + foreign key (ASSET_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD + add constraint FKfff2ein3uhgwyyyajamy3hfwy + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD + add constraint FKtl48flnrkr0upvrc1ksy1o92m + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BOOKMARKS + add constraint FKksnngecvvxmsxdvri4shby2hy + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.BOOKMARKS_AUD + add constraint FK47cpxaw9vnnes2dbr6h3toirl + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS + add constraint FK6mt4tjnenr79o52wcj99tpeu4 + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD + add constraint FK12yrysxv4fxa73ker40e883av + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD + add constraint FK4pxuq0pf2hrtireo902t21ocx + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_NAMES + add constraint FKijrfangf9s3lyncmod651xyg8 + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.CONTENT_ITEM_NAMES_AUD + add constraint FKq631ee5ollx5xkliowcrt8wkj + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_NAMES_AUD + add constraint FKbjaycalit9pa2u7ae5dwjgtky + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_TITLES + add constraint FKbvf67lou4ep94pgi6tur6o2gf + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.CONTENT_ITEM_TITLES_AUD + add constraint FKfbno0rxshoi57y8aehwv3o42j + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_TITLES_AUD + add constraint FK4c3exifj1ghwg6htglynlo094 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FKg83y3asxi1jr7larwven7ueu0 + foreign key (CONTENT_TYPE_ID) + references CCM_CMS.CONTENT_TYPES; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FKfh1nm46qpw6xcwkmgaqw2iu3h + foreign key (LIFECYCLE_ID) + references CCM_CMS.LIFECYCLES; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FKl00ldjygr6as8gqbt3j14ke7j + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FK1fr2q5y1wpmrufruja5ivfpuf + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CMS.CONTENT_ITEMS_AUD + add constraint FKsfhj0qok0ksjplvgcaditqekl + foreign key (OBJECT_ID, REV) + references CCM_CORE.CCM_OBJECTS_AUD; + + alter table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS + add constraint FKqnsnk1eju8vrbm7x0wr5od4ll + foreign key (LIFECYCLE_DEFINITION_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS + add constraint FK7daejlunqsnhgky4b92n019a9 + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_SECTION_ROLES + add constraint FKkn5nygbmub9wd5lxw3402t82d + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CMS.CONTENT_SECTION_ROLES + add constraint FKgcn76piocmkmvl3b0omv9vkv9 + foreign key (SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES + add constraint FK1t85m4jehnhd6tyx5dtpavr15 + foreign key (WORKFLOW_TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES + add constraint FK6kuejkcl9hcbkr8q6bdlatt8q + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_SECTIONS + add constraint FKavcn4aakxsb7kt7hmqlx0ecu6 + foreign key (ROOT_ASSETS_FOLDER_ID) + references CCM_CMS.FOLDERS; + + alter table CCM_CMS.CONTENT_SECTIONS + add constraint FKd5sahsfsycq3i5icf3122ne8e + foreign key (ROOT_DOCUMENTS_FOLDER_ID) + references CCM_CMS.FOLDERS; + + alter table CCM_CMS.CONTENT_SECTIONS + add constraint FK72jh0axiiru87i61mppvaiv96 + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_CMS.CONTENT_TYPE_DESCRIPTIONS + add constraint FKknyen2aw844b65grp7uys34cb + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_TYPES; + + alter table CCM_CMS.CONTENT_TYPE_LABELS + add constraint FK3suusqws1xgffyk3yob7m7dge + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_TYPES; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FKriohuo8093its1k5rgoc5yrfc + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FK8s83we1tuh9r3j57dyos69wfa + foreign key (DEFAULT_LIFECYCLE_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FKpgeccqsr50xwb268ypmfx0r66 + foreign key (DEFAULT_WORKFLOW) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FK96vwsbqfbdg33ujeeawajr0v4 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CMS.EVENT_COSTS + add constraint FKrbmepytotc73h5inefeih6rea + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_COSTS_AUD + add constraint FKocok2fj1oflsi16i9guf8bpc6 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_COSTS_AUD + add constraint FKr17panho66n1ixh8tdms01e2c + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_DATES + add constraint FKfsfsbgoeoi511ll69iy1v7ujs + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_DATES_AUD + add constraint FK70p2ayg7fexrb9jogdu3vlwfb + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_DATES_AUD + add constraint FKklmki82kiy0hwwpfdur2s7l3e + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_LOCATIONS + add constraint FK8snwub57evwh6px3n265tcoiv + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_LOCATIONS_AUD + add constraint FKk5thpb1gaktsk213o53y97hno + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_LOCATIONS_AUD + add constraint FKivwe7h7k4myq4rhuh2wkepd9j + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS + add constraint FKlmq881mxd08hthm5dy4ayjq0e + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD + add constraint FKqgkj5almojvt913heh1f4kro5 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD + add constraint FKh8vhg85li7c8yqjrg2plvkgho + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TEXTS + add constraint FKc46r2g7ry50b9e875dldjhwxp + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_TEXTS_AUD + add constraint FK82mc7uswliij43std6gwyswj3 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TEXTS_AUD + add constraint FK1s381t783dmpk0fup65mvma0w + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TYPES + add constraint FKhdbj26ubbhmht44qpin7ony29 + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_TYPES_AUD + add constraint FKgby7m27rnb6oeloqycyf4b1kx + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TYPES_AUD + add constraint FKhcpvb5q2geclo5vxk0gt815x8 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENTS + add constraint FKt56odfo39eq13gcj1bbtngoj7 + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.EVENTS_AUD + add constraint FK9gofktd490afdwak49x15w6me + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS + add constraint FKrwn3rdmqevi618fthojs0xkkq + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS + add constraint FK36xjlvslk0vlekn9lsc7x1c7a + foreign key (OBJECT_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS_AUD + add constraint FKp3jndaw4k35wb3d6hg5ng4xww + foreign key (OBJECT_ID, REV) + references CCM_CMS.BOOKMARKS_AUD; + + alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS + add constraint FK82gxr2se97dl902eu4wvhdvh3 + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS + add constraint FKps8bq22n1fxy8svnsrui3f0t2 + foreign key (OBJECT_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS_AUD + add constraint FKilxwg8ppd64hl14tojfmupau9 + foreign key (OBJECT_ID, REV) + references CCM_CMS.BOOKMARKS_AUD; + + alter table CCM_CMS.FILES + add constraint FKpg74w39tfbbuqhcy21u61q138 + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.FILES_AUD + add constraint FKdl876a4twd0gkranwqkdmxnwy + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.FOLDER_CONTENT_SECTION_MAP + add constraint FKnof2m7o4f0ufrugeh4g5wt3g9 + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.FOLDER_CONTENT_SECTION_MAP + add constraint FKmmb7728dp707dljq282ch47k3 + foreign key (FOLDER_ID) + references CCM_CMS.FOLDERS; + + alter table CCM_CMS.FOLDERS + add constraint FK2ag06r5ywtuji2pkt68etlg48 + foreign key (OBJECT_ID) + references CCM_CORE.CATEGORIES; + + alter table CCM_CMS.IMAGES + add constraint FK51ja1101epvl74auenv6sqyev + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.IMAGES + add constraint FKmdqranhdstkn6m6d73l15amxs + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.IMAGES_AUD + add constraint FK4jsrdpe6d8is0ybx2p7sxivwf + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.LEGAL_METADATA + add constraint FKnxl7uyv1ks0qabgeienx2t9d1 + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.LEGAL_METADATA_AUD + add constraint FKpt3eqil7iij6t5h1lrnjbb5xs + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS + add constraint FKf9s3kxi6y5r60wksv5bospmx1 + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS_AUD + add constraint FKc3lonfk7mn3p14ix96k5u74om + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS_AUD + add constraint FKgxxsteesd2em96fj05f0u4men + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LEGAL_METADATA_RIGHTS + add constraint FKhsy9u7nrh3slmkkri3nba7e1 + foreign key (ASSET_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD + add constraint FKe2da3kha2nl6sj0dllhepuxtq + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD + add constraint FKr867xswbxlqq6diyqyqnrh670 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LIFECYCLE_DEFINITION_DESCRIPTIONS + add constraint FKsdr5aoogu4b9x95m8qsbe4t0y + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_DEFINITION_LABELS + add constraint FKt4h71sl91ue18b25pdjty7jex + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_DESCRIPTIONS + add constraint FKafbeck8qm0nflpt9aedn196ou + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_LABELS + add constraint FKqysn500b0sp7bu8gy2sf2q8b9 + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS + add constraint FKq5cwomuc9s1f3fsriq9t35407 + foreign key (LIFECYCLE_DEFINITION_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLES + add constraint FK5yx1a2f8g4w95p1ul77sfhow8 + foreign key (DEFINITION_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYLE_PHASES + add constraint FKpqysexvd82e4xd4uibtdfn8j4 + foreign key (DEFINITION_ID) + references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS; + + alter table CCM_CMS.LIFECYLE_PHASES + add constraint FKlh2b1nokqxhf790lt7lhgoisc + foreign key (LIFECYCLE_ID) + references CCM_CMS.LIFECYCLES; + + alter table CCM_CMS.MPA_SECTION_TEXTS + add constraint FKaruovr4oa07syyhvkixfwc17h + foreign key (OBJECT_ID) + references CCM_CMS.MULTIPART_ARTICLE_SECTIONS; + + alter table CCM_CMS.MPA_SECTION_TEXTS_AUD + add constraint FKs4kvqroybq9ldb2rwhr6v8kmt + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SECTION_TEXTS_AUD + add constraint FKpxvtsycad805c8u0vyh7pcb2c + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SECTION_TITLES + add constraint FK7qpmrj6yjvad50k5budn5rag4 + foreign key (OBJECT_ID) + references CCM_CMS.MULTIPART_ARTICLE_SECTIONS; + + alter table CCM_CMS.MPA_SECTION_TITLES_AUD + add constraint FKk64mi5911ybptw4slxh8i0lgb + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SECTION_TITLES_AUD + add constraint FKq7f0y31r5tk2nesx0lv53d6sb + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SUMMARIES + add constraint FK5kx5ghrkh6tqa2vms2qabacx8 + foreign key (OBJECT_ID) + references CCM_CMS.MULTIPART_ARTICLES; + + alter table CCM_CMS.MPA_SUMMARIES_AUD + add constraint FKmmrabpl2gsrdb2udc76x9o6q7 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SUMMARIES_AUD + add constraint FK3kebu6i1dtwfegp4409hhob4x + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS + add constraint FK30tkd6xp4i1gg6nrse4di2yxx + foreign key (MULTIPART_ARTICLE_ID) + references CCM_CMS.MULTIPART_ARTICLES; + + alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS_AUD + add constraint FK8xq6k3a1kmnxv9nh5wae80k6k + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS_AUD + add constraint FKsudhdaa9hs73447yik8mdy3ts + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MULTIPART_ARTICLES + add constraint FKj7j0ew378cmcta2dfdso4tmey + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.MULTIPART_ARTICLES_AUD + add constraint FKacl2u1cx6tmwfb9cpaxstw39k + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.MultiPartArticle_MultiPartArticleSection_AUD + add constraint FK9vexjsvd62ufkgi4g24qiql70 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MultiPartArticle_MultiPartArticleSection_AUD + add constraint FK4ds2fgwphr74869qkn4e2yia6 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.NEWS + add constraint FKl8jhpvtn0lx9drkhhbbuvqqis + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.NEWS_AUD + add constraint FK7akvtda3f51espb46xtjalcl2 + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.NEWS_TEXTS + add constraint FK1s5m60rf80iaidktawb3ebmf3 + foreign key (OBJECT_ID) + references CCM_CMS.NEWS; + + alter table CCM_CMS.NEWS_TEXTS_AUD + add constraint FKrand9sf233sgkgp8wfoen468l + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.NEWS_TEXTS_AUD + add constraint FKotjtrajmmjxussl4pvy2vl7ho + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.RELATED_LINKS + add constraint FKb517dnfj56oby2s34jp1omuim + foreign key (BOOKMARK_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.RELATED_LINKS + add constraint FK7ts8tmnwxi8kry7cer3egujsv + foreign key (TARGET_ITEM) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.RELATED_LINKS + add constraint FK35tv60a9kflo17h6xduvwvgis + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.RELATED_LINKS_AUD + add constraint FKiuwk6mcj3h5gccu2aviq3d8lt + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.SIDE_NOTE_TEXTS + add constraint FK4mvpioee23u1qswmn1fekipoh + foreign key (SIDE_NOTE_ID) + references CCM_CMS.SIDE_NOTES; + + alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD + add constraint FKiu4ht1tipeal2csdkvws4fnws + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD + add constraint FKacekagiqks1cj9otxdmryl934 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.SIDE_NOTES + add constraint FKea6cikleenmkgw5bwus22mfr3 + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.SIDE_NOTES_AUD + add constraint FKl5pkg9mp2ymc2uo4kmlubyp3m + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.VIDEO_ASSETS + add constraint FKjuywvv7wq9pyid5b6ivyrc0yk + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.VIDEO_ASSETS + add constraint FKqt2cx1r31kqbqkimdld312i9g + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.VIDEO_ASSETS_AUD + add constraint FKdrx9uu9a03ju7vqvkjretohpk + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.WORKFLOW_TASKS + add constraint FKoon3rwfmg0lhgbj4un4q3otya + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; alter table CCM_CORE.APPLICATIONS add constraint FKatcp9ij6mbkx0nfeig1o6n3lm @@ -1852,7 +2595,7 @@ create sequence hibernate_sequence start with 1 increment by 1; references CCM_CORE.CCM_ROLES; alter table CCM_CORE.PERMISSIONS - add constraint FKc1x3h1p3o20qiwmonpmva7t5i + add constraint FKg56ujjoe0j30pq579rf0l5yc6 foreign key (INHERITED_FROM_ID) references CCM_CORE.CCM_OBJECTS; @@ -2036,17 +2779,12 @@ create sequence hibernate_sequence start with 1 increment by 1; foreign key (WORKFLOW_ID) references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOW_TEMPLATES - add constraint FK8692vdme4yxnkj1m0k1dw74pk - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOWS add constraint FKrm2yfrs6veoxoy304upq2wc64 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.WORKFLOWS - add constraint FKeixdxau4jebw682gd49tdbsjy + add constraint FK9ray5beiny6wm2mi0uwyecay2 foreign key (TEMPLATE_ID) - references CCM_CORE.WORKFLOW_TEMPLATES; + references CCM_CORE.WORKFLOWS; \ No newline at end of file diff --git a/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/cleanup.sql b/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/cleanup.sql index cc2fdf4ad..0cf352a13 100644 --- a/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/cleanup.sql +++ b/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/cleanup.sql @@ -82,8 +82,6 @@ DELETE FROM ccm_core.workflow_task_descriptions; DELETE FROM ccm_cms.content_section_workflow_templates; -DELETE FROM ccm_core.workflow_templates; - DELETE FROM ccm_core.workflows; DELETE FROM ccm_cms.lifecycle_phase_definition_labels; diff --git a/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_cms_schema.sql b/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_cms_schema.sql index 625ef09a7..8c48bfad5 100644 --- a/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_cms_schema.sql +++ b/ccm-cms/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_cms_schema.sql @@ -2051,3 +2051,2785 @@ create sequence hibernate_sequence start 1 increment 1; add constraint FKeixdxau4jebw682gd49tdbsjy foreign key (TEMPLATE_ID) references CCM_CORE.WORKFLOW_TEMPLATES; + create table CCM_CMS.ARTICLE_TEXTS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.ARTICLE_TEXTS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.ARTICLES ( + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.ARTICLES_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.ASSET_TITLES ( + ASSET_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (ASSET_ID, LOCALE) + ); + + create table CCM_CMS.ASSET_TITLES_AUD ( + REV int4 not null, + ASSET_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.ASSETS ( + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.ASSETS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.ATTACHMENT_LIST_CAPTIONS ( + LIST_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (LIST_ID, LOCALE) + ); + + create table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD ( + REV int4 not null, + LIST_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, LIST_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS ( + LIST_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (LIST_ID, LOCALE) + ); + + create table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD ( + REV int4 not null, + LIST_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, LIST_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.ATTACHMENT_LISTS ( + LIST_ID int8 not null, + NAME varchar(255), + LIST_ORDER int8, + UUID varchar(255), + ITEM_ID int8, + primary key (LIST_ID) + ); + + create table CCM_CMS.ATTACHMENT_LISTS_AUD ( + LIST_ID int8 not null, + REV int4 not null, + REVTYPE int2, + REVEND int4, + NAME varchar(255), + LIST_ORDER int8, + UUID varchar(255), + ITEM_ID int8, + primary key (LIST_ID, REV) + ); + + create table CCM_CMS.ATTACHMENTS ( + ATTACHMENT_ID int8 not null, + SORT_KEY int8, + uuid varchar(255), + ASSET_ID int8, + ATTACHMENT_LIST_ID int8, + primary key (ATTACHMENT_ID) + ); + + create table CCM_CMS.ATTACHMENTS_AUD ( + ATTACHMENT_ID int8 not null, + REV int4 not null, + REVTYPE int2, + REVEND int4, + SORT_KEY int8, + uuid varchar(255), + ASSET_ID int8, + ATTACHMENT_LIST_ID int8, + primary key (ATTACHMENT_ID, REV) + ); + + create table CCM_CMS.AUDIO_ASSETS ( + OBJECT_ID int8 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.AUDIO_ASSETS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.BINARY_ASSET_DESCRIPTIONS ( + ASSET_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (ASSET_ID, LOCALE) + ); + + create table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD ( + REV int4 not null, + ASSET_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.BINARY_ASSETS ( + ASSET_DATA oid, + FILENAME varchar(512) not null, + MIME_TYPE varchar(512) not null, + DATA_SIZE int8, + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.BINARY_ASSETS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + ASSET_DATA oid, + FILENAME varchar(512), + MIME_TYPE varchar(512), + DATA_SIZE int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.BOOKMARK_DESCRIPTIONS ( + ASSET_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (ASSET_ID, LOCALE) + ); + + create table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD ( + REV int4 not null, + ASSET_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.BOOKMARKS ( + URL varchar(2048) not null, + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.BOOKMARKS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + URL varchar(2048), + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.CONTENT_ITEM_NAMES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.CONTENT_ITEM_NAMES_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.CONTENT_ITEM_TITLES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.CONTENT_ITEM_TITLES_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.CONTENT_ITEMS ( + ANCESTORS varchar(1024), + CREATION_DATE timestamp, + CREATION_USER_NAME varchar(255), + ITEM_UUID varchar(255) not null, + LAST_MODIFIED timestamp, + LAST_MODIFYING_USER_NAME varchar(255), + LAUNCH_DATE date, + VERSION varchar(255), + OBJECT_ID int8 not null, + CONTENT_TYPE_ID int8, + LIFECYCLE_ID int8, + WORKFLOW_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.CONTENT_ITEMS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + ANCESTORS varchar(1024), + ITEM_UUID varchar(255), + LAUNCH_DATE date, + VERSION varchar(255), + CONTENT_TYPE_ID int8, + LIFECYCLE_ID int8, + WORKFLOW_ID int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS ( + CONTENT_SECTION_ID int8 not null, + LIFECYCLE_DEFINITION_ID int8 not null + ); + + create table CCM_CMS.CONTENT_SECTION_ROLES ( + SECTION_ID int8 not null, + ROLE_ID int8 not null + ); + + create table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES ( + CONTENT_SECTION_ID int8 not null, + WORKFLOW_TEMPLATE_ID int8 not null + ); + + create table CCM_CMS.CONTENT_SECTIONS ( + DEFAULT_LOCALE varchar(255), + ITEM_RESOLVER_CLASS varchar(1024), + LABEL varchar(512), + PAGE_RESOLVER_CLASS varchar(1024), + TEMPLATE_RESOLVER_CLASS varchar(1024), + XML_GENERATOR_CLASS varchar(1024), + OBJECT_ID int8 not null, + ROOT_ASSETS_FOLDER_ID int8, + ROOT_DOCUMENTS_FOLDER_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.CONTENT_TYPE_DESCRIPTIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.CONTENT_TYPE_LABELS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.CONTENT_TYPES ( + ANCESTORS varchar(1024), + CONTENT_ITEM_CLASS varchar(1024), + DESCENDANTS varchar(1024), + TYPE_MODE varchar(255), + OBJECT_ID int8 not null, + CONTENT_SECTION_ID int8, + DEFAULT_LIFECYCLE_ID int8, + DEFAULT_WORKFLOW int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.EVENT_COSTS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.EVENT_COSTS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.EVENT_DATES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.EVENT_DATES_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.EVENT_LOCATIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.EVENT_LOCATIONS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.EVENT_MAIN_CONTRIBUTORS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.EVENT_TEXTS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.EVENT_TEXTS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.EVENT_TYPES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.EVENT_TYPES_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.EVENTS ( + END_DATE timestamp, + MAP_LINK varchar(255), + START_DATE timestamp not null, + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.EVENTS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + END_DATE timestamp, + MAP_LINK varchar(255), + START_DATE timestamp, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.EXTERNAL_AUDIO_ASSETS ( + OBJECT_ID int8 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.EXTERNAL_AUDIO_ASSETS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.EXTERNAL_VIDEO_ASSETS ( + OBJECT_ID int8 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.EXTERNAL_VIDEO_ASSETS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.FILES ( + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.FILES_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.FOLDER_CONTENT_SECTION_MAP ( + CONTENT_SECTION_ID int8, + FOLDER_ID int8 not null, + primary key (FOLDER_ID) + ); + + create table CCM_CMS.FOLDERS ( + TYPE varchar(255) not null, + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.IMAGES ( + HEIGHT int8, + WIDTH int8, + OBJECT_ID int8 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.IMAGES_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + HEIGHT int8, + WIDTH int8, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.LEGAL_METADATA ( + CREATOR varchar(255), + PUBLISHER varchar(255), + RIGHTS_HOLDER varchar(512), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.LEGAL_METADATA_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + CREATOR varchar(255), + PUBLISHER varchar(255), + RIGHTS_HOLDER varchar(512), + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS ( + LEGAL_METADATA_ID int8 not null, + CONTRIBUTORS varchar(255) + ); + + create table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS_AUD ( + REV int4 not null, + LEGAL_METADATA_ID int8 not null, + CONTRIBUTORS varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, LEGAL_METADATA_ID, CONTRIBUTORS) + ); + + create table CCM_CMS.LEGAL_METADATA_RIGHTS ( + ASSET_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (ASSET_ID, LOCALE) + ); + + create table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD ( + REV int4 not null, + ASSET_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.LIFECYCLE_DEFINITION_DESCRIPTIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.LIFECYCLE_DEFINITION_LABELS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_DESCRIPTIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_LABELS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS ( + PHASE_DEFINITION_ID int8 not null, + DEFAULT_DELAY int8, + DEFAULT_DURATION int8, + DEFAULT_LISTENER varchar(1024), + LIFECYCLE_DEFINITION_ID int8, + primary key (PHASE_DEFINITION_ID) + ); + + create table CCM_CMS.LIFECYCLES ( + LIFECYCLE_ID int8 not null, + END_DATE_TIME date, + FINISHED boolean, + LISTENER varchar(1024), + START_DATE_TIME date, + STARTED boolean, + DEFINITION_ID int8, + primary key (LIFECYCLE_ID) + ); + + create table CCM_CMS.LIFECYLE_DEFINITIONS ( + LIFECYCLE_DEFINITION_ID int8 not null, + DEFAULT_LISTENER varchar(1024), + primary key (LIFECYCLE_DEFINITION_ID) + ); + + create table CCM_CMS.LIFECYLE_PHASES ( + PHASE_ID int8 not null, + END_DATE_TIME date, + FINISHED boolean, + LISTENER varchar(1024), + START_DATE_TIME date, + STARTED boolean, + DEFINITION_ID int8, + LIFECYCLE_ID int8, + primary key (PHASE_ID) + ); + + create table CCM_CMS.MPA_SECTION_TEXTS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.MPA_SECTION_TEXTS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.MPA_SECTION_TITLES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.MPA_SECTION_TITLES_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.MPA_SUMMARIES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.MPA_SUMMARIES_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.MULTIPART_ARTICLE_SECTIONS ( + SECTION_ID int8 not null, + PAGE_BREAK boolean, + RANK int4, + MULTIPART_ARTICLE_ID int8, + primary key (SECTION_ID) + ); + + create table CCM_CMS.MULTIPART_ARTICLE_SECTIONS_AUD ( + SECTION_ID int8 not null, + REV int4 not null, + REVTYPE int2, + REVEND int4, + PAGE_BREAK boolean, + RANK int4, + primary key (SECTION_ID, REV) + ); + + create table CCM_CMS.MULTIPART_ARTICLES ( + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.MULTIPART_ARTICLES_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.MultiPartArticle_MultiPartArticleSection_AUD ( + REV int4 not null, + MULTIPART_ARTICLE_ID int8 not null, + SECTION_ID int8 not null, + REVTYPE int2, + REVEND int4, + primary key (REV, MULTIPART_ARTICLE_ID, SECTION_ID) + ); + + create table CCM_CMS.NEWS ( + HOMEPAGE boolean, + NEWS_DATE date not null, + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.NEWS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + HOMEPAGE boolean, + NEWS_DATE date, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.NEWS_TEXTS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CMS.NEWS_TEXTS_AUD ( + REV int4 not null, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, OBJECT_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.RELATED_LINKS ( + OBJECT_ID int8 not null, + BOOKMARK_ID int8, + TARGET_ITEM int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.RELATED_LINKS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + BOOKMARK_ID int8, + TARGET_ITEM int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.SIDE_NOTE_TEXTS ( + SIDE_NOTE_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (SIDE_NOTE_ID, LOCALE) + ); + + create table CCM_CMS.SIDE_NOTE_TEXTS_AUD ( + REV int4 not null, + SIDE_NOTE_ID int8 not null, + LOCALIZED_VALUE text not null, + LOCALE varchar(255) not null, + REVTYPE int2, + REVEND int4, + primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE) + ); + + create table CCM_CMS.SIDE_NOTES ( + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.SIDE_NOTES_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.VIDEO_ASSETS ( + HEIGHT int8, + WIDTH int8, + OBJECT_ID int8 not null, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CMS.VIDEO_ASSETS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + HEIGHT int8, + WIDTH int8, + LEGAL_METADATA_ID int8, + primary key (OBJECT_ID, REV) + ); + + create table CCM_CMS.WORKFLOW_TASKS ( + TASK_TYPE varchar(255), + TASK_ID int8 not null, + primary key (TASK_ID) + ); + + alter table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS + add constraint UK_dhbp1f81iaw6sl7tg36xh439e unique (LIFECYCLE_DEFINITION_ID); + + alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES + add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID); + + create table CCM_CORE.APPLICATIONS ( + APPLICATION_TYPE varchar(1024) not null, + PRIMARY_URL varchar(1024) not null, + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.ATTACHMENTS ( + ATTACHMENT_ID int8 not null, + ATTACHMENT_DATA oid, + DESCRIPTION varchar(255), + MIME_TYPE varchar(255), + TITLE varchar(255), + MESSAGE_ID int8, + primary key (ATTACHMENT_ID) + ); + + create table CCM_CORE.CATEGORIES ( + ABSTRACT_CATEGORY boolean, + CATEGORY_ORDER int8, + ENABLED boolean, + NAME varchar(255) not null, + UNIQUE_ID varchar(255), + VISIBLE boolean, + OBJECT_ID int8 not null, + PARENT_CATEGORY_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.CATEGORIZATIONS ( + CATEGORIZATION_ID int8 not null, + CATEGORY_ORDER int8, + CATEGORY_INDEX boolean, + OBJECT_ORDER int8, + TYPE varchar(255), + OBJECT_ID int8, + CATEGORY_ID int8, + primary key (CATEGORIZATION_ID) + ); + + create table CCM_CORE.CATEGORY_DESCRIPTIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CORE.CATEGORY_DOMAINS ( + DOMAIN_KEY varchar(255) not null, + RELEASED timestamp, + URI varchar(1024), + VERSION varchar(255), + OBJECT_ID int8 not null, + ROOT_CATEGORY_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.CATEGORY_TITLES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CORE.CCM_OBJECTS ( + OBJECT_ID int8 not null, + DISPLAY_NAME varchar(255), + UUID varchar(255), + primary key (OBJECT_ID) + ); + + create table CCM_CORE.CCM_OBJECTS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + REVTYPE int2, + REVEND int4, + DISPLAY_NAME varchar(255), + primary key (OBJECT_ID, REV) + ); + + create table CCM_CORE.CCM_REVISIONS ( + id int4 not null, + timestamp int8 not null, + USER_NAME varchar(255), + primary key (id) + ); + + create table CCM_CORE.CCM_ROLES ( + ROLE_ID int8 not null, + NAME varchar(512) not null, + primary key (ROLE_ID) + ); + + create table CCM_CORE.DIGESTS ( + FREQUENCY int4, + HEADER varchar(4096) not null, + NEXT_RUN timestamp, + DIGEST_SEPARATOR varchar(128) not null, + SIGNATURE varchar(4096) not null, + SUBJECT varchar(255) not null, + OBJECT_ID int8 not null, + FROM_PARTY_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.DOMAIN_DESCRIPTIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CORE.DOMAIN_OWNERSHIPS ( + OWNERSHIP_ID int8 not null, + CONTEXT varchar(255), + DOMAIN_ORDER int8, + OWNER_ORDER int8, + domain_OBJECT_ID int8 not null, + owner_OBJECT_ID int8 not null, + primary key (OWNERSHIP_ID) + ); + + create table CCM_CORE.DOMAIN_TITLES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( + COMPONENT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (COMPONENT_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_COMPONENTS ( + ACTIVE boolean, + ADMIN_NAME varchar(255), + ATTRIBUTE_STRING varchar(255), + COMPONENT_ORDER int8, + SELECTED boolean, + OBJECT_ID int8 not null, + parentComponent_OBJECT_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER ( + BODY text, + FROM_EMAIL varchar(255), + SUBJECT varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS ( + URL varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS ( + MULTIPLE boolean, + QUERY varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_DATA_QUERIES ( + QUERY_ID varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( + DATA_QUERY_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (DATA_QUERY_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( + DATA_QUERY_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (DATA_QUERY_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_FORMSECTIONS ( + FORMSECTION_ACTION varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_LISTENERS ( + ATTRIBUTE_STRING varchar(255), + CLASS_NAME varchar(255), + OBJECT_ID int8 not null, + widget_OBJECT_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_METAOBJECTS ( + CLASS_NAME varchar(255), + PRETTY_NAME varchar(255), + PRETTY_PLURAL varchar(255), + PROPERTIES_FORM varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_OBJECT_TYPES ( + APP_NAME varchar(255), + CLASS_NAME varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( + OPTION_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OPTION_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_OPTIONS ( + PARAMETER_VALUE varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( + PROCESS_LISTENER_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (PROCESS_LISTENER_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( + PROCESS_LISTENER_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (PROCESS_LISTENER_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( + LISTENER_CLASS varchar(255), + PROCESS_LISTENER_ORDER int8, + OBJECT_ID int8 not null, + formSection_OBJECT_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER ( + REMOTE_URL varchar(2048), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS ( + RECIPIENT varchar(255), + SUBJECT varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS ( + BODY text, + RECIPIENT varchar(255), + SUBJECT varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_WIDGETS ( + DEFAULT_VALUE varchar(255), + PARAMETER_MODEL varchar(255), + PARAMETER_NAME varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS ( + RECIPIENT varchar(255), + SUBJECT varchar(255), + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.GROUP_MEMBERSHIPS ( + MEMBERSHIP_ID int8 not null, + GROUP_ID int8, + MEMBER_ID int8, + primary key (MEMBERSHIP_ID) + ); + + create table CCM_CORE.GROUPS ( + PARTY_ID int8 not null, + primary key (PARTY_ID) + ); + + create table CCM_CORE.HOSTS ( + HOST_ID int8 not null, + SERVER_NAME varchar(512), + SERVER_PORT int8, + primary key (HOST_ID) + ); + + create table CCM_CORE.INITS ( + INITIALIZER_ID int8 not null, + CLASS_NAME varchar(255), + REQUIRED_BY_ID int8, + primary key (INITIALIZER_ID) + ); + + create table CCM_CORE.INSTALLED_MODULES ( + MODULE_ID int4 not null, + MODULE_CLASS_NAME varchar(2048), + STATUS varchar(255), + primary key (MODULE_ID) + ); + + create table CCM_CORE.LUCENE_DOCUMENTS ( + DOCUMENT_ID int8 not null, + CONTENT text, + CONTENT_SECTION varchar(512), + COUNTRY varchar(8), + CREATED timestamp, + DIRTY int8, + DOCUMENT_LANGUAGE varchar(8), + LAST_MODIFIED timestamp, + SUMMARY varchar(4096), + DOCUMENT_TIMESTAMP timestamp, + TITLE varchar(4096), + TYPE varchar(255), + TYPE_SPECIFIC_INFO varchar(512), + CREATED_BY_PARTY_ID int8, + LAST_MODIFIED_BY int8, + primary key (DOCUMENT_ID) + ); + + create table CCM_CORE.LUCENE_INDEXES ( + INDEX_ID int8 not null, + LUCENE_INDEX_ID int8, + HOST_ID int8, + primary key (INDEX_ID) + ); + + create table CCM_CORE.MESSAGES ( + BODY varchar(255), + BODY_MIME_TYPE varchar(255), + SENT timestamp, + SUBJECT varchar(255), + OBJECT_ID int8 not null, + IN_REPLY_TO_ID int8, + SENDER_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.NOTIFICATIONS ( + EXPAND_GROUP boolean, + EXPUNGE boolean, + EXPUNGE_MESSAGE boolean, + FULFILL_DATE timestamp, + HEADER varchar(4096), + MAX_RETRIES int8, + REQUEST_DATE timestamp, + SIGNATURE varchar(4096), + STATUS varchar(32), + OBJECT_ID int8 not null, + DIGEST_ID int8, + MESSAGE_ID int8, + RECEIVER_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( + TOKEN_ID int8 not null, + PURPOSE varchar(255), + TOKEN varchar(255), + VALID_UNTIL timestamp, + USER_ID int8, + primary key (TOKEN_ID) + ); + + create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS ( + COMPONENT_MODEL_ID int8 not null, + CLASS_ATTRIBUTE varchar(512), + ID_ATTRIBUTE varchar(255), + COMPONENT_KEY varchar(255), + MODEL_UUID varchar(255) not null, + STYLE_ATTRIBUTE varchar(1024), + UUID varchar(255) not null, + PAGE_MODEL_ID int8, + primary key (COMPONENT_MODEL_ID) + ); + + create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( + PAGE_MODEL_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (PAGE_MODEL_ID, LOCALE) + ); + + create table CCM_CORE.PAGE_MODEL_TITLES ( + PAGE_MODEL_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (PAGE_MODEL_ID, LOCALE) + ); + + create table CCM_CORE.PAGE_MODELS ( + PAGE_MODEL_ID int8 not null, + MODEL_UUID varchar(255) not null, + NAME varchar(255), + TYPE varchar(255) not null, + UUID varchar(255) not null, + VERSION varchar(255) not null, + APPLICATION_ID int8, + primary key (PAGE_MODEL_ID) + ); + + create table CCM_CORE.PARTIES ( + PARTY_ID int8 not null, + NAME varchar(256) not null, + primary key (PARTY_ID) + ); + + create table CCM_CORE.PERMISSIONS ( + PERMISSION_ID int8 not null, + CREATION_DATE timestamp, + CREATION_IP varchar(255), + GRANTED_PRIVILEGE varchar(255), + INHERITED boolean, + CREATION_USER_ID int8, + GRANTEE_ID int8, + INHERITED_FROM_ID int8, + OBJECT_ID int8, + primary key (PERMISSION_ID) + ); + + create table CCM_CORE.PORTALS ( + TEMPLATE boolean, + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.PORTLETS ( + CELL_NUMBER int8, + SORT_KEY int8, + OBJECT_ID int8 not null, + PORTAL_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.QUEUE_ITEMS ( + QUEUE_ITEM_ID int8 not null, + HEADER varchar(4096), + RECEIVER_ADDRESS varchar(512), + RETRY_COUNT int8, + SIGNATURE varchar(4096), + SUCCESSFUL_SENDED boolean, + MESSAGE_ID int8, + RECEIVER_ID int8, + primary key (QUEUE_ITEM_ID) + ); + + create table CCM_CORE.RESOURCE_DESCRIPTIONS ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CORE.RESOURCE_TITLES ( + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (OBJECT_ID, LOCALE) + ); + + create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( + RESOURCE_TYPE_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (RESOURCE_TYPE_ID, LOCALE) + ); + + create table CCM_CORE.RESOURCE_TYPES ( + RESOURCE_TYPE_ID int8 not null, + SINGLETON boolean, + TITLE varchar(254) not null, + EMBEDDED_VIEW boolean, + FULL_PAGE_VIEW boolean, + WORKSPACE_APP boolean, + primary key (RESOURCE_TYPE_ID) + ); + + create table CCM_CORE.RESOURCES ( + CREATED timestamp, + OBJECT_ID int8 not null, + parent_OBJECT_ID int8, + resourceType_RESOURCE_TYPE_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.ROLE_DESCRIPTIONS ( + ROLE_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (ROLE_ID, LOCALE) + ); + + create table CCM_CORE.ROLE_MEMBERSHIPS ( + MEMBERSHIP_ID int8 not null, + MEMBER_ID int8, + ROLE_ID int8, + primary key (MEMBERSHIP_ID) + ); + + create table CCM_CORE.SETTINGS ( + DTYPE varchar(31) not null, + SETTING_ID int8 not null, + CONFIGURATION_CLASS varchar(512) not null, + NAME varchar(512) not null, + SETTING_VALUE_DOUBLE float8, + SETTING_VALUE_LONG int8, + SETTING_VALUE_BOOLEAN boolean, + SETTING_VALUE_BIG_DECIMAL numeric(19, 2), + SETTING_VALUE_STRING varchar(1024), + primary key (SETTING_ID) + ); + + create table CCM_CORE.SETTINGS_ENUM_VALUES ( + ENUM_ID int8 not null, + value varchar(255) + ); + + create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( + ENTRY_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (ENTRY_ID, LOCALE) + ); + + create table CCM_CORE.SETTINGS_STRING_LIST ( + LIST_ID int8 not null, + value varchar(255) + ); + + create table CCM_CORE.THREADS ( + OBJECT_ID int8 not null, + ROOT_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.USER_EMAIL_ADDRESSES ( + USER_ID int8 not null, + EMAIL_ADDRESS varchar(512) not null, + BOUNCING boolean, + VERIFIED boolean + ); + + create table CCM_CORE.USERS ( + BANNED boolean, + FAMILY_NAME varchar(512), + GIVEN_NAME varchar(512), + PASSWORD varchar(2048), + PASSWORD_RESET_REQUIRED boolean, + EMAIL_ADDRESS varchar(512) not null, + BOUNCING boolean, + VERIFIED boolean, + PARTY_ID int8 not null, + primary key (PARTY_ID) + ); + + create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS ( + DUE_DATE timestamp, + DURATION_MINUTES int8, + LOCKED boolean, + START_DATE timestamp, + TASK_ID int8 not null, + LOCKING_USER_ID int8, + NOTIFICATION_SENDER int8, + primary key (TASK_ID) + ); + + create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( + WORKFLOW_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (WORKFLOW_ID, LOCALE) + ); + + create table CCM_CORE.WORKFLOW_NAMES ( + WORKFLOW_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (WORKFLOW_ID, LOCALE) + ); + + create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS ( + TASK_ASSIGNMENT_ID int8 not null, + ROLE_ID int8, + TASK_ID int8, + primary key (TASK_ASSIGNMENT_ID) + ); + + create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( + COMMENT_ID int8 not null, + COMMENT text, + UUID varchar(255) not null, + AUTHOR_ID int8, + TASK_ID int8, + primary key (COMMENT_ID) + ); + + create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( + DEPENDS_ON_TASK_ID int8 not null, + DEPENDENT_TASK_ID int8 not null + ); + + create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( + TASK_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (TASK_ID, LOCALE) + ); + + create table CCM_CORE.WORKFLOW_TASK_LABELS ( + TASK_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (TASK_ID, LOCALE) + ); + + create table CCM_CORE.WORKFLOW_TASKS ( + TASK_ID int8 not null, + ACTIVE boolean, + TASK_STATE varchar(512), + UUID varchar(255) not null, + WORKFLOW_ID int8, + primary key (TASK_ID) + ); + + create table CCM_CORE.WORKFLOWS ( + WORKFLOW_ID int8 not null, + abstract_workflow boolean, + ACTIVE boolean, + WORKFLOW_STATE varchar(255), + TASKS_STATE varchar(255), + UUID varchar(255) not null, + OBJECT_ID int8, + TEMPLATE_ID int8, + primary key (WORKFLOW_ID) + ); + + alter table CCM_CORE.CATEGORY_DOMAINS + add constraint UK_mb1riernf8a88u3mwl0bgfj8y unique (DOMAIN_KEY); + + alter table CCM_CORE.CATEGORY_DOMAINS + add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); + + alter table CCM_CORE.CCM_OBJECTS + add constraint UK_1cm71jlagvyvcnkqvxqyit3wx unique (UUID); + + alter table CCM_CORE.HOSTS + add constraint UK9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); + + alter table CCM_CORE.INSTALLED_MODULES + add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); + + alter table CCM_CORE.SETTINGS + add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID); + + alter table CCM_CORE.WORKFLOW_TASKS + add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID); + + alter table CCM_CORE.WORKFLOWS + add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); + + create sequence hibernate_sequence start 1 increment 1; + + alter table CCM_CMS.ARTICLE_TEXTS + add constraint FK1pel1j53h3t3adh9o5cbje2d3 + foreign key (OBJECT_ID) + references CCM_CMS.ARTICLES; + + alter table CCM_CMS.ARTICLE_TEXTS_AUD + add constraint FKa06qks62tieeba607ykdrv3ry + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ARTICLE_TEXTS_AUD + add constraint FKljfof07259eofkub5g2dx0jlq + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ARTICLES + add constraint FK2pwvn9v2t2pikcw5hn2oq13q + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.ARTICLES_AUD + add constraint FKnevu4il5fu4vy2f5twh50kstr + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.ASSET_TITLES + add constraint FKj61sy509dv63u246wlau5f9pa + foreign key (ASSET_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.ASSET_TITLES_AUD + add constraint FK6yuimrre2oowjo0diw6b00nhe + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ASSET_TITLES_AUD + add constraint FKcaockxi21ve0irh06vegc77uu + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ASSETS + add constraint FKlbiojib44ujxv9eee1sjn67qk + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CMS.ASSETS_AUD + add constraint FKi5q560xg9357da8gc5sukqbw8 + foreign key (OBJECT_ID, REV) + references CCM_CORE.CCM_OBJECTS_AUD; + + alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS + add constraint FKeqcryerscpnmqpipwyrvd0lae + foreign key (LIST_ID) + references CCM_CMS.ATTACHMENT_LISTS; + + alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD + add constraint FK727detagt51wmejywhteq4jfs + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD + add constraint FK7589vpkxegxs8y3wqjx37tig3 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS + add constraint FKixgpo00r1cqq5jw1s7v6fchpn + foreign key (LIST_ID) + references CCM_CMS.ATTACHMENT_LISTS; + + alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD + add constraint FKqhqkm6tas9fdmggv4k1vj0nc7 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD + add constraint FKqv2o9jffgok4518fb5c85552l + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LISTS + add constraint FKqyj7ifjfyp7kmsj8fiyxn0am3 + foreign key (ITEM_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.ATTACHMENT_LISTS_AUD + add constraint FKgdt5p8huh1lhk299hkrytqmqc + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENT_LISTS_AUD + add constraint FKdn502yobchapgcyj1bu00u67a + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENTS + add constraint FKmn0bm137vwr61iy5nb59cjm22 + foreign key (ASSET_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.ATTACHMENTS + add constraint FK3mqbt13sbed2ae0esrps4p0oh + foreign key (ATTACHMENT_LIST_ID) + references CCM_CMS.ATTACHMENT_LISTS; + + alter table CCM_CMS.ATTACHMENTS_AUD + add constraint FKl19663g6todb5d1e9lok7fl9e + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.ATTACHMENTS_AUD + add constraint FK4n28sostn1hc8bf43qsp1pyuf + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.AUDIO_ASSETS + add constraint FKg9tos3it7lflk5o90jluonpev + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.AUDIO_ASSETS + add constraint FKgxpsfjlfsk609c0w2te18y90v + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.AUDIO_ASSETS_AUD + add constraint FKbt11nwbde1en1upceratct6s3 + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS + add constraint FK31kl9gu49nvhcku7gfsro6hqq + foreign key (ASSET_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD + add constraint FKhehi2pvqliq0s2jhv661lar7g + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD + add constraint FK9f5n81i6j0yopog1hvua2wmxc + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BINARY_ASSETS + add constraint FKltx0jq1u1aflrd20k1c77m8vh + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.BINARY_ASSETS_AUD + add constraint FK1qfap4mxprjk7gnjdcvdxr5mv + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.BOOKMARK_DESCRIPTIONS + add constraint FKmeydpwmlq0wqw3gab4auiyrqg + foreign key (ASSET_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD + add constraint FKfff2ein3uhgwyyyajamy3hfwy + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD + add constraint FKtl48flnrkr0upvrc1ksy1o92m + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.BOOKMARKS + add constraint FKksnngecvvxmsxdvri4shby2hy + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.BOOKMARKS_AUD + add constraint FK47cpxaw9vnnes2dbr6h3toirl + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS + add constraint FK6mt4tjnenr79o52wcj99tpeu4 + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD + add constraint FK12yrysxv4fxa73ker40e883av + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD + add constraint FK4pxuq0pf2hrtireo902t21ocx + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_NAMES + add constraint FKijrfangf9s3lyncmod651xyg8 + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.CONTENT_ITEM_NAMES_AUD + add constraint FKq631ee5ollx5xkliowcrt8wkj + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_NAMES_AUD + add constraint FKbjaycalit9pa2u7ae5dwjgtky + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_TITLES + add constraint FKbvf67lou4ep94pgi6tur6o2gf + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.CONTENT_ITEM_TITLES_AUD + add constraint FKfbno0rxshoi57y8aehwv3o42j + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEM_TITLES_AUD + add constraint FK4c3exifj1ghwg6htglynlo094 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FKg83y3asxi1jr7larwven7ueu0 + foreign key (CONTENT_TYPE_ID) + references CCM_CMS.CONTENT_TYPES; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FKfh1nm46qpw6xcwkmgaqw2iu3h + foreign key (LIFECYCLE_ID) + references CCM_CMS.LIFECYCLES; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FKl00ldjygr6as8gqbt3j14ke7j + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CMS.CONTENT_ITEMS + add constraint FK1fr2q5y1wpmrufruja5ivfpuf + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CMS.CONTENT_ITEMS_AUD + add constraint FKsfhj0qok0ksjplvgcaditqekl + foreign key (OBJECT_ID, REV) + references CCM_CORE.CCM_OBJECTS_AUD; + + alter table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS + add constraint FKqnsnk1eju8vrbm7x0wr5od4ll + foreign key (LIFECYCLE_DEFINITION_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS + add constraint FK7daejlunqsnhgky4b92n019a9 + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_SECTION_ROLES + add constraint FKkn5nygbmub9wd5lxw3402t82d + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CMS.CONTENT_SECTION_ROLES + add constraint FKgcn76piocmkmvl3b0omv9vkv9 + foreign key (SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES + add constraint FK1t85m4jehnhd6tyx5dtpavr15 + foreign key (WORKFLOW_TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES + add constraint FK6kuejkcl9hcbkr8q6bdlatt8q + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_SECTIONS + add constraint FKavcn4aakxsb7kt7hmqlx0ecu6 + foreign key (ROOT_ASSETS_FOLDER_ID) + references CCM_CMS.FOLDERS; + + alter table CCM_CMS.CONTENT_SECTIONS + add constraint FKd5sahsfsycq3i5icf3122ne8e + foreign key (ROOT_DOCUMENTS_FOLDER_ID) + references CCM_CMS.FOLDERS; + + alter table CCM_CMS.CONTENT_SECTIONS + add constraint FK72jh0axiiru87i61mppvaiv96 + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_CMS.CONTENT_TYPE_DESCRIPTIONS + add constraint FKknyen2aw844b65grp7uys34cb + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_TYPES; + + alter table CCM_CMS.CONTENT_TYPE_LABELS + add constraint FK3suusqws1xgffyk3yob7m7dge + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_TYPES; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FKriohuo8093its1k5rgoc5yrfc + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FK8s83we1tuh9r3j57dyos69wfa + foreign key (DEFAULT_LIFECYCLE_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FKpgeccqsr50xwb268ypmfx0r66 + foreign key (DEFAULT_WORKFLOW) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CMS.CONTENT_TYPES + add constraint FK96vwsbqfbdg33ujeeawajr0v4 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CMS.EVENT_COSTS + add constraint FKrbmepytotc73h5inefeih6rea + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_COSTS_AUD + add constraint FKocok2fj1oflsi16i9guf8bpc6 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_COSTS_AUD + add constraint FKr17panho66n1ixh8tdms01e2c + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_DATES + add constraint FKfsfsbgoeoi511ll69iy1v7ujs + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_DATES_AUD + add constraint FK70p2ayg7fexrb9jogdu3vlwfb + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_DATES_AUD + add constraint FKklmki82kiy0hwwpfdur2s7l3e + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_LOCATIONS + add constraint FK8snwub57evwh6px3n265tcoiv + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_LOCATIONS_AUD + add constraint FKk5thpb1gaktsk213o53y97hno + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_LOCATIONS_AUD + add constraint FKivwe7h7k4myq4rhuh2wkepd9j + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS + add constraint FKlmq881mxd08hthm5dy4ayjq0e + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD + add constraint FKqgkj5almojvt913heh1f4kro5 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD + add constraint FKh8vhg85li7c8yqjrg2plvkgho + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TEXTS + add constraint FKc46r2g7ry50b9e875dldjhwxp + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_TEXTS_AUD + add constraint FK82mc7uswliij43std6gwyswj3 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TEXTS_AUD + add constraint FK1s381t783dmpk0fup65mvma0w + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TYPES + add constraint FKhdbj26ubbhmht44qpin7ony29 + foreign key (OBJECT_ID) + references CCM_CMS.EVENTS; + + alter table CCM_CMS.EVENT_TYPES_AUD + add constraint FKgby7m27rnb6oeloqycyf4b1kx + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENT_TYPES_AUD + add constraint FKhcpvb5q2geclo5vxk0gt815x8 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.EVENTS + add constraint FKt56odfo39eq13gcj1bbtngoj7 + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.EVENTS_AUD + add constraint FK9gofktd490afdwak49x15w6me + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS + add constraint FKrwn3rdmqevi618fthojs0xkkq + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS + add constraint FK36xjlvslk0vlekn9lsc7x1c7a + foreign key (OBJECT_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS_AUD + add constraint FKp3jndaw4k35wb3d6hg5ng4xww + foreign key (OBJECT_ID, REV) + references CCM_CMS.BOOKMARKS_AUD; + + alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS + add constraint FK82gxr2se97dl902eu4wvhdvh3 + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS + add constraint FKps8bq22n1fxy8svnsrui3f0t2 + foreign key (OBJECT_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS_AUD + add constraint FKilxwg8ppd64hl14tojfmupau9 + foreign key (OBJECT_ID, REV) + references CCM_CMS.BOOKMARKS_AUD; + + alter table CCM_CMS.FILES + add constraint FKpg74w39tfbbuqhcy21u61q138 + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.FILES_AUD + add constraint FKdl876a4twd0gkranwqkdmxnwy + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.FOLDER_CONTENT_SECTION_MAP + add constraint FKnof2m7o4f0ufrugeh4g5wt3g9 + foreign key (CONTENT_SECTION_ID) + references CCM_CMS.CONTENT_SECTIONS; + + alter table CCM_CMS.FOLDER_CONTENT_SECTION_MAP + add constraint FKmmb7728dp707dljq282ch47k3 + foreign key (FOLDER_ID) + references CCM_CMS.FOLDERS; + + alter table CCM_CMS.FOLDERS + add constraint FK2ag06r5ywtuji2pkt68etlg48 + foreign key (OBJECT_ID) + references CCM_CORE.CATEGORIES; + + alter table CCM_CMS.IMAGES + add constraint FK51ja1101epvl74auenv6sqyev + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.IMAGES + add constraint FKmdqranhdstkn6m6d73l15amxs + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.IMAGES_AUD + add constraint FK4jsrdpe6d8is0ybx2p7sxivwf + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.LEGAL_METADATA + add constraint FKnxl7uyv1ks0qabgeienx2t9d1 + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.LEGAL_METADATA_AUD + add constraint FKpt3eqil7iij6t5h1lrnjbb5xs + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS + add constraint FKf9s3kxi6y5r60wksv5bospmx1 + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS_AUD + add constraint FKc3lonfk7mn3p14ix96k5u74om + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS_AUD + add constraint FKgxxsteesd2em96fj05f0u4men + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LEGAL_METADATA_RIGHTS + add constraint FKhsy9u7nrh3slmkkri3nba7e1 + foreign key (ASSET_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD + add constraint FKe2da3kha2nl6sj0dllhepuxtq + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD + add constraint FKr867xswbxlqq6diyqyqnrh670 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.LIFECYCLE_DEFINITION_DESCRIPTIONS + add constraint FKsdr5aoogu4b9x95m8qsbe4t0y + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_DEFINITION_LABELS + add constraint FKt4h71sl91ue18b25pdjty7jex + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_DESCRIPTIONS + add constraint FKafbeck8qm0nflpt9aedn196ou + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_LABELS + add constraint FKqysn500b0sp7bu8gy2sf2q8b9 + foreign key (OBJECT_ID) + references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS + add constraint FKq5cwomuc9s1f3fsriq9t35407 + foreign key (LIFECYCLE_DEFINITION_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYCLES + add constraint FK5yx1a2f8g4w95p1ul77sfhow8 + foreign key (DEFINITION_ID) + references CCM_CMS.LIFECYLE_DEFINITIONS; + + alter table CCM_CMS.LIFECYLE_PHASES + add constraint FKpqysexvd82e4xd4uibtdfn8j4 + foreign key (DEFINITION_ID) + references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS; + + alter table CCM_CMS.LIFECYLE_PHASES + add constraint FKlh2b1nokqxhf790lt7lhgoisc + foreign key (LIFECYCLE_ID) + references CCM_CMS.LIFECYCLES; + + alter table CCM_CMS.MPA_SECTION_TEXTS + add constraint FKaruovr4oa07syyhvkixfwc17h + foreign key (OBJECT_ID) + references CCM_CMS.MULTIPART_ARTICLE_SECTIONS; + + alter table CCM_CMS.MPA_SECTION_TEXTS_AUD + add constraint FKs4kvqroybq9ldb2rwhr6v8kmt + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SECTION_TEXTS_AUD + add constraint FKpxvtsycad805c8u0vyh7pcb2c + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SECTION_TITLES + add constraint FK7qpmrj6yjvad50k5budn5rag4 + foreign key (OBJECT_ID) + references CCM_CMS.MULTIPART_ARTICLE_SECTIONS; + + alter table CCM_CMS.MPA_SECTION_TITLES_AUD + add constraint FKk64mi5911ybptw4slxh8i0lgb + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SECTION_TITLES_AUD + add constraint FKq7f0y31r5tk2nesx0lv53d6sb + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SUMMARIES + add constraint FK5kx5ghrkh6tqa2vms2qabacx8 + foreign key (OBJECT_ID) + references CCM_CMS.MULTIPART_ARTICLES; + + alter table CCM_CMS.MPA_SUMMARIES_AUD + add constraint FKmmrabpl2gsrdb2udc76x9o6q7 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MPA_SUMMARIES_AUD + add constraint FK3kebu6i1dtwfegp4409hhob4x + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS + add constraint FK30tkd6xp4i1gg6nrse4di2yxx + foreign key (MULTIPART_ARTICLE_ID) + references CCM_CMS.MULTIPART_ARTICLES; + + alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS_AUD + add constraint FK8xq6k3a1kmnxv9nh5wae80k6k + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS_AUD + add constraint FKsudhdaa9hs73447yik8mdy3ts + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MULTIPART_ARTICLES + add constraint FKj7j0ew378cmcta2dfdso4tmey + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.MULTIPART_ARTICLES_AUD + add constraint FKacl2u1cx6tmwfb9cpaxstw39k + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.MultiPartArticle_MultiPartArticleSection_AUD + add constraint FK9vexjsvd62ufkgi4g24qiql70 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.MultiPartArticle_MultiPartArticleSection_AUD + add constraint FK4ds2fgwphr74869qkn4e2yia6 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.NEWS + add constraint FKl8jhpvtn0lx9drkhhbbuvqqis + foreign key (OBJECT_ID) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.NEWS_AUD + add constraint FK7akvtda3f51espb46xtjalcl2 + foreign key (OBJECT_ID, REV) + references CCM_CMS.CONTENT_ITEMS_AUD; + + alter table CCM_CMS.NEWS_TEXTS + add constraint FK1s5m60rf80iaidktawb3ebmf3 + foreign key (OBJECT_ID) + references CCM_CMS.NEWS; + + alter table CCM_CMS.NEWS_TEXTS_AUD + add constraint FKrand9sf233sgkgp8wfoen468l + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.NEWS_TEXTS_AUD + add constraint FKotjtrajmmjxussl4pvy2vl7ho + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.RELATED_LINKS + add constraint FKb517dnfj56oby2s34jp1omuim + foreign key (BOOKMARK_ID) + references CCM_CMS.BOOKMARKS; + + alter table CCM_CMS.RELATED_LINKS + add constraint FK7ts8tmnwxi8kry7cer3egujsv + foreign key (TARGET_ITEM) + references CCM_CMS.CONTENT_ITEMS; + + alter table CCM_CMS.RELATED_LINKS + add constraint FK35tv60a9kflo17h6xduvwvgis + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.RELATED_LINKS_AUD + add constraint FKiuwk6mcj3h5gccu2aviq3d8lt + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.SIDE_NOTE_TEXTS + add constraint FK4mvpioee23u1qswmn1fekipoh + foreign key (SIDE_NOTE_ID) + references CCM_CMS.SIDE_NOTES; + + alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD + add constraint FKiu4ht1tipeal2csdkvws4fnws + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD + add constraint FKacekagiqks1cj9otxdmryl934 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CMS.SIDE_NOTES + add constraint FKea6cikleenmkgw5bwus22mfr3 + foreign key (OBJECT_ID) + references CCM_CMS.ASSETS; + + alter table CCM_CMS.SIDE_NOTES_AUD + add constraint FKl5pkg9mp2ymc2uo4kmlubyp3m + foreign key (OBJECT_ID, REV) + references CCM_CMS.ASSETS_AUD; + + alter table CCM_CMS.VIDEO_ASSETS + add constraint FKjuywvv7wq9pyid5b6ivyrc0yk + foreign key (LEGAL_METADATA_ID) + references CCM_CMS.LEGAL_METADATA; + + alter table CCM_CMS.VIDEO_ASSETS + add constraint FKqt2cx1r31kqbqkimdld312i9g + foreign key (OBJECT_ID) + references CCM_CMS.BINARY_ASSETS; + + alter table CCM_CMS.VIDEO_ASSETS_AUD + add constraint FKdrx9uu9a03ju7vqvkjretohpk + foreign key (OBJECT_ID, REV) + references CCM_CMS.BINARY_ASSETS_AUD; + + alter table CCM_CMS.WORKFLOW_TASKS + add constraint FKoon3rwfmg0lhgbj4un4q3otya + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; + + alter table CCM_CORE.APPLICATIONS + add constraint FKatcp9ij6mbkx0nfeig1o6n3lm + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.ATTACHMENTS + add constraint FK8ju9hm9baceridp803nislkwb + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.CATEGORIES + add constraint FKrj3marx99nheur4fqanm0ylur + foreign key (PARENT_CATEGORY_ID) + references CCM_CORE.CATEGORIES; + + alter table CCM_CORE.CATEGORIES + add constraint FKpm291swli2musd0204phta652 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.CATEGORIZATIONS + add constraint FKejp0ubk034nfq60v1po6srkke + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.CATEGORIZATIONS + add constraint FKoyeipswl876wa6mqwbx0uy83h + foreign key (CATEGORY_ID) + references CCM_CORE.CATEGORIES; + + alter table CCM_CORE.CATEGORY_DESCRIPTIONS + add constraint FKhiwjlmh5vkbu3v3vng1la1qum + foreign key (OBJECT_ID) + references CCM_CORE.CATEGORIES; + + alter table CCM_CORE.CATEGORY_DOMAINS + add constraint FKf25vi73cji01w8fgo6ow1dgg + foreign key (ROOT_CATEGORY_ID) + references CCM_CORE.CATEGORIES; + + alter table CCM_CORE.CATEGORY_DOMAINS + add constraint FK58xpmnvciohkom1c16oua4xha + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.CATEGORY_TITLES + add constraint FKka9bt9f5br0kji5bcjxcmf6ch + foreign key (OBJECT_ID) + references CCM_CORE.CATEGORIES; + + alter table CCM_CORE.CCM_OBJECTS_AUD + add constraint FKr00eauutiyvocno8ckx6h9nw6 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CORE.CCM_OBJECTS_AUD + add constraint FKo5s37ctcdny7tmewjwv7705h5 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CORE.DIGESTS + add constraint FKc53g09agnye3w1v4euy3e0gsi + foreign key (FROM_PARTY_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.DIGESTS + add constraint FK845r9ep6xu6nbt1mvxulwybym + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.DOMAIN_DESCRIPTIONS + add constraint FKn4i2dxgn8cqysa62dds6eih6a + foreign key (OBJECT_ID) + references CCM_CORE.CATEGORY_DOMAINS; + + alter table CCM_CORE.DOMAIN_OWNERSHIPS + add constraint FK47nsasr7jrdwlky5gx0u6e9py + foreign key (domain_OBJECT_ID) + references CCM_CORE.CATEGORY_DOMAINS; + + alter table CCM_CORE.DOMAIN_OWNERSHIPS + add constraint FK3u4hq6yqau4m419b1xva3xpwq + foreign key (owner_OBJECT_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_CORE.DOMAIN_TITLES + add constraint FK5p526dsdwn94els6lp5w0hdn4 + foreign key (OBJECT_ID) + references CCM_CORE.CATEGORY_DOMAINS; + + alter table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS + add constraint FKfh0k9lj3pf4amfc9bbbss0tr1 + foreign key (COMPONENT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + + alter table CCM_CORE.FORMBUILDER_COMPONENTS + add constraint FKpcpmvyiix023b4g5n4q8nkfca + foreign key (parentComponent_OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + + alter table CCM_CORE.FORMBUILDER_COMPONENTS + add constraint FKt0e0uv00pp1rwhyaltrytghnm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER + add constraint FK48khrbud3xhi2gvsvnlttd8tg + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS + add constraint FKbyjjt2ufendvje2obtge2l7et + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS + add constraint FK8oriyta1957u7dvbrqk717944 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_WIDGETS; + + alter table CCM_CORE.FORMBUILDER_DATA_QUERIES + add constraint FKhhaxpeddbtmrnjr5o0fopju3a + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS + add constraint FKsmduu1opoiulkeo2gc8v7lsbn + foreign key (DATA_QUERY_ID) + references CCM_CORE.FORMBUILDER_DATA_QUERIES; + + alter table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES + add constraint FKju1x82inrw3kguyjuxoetn6gn + foreign key (DATA_QUERY_ID) + references CCM_CORE.FORMBUILDER_DATA_QUERIES; + + alter table CCM_CORE.FORMBUILDER_FORMSECTIONS + add constraint FKnfhsgxp4lvigq2pm33pn4afac + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + + alter table CCM_CORE.FORMBUILDER_LISTENERS + add constraint FK33ilyirwoux28yowafgd5xx0o + foreign key (widget_OBJECT_ID) + references CCM_CORE.FORMBUILDER_WIDGETS; + + alter table CCM_CORE.FORMBUILDER_LISTENERS + add constraint FKlqm76746nq5yrt8ganm474uu0 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.FORMBUILDER_METAOBJECTS + add constraint FKf963v6u9mw8pwjmasrw51w8dx + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.FORMBUILDER_OBJECT_TYPES + add constraint FKkv337e83rsecf0h3qy8bu7l9w + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.FORMBUILDER_OPTION_LABELS + add constraint FKatlsylsvln6yse55eof6wwkj6 + foreign key (OPTION_ID) + references CCM_CORE.FORMBUILDER_OPTIONS; + + alter table CCM_CORE.FORMBUILDER_OPTIONS + add constraint FKhe5q71wby9g4i56sotc501h11 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS + add constraint FKcv3iu04gxjk9c0pn6tl8rqqv3 + foreign key (PROCESS_LISTENER_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES + add constraint FK8rnyb1m6ij3b9hhmhr7klgd4p + foreign key (PROCESS_LISTENER_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS + add constraint FK7uiaeax8qafm82e5k729ms5ku + foreign key (formSection_OBJECT_ID) + references CCM_CORE.FORMBUILDER_FORMSECTIONS; + + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS + add constraint FKbdnloo884qk6gn36jwiqv5rlp + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER + add constraint FKpajvu9m6fj1enm67a9gcb5ii9 + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS + add constraint FKsn82ktlq0c9ikijyv8k2bfv4f + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS + add constraint FK8kjyu72btjsuaaqh4bvd8npns + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.FORMBUILDER_WIDGETS + add constraint FK1wosr4ujbfckdc50u5fgmrhrk + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + + alter table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS + add constraint FKjie9co03m7ow4ihig5rk7l8oj + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + + alter table CCM_CORE.GROUP_MEMBERSHIPS + add constraint FKq4qnny8ri3eo7eqh4olxco8nk + foreign key (GROUP_ID) + references CCM_CORE.GROUPS; + + alter table CCM_CORE.GROUP_MEMBERSHIPS + add constraint FKc8u86ivkhvoiw6ju8b2p365he + foreign key (MEMBER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.GROUPS + add constraint FK4f61mlqxw0ct6s7wwpi9m0735 + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.INITS + add constraint FK3nvvxk10nmq9nfuko8yklqdgc + foreign key (REQUIRED_BY_ID) + references CCM_CORE.INITS; + + alter table CCM_CORE.LUCENE_DOCUMENTS + add constraint FK942kl4yff8rdiwr0pjk2a9g8 + foreign key (CREATED_BY_PARTY_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.LUCENE_DOCUMENTS + add constraint FKc5rs6afx4p9fidabfqsxr5ble + foreign key (LAST_MODIFIED_BY) + references CCM_CORE.USERS; + + alter table CCM_CORE.LUCENE_INDEXES + add constraint FK6gu0yrlviqk07dtb3r02iw43f + foreign key (HOST_ID) + references CCM_CORE.HOSTS; + + alter table CCM_CORE.MESSAGES + add constraint FKph10aehmg9f20pn2w4buki97q + foreign key (IN_REPLY_TO_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.MESSAGES + add constraint FKjufsx3c3h538fj35h8hgfnb1p + foreign key (SENDER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.MESSAGES + add constraint FK6w20ao7scwecd9mfwpun2ddqx + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.NOTIFICATIONS + add constraint FKqk70c1x1dklhty9ju5t4wukd9 + foreign key (DIGEST_ID) + references CCM_CORE.DIGESTS; + + alter table CCM_CORE.NOTIFICATIONS + add constraint FKtt4fjr2p75og79jxxgd8q8mr + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.NOTIFICATIONS + add constraint FK2vlnma0ox43j0clx8ead08n5s + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.NOTIFICATIONS + add constraint FKf423hhiaw1bexpxeh1pnas7qt + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.ONE_TIME_AUTH_TOKENS + add constraint FKtplfuphkiorfkttaewb4wmfjc + foreign key (USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS + add constraint FKo696ch035fe7rrueol1po13od + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS + add constraint FKcc5d6eqxu1369k8ycyyt6vn3e + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODEL_TITLES + add constraint FKj14q9911yhd4js9p6rs21rwjf + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODELS + add constraint FKk2lihllrxj89mn3tqv43amafe + foreign key (APPLICATION_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKj9di7pawxgtouxmu2k44bj5c4 + foreign key (CREATION_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKikx3x0kn9fito23g50v6xbr9f + foreign key (GRANTEE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.PERMISSIONS + add constraint FKg56ujjoe0j30pq579rf0l5yc6 + foreign key (INHERITED_FROM_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKkamckexjnffnt8lay9nqeawhm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.PORTALS + add constraint FK5a2hdrbw03mmgr74vj5nxlpvk + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.PORTLETS + add constraint FK9gr5xjt3rx4uhtw7vl6adruol + foreign key (PORTAL_ID) + references CCM_CORE.PORTALS; + + alter table CCM_CORE.PORTLETS + add constraint FKjmx9uebt0gwxkw3xv34niy35f + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.QUEUE_ITEMS + add constraint FKtgkwfruv9kjdybf46l02da088 + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.QUEUE_ITEMS + add constraint FKs9aq1hyxstwmvx7fmfifp4x7r + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.RESOURCE_DESCRIPTIONS + add constraint FKk9arvj5u21rv23ce3cav4opqx + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCE_TITLES + add constraint FKto4p6n2wklljyf7tmuxtmyfe0 + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS + add constraint FKckpihjtv23iahbg3imnpbsr2 + foreign key (RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; + + alter table CCM_CORE.RESOURCES + add constraint FKbo7ibfgodicn9flv2gfo11g5a + foreign key (parent_OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCES + add constraint FK262fbwetpjx3k4uuvw24wsiv + foreign key (resourceType_RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; + + alter table CCM_CORE.RESOURCES + add constraint FKbjdf8pm4frth8r06ev2qjm88f + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.ROLE_DESCRIPTIONS + add constraint FKo09bh4j3k3k0ph3awvjwx31ft + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.ROLE_MEMBERSHIPS + add constraint FK9m88ywi7rcin7b7jrgh53emrq + foreign key (MEMBER_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.ROLE_MEMBERSHIPS + add constraint FKcsyogv5m2rgsrmtgnhgkjhfw7 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.SETTINGS_ENUM_VALUES + add constraint FK8mw4p92s0h3h8bmo8saowu32i + foreign key (ENUM_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.SETTINGS_L10N_STR_VALUES + add constraint FK5knjq7cisej0qfx5dw1y93rou + foreign key (ENTRY_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.SETTINGS_STRING_LIST + add constraint FKqeclqa5sf1g53vxs857tpwrus + foreign key (LIST_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.THREADS + add constraint FKsx08mpwvwnw97uwdgjs76q39g + foreign key (ROOT_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.THREADS + add constraint FKp97b1sy1kop07rtapeh5l9fb2 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.USER_EMAIL_ADDRESSES + add constraint FKr900l79erul95seyyccf04ufc + foreign key (USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.USERS + add constraint FKosh928q71aonu6l1kurb417r + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FK1pnsq9ur3ylq0ghuj23p4cogs + foreign key (LOCKING_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FK9ngp088m8xa82swy7yg3qx6vh + foreign key (NOTIFICATION_SENDER) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FKt9ha3no3bj8a50pnw8cnqh2cq + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_DESCRIPTIONS + add constraint FKgx7upkqky82dpxvbs95imfl9l + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOW_NAMES + add constraint FKkxedy9p48avfk45r0bn4uc09i + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS + add constraint FKpq4paqtfbi5erhh98wl1ja005 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS + add constraint FK3933ol31co3yn5ee75b2hmhgp + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint FKd2ymdg8nay9pmh2nn2whba0j8 + foreign key (AUTHOR_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint FKkfqrf9jdvm7livu5if06w0r5t + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES + add constraint FK1htp420ki24jaswtcum56iawe + foreign key (DEPENDENT_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES + add constraint FK8rbggnp4yjpab8quvvx800ymy + foreign key (DEPENDS_ON_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS + add constraint FKeb7mqbdx3bk7t01vo7kp2hpf + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_LABELS + add constraint FKf715qud6g9xv2xeb8rrpnv4xs + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASKS + add constraint FK1693cbc36e4d8gucg8q7sc57e + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOWS + add constraint FKrm2yfrs6veoxoy304upq2wc64 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.WORKFLOWS + add constraint FK9ray5beiny6wm2mi0uwyecay2 + foreign key (TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; \ No newline at end of file diff --git a/ccm-core/src/main/java/org/libreccm/workflow/AbstractWorkflowException.java b/ccm-core/src/main/java/org/libreccm/workflow/AbstractWorkflowException.java new file mode 100644 index 000000000..6dd0405d6 --- /dev/null +++ b/ccm-core/src/main/java/org/libreccm/workflow/AbstractWorkflowException.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2017 LibreCCM Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +package org.libreccm.workflow; + +/** + * + * @author Jens Pelzetter + */ +public class AbstractWorkflowException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance of AbstractWorkflowException without detail message. + */ + public AbstractWorkflowException() { + super(); + } + + + /** + * Constructs an instance of AbstractWorkflowException with the specified detail message. + * + * @param msg The detail message. + */ + public AbstractWorkflowException(final String msg) { + super(msg); + } + + /** + * Constructs an instance of AbstractWorkflowException which wraps the + * specified exception. + * + * @param exception The exception to wrap. + */ + public AbstractWorkflowException(final Exception exception) { + super(exception); + } + + /** + * Constructs an instance of AbstractWorkflowException with the specified message which also wraps the + * specified exception. + * + * @param msg The detail message. + * @param exception The exception to wrap. + */ + public AbstractWorkflowException(final String msg, final Exception exception) { + super(msg, exception); + } +} diff --git a/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java b/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java index b3477b209..a1abaedd9 100644 --- a/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java +++ b/ccm-core/src/main/java/org/libreccm/workflow/Workflow.java @@ -29,6 +29,7 @@ import org.libreccm.portation.Portable; import javax.persistence.*; import javax.validation.constraints.NotNull; + import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; @@ -37,6 +38,8 @@ import java.util.Objects; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import java.util.Locale; + /** * A workflow is a collection of tasks which are performed on an object. Tasks * can depend on each other. @@ -78,13 +81,18 @@ public class Workflow implements Identifiable, Serializable, Portable { @NotNull private String uuid; + /** + * Indicates that this {@code Workflow} can be assigned to an object. + */ + @Column(name = "abstract_workflow") + private boolean abstractWorkflow; + /** * The template which was used to generate the workflow. */ @ManyToOne @JoinColumn(name = "TEMPLATE_ID") - @JsonIdentityReference(alwaysAsId = true) - private WorkflowTemplate template; + private Workflow template; /** * Human readable name of the workflow. @@ -173,11 +181,19 @@ public class Workflow implements Identifiable, Serializable, Portable { this.uuid = uuid; } - public WorkflowTemplate getTemplate() { + public boolean isAbstractWorkflow() { + return abstractWorkflow; + } + + public void setAbstractWorkflow(boolean abstractWorkflow) { + this.abstractWorkflow = abstractWorkflow; + } + + public Workflow getTemplate() { return template; } - protected void setTemplate(final WorkflowTemplate template) { + protected void setTemplate(final Workflow template) { this.template = template; } @@ -228,6 +244,11 @@ public class Workflow implements Identifiable, Serializable, Portable { } protected void setObject(final CcmObject object) { + if (abstractWorkflow) { + throw new AbstractWorkflowException(String.format( + "Workflow %s is abstrct and can not assigned to an object.", + uuid)); + } this.object = object; } @@ -257,6 +278,7 @@ public class Workflow implements Identifiable, Serializable, Portable { hash = 79 * hash + (int) (workflowId ^ (workflowId >>> 32)); hash = 79 * hash + Objects.hashCode(uuid); hash = 79 * hash + Objects.hashCode(name); + hash = 79 * hash + (abstractWorkflow ? 1 : 0); hash = 79 * hash + Objects.hashCode(description); hash = 79 * hash + Objects.hashCode(state); hash = 79 * hash + (active ? 1 : 0); @@ -289,6 +311,10 @@ public class Workflow implements Identifiable, Serializable, Portable { return false; } + if (abstractWorkflow != other.isAbstractWorkflow()) { + return false; + } + if (!Objects.equals(description, other.getDescription())) { return false; } @@ -319,6 +345,7 @@ public class Workflow implements Identifiable, Serializable, Portable { + "uuid = \"%s\", " + "name = \"%s\", " + "description = \"%s\", " + + "abstractWorkflow = %b, " + "state = \"%s\", " + "active = %b%s" + " }", @@ -327,6 +354,7 @@ public class Workflow implements Identifiable, Serializable, Portable { uuid, Objects.toString(name), Objects.toString(description), + abstractWorkflow, Objects.toString(state), active, data); diff --git a/ccm-core/src/main/java/org/libreccm/workflow/WorkflowManager.java b/ccm-core/src/main/java/org/libreccm/workflow/WorkflowManager.java index 7635f3f53..c84e3e606 100644 --- a/ccm-core/src/main/java/org/libreccm/workflow/WorkflowManager.java +++ b/ccm-core/src/main/java/org/libreccm/workflow/WorkflowManager.java @@ -19,6 +19,7 @@ package org.libreccm.workflow; import com.arsdigita.kernel.KernelConfig; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.shiro.subject.Subject; @@ -37,13 +38,22 @@ import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.TypedQuery; import javax.transaction.Transactional; + import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.*; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + /** * Manager for {@link Workflow}s. The logic of some of these classes has been @@ -109,18 +119,18 @@ public class WorkflowManager { @AuthorizationRequired @RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN) @Transactional(Transactional.TxType.REQUIRED) - public Workflow createWorkflow(final WorkflowTemplate template, + public Workflow createWorkflow(final Workflow template, final CcmObject object) { - if (template == null) { + Objects.requireNonNull(template, + "Can't create a workflow without a template."); + if (!template.isAbstractWorkflow()) { throw new IllegalArgumentException( - "Can't create a workflow without a template."); - } - - if (object == null) { - throw new IllegalArgumentException( - "Can't create a workflow without an object."); + "The provided template is not an abstract workflow"); } + Objects.requireNonNull(object, + "Can't create a workflow without an object."); + final Workflow workflow = new Workflow(); final LocalizedString name = new LocalizedString(); @@ -219,8 +229,8 @@ public class WorkflowManager { writeMethod.invoke(task, value); } } catch (IllegalAccessException - | IllegalArgumentException - | InvocationTargetException ex) { + | IllegalArgumentException + | InvocationTargetException ex) { throw new RuntimeException(); } } diff --git a/ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplate.java b/ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplate.java deleted file mode 100644 index cf905a8ee..000000000 --- a/ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplate.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2016 LibreCCM Foundation. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -package org.libreccm.workflow; - -import com.fasterxml.jackson.annotation.JsonIdentityInfo; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; -import org.libreccm.core.CcmObject; -import org.libreccm.portation.Portable; -import org.libreccm.security.GroupIdResolver; - -import javax.persistence.Entity; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import java.io.Serializable; - -import static org.libreccm.core.CoreConstants.DB_SCHEMA; - -/** - * Objects of these class are used as templates for new workflows. The tasks - * in the template are copied when a new workflow is generated. - * - * @author Jens Pelzetter - */ -@Entity -@Table(name = "WORKFLOW_TEMPLATES", schema = DB_SCHEMA) -@NamedQueries({ - @NamedQuery( - name = "WorkflowTemplate.findByUuid", - query = "SELECT t FROM WorkflowTemplate t " + - "WHERE t.uuid = :uuid") -}) -@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, - resolver = WorkflowTemplateIdResolver.class, - property = "uuid") -public class WorkflowTemplate extends Workflow implements Serializable, - Portable { - - private static final long serialVersionUID = 5770519379144947171L; - - /** - * A workflow template has no object. Therefore the {@code setObject - * (CcmObject)} method has been overwritten to throw an - * {@link UnsupportedOperationException} when called on the workflow - * template. - * - * @param object - */ - @Override - protected void setObject(final CcmObject object) { - //throw new UnsupportedOperationException( - // "A WorkflowTemplate has no object."); - } - - @Override - public int hashCode() { - return super.hashCode(); - } - - @Override - public boolean equals(final Object obj) { - if (obj == null) { - return false; - } - - if (!super.equals(obj)) { - return false; - } - - if (!(obj instanceof WorkflowTemplate)) { - return false; - } - final WorkflowTemplate other = (WorkflowTemplate) obj; - return other.canEqual(obj); - } - - @Override - public boolean canEqual(final Object obj) { - return obj instanceof WorkflowTemplate; - } - -} diff --git a/ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplateIdResolver.java b/ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplateIdResolver.java deleted file mode 100644 index 3c95223ac..000000000 --- a/ccm-core/src/main/java/org/libreccm/workflow/WorkflowTemplateIdResolver.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2015 LibreCCM Foundation. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -package org.libreccm.workflow; - -import com.fasterxml.jackson.annotation.ObjectIdGenerator; -import com.fasterxml.jackson.annotation.ObjectIdResolver; -import org.libreccm.cdi.utils.CdiUtil; - -import javax.enterprise.context.RequestScoped; - -/** - * @author Jens Pelzetter - */ -@RequestScoped -public class WorkflowTemplateRepository - extends AbstractEntityRepository { - - @Override - public Class getEntityClass() { - return WorkflowTemplate.class; - } - - @Override - public boolean isNew(final WorkflowTemplate template) { - return template.getWorkflowId() == 0; - } - - @Override - public void initNewEntity(final WorkflowTemplate workflowTemplate) { - super.initNewEntity(workflowTemplate); - workflowTemplate.setUuid(UUID.randomUUID().toString()); - } - - /** - * Find a {@link WorkflowTemplate} by its UUID. - * - * @param uuid The UUID of the {@link WorkflowTemplate} to find. - * - * @return An {@link Optional} containing the {@link WorkflowTemplate} - * identified by the provided UUID. - */ - public Optional findByUuid(final String uuid) { - if (uuid == null || uuid.trim().isEmpty()) { - throw new IllegalArgumentException( - "The UUID of the WorkflowTemplate to retrieve can't be " + - "null or empty."); - } - - final TypedQuery query = getEntityManager() - .createNamedQuery("WorkflowTemplate.findByUuid", - WorkflowTemplate.class); - query.setParameter("uuid", uuid); - - try { - return Optional.of(query.getSingleResult()); - } catch(NoResultException ex) { - return Optional.empty(); - } - } -} diff --git a/ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/h2/V7_0_0_14__abstract_workflow.sql b/ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/h2/V7_0_0_14__abstract_workflow.sql new file mode 100644 index 000000000..77b87465a --- /dev/null +++ b/ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/h2/V7_0_0_14__abstract_workflow.sql @@ -0,0 +1,13 @@ +alter table CCM_CORE.WORKFLOWS add column ABSTRACT_WORKFLOW boolean; + +update CCM_CORE.WORKFLOWS set ABSTRACT_WORKFLOW = true +where WORKFLOW_ID in (select WORKFLOW_ID from CCM_CORE.WORKFLOW_TEMPLATES); + +alter table CCM_CORE.WORKFLOW_TEMPLATES +drop constraint if exists FK8692vdme4yxnkj1m0k1dw74pk; + +alter table CCM_CORE.WORKFLOWS +drop constraint if exists FKeixdxau4jebw682gd49tdbsjy; + +drop table CCM_CORE.WORKFLOW_TEMPLATES cascade; + diff --git a/ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_14__abstract_workflow.sql b/ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_14__abstract_workflow.sql new file mode 100644 index 000000000..77b87465a --- /dev/null +++ b/ccm-core/src/main/resources/db/migrations/org/libreccm/ccm_core/pgsql/V7_0_0_14__abstract_workflow.sql @@ -0,0 +1,13 @@ +alter table CCM_CORE.WORKFLOWS add column ABSTRACT_WORKFLOW boolean; + +update CCM_CORE.WORKFLOWS set ABSTRACT_WORKFLOW = true +where WORKFLOW_ID in (select WORKFLOW_ID from CCM_CORE.WORKFLOW_TEMPLATES); + +alter table CCM_CORE.WORKFLOW_TEMPLATES +drop constraint if exists FK8692vdme4yxnkj1m0k1dw74pk; + +alter table CCM_CORE.WORKFLOWS +drop constraint if exists FKeixdxau4jebw682gd49tdbsjy; + +drop table CCM_CORE.WORKFLOW_TEMPLATES cascade; + diff --git a/ccm-core/src/test/java/org/libreccm/portation/CoreDataImportTest.java b/ccm-core/src/test/java/org/libreccm/portation/CoreDataImportTest.java index caef187a8..0d5d434bc 100644 --- a/ccm-core/src/test/java/org/libreccm/portation/CoreDataImportTest.java +++ b/ccm-core/src/test/java/org/libreccm/portation/CoreDataImportTest.java @@ -144,7 +144,7 @@ public class CoreDataImportTest { Assert.assertFalse(importHelper.importPermissions()); - Assert.assertFalse(importHelper.importWorkflowTemplates()); +// Assert.assertFalse(importHelper.importWorkflowTemplates()); Assert.assertFalse(importHelper.importWorkflows()); Assert.assertFalse(importHelper.importTaskComments()); //Assert.assertFalse(importHelper.importAssignableTasks()); diff --git a/ccm-core/src/test/java/org/libreccm/portation/ImportHelper.java b/ccm-core/src/test/java/org/libreccm/portation/ImportHelper.java index 1a3ac087a..31ee66681 100644 --- a/ccm-core/src/test/java/org/libreccm/portation/ImportHelper.java +++ b/ccm-core/src/test/java/org/libreccm/portation/ImportHelper.java @@ -79,13 +79,6 @@ class ImportHelper { @Marshals(DomainOwnership.class) private DomainOwnershipMarshaller domainOwnershipMarshaller; - @Inject - @Marshals(Permission.class) - private PermissionMarshaller permissionMarshaller; - - @Inject - @Marshals(WorkflowTemplate.class) - private WorkflowTemplateMarshaller workflowTemplateMarshaller; @Inject @Marshals(Workflow.class) private WorkflowMarshaller workflowMarshaller; @@ -209,14 +202,6 @@ class ImportHelper { return permissionMarshaller.importFile(); } - boolean importWorkflowTemplates() { - workflowTemplateMarshaller.prepare( - Format.XML, - repoPath + projectPath, - "workflowTemplates.xml", - indentation); - return workflowTemplateMarshaller.importFile(); - } boolean importWorkflows() { workflowMarshaller.prepare( diff --git a/ccm-core/src/test/java/org/libreccm/security/PermissionManagerTest.java b/ccm-core/src/test/java/org/libreccm/security/PermissionManagerTest.java index ff4e2f78f..6295493af 100644 --- a/ccm-core/src/test/java/org/libreccm/security/PermissionManagerTest.java +++ b/ccm-core/src/test/java/org/libreccm/security/PermissionManagerTest.java @@ -109,36 +109,36 @@ public class PermissionManagerTest { @Deployment public static WebArchive createDeployment() { return ShrinkWrap - .create(WebArchive.class, - "LibreCCM-org.libreccm.security.PermissionManagerTest.war"). - addPackage(org.libreccm.categorization.Categorization.class - .getPackage()) - .addPackage(org.libreccm.configuration.Configuration.class - .getPackage()) - .addPackage(org.libreccm.core.CcmObject.class.getPackage()) - .addPackage(org.libreccm.jpa.EntityManagerProducer.class - .getPackage()) - .addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class - .getPackage()) - .addPackage(org.libreccm.l10n.LocalizedString.class.getPackage()). - addPackage(org.libreccm.security.User.class.getPackage()) - .addPackage(org.libreccm.tests.categories.IntegrationTest.class - .getPackage()) - .addPackage(org.libreccm.testutils.EqualsVerifier.class - .getPackage()) - .addPackage(org.libreccm.web.CcmApplication.class.getPackage()) - .addPackage(org.libreccm.workflow.Workflow.class.getPackage()) - .addPackage(com.arsdigita.kernel.KernelConfig.class.getPackage()). - addPackage(com.arsdigita.kernel.security.SecurityConfig.class - .getPackage()) - .addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage()) - .addClass(org.libreccm.portation.Portable.class) - .addAsLibraries(getModuleDependencies()) - .addAsResource("test-persistence.xml", - "META-INF/persistence.xml") - .addAsResource("configs/shiro.ini", "shiro.ini") - .addAsWebInfResource("test-web.xml", "web.xml") - .addAsWebInfResource("META-INF/beans.xml", "beans.xml"); + .create(WebArchive.class, + "LibreCCM-org.libreccm.security.PermissionManagerTest.war"). + addPackage(org.libreccm.categorization.Categorization.class + .getPackage()) + .addPackage(org.libreccm.configuration.Configuration.class + .getPackage()) + .addPackage(org.libreccm.core.CcmObject.class.getPackage()) + .addPackage(org.libreccm.jpa.EntityManagerProducer.class + .getPackage()) + .addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class + .getPackage()) + .addPackage(org.libreccm.l10n.LocalizedString.class.getPackage()). + addPackage(org.libreccm.security.User.class.getPackage()) + .addPackage(org.libreccm.tests.categories.IntegrationTest.class + .getPackage()) + .addPackage(org.libreccm.testutils.EqualsVerifier.class + .getPackage()) + .addPackage(org.libreccm.web.CcmApplication.class.getPackage()) + .addPackage(org.libreccm.workflow.Workflow.class.getPackage()) + .addPackage(com.arsdigita.kernel.KernelConfig.class.getPackage()). + addPackage(com.arsdigita.kernel.security.SecurityConfig.class + .getPackage()) + .addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage()) + .addClass(org.libreccm.portation.Portable.class) + .addAsLibraries(getModuleDependencies()) + .addAsResource("test-persistence.xml", + "META-INF/persistence.xml") + .addAsResource("configs/shiro.ini", "shiro.ini") + .addAsWebInfResource("test-web.xml", "web.xml") + .addAsWebInfResource("META-INF/beans.xml", "beans.xml"); } /** @@ -177,11 +177,11 @@ public class PermissionManagerTest { */ @Test @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "after-grant.yml", - excludeColumns = {"permission_id"}) + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "after-grant.yml", + excludeColumns = {"permission_id"}) @InSequence(200) public void grantPermission() { final Role role2 = roleRepository.findByName("role2").get(); @@ -202,10 +202,10 @@ public class PermissionManagerTest { */ @Test @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "data.yml") + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "data.yml") @InSequence(210) public void grantPermissionAgain() { final Role role1 = roleRepository.findByName("role1").get(); @@ -224,11 +224,11 @@ public class PermissionManagerTest { */ @Test @UsingDataSet("datasets/org/libreccm/security/PermissionManagerTest/" - + "data-recursivly.yml") + + "data-recursivly.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "after-grant-recursivly.yml", - excludeColumns = {"permission_id"}) + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "after-grant-recursivly.yml", + excludeColumns = {"permission_id"}) @InSequence(211) public void grantPermissionRecursively() { final Role role1 = roleRepository.findByName("role1").get(); @@ -249,7 +249,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(220) public void grantPermissionPrivilegeNull() throws Throwable { @@ -257,7 +257,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.grantPrivilege(null, role1)); + () -> permissionManager.grantPrivilege(null, role1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -273,7 +273,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(225) public void grantPermissionOnObjectPrivilegeNull() throws Throwable { @@ -282,7 +282,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.grantPrivilege(null, role1, object1)); + () -> permissionManager.grantPrivilege(null, role1, object1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -298,7 +298,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(230) public void grantPermissionEmptyPrivilege() throws Throwable { @@ -306,7 +306,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.grantPrivilege("", role1)); + () -> permissionManager.grantPrivilege("", role1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -322,7 +322,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(235) public void grantPermissionOnObjectEmptyPrivilege() throws Throwable { @@ -331,7 +331,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.grantPrivilege("", role1, object1)); + () -> permissionManager.grantPrivilege("", role1, object1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -347,13 +347,13 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(240) public void grantPermissionToRoleNull() throws Throwable { try { shiro.getSystemUser().execute( - () -> permissionManager.grantPrivilege("privilege", null)); + () -> permissionManager.grantPrivilege("privilege", null)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -369,7 +369,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(240) public void grantPermissionOnObjectToRoleNull() throws Throwable { @@ -377,9 +377,9 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.grantPrivilege("privilege", - null, - object1)); + () -> permissionManager.grantPrivilege("privilege", + null, + object1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -395,7 +395,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(250) public void grantPermissionNullObject() throws Throwable { @@ -403,9 +403,9 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.grantPrivilege("privilege1", - role1, - null)); + () -> permissionManager.grantPrivilege("privilege1", + role1, + null)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -420,11 +420,11 @@ public class PermissionManagerTest { */ @Test @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "after-revoke.yml", - excludeColumns = {"permission_id"}) + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "after-revoke.yml", + excludeColumns = {"permission_id"}) @InSequence(300) public void revokePermission() { final Role role1 = roleRepository.findByName("role1").get(); @@ -446,16 +446,16 @@ public class PermissionManagerTest { */ @Test @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "data.yml") + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "data.yml") @InSequence(310) public void revokeNotExistingPermission() throws Throwable { final Role role1 = roleRepository.findByName("role1").get(); shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege("privilege999", role1)); + () -> permissionManager.revokePrivilege("privilege999", role1)); } /** @@ -464,10 +464,10 @@ public class PermissionManagerTest { */ @Test @UsingDataSet("datasets/org/libreccm/security/PermissionManagerTest/" - + "after-grant-recursivly.yml") + + "after-grant-recursivly.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "after-revoke-recursivly.yml") + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "after-revoke-recursivly.yml") @InSequence(311) public void revokePermissionRecursivly() { final Role role1 = roleRepository.findByName("role1").get(); @@ -487,19 +487,19 @@ public class PermissionManagerTest { */ @Test @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "data.yml") + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "data.yml") @InSequence(310) public void revokeNotExistingPermissionOnObject() { final Role role1 = roleRepository.findByName("role1").get(); final CcmObject object1 = ccmObjectRepository.findById(-20001L).get(); shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege("privilege999", - role1, - object1)); + () -> permissionManager.revokePrivilege("privilege999", + role1, + object1)); } /** @@ -512,7 +512,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(320) public void revokePermissionPrivilegeNull() throws Throwable { @@ -520,7 +520,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege(null, role1)); + () -> permissionManager.revokePrivilege(null, role1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -536,7 +536,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(320) public void revokePermissionOnObjectPrivilegeNull() throws Throwable { @@ -545,8 +545,8 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager. - revokePrivilege(null, role1, object1)); + () -> permissionManager. + revokePrivilege(null, role1, object1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -562,7 +562,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(330) public void revokePermissionEmptyPrivilege() throws Throwable { @@ -570,7 +570,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege("", role1)); + () -> permissionManager.revokePrivilege("", role1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -579,15 +579,14 @@ public class PermissionManagerTest { /** * Verifies that * {@link PermissionManager#revokePrivilege(java.lang.String, org.libreccm.security.Role, org.libreccm.core.CcmObject)} - * throws an {@link IllegalArgumentException} if called with {@code null} - * for the privilege to revoke. + * throws an {@link NullPointerException} if called with {@code null} for + * the privilege to revoke. * * @throws Throwable */ - @Test(expected - = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(320) public void revokePermissionOnObjectEmptyPrivilege() throws Throwable { @@ -596,7 +595,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege("", role1, object1)); + () -> permissionManager.revokePrivilege("", role1, object1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -605,21 +604,20 @@ public class PermissionManagerTest { /** * Verifies that * {@link PermissionManager#revokePrivilege(java.lang.String, org.libreccm.security.Role)} - * throws an {@link IllegalArgumentException} if called with {@code null} - * for the role to revoke the permission from. + * throws an {@link NullPointerException} if called with {@code null} for + * the role to revoke the permission from. * * @throws Throwable */ - @Test(expected - = IllegalArgumentException.class) - @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + @Test(expected = IllegalArgumentException.class) + @UsingDataSet("datasets/org/libreccm/security/PermissionManagerTest/" + + "data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(340) public void revokePermissionFromRoleNull() throws Throwable { try { shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege("privilege1", null)); + () -> permissionManager.revokePrivilege("privilege1", null)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -628,24 +626,24 @@ public class PermissionManagerTest { /** * Verifies that * {@link PermissionManager#revokePrivilege(java.lang.String, org.libreccm.security.Role, org.libreccm.core.CcmObject)} - * throws an {@link IllegalArgumentException} if called with {@code null} - * for the role to revoke the permission from. + * throws an {@link NullPointerException} if called with {@code null} for + * the role to revoke the permission from. * * @throws Throwable */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = NullPointerException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") - @ShouldThrowException(IllegalArgumentException.class) + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + @ShouldThrowException(NullPointerException.class) @InSequence(345) public void revokePermissionOnObjectFromRoleNull() throws Throwable { final CcmObject object1 = ccmObjectRepository.findById(-20001L).get(); try { shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege("privilege1", - null, - object1)); + () -> permissionManager.revokePrivilege("privilege1", + null, + object1)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -659,19 +657,19 @@ public class PermissionManagerTest { * * @throws Throwable */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = NullPointerException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") - @ShouldThrowException(IllegalArgumentException.class) + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + @ShouldThrowException(NullPointerException.class) @InSequence(350) public void revokePermissionNullObject() throws Throwable { final Role role1 = roleRepository.findByName("role1").get(); try { shiro.getSystemUser().execute( - () -> permissionManager.revokePrivilege("privilege2", - role1, - null)); + () -> permissionManager.revokePrivilege("privilege2", + role1, + null)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -686,18 +684,18 @@ public class PermissionManagerTest { */ @Test @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldMatchDataSet( - value = "datasets/org/libreccm/security/PermissionManagerTest/" - + "after-copy.yml", - excludeColumns = {"permission_id"}) + value = "datasets/org/libreccm/security/PermissionManagerTest/" + + "after-copy.yml", + excludeColumns = {"permission_id"}) @InSequence(400) public void copyPermissions() throws Throwable { final CcmObject object2 = ccmObjectRepository.findById(-20002L).get(); final CcmObject object3 = ccmObjectRepository.findById(-20003L).get(); shiro.getSystemUser().execute( - () -> permissionManager.copyPermissions(object2, object3)); + () -> permissionManager.copyPermissions(object2, object3)); } /** @@ -710,7 +708,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(410) public void copyPermissionsNullSource() throws Throwable { @@ -718,7 +716,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.copyPermissions(null, object3)); + () -> permissionManager.copyPermissions(null, object3)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -734,7 +732,7 @@ public class PermissionManagerTest { */ @Test(expected = IllegalArgumentException.class) @UsingDataSet( - "datasets/org/libreccm/security/PermissionManagerTest/data.yml") + "datasets/org/libreccm/security/PermissionManagerTest/data.yml") @ShouldThrowException(IllegalArgumentException.class) @InSequence(420) public void copyPermissionsNullTarget() throws Throwable { @@ -742,7 +740,7 @@ public class PermissionManagerTest { try { shiro.getSystemUser().execute( - () -> permissionManager.copyPermissions(object2, null)); + () -> permissionManager.copyPermissions(object2, null)); } catch (ExecutionException ex) { throw ex.getCause(); } @@ -758,9 +756,9 @@ public class PermissionManagerTest { public void verifyListPrivileges() { final List corePrivileges = permissionManager - .listDefiniedPrivileges(CoreConstants.class); + .listDefiniedPrivileges(CoreConstants.class); final List catPrivileges = permissionManager - .listDefiniedPrivileges(CategorizationConstants.class); + .listDefiniedPrivileges(CategorizationConstants.class); assertThat(corePrivileges, is(not(nullValue()))); assertThat(corePrivileges.isEmpty(), is(false)); diff --git a/ccm-core/src/test/java/org/libreccm/workflow/EqualsAndHashCodeTest.java b/ccm-core/src/test/java/org/libreccm/workflow/EqualsAndHashCodeTest.java index 658f4f1bf..068304a4f 100644 --- a/ccm-core/src/test/java/org/libreccm/workflow/EqualsAndHashCodeTest.java +++ b/ccm-core/src/test/java/org/libreccm/workflow/EqualsAndHashCodeTest.java @@ -47,8 +47,7 @@ public class EqualsAndHashCodeTest extends EqualsVerifier { TaskComment.class, TaskAssignment.class, AssignableTask.class, - Workflow.class, - WorkflowTemplate.class + Workflow.class }); } @@ -97,12 +96,6 @@ public class EqualsAndHashCodeTest extends EqualsVerifier { final Workflow workflow2 = new Workflow(); workflow2.getName().addValue(Locale.ENGLISH, "Workflow 2"); - - final WorkflowTemplate template1 = new WorkflowTemplate(); - template1.getName().addValue(Locale.ENGLISH, "Template 1"); - - final WorkflowTemplate template2 = new WorkflowTemplate(); - template1.getName().addValue(Locale.ENGLISH, "Template 2"); final CcmObject object1 = new CcmObject(); object1.setDisplayName("Object 1"); @@ -117,7 +110,6 @@ public class EqualsAndHashCodeTest extends EqualsVerifier { .withPrefabValues(Group.class, group1, group2) .withPrefabValues(User.class, user1, user2) .withPrefabValues(Workflow.class, workflow1, workflow2) - .withPrefabValues(WorkflowTemplate.class, template1, template2) .withPrefabValues(CcmObject.class, object1, object2); } diff --git a/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_core_schema.sql b/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_core_schema.sql index 95f8fc561..5a0d4b856 100644 --- a/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_core_schema.sql +++ b/ccm-core/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_core_schema.sql @@ -46,7 +46,7 @@ create schema CCM_CORE; create table CCM_CORE.CATEGORY_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -63,7 +63,7 @@ create schema CCM_CORE; create table CCM_CORE.CATEGORY_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -111,7 +111,7 @@ create schema CCM_CORE; create table CCM_CORE.DOMAIN_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -128,14 +128,14 @@ create schema CCM_CORE; create table CCM_CORE.DOMAIN_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( COMPONENT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (COMPONENT_ID, LOCALE) ); @@ -180,14 +180,14 @@ create schema CCM_CORE; create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); @@ -224,7 +224,7 @@ create schema CCM_CORE; create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( OPTION_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OPTION_ID, LOCALE) ); @@ -237,14 +237,14 @@ create schema CCM_CORE; create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); @@ -403,14 +403,14 @@ create schema CCM_CORE; create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PAGE_MODEL_ID, LOCALE) ); create table CCM_CORE.PAGE_MODEL_TITLES ( PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PAGE_MODEL_ID, LOCALE) ); @@ -436,7 +436,7 @@ create schema CCM_CORE; PERMISSION_ID bigint not null, CREATION_DATE timestamp, CREATION_IP varchar(255), - granted_privilege varchar(255), + GRANTED_PRIVILEGE varchar(255), INHERITED boolean, CREATION_USER_ID bigint, GRANTEE_ID bigint, @@ -473,21 +473,21 @@ create schema CCM_CORE; create table CCM_CORE.RESOURCE_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( RESOURCE_TYPE_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (RESOURCE_TYPE_ID, LOCALE) ); @@ -512,7 +512,7 @@ create schema CCM_CORE; create table CCM_CORE.ROLE_DESCRIPTIONS ( ROLE_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ROLE_ID, LOCALE) ); @@ -529,11 +529,11 @@ create schema CCM_CORE; SETTING_ID bigint not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, - SETTING_VALUE_BIG_DECIMAL decimal(19,2), SETTING_VALUE_BOOLEAN boolean, - SETTING_VALUE_STRING varchar(1024), - SETTING_VALUE_DOUBLE double, + SETTING_VALUE_BIG_DECIMAL decimal(19,2), SETTING_VALUE_LONG bigint, + SETTING_VALUE_DOUBLE double, + SETTING_VALUE_STRING varchar(1024), primary key (SETTING_ID) ); @@ -544,7 +544,7 @@ create schema CCM_CORE; create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( ENTRY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ENTRY_ID, LOCALE) ); @@ -593,14 +593,14 @@ create schema CCM_CORE; create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_NAMES ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); @@ -614,7 +614,7 @@ create schema CCM_CORE; create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( COMMENT_ID bigint not null, - COMMENT longvarchar, + COMMENT varchar(2147483647), UUID varchar(255) not null, AUTHOR_ID bigint, TASK_ID bigint, @@ -628,14 +628,14 @@ create schema CCM_CORE; create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( TASK_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_TASK_LABELS ( TASK_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); @@ -649,13 +649,9 @@ create schema CCM_CORE; primary key (TASK_ID) ); - create table CCM_CORE.WORKFLOW_TEMPLATES ( - WORKFLOW_ID bigint not null, - primary key (WORKFLOW_ID) - ); - create table CCM_CORE.WORKFLOWS ( WORKFLOW_ID bigint not null, + abstract_workflow boolean, ACTIVE boolean, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), @@ -691,7 +687,8 @@ create schema CCM_CORE; alter table CCM_CORE.WORKFLOWS add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); -create sequence hibernate_sequence start with 1 increment by 1; + + create sequence hibernate_sequence start with 1 increment by 1; alter table CCM_CORE.APPLICATIONS add constraint FKatcp9ij6mbkx0nfeig1o6n3lm @@ -1014,7 +1011,7 @@ create sequence hibernate_sequence start with 1 increment by 1; references CCM_CORE.CCM_ROLES; alter table CCM_CORE.PERMISSIONS - add constraint FKc1x3h1p3o20qiwmonpmva7t5i + add constraint FKg56ujjoe0j30pq579rf0l5yc6 foreign key (INHERITED_FROM_ID) references CCM_CORE.CCM_OBJECTS; @@ -1198,17 +1195,12 @@ create sequence hibernate_sequence start with 1 increment by 1; foreign key (WORKFLOW_ID) references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOW_TEMPLATES - add constraint FK8692vdme4yxnkj1m0k1dw74pk - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOWS add constraint FKrm2yfrs6veoxoy304upq2wc64 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.WORKFLOWS - add constraint FKeixdxau4jebw682gd49tdbsjy + add constraint FK9ray5beiny6wm2mi0uwyecay2 foreign key (TEMPLATE_ID) - references CCM_CORE.WORKFLOW_TEMPLATES; + references CCM_CORE.WORKFLOWS; \ No newline at end of file diff --git a/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_core_schema.sql b/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_core_schema.sql index 4d8e35856..67041e43b 100644 --- a/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_core_schema.sql +++ b/ccm-core/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_core_schema.sql @@ -2,7 +2,7 @@ drop schema if exists CCM_CORE cascade; drop sequence if exists HIBERNATE_SEQUENCE; -create schema CCM_CORE; + create schema CCM_CORE; create table CCM_CORE.APPLICATIONS ( APPLICATION_TYPE varchar(1024) not null, @@ -436,7 +436,7 @@ create schema CCM_CORE; PERMISSION_ID int8 not null, CREATION_DATE timestamp, CREATION_IP varchar(255), - granted_privilege varchar(255), + GRANTED_PRIVILEGE varchar(255), INHERITED boolean, CREATION_USER_ID int8, GRANTEE_ID int8, @@ -529,11 +529,11 @@ create schema CCM_CORE; SETTING_ID int8 not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, - SETTING_VALUE_BIG_DECIMAL numeric(19, 2), SETTING_VALUE_BOOLEAN boolean, - SETTING_VALUE_STRING varchar(1024), - SETTING_VALUE_DOUBLE float8, + SETTING_VALUE_BIG_DECIMAL numeric(19, 2), SETTING_VALUE_LONG int8, + SETTING_VALUE_DOUBLE float8, + SETTING_VALUE_STRING varchar(1024), primary key (SETTING_ID) ); @@ -649,13 +649,9 @@ create schema CCM_CORE; primary key (TASK_ID) ); - create table CCM_CORE.WORKFLOW_TEMPLATES ( - WORKFLOW_ID int8 not null, - primary key (WORKFLOW_ID) - ); - create table CCM_CORE.WORKFLOWS ( WORKFLOW_ID int8 not null, + abstract_workflow boolean, ACTIVE boolean, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), @@ -691,7 +687,8 @@ create schema CCM_CORE; alter table CCM_CORE.WORKFLOWS add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); -create sequence hibernate_sequence start 1 increment 1; + + create sequence hibernate_sequence start 1 increment 1; alter table CCM_CORE.APPLICATIONS add constraint FKatcp9ij6mbkx0nfeig1o6n3lm @@ -1014,7 +1011,7 @@ create sequence hibernate_sequence start 1 increment 1; references CCM_CORE.CCM_ROLES; alter table CCM_CORE.PERMISSIONS - add constraint FKc1x3h1p3o20qiwmonpmva7t5i + add constraint FKg56ujjoe0j30pq579rf0l5yc6 foreign key (INHERITED_FROM_ID) references CCM_CORE.CCM_OBJECTS; @@ -1198,17 +1195,12 @@ create sequence hibernate_sequence start 1 increment 1; foreign key (WORKFLOW_ID) references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOW_TEMPLATES - add constraint FK8692vdme4yxnkj1m0k1dw74pk - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOWS add constraint FKrm2yfrs6veoxoy304upq2wc64 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.WORKFLOWS - add constraint FKeixdxau4jebw682gd49tdbsjy + add constraint FK9ray5beiny6wm2mi0uwyecay2 foreign key (TEMPLATE_ID) - references CCM_CORE.WORKFLOW_TEMPLATES; + references CCM_CORE.WORKFLOWS; \ No newline at end of file diff --git a/ccm-docrepo/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_docrepo_schema.sql b/ccm-docrepo/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_docrepo_schema.sql index 5b9c319cf..1e6174e67 100644 --- a/ccm-docrepo/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_docrepo_schema.sql +++ b/ccm-docrepo/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_docrepo_schema.sql @@ -40,6 +40,7 @@ CREATE SCHEMA ccm_docrepo; CATEGORY_ORDER bigint, CATEGORY_INDEX boolean, OBJECT_ORDER bigint, + TYPE varchar(255), OBJECT_ID bigint, CATEGORY_ID bigint, primary key (CATEGORIZATION_ID) @@ -47,7 +48,7 @@ CREATE SCHEMA ccm_docrepo; create table CCM_CORE.CATEGORY_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -64,7 +65,7 @@ CREATE SCHEMA ccm_docrepo; create table CCM_CORE.CATEGORY_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -72,10 +73,19 @@ CREATE SCHEMA ccm_docrepo; create table CCM_CORE.CCM_OBJECTS ( OBJECT_ID bigint not null, DISPLAY_NAME varchar(255), - UUID varchar(255) not null, + UUID varchar(255), primary key (OBJECT_ID) ); + create table CCM_CORE.CCM_OBJECTS_AUD ( + OBJECT_ID bigint not null, + REV integer not null, + REVTYPE tinyint, + REVEND integer, + DISPLAY_NAME varchar(255), + primary key (OBJECT_ID, REV) + ); + create table CCM_CORE.CCM_REVISIONS ( id integer not null, timestamp bigint not null, @@ -103,7 +113,7 @@ CREATE SCHEMA ccm_docrepo; create table CCM_CORE.DOMAIN_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -120,11 +130,18 @@ CREATE SCHEMA ccm_docrepo; create table CCM_CORE.DOMAIN_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); + create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( + COMPONENT_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), + LOCALE varchar(255) not null, + primary key (COMPONENT_ID, LOCALE) + ); + create table CCM_CORE.FORMBUILDER_COMPONENTS ( ACTIVE boolean, ADMIN_NAME varchar(255), @@ -136,13 +153,6 @@ CREATE SCHEMA ccm_docrepo; primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( - COMPONENT_ID bigint not null, - LOCALIZED_VALUE clob, - LOCALE varchar(255) not null, - primary key (COMPONENT_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER ( BODY clob, FROM_EMAIL varchar(255), @@ -172,14 +182,14 @@ CREATE SCHEMA ccm_docrepo; create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); @@ -214,17 +224,31 @@ CREATE SCHEMA ccm_docrepo; primary key (OBJECT_ID) ); + create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( + OPTION_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), + LOCALE varchar(255) not null, + primary key (OPTION_ID, LOCALE) + ); + create table CCM_CORE.FORMBUILDER_OPTIONS ( PARAMETER_VALUE varchar(255), OBJECT_ID bigint not null, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( - OPTION_ID bigint not null, - LOCALIZED_VALUE clob, + create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( + PROCESS_LISTENER_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, - primary key (OPTION_ID, LOCALE) + primary key (PROCESS_LISTENER_ID, LOCALE) + ); + + create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( + PROCESS_LISTENER_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), + LOCALE varchar(255) not null, + primary key (PROCESS_LISTENER_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( @@ -235,20 +259,6 @@ CREATE SCHEMA ccm_docrepo; primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( - PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE clob, - LOCALE varchar(255) not null, - primary key (PROCESS_LISTENER_ID, LOCALE) - ); - - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( - PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE clob, - LOCALE varchar(255) not null, - primary key (PROCESS_LISTENER_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER ( REMOTE_URL varchar(2048), OBJECT_ID bigint not null, @@ -285,11 +295,6 @@ CREATE SCHEMA ccm_docrepo; primary key (OBJECT_ID) ); - create table CCM_CORE.GROUPS ( - PARTY_ID bigint not null, - primary key (PARTY_ID) - ); - create table CCM_CORE.GROUP_MEMBERSHIPS ( MEMBERSHIP_ID bigint not null, GROUP_ID bigint, @@ -297,6 +302,11 @@ CREATE SCHEMA ccm_docrepo; primary key (MEMBERSHIP_ID) ); + create table CCM_CORE.GROUPS ( + PARTY_ID bigint not null, + primary key (PARTY_ID) + ); + create table CCM_CORE.HOSTS ( HOST_ID bigint not null, SERVER_NAME varchar(512), @@ -372,6 +382,52 @@ CREATE SCHEMA ccm_docrepo; primary key (OBJECT_ID) ); + create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( + TOKEN_ID bigint not null, + PURPOSE varchar(255), + TOKEN varchar(255), + VALID_UNTIL timestamp, + USER_ID bigint, + primary key (TOKEN_ID) + ); + + create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS ( + COMPONENT_MODEL_ID bigint not null, + CLASS_ATTRIBUTE varchar(512), + ID_ATTRIBUTE varchar(255), + COMPONENT_KEY varchar(255), + MODEL_UUID varchar(255) not null, + STYLE_ATTRIBUTE varchar(1024), + UUID varchar(255) not null, + PAGE_MODEL_ID bigint, + primary key (COMPONENT_MODEL_ID) + ); + + create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( + PAGE_MODEL_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), + LOCALE varchar(255) not null, + primary key (PAGE_MODEL_ID, LOCALE) + ); + + create table CCM_CORE.PAGE_MODEL_TITLES ( + PAGE_MODEL_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), + LOCALE varchar(255) not null, + primary key (PAGE_MODEL_ID, LOCALE) + ); + + create table CCM_CORE.PAGE_MODELS ( + PAGE_MODEL_ID bigint not null, + MODEL_UUID varchar(255) not null, + NAME varchar(255), + TYPE varchar(255) not null, + UUID varchar(255) not null, + VERSION varchar(255) not null, + APPLICATION_ID bigint, + primary key (PAGE_MODEL_ID) + ); + create table CCM_CORE.PARTIES ( PARTY_ID bigint not null, NAME varchar(256) not null, @@ -382,9 +438,11 @@ CREATE SCHEMA ccm_docrepo; PERMISSION_ID bigint not null, CREATION_DATE timestamp, CREATION_IP varchar(255), - granted_privilege varchar(255), + GRANTED_PRIVILEGE varchar(255), + INHERITED boolean, CREATION_USER_ID bigint, GRANTEE_ID bigint, + INHERITED_FROM_ID bigint, OBJECT_ID bigint, primary key (PERMISSION_ID) ); @@ -415,28 +473,27 @@ CREATE SCHEMA ccm_docrepo; primary key (QUEUE_ITEM_ID) ); - create table CCM_CORE.RESOURCES ( - CREATED timestamp, - OBJECT_ID bigint not null, - parent_OBJECT_ID bigint, - resourceType_RESOURCE_TYPE_ID bigint, - primary key (OBJECT_ID) - ); - create table CCM_CORE.RESOURCE_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); + create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( + RESOURCE_TYPE_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), + LOCALE varchar(255) not null, + primary key (RESOURCE_TYPE_ID, LOCALE) + ); + create table CCM_CORE.RESOURCE_TYPES ( RESOURCE_TYPE_ID bigint not null, SINGLETON boolean, @@ -447,11 +504,19 @@ CREATE SCHEMA ccm_docrepo; primary key (RESOURCE_TYPE_ID) ); - create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( - RESOURCE_TYPE_ID bigint not null, - LOCALIZED_VALUE clob, + create table CCM_CORE.RESOURCES ( + CREATED timestamp, + OBJECT_ID bigint not null, + parent_OBJECT_ID bigint, + resourceType_RESOURCE_TYPE_ID bigint, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.ROLE_DESCRIPTIONS ( + ROLE_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, - primary key (RESOURCE_TYPE_ID, LOCALE) + primary key (ROLE_ID, LOCALE) ); create table CCM_CORE.ROLE_MEMBERSHIPS ( @@ -462,32 +527,16 @@ CREATE SCHEMA ccm_docrepo; ); create table CCM_CORE.SETTINGS ( - name varchar(512) not null, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_BIG_DECIMAL ( - setting_value decimal(19,2), - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_BOOLEAN ( - setting_value boolean, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_DOUBLE ( - setting_value double, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_ENUM ( - OBJECT_ID bigint not null, - primary key (OBJECT_ID) + DTYPE varchar(31) not null, + SETTING_ID bigint not null, + CONFIGURATION_CLASS varchar(512) not null, + NAME varchar(512) not null, + SETTING_VALUE_LONG bigint, + SETTING_VALUE_BOOLEAN boolean, + SETTING_VALUE_STRING varchar(1024), + SETTING_VALUE_DOUBLE double, + SETTING_VALUE_BIG_DECIMAL decimal(19,2), + primary key (SETTING_ID) ); create table CCM_CORE.SETTINGS_ENUM_VALUES ( @@ -495,42 +544,16 @@ CREATE SCHEMA ccm_docrepo; value varchar(255) ); - create table CCM_CORE.SETTINGS_L10N_STRING ( - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( ENTRY_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ENTRY_ID, LOCALE) ); - create table CCM_CORE.SETTINGS_LONG ( - setting_value bigint, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_STRING ( - setting_value varchar(1024), - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - create table CCM_CORE.SETTINGS_STRING_LIST ( - OBJECT_ID bigint not null, LIST_ID bigint not null, - value varchar(255), - primary key (OBJECT_ID) - ); - - create table CCM_CORE.TASK_ASSIGNMENTS ( - TASK_ASSIGNMENT_ID bigint not null, - ROLE_ID bigint, - TASK_ID bigint, - primary key (TASK_ASSIGNMENT_ID) + value varchar(255) ); create table CCM_CORE.THREADS ( @@ -539,6 +562,13 @@ CREATE SCHEMA ccm_docrepo; primary key (OBJECT_ID) ); + create table CCM_CORE.USER_EMAIL_ADDRESSES ( + USER_ID bigint not null, + EMAIL_ADDRESS varchar(512) not null, + BOUNCING boolean, + VERIFIED boolean + ); + create table CCM_CORE.USERS ( BANNED boolean, FAMILY_NAME varchar(512), @@ -552,50 +582,45 @@ CREATE SCHEMA ccm_docrepo; primary key (PARTY_ID) ); - create table CCM_CORE.USER_EMAIL_ADDRESSES ( - USER_ID bigint not null, - EMAIL_ADDRESS varchar(512) not null, - BOUNCING boolean, - VERIFIED boolean - ); - - create table CCM_CORE.WORKFLOWS ( - WORKFLOW_ID bigint not null, - primary key (WORKFLOW_ID) + create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS ( + DUE_DATE timestamp, + DURATION_MINUTES bigint, + LOCKED boolean, + START_DATE timestamp, + TASK_ID bigint not null, + LOCKING_USER_ID bigint, + NOTIFICATION_SENDER bigint, + primary key (TASK_ID) ); create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_NAMES ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); - create table CCM_CORE.WORKFLOW_TASKS ( - TASK_ID bigint not null, - ACTIVE boolean, - TASK_STATE varchar(512), - WORKFLOW_ID bigint, - primary key (TASK_ID) - ); - - create table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS ( - TASK_ID bigint not null, - LOCALIZED_VALUE clob, - LOCALE varchar(255) not null, - primary key (TASK_ID, LOCALE) + create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS ( + TASK_ASSIGNMENT_ID bigint not null, + ROLE_ID bigint, + TASK_ID bigint, + primary key (TASK_ASSIGNMENT_ID) ); create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( - TASK_ID bigint not null, - COMMENT clob + COMMENT_ID bigint not null, + COMMENT varchar(2147483647), + UUID varchar(255) not null, + AUTHOR_ID bigint, + TASK_ID bigint, + primary key (COMMENT_ID) ); create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( @@ -603,39 +628,72 @@ CREATE SCHEMA ccm_docrepo; DEPENDENT_TASK_ID bigint not null ); - create table CCM_CORE.WORKFLOW_TASK_LABELS ( + create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( TASK_ID bigint not null, - LOCALIZED_VALUE clob, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); - create table CCM_CORE.WORKFLOW_USER_TASKS ( + create table CCM_CORE.WORKFLOW_TASK_LABELS ( + TASK_ID bigint not null, + LOCALIZED_VALUE varchar(2147483647), + LOCALE varchar(255) not null, + primary key (TASK_ID, LOCALE) + ); + + create table CCM_CORE.WORKFLOW_TASKS ( TASK_ID bigint not null, ACTIVE boolean, TASK_STATE varchar(512), + UUID varchar(255) not null, WORKFLOW_ID bigint, - DUE_DATE timestamp, - DURATION_MINUTES bigint, - LOCKED boolean, - START_DATE timestamp, - LOCKING_USER_ID bigint, - NOTIFICATION_SENDER bigint, primary key (TASK_ID) ); - create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( - TOKEN_ID bigint not null, - PURPOSE varchar(255), - TOKEN varchar(255), - VALID_UNTIL timestamp, - USER_ID bigint, - primary key (TOKEN_ID) + create table CCM_CORE.WORKFLOWS ( + WORKFLOW_ID bigint not null, + abstract_workflow boolean, + ACTIVE boolean, + WORKFLOW_STATE varchar(255), + TASKS_STATE varchar(255), + UUID varchar(255) not null, + OBJECT_ID bigint, + TEMPLATE_ID bigint, + primary key (WORKFLOW_ID) ); + alter table CCM_CORE.CATEGORY_DOMAINS + add constraint UK_mb1riernf8a88u3mwl0bgfj8y unique (DOMAIN_KEY); + + alter table CCM_CORE.CATEGORY_DOMAINS + add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); + + alter table CCM_CORE.CCM_OBJECTS + add constraint UK_1cm71jlagvyvcnkqvxqyit3wx unique (UUID); + + alter table CCM_CORE.HOSTS + add constraint UK9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); + + alter table CCM_CORE.INSTALLED_MODULES + add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); + + alter table CCM_CORE.SETTINGS + add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID); + + alter table CCM_CORE.WORKFLOW_TASKS + add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID); + + alter table CCM_CORE.WORKFLOWS + add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); + create table CCM_DOCREPO.BLOB_OBJECTS ( BLOB_OBJECT_ID bigint not null, CONTENT blob, + UUID varchar(255) not null, primary key (BLOB_OBJECT_ID) ); @@ -664,10 +722,10 @@ CREATE SCHEMA ccm_docrepo; ); create table CCM_DOCREPO.RESOURCES ( - CREATION_DATE timestamp, + CREATION_DATE timestamp not null, CREATION_IP varchar(255), DESCRIPTION varchar(255), - LAST_MODIFIED_DATE timestamp, + LAST_MODIFIED_DATE timestamp not null, LAST_MODIFIED_IP varchar(255), MIME_TYPE varchar(255), NAME varchar(512) not null, @@ -681,18 +739,6 @@ CREATE SCHEMA ccm_docrepo; primary key (OBJECT_ID) ); - alter table CCM_CORE.CATEGORY_DOMAINS - add constraint UK_mb1riernf8a88u3mwl0bgfj8y unique (DOMAIN_KEY); - - alter table CCM_CORE.CATEGORY_DOMAINS - add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); - - alter table CCM_CORE.HOSTS - add constraint UK_9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); - - alter table CCM_CORE.INSTALLED_MODULES - add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); - alter table CCM_DOCREPO.REPOSITORIES add constraint UK_n24tjtffp9k0wwng0p6s86mrp unique (NAME); @@ -705,539 +751,579 @@ CREATE SCHEMA ccm_docrepo; alter table CCM_DOCREPO.RESOURCES add constraint UK_gl32co8ta3opblaihamh6d0fk unique (PATH); + create sequence hibernate_sequence start with 1 increment by 1; + alter table CCM_CORE.APPLICATIONS - add constraint FK_sn1sqtx94nhxgv282ymoqiock + add constraint FKatcp9ij6mbkx0nfeig1o6n3lm foreign key (OBJECT_ID) references CCM_CORE.RESOURCES; alter table CCM_CORE.ATTACHMENTS - add constraint FK_fwm2uvhmqg8bmo1d66g0b6be9 + add constraint FK8ju9hm9baceridp803nislkwb foreign key (MESSAGE_ID) references CCM_CORE.MESSAGES; alter table CCM_CORE.CATEGORIES - add constraint FK_4sghd3hxh69xgu68m8uh2axej + add constraint FKrj3marx99nheur4fqanm0ylur foreign key (PARENT_CATEGORY_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORIES - add constraint FK_pvjwyfbuwafc1mlyevgwwyg49 + add constraint FKpm291swli2musd0204phta652 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FK_2onruptfmyn5mu8f5j2o4h8i3 + add constraint FKejp0ubk034nfq60v1po6srkke foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FK_k43sltpj69u3y5eltkjhumc4p + add constraint FKoyeipswl876wa6mqwbx0uy83h foreign key (CATEGORY_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DESCRIPTIONS - add constraint FK_55equbyl81ut4yyt6jms57jwr + add constraint FKhiwjlmh5vkbu3v3vng1la1qum foreign key (OBJECT_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FK_jyt6c67quitehuh5xe7ulhqvu + add constraint FKf25vi73cji01w8fgo6ow1dgg foreign key (ROOT_CATEGORY_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FK_40h1mx7tdlmjvb6x2e04jqgi7 + add constraint FK58xpmnvciohkom1c16oua4xha foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORY_TITLES - add constraint FK_954p2g6kwhef5h41pfcda812u + add constraint FKka9bt9f5br0kji5bcjxcmf6ch foreign key (OBJECT_ID) references CCM_CORE.CATEGORIES; + alter table CCM_CORE.CCM_OBJECTS_AUD + add constraint FKr00eauutiyvocno8ckx6h9nw6 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CORE.CCM_OBJECTS_AUD + add constraint FKo5s37ctcdny7tmewjwv7705h5 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + alter table CCM_CORE.DIGESTS - add constraint FK_3xrcpufumqnh4ke4somt89rvh + add constraint FKc53g09agnye3w1v4euy3e0gsi foreign key (FROM_PARTY_ID) references CCM_CORE.PARTIES; alter table CCM_CORE.DIGESTS - add constraint FK_4sxl35dvaj54ck0ikf850h58x + add constraint FK845r9ep6xu6nbt1mvxulwybym foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.DOMAIN_DESCRIPTIONS - add constraint FK_12rneohwyp6p66ioyoyobvkxr + add constraint FKn4i2dxgn8cqysa62dds6eih6a foreign key (OBJECT_ID) references CCM_CORE.CATEGORY_DOMAINS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK_m53bm8ecspukj3qj99q9xa8ox + add constraint FK47nsasr7jrdwlky5gx0u6e9py foreign key (domain_OBJECT_ID) references CCM_CORE.CATEGORY_DOMAINS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK_ce4xhu9ilpdvjsmrsjb739t64 + add constraint FK3u4hq6yqau4m419b1xva3xpwq foreign key (owner_OBJECT_ID) references CCM_CORE.APPLICATIONS; alter table CCM_CORE.DOMAIN_TITLES - add constraint FK_98kfhafuv6lmhnpkhurwp9bgm + add constraint FK5p526dsdwn94els6lp5w0hdn4 foreign key (OBJECT_ID) references CCM_CORE.CATEGORY_DOMAINS; + alter table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS + add constraint FKfh0k9lj3pf4amfc9bbbss0tr1 + foreign key (COMPONENT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FK_72108sd6vsqt88g3fb4kl6o81 + add constraint FKpcpmvyiix023b4g5n4q8nkfca foreign key (parentComponent_OBJECT_ID) references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FK_f9xo42yrxdjxqedrk3t2upm9e + add constraint FKt0e0uv00pp1rwhyaltrytghnm foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; - alter table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS - add constraint FK_2njuft67tbfnkxsr62r0bmhh3 - foreign key (COMPONENT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; - alter table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER - add constraint FK_qm4q6qc2p81e349jgpoyxpq10 + add constraint FK48khrbud3xhi2gvsvnlttd8tg foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS - add constraint FK_cq44p887dqh2ycd0htku119wf + add constraint FKbyjjt2ufendvje2obtge2l7et foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS - add constraint FK_qeyxu4t8aqosmoup7ho9qrtae + add constraint FK8oriyta1957u7dvbrqk717944 foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_DATA_QUERIES - add constraint FK_6xtng7pfv18ixfpid57grfh4 + add constraint FKhhaxpeddbtmrnjr5o0fopju3a foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS - add constraint FK_2rlo453aslip0ng1fpyv022ld + add constraint FKsmduu1opoiulkeo2gc8v7lsbn foreign key (DATA_QUERY_ID) references CCM_CORE.FORMBUILDER_DATA_QUERIES; alter table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES - add constraint FK_9nqk2rpq4exw708vobkmdcr1s + add constraint FKju1x82inrw3kguyjuxoetn6gn foreign key (DATA_QUERY_ID) references CCM_CORE.FORMBUILDER_DATA_QUERIES; alter table CCM_CORE.FORMBUILDER_FORMSECTIONS - add constraint FK_anavw6ab288yo2d90axcebv1p + add constraint FKnfhsgxp4lvigq2pm33pn4afac foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FK_lnlrrafk9r9v072vqtmnkwkou + add constraint FK33ilyirwoux28yowafgd5xx0o foreign key (widget_OBJECT_ID) references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FK_2ynw5cse8kayvi9wqdgg477w0 + add constraint FKlqm76746nq5yrt8ganm474uu0 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_METAOBJECTS - add constraint FK_9bx162hal2lqub5m5c21hh31r + add constraint FKf963v6u9mw8pwjmasrw51w8dx foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_OBJECT_TYPES - add constraint FK_qaj6yd47l5trvvxtnxeao1c33 + add constraint FKkv337e83rsecf0h3qy8bu7l9w foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; - alter table CCM_CORE.FORMBUILDER_OPTIONS - add constraint FK_6s1dxx8lfky4l5ibtd20ouvuj - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; - alter table CCM_CORE.FORMBUILDER_OPTION_LABELS - add constraint FK_90c86qtfefh98jcche7rtk5ms + add constraint FKatlsylsvln6yse55eof6wwkj6 foreign key (OPTION_ID) references CCM_CORE.FORMBUILDER_OPTIONS; - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FK_2a4hflqpujuxvx90bsnie3s33 - foreign key (formSection_OBJECT_ID) - references CCM_CORE.FORMBUILDER_FORMSECTIONS; - - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FK_dth0onqirda98fvvpo1rtpjxi + alter table CCM_CORE.FORMBUILDER_OPTIONS + add constraint FKhe5q71wby9g4i56sotc501h11 foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS - add constraint FK_cynaaq1405ih7epmt4k6vv5m1 + add constraint FKcv3iu04gxjk9c0pn6tl8rqqv3 foreign key (PROCESS_LISTENER_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES - add constraint FK_gpc3rhvwhy9038k7or5ud8mim + add constraint FK8rnyb1m6ij3b9hhmhr7klgd4p foreign key (PROCESS_LISTENER_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS + add constraint FK7uiaeax8qafm82e5k729ms5ku + foreign key (formSection_OBJECT_ID) + references CCM_CORE.FORMBUILDER_FORMSECTIONS; + + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS + add constraint FKbdnloo884qk6gn36jwiqv5rlp + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + alter table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER - add constraint FK_b6b0wn2j0mps0ml4jh8s46y4r + add constraint FKpajvu9m6fj1enm67a9gcb5ii9 foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS - add constraint FK_33n9b1q1goybwbvvaotnq4n7 + add constraint FKsn82ktlq0c9ikijyv8k2bfv4f foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS - add constraint FK_iqwglkvml7y4yevaq8s1936im + add constraint FK8kjyu72btjsuaaqh4bvd8npns foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + alter table CCM_CORE.FORMBUILDER_WIDGETS + add constraint FK1wosr4ujbfckdc50u5fgmrhrk + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + alter table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS - add constraint FK_kcfevkdytrk81gj08f4aeh3qu + add constraint FKjie9co03m7ow4ihig5rk7l8oj foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; - alter table CCM_CORE.GROUPS - add constraint FK_bm1g1sp4aav32ghhbo04gkakl - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; - alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FK_8fitvs176l2fpsoplbbsaxpjo + add constraint FKq4qnny8ri3eo7eqh4olxco8nk foreign key (GROUP_ID) references CCM_CORE.GROUPS; alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FK_7ttmeu1wo1bhgnxvqm5hksbwm + add constraint FKc8u86ivkhvoiw6ju8b2p365he foreign key (MEMBER_ID) references CCM_CORE.USERS; + alter table CCM_CORE.GROUPS + add constraint FK4f61mlqxw0ct6s7wwpi9m0735 + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; + alter table CCM_CORE.INITS - add constraint FK_jm1ulcmd86shcy83907ojny4q + add constraint FK3nvvxk10nmq9nfuko8yklqdgc foreign key (REQUIRED_BY_ID) references CCM_CORE.INITS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FK_hhbqgpg0ocewhlr2cclrtsj7r + add constraint FK942kl4yff8rdiwr0pjk2a9g8 foreign key (CREATED_BY_PARTY_ID) references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FK_mp7nlc3u4t38x0cevx0bg022s + add constraint FKc5rs6afx4p9fidabfqsxr5ble foreign key (LAST_MODIFIED_BY) references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_INDEXES - add constraint FK_f5ddcxpneculqmctmixjus42k + add constraint FK6gu0yrlviqk07dtb3r02iw43f foreign key (HOST_ID) references CCM_CORE.HOSTS; alter table CCM_CORE.MESSAGES - add constraint FK_pymp95s2bsv5dke8dxbdmdx1d + add constraint FKph10aehmg9f20pn2w4buki97q foreign key (IN_REPLY_TO_ID) references CCM_CORE.MESSAGES; alter table CCM_CORE.MESSAGES - add constraint FK_7w5nh4eo1l5idhvfwvkv02yyi + add constraint FKjufsx3c3h538fj35h8hgfnb1p foreign key (SENDER_ID) references CCM_CORE.USERS; alter table CCM_CORE.MESSAGES - add constraint FK_t98lp1382qxby5c7b34j238pc + add constraint FK6w20ao7scwecd9mfwpun2ddqx foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_a2hr4wa8qqnoj0njlrkuak3s6 + add constraint FKqk70c1x1dklhty9ju5t4wukd9 foreign key (DIGEST_ID) references CCM_CORE.DIGESTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_ck8hytjcms2iwen7q538n49nu + add constraint FKtt4fjr2p75og79jxxgd8q8mr foreign key (MESSAGE_ID) references CCM_CORE.MESSAGES; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_lp67f9mq0basheao3o81xj0xh + add constraint FK2vlnma0ox43j0clx8ead08n5s foreign key (RECEIVER_ID) references CCM_CORE.PARTIES; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_2aqx4bgfyhhh4g3pvvjh8hy0w - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.PERMISSIONS - add constraint FK_7f7dd6k54fi1vy3llbvrer061 - foreign key (CREATION_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_CORE.PERMISSIONS - add constraint FK_cnt8ay16396ldn10w9yqfvtib - foreign key (GRANTEE_ID) - references CCM_CORE.CCM_ROLES; - - alter table CCM_CORE.PERMISSIONS - add constraint FK_5d855uu7512wakcver0bvdc3f - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.PORTALS - add constraint FK_2san7d6vxf5jhesvar5hq57v4 - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.PORTLETS - add constraint FK_46ty07r54th9qc87pyi31jdqs - foreign key (PORTAL_ID) - references CCM_CORE.PORTALS; - - alter table CCM_CORE.PORTLETS - add constraint FK_r0tybwnahtdoo68tbna9q3s75 - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.QUEUE_ITEMS - add constraint FK_kskdba7a8ytgc5fxen06peg7 - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; - - alter table CCM_CORE.QUEUE_ITEMS - add constraint FK_iccfxv2glwbqa465s8125ftgm - foreign key (RECEIVER_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.RESOURCES - add constraint FK_ceqi7mfjyk4vdoiyie09kmgj - foreign key (parent_OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCES - add constraint FK_eodj9xd1rmdokm4c3ir1l7s4d - foreign key (resourceType_RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; - - alter table CCM_CORE.RESOURCES - add constraint FK_f600trvtav1r0n6oy7nri9wry - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.RESOURCE_DESCRIPTIONS - add constraint FK_pcahs6vr1ajb3a4mh0vi4stuy - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TITLES - add constraint FK_brvlxvpy2f1n67562twvvux7s - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS - add constraint FK_7860pdhhck6opa22gc9u0pgfu - foreign key (RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; - - alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FK_hueyk522he8t6fa1blnpcslap - foreign key (MEMBER_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FK_eykbm84ndwgpqsr48wekhdoqj - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; - - alter table CCM_CORE.SETTINGS - add constraint FK_3k0t3in140j6wj6eq5olwjgu - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.SETTINGS_BIG_DECIMAL - add constraint FK_9mbdc1rjkm80edyuijnkwl6ak - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_BOOLEAN - add constraint FK_1mjjvpjxpwicyv8im6mumc7ug - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_DOUBLE - add constraint FK_kejnkuyk89tw59xg550kugwb5 - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_ENUM - add constraint FK_fgrfc2qbl2f2t1l0ku8wo2e5r - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_ENUM_VALUES - add constraint FK_sq653hqyeeklci0y7pvoxf5ha - foreign key (ENUM_ID) - references CCM_CORE.SETTINGS_ENUM; - - alter table CCM_CORE.SETTINGS_L10N_STRING - add constraint FK_evnyfg9udprxmbginhc4o0is9 - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_L10N_STR_VALUES - add constraint FK_t21obt5do2tjhskjxgxd5143r - foreign key (ENTRY_ID) - references CCM_CORE.SETTINGS_L10N_STRING; - - alter table CCM_CORE.SETTINGS_LONG - add constraint FK_2l4bw7pbq3koj81cjyoqpenjj - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_STRING - add constraint FK_naonte6jut7b842icvp9ahino - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_STRING_LIST - add constraint FK_34s3comqq4mhy9kcr04iavfef - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_STRING_LIST - add constraint FK_obwiaa74lrjqjlpjidjltysoq - foreign key (LIST_ID) - references CCM_CORE.SETTINGS_STRING_LIST; - - alter table CCM_CORE.TASK_ASSIGNMENTS - add constraint FK_klh64or0yq26c63181j1tps2o - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; - - alter table CCM_CORE.TASK_ASSIGNMENTS - add constraint FK_fu6ukne6hj8ihlfxtmp17xpfj - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_USER_TASKS; - - alter table CCM_CORE.THREADS - add constraint FK_oopqroe5a8fg932teo0cyifcv - foreign key (ROOT_ID) - references CCM_CORE.MESSAGES; - - alter table CCM_CORE.THREADS - add constraint FK_n86cmt6poesgsr4g4c4q07i9f - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.USERS - add constraint FK_9gwih54tm0rn63e536f6s9oti - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.USER_EMAIL_ADDRESSES - add constraint FK_tp5wms6tgfl827ihqbcgskusy - foreign key (USER_ID) - references CCM_CORE.USERS; - - alter table CCM_CORE.WORKFLOW_DESCRIPTIONS - add constraint FK_sp01mgi5mi5wbwrh8ivnfpw2n - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_NAMES - add constraint FK_rmkgykysvk7su7h5tij67p2r3 - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_TASKS - add constraint FK_bawikoiw1k0bil1bvwq5qpa0j - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_USER_TASKS - add constraint FK_byuic3urkanoiqjnf6awfqmyk - foreign key (LOCKING_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_CORE.WORKFLOW_USER_TASKS - add constraint FK_2dtlvmuapubq81quny4elndh - foreign key (NOTIFICATION_SENDER) - references CCM_CORE.USERS; - - alter table CCM_CORE.WORKFLOW_USER_TASKS - add constraint FK_bg60xxg9kerqsxyphbfxulg8y - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_DOCREPO.FILES - add constraint FK_s412u1ou70hc2sdj26e5638o - foreign key (CONTENT_ID) - references CCM_DOCREPO.BLOB_OBJECTS; - - alter table CCM_DOCREPO.FILES - add constraint FK_4w157foajv876017oiexm1a1d - foreign key (OBJECT_ID) - references CCM_DOCREPO.RESOURCES; - - alter table CCM_DOCREPO.FOLDERS - add constraint FK_byhuep63cwuywql7ymp3cr2d6 - foreign key (OBJECT_ID) - references CCM_DOCREPO.RESOURCES; - - alter table CCM_DOCREPO.REC_UPD_DOCS_PORTLETS - add constraint FK_jqcd60j6cuisivbpie4kccx4 - foreign key (OBJECT_ID) - references CCM_CORE.PORTLETS; - - alter table CCM_DOCREPO.REPOSITORIES - add constraint FK_oeoim1ueaad0wkhlgm6hnu0ad - foreign key (OWNER_ID) - references CCM_CORE.USERS; - - alter table CCM_DOCREPO.REPOSITORIES - add constraint FK_li6a82kt97qrftfobdo1bweaq - foreign key (ROOT_FOLDER_ID) - references CCM_DOCREPO.FOLDERS; - - alter table CCM_DOCREPO.REPOSITORIES - add constraint FK_n8ueci6o4q3g5u2uk4j37aeq4 - foreign key (OBJECT_ID) - references CCM_CORE.APPLICATIONS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_25wui494pab6yrs80ibq94gs1 - foreign key (CREATION_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_a6l3gmrpjfwd1yfcqdj1vewum - foreign key (LAST_MODIFIED_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_jjyxytwliy3l6cp3ouudcp8yy - foreign key (PARENT_ID) - references CCM_DOCREPO.FOLDERS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_1lkenqs1i2j4upr5xphre0ku4 - foreign key (REPOSITORY_ID) - references CCM_DOCREPO.REPOSITORIES; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_f600trvtav1r0n6oy7nri9wry + add constraint FKf423hhiaw1bexpxeh1pnas7qt foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.ONE_TIME_AUTH_TOKENS - add constraint FK_fvr3t6w3nsm3u29mjuh4tplno + add constraint FKtplfuphkiorfkttaewb4wmfjc foreign key (USER_ID) references CCM_CORE.USERS; - create sequence hibernate_sequence start with 1 increment by 1; + alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS + add constraint FKo696ch035fe7rrueol1po13od + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS + add constraint FKcc5d6eqxu1369k8ycyyt6vn3e + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODEL_TITLES + add constraint FKj14q9911yhd4js9p6rs21rwjf + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODELS + add constraint FKk2lihllrxj89mn3tqv43amafe + foreign key (APPLICATION_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKj9di7pawxgtouxmu2k44bj5c4 + foreign key (CREATION_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKikx3x0kn9fito23g50v6xbr9f + foreign key (GRANTEE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.PERMISSIONS + add constraint FKg56ujjoe0j30pq579rf0l5yc6 + foreign key (INHERITED_FROM_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKkamckexjnffnt8lay9nqeawhm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.PORTALS + add constraint FK5a2hdrbw03mmgr74vj5nxlpvk + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.PORTLETS + add constraint FK9gr5xjt3rx4uhtw7vl6adruol + foreign key (PORTAL_ID) + references CCM_CORE.PORTALS; + + alter table CCM_CORE.PORTLETS + add constraint FKjmx9uebt0gwxkw3xv34niy35f + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.QUEUE_ITEMS + add constraint FKtgkwfruv9kjdybf46l02da088 + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.QUEUE_ITEMS + add constraint FKs9aq1hyxstwmvx7fmfifp4x7r + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.RESOURCE_DESCRIPTIONS + add constraint FKk9arvj5u21rv23ce3cav4opqx + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCE_TITLES + add constraint FKto4p6n2wklljyf7tmuxtmyfe0 + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS + add constraint FKckpihjtv23iahbg3imnpbsr2 + foreign key (RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; + + alter table CCM_CORE.RESOURCES + add constraint FKbo7ibfgodicn9flv2gfo11g5a + foreign key (parent_OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCES + add constraint FK262fbwetpjx3k4uuvw24wsiv + foreign key (resourceType_RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; + + alter table CCM_CORE.RESOURCES + add constraint FKbjdf8pm4frth8r06ev2qjm88f + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.ROLE_DESCRIPTIONS + add constraint FKo09bh4j3k3k0ph3awvjwx31ft + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.ROLE_MEMBERSHIPS + add constraint FK9m88ywi7rcin7b7jrgh53emrq + foreign key (MEMBER_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.ROLE_MEMBERSHIPS + add constraint FKcsyogv5m2rgsrmtgnhgkjhfw7 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.SETTINGS_ENUM_VALUES + add constraint FK8mw4p92s0h3h8bmo8saowu32i + foreign key (ENUM_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.SETTINGS_L10N_STR_VALUES + add constraint FK5knjq7cisej0qfx5dw1y93rou + foreign key (ENTRY_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.SETTINGS_STRING_LIST + add constraint FKqeclqa5sf1g53vxs857tpwrus + foreign key (LIST_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.THREADS + add constraint FKsx08mpwvwnw97uwdgjs76q39g + foreign key (ROOT_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.THREADS + add constraint FKp97b1sy1kop07rtapeh5l9fb2 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.USER_EMAIL_ADDRESSES + add constraint FKr900l79erul95seyyccf04ufc + foreign key (USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.USERS + add constraint FKosh928q71aonu6l1kurb417r + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FK1pnsq9ur3ylq0ghuj23p4cogs + foreign key (LOCKING_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FK9ngp088m8xa82swy7yg3qx6vh + foreign key (NOTIFICATION_SENDER) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FKt9ha3no3bj8a50pnw8cnqh2cq + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_DESCRIPTIONS + add constraint FKgx7upkqky82dpxvbs95imfl9l + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOW_NAMES + add constraint FKkxedy9p48avfk45r0bn4uc09i + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS + add constraint FKpq4paqtfbi5erhh98wl1ja005 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS + add constraint FK3933ol31co3yn5ee75b2hmhgp + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint FKd2ymdg8nay9pmh2nn2whba0j8 + foreign key (AUTHOR_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint FKkfqrf9jdvm7livu5if06w0r5t + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES + add constraint FK1htp420ki24jaswtcum56iawe + foreign key (DEPENDENT_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES + add constraint FK8rbggnp4yjpab8quvvx800ymy + foreign key (DEPENDS_ON_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS + add constraint FKeb7mqbdx3bk7t01vo7kp2hpf + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_LABELS + add constraint FKf715qud6g9xv2xeb8rrpnv4xs + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASKS + add constraint FK1693cbc36e4d8gucg8q7sc57e + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOWS + add constraint FKrm2yfrs6veoxoy304upq2wc64 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.WORKFLOWS + add constraint FK9ray5beiny6wm2mi0uwyecay2 + foreign key (TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_DOCREPO.FILES + add constraint FK2hsq6npoqb0gnvj9blucdy0cp + foreign key (CONTENT_ID) + references CCM_DOCREPO.BLOB_OBJECTS; + + alter table CCM_DOCREPO.FILES + add constraint FKj29rqxnqsxub552uxng0ekyj4 + foreign key (OBJECT_ID) + references CCM_DOCREPO.RESOURCES; + + alter table CCM_DOCREPO.FOLDERS + add constraint FKnmxkqionnxqc7ye70npa5ikp0 + foreign key (OBJECT_ID) + references CCM_DOCREPO.RESOURCES; + + alter table CCM_DOCREPO.REC_UPD_DOCS_PORTLETS + add constraint FKaxwcfqi3ssgmdhhsqy2m258vc + foreign key (OBJECT_ID) + references CCM_CORE.PORTLETS; + + alter table CCM_DOCREPO.REPOSITORIES + add constraint FKovamdv1r9txoqbp7sw4i55pwu + foreign key (OWNER_ID) + references CCM_CORE.USERS; + + alter table CCM_DOCREPO.REPOSITORIES + add constraint FKr3nbsglhju8b24vxkcie08g1k + foreign key (ROOT_FOLDER_ID) + references CCM_DOCREPO.FOLDERS; + + alter table CCM_DOCREPO.REPOSITORIES + add constraint FKdjq3yme7ow441nw4as9dqy0we + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FK7fv70w41xca4tduehyb1ye2c6 + foreign key (CREATION_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FK9jl78hpalagwr323bl561qsgj + foreign key (LAST_MODIFIED_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FKap5pdovro7cgbn4jrs77nqa6o + foreign key (PARENT_ID) + references CCM_DOCREPO.FOLDERS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FKpn78v9bfo6ak34kqbe3g6nb1n + foreign key (REPOSITORY_ID) + references CCM_DOCREPO.REPOSITORIES; + + alter table CCM_DOCREPO.RESOURCES + add constraint FKbjdf8pm4frth8r06ev2qjm88f + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; \ No newline at end of file diff --git a/ccm-docrepo/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_docrepo_schema.sql b/ccm-docrepo/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_docrepo_schema.sql index 5b9c319cf..b5ba2e154 100644 --- a/ccm-docrepo/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_docrepo_schema.sql +++ b/ccm-docrepo/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_docrepo_schema.sql @@ -9,45 +9,46 @@ CREATE SCHEMA ccm_docrepo; create table CCM_CORE.APPLICATIONS ( APPLICATION_TYPE varchar(1024) not null, PRIMARY_URL varchar(1024) not null, - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.ATTACHMENTS ( - ATTACHMENT_ID bigint not null, - ATTACHMENT_DATA blob, + ATTACHMENT_ID int8 not null, + ATTACHMENT_DATA oid, DESCRIPTION varchar(255), MIME_TYPE varchar(255), TITLE varchar(255), - MESSAGE_ID bigint, + MESSAGE_ID int8, primary key (ATTACHMENT_ID) ); create table CCM_CORE.CATEGORIES ( ABSTRACT_CATEGORY boolean, - CATEGORY_ORDER bigint, + CATEGORY_ORDER int8, ENABLED boolean, NAME varchar(255) not null, UNIQUE_ID varchar(255), VISIBLE boolean, - OBJECT_ID bigint not null, - PARENT_CATEGORY_ID bigint, + OBJECT_ID int8 not null, + PARENT_CATEGORY_ID int8, primary key (OBJECT_ID) ); create table CCM_CORE.CATEGORIZATIONS ( - CATEGORIZATION_ID bigint not null, - CATEGORY_ORDER bigint, + CATEGORIZATION_ID int8 not null, + CATEGORY_ORDER int8, CATEGORY_INDEX boolean, - OBJECT_ORDER bigint, - OBJECT_ID bigint, - CATEGORY_ID bigint, + OBJECT_ORDER int8, + TYPE varchar(255), + OBJECT_ID int8, + CATEGORY_ID int8, primary key (CATEGORIZATION_ID) ); create table CCM_CORE.CATEGORY_DESCRIPTIONS ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -57,144 +58,153 @@ CREATE SCHEMA ccm_docrepo; RELEASED timestamp, URI varchar(1024), VERSION varchar(255), - OBJECT_ID bigint not null, - ROOT_CATEGORY_ID bigint, + OBJECT_ID int8 not null, + ROOT_CATEGORY_ID int8, primary key (OBJECT_ID) ); create table CCM_CORE.CATEGORY_TITLES ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.CCM_OBJECTS ( - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, DISPLAY_NAME varchar(255), - UUID varchar(255) not null, + UUID varchar(255), primary key (OBJECT_ID) ); + create table CCM_CORE.CCM_OBJECTS_AUD ( + OBJECT_ID int8 not null, + REV int4 not null, + REVTYPE int2, + REVEND int4, + DISPLAY_NAME varchar(255), + primary key (OBJECT_ID, REV) + ); + create table CCM_CORE.CCM_REVISIONS ( - id integer not null, - timestamp bigint not null, + id int4 not null, + timestamp int8 not null, USER_NAME varchar(255), primary key (id) ); create table CCM_CORE.CCM_ROLES ( - ROLE_ID bigint not null, + ROLE_ID int8 not null, NAME varchar(512) not null, primary key (ROLE_ID) ); create table CCM_CORE.DIGESTS ( - FREQUENCY integer, + FREQUENCY int4, HEADER varchar(4096) not null, NEXT_RUN timestamp, DIGEST_SEPARATOR varchar(128) not null, SIGNATURE varchar(4096) not null, SUBJECT varchar(255) not null, - OBJECT_ID bigint not null, - FROM_PARTY_ID bigint, + OBJECT_ID int8 not null, + FROM_PARTY_ID int8, primary key (OBJECT_ID) ); create table CCM_CORE.DOMAIN_DESCRIPTIONS ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.DOMAIN_OWNERSHIPS ( - OWNERSHIP_ID bigint not null, + OWNERSHIP_ID int8 not null, CONTEXT varchar(255), - DOMAIN_ORDER bigint, - OWNER_ORDER bigint, - domain_OBJECT_ID bigint not null, - owner_OBJECT_ID bigint not null, + DOMAIN_ORDER int8, + OWNER_ORDER int8, + domain_OBJECT_ID int8 not null, + owner_OBJECT_ID int8 not null, primary key (OWNERSHIP_ID) ); create table CCM_CORE.DOMAIN_TITLES ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); + create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( + COMPONENT_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (COMPONENT_ID, LOCALE) + ); + create table CCM_CORE.FORMBUILDER_COMPONENTS ( ACTIVE boolean, ADMIN_NAME varchar(255), ATTRIBUTE_STRING varchar(255), - COMPONENT_ORDER bigint, + COMPONENT_ORDER int8, SELECTED boolean, - OBJECT_ID bigint not null, - parentComponent_OBJECT_ID bigint, + OBJECT_ID int8 not null, + parentComponent_OBJECT_ID int8, primary key (OBJECT_ID) ); - create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( - COMPONENT_ID bigint not null, - LOCALIZED_VALUE clob, - LOCALE varchar(255) not null, - primary key (COMPONENT_ID, LOCALE) - ); - create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER ( - BODY clob, + BODY text, FROM_EMAIL varchar(255), SUBJECT varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS ( URL varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS ( MULTIPLE boolean, QUERY varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_DATA_QUERIES ( QUERY_ID varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( - DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE clob, + DATA_QUERY_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( - DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE clob, + DATA_QUERY_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_FORMSECTIONS ( FORMSECTION_ACTION varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_LISTENERS ( ATTRIBUTE_STRING varchar(255), CLASS_NAME varchar(255), - OBJECT_ID bigint not null, - widget_OBJECT_ID bigint, + OBJECT_ID int8 not null, + widget_OBJECT_ID int8, primary key (OBJECT_ID) ); @@ -203,70 +213,70 @@ CREATE SCHEMA ccm_docrepo; PRETTY_NAME varchar(255), PRETTY_PLURAL varchar(255), PROPERTIES_FORM varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_OBJECT_TYPES ( APP_NAME varchar(255), CLASS_NAME varchar(255), - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.FORMBUILDER_OPTIONS ( - PARAMETER_VALUE varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( - OPTION_ID bigint not null, - LOCALIZED_VALUE clob, + OPTION_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (OPTION_ID, LOCALE) ); - create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( - LISTENER_CLASS varchar(255), - PROCESS_LISTENER_ORDER bigint, - OBJECT_ID bigint not null, - formSection_OBJECT_ID bigint, + create table CCM_CORE.FORMBUILDER_OPTIONS ( + PARAMETER_VALUE varchar(255), + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( - PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE clob, + PROCESS_LISTENER_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( - PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE clob, + PROCESS_LISTENER_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); + create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( + LISTENER_CLASS varchar(255), + PROCESS_LISTENER_ORDER int8, + OBJECT_ID int8 not null, + formSection_OBJECT_ID int8, + primary key (OBJECT_ID) + ); + create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER ( REMOTE_URL varchar(2048), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS ( RECIPIENT varchar(255), SUBJECT varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS ( - BODY clob, + BODY text, RECIPIENT varchar(255), SUBJECT varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); @@ -274,57 +284,57 @@ CREATE SCHEMA ccm_docrepo; DEFAULT_VALUE varchar(255), PARAMETER_MODEL varchar(255), PARAMETER_NAME varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS ( RECIPIENT varchar(255), SUBJECT varchar(255), - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); - create table CCM_CORE.GROUPS ( - PARTY_ID bigint not null, - primary key (PARTY_ID) - ); - create table CCM_CORE.GROUP_MEMBERSHIPS ( - MEMBERSHIP_ID bigint not null, - GROUP_ID bigint, - MEMBER_ID bigint, + MEMBERSHIP_ID int8 not null, + GROUP_ID int8, + MEMBER_ID int8, primary key (MEMBERSHIP_ID) ); + create table CCM_CORE.GROUPS ( + PARTY_ID int8 not null, + primary key (PARTY_ID) + ); + create table CCM_CORE.HOSTS ( - HOST_ID bigint not null, + HOST_ID int8 not null, SERVER_NAME varchar(512), - SERVER_PORT bigint, + SERVER_PORT int8, primary key (HOST_ID) ); create table CCM_CORE.INITS ( - INITIALIZER_ID bigint not null, + INITIALIZER_ID int8 not null, CLASS_NAME varchar(255), - REQUIRED_BY_ID bigint, + REQUIRED_BY_ID int8, primary key (INITIALIZER_ID) ); create table CCM_CORE.INSTALLED_MODULES ( - MODULE_ID integer not null, + MODULE_ID int4 not null, MODULE_CLASS_NAME varchar(2048), STATUS varchar(255), primary key (MODULE_ID) ); create table CCM_CORE.LUCENE_DOCUMENTS ( - DOCUMENT_ID bigint not null, - CONTENT clob, + DOCUMENT_ID int8 not null, + CONTENT text, CONTENT_SECTION varchar(512), COUNTRY varchar(8), CREATED timestamp, - DIRTY bigint, + DIRTY int8, DOCUMENT_LANGUAGE varchar(8), LAST_MODIFIED timestamp, SUMMARY varchar(4096), @@ -332,15 +342,15 @@ CREATE SCHEMA ccm_docrepo; TITLE varchar(4096), TYPE varchar(255), TYPE_SPECIFIC_INFO varchar(512), - CREATED_BY_PARTY_ID bigint, - LAST_MODIFIED_BY bigint, + CREATED_BY_PARTY_ID int8, + LAST_MODIFIED_BY int8, primary key (DOCUMENT_ID) ); create table CCM_CORE.LUCENE_INDEXES ( - INDEX_ID bigint not null, - LUCENE_INDEX_ID bigint, - HOST_ID bigint, + INDEX_ID int8 not null, + LUCENE_INDEX_ID int8, + HOST_ID int8, primary key (INDEX_ID) ); @@ -349,9 +359,9 @@ CREATE SCHEMA ccm_docrepo; BODY_MIME_TYPE varchar(255), SENT timestamp, SUBJECT varchar(255), - OBJECT_ID bigint not null, - IN_REPLY_TO_ID bigint, - SENDER_ID bigint, + OBJECT_ID int8 not null, + IN_REPLY_TO_ID int8, + SENDER_ID int8, primary key (OBJECT_ID) ); @@ -361,84 +371,131 @@ CREATE SCHEMA ccm_docrepo; EXPUNGE_MESSAGE boolean, FULFILL_DATE timestamp, HEADER varchar(4096), - MAX_RETRIES bigint, + MAX_RETRIES int8, REQUEST_DATE timestamp, SIGNATURE varchar(4096), STATUS varchar(32), - OBJECT_ID bigint not null, - DIGEST_ID bigint, - MESSAGE_ID bigint, - RECEIVER_ID bigint, + OBJECT_ID int8 not null, + DIGEST_ID int8, + MESSAGE_ID int8, + RECEIVER_ID int8, primary key (OBJECT_ID) ); + create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( + TOKEN_ID int8 not null, + PURPOSE varchar(255), + TOKEN varchar(255), + VALID_UNTIL timestamp, + USER_ID int8, + primary key (TOKEN_ID) + ); + + create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS ( + COMPONENT_MODEL_ID int8 not null, + CLASS_ATTRIBUTE varchar(512), + ID_ATTRIBUTE varchar(255), + COMPONENT_KEY varchar(255), + MODEL_UUID varchar(255) not null, + STYLE_ATTRIBUTE varchar(1024), + UUID varchar(255) not null, + PAGE_MODEL_ID int8, + primary key (COMPONENT_MODEL_ID) + ); + + create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( + PAGE_MODEL_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (PAGE_MODEL_ID, LOCALE) + ); + + create table CCM_CORE.PAGE_MODEL_TITLES ( + PAGE_MODEL_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (PAGE_MODEL_ID, LOCALE) + ); + + create table CCM_CORE.PAGE_MODELS ( + PAGE_MODEL_ID int8 not null, + MODEL_UUID varchar(255) not null, + NAME varchar(255), + TYPE varchar(255) not null, + UUID varchar(255) not null, + VERSION varchar(255) not null, + APPLICATION_ID int8, + primary key (PAGE_MODEL_ID) + ); + create table CCM_CORE.PARTIES ( - PARTY_ID bigint not null, + PARTY_ID int8 not null, NAME varchar(256) not null, primary key (PARTY_ID) ); create table CCM_CORE.PERMISSIONS ( - PERMISSION_ID bigint not null, + PERMISSION_ID int8 not null, CREATION_DATE timestamp, CREATION_IP varchar(255), - granted_privilege varchar(255), - CREATION_USER_ID bigint, - GRANTEE_ID bigint, - OBJECT_ID bigint, + GRANTED_PRIVILEGE varchar(255), + INHERITED boolean, + CREATION_USER_ID int8, + GRANTEE_ID int8, + INHERITED_FROM_ID int8, + OBJECT_ID int8, primary key (PERMISSION_ID) ); create table CCM_CORE.PORTALS ( TEMPLATE boolean, - OBJECT_ID bigint not null, + OBJECT_ID int8 not null, primary key (OBJECT_ID) ); create table CCM_CORE.PORTLETS ( - CELL_NUMBER bigint, - SORT_KEY bigint, - OBJECT_ID bigint not null, - PORTAL_ID bigint, + CELL_NUMBER int8, + SORT_KEY int8, + OBJECT_ID int8 not null, + PORTAL_ID int8, primary key (OBJECT_ID) ); create table CCM_CORE.QUEUE_ITEMS ( - QUEUE_ITEM_ID bigint not null, + QUEUE_ITEM_ID int8 not null, HEADER varchar(4096), RECEIVER_ADDRESS varchar(512), - RETRY_COUNT bigint, + RETRY_COUNT int8, SIGNATURE varchar(4096), SUCCESSFUL_SENDED boolean, - MESSAGE_ID bigint, - RECEIVER_ID bigint, + MESSAGE_ID int8, + RECEIVER_ID int8, primary key (QUEUE_ITEM_ID) ); - create table CCM_CORE.RESOURCES ( - CREATED timestamp, - OBJECT_ID bigint not null, - parent_OBJECT_ID bigint, - resourceType_RESOURCE_TYPE_ID bigint, - primary key (OBJECT_ID) - ); - create table CCM_CORE.RESOURCE_DESCRIPTIONS ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TITLES ( - OBJECT_ID bigint not null, - LOCALIZED_VALUE clob, + OBJECT_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); + create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( + RESOURCE_TYPE_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (RESOURCE_TYPE_ID, LOCALE) + ); + create table CCM_CORE.RESOURCE_TYPES ( - RESOURCE_TYPE_ID bigint not null, + RESOURCE_TYPE_ID int8 not null, SINGLETON boolean, TITLE varchar(254) not null, EMBEDDED_VIEW boolean, @@ -447,98 +504,71 @@ CREATE SCHEMA ccm_docrepo; primary key (RESOURCE_TYPE_ID) ); - create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( - RESOURCE_TYPE_ID bigint not null, - LOCALIZED_VALUE clob, + create table CCM_CORE.RESOURCES ( + CREATED timestamp, + OBJECT_ID int8 not null, + parent_OBJECT_ID int8, + resourceType_RESOURCE_TYPE_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_CORE.ROLE_DESCRIPTIONS ( + ROLE_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, - primary key (RESOURCE_TYPE_ID, LOCALE) + primary key (ROLE_ID, LOCALE) ); create table CCM_CORE.ROLE_MEMBERSHIPS ( - MEMBERSHIP_ID bigint not null, - MEMBER_ID bigint, - ROLE_ID bigint, + MEMBERSHIP_ID int8 not null, + MEMBER_ID int8, + ROLE_ID int8, primary key (MEMBERSHIP_ID) ); create table CCM_CORE.SETTINGS ( - name varchar(512) not null, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_BIG_DECIMAL ( - setting_value decimal(19,2), - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_BOOLEAN ( - setting_value boolean, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_DOUBLE ( - setting_value double, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_ENUM ( - OBJECT_ID bigint not null, - primary key (OBJECT_ID) + DTYPE varchar(31) not null, + SETTING_ID int8 not null, + CONFIGURATION_CLASS varchar(512) not null, + NAME varchar(512) not null, + SETTING_VALUE_LONG int8, + SETTING_VALUE_BOOLEAN boolean, + SETTING_VALUE_STRING varchar(1024), + SETTING_VALUE_DOUBLE float8, + SETTING_VALUE_BIG_DECIMAL numeric(19, 2), + primary key (SETTING_ID) ); create table CCM_CORE.SETTINGS_ENUM_VALUES ( - ENUM_ID bigint not null, + ENUM_ID int8 not null, value varchar(255) ); - create table CCM_CORE.SETTINGS_L10N_STRING ( - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( - ENTRY_ID bigint not null, - LOCALIZED_VALUE clob, + ENTRY_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (ENTRY_ID, LOCALE) ); - create table CCM_CORE.SETTINGS_LONG ( - setting_value bigint, - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_CORE.SETTINGS_STRING ( - setting_value varchar(1024), - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - create table CCM_CORE.SETTINGS_STRING_LIST ( - OBJECT_ID bigint not null, - LIST_ID bigint not null, - value varchar(255), - primary key (OBJECT_ID) - ); - - create table CCM_CORE.TASK_ASSIGNMENTS ( - TASK_ASSIGNMENT_ID bigint not null, - ROLE_ID bigint, - TASK_ID bigint, - primary key (TASK_ASSIGNMENT_ID) + LIST_ID int8 not null, + value varchar(255) ); create table CCM_CORE.THREADS ( - OBJECT_ID bigint not null, - ROOT_ID bigint, + OBJECT_ID int8 not null, + ROOT_ID int8, primary key (OBJECT_ID) ); + create table CCM_CORE.USER_EMAIL_ADDRESSES ( + USER_ID int8 not null, + EMAIL_ADDRESS varchar(512) not null, + BOUNCING boolean, + VERIFIED boolean + ); + create table CCM_CORE.USERS ( BANNED boolean, FAMILY_NAME varchar(512), @@ -548,137 +578,89 @@ CREATE SCHEMA ccm_docrepo; EMAIL_ADDRESS varchar(512) not null, BOUNCING boolean, VERIFIED boolean, - PARTY_ID bigint not null, + PARTY_ID int8 not null, primary key (PARTY_ID) ); - create table CCM_CORE.USER_EMAIL_ADDRESSES ( - USER_ID bigint not null, - EMAIL_ADDRESS varchar(512) not null, - BOUNCING boolean, - VERIFIED boolean - ); - - create table CCM_CORE.WORKFLOWS ( - WORKFLOW_ID bigint not null, - primary key (WORKFLOW_ID) + create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS ( + DUE_DATE timestamp, + DURATION_MINUTES int8, + LOCKED boolean, + START_DATE timestamp, + TASK_ID int8 not null, + LOCKING_USER_ID int8, + NOTIFICATION_SENDER int8, + primary key (TASK_ID) ); create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( - WORKFLOW_ID bigint not null, - LOCALIZED_VALUE clob, + WORKFLOW_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_NAMES ( - WORKFLOW_ID bigint not null, - LOCALIZED_VALUE clob, + WORKFLOW_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); - create table CCM_CORE.WORKFLOW_TASKS ( - TASK_ID bigint not null, - ACTIVE boolean, - TASK_STATE varchar(512), - WORKFLOW_ID bigint, - primary key (TASK_ID) - ); - - create table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS ( - TASK_ID bigint not null, - LOCALIZED_VALUE clob, - LOCALE varchar(255) not null, - primary key (TASK_ID, LOCALE) + create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS ( + TASK_ASSIGNMENT_ID int8 not null, + ROLE_ID int8, + TASK_ID int8, + primary key (TASK_ASSIGNMENT_ID) ); create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( - TASK_ID bigint not null, - COMMENT clob + COMMENT_ID int8 not null, + COMMENT text, + UUID varchar(255) not null, + AUTHOR_ID int8, + TASK_ID int8, + primary key (COMMENT_ID) ); create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( - DEPENDS_ON_TASK_ID bigint not null, - DEPENDENT_TASK_ID bigint not null + DEPENDS_ON_TASK_ID int8 not null, + DEPENDENT_TASK_ID int8 not null ); - create table CCM_CORE.WORKFLOW_TASK_LABELS ( - TASK_ID bigint not null, - LOCALIZED_VALUE clob, + create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( + TASK_ID int8 not null, + LOCALIZED_VALUE text, LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); - create table CCM_CORE.WORKFLOW_USER_TASKS ( - TASK_ID bigint not null, + create table CCM_CORE.WORKFLOW_TASK_LABELS ( + TASK_ID int8 not null, + LOCALIZED_VALUE text, + LOCALE varchar(255) not null, + primary key (TASK_ID, LOCALE) + ); + + create table CCM_CORE.WORKFLOW_TASKS ( + TASK_ID int8 not null, ACTIVE boolean, TASK_STATE varchar(512), - WORKFLOW_ID bigint, - DUE_DATE timestamp, - DURATION_MINUTES bigint, - LOCKED boolean, - START_DATE timestamp, - LOCKING_USER_ID bigint, - NOTIFICATION_SENDER bigint, + UUID varchar(255) not null, + WORKFLOW_ID int8, primary key (TASK_ID) ); - create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( - TOKEN_ID bigint not null, - PURPOSE varchar(255), - TOKEN varchar(255), - VALID_UNTIL timestamp, - USER_ID bigint, - primary key (TOKEN_ID) - ); - - create table CCM_DOCREPO.BLOB_OBJECTS ( - BLOB_OBJECT_ID bigint not null, - CONTENT blob, - primary key (BLOB_OBJECT_ID) - ); - - create table CCM_DOCREPO.FILES ( - OBJECT_ID bigint not null, - CONTENT_ID bigint, - primary key (OBJECT_ID) - ); - - create table CCM_DOCREPO.FOLDERS ( - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_DOCREPO.REC_UPD_DOCS_PORTLETS ( - OBJECT_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_DOCREPO.REPOSITORIES ( - NAME varchar(512) not null, - OBJECT_ID bigint not null, - OWNER_ID bigint not null, - ROOT_FOLDER_ID bigint not null, - primary key (OBJECT_ID) - ); - - create table CCM_DOCREPO.RESOURCES ( - CREATION_DATE timestamp, - CREATION_IP varchar(255), - DESCRIPTION varchar(255), - LAST_MODIFIED_DATE timestamp, - LAST_MODIFIED_IP varchar(255), - MIME_TYPE varchar(255), - NAME varchar(512) not null, - PATH varchar(255), - SIZE bigint, - OBJECT_ID bigint not null, - CREATION_USER_ID bigint, - LAST_MODIFIED_USER_ID bigint, - PARENT_ID bigint, - REPOSITORY_ID bigint, - primary key (OBJECT_ID) + create table CCM_CORE.WORKFLOWS ( + WORKFLOW_ID int8 not null, + abstract_workflow boolean, + ACTIVE boolean, + WORKFLOW_STATE varchar(255), + TASKS_STATE varchar(255), + UUID varchar(255) not null, + OBJECT_ID int8, + TEMPLATE_ID int8, + primary key (WORKFLOW_ID) ); alter table CCM_CORE.CATEGORY_DOMAINS @@ -687,12 +669,76 @@ CREATE SCHEMA ccm_docrepo; alter table CCM_CORE.CATEGORY_DOMAINS add constraint UK_i1xqotjvml7i6ro2jq22fxf5g unique (URI); + alter table CCM_CORE.CCM_OBJECTS + add constraint UK_1cm71jlagvyvcnkqvxqyit3wx unique (UUID); + alter table CCM_CORE.HOSTS - add constraint UK_9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); + add constraint UK9ramlv6uxwt13v0wj7q0tucsx unique (SERVER_NAME, SERVER_PORT); alter table CCM_CORE.INSTALLED_MODULES add constraint UK_11imwgfojyi4hpr18uw9g3jvx unique (MODULE_CLASS_NAME); + alter table CCM_CORE.SETTINGS + add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID); + + alter table CCM_CORE.WORKFLOW_TASKS + add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID); + + alter table CCM_CORE.WORKFLOWS + add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); + + create table CCM_DOCREPO.BLOB_OBJECTS ( + BLOB_OBJECT_ID int8 not null, + CONTENT oid, + UUID varchar(255) not null, + primary key (BLOB_OBJECT_ID) + ); + + create table CCM_DOCREPO.FILES ( + OBJECT_ID int8 not null, + CONTENT_ID int8, + primary key (OBJECT_ID) + ); + + create table CCM_DOCREPO.FOLDERS ( + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_DOCREPO.REC_UPD_DOCS_PORTLETS ( + OBJECT_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_DOCREPO.REPOSITORIES ( + NAME varchar(512) not null, + OBJECT_ID int8 not null, + OWNER_ID int8 not null, + ROOT_FOLDER_ID int8 not null, + primary key (OBJECT_ID) + ); + + create table CCM_DOCREPO.RESOURCES ( + CREATION_DATE timestamp not null, + CREATION_IP varchar(255), + DESCRIPTION varchar(255), + LAST_MODIFIED_DATE timestamp not null, + LAST_MODIFIED_IP varchar(255), + MIME_TYPE varchar(255), + NAME varchar(512) not null, + PATH varchar(255), + SIZE int8, + OBJECT_ID int8 not null, + CREATION_USER_ID int8, + LAST_MODIFIED_USER_ID int8, + PARENT_ID int8, + REPOSITORY_ID int8, + primary key (OBJECT_ID) + ); + alter table CCM_DOCREPO.REPOSITORIES add constraint UK_n24tjtffp9k0wwng0p6s86mrp unique (NAME); @@ -705,539 +751,579 @@ CREATE SCHEMA ccm_docrepo; alter table CCM_DOCREPO.RESOURCES add constraint UK_gl32co8ta3opblaihamh6d0fk unique (PATH); + create sequence hibernate_sequence start 1 increment 1; + alter table CCM_CORE.APPLICATIONS - add constraint FK_sn1sqtx94nhxgv282ymoqiock + add constraint FKatcp9ij6mbkx0nfeig1o6n3lm foreign key (OBJECT_ID) references CCM_CORE.RESOURCES; alter table CCM_CORE.ATTACHMENTS - add constraint FK_fwm2uvhmqg8bmo1d66g0b6be9 + add constraint FK8ju9hm9baceridp803nislkwb foreign key (MESSAGE_ID) references CCM_CORE.MESSAGES; alter table CCM_CORE.CATEGORIES - add constraint FK_4sghd3hxh69xgu68m8uh2axej + add constraint FKrj3marx99nheur4fqanm0ylur foreign key (PARENT_CATEGORY_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORIES - add constraint FK_pvjwyfbuwafc1mlyevgwwyg49 + add constraint FKpm291swli2musd0204phta652 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FK_2onruptfmyn5mu8f5j2o4h8i3 + add constraint FKejp0ubk034nfq60v1po6srkke foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORIZATIONS - add constraint FK_k43sltpj69u3y5eltkjhumc4p + add constraint FKoyeipswl876wa6mqwbx0uy83h foreign key (CATEGORY_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DESCRIPTIONS - add constraint FK_55equbyl81ut4yyt6jms57jwr + add constraint FKhiwjlmh5vkbu3v3vng1la1qum foreign key (OBJECT_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FK_jyt6c67quitehuh5xe7ulhqvu + add constraint FKf25vi73cji01w8fgo6ow1dgg foreign key (ROOT_CATEGORY_ID) references CCM_CORE.CATEGORIES; alter table CCM_CORE.CATEGORY_DOMAINS - add constraint FK_40h1mx7tdlmjvb6x2e04jqgi7 + add constraint FK58xpmnvciohkom1c16oua4xha foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.CATEGORY_TITLES - add constraint FK_954p2g6kwhef5h41pfcda812u + add constraint FKka9bt9f5br0kji5bcjxcmf6ch foreign key (OBJECT_ID) references CCM_CORE.CATEGORIES; + alter table CCM_CORE.CCM_OBJECTS_AUD + add constraint FKr00eauutiyvocno8ckx6h9nw6 + foreign key (REV) + references CCM_CORE.CCM_REVISIONS; + + alter table CCM_CORE.CCM_OBJECTS_AUD + add constraint FKo5s37ctcdny7tmewjwv7705h5 + foreign key (REVEND) + references CCM_CORE.CCM_REVISIONS; + alter table CCM_CORE.DIGESTS - add constraint FK_3xrcpufumqnh4ke4somt89rvh + add constraint FKc53g09agnye3w1v4euy3e0gsi foreign key (FROM_PARTY_ID) references CCM_CORE.PARTIES; alter table CCM_CORE.DIGESTS - add constraint FK_4sxl35dvaj54ck0ikf850h58x + add constraint FK845r9ep6xu6nbt1mvxulwybym foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.DOMAIN_DESCRIPTIONS - add constraint FK_12rneohwyp6p66ioyoyobvkxr + add constraint FKn4i2dxgn8cqysa62dds6eih6a foreign key (OBJECT_ID) references CCM_CORE.CATEGORY_DOMAINS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK_m53bm8ecspukj3qj99q9xa8ox + add constraint FK47nsasr7jrdwlky5gx0u6e9py foreign key (domain_OBJECT_ID) references CCM_CORE.CATEGORY_DOMAINS; alter table CCM_CORE.DOMAIN_OWNERSHIPS - add constraint FK_ce4xhu9ilpdvjsmrsjb739t64 + add constraint FK3u4hq6yqau4m419b1xva3xpwq foreign key (owner_OBJECT_ID) references CCM_CORE.APPLICATIONS; alter table CCM_CORE.DOMAIN_TITLES - add constraint FK_98kfhafuv6lmhnpkhurwp9bgm + add constraint FK5p526dsdwn94els6lp5w0hdn4 foreign key (OBJECT_ID) references CCM_CORE.CATEGORY_DOMAINS; + alter table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS + add constraint FKfh0k9lj3pf4amfc9bbbss0tr1 + foreign key (COMPONENT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FK_72108sd6vsqt88g3fb4kl6o81 + add constraint FKpcpmvyiix023b4g5n4q8nkfca foreign key (parentComponent_OBJECT_ID) references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_COMPONENTS - add constraint FK_f9xo42yrxdjxqedrk3t2upm9e + add constraint FKt0e0uv00pp1rwhyaltrytghnm foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; - alter table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS - add constraint FK_2njuft67tbfnkxsr62r0bmhh3 - foreign key (COMPONENT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; - alter table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER - add constraint FK_qm4q6qc2p81e349jgpoyxpq10 + add constraint FK48khrbud3xhi2gvsvnlttd8tg foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS - add constraint FK_cq44p887dqh2ycd0htku119wf + add constraint FKbyjjt2ufendvje2obtge2l7et foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS - add constraint FK_qeyxu4t8aqosmoup7ho9qrtae + add constraint FK8oriyta1957u7dvbrqk717944 foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_DATA_QUERIES - add constraint FK_6xtng7pfv18ixfpid57grfh4 + add constraint FKhhaxpeddbtmrnjr5o0fopju3a foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS - add constraint FK_2rlo453aslip0ng1fpyv022ld + add constraint FKsmduu1opoiulkeo2gc8v7lsbn foreign key (DATA_QUERY_ID) references CCM_CORE.FORMBUILDER_DATA_QUERIES; alter table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES - add constraint FK_9nqk2rpq4exw708vobkmdcr1s + add constraint FKju1x82inrw3kguyjuxoetn6gn foreign key (DATA_QUERY_ID) references CCM_CORE.FORMBUILDER_DATA_QUERIES; alter table CCM_CORE.FORMBUILDER_FORMSECTIONS - add constraint FK_anavw6ab288yo2d90axcebv1p + add constraint FKnfhsgxp4lvigq2pm33pn4afac foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FK_lnlrrafk9r9v072vqtmnkwkou + add constraint FK33ilyirwoux28yowafgd5xx0o foreign key (widget_OBJECT_ID) references CCM_CORE.FORMBUILDER_WIDGETS; alter table CCM_CORE.FORMBUILDER_LISTENERS - add constraint FK_2ynw5cse8kayvi9wqdgg477w0 + add constraint FKlqm76746nq5yrt8ganm474uu0 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_METAOBJECTS - add constraint FK_9bx162hal2lqub5m5c21hh31r + add constraint FKf963v6u9mw8pwjmasrw51w8dx foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.FORMBUILDER_OBJECT_TYPES - add constraint FK_qaj6yd47l5trvvxtnxeao1c33 + add constraint FKkv337e83rsecf0h3qy8bu7l9w foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; - alter table CCM_CORE.FORMBUILDER_OPTIONS - add constraint FK_6s1dxx8lfky4l5ibtd20ouvuj - foreign key (OBJECT_ID) - references CCM_CORE.FORMBUILDER_COMPONENTS; - alter table CCM_CORE.FORMBUILDER_OPTION_LABELS - add constraint FK_90c86qtfefh98jcche7rtk5ms + add constraint FKatlsylsvln6yse55eof6wwkj6 foreign key (OPTION_ID) references CCM_CORE.FORMBUILDER_OPTIONS; - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FK_2a4hflqpujuxvx90bsnie3s33 - foreign key (formSection_OBJECT_ID) - references CCM_CORE.FORMBUILDER_FORMSECTIONS; - - alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS - add constraint FK_dth0onqirda98fvvpo1rtpjxi + alter table CCM_CORE.FORMBUILDER_OPTIONS + add constraint FKhe5q71wby9g4i56sotc501h11 foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; + references CCM_CORE.FORMBUILDER_COMPONENTS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS - add constraint FK_cynaaq1405ih7epmt4k6vv5m1 + add constraint FKcv3iu04gxjk9c0pn6tl8rqqv3 foreign key (PROCESS_LISTENER_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES - add constraint FK_gpc3rhvwhy9038k7or5ud8mim + add constraint FK8rnyb1m6ij3b9hhmhr7klgd4p foreign key (PROCESS_LISTENER_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS + add constraint FK7uiaeax8qafm82e5k729ms5ku + foreign key (formSection_OBJECT_ID) + references CCM_CORE.FORMBUILDER_FORMSECTIONS; + + alter table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS + add constraint FKbdnloo884qk6gn36jwiqv5rlp + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + alter table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER - add constraint FK_b6b0wn2j0mps0ml4jh8s46y4r + add constraint FKpajvu9m6fj1enm67a9gcb5ii9 foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS - add constraint FK_33n9b1q1goybwbvvaotnq4n7 + add constraint FKsn82ktlq0c9ikijyv8k2bfv4f foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; alter table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS - add constraint FK_iqwglkvml7y4yevaq8s1936im + add constraint FK8kjyu72btjsuaaqh4bvd8npns foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; + alter table CCM_CORE.FORMBUILDER_WIDGETS + add constraint FK1wosr4ujbfckdc50u5fgmrhrk + foreign key (OBJECT_ID) + references CCM_CORE.FORMBUILDER_COMPONENTS; + alter table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS - add constraint FK_kcfevkdytrk81gj08f4aeh3qu + add constraint FKjie9co03m7ow4ihig5rk7l8oj foreign key (OBJECT_ID) references CCM_CORE.FORMBUILDER_PROCESS_LISTENERS; - alter table CCM_CORE.GROUPS - add constraint FK_bm1g1sp4aav32ghhbo04gkakl - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; - alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FK_8fitvs176l2fpsoplbbsaxpjo + add constraint FKq4qnny8ri3eo7eqh4olxco8nk foreign key (GROUP_ID) references CCM_CORE.GROUPS; alter table CCM_CORE.GROUP_MEMBERSHIPS - add constraint FK_7ttmeu1wo1bhgnxvqm5hksbwm + add constraint FKc8u86ivkhvoiw6ju8b2p365he foreign key (MEMBER_ID) references CCM_CORE.USERS; + alter table CCM_CORE.GROUPS + add constraint FK4f61mlqxw0ct6s7wwpi9m0735 + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; + alter table CCM_CORE.INITS - add constraint FK_jm1ulcmd86shcy83907ojny4q + add constraint FK3nvvxk10nmq9nfuko8yklqdgc foreign key (REQUIRED_BY_ID) references CCM_CORE.INITS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FK_hhbqgpg0ocewhlr2cclrtsj7r + add constraint FK942kl4yff8rdiwr0pjk2a9g8 foreign key (CREATED_BY_PARTY_ID) references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_DOCUMENTS - add constraint FK_mp7nlc3u4t38x0cevx0bg022s + add constraint FKc5rs6afx4p9fidabfqsxr5ble foreign key (LAST_MODIFIED_BY) references CCM_CORE.USERS; alter table CCM_CORE.LUCENE_INDEXES - add constraint FK_f5ddcxpneculqmctmixjus42k + add constraint FK6gu0yrlviqk07dtb3r02iw43f foreign key (HOST_ID) references CCM_CORE.HOSTS; alter table CCM_CORE.MESSAGES - add constraint FK_pymp95s2bsv5dke8dxbdmdx1d + add constraint FKph10aehmg9f20pn2w4buki97q foreign key (IN_REPLY_TO_ID) references CCM_CORE.MESSAGES; alter table CCM_CORE.MESSAGES - add constraint FK_7w5nh4eo1l5idhvfwvkv02yyi + add constraint FKjufsx3c3h538fj35h8hgfnb1p foreign key (SENDER_ID) references CCM_CORE.USERS; alter table CCM_CORE.MESSAGES - add constraint FK_t98lp1382qxby5c7b34j238pc + add constraint FK6w20ao7scwecd9mfwpun2ddqx foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_a2hr4wa8qqnoj0njlrkuak3s6 + add constraint FKqk70c1x1dklhty9ju5t4wukd9 foreign key (DIGEST_ID) references CCM_CORE.DIGESTS; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_ck8hytjcms2iwen7q538n49nu + add constraint FKtt4fjr2p75og79jxxgd8q8mr foreign key (MESSAGE_ID) references CCM_CORE.MESSAGES; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_lp67f9mq0basheao3o81xj0xh + add constraint FK2vlnma0ox43j0clx8ead08n5s foreign key (RECEIVER_ID) references CCM_CORE.PARTIES; alter table CCM_CORE.NOTIFICATIONS - add constraint FK_2aqx4bgfyhhh4g3pvvjh8hy0w - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.PERMISSIONS - add constraint FK_7f7dd6k54fi1vy3llbvrer061 - foreign key (CREATION_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_CORE.PERMISSIONS - add constraint FK_cnt8ay16396ldn10w9yqfvtib - foreign key (GRANTEE_ID) - references CCM_CORE.CCM_ROLES; - - alter table CCM_CORE.PERMISSIONS - add constraint FK_5d855uu7512wakcver0bvdc3f - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.PORTALS - add constraint FK_2san7d6vxf5jhesvar5hq57v4 - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.PORTLETS - add constraint FK_46ty07r54th9qc87pyi31jdqs - foreign key (PORTAL_ID) - references CCM_CORE.PORTALS; - - alter table CCM_CORE.PORTLETS - add constraint FK_r0tybwnahtdoo68tbna9q3s75 - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.QUEUE_ITEMS - add constraint FK_kskdba7a8ytgc5fxen06peg7 - foreign key (MESSAGE_ID) - references CCM_CORE.MESSAGES; - - alter table CCM_CORE.QUEUE_ITEMS - add constraint FK_iccfxv2glwbqa465s8125ftgm - foreign key (RECEIVER_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.RESOURCES - add constraint FK_ceqi7mfjyk4vdoiyie09kmgj - foreign key (parent_OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCES - add constraint FK_eodj9xd1rmdokm4c3ir1l7s4d - foreign key (resourceType_RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; - - alter table CCM_CORE.RESOURCES - add constraint FK_f600trvtav1r0n6oy7nri9wry - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.RESOURCE_DESCRIPTIONS - add constraint FK_pcahs6vr1ajb3a4mh0vi4stuy - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TITLES - add constraint FK_brvlxvpy2f1n67562twvvux7s - foreign key (OBJECT_ID) - references CCM_CORE.RESOURCES; - - alter table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS - add constraint FK_7860pdhhck6opa22gc9u0pgfu - foreign key (RESOURCE_TYPE_ID) - references CCM_CORE.RESOURCE_TYPES; - - alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FK_hueyk522he8t6fa1blnpcslap - foreign key (MEMBER_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.ROLE_MEMBERSHIPS - add constraint FK_eykbm84ndwgpqsr48wekhdoqj - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; - - alter table CCM_CORE.SETTINGS - add constraint FK_3k0t3in140j6wj6eq5olwjgu - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.SETTINGS_BIG_DECIMAL - add constraint FK_9mbdc1rjkm80edyuijnkwl6ak - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_BOOLEAN - add constraint FK_1mjjvpjxpwicyv8im6mumc7ug - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_DOUBLE - add constraint FK_kejnkuyk89tw59xg550kugwb5 - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_ENUM - add constraint FK_fgrfc2qbl2f2t1l0ku8wo2e5r - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_ENUM_VALUES - add constraint FK_sq653hqyeeklci0y7pvoxf5ha - foreign key (ENUM_ID) - references CCM_CORE.SETTINGS_ENUM; - - alter table CCM_CORE.SETTINGS_L10N_STRING - add constraint FK_evnyfg9udprxmbginhc4o0is9 - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_L10N_STR_VALUES - add constraint FK_t21obt5do2tjhskjxgxd5143r - foreign key (ENTRY_ID) - references CCM_CORE.SETTINGS_L10N_STRING; - - alter table CCM_CORE.SETTINGS_LONG - add constraint FK_2l4bw7pbq3koj81cjyoqpenjj - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_STRING - add constraint FK_naonte6jut7b842icvp9ahino - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_STRING_LIST - add constraint FK_34s3comqq4mhy9kcr04iavfef - foreign key (OBJECT_ID) - references CCM_CORE.SETTINGS; - - alter table CCM_CORE.SETTINGS_STRING_LIST - add constraint FK_obwiaa74lrjqjlpjidjltysoq - foreign key (LIST_ID) - references CCM_CORE.SETTINGS_STRING_LIST; - - alter table CCM_CORE.TASK_ASSIGNMENTS - add constraint FK_klh64or0yq26c63181j1tps2o - foreign key (ROLE_ID) - references CCM_CORE.CCM_ROLES; - - alter table CCM_CORE.TASK_ASSIGNMENTS - add constraint FK_fu6ukne6hj8ihlfxtmp17xpfj - foreign key (TASK_ID) - references CCM_CORE.WORKFLOW_USER_TASKS; - - alter table CCM_CORE.THREADS - add constraint FK_oopqroe5a8fg932teo0cyifcv - foreign key (ROOT_ID) - references CCM_CORE.MESSAGES; - - alter table CCM_CORE.THREADS - add constraint FK_n86cmt6poesgsr4g4c4q07i9f - foreign key (OBJECT_ID) - references CCM_CORE.CCM_OBJECTS; - - alter table CCM_CORE.USERS - add constraint FK_9gwih54tm0rn63e536f6s9oti - foreign key (PARTY_ID) - references CCM_CORE.PARTIES; - - alter table CCM_CORE.USER_EMAIL_ADDRESSES - add constraint FK_tp5wms6tgfl827ihqbcgskusy - foreign key (USER_ID) - references CCM_CORE.USERS; - - alter table CCM_CORE.WORKFLOW_DESCRIPTIONS - add constraint FK_sp01mgi5mi5wbwrh8ivnfpw2n - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_NAMES - add constraint FK_rmkgykysvk7su7h5tij67p2r3 - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_TASKS - add constraint FK_bawikoiw1k0bil1bvwq5qpa0j - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_CORE.WORKFLOW_USER_TASKS - add constraint FK_byuic3urkanoiqjnf6awfqmyk - foreign key (LOCKING_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_CORE.WORKFLOW_USER_TASKS - add constraint FK_2dtlvmuapubq81quny4elndh - foreign key (NOTIFICATION_SENDER) - references CCM_CORE.USERS; - - alter table CCM_CORE.WORKFLOW_USER_TASKS - add constraint FK_bg60xxg9kerqsxyphbfxulg8y - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - - alter table CCM_DOCREPO.FILES - add constraint FK_s412u1ou70hc2sdj26e5638o - foreign key (CONTENT_ID) - references CCM_DOCREPO.BLOB_OBJECTS; - - alter table CCM_DOCREPO.FILES - add constraint FK_4w157foajv876017oiexm1a1d - foreign key (OBJECT_ID) - references CCM_DOCREPO.RESOURCES; - - alter table CCM_DOCREPO.FOLDERS - add constraint FK_byhuep63cwuywql7ymp3cr2d6 - foreign key (OBJECT_ID) - references CCM_DOCREPO.RESOURCES; - - alter table CCM_DOCREPO.REC_UPD_DOCS_PORTLETS - add constraint FK_jqcd60j6cuisivbpie4kccx4 - foreign key (OBJECT_ID) - references CCM_CORE.PORTLETS; - - alter table CCM_DOCREPO.REPOSITORIES - add constraint FK_oeoim1ueaad0wkhlgm6hnu0ad - foreign key (OWNER_ID) - references CCM_CORE.USERS; - - alter table CCM_DOCREPO.REPOSITORIES - add constraint FK_li6a82kt97qrftfobdo1bweaq - foreign key (ROOT_FOLDER_ID) - references CCM_DOCREPO.FOLDERS; - - alter table CCM_DOCREPO.REPOSITORIES - add constraint FK_n8ueci6o4q3g5u2uk4j37aeq4 - foreign key (OBJECT_ID) - references CCM_CORE.APPLICATIONS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_25wui494pab6yrs80ibq94gs1 - foreign key (CREATION_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_a6l3gmrpjfwd1yfcqdj1vewum - foreign key (LAST_MODIFIED_USER_ID) - references CCM_CORE.USERS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_jjyxytwliy3l6cp3ouudcp8yy - foreign key (PARENT_ID) - references CCM_DOCREPO.FOLDERS; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_1lkenqs1i2j4upr5xphre0ku4 - foreign key (REPOSITORY_ID) - references CCM_DOCREPO.REPOSITORIES; - - alter table CCM_DOCREPO.RESOURCES - add constraint FK_f600trvtav1r0n6oy7nri9wry + add constraint FKf423hhiaw1bexpxeh1pnas7qt foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.ONE_TIME_AUTH_TOKENS - add constraint FK_fvr3t6w3nsm3u29mjuh4tplno + add constraint FKtplfuphkiorfkttaewb4wmfjc foreign key (USER_ID) references CCM_CORE.USERS; - create sequence hibernate_sequence start with 1 increment by 1; + alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS + add constraint FKo696ch035fe7rrueol1po13od + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS + add constraint FKcc5d6eqxu1369k8ycyyt6vn3e + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODEL_TITLES + add constraint FKj14q9911yhd4js9p6rs21rwjf + foreign key (PAGE_MODEL_ID) + references CCM_CORE.PAGE_MODELS; + + alter table CCM_CORE.PAGE_MODELS + add constraint FKk2lihllrxj89mn3tqv43amafe + foreign key (APPLICATION_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKj9di7pawxgtouxmu2k44bj5c4 + foreign key (CREATION_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKikx3x0kn9fito23g50v6xbr9f + foreign key (GRANTEE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.PERMISSIONS + add constraint FKg56ujjoe0j30pq579rf0l5yc6 + foreign key (INHERITED_FROM_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.PERMISSIONS + add constraint FKkamckexjnffnt8lay9nqeawhm + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.PORTALS + add constraint FK5a2hdrbw03mmgr74vj5nxlpvk + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.PORTLETS + add constraint FK9gr5xjt3rx4uhtw7vl6adruol + foreign key (PORTAL_ID) + references CCM_CORE.PORTALS; + + alter table CCM_CORE.PORTLETS + add constraint FKjmx9uebt0gwxkw3xv34niy35f + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.QUEUE_ITEMS + add constraint FKtgkwfruv9kjdybf46l02da088 + foreign key (MESSAGE_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.QUEUE_ITEMS + add constraint FKs9aq1hyxstwmvx7fmfifp4x7r + foreign key (RECEIVER_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.RESOURCE_DESCRIPTIONS + add constraint FKk9arvj5u21rv23ce3cav4opqx + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCE_TITLES + add constraint FKto4p6n2wklljyf7tmuxtmyfe0 + foreign key (OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS + add constraint FKckpihjtv23iahbg3imnpbsr2 + foreign key (RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; + + alter table CCM_CORE.RESOURCES + add constraint FKbo7ibfgodicn9flv2gfo11g5a + foreign key (parent_OBJECT_ID) + references CCM_CORE.RESOURCES; + + alter table CCM_CORE.RESOURCES + add constraint FK262fbwetpjx3k4uuvw24wsiv + foreign key (resourceType_RESOURCE_TYPE_ID) + references CCM_CORE.RESOURCE_TYPES; + + alter table CCM_CORE.RESOURCES + add constraint FKbjdf8pm4frth8r06ev2qjm88f + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.ROLE_DESCRIPTIONS + add constraint FKo09bh4j3k3k0ph3awvjwx31ft + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.ROLE_MEMBERSHIPS + add constraint FK9m88ywi7rcin7b7jrgh53emrq + foreign key (MEMBER_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.ROLE_MEMBERSHIPS + add constraint FKcsyogv5m2rgsrmtgnhgkjhfw7 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.SETTINGS_ENUM_VALUES + add constraint FK8mw4p92s0h3h8bmo8saowu32i + foreign key (ENUM_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.SETTINGS_L10N_STR_VALUES + add constraint FK5knjq7cisej0qfx5dw1y93rou + foreign key (ENTRY_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.SETTINGS_STRING_LIST + add constraint FKqeclqa5sf1g53vxs857tpwrus + foreign key (LIST_ID) + references CCM_CORE.SETTINGS; + + alter table CCM_CORE.THREADS + add constraint FKsx08mpwvwnw97uwdgjs76q39g + foreign key (ROOT_ID) + references CCM_CORE.MESSAGES; + + alter table CCM_CORE.THREADS + add constraint FKp97b1sy1kop07rtapeh5l9fb2 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.USER_EMAIL_ADDRESSES + add constraint FKr900l79erul95seyyccf04ufc + foreign key (USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.USERS + add constraint FKosh928q71aonu6l1kurb417r + foreign key (PARTY_ID) + references CCM_CORE.PARTIES; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FK1pnsq9ur3ylq0ghuj23p4cogs + foreign key (LOCKING_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FK9ngp088m8xa82swy7yg3qx6vh + foreign key (NOTIFICATION_SENDER) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS + add constraint FKt9ha3no3bj8a50pnw8cnqh2cq + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_DESCRIPTIONS + add constraint FKgx7upkqky82dpxvbs95imfl9l + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOW_NAMES + add constraint FKkxedy9p48avfk45r0bn4uc09i + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS + add constraint FKpq4paqtfbi5erhh98wl1ja005 + foreign key (ROLE_ID) + references CCM_CORE.CCM_ROLES; + + alter table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS + add constraint FK3933ol31co3yn5ee75b2hmhgp + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint FKd2ymdg8nay9pmh2nn2whba0j8 + foreign key (AUTHOR_ID) + references CCM_CORE.USERS; + + alter table CCM_CORE.WORKFLOW_TASK_COMMENTS + add constraint FKkfqrf9jdvm7livu5if06w0r5t + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES + add constraint FK1htp420ki24jaswtcum56iawe + foreign key (DEPENDENT_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES + add constraint FK8rbggnp4yjpab8quvvx800ymy + foreign key (DEPENDS_ON_TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS + add constraint FKeb7mqbdx3bk7t01vo7kp2hpf + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASK_LABELS + add constraint FKf715qud6g9xv2xeb8rrpnv4xs + foreign key (TASK_ID) + references CCM_CORE.WORKFLOW_TASKS; + + alter table CCM_CORE.WORKFLOW_TASKS + add constraint FK1693cbc36e4d8gucg8q7sc57e + foreign key (WORKFLOW_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_CORE.WORKFLOWS + add constraint FKrm2yfrs6veoxoy304upq2wc64 + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; + + alter table CCM_CORE.WORKFLOWS + add constraint FK9ray5beiny6wm2mi0uwyecay2 + foreign key (TEMPLATE_ID) + references CCM_CORE.WORKFLOWS; + + alter table CCM_DOCREPO.FILES + add constraint FK2hsq6npoqb0gnvj9blucdy0cp + foreign key (CONTENT_ID) + references CCM_DOCREPO.BLOB_OBJECTS; + + alter table CCM_DOCREPO.FILES + add constraint FKj29rqxnqsxub552uxng0ekyj4 + foreign key (OBJECT_ID) + references CCM_DOCREPO.RESOURCES; + + alter table CCM_DOCREPO.FOLDERS + add constraint FKnmxkqionnxqc7ye70npa5ikp0 + foreign key (OBJECT_ID) + references CCM_DOCREPO.RESOURCES; + + alter table CCM_DOCREPO.REC_UPD_DOCS_PORTLETS + add constraint FKaxwcfqi3ssgmdhhsqy2m258vc + foreign key (OBJECT_ID) + references CCM_CORE.PORTLETS; + + alter table CCM_DOCREPO.REPOSITORIES + add constraint FKovamdv1r9txoqbp7sw4i55pwu + foreign key (OWNER_ID) + references CCM_CORE.USERS; + + alter table CCM_DOCREPO.REPOSITORIES + add constraint FKr3nbsglhju8b24vxkcie08g1k + foreign key (ROOT_FOLDER_ID) + references CCM_DOCREPO.FOLDERS; + + alter table CCM_DOCREPO.REPOSITORIES + add constraint FKdjq3yme7ow441nw4as9dqy0we + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FK7fv70w41xca4tduehyb1ye2c6 + foreign key (CREATION_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FK9jl78hpalagwr323bl561qsgj + foreign key (LAST_MODIFIED_USER_ID) + references CCM_CORE.USERS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FKap5pdovro7cgbn4jrs77nqa6o + foreign key (PARENT_ID) + references CCM_DOCREPO.FOLDERS; + + alter table CCM_DOCREPO.RESOURCES + add constraint FKpn78v9bfo6ak34kqbe3g6nb1n + foreign key (REPOSITORY_ID) + references CCM_DOCREPO.REPOSITORIES; + + alter table CCM_DOCREPO.RESOURCES + add constraint FKbjdf8pm4frth8r06ev2qjm88f + foreign key (OBJECT_ID) + references CCM_CORE.CCM_OBJECTS; \ No newline at end of file diff --git a/ccm-shortcuts/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_shortcuts_schema.sql b/ccm-shortcuts/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_shortcuts_schema.sql index af8fb307a..79d21a5df 100644 --- a/ccm-shortcuts/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_shortcuts_schema.sql +++ b/ccm-shortcuts/src/test/resources-wildfly-remote-h2-mem/scripts/create_ccm_shortcuts_schema.sql @@ -48,7 +48,7 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.CATEGORY_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -65,7 +65,7 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.CATEGORY_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -81,7 +81,6 @@ CREATE SCHEMA ccm_shortcuts; OBJECT_ID bigint not null, REV integer not null, REVTYPE tinyint, - REVEND integer, DISPLAY_NAME varchar(255), primary key (OBJECT_ID, REV) ); @@ -113,7 +112,7 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.DOMAIN_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); @@ -130,14 +129,14 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.DOMAIN_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( COMPONENT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (COMPONENT_ID, LOCALE) ); @@ -182,14 +181,14 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( DATA_QUERY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (DATA_QUERY_ID, LOCALE) ); @@ -226,7 +225,7 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( OPTION_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OPTION_ID, LOCALE) ); @@ -239,14 +238,14 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( PROCESS_LISTENER_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PROCESS_LISTENER_ID, LOCALE) ); @@ -405,14 +404,14 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PAGE_MODEL_ID, LOCALE) ); create table CCM_CORE.PAGE_MODEL_TITLES ( PAGE_MODEL_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (PAGE_MODEL_ID, LOCALE) ); @@ -438,7 +437,7 @@ CREATE SCHEMA ccm_shortcuts; PERMISSION_ID bigint not null, CREATION_DATE timestamp, CREATION_IP varchar(255), - granted_privilege varchar(255), + GRANTED_PRIVILEGE varchar(255), INHERITED boolean, CREATION_USER_ID bigint, GRANTEE_ID bigint, @@ -475,21 +474,21 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.RESOURCE_DESCRIPTIONS ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TITLES ( OBJECT_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (OBJECT_ID, LOCALE) ); create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( RESOURCE_TYPE_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (RESOURCE_TYPE_ID, LOCALE) ); @@ -514,7 +513,7 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.ROLE_DESCRIPTIONS ( ROLE_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ROLE_ID, LOCALE) ); @@ -531,11 +530,11 @@ CREATE SCHEMA ccm_shortcuts; SETTING_ID bigint not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, - SETTING_VALUE_BIG_DECIMAL decimal(19,2), - SETTING_VALUE_BOOLEAN boolean, - SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_DOUBLE double, + SETTING_VALUE_STRING varchar(1024), + SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_LONG bigint, + SETTING_VALUE_BIG_DECIMAL decimal(19,2), primary key (SETTING_ID) ); @@ -546,7 +545,7 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( ENTRY_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (ENTRY_ID, LOCALE) ); @@ -595,14 +594,14 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_NAMES ( WORKFLOW_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (WORKFLOW_ID, LOCALE) ); @@ -616,7 +615,7 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( COMMENT_ID bigint not null, - COMMENT longvarchar, + COMMENT varchar(2147483647), UUID varchar(255) not null, AUTHOR_ID bigint, TASK_ID bigint, @@ -630,14 +629,14 @@ CREATE SCHEMA ccm_shortcuts; create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( TASK_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); create table CCM_CORE.WORKFLOW_TASK_LABELS ( TASK_ID bigint not null, - LOCALIZED_VALUE longvarchar, + LOCALIZED_VALUE varchar(2147483647), LOCALE varchar(255) not null, primary key (TASK_ID, LOCALE) ); @@ -651,13 +650,9 @@ CREATE SCHEMA ccm_shortcuts; primary key (TASK_ID) ); - create table CCM_CORE.WORKFLOW_TEMPLATES ( - WORKFLOW_ID bigint not null, - primary key (WORKFLOW_ID) - ); - create table CCM_CORE.WORKFLOWS ( WORKFLOW_ID bigint not null, + abstract_workflow boolean, ACTIVE boolean, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), @@ -693,7 +688,18 @@ CREATE SCHEMA ccm_shortcuts; alter table CCM_CORE.WORKFLOWS add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); -create sequence hibernate_sequence start with 1 increment by 1; + + create table CCM_SHORTCUTS.SHORTCUTS ( + SHORTCUT_ID bigint not null, + REDIRECT varchar(1024), + URL_KEY varchar(1024), + primary key (SHORTCUT_ID) + ); + + alter table CCM_SHORTCUTS.SHORTCUTS + add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY); + + create sequence hibernate_sequence start with 1 increment by 1; alter table CCM_CORE.APPLICATIONS add constraint FKatcp9ij6mbkx0nfeig1o6n3lm @@ -750,11 +756,6 @@ create sequence hibernate_sequence start with 1 increment by 1; foreign key (REV) references CCM_CORE.CCM_REVISIONS; - alter table CCM_CORE.CCM_OBJECTS_AUD - add constraint FKo5s37ctcdny7tmewjwv7705h5 - foreign key (REVEND) - references CCM_CORE.CCM_REVISIONS; - alter table CCM_CORE.DIGESTS add constraint FKc53g09agnye3w1v4euy3e0gsi foreign key (FROM_PARTY_ID) @@ -1016,7 +1017,7 @@ create sequence hibernate_sequence start with 1 increment by 1; references CCM_CORE.CCM_ROLES; alter table CCM_CORE.PERMISSIONS - add constraint FKc1x3h1p3o20qiwmonpmva7t5i + add constraint FKg56ujjoe0j30pq579rf0l5yc6 foreign key (INHERITED_FROM_ID) references CCM_CORE.CCM_OBJECTS; @@ -1200,27 +1201,12 @@ create sequence hibernate_sequence start with 1 increment by 1; foreign key (WORKFLOW_ID) references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOW_TEMPLATES - add constraint FK8692vdme4yxnkj1m0k1dw74pk - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOWS add constraint FKrm2yfrs6veoxoy304upq2wc64 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.WORKFLOWS - add constraint FKeixdxau4jebw682gd49tdbsjy + add constraint FK9ray5beiny6wm2mi0uwyecay2 foreign key (TEMPLATE_ID) - references CCM_CORE.WORKFLOW_TEMPLATES; - - create table CCM_SHORTCUTS.SHORTCUTS ( - SHORTCUT_ID bigint not null, - REDIRECT varchar(1024), - URL_KEY varchar(1024), - primary key (SHORTCUT_ID) - ); - - alter table CCM_SHORTCUTS.SHORTCUTS - add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY); + references CCM_CORE.WORKFLOWS; \ No newline at end of file diff --git a/ccm-shortcuts/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_shortcuts_schema.sql b/ccm-shortcuts/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_shortcuts_schema.sql index b7c122326..8201effaa 100644 --- a/ccm-shortcuts/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_shortcuts_schema.sql +++ b/ccm-shortcuts/src/test/resources-wildfly-remote-pgsql/scripts/create_ccm_shortcuts_schema.sql @@ -81,7 +81,6 @@ create table CCM_CORE.APPLICATIONS ( OBJECT_ID int8 not null, REV int4 not null, REVTYPE int2, - REVEND int4, DISPLAY_NAME varchar(255), primary key (OBJECT_ID, REV) ); @@ -438,7 +437,7 @@ create table CCM_CORE.APPLICATIONS ( PERMISSION_ID int8 not null, CREATION_DATE timestamp, CREATION_IP varchar(255), - granted_privilege varchar(255), + GRANTED_PRIVILEGE varchar(255), INHERITED boolean, CREATION_USER_ID int8, GRANTEE_ID int8, @@ -531,11 +530,11 @@ create table CCM_CORE.APPLICATIONS ( SETTING_ID int8 not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, - SETTING_VALUE_BIG_DECIMAL numeric(19, 2), - SETTING_VALUE_BOOLEAN boolean, - SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_DOUBLE float8, + SETTING_VALUE_STRING varchar(1024), + SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_LONG int8, + SETTING_VALUE_BIG_DECIMAL numeric(19, 2), primary key (SETTING_ID) ); @@ -651,13 +650,9 @@ create table CCM_CORE.APPLICATIONS ( primary key (TASK_ID) ); - create table CCM_CORE.WORKFLOW_TEMPLATES ( - WORKFLOW_ID int8 not null, - primary key (WORKFLOW_ID) - ); - create table CCM_CORE.WORKFLOWS ( WORKFLOW_ID int8 not null, + abstract_workflow boolean, ACTIVE boolean, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), @@ -693,7 +688,18 @@ create table CCM_CORE.APPLICATIONS ( alter table CCM_CORE.WORKFLOWS add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); -create sequence hibernate_sequence start 1 increment 1; + + create table CCM_SHORTCUTS.SHORTCUTS ( + SHORTCUT_ID int8 not null, + REDIRECT varchar(1024), + URL_KEY varchar(1024), + primary key (SHORTCUT_ID) + ); + + alter table CCM_SHORTCUTS.SHORTCUTS + add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY); + + create sequence hibernate_sequence start 1 increment 1; alter table CCM_CORE.APPLICATIONS add constraint FKatcp9ij6mbkx0nfeig1o6n3lm @@ -750,11 +756,6 @@ create sequence hibernate_sequence start 1 increment 1; foreign key (REV) references CCM_CORE.CCM_REVISIONS; - alter table CCM_CORE.CCM_OBJECTS_AUD - add constraint FKo5s37ctcdny7tmewjwv7705h5 - foreign key (REVEND) - references CCM_CORE.CCM_REVISIONS; - alter table CCM_CORE.DIGESTS add constraint FKc53g09agnye3w1v4euy3e0gsi foreign key (FROM_PARTY_ID) @@ -1016,7 +1017,7 @@ create sequence hibernate_sequence start 1 increment 1; references CCM_CORE.CCM_ROLES; alter table CCM_CORE.PERMISSIONS - add constraint FKc1x3h1p3o20qiwmonpmva7t5i + add constraint FKg56ujjoe0j30pq579rf0l5yc6 foreign key (INHERITED_FROM_ID) references CCM_CORE.CCM_OBJECTS; @@ -1200,28 +1201,12 @@ create sequence hibernate_sequence start 1 increment 1; foreign key (WORKFLOW_ID) references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOW_TEMPLATES - add constraint FK8692vdme4yxnkj1m0k1dw74pk - foreign key (WORKFLOW_ID) - references CCM_CORE.WORKFLOWS; - alter table CCM_CORE.WORKFLOWS add constraint FKrm2yfrs6veoxoy304upq2wc64 foreign key (OBJECT_ID) references CCM_CORE.CCM_OBJECTS; alter table CCM_CORE.WORKFLOWS - add constraint FKeixdxau4jebw682gd49tdbsjy + add constraint FK9ray5beiny6wm2mi0uwyecay2 foreign key (TEMPLATE_ID) - references CCM_CORE.WORKFLOW_TEMPLATES; - - create table CCM_SHORTCUTS.SHORTCUTS ( - SHORTCUT_ID int8 not null, - REDIRECT varchar(1024), - URL_KEY varchar(1024), - primary key (SHORTCUT_ID) - ); - - alter table CCM_SHORTCUTS.SHORTCUTS - add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY); - + references CCM_CORE.WORKFLOWS; \ No newline at end of file