From 99b3e513aa04b75b0ba9ee4deb1d5f921cfb27ec Mon Sep 17 00:00:00 2001 From: jensp Date: Tue, 10 Oct 2017 17:27:02 +0000 Subject: [PATCH] CCM NG: First part of sites/pages application git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5035 8810af33-2d31-482b-a856-94f89814c4df --- .../com/arsdigita/cms/ui/ContentItemPage.java | 1 + .../cms/ui/authoring/AuthoringKitWizard.java | 15 +- .../ItemLifecycleAdminController.java | 180 +- .../ui/lifecycle/ItemLifecycleSelectForm.java | 195 +- .../cms/ui/workflow/CommentAddForm.java | 22 +- .../cms/ui/workflow/TaskFinishForm.java | 32 +- .../ui/workflow/TaskFinishFormController.java | 91 +- .../java/org/arsdigita/cms/CMSConfig.java | 2 +- .../contentsection/ContentItemManager.java | 6 +- .../contentsection/ContentItemRepository.java | 2 +- .../librecms/lifecycle/LifecycleManager.java | 25 +- .../main/java/org/librecms/sites/Pages.java | 84 + .../main/java/org/librecms/sites/Site.java | 154 ++ .../org/librecms/sites/SiteRepository.java | 44 + .../main/java/org/librecms/sites/Sites.java | 45 + .../org/librecms/ui/ContentItemEditor.java | 131 ++ .../ui/ContentSectionViewController.java | 1 - .../ccm_cms/h2/V7_0_0_16__create_sites.sql | 20 + .../ccm_cms/pgsql/V7_0_0_16__create_sites.sql | 20 + .../org/librecms/CmsResources.properties | 10 + .../org/librecms/CmsResources_de.properties | 10 + .../org/librecms/CmsResources_fr.properties | 10 + .../scripts/create_ccm_cms_schema.sql | 33 +- .../scripts/create_ccm_cms_schema.sql | 2076 +---------------- .../main/java/org/libreccm/core/Resource.java | 22 +- .../libreccm/pagemodel/ComponentModel.java | 13 +- .../org/libreccm/pagemodel/PageBuilder.java | 5 +- .../org/libreccm/pagemodel/PageModel.java | 21 +- .../java/org/libreccm/security/Group.java | 9 +- .../java/org/libreccm/security/Party.java | 21 +- .../java/org/libreccm/ui/ConfirmDialog.java | 4 + 31 files changed, 1090 insertions(+), 2214 deletions(-) create mode 100644 ccm-cms/src/main/java/org/librecms/sites/Pages.java create mode 100644 ccm-cms/src/main/java/org/librecms/sites/Site.java create mode 100644 ccm-cms/src/main/java/org/librecms/sites/SiteRepository.java create mode 100644 ccm-cms/src/main/java/org/librecms/sites/Sites.java create mode 100644 ccm-cms/src/main/java/org/librecms/ui/ContentItemEditor.java create mode 100644 ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_16__create_sites.sql create mode 100644 ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_16__create_sites.sql diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java index 3b603d797..f1ed6bf86 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java @@ -545,6 +545,7 @@ public class ContentItemPage extends CMSPage implements ActionListener { */ public static String getItemURL(final ContentItem item, final int tab) { + final ContentSection section = item.getContentType().getContentSection(); if (section == null) { diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java index 723781edb..eb7707adf 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java @@ -65,7 +65,10 @@ import org.apache.logging.log4j.LogManager; import org.arsdigita.cms.CMSConfig; import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.configuration.ConfigurationManager; +import org.libreccm.core.UnexpectedErrorException; import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.workflow.Task; +import org.libreccm.workflow.TaskRepository; import org.librecms.CmsConstants; import org.librecms.contentsection.ContentItem; import org.librecms.contenttypes.AuthoringKit; @@ -576,7 +579,17 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable { .getSelectedKey(state) .toString(); - return CmsTaskType.valueOf(key); + final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); + final TaskRepository taskRepo = cdiUtil + .findBean(TaskRepository.class); + + final Task task = taskRepo + .findById(Long.parseLong(key)) + .orElseThrow(() -> new UnexpectedErrorException(String + .format("No Task with ID %s in the database.", + key))); + + return task; } } diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminController.java index cb6c0df12..022eacddb 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/lifecycle/ItemLifecycleAdminController.java @@ -18,16 +18,37 @@ */ package com.arsdigita.cms.ui.lifecycle; +import com.arsdigita.cms.ui.ContentItemPage; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.arsdigita.cms.CMSConfig; import org.libreccm.categorization.Categorization; import org.libreccm.categorization.Category; +import org.libreccm.configuration.ConfigurationManager; +import org.libreccm.security.User; +import org.libreccm.workflow.Task; +import org.libreccm.workflow.TaskManager; +import org.libreccm.workflow.Workflow; +import org.libreccm.workflow.WorkflowManager; +import org.libreccm.workflow.WorkflowRepository; import org.librecms.contentsection.ContentItem; +import org.librecms.contentsection.ContentItemManager; import org.librecms.contentsection.ContentItemRepository; import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionRepository; +import org.librecms.lifecycle.Lifecycle; import org.librecms.lifecycle.LifecycleDefinition; +import org.librecms.lifecycle.LifecycleDefinitionRepository; +import org.librecms.lifecycle.LifecycleManager; +import org.librecms.lifecycle.Phase; +import org.librecms.lifecycle.PhaseRepository; +import org.librecms.workflow.CmsTask; +import org.librecms.workflow.CmsTaskType; -import java.util.ArrayList; +import java.util.Date; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import javax.enterprise.context.RequestScoped; @@ -41,12 +62,39 @@ import javax.transaction.Transactional; @RequestScoped public class ItemLifecycleAdminController { + private static final Logger LOGGER = LogManager + .getLogger(ItemLifecycleAdminController.class); + + @Inject + private ConfigurationManager confManager; + @Inject private ContentItemRepository itemRepo; + @Inject + private ContentItemManager itemManager; + + @Inject + private LifecycleDefinitionRepository lifecycleDefRepo; + + @Inject + private LifecycleManager lifecycleManager; + + @Inject + private PhaseRepository phaseRepo; + @Inject private ContentSectionRepository sectionRepo; + @Inject + private TaskManager taskManager; + + @Inject + private WorkflowManager workflowManager; + + @Inject + private WorkflowRepository workflowRepo; + @Transactional(Transactional.TxType.REQUIRED) public boolean isAssignedToAbstractCategory(final ContentItem item) { @@ -91,7 +139,135 @@ public class ItemLifecycleAdminController { .format("No ContentItem with ID %d in the database.", item.getObjectId()))); - return contentItem.getContentType().getDefaultLifecycle(); + final LifecycleDefinition definition = contentItem + .getContentType() + .getDefaultLifecycle(); + + return lifecycleDefRepo + .findById(definition.getDefinitionId()) + .get(); + } + + @Transactional(Transactional.TxType.REQUIRED) + public LifecycleDefinition getDefinitionOfLifecycle(final ContentItem item) { + + final ContentItem contentItem = itemRepo + .findById(item.getObjectId()) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No ContentItem with ID %d in the database.", + item.getObjectId()))); + + final ContentItem liveItem = itemManager + .getLiveVersion(item, ContentItem.class) + .get(); + + return liveItem.getLifecycle().getDefinition(); + } + + @Transactional(Transactional.TxType.REQUIRED) + public String getPublishingTabUrl(final ContentItem item) { + + final ContentItem contentItem = itemRepo + .findById(item.getObjectId()) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No ContentItem with ID %d in the database.", + item.getObjectId()))); + + return ContentItemPage.getItemURL(contentItem, + ContentItemPage.PUBLISHING_TAB); + } + + @Transactional(Transactional.TxType.REQUIRED) + public void publish(final String itemUuid, + final long cycleDefId, + final Date endDate, + final String workflowUuid, + final User user) { + + final ContentItem contentItem = itemRepo + .findByUuid(itemUuid) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No ContentItem with UUID %s in the database.", + itemUuid))); + + final LifecycleDefinition cycleDef = lifecycleDefRepo + .findById(cycleDefId) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No LifecycleDefinition with ID %d in the database.", + cycleDefId))); + + if (itemManager.isLive(contentItem)) { + contentItem.setLifecycle(null); + itemRepo.save(contentItem); + } + + final ContentItem pending = itemManager.publish(contentItem, cycleDef); + final Lifecycle lifecycle = pending.getLifecycle(); + + if (endDate != null) { + + // update individual phases + final List phases = lifecycle.getPhases(); + + for (final Phase phase : phases) { + final Date thisStart = phase.getStartDateTime(); + if (thisStart.compareTo(endDate) > 0) { + phase.setStartDateTime(endDate); + phaseRepo.save(phase); + } + } + } + + lifecycleManager.startLifecycle(lifecycle); + + if (workflowUuid != null) { + final Workflow workflow = workflowRepo + .findByUuid(workflowUuid) + .get(); + finish(workflow, contentItem, user); + } + } + + private void finish(final Workflow workflow, + final ContentItem item, + final User user) { + + if (workflow != null && user != null) { + + final List enabledTasks = workflowManager + .findEnabledTasks(workflow); + for (final Task task : enabledTasks) { + LOGGER.debug("Task is {}.", task.getUuid()); + if (task instanceof CmsTask) { + final CmsTask cmsTask = (CmsTask) task; + + if (cmsTask.getTaskType() == CmsTaskType.DEPLOY) { + LOGGER.debug("Found DEPLOY task."); + taskManager.finish(cmsTask); + } + } + } + + final CMSConfig cmsConfig = confManager + .findConfiguration(CMSConfig.class); + + if (cmsConfig.isDeleteWorkflowAfterPublication()) { + workflowRepo.delete(workflow); + } else { + // restart the workflow by recreating it + // from the same workflow template + final Workflow template = workflow.getTemplate(); + if (template == null) { + return; + } + workflowRepo.delete(workflow); + final Workflow restarted = workflowManager.createWorkflow( + template, item); + // Startring the workflow will probably do the wrong thing, because most of the time + // the current user would be a publisher, not an author + workflowRepo.save(restarted); + } + } } } 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 cd0d27011..3f21f34ae 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 @@ -84,6 +84,7 @@ import org.librecms.workflow.CmsTaskType; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; +import java.math.BigDecimal; import java.util.Calendar; import java.util.List; import java.util.Locale; @@ -284,14 +285,16 @@ class ItemLifecycleSelectForm extends BaseForm { final Locale locale = globalizationHelper.getNegotiatedLocale(); for (final LifecycleDefinition definition : definitions) { - final List phaseDefinitions = definition - .getPhaseDefinitions(); - - if (!phaseDefinitions.isEmpty()) { - target.addOption(new Option( +// final List phaseDefinitions = definition +// .getPhaseDefinitions(); +// +// if (!phaseDefinitions.isEmpty()) { + target.addOption( + new Option( Long.toString(definition.getDefinitionId()), - new Text(definition.getLabel().getValue(locale)))); - } + new Text(globalizationHelper + .getValueFromLocalizedString(definition.getLabel())))); +// } } } @@ -301,13 +304,14 @@ class ItemLifecycleSelectForm extends BaseForm { @Override public final void init(final FormSectionEvent event) { + final PageState state = event.getPageState(); final ContentItem item = itemRequestLocal.getContentItem(state); final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); - final ContentItemManager itemManager = cdiUtil.findBean( - ContentItemManager.class); + final ContentItemManager itemManager = cdiUtil + .findBean(ContentItemManager.class); final ItemLifecycleAdminController controller = cdiUtil .findBean(ItemLifecycleAdminController.class); @@ -315,8 +319,11 @@ class ItemLifecycleSelectForm extends BaseForm { // If the item is published, select the currently // associated lifecycle. - final LifecycleDefinition definition = item.getLifecycle() - .getDefinition(); + final LifecycleDefinition definition = controller + .getDefinitionOfLifecycle(item); +// final LifecycleDefinition definition = item +// .getLifecycle() +// .getDefinition(); cycleSelect.setValue(state, definition.getDefinitionId()); } else { // Set the default lifecycle (if it exists). @@ -382,7 +389,9 @@ class ItemLifecycleSelectForm extends BaseForm { final PageState state = event.getPageState(); final ContentItem item = itemRequestLocal.getContentItem(state); final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); - + final ItemLifecycleAdminController controller = cdiUtil + .findBean(ItemLifecycleAdminController.class); + final Publisher publisher = new Publisher(state); if (CMSConfig.getConfig().isThreadPublishing()) { final Runnable threadAction = new Runnable() { @@ -467,8 +476,7 @@ class ItemLifecycleSelectForm extends BaseForm { if (CMSConfig.getConfig().isThreadPublishing()) { throw new RedirectSignal( URL.getDispatcherPath() - + ContentItemPage.getItemURL(item, - ContentItemPage.PUBLISHING_TAB), + + controller.getPublishingTabUrl(item), true); } else { if (CMSConfig.getConfig().isUseStreamlinedCreation()) { @@ -649,7 +657,13 @@ class ItemLifecycleSelectForm extends BaseForm { //item = m_item.getContentItem(state); itemUuid = itemRequestLocal.getContentItem(state).getItemUuid(); - defID = (Long) cycleSelect.getValue(state); + if (cycleSelect.getValue(state) instanceof BigDecimal) { + defID = ((Number) cycleSelect.getValue(state)).longValue(); + } else if (cycleSelect.getValue(state) instanceof Long) { + defID = (Long) cycleSelect.getValue(state); + } else { + defID = Long.parseLong(cycleSelect.getValue(state).toString()); + } final Calendar start = Calendar.getInstance(); start.setTime((java.util.Date) startDateField.getValue(state)); @@ -715,79 +729,84 @@ class ItemLifecycleSelectForm extends BaseForm { public void publish() { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); - final ContentItemRepository itemRepo = cdiUtil.findBean( - ContentItemRepository.class); - final ContentItemManager itemManager = cdiUtil.findBean( - ContentItemManager.class); - final PhaseRepository phaseRepo = cdiUtil.findBean( - PhaseRepository.class); - final LifecycleDefinitionRepository lifecycleDefRepo = cdiUtil - .findBean(LifecycleDefinitionRepository.class); - final LifecycleManager lifecycleManager = cdiUtil.findBean( - LifecycleManager.class); - - final ContentItem item = itemRepo.findByUuid(itemUuid).get(); - - // If the item is already published, remove the current lifecycle. - // Do not touch the live version. - if (itemManager.isLive(item)) { - item.setLifecycle(null); - itemRepo.save(item); - } - - ContentItem pending; - final LifecycleDefinition cycleDef; - final Lifecycle lifecycle; - // Apply the new lifecycle. - cycleDef = lifecycleDefRepo.findById(defID).get(); - pending = itemManager.publish(item, cycleDef); - lifecycle = pending.getLifecycle(); - - if (endDate != null) { - - // update individual phases - final List phases = lifecycle.getPhases(); - - for (final Phase phase : phases) { - final java.util.Date thisEnd = phase.getEndDateTime(); - final java.util.Date thisStart = phase.getStartDateTime(); - if (thisStart.compareTo(endDate) > 0) { - phase.setStartDateTime(endDate); - phaseRepo.save(phase); - } - } - } - - // endOfCycle may be the original date according to lifecycle phase definitions, or endDate if that was before - // natural end of lifecycle - final java.util.Date endOfCycle = lifecycle.getEndDateTime(); - if (endOfCycle != null) { - - // if advance notification is requested (!= 0) - // add another phase at the start of which the user is notified - java.util.Date notificationDate; - - int notificationPeriod = 0; - if (notificationDays != null) { - notificationPeriod += notificationDays * 24; - } - if (notificationHours != null) { - notificationPeriod += notificationHours; - } - } - - // Force the lifecycle scheduler to run to avoid any - // scheduler delay for items that should be published - // immediately. - lifecycleManager.startLifecycle(pending.getLifecycle()); - - if (workflowUuid != null) { - final WorkflowRepository workflowRepo = cdiUtil.findBean( - WorkflowRepository.class); - final Workflow workflow = workflowRepo.findByUuid(workflowUuid) - .get(); - finish(workflow, item, user); - } + final ItemLifecycleAdminController controller = cdiUtil + .findBean(ItemLifecycleAdminController.class); + + controller.publish(itemUuid, defID, endDate, workflowUuid, user); + +// final ContentItemRepository itemRepo = cdiUtil.findBean( +// ContentItemRepository.class); +// final ContentItemManager itemManager = cdiUtil.findBean( +// ContentItemManager.class); +// final PhaseRepository phaseRepo = cdiUtil.findBean( +// PhaseRepository.class); +// final LifecycleDefinitionRepository lifecycleDefRepo = cdiUtil +// .findBean(LifecycleDefinitionRepository.class); +// final LifecycleManager lifecycleManager = cdiUtil.findBean( +// LifecycleManager.class); +// +// final ContentItem item = itemRepo.findByUuid(itemUuid).get(); +// +// // If the item is already published, remove the current lifecycle. +// // Do not touch the live version. +// if (itemManager.isLive(item)) { +// item.setLifecycle(null); +// itemRepo.save(item); +// } +// +// ContentItem pending; +// final LifecycleDefinition cycleDef; +// final Lifecycle lifecycle; +// // Apply the new lifecycle. +// cycleDef = lifecycleDefRepo.findById(defID).get(); +// pending = itemManager.publish(item, cycleDef); +// lifecycle = pending.getLifecycle(); +// +// if (endDate != null) { +// +// // update individual phases +// final List phases = lifecycle.getPhases(); +// +// for (final Phase phase : phases) { +// final java.util.Date thisEnd = phase.getEndDateTime(); +// final java.util.Date thisStart = phase.getStartDateTime(); +// if (thisStart.compareTo(endDate) > 0) { +// phase.setStartDateTime(endDate); +// phaseRepo.save(phase); +// } +// } +// } +// +// // endOfCycle may be the original date according to lifecycle phase definitions, or endDate if that was before +// // natural end of lifecycle +// final java.util.Date endOfCycle = lifecycle.getEndDateTime(); +// if (endOfCycle != null) { +// +// // if advance notification is requested (!= 0) +// // add another phase at the start of which the user is notified +// java.util.Date notificationDate; +// +// int notificationPeriod = 0; +// if (notificationDays != null) { +// notificationPeriod += notificationDays * 24; +// } +// if (notificationHours != null) { +// notificationPeriod += notificationHours; +// } +// } +// +// // Force the lifecycle scheduler to run to avoid any +// // scheduler delay for items that should be published +// // immediately. +// lifecycleManager.startLifecycle(pending.getLifecycle()); +// +// if (workflowUuid != null) { +// final WorkflowRepository workflowRepo = cdiUtil.findBean( +// WorkflowRepository.class); +// final Workflow workflow = workflowRepo.findByUuid(workflowUuid) +// .get(); +// finish(workflow, item, user); +// } } } diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/CommentAddForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/CommentAddForm.java index 9f08a3cfc..0795a004d 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/CommentAddForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/CommentAddForm.java @@ -29,7 +29,6 @@ import org.librecms.workflow.CmsTask; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.libreccm.cdi.utils.CdiUtil; -import org.libreccm.workflow.TaskComment; import org.libreccm.workflow.TaskManager; import org.libreccm.workflow.TaskRepository; @@ -39,7 +38,8 @@ import org.libreccm.workflow.TaskRepository; */ class CommentAddForm extends BaseForm { - private static final Logger LOGGER = LogManager.getLogger(CommentAddForm.class); + private static final Logger LOGGER = LogManager.getLogger( + CommentAddForm.class); private final TaskRequestLocal selectedTask; private final TextArea comment; @@ -63,17 +63,23 @@ class CommentAddForm extends BaseForm { } private class ProcessListener implements FormProcessListener { + @Override public final void process(final FormSectionEvent event) - throws FormProcessException { + throws FormProcessException { LOGGER.debug("Processing comment add"); final PageState state = event.getPageState(); - final CmsTask task = selectedTask.getTask(state); - final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); - final TaskRepository taskRepo = cdiUtil.findBean(TaskRepository.class); - final TaskManager taskManager = cdiUtil.findBean(TaskManager.class); - taskManager.addComment(task, (String) comment.getValue(state)); + if (comment.getValue(state) != null + && !((String) comment.getValue(state)).isEmpty()) { + final CmsTask task = selectedTask.getTask(state); + final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); + final TaskFinishFormController controller = cdiUtil + .findBean(TaskFinishFormController.class); + controller.addComment(task, (String) comment.getValue(state)); + } } + } + } diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishForm.java index aa3c5983a..5269f79e8 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishForm.java @@ -50,11 +50,7 @@ import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.configuration.ConfigurationManager; import org.libreccm.security.PermissionChecker; import org.libreccm.workflow.AssignableTask; -import org.libreccm.workflow.AssignableTaskManager; -import org.libreccm.workflow.TaskManager; -import org.libreccm.workflow.TaskRepository; import org.libreccm.workflow.Workflow; -import org.libreccm.workflow.WorkflowManager; import org.librecms.CmsConstants; import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItemRepository; @@ -170,13 +166,8 @@ public final class TaskFinishForm extends CommentAddForm { permissionChecker.checkPermission(task.getTaskType().getPrivilege(), item.get()); - final TaskRepository taskRepo = cdiUtil.findBean( - TaskRepository.class); - final WorkflowManager workflowManager = cdiUtil.findBean( - WorkflowManager.class); - final TaskManager taskManager = cdiUtil.findBean(TaskManager.class); - final AssignableTaskManager assignableTaskManager = cdiUtil - .findBean(AssignableTaskManager.class); + final TaskFinishFormController controller = cdiUtil + .findBean(TaskFinishFormController.class); final ConfigurationManager confManager = cdiUtil.findBean( ConfigurationManager.class); final KernelConfig kernelConfig = confManager.findConfiguration( @@ -194,7 +185,7 @@ public final class TaskFinishForm extends CommentAddForm { if (isApproved.equals(Boolean.TRUE)) { LOGGER.debug("The task is approved; finishing the task"); - taskManager.finish(task); + controller.finish(task); finishedTask = true; } else { LOGGER.debug("The task is rejected; reenabling dependent " @@ -206,17 +197,16 @@ public final class TaskFinishForm extends CommentAddForm { dependent.getLabel().getValue( kernelConfig.getDefaultLocale())); - taskManager.enable(dependent); + controller.enable(dependent); } } } else { LOGGER.debug("The task does not require approval; finishing it"); - taskManager.disable(task); + controller.finish(task); + finishedTask = true; } if (finishedTask) { - final TaskFinishFormController controller = cdiUtil.findBean( - TaskFinishFormController.class); final Workflow workflow = task.getWorkflow(); final List tasks = controller.findEnabledTasks( workflow); @@ -231,16 +221,16 @@ public final class TaskFinishForm extends CommentAddForm { if (permissionChecker.isPermitted(privilege, workflow.getObject())) { //Lock task for current user - assignableTaskManager.lockTask(currentCmsTask); + controller.lock(currentCmsTask); if (CmsTaskType.DEPLOY == currentCmsTask.getTaskType()) { } else { throw new RedirectSignal( - URL.there(state.getRequest(), - ContentItemPage.getItemURL( - item.get(), - ContentItemPage.PUBLISHING_TAB)), + URL.there( + state.getRequest(), + controller + .getContentItemPublishUrl(item.get())), true); } diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishFormController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishFormController.java index f768c2b4b..172cd24d1 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishFormController.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishFormController.java @@ -18,12 +18,20 @@ */ package com.arsdigita.cms.ui.workflow; +import com.arsdigita.cms.ui.ContentItemPage; + import org.libreccm.security.Role; import org.libreccm.security.Shiro; import org.libreccm.security.User; import org.libreccm.workflow.AssignableTask; import org.libreccm.workflow.AssignableTaskManager; +import org.libreccm.workflow.Task; +import org.libreccm.workflow.TaskManager; +import org.libreccm.workflow.TaskRepository; import org.libreccm.workflow.Workflow; +import org.librecms.contentsection.ContentItem; +import org.librecms.contentsection.ContentItemRepository; +import org.librecms.workflow.CmsTask; import java.util.List; import java.util.stream.Collectors; @@ -38,21 +46,94 @@ import javax.transaction.Transactional; */ @RequestScoped public class TaskFinishFormController { + + @Inject + private ContentItemRepository itemRepo; @Inject - private AssignableTaskManager taskManager; + private TaskRepository taskRepo; + + @Inject + private TaskManager taskManager; + @Inject + private AssignableTaskManager assignableTaskManager; + @Inject private Shiro shiro; - + @Transactional(Transactional.TxType.REQUIRED) public List findEnabledTasks(final Workflow workflow) { final User user = shiro.getUser().get(); final List roles = user.getRoleMemberships().stream() - .map(membership -> membership.getRole()) - .collect(Collectors.toList()); + .map(membership -> membership.getRole()) + .collect(Collectors.toList()); + + return assignableTaskManager.findAssignedTasks(workflow, roles); + } + + @Transactional(Transactional.TxType.REQUIRED) + public void addComment(final CmsTask task, final String comment) { + + final Task theTask = taskRepo + .findById(task.getTaskId()) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No Task with ID %d in the database.", + task.getTaskId()))); + + taskManager.addComment(theTask, comment); + } + + @Transactional + public void lock(final AssignableTask task) { + + final AssignableTask theTask = (AssignableTask) taskRepo + .findById(task.getTaskId()) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No Task with ID %d in the database.", + task.getTaskId()))); + + assignableTaskManager.unlockTask(theTask); + assignableTaskManager.lockTask(theTask); + } + + @Transactional(Transactional.TxType.REQUIRED) + public void enable(final Task task) { + + final Task theTask = taskRepo + .findById(task.getTaskId()) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No Task with ID %d in the database.", + task.getTaskId()))); + + taskManager.enable(theTask); + } + + @Transactional(Transactional.TxType.REQUIRED) + public void finish(final CmsTask task) { + + final Task theTask = taskRepo + .findById(task.getTaskId()) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No Task with ID %d in the database.", + task.getTaskId()))); + + taskManager.finish(theTask); + } + + @Transactional(Transactional.TxType.REQUIRED) + public String getContentItemPublishUrl(final ContentItem item) { + + final ContentItem contentItem = itemRepo + .findById(item.getObjectId()) + .orElseThrow(() -> new IllegalArgumentException(String + .format("No ContentItem with ID %d in the database.", + item.getObjectId()))); + + return ContentItemPage.getItemURL(contentItem, + ContentItemPage.PUBLISHING_TAB); + - return taskManager.findAssignedTasks(workflow, roles); } } diff --git a/ccm-cms/src/main/java/org/arsdigita/cms/CMSConfig.java b/ccm-cms/src/main/java/org/arsdigita/cms/CMSConfig.java index 435075971..34f974708 100644 --- a/ccm-cms/src/main/java/org/arsdigita/cms/CMSConfig.java +++ b/ccm-cms/src/main/java/org/arsdigita/cms/CMSConfig.java @@ -321,7 +321,7 @@ public class CMSConfig { private boolean useOldStyleItemLifecycleItemPane = false; @Setting - private boolean threadPublishing = true; + private boolean threadPublishing = false; @Setting private String publishingFailureSender = ""; 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 75ffdd71b..47177cfe8 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java @@ -345,7 +345,7 @@ public class ContentItemManager { if (item.getWorkflow() != null) { workflowManager.start(item.getWorkflow()); } - + permissionManager.copyPermissions(folder, item, true); return item; @@ -880,8 +880,8 @@ public class ContentItemManager { liveItem.setItemUuid(draftItem.getItemUuid()); liveItem.setContentType(draftItem.getContentType()); - final Lifecycle lifecycle = lifecycleManager.createLifecycle( - lifecycleDefinition); + final Lifecycle lifecycle = lifecycleManager + .createLifecycle(lifecycleDefinition); liveItem.setLifecycle(lifecycle); liveItem.setWorkflow(draftItem.getWorkflow()); diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemRepository.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemRepository.java index 13d41dac6..9f5a254fb 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemRepository.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemRepository.java @@ -192,7 +192,7 @@ public class ContentItemRepository final TypedQuery query = getEntityManager() .createNamedQuery("ContentItem.findByUuid", ContentItem.class); - query.setParameter("objectId", uuid); + query.setParameter("uuid", uuid); setAuthorizationParameters(query); try { diff --git a/ccm-cms/src/main/java/org/librecms/lifecycle/LifecycleManager.java b/ccm-cms/src/main/java/org/librecms/lifecycle/LifecycleManager.java index cdeb102d2..432f0fea5 100644 --- a/ccm-cms/src/main/java/org/librecms/lifecycle/LifecycleManager.java +++ b/ccm-cms/src/main/java/org/librecms/lifecycle/LifecycleManager.java @@ -127,8 +127,11 @@ public class LifecycleManager { phaseRepo.save(phase); }); - lifecycle.getPhases().get(0).setStarted(true); - phaseRepo.save(lifecycle.getPhases().get(0)); + if (lifecycle.getPhases() != null + && !lifecycle.getPhases().isEmpty()) { + lifecycle.getPhases().get(0).setStarted(true); + phaseRepo.save(lifecycle.getPhases().get(0)); + } lifecycleRepo.save(lifecycle); @@ -166,8 +169,8 @@ public class LifecycleManager { } lifecycle.getPhases().get(current).setFinished(true); - invokePhaseEventListener(lifecycle, - lifecycle.getPhases().get(current), + invokePhaseEventListener(lifecycle, + lifecycle.getPhases().get(current), PhaseEvent.FINISHED); //Check for last phase, if not set next phase to started if (current < lifecycle.getPhases().size() - 1) { @@ -201,6 +204,11 @@ public class LifecycleManager { private void invokeLifecycleEventListener(final Lifecycle lifecycle, final LifecycleEvent event) { final String listenerClassName = lifecycle.getListener(); + + if (listenerClassName == null || listenerClassName.isEmpty()) { + return; + } + final Class listenerClass; try { listenerClass = Class.forName(listenerClassName); @@ -208,6 +216,7 @@ public class LifecycleManager { LOGGER.error("Failed to find LifecycleListener class \"{}\". " + "Listener is ignored.", listenerClassName); + LOGGER.error(ex); return; } @@ -222,8 +231,8 @@ public class LifecycleManager { final Object object; try { object = listenerClass.newInstance(); - } catch (IllegalAccessException | - InstantiationException ex) { + } catch (IllegalAccessException + | InstantiationException ex) { LOGGER.error("Failed to create instance of LifecycleEventListener " + "of class \"{}\".", listenerClass.getName()); @@ -267,8 +276,8 @@ public class LifecycleManager { final Object object; try { object = listenerClass.newInstance(); - } catch (IllegalAccessException | - InstantiationException ex) { + } catch (IllegalAccessException + | InstantiationException ex) { LOGGER.error("Failed to create instance of PhaseEventListener " + "of class \"{}\".", listenerClass.getName()); diff --git a/ccm-cms/src/main/java/org/librecms/sites/Pages.java b/ccm-cms/src/main/java/org/librecms/sites/Pages.java new file mode 100644 index 000000000..ae54bc66b --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/sites/Pages.java @@ -0,0 +1,84 @@ +/* + * 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.librecms.sites; + +import org.libreccm.categorization.Category; +import org.libreccm.categorization.CategoryManager; +import org.libreccm.categorization.CategoryRepository; +import org.libreccm.pagemodel.PageModelManager; + +import java.util.Optional; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.transaction.Transactional; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.UriInfo; + +/** + * + * @author Jens Pelzetter + */ +@RequestScoped +@Path("/{page:.+}") +public class Pages { + + @Inject + private CategoryManager categoryManager; + + @Inject + private CategoryRepository categoryRepo; + + @Inject + private PageModelManager pageModelManager; + + @Inject + private SiteRepository siteRepo; + + @Path("/") + @Produces("text/html") + @Transactional(Transactional.TxType.REQUIRED) + public String getPage(@Context final UriInfo uriInfo, + @PathParam("page") final String page) { + + final String siteName = uriInfo.getBaseUri().getHost(); + + final Site site = siteRepo.findByName(siteName); + final Category category =categoryRepo + .findByPath(site.getCategoryDomain(), page) + .orElseThrow(() -> new NotFoundException(String.format( + "No page for path \"%s\" in site \"%s\"", + page, + siteName))); + + // ToDo Get PageModelBuilder + // ToDo Build page + // ToDo Get Theme Processor + // ToDo Pass page to theme processor + // ToDo Return result of ThemeProcessor + + throw new UnsupportedOperationException(); + + } + +} diff --git a/ccm-cms/src/main/java/org/librecms/sites/Site.java b/ccm-cms/src/main/java/org/librecms/sites/Site.java new file mode 100644 index 000000000..cabf7f742 --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/sites/Site.java @@ -0,0 +1,154 @@ +/* + * 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.librecms.sites; + +import org.libreccm.categorization.Domain; +import org.libreccm.web.CcmApplication; + +import java.io.Serializable; +import java.util.Objects; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import static org.librecms.CmsConstants.*; + +/** + * + * @author Jens Pelzetter + */ +@Entity +@Table(name = "SITES", schema = DB_SCHEMA) +@NamedQueries({ + @NamedQuery( + name = "Site.findByName", + query = "SELECT s FROM Site s WHERE s.name = :name" + ) +}) +public class Site extends CcmApplication implements Serializable { + + private static final long serialVersionUID = -352205318143692477L; + + /** + * The domain of the site. + */ + @Column(name = "NAME", unique = true) + private String name; + + /** + * Should this be the default site which is used when there is no matching + * site? + */ + @Column(name = "DEFAULT_SITE") + private boolean defaultSite; + + @OneToOne + @JoinColumn(name = "CATEGORY_DOMAIN_ID") + private Domain categoryDomain; + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + public boolean isDefaultSite() { + return defaultSite; + } + + public void setDefaultSite(boolean defaultSite) { + this.defaultSite = defaultSite; + } + + public Domain getCategoryDomain() { + return categoryDomain; + } + + protected void setCategoryDomain(Domain categoryDomain) { + this.categoryDomain = categoryDomain; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 17 * hash + Objects.hashCode(name); + hash = 17 * hash + (defaultSite ? 1 : 0); + hash = 17 * hash + Objects.hashCode(categoryDomain); + return hash; + } + + @Override + public boolean equals(final Object obj) { + + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (!super.equals(obj)) { + return false; + } + + if (!(obj instanceof Site)) { + return false; + } + + final Site other = (Site) obj; + if (!other.canEqual(this)) { + return false; + } + + if (!Objects.equals(name, other.getName())) { + return false; + } + if (defaultSite != other.isDefaultSite()) { + return false; + } + + return Objects.equals(categoryDomain, other.getCategoryDomain()); + } + + @Override + public boolean canEqual(final Object obj) { + return obj instanceof Site; + } + + @Override + public String toString(final String data) { + + return super.toString(String.format( + ", name = \"%s\"," + + "defaultSite = %b%s", + name, + defaultSite, + data + )); + } + +} diff --git a/ccm-cms/src/main/java/org/librecms/sites/SiteRepository.java b/ccm-cms/src/main/java/org/librecms/sites/SiteRepository.java new file mode 100644 index 000000000..5901acd56 --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/sites/SiteRepository.java @@ -0,0 +1,44 @@ +/* + * 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.librecms.sites; + +import org.libreccm.core.CcmObjectRepository; + +import javax.enterprise.context.RequestScoped; +import javax.persistence.TypedQuery; +import javax.transaction.Transactional; + +/** + * + * @author Jens Pelzetter + */ +@RequestScoped +public class SiteRepository extends CcmObjectRepository { + + @Transactional(Transactional.TxType.REQUIRED) + public Site findByName(final String name) { + + final TypedQuery query = getEntityManager() + .createNamedQuery("Site.findByName", Site.class); + query.setParameter("name", name); + + return query.getSingleResult(); + } + +} diff --git a/ccm-cms/src/main/java/org/librecms/sites/Sites.java b/ccm-cms/src/main/java/org/librecms/sites/Sites.java new file mode 100644 index 000000000..47e92256a --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/sites/Sites.java @@ -0,0 +1,45 @@ +/* + * 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.librecms.sites; + +import java.util.HashSet; +import java.util.Set; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +/** + * + * + * @author Jens Pelzetter + */ +@ApplicationPath("/pages") +public class Sites extends Application { + + @Override + public Set> getClasses() { + + final Set> classes = new HashSet<>(); + + classes.add(Pages.class); + + return classes; + } + +} diff --git a/ccm-cms/src/main/java/org/librecms/ui/ContentItemEditor.java b/ccm-cms/src/main/java/org/librecms/ui/ContentItemEditor.java new file mode 100644 index 000000000..fb496aff7 --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/ui/ContentItemEditor.java @@ -0,0 +1,131 @@ +/* + * 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.librecms.ui; + +import com.vaadin.ui.Button; +import com.vaadin.ui.Component; +import com.vaadin.ui.Label; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; +import com.vaadin.ui.themes.ValoTheme; +import org.librecms.contentsection.ContentItem; +import org.librecms.contenttypes.AuthoringKitInfo; +import org.librecms.contenttypes.AuthoringStepInfo; +import org.librecms.contenttypes.ContentTypeInfo; +import org.librecms.contenttypes.ContentTypesManager; + +import java.lang.reflect.InvocationTargetException; +import java.util.List; +import java.util.ResourceBundle; + +/** + * + * @author Jens Pelzetter + */ +public class ContentItemEditor extends Window { + + private static final long serialVersionUID = 3341827053652019616L; + + private List authoringsSteps; + + public ContentItemEditor(final ContentSectionViewController controller, + final ContentItem item) { + + super(); + + final ContentTypesManager typesManager = controller + .getContentTypesManager(); + final ContentTypeInfo typeInfo = typesManager + .getContentTypeInfo(item.getContentType()); + + final AuthoringKitInfo authoringKitInfo = typeInfo.getAuthoringKit(); + final List authoringsStepInfos = authoringKitInfo + .getAuthoringSteps(); + + final VerticalLayout sidebar = new VerticalLayout(); + final VerticalLayout mainArea = new VerticalLayout(); + for (final AuthoringStepInfo stepInfo : authoringsStepInfos) { + + final String componentClassName; + if (stepInfo.getComponent().getName() + .startsWith("com.arsdigita.cms")) { + componentClassName = stepInfo + .getComponent() + .getName() + .replace("com.arsdigita.cms", "org.librecms"); + } else if (stepInfo.getComponent().getName().startsWith( + "com.arsdigita")) { + componentClassName = stepInfo + .getComponent() + .getName() + .replace("com.arsdigita", "org.libreccm"); + } else { + componentClassName = stepInfo.getComponent().getName(); + } + + final Component authoringStep = createAuthoringStep( + controller, item, componentClassName); + final ResourceBundle resourceBundle = ResourceBundle + .getBundle(stepInfo.getLabelBundle(), + controller + .getGlobalizationHelper() + .getNegotiatedLocale()); + final Button button = new Button(resourceBundle + .getString(stepInfo.getLabelKey())); + button.addStyleName(ValoTheme.BUTTON_LINK); + button.addClickListener(event-> authoringStep.setVisible(true)); + authoringStep.setVisible(false); + sidebar.addComponent(button); + mainArea.addComponent(authoringStep); + authoringsSteps.add(authoringStep); + } + + authoringsSteps.get(0).setVisible(true); + } + + private Component createAuthoringStep( + final ContentSectionViewController controller, + final ContentItem item, + final String componentClassName) { + + try { + @SuppressWarnings("unchecked") + final Class stepClass = (Class) Class + .forName(componentClassName); + + return stepClass + .getDeclaredConstructor(ContentSectionViewController.class, + ContentItem.class) + .newInstance(controller, item); + } catch (ClassNotFoundException + | NoSuchMethodException + | InstantiationException + | IllegalAccessException + | InvocationTargetException ex) { + + final Label label = new Label(String + .format("AuthoringStep \"%s\" not available", + componentClassName)); + label.addStyleName(ValoTheme.LABEL_FAILURE); + return new VerticalLayout(label); + } + + } + +} diff --git a/ccm-cms/src/main/java/org/librecms/ui/ContentSectionViewController.java b/ccm-cms/src/main/java/org/librecms/ui/ContentSectionViewController.java index 52d22324a..db86a7d93 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/ContentSectionViewController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/ContentSectionViewController.java @@ -21,7 +21,6 @@ package org.librecms.ui; import com.vaadin.cdi.ViewScoped; import org.libreccm.l10n.GlobalizationHelper; import org.libreccm.security.PermissionChecker; -import org.librecms.contentsection.ContentSection; import org.librecms.contentsection.ContentSectionRepository; import org.librecms.contentsection.FolderRepository; import org.librecms.contenttypes.ContentTypesManager; diff --git a/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_16__create_sites.sql b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_16__create_sites.sql new file mode 100644 index 000000000..ff1974007 --- /dev/null +++ b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/h2/V7_0_0_16__create_sites.sql @@ -0,0 +1,20 @@ +create table CCM_CMS.SITES ( + DEFAULT_SITE boolean, + NAME varchar(255), + OBJECT_ID bigint not null, + CATEGORY_DOMAIN_ID bigint, + primary key (OBJECT_ID) +); + +alter table CCM_CMS.SITES + add constraint UK_fgjx0nuuxlgnuit724a96vw81 unique (NAME); + +alter table CCM_CMS.SITES + add constraint FKmiysfmv1nkcso6bm18sjhvtm8 + foreign key (CATEGORY_DOMAIN_ID) + references CCM_CORE.CATEGORY_DOMAINS; + +alter table CCM_CMS.SITES + add constraint FK5kmn26x72uue9t3dfnjwes45 + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; diff --git a/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_16__create_sites.sql b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_16__create_sites.sql new file mode 100644 index 000000000..7526e4211 --- /dev/null +++ b/ccm-cms/src/main/resources/db/migrations/org/librecms/ccm_cms/pgsql/V7_0_0_16__create_sites.sql @@ -0,0 +1,20 @@ +create table CCM_CMS.SITES ( + DEFAULT_SITE boolean, + NAME varchar(255), + OBJECT_ID int8 not null, + CATEGORY_DOMAIN_ID int8, + primary key (OBJECT_ID) +); + +alter table CCM_CMS.SITES + add constraint UK_fgjx0nuuxlgnuit724a96vw81 unique (NAME); + +alter table CCM_CMS.SITES + add constraint FKmiysfmv1nkcso6bm18sjhvtm8 + foreign key (CATEGORY_DOMAIN_ID) + references CCM_CORE.CATEGORY_DOMAINS; + +alter table CCM_CMS.SITES + add constraint FK5kmn26x72uue9t3dfnjwes45 + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; diff --git a/ccm-cms/src/main/resources/org/librecms/CmsResources.properties b/ccm-cms/src/main/resources/org/librecms/CmsResources.properties index bf65aeec6..aeea05001 100644 --- a/ccm-cms/src/main/resources/org/librecms/CmsResources.properties +++ b/ccm-cms/src/main/resources/org/librecms/CmsResources.properties @@ -447,3 +447,13 @@ cms.ui.authoring.assets.related_info_step.internal_link.target_item=Target item_category_step.label=Assigned categories related_info_step.description=Assign this item to categories cms.ui.authoring.launch_date_required=Lauch date is required +cms.ui.item.lifecycle.apply=Select a lifecycle to apply +cms.ui.item.lifecycle=Lifecycle +cms.ui.item.lifecycle.start_date=Start date +cms.ui.item.lifecycle.end_date=End date +cms.ui.item.lifecycle.start_time=Start time +cms.ui.item.lifecycle.end_time\ =End time +cms.ui.item.notification_period=Notify in advance +cms.ui.item.days=days +cms.ui.item.hours=hours +cms.ui.item.lifecycle.publish=Publish content item diff --git a/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties b/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties index 4a80f0f5f..2f277a76d 100644 --- a/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties +++ b/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties @@ -444,3 +444,13 @@ cms.ui.authoring.assets.related_info_step.internal_link.target_item=Ziel item_category_step.label=Zugewiesene Kategorien related_info_step.description=Dieses Dokument Kategorien zuweisen cms.ui.authoring.launch_date_required=Lauch date is required +cms.ui.item.lifecycle.apply=Anzuwendenen Veroffentlichungszyklus ausw\u00e4hlen +cms.ui.item.lifecycle=Ver\u00f6ffentlichungszyklus +cms.ui.item.lifecycle.start_date=Beginnt am +cms.ui.item.lifecycle.end_date=Endet am +cms.ui.item.lifecycle.start_time=Beginnt um +cms.ui.item.lifecycle.end_time\ =Endet um +cms.ui.item.notification_period=Vorab Benachrichtigung +cms.ui.item.days=Tage +cms.ui.item.hours=Stunden +cms.ui.item.lifecycle.publish=Dokument ver\u00f6ffentlichen diff --git a/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties b/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties index 6705d0ac9..eb5d0ec46 100644 --- a/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties +++ b/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties @@ -403,3 +403,13 @@ cms.ui.authoring.assets.related_info_step.internal_link.target_item=Target item_category_step.label=Assigned categories related_info_step.description=Assign this item to categories cms.ui.authoring.launch_date_required=Lauch date is required +cms.ui.item.lifecycle.apply=Select a lifecycle to apply +cms.ui.item.lifecycle=Lifecycle +cms.ui.item.lifecycle.start_date=Start date +cms.ui.item.lifecycle.end_date=End date +cms.ui.item.lifecycle.start_time=Start time +cms.ui.item.lifecycle.end_time\ =End time +cms.ui.item.notification_period=Notify in advance +cms.ui.item.days=days +cms.ui.item.hours=hours +cms.ui.item.lifecycle.publish=Publish content item 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 fbe41e005..88ef238e7 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 @@ -3,8 +3,8 @@ drop schema if exists CCM_CORE; drop sequence if exists HIBERNATE_SEQUENCE; -create schema CCM_CMS; -create schema CCM_CORE; + create schema CCM_CMS; + create schema CCM_CORE; create table CCM_CMS.ARTICLE_TEXTS ( OBJECT_ID bigint not null, @@ -814,6 +814,14 @@ create schema CCM_CORE; primary key (OBJECT_ID, REV) ); + create table CCM_CMS.SITES ( + DEFAULT_SITE boolean, + NAME varchar(255), + OBJECT_ID bigint not null, + CATEGORY_DOMAIN_ID bigint, + primary key (OBJECT_ID) + ); + create table CCM_CMS.VIDEO_ASSETS ( HEIGHT bigint, WIDTH bigint, @@ -843,6 +851,9 @@ create schema CCM_CORE; alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID); + alter table CCM_CMS.SITES + add constraint UK_fgjx0nuuxlgnuit724a96vw81 unique (NAME); + create table CCM_CORE.APPLICATIONS ( APPLICATION_TYPE varchar(1024) not null, PRIMARY_URL varchar(1024) not null, @@ -1368,11 +1379,11 @@ create schema CCM_CORE; SETTING_ID bigint not null, CONFIGURATION_CLASS varchar(512) not null, NAME varchar(512) not null, - SETTING_VALUE_DOUBLE double, - SETTING_VALUE_LONG bigint, SETTING_VALUE_BOOLEAN boolean, - SETTING_VALUE_BIG_DECIMAL decimal(19,2), SETTING_VALUE_STRING varchar(1024), + SETTING_VALUE_BIG_DECIMAL decimal(19,2), + SETTING_VALUE_LONG bigint, + SETTING_VALUE_DOUBLE double, primary key (SETTING_ID) ); @@ -1490,7 +1501,7 @@ create schema CCM_CORE; create table CCM_CORE.WORKFLOWS ( WORKFLOW_ID bigint not null, - ABSTRACT_WORKFLOW boolean, + abstract_workflow boolean, ACTIVE boolean, WORKFLOW_STATE varchar(255), TASKS_STATE varchar(255), @@ -2254,6 +2265,16 @@ create schema CCM_CORE; foreign key (OBJECT_ID, REV) references CCM_CMS.ASSETS_AUD; + alter table CCM_CMS.SITES + add constraint FKmiysfmv1nkcso6bm18sjhvtm8 + foreign key (CATEGORY_DOMAIN_ID) + references CCM_CORE.CATEGORY_DOMAINS; + + alter table CCM_CMS.SITES + add constraint FK5kmn26x72uue9t3dfnjwes45 + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; + alter table CCM_CMS.VIDEO_ASSETS add constraint FKjuywvv7wq9pyid5b6ivyrc0yk foreign key (LEGAL_METADATA_ID) 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 8c48bfad5..84913c2e5 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 @@ -3,8 +3,8 @@ drop schema if exists CCM_CORE cascade; drop sequence if exists HIBERNATE_SEQUENCE; -create schema CCM_CMS; -create schema CCM_CORE; + create schema CCM_CMS; + create schema CCM_CORE; create table CCM_CMS.ARTICLE_TEXTS ( OBJECT_ID int8 not null, @@ -168,2051 +168,6 @@ create schema CCM_CORE; primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE) ); - create table CCM_CMS.BINARY_ASSETS ( - ASSET_DATA oid, - FILENAME varchar(512), - MIME_TYPE varchar(512), - 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_BIG_DECIMAL numeric(19, 2), - SETTING_VALUE_BOOLEAN boolean, - SETTING_VALUE_STRING varchar(1024), - SETTING_VALUE_DOUBLE float8, - SETTING_VALUE_LONG int8, - 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.WORKFLOW_TEMPLATES ( - WORKFLOW_ID int8 not null, - primary key (WORKFLOW_ID) - ); - - create table CCM_CORE.WORKFLOWS ( - WORKFLOW_ID int8 not null, - 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_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 FKc1x3h1p3o20qiwmonpmva7t5i - 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.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 - 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, @@ -2859,6 +814,14 @@ create sequence hibernate_sequence start 1 increment 1; primary key (OBJECT_ID, REV) ); + create table CCM_CMS.SITES ( + DEFAULT_SITE boolean, + NAME varchar(255), + OBJECT_ID int8 not null, + CATEGORY_DOMAIN_ID int8, + primary key (OBJECT_ID) + ); + create table CCM_CMS.VIDEO_ASSETS ( HEIGHT int8, WIDTH int8, @@ -2888,6 +851,9 @@ create sequence hibernate_sequence start 1 increment 1; alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID); + alter table CCM_CMS.SITES + add constraint UK_fgjx0nuuxlgnuit724a96vw81 unique (NAME); + create table CCM_CORE.APPLICATIONS ( APPLICATION_TYPE varchar(1024) not null, PRIMARY_URL varchar(1024) not null, @@ -3413,11 +1379,11 @@ create sequence hibernate_sequence start 1 increment 1; 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), + SETTING_VALUE_BIG_DECIMAL numeric(19, 2), + SETTING_VALUE_LONG int8, + SETTING_VALUE_DOUBLE float8, primary key (SETTING_ID) ); @@ -4299,6 +2265,16 @@ create sequence hibernate_sequence start 1 increment 1; foreign key (OBJECT_ID, REV) references CCM_CMS.ASSETS_AUD; + alter table CCM_CMS.SITES + add constraint FKmiysfmv1nkcso6bm18sjhvtm8 + foreign key (CATEGORY_DOMAIN_ID) + references CCM_CORE.CATEGORY_DOMAINS; + + alter table CCM_CMS.SITES + add constraint FK5kmn26x72uue9t3dfnjwes45 + foreign key (OBJECT_ID) + references CCM_CORE.APPLICATIONS; + alter table CCM_CMS.VIDEO_ASSETS add constraint FKjuywvv7wq9pyid5b6ivyrc0yk foreign key (LEGAL_METADATA_ID) diff --git a/ccm-core/src/main/java/org/libreccm/core/Resource.java b/ccm-core/src/main/java/org/libreccm/core/Resource.java index 51ec4ea91..c2e0f614c 100644 --- a/ccm-core/src/main/java/org/libreccm/core/Resource.java +++ b/ccm-core/src/main/java/org/libreccm/core/Resource.java @@ -25,12 +25,30 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators; import org.libreccm.l10n.LocalizedString; import org.libreccm.web.CcmApplication; -import javax.persistence.*; import java.io.Serializable; -import java.util.*; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +import javax.persistence.AssociationOverride; +import javax.persistence.Column; +import javax.persistence.Embedded; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + /** * The {@code Resource} class is a base class for several other classes, for * example the {@link CcmApplication} class. diff --git a/ccm-core/src/main/java/org/libreccm/pagemodel/ComponentModel.java b/ccm-core/src/main/java/org/libreccm/pagemodel/ComponentModel.java index d266e8287..48043ae07 100644 --- a/ccm-core/src/main/java/org/libreccm/pagemodel/ComponentModel.java +++ b/ccm-core/src/main/java/org/libreccm/pagemodel/ComponentModel.java @@ -20,11 +20,22 @@ package org.libreccm.pagemodel; import org.libreccm.core.CoreConstants; -import javax.persistence.*; import javax.validation.constraints.NotNull; + import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + /** * Base class for the components model for use in a {@link PageModel}. This * class is not designed for direct use. Instead the classes for concrete diff --git a/ccm-core/src/main/java/org/libreccm/pagemodel/PageBuilder.java b/ccm-core/src/main/java/org/libreccm/pagemodel/PageBuilder.java index d5b7ab948..7359f4074 100644 --- a/ccm-core/src/main/java/org/libreccm/pagemodel/PageBuilder.java +++ b/ccm-core/src/main/java/org/libreccm/pagemodel/PageBuilder.java @@ -28,8 +28,7 @@ import javax.enterprise.context.RequestScoped; * * An implementation should add all default components which have to be present * in page. The {@link PageModel} should only specify - * additional - * components. + * additional components. * * * @author Jens Pelzetter @@ -39,7 +38,7 @@ public interface PageBuilder

{ /** * Build a page for the view technology supported by this page builder - * without an additional components. + * without any additional components. * {@link #buildPage(org.libreccm.pagemodel.PageModel)} should use this * method for creating the default page. * diff --git a/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java b/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java index a7f02e3ba..ed4ef472e 100644 --- a/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java +++ b/ccm-core/src/main/java/org/libreccm/pagemodel/PageModel.java @@ -22,13 +22,32 @@ import org.libreccm.core.CoreConstants; import org.libreccm.l10n.LocalizedString; import org.libreccm.web.CcmApplication; -import javax.persistence.*; import javax.validation.constraints.NotNull; + import java.io.Serializable; import java.util.Collections; import java.util.List; import java.util.Objects; +import javax.persistence.AssociationOverride; +import javax.persistence.Column; +import javax.persistence.Embedded; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; + /** * A {@link PageModel} is used by a {@link PageBuilder} implementation to build * a page. The {@code PageModel} specifics which components are used on a page. diff --git a/ccm-core/src/main/java/org/libreccm/security/Group.java b/ccm-core/src/main/java/org/libreccm/security/Group.java index 61b84336f..88f33fcdc 100644 --- a/ccm-core/src/main/java/org/libreccm/security/Group.java +++ b/ccm-core/src/main/java/org/libreccm/security/Group.java @@ -162,11 +162,4 @@ public class Group extends Party implements Serializable, Portable { return super.hashCode(); } - @Override - public String toString(final String data) { - return super.toString(String.format(", members = { %s }%s", - Objects.toString(memberships), - data)); - } - -} +} \ No newline at end of file diff --git a/ccm-core/src/main/java/org/libreccm/security/Party.java b/ccm-core/src/main/java/org/libreccm/security/Party.java index f1c201ff9..dcb12692f 100644 --- a/ccm-core/src/main/java/org/libreccm/security/Party.java +++ b/ccm-core/src/main/java/org/libreccm/security/Party.java @@ -22,10 +22,10 @@ import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.ObjectIdGenerators; -import javax.persistence.*; import javax.validation.constraints.NotNull; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; + import java.io.Serializable; import java.util.Collections; import java.util.HashSet; @@ -35,6 +35,21 @@ import java.util.Set; import static org.libreccm.core.CoreConstants.CORE_XML_NS; import static org.libreccm.core.CoreConstants.DB_SCHEMA; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.NamedAttributeNode; +import javax.persistence.NamedEntityGraph; +import javax.persistence.NamedEntityGraphs; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; + /** * Party is a base class for {@link User} and {@link Group} defining some common * characteristics and associations, especially the association to @@ -178,13 +193,11 @@ public class Party implements Serializable { public String toString(final String data) { return String.format("%s{ " + "partyId = %d, " - + "name = \"%s\", " - + "roles = { %s }%s" + + "name = \"%s\"%s" + " }", super.toString(), partyId, name, - Objects.toString(roleMemberships), data); } diff --git a/ccm-core/src/main/java/org/libreccm/ui/ConfirmDialog.java b/ccm-core/src/main/java/org/libreccm/ui/ConfirmDialog.java index 1b3ac5535..51fa86956 100644 --- a/ccm-core/src/main/java/org/libreccm/ui/ConfirmDialog.java +++ b/ccm-core/src/main/java/org/libreccm/ui/ConfirmDialog.java @@ -43,6 +43,8 @@ public class ConfirmDialog extends Window { private Button cancelButton; public ConfirmDialog(final Callable confirmedAction) { + super(); + this.confirmedAction = confirmedAction; this.cancelAction = () -> { close(); @@ -53,6 +55,8 @@ public class ConfirmDialog extends Window { public ConfirmDialog(final Callable confirmedAction, final Callable cancelAction) { + super(); + this.confirmedAction = confirmedAction; this.cancelAction = cancelAction; addWidgets();