CCM NG: First part of changed permission inhertitence

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4533 8810af33-2d31-482b-a856-94f89814c4df
ccm-docs
jensp 2017-01-23 19:11:56 +00:00
parent 997edf8af2
commit eb737fcb02
21 changed files with 1287 additions and 572 deletions

View File

@ -23,6 +23,8 @@ import org.libreccm.core.CcmObject;
import org.libreccm.core.Identifiable; import org.libreccm.core.Identifiable;
import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedString;
import org.libreccm.security.InheritsPermissions; import org.libreccm.security.InheritsPermissions;
import org.libreccm.security.RecursivePermissions;
import org.librecms.contentsection.privileges.AssetPrivileges;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
@ -137,6 +139,9 @@ public class AttachmentList implements Comparable<AttachmentList>,
private LocalizedString description; private LocalizedString description;
@OneToMany(mappedBy = "attachmentList") @OneToMany(mappedBy = "attachmentList")
@RecursivePermissions(privileges = {AssetPrivileges.EDIT,
AssetPrivileges.DELETE,
AssetPrivileges.VIEW})
private List<ItemAttachment<?>> attachments; private List<ItemAttachment<?>> attachments;
public AttachmentList() { public AttachmentList() {

View File

@ -54,7 +54,11 @@ import javax.persistence.OneToOne;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import org.hibernate.search.annotations.IndexedEmbedded; import org.hibernate.search.annotations.IndexedEmbedded;
import org.libreccm.security.RecursivePermissions;
import org.librecms.contentsection.privileges.AssetPrivileges;
import org.librecms.contentsection.privileges.ItemPrivileges;
import static org.librecms.CmsConstants.*; import static org.librecms.CmsConstants.*;
@ -237,6 +241,9 @@ public class ContentItem extends CcmObject implements Serializable,
@Column(name = "ANCESTORS", length = 1024) @Column(name = "ANCESTORS", length = 1024)
private String ancestors; private String ancestors;
@RecursivePermissions(privileges = {AssetPrivileges.EDIT,
AssetPrivileges.DELETE,
AssetPrivileges.VIEW})
@OneToMany(mappedBy = "item") @OneToMany(mappedBy = "item")
private List<AttachmentList> attachments; private List<AttachmentList> attachments;

View File

@ -18,6 +18,7 @@
*/ */
package org.librecms.contentsection; package org.librecms.contentsection;
import org.libreccm.security.RecursivePermissions;
import org.libreccm.security.Role; import org.libreccm.security.Role;
import org.libreccm.web.CcmApplication; import org.libreccm.web.CcmApplication;
@ -42,6 +43,8 @@ import javax.persistence.NamedQuery;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import org.libreccm.workflow.WorkflowTemplate; import org.libreccm.workflow.WorkflowTemplate;
import org.librecms.contentsection.privileges.AssetPrivileges;
import org.librecms.contentsection.privileges.ItemPrivileges;
import org.librecms.lifecycle.LifecycleDefinition; import org.librecms.lifecycle.LifecycleDefinition;
import static org.librecms.CmsConstants.*; import static org.librecms.CmsConstants.*;
@ -54,14 +57,15 @@ import static org.librecms.CmsConstants.*;
@Table(name = "CONTENT_SECTIONS", schema = DB_SCHEMA) @Table(name = "CONTENT_SECTIONS", schema = DB_SCHEMA)
@NamedQueries({ @NamedQueries({
@NamedQuery( @NamedQuery(
name = "ContentSection.findByLabel", name = "ContentSection.findByLabel",
query = "SELECT s FROM ContentSection s WHERE s.label = :label"), query = "SELECT s FROM ContentSection s WHERE s.label = :label")
,
@NamedQuery( @NamedQuery(
name = "ContentSection.findPermissions", name = "ContentSection.findPermissions",
query = "SELECT p FROM Permission p " query = "SELECT p FROM Permission p "
+ "WHERE (p.object = :section " + "WHERE (p.object = :section "
+ " OR p.object = :rootDocumentsFolder) " + " OR p.object = :rootDocumentsFolder) "
+ "AND p.grantee = :role") + "AND p.grantee = :role")
}) })
//@ApplicationType( //@ApplicationType(
// name = CONTENT_SECTION_APP_TYPE, // name = CONTENT_SECTION_APP_TYPE,
@ -86,10 +90,25 @@ public class ContentSection extends CcmApplication implements Serializable {
@Column(name = "LABEL", length = 512) @Column(name = "LABEL", length = 512)
private String label; private String label;
@RecursivePermissions(privileges = {ItemPrivileges.ADMINISTER,
ItemPrivileges.APPLY_ALTERNATE_WORKFLOW,
ItemPrivileges.APPROVE,
ItemPrivileges.CATEGORIZE,
ItemPrivileges.CREATE_NEW,
ItemPrivileges.DELETE,
ItemPrivileges.EDIT,
ItemPrivileges.PREVIEW,
ItemPrivileges.PUBLISH,
ItemPrivileges.VIEW_PUBLISHED})
@OneToOne @OneToOne
@JoinColumn(name = "ROOT_DOCUMENTS_FOLDER_ID") @JoinColumn(name = "ROOT_DOCUMENTS_FOLDER_ID")
private Folder rootDocumentsFolder; private Folder rootDocumentsFolder;
@RecursivePermissions(privileges = {AssetPrivileges.CREATE_NEW,
AssetPrivileges.DELETE,
AssetPrivileges.EDIT,
AssetPrivileges.USE,
AssetPrivileges.VIEW})
@OneToOne @OneToOne
@JoinColumn(name = "ROOT_ASSETS_FOLDER_ID") @JoinColumn(name = "ROOT_ASSETS_FOLDER_ID")
private Folder rootAssetsFolder; private Folder rootAssetsFolder;
@ -125,27 +144,27 @@ public class ContentSection extends CcmApplication implements Serializable {
@OneToMany @OneToMany
@JoinTable( @JoinTable(
name = "CONTENT_SECTION_LIFECYCLE_DEFINITIONS", name = "CONTENT_SECTION_LIFECYCLE_DEFINITIONS",
schema = DB_SCHEMA, schema = DB_SCHEMA,
joinColumns = { joinColumns = {
@JoinColumn(name = "CONTENT_SECTION_ID") @JoinColumn(name = "CONTENT_SECTION_ID")
}, },
inverseJoinColumns = { inverseJoinColumns = {
@JoinColumn(name = "LIFECYCLE_DEFINITION_ID") @JoinColumn(name = "LIFECYCLE_DEFINITION_ID")
} }
) )
private List<LifecycleDefinition> lifecycleDefinitions; private List<LifecycleDefinition> lifecycleDefinitions;
@OneToMany @OneToMany
@JoinTable( @JoinTable(
name = "CONTENT_SECTION_WORKFLOW_TEMPLATES", name = "CONTENT_SECTION_WORKFLOW_TEMPLATES",
schema = DB_SCHEMA, schema = DB_SCHEMA,
joinColumns = { joinColumns = {
@JoinColumn(name = "CONTENT_SECTION_ID") @JoinColumn(name = "CONTENT_SECTION_ID")
}, },
inverseJoinColumns = { inverseJoinColumns = {
@JoinColumn(name = "WORKFLOW_TEMPLATE_ID") @JoinColumn(name = "WORKFLOW_TEMPLATE_ID")
} }
) )
private List<WorkflowTemplate> workflowTemplates; private List<WorkflowTemplate> workflowTemplates;
@ -267,7 +286,7 @@ public class ContentSection extends CcmApplication implements Serializable {
} }
protected void setLifecycleDefinitions( protected void setLifecycleDefinitions(
final List<LifecycleDefinition> lifecycleDefinitions) { final List<LifecycleDefinition> lifecycleDefinitions) {
this.lifecycleDefinitions = lifecycleDefinitions; this.lifecycleDefinitions = lifecycleDefinitions;
} }
@ -276,25 +295,26 @@ public class ContentSection extends CcmApplication implements Serializable {
} }
protected void removeLifecycleDefinition( protected void removeLifecycleDefinition(
final LifecycleDefinition definition) { final LifecycleDefinition definition) {
lifecycleDefinitions.remove(definition); lifecycleDefinitions.remove(definition);
} }
public List<WorkflowTemplate> getWorkflowTemplates() { public List<WorkflowTemplate> getWorkflowTemplates() {
return Collections.unmodifiableList(workflowTemplates); return Collections.unmodifiableList(workflowTemplates);
} }
protected void setWorkflowTemplates(final List<WorkflowTemplate> workflowTemplates) { protected void setWorkflowTemplates(
this.workflowTemplates = workflowTemplates; final List<WorkflowTemplate> workflowTemplates) {
} this.workflowTemplates = workflowTemplates;
}
protected void addWorkflowTemplate(final WorkflowTemplate template) {
workflowTemplates.add(template); protected void addWorkflowTemplate(final WorkflowTemplate template) {
} workflowTemplates.add(template);
}
protected void removeWorkflowTemplate(final WorkflowTemplate template) {
workflowTemplates.remove(template); protected void removeWorkflowTemplate(final WorkflowTemplate template) {
} workflowTemplates.remove(template);
}
@Override @Override
public int hashCode() { public int hashCode() {
@ -362,23 +382,23 @@ public class ContentSection extends CcmApplication implements Serializable {
@Override @Override
public String toString(final String data) { public String toString(final String data) {
return super.toString(String.format( return super.toString(String.format(
", label = \"%s\", " ", label = \"%s\", "
+ "rootDocumentsFolder = \"%s\", " + "rootDocumentsFolder = \"%s\", "
+ "rootAssetsFolder = \"%s\", " + "rootAssetsFolder = \"%s\", "
+ "pageResolverClass = \"%s\", " + "pageResolverClass = \"%s\", "
+ "itemResolverClass = \"%s\", " + "itemResolverClass = \"%s\", "
+ "templateResolverClass = \"%s\", " + "templateResolverClass = \"%s\", "
+ "xmlGeneratorClass = \"%s\", " + "xmlGeneratorClass = \"%s\", "
+ "defaultLocale = \"%s\"%s", + "defaultLocale = \"%s\"%s",
label, label,
Objects.toString(rootDocumentsFolder), Objects.toString(rootDocumentsFolder),
Objects.toString(rootAssetsFolder), Objects.toString(rootAssetsFolder),
pageResolverClass, pageResolverClass,
itemResolverClass, itemResolverClass,
templateResolverClass, templateResolverClass,
xmlGeneratorClass, xmlGeneratorClass,
Objects.toString(defaultLocale), Objects.toString(defaultLocale),
data)); data));
} }
} }

View File

@ -856,50 +856,49 @@ create schema CCM_CORE;
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID); add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID);
create table CCM_CORE.APPLICATIONS ( create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null, APPLICATION_TYPE varchar(1024) not null,
PRIMARY_URL varchar(1024) not null, PRIMARY_URL varchar(1024) not null,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.ATTACHMENTS ( create table CCM_CORE.ATTACHMENTS (
ATTACHMENT_ID int8 not null, ATTACHMENT_ID bigint not null,
ATTACHMENT_DATA oid, ATTACHMENT_DATA blob,
DESCRIPTION varchar(255), DESCRIPTION varchar(255),
MIME_TYPE varchar(255), MIME_TYPE varchar(255),
TITLE varchar(255), TITLE varchar(255),
MESSAGE_ID int8, MESSAGE_ID bigint,
primary key (ATTACHMENT_ID) primary key (ATTACHMENT_ID)
); );
create table CCM_CORE.CATEGORIES ( create table CCM_CORE.CATEGORIES (
ABSTRACT_CATEGORY boolean, ABSTRACT_CATEGORY boolean,
CATEGORY_ORDER int8, CATEGORY_ORDER bigint,
ENABLED boolean, ENABLED boolean,
NAME varchar(255) not null, NAME varchar(255) not null,
UNIQUE_ID varchar(255), UNIQUE_ID varchar(255),
VISIBLE boolean, VISIBLE boolean,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
PARENT_CATEGORY_ID int8, PARENT_CATEGORY_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.CATEGORIZATIONS ( create table CCM_CORE.CATEGORIZATIONS (
CATEGORIZATION_ID int8 not null, CATEGORIZATION_ID bigint not null,
CATEGORY_ORDER int8, CATEGORY_ORDER bigint,
CATEGORY_INDEX boolean, CATEGORY_INDEX boolean,
OBJECT_ORDER int8, OBJECT_ORDER bigint,
TYPE varchar(255), TYPE varchar(255),
OBJECT_ID int8, OBJECT_ID bigint,
CATEGORY_ID int8, CATEGORY_ID bigint,
primary key (CATEGORIZATION_ID) primary key (CATEGORIZATION_ID)
); );
create table CCM_CORE.CATEGORY_DESCRIPTIONS ( create table CCM_CORE.CATEGORY_DESCRIPTIONS (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
@ -909,86 +908,86 @@ create schema CCM_CORE;
RELEASED timestamp, RELEASED timestamp,
URI varchar(1024), URI varchar(1024),
VERSION varchar(255), VERSION varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
ROOT_CATEGORY_ID int8, ROOT_CATEGORY_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.CATEGORY_TITLES ( create table CCM_CORE.CATEGORY_TITLES (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.CCM_OBJECTS ( create table CCM_CORE.CCM_OBJECTS (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
DISPLAY_NAME varchar(255), DISPLAY_NAME varchar(255),
UUID varchar(255), UUID varchar(255),
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.CCM_OBJECTS_AUD ( create table CCM_CORE.CCM_OBJECTS_AUD (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
REV int4 not null, REV integer not null,
REVTYPE int2, REVTYPE tinyint,
REVEND int4, REVEND integer,
DISPLAY_NAME varchar(255), DISPLAY_NAME varchar(255),
primary key (OBJECT_ID, REV) primary key (OBJECT_ID, REV)
); );
create table CCM_CORE.CCM_REVISIONS ( create table CCM_CORE.CCM_REVISIONS (
id int4 not null, id integer not null,
timestamp int8 not null, timestamp bigint not null,
USER_NAME varchar(255), USER_NAME varchar(255),
primary key (id) primary key (id)
); );
create table CCM_CORE.CCM_ROLES ( create table CCM_CORE.CCM_ROLES (
ROLE_ID int8 not null, ROLE_ID bigint not null,
NAME varchar(512) not null, NAME varchar(512) not null,
primary key (ROLE_ID) primary key (ROLE_ID)
); );
create table CCM_CORE.DIGESTS ( create table CCM_CORE.DIGESTS (
FREQUENCY int4, FREQUENCY integer,
HEADER varchar(4096) not null, HEADER varchar(4096) not null,
NEXT_RUN timestamp, NEXT_RUN timestamp,
DIGEST_SEPARATOR varchar(128) not null, DIGEST_SEPARATOR varchar(128) not null,
SIGNATURE varchar(4096) not null, SIGNATURE varchar(4096) not null,
SUBJECT varchar(255) not null, SUBJECT varchar(255) not null,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
FROM_PARTY_ID int8, FROM_PARTY_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.DOMAIN_DESCRIPTIONS ( create table CCM_CORE.DOMAIN_DESCRIPTIONS (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.DOMAIN_OWNERSHIPS ( create table CCM_CORE.DOMAIN_OWNERSHIPS (
OWNERSHIP_ID int8 not null, OWNERSHIP_ID bigint not null,
CONTEXT varchar(255), CONTEXT varchar(255),
DOMAIN_ORDER int8, DOMAIN_ORDER bigint,
OWNER_ORDER int8, OWNER_ORDER bigint,
domain_OBJECT_ID int8 not null, domain_OBJECT_ID bigint not null,
owner_OBJECT_ID int8 not null, owner_OBJECT_ID bigint not null,
primary key (OWNERSHIP_ID) primary key (OWNERSHIP_ID)
); );
create table CCM_CORE.DOMAIN_TITLES ( create table CCM_CORE.DOMAIN_TITLES (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS (
COMPONENT_ID int8 not null, COMPONENT_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (COMPONENT_ID, LOCALE) primary key (COMPONENT_ID, LOCALE)
); );
@ -997,65 +996,65 @@ create schema CCM_CORE;
ACTIVE boolean, ACTIVE boolean,
ADMIN_NAME varchar(255), ADMIN_NAME varchar(255),
ATTRIBUTE_STRING varchar(255), ATTRIBUTE_STRING varchar(255),
COMPONENT_ORDER int8, COMPONENT_ORDER bigint,
SELECTED boolean, SELECTED boolean,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
parentComponent_OBJECT_ID int8, parentComponent_OBJECT_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER ( create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER (
BODY text, BODY clob,
FROM_EMAIL varchar(255), FROM_EMAIL varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS ( create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS (
URL varchar(255), URL varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS ( create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS (
MULTIPLE boolean, MULTIPLE boolean,
QUERY varchar(255), QUERY varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_DATA_QUERIES ( create table CCM_CORE.FORMBUILDER_DATA_QUERIES (
QUERY_ID varchar(255), QUERY_ID varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS (
DATA_QUERY_ID int8 not null, DATA_QUERY_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (DATA_QUERY_ID, LOCALE) primary key (DATA_QUERY_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES (
DATA_QUERY_ID int8 not null, DATA_QUERY_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (DATA_QUERY_ID, LOCALE) primary key (DATA_QUERY_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_FORMSECTIONS ( create table CCM_CORE.FORMBUILDER_FORMSECTIONS (
FORMSECTION_ACTION varchar(255), FORMSECTION_ACTION varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_LISTENERS ( create table CCM_CORE.FORMBUILDER_LISTENERS (
ATTRIBUTE_STRING varchar(255), ATTRIBUTE_STRING varchar(255),
CLASS_NAME varchar(255), CLASS_NAME varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
widget_OBJECT_ID int8, widget_OBJECT_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
@ -1064,76 +1063,76 @@ create schema CCM_CORE;
PRETTY_NAME varchar(255), PRETTY_NAME varchar(255),
PRETTY_PLURAL varchar(255), PRETTY_PLURAL varchar(255),
PROPERTIES_FORM varchar(255), PROPERTIES_FORM varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_OBJECT_TYPES ( create table CCM_CORE.FORMBUILDER_OBJECT_TYPES (
APP_NAME varchar(255), APP_NAME varchar(255),
CLASS_NAME varchar(255), CLASS_NAME varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( create table CCM_CORE.FORMBUILDER_OPTION_LABELS (
OPTION_ID int8 not null, OPTION_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OPTION_ID, LOCALE) primary key (OPTION_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_OPTIONS ( create table CCM_CORE.FORMBUILDER_OPTIONS (
PARAMETER_VALUE varchar(255), PARAMETER_VALUE varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS (
PROCESS_LISTENER_ID int8 not null, PROCESS_LISTENER_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PROCESS_LISTENER_ID, LOCALE) primary key (PROCESS_LISTENER_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES (
PROCESS_LISTENER_ID int8 not null, PROCESS_LISTENER_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PROCESS_LISTENER_ID, LOCALE) primary key (PROCESS_LISTENER_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS (
LISTENER_CLASS varchar(255), LISTENER_CLASS varchar(255),
PROCESS_LISTENER_ORDER int8, PROCESS_LISTENER_ORDER bigint,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
formSection_OBJECT_ID int8, formSection_OBJECT_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER ( create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER (
REMOTE_URL varchar(2048), REMOTE_URL varchar(2048),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS ( create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS (
RECIPIENT varchar(255), RECIPIENT varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS ( create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS (
BODY text, BODY clob,
RECIPIENT varchar(255), RECIPIENT varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_WIDGET_LABELS ( create table CCM_CORE.FORMBUILDER_WIDGET_LABELS (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
widget_OBJECT_ID int8, widget_OBJECT_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
@ -1141,58 +1140,58 @@ create schema CCM_CORE;
DEFAULT_VALUE varchar(255), DEFAULT_VALUE varchar(255),
PARAMETER_MODEL varchar(255), PARAMETER_MODEL varchar(255),
PARAMETER_NAME varchar(255), PARAMETER_NAME varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
label_OBJECT_ID int8, label_OBJECT_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS ( create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS (
RECIPIENT varchar(255), RECIPIENT varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.GROUP_MEMBERSHIPS ( create table CCM_CORE.GROUP_MEMBERSHIPS (
MEMBERSHIP_ID int8 not null, MEMBERSHIP_ID bigint not null,
GROUP_ID int8, GROUP_ID bigint,
MEMBER_ID int8, MEMBER_ID bigint,
primary key (MEMBERSHIP_ID) primary key (MEMBERSHIP_ID)
); );
create table CCM_CORE.GROUPS ( create table CCM_CORE.GROUPS (
PARTY_ID int8 not null, PARTY_ID bigint not null,
primary key (PARTY_ID) primary key (PARTY_ID)
); );
create table CCM_CORE.HOSTS ( create table CCM_CORE.HOSTS (
HOST_ID int8 not null, HOST_ID bigint not null,
SERVER_NAME varchar(512), SERVER_NAME varchar(512),
SERVER_PORT int8, SERVER_PORT bigint,
primary key (HOST_ID) primary key (HOST_ID)
); );
create table CCM_CORE.INITS ( create table CCM_CORE.INITS (
INITIALIZER_ID int8 not null, INITIALIZER_ID bigint not null,
CLASS_NAME varchar(255), CLASS_NAME varchar(255),
REQUIRED_BY_ID int8, REQUIRED_BY_ID bigint,
primary key (INITIALIZER_ID) primary key (INITIALIZER_ID)
); );
create table CCM_CORE.INSTALLED_MODULES ( create table CCM_CORE.INSTALLED_MODULES (
MODULE_ID int4 not null, MODULE_ID integer not null,
MODULE_CLASS_NAME varchar(2048), MODULE_CLASS_NAME varchar(2048),
STATUS varchar(255), STATUS varchar(255),
primary key (MODULE_ID) primary key (MODULE_ID)
); );
create table CCM_CORE.LUCENE_DOCUMENTS ( create table CCM_CORE.LUCENE_DOCUMENTS (
DOCUMENT_ID int8 not null, DOCUMENT_ID bigint not null,
CONTENT text, CONTENT clob,
CONTENT_SECTION varchar(512), CONTENT_SECTION varchar(512),
COUNTRY varchar(8), COUNTRY varchar(8),
CREATED timestamp, CREATED timestamp,
DIRTY int8, DIRTY bigint,
DOCUMENT_LANGUAGE varchar(8), DOCUMENT_LANGUAGE varchar(8),
LAST_MODIFIED timestamp, LAST_MODIFIED timestamp,
SUMMARY varchar(4096), SUMMARY varchar(4096),
@ -1200,15 +1199,15 @@ create schema CCM_CORE;
TITLE varchar(4096), TITLE varchar(4096),
TYPE varchar(255), TYPE varchar(255),
TYPE_SPECIFIC_INFO varchar(512), TYPE_SPECIFIC_INFO varchar(512),
CREATED_BY_PARTY_ID int8, CREATED_BY_PARTY_ID bigint,
LAST_MODIFIED_BY int8, LAST_MODIFIED_BY bigint,
primary key (DOCUMENT_ID) primary key (DOCUMENT_ID)
); );
create table CCM_CORE.LUCENE_INDEXES ( create table CCM_CORE.LUCENE_INDEXES (
INDEX_ID int8 not null, INDEX_ID bigint not null,
LUCENE_INDEX_ID int8, LUCENE_INDEX_ID bigint,
HOST_ID int8, HOST_ID bigint,
primary key (INDEX_ID) primary key (INDEX_ID)
); );
@ -1217,9 +1216,9 @@ create schema CCM_CORE;
BODY_MIME_TYPE varchar(255), BODY_MIME_TYPE varchar(255),
SENT timestamp, SENT timestamp,
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
IN_REPLY_TO_ID int8, IN_REPLY_TO_ID bigint,
SENDER_ID int8, SENDER_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
@ -1229,127 +1228,131 @@ create schema CCM_CORE;
EXPUNGE_MESSAGE boolean, EXPUNGE_MESSAGE boolean,
FULFILL_DATE timestamp, FULFILL_DATE timestamp,
HEADER varchar(4096), HEADER varchar(4096),
MAX_RETRIES int8, MAX_RETRIES bigint,
REQUEST_DATE timestamp, REQUEST_DATE timestamp,
SIGNATURE varchar(4096), SIGNATURE varchar(4096),
STATUS varchar(32), STATUS varchar(32),
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
DIGEST_ID int8, DIGEST_ID bigint,
MESSAGE_ID int8, MESSAGE_ID bigint,
RECEIVER_ID int8, RECEIVER_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( create table CCM_CORE.ONE_TIME_AUTH_TOKENS (
TOKEN_ID int8 not null, TOKEN_ID bigint not null,
PURPOSE varchar(255), PURPOSE varchar(255),
TOKEN varchar(255), TOKEN varchar(255),
VALID_UNTIL timestamp, VALID_UNTIL timestamp,
USER_ID int8, USER_ID bigint,
primary key (TOKEN_ID) primary key (TOKEN_ID)
); );
create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS ( create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS (
COMPONENT_MODEL_ID int8 not null, COMPONENT_MODEL_ID bigint not null,
CLASS_ATTRIBUTE varchar(512), CLASS_ATTRIBUTE varchar(512),
ID_ATTRIBUTE varchar(255), ID_ATTRIBUTE varchar(255),
COMPONENT_KEY varchar(255), COMPONENT_KEY varchar(255),
MODEL_UUID varchar(255) not null,
STYLE_ATTRIBUTE varchar(1024), STYLE_ATTRIBUTE varchar(1024),
UUID varchar(255) not null, UUID varchar(255) not null,
PAGE_MODEL_ID int8, PAGE_MODEL_ID bigint,
primary key (COMPONENT_MODEL_ID) primary key (COMPONENT_MODEL_ID)
); );
create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS (
PAGE_MODEL_ID int8 not null, PAGE_MODEL_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PAGE_MODEL_ID, LOCALE) primary key (PAGE_MODEL_ID, LOCALE)
); );
create table CCM_CORE.PAGE_MODEL_TITLES ( create table CCM_CORE.PAGE_MODEL_TITLES (
PAGE_MODEL_ID int8 not null, PAGE_MODEL_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PAGE_MODEL_ID, LOCALE) primary key (PAGE_MODEL_ID, LOCALE)
); );
create table CCM_CORE.PAGE_MODELS ( create table CCM_CORE.PAGE_MODELS (
PAGE_MODEL_ID int8 not null, PAGE_MODEL_ID bigint not null,
MODEL_UUID varchar(255) not null,
NAME varchar(255), NAME varchar(255),
TYPE varchar(255) not null, TYPE varchar(255) not null,
UUID varchar(255) not null, UUID varchar(255) not null,
VERSION varchar(255) not null, VERSION varchar(255) not null,
APPLICATION_ID int8, APPLICATION_ID bigint,
primary key (PAGE_MODEL_ID) primary key (PAGE_MODEL_ID)
); );
create table CCM_CORE.PARTIES ( create table CCM_CORE.PARTIES (
PARTY_ID int8 not null, PARTY_ID bigint not null,
NAME varchar(256) not null, NAME varchar(256) not null,
primary key (PARTY_ID) primary key (PARTY_ID)
); );
create table CCM_CORE.PERMISSIONS ( create table CCM_CORE.PERMISSIONS (
PERMISSION_ID int8 not null, PERMISSION_ID bigint not null,
CREATION_DATE timestamp, CREATION_DATE timestamp,
CREATION_IP varchar(255), CREATION_IP varchar(255),
granted_privilege varchar(255), granted_privilege varchar(255),
CREATION_USER_ID int8, INHERITED boolean,
GRANTEE_ID int8, CREATION_USER_ID bigint,
OBJECT_ID int8, GRANTEE_ID bigint,
INHERITED_FROM_ID bigint,
OBJECT_ID bigint,
primary key (PERMISSION_ID) primary key (PERMISSION_ID)
); );
create table CCM_CORE.PORTALS ( create table CCM_CORE.PORTALS (
TEMPLATE boolean, TEMPLATE boolean,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.PORTLETS ( create table CCM_CORE.PORTLETS (
CELL_NUMBER int8, CELL_NUMBER bigint,
SORT_KEY int8, SORT_KEY bigint,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
PORTAL_ID int8, PORTAL_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.QUEUE_ITEMS ( create table CCM_CORE.QUEUE_ITEMS (
QUEUE_ITEM_ID int8 not null, QUEUE_ITEM_ID bigint not null,
HEADER varchar(4096), HEADER varchar(4096),
RECEIVER_ADDRESS varchar(512), RECEIVER_ADDRESS varchar(512),
RETRY_COUNT int8, RETRY_COUNT bigint,
SIGNATURE varchar(4096), SIGNATURE varchar(4096),
SUCCESSFUL_SENDED boolean, SUCCESSFUL_SENDED boolean,
MESSAGE_ID int8, MESSAGE_ID bigint,
RECEIVER_ID int8, RECEIVER_ID bigint,
primary key (QUEUE_ITEM_ID) primary key (QUEUE_ITEM_ID)
); );
create table CCM_CORE.RESOURCE_DESCRIPTIONS ( create table CCM_CORE.RESOURCE_DESCRIPTIONS (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TITLES ( create table CCM_CORE.RESOURCE_TITLES (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS (
RESOURCE_TYPE_ID int8 not null, RESOURCE_TYPE_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (RESOURCE_TYPE_ID, LOCALE) primary key (RESOURCE_TYPE_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TYPES ( create table CCM_CORE.RESOURCE_TYPES (
RESOURCE_TYPE_ID int8 not null, RESOURCE_TYPE_ID bigint not null,
SINGLETON boolean, SINGLETON boolean,
TITLE varchar(254) not null, TITLE varchar(254) not null,
EMBEDDED_VIEW boolean, EMBEDDED_VIEW boolean,
@ -1360,64 +1363,64 @@ create schema CCM_CORE;
create table CCM_CORE.RESOURCES ( create table CCM_CORE.RESOURCES (
CREATED timestamp, CREATED timestamp,
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
parent_OBJECT_ID int8, parent_OBJECT_ID bigint,
resourceType_RESOURCE_TYPE_ID int8, resourceType_RESOURCE_TYPE_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.ROLE_DESCRIPTIONS ( create table CCM_CORE.ROLE_DESCRIPTIONS (
ROLE_ID int8 not null, ROLE_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (ROLE_ID, LOCALE) primary key (ROLE_ID, LOCALE)
); );
create table CCM_CORE.ROLE_MEMBERSHIPS ( create table CCM_CORE.ROLE_MEMBERSHIPS (
MEMBERSHIP_ID int8 not null, MEMBERSHIP_ID bigint not null,
MEMBER_ID int8, MEMBER_ID bigint,
ROLE_ID int8, ROLE_ID bigint,
primary key (MEMBERSHIP_ID) primary key (MEMBERSHIP_ID)
); );
create table CCM_CORE.SETTINGS ( create table CCM_CORE.SETTINGS (
DTYPE varchar(31) not null, DTYPE varchar(31) not null,
SETTING_ID int8 not null, SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE float8, SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2), SETTING_VALUE_LONG bigint,
SETTING_VALUE_LONG int8,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
create table CCM_CORE.SETTINGS_ENUM_VALUES ( create table CCM_CORE.SETTINGS_ENUM_VALUES (
ENUM_ID int8 not null, ENUM_ID bigint not null,
value varchar(255) value varchar(255)
); );
create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( create table CCM_CORE.SETTINGS_L10N_STR_VALUES (
ENTRY_ID int8 not null, ENTRY_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (ENTRY_ID, LOCALE) primary key (ENTRY_ID, LOCALE)
); );
create table CCM_CORE.SETTINGS_STRING_LIST ( create table CCM_CORE.SETTINGS_STRING_LIST (
LIST_ID int8 not null, LIST_ID bigint not null,
value varchar(255) value varchar(255)
); );
create table CCM_CORE.THREADS ( create table CCM_CORE.THREADS (
OBJECT_ID int8 not null, OBJECT_ID bigint not null,
ROOT_ID int8, ROOT_ID bigint,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.USER_EMAIL_ADDRESSES ( create table CCM_CORE.USER_EMAIL_ADDRESSES (
USER_ID int8 not null, USER_ID bigint not null,
EMAIL_ADDRESS varchar(512) not null, EMAIL_ADDRESS varchar(512) not null,
BOUNCING boolean, BOUNCING boolean,
VERIFIED boolean VERIFIED boolean
@ -1432,92 +1435,92 @@ create schema CCM_CORE;
EMAIL_ADDRESS varchar(512) not null, EMAIL_ADDRESS varchar(512) not null,
BOUNCING boolean, BOUNCING boolean,
VERIFIED boolean, VERIFIED boolean,
PARTY_ID int8 not null, PARTY_ID bigint not null,
primary key (PARTY_ID) primary key (PARTY_ID)
); );
create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS ( create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS (
DUE_DATE timestamp, DUE_DATE timestamp,
DURATION_MINUTES int8, DURATION_MINUTES bigint,
LOCKED boolean, LOCKED boolean,
START_DATE timestamp, START_DATE timestamp,
TASK_ID int8 not null, TASK_ID bigint not null,
LOCKING_USER_ID int8, LOCKING_USER_ID bigint,
NOTIFICATION_SENDER int8, NOTIFICATION_SENDER bigint,
primary key (TASK_ID) primary key (TASK_ID)
); );
create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( create table CCM_CORE.WORKFLOW_DESCRIPTIONS (
WORKFLOW_ID int8 not null, WORKFLOW_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (WORKFLOW_ID, LOCALE) primary key (WORKFLOW_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_NAMES ( create table CCM_CORE.WORKFLOW_NAMES (
WORKFLOW_ID int8 not null, WORKFLOW_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (WORKFLOW_ID, LOCALE) primary key (WORKFLOW_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS ( create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS (
TASK_ASSIGNMENT_ID int8 not null, TASK_ASSIGNMENT_ID bigint not null,
ROLE_ID int8, ROLE_ID bigint,
TASK_ID int8, TASK_ID bigint,
primary key (TASK_ASSIGNMENT_ID) primary key (TASK_ASSIGNMENT_ID)
); );
create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( create table CCM_CORE.WORKFLOW_TASK_COMMENTS (
COMMENT_ID int8 not null, COMMENT_ID bigint not null,
COMMENT text, COMMENT longvarchar,
UUID varchar(255) not null, UUID varchar(255) not null,
AUTHOR_ID int8, AUTHOR_ID bigint,
TASK_ID int8, TASK_ID bigint,
primary key (COMMENT_ID) primary key (COMMENT_ID)
); );
create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES (
DEPENDS_ON_TASK_ID int8 not null, DEPENDS_ON_TASK_ID bigint not null,
DEPENDENT_TASK_ID int8 not null DEPENDENT_TASK_ID bigint not null
); );
create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS (
TASK_ID int8 not null, TASK_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE) primary key (TASK_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_TASK_LABELS ( create table CCM_CORE.WORKFLOW_TASK_LABELS (
TASK_ID int8 not null, TASK_ID bigint not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE) primary key (TASK_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_TASKS ( create table CCM_CORE.WORKFLOW_TASKS (
TASK_ID int8 not null, TASK_ID bigint not null,
ACTIVE boolean, ACTIVE boolean,
TASK_STATE varchar(512), TASK_STATE varchar(512),
UUID varchar(255) not null, UUID varchar(255) not null,
WORKFLOW_ID int8, WORKFLOW_ID bigint,
primary key (TASK_ID) primary key (TASK_ID)
); );
create table CCM_CORE.WORKFLOW_TEMPLATES ( create table CCM_CORE.WORKFLOW_TEMPLATES (
WORKFLOW_ID int8 not null, WORKFLOW_ID bigint not null,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
create table CCM_CORE.WORKFLOWS ( create table CCM_CORE.WORKFLOWS (
WORKFLOW_ID int8 not null, WORKFLOW_ID bigint not null,
ACTIVE boolean, ACTIVE boolean,
WORKFLOW_STATE varchar(255), WORKFLOW_STATE varchar(255),
TASKS_STATE varchar(255), TASKS_STATE varchar(255),
UUID varchar(255) not null, UUID varchar(255) not null,
OBJECT_ID int8, OBJECT_ID bigint,
TEMPLATE_ID int8, TEMPLATE_ID bigint,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
@ -1547,7 +1550,7 @@ create schema CCM_CORE;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID);
create sequence hibernate_sequence start 1 increment 1; create sequence hibernate_sequence start with 1 increment by 1;
alter table CCM_CORE.APPLICATIONS alter table CCM_CORE.APPLICATIONS
add constraint FKatcp9ij6mbkx0nfeig1o6n3lm add constraint FKatcp9ij6mbkx0nfeig1o6n3lm
@ -1884,6 +1887,11 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (GRANTEE_ID) foreign key (GRANTEE_ID)
references CCM_CORE.CCM_ROLES; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKkamckexjnffnt8lay9nqeawhm add constraint FKkamckexjnffnt8lay9nqeawhm
foreign key (OBJECT_ID) foreign key (OBJECT_ID)
@ -2077,4 +2085,4 @@ create sequence hibernate_sequence start 1 increment 1;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID) foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES; references CCM_CORE.WORKFLOW_TEMPLATES;

View File

@ -856,50 +856,49 @@ create schema CCM_CORE;
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID); add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID);
create table CCM_CORE.APPLICATIONS ( create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null, APPLICATION_TYPE varchar(1024) not null,
PRIMARY_URL varchar(1024) not null, PRIMARY_URL varchar(1024) not null,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.ATTACHMENTS ( create table CCM_CORE.ATTACHMENTS (
ATTACHMENT_ID bigint not null, ATTACHMENT_ID int8 not null,
ATTACHMENT_DATA blob, ATTACHMENT_DATA oid,
DESCRIPTION varchar(255), DESCRIPTION varchar(255),
MIME_TYPE varchar(255), MIME_TYPE varchar(255),
TITLE varchar(255), TITLE varchar(255),
MESSAGE_ID bigint, MESSAGE_ID int8,
primary key (ATTACHMENT_ID) primary key (ATTACHMENT_ID)
); );
create table CCM_CORE.CATEGORIES ( create table CCM_CORE.CATEGORIES (
ABSTRACT_CATEGORY boolean, ABSTRACT_CATEGORY boolean,
CATEGORY_ORDER bigint, CATEGORY_ORDER int8,
ENABLED boolean, ENABLED boolean,
NAME varchar(255) not null, NAME varchar(255) not null,
UNIQUE_ID varchar(255), UNIQUE_ID varchar(255),
VISIBLE boolean, VISIBLE boolean,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
PARENT_CATEGORY_ID bigint, PARENT_CATEGORY_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.CATEGORIZATIONS ( create table CCM_CORE.CATEGORIZATIONS (
CATEGORIZATION_ID bigint not null, CATEGORIZATION_ID int8 not null,
CATEGORY_ORDER bigint, CATEGORY_ORDER int8,
CATEGORY_INDEX boolean, CATEGORY_INDEX boolean,
OBJECT_ORDER bigint, OBJECT_ORDER int8,
TYPE varchar(255), TYPE varchar(255),
OBJECT_ID bigint, OBJECT_ID int8,
CATEGORY_ID bigint, CATEGORY_ID int8,
primary key (CATEGORIZATION_ID) primary key (CATEGORIZATION_ID)
); );
create table CCM_CORE.CATEGORY_DESCRIPTIONS ( create table CCM_CORE.CATEGORY_DESCRIPTIONS (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
@ -909,86 +908,86 @@ create schema CCM_CORE;
RELEASED timestamp, RELEASED timestamp,
URI varchar(1024), URI varchar(1024),
VERSION varchar(255), VERSION varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
ROOT_CATEGORY_ID bigint, ROOT_CATEGORY_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.CATEGORY_TITLES ( create table CCM_CORE.CATEGORY_TITLES (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.CCM_OBJECTS ( create table CCM_CORE.CCM_OBJECTS (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
DISPLAY_NAME varchar(255), DISPLAY_NAME varchar(255),
UUID varchar(255), UUID varchar(255),
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.CCM_OBJECTS_AUD ( create table CCM_CORE.CCM_OBJECTS_AUD (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
REV integer not null, REV int4 not null,
REVTYPE tinyint, REVTYPE int2,
REVEND integer, REVEND int4,
DISPLAY_NAME varchar(255), DISPLAY_NAME varchar(255),
primary key (OBJECT_ID, REV) primary key (OBJECT_ID, REV)
); );
create table CCM_CORE.CCM_REVISIONS ( create table CCM_CORE.CCM_REVISIONS (
id integer not null, id int4 not null,
timestamp bigint not null, timestamp int8 not null,
USER_NAME varchar(255), USER_NAME varchar(255),
primary key (id) primary key (id)
); );
create table CCM_CORE.CCM_ROLES ( create table CCM_CORE.CCM_ROLES (
ROLE_ID bigint not null, ROLE_ID int8 not null,
NAME varchar(512) not null, NAME varchar(512) not null,
primary key (ROLE_ID) primary key (ROLE_ID)
); );
create table CCM_CORE.DIGESTS ( create table CCM_CORE.DIGESTS (
FREQUENCY integer, FREQUENCY int4,
HEADER varchar(4096) not null, HEADER varchar(4096) not null,
NEXT_RUN timestamp, NEXT_RUN timestamp,
DIGEST_SEPARATOR varchar(128) not null, DIGEST_SEPARATOR varchar(128) not null,
SIGNATURE varchar(4096) not null, SIGNATURE varchar(4096) not null,
SUBJECT varchar(255) not null, SUBJECT varchar(255) not null,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
FROM_PARTY_ID bigint, FROM_PARTY_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.DOMAIN_DESCRIPTIONS ( create table CCM_CORE.DOMAIN_DESCRIPTIONS (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.DOMAIN_OWNERSHIPS ( create table CCM_CORE.DOMAIN_OWNERSHIPS (
OWNERSHIP_ID bigint not null, OWNERSHIP_ID int8 not null,
CONTEXT varchar(255), CONTEXT varchar(255),
DOMAIN_ORDER bigint, DOMAIN_ORDER int8,
OWNER_ORDER bigint, OWNER_ORDER int8,
domain_OBJECT_ID bigint not null, domain_OBJECT_ID int8 not null,
owner_OBJECT_ID bigint not null, owner_OBJECT_ID int8 not null,
primary key (OWNERSHIP_ID) primary key (OWNERSHIP_ID)
); );
create table CCM_CORE.DOMAIN_TITLES ( create table CCM_CORE.DOMAIN_TITLES (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_COMPONENT_DESCRIPTIONS (
COMPONENT_ID bigint not null, COMPONENT_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (COMPONENT_ID, LOCALE) primary key (COMPONENT_ID, LOCALE)
); );
@ -997,65 +996,65 @@ create schema CCM_CORE;
ACTIVE boolean, ACTIVE boolean,
ADMIN_NAME varchar(255), ADMIN_NAME varchar(255),
ATTRIBUTE_STRING varchar(255), ATTRIBUTE_STRING varchar(255),
COMPONENT_ORDER bigint, COMPONENT_ORDER int8,
SELECTED boolean, SELECTED boolean,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
parentComponent_OBJECT_ID bigint, parentComponent_OBJECT_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER ( create table CCM_CORE.FORMBUILDER_CONFIRM_EMAIL_LISTENER (
BODY clob, BODY text,
FROM_EMAIL varchar(255), FROM_EMAIL varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS ( create table CCM_CORE.FORMBUILDER_CONFIRM_REDIRECT_LISTENERS (
URL varchar(255), URL varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS ( create table CCM_CORE.FORMBUILDER_DATA_DRIVEN_SELECTS (
MULTIPLE boolean, MULTIPLE boolean,
QUERY varchar(255), QUERY varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_DATA_QUERIES ( create table CCM_CORE.FORMBUILDER_DATA_QUERIES (
QUERY_ID varchar(255), QUERY_ID varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_DATA_QUERY_DESCRIPTIONS (
DATA_QUERY_ID bigint not null, DATA_QUERY_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (DATA_QUERY_ID, LOCALE) primary key (DATA_QUERY_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES ( create table CCM_CORE.FORMBUILDER_DATA_QUERY_NAMES (
DATA_QUERY_ID bigint not null, DATA_QUERY_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (DATA_QUERY_ID, LOCALE) primary key (DATA_QUERY_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_FORMSECTIONS ( create table CCM_CORE.FORMBUILDER_FORMSECTIONS (
FORMSECTION_ACTION varchar(255), FORMSECTION_ACTION varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_LISTENERS ( create table CCM_CORE.FORMBUILDER_LISTENERS (
ATTRIBUTE_STRING varchar(255), ATTRIBUTE_STRING varchar(255),
CLASS_NAME varchar(255), CLASS_NAME varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
widget_OBJECT_ID bigint, widget_OBJECT_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
@ -1064,76 +1063,76 @@ create schema CCM_CORE;
PRETTY_NAME varchar(255), PRETTY_NAME varchar(255),
PRETTY_PLURAL varchar(255), PRETTY_PLURAL varchar(255),
PROPERTIES_FORM varchar(255), PROPERTIES_FORM varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_OBJECT_TYPES ( create table CCM_CORE.FORMBUILDER_OBJECT_TYPES (
APP_NAME varchar(255), APP_NAME varchar(255),
CLASS_NAME varchar(255), CLASS_NAME varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_OPTION_LABELS ( create table CCM_CORE.FORMBUILDER_OPTION_LABELS (
OPTION_ID bigint not null, OPTION_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OPTION_ID, LOCALE) primary key (OPTION_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_OPTIONS ( create table CCM_CORE.FORMBUILDER_OPTIONS (
PARAMETER_VALUE varchar(255), PARAMETER_VALUE varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS (
PROCESS_LISTENER_ID bigint not null, PROCESS_LISTENER_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PROCESS_LISTENER_ID, LOCALE) primary key (PROCESS_LISTENER_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENER_NAMES (
PROCESS_LISTENER_ID bigint not null, PROCESS_LISTENER_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PROCESS_LISTENER_ID, LOCALE) primary key (PROCESS_LISTENER_ID, LOCALE)
); );
create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS ( create table CCM_CORE.FORMBUILDER_PROCESS_LISTENERS (
LISTENER_CLASS varchar(255), LISTENER_CLASS varchar(255),
PROCESS_LISTENER_ORDER bigint, PROCESS_LISTENER_ORDER int8,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
formSection_OBJECT_ID bigint, formSection_OBJECT_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER ( create table CCM_CORE.FORMBUILDER_REMOTE_SERVER_POST_LISTENER (
REMOTE_URL varchar(2048), REMOTE_URL varchar(2048),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS ( create table CCM_CORE.FORMBUILDER_SIMPLE_EMAIL_LISTENERS (
RECIPIENT varchar(255), RECIPIENT varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS ( create table CCM_CORE.FORMBUILDER_TEMPLATE_EMAIL_LISTENERS (
BODY clob, BODY text,
RECIPIENT varchar(255), RECIPIENT varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_WIDGET_LABELS ( create table CCM_CORE.FORMBUILDER_WIDGET_LABELS (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
widget_OBJECT_ID bigint, widget_OBJECT_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
@ -1141,58 +1140,58 @@ create schema CCM_CORE;
DEFAULT_VALUE varchar(255), DEFAULT_VALUE varchar(255),
PARAMETER_MODEL varchar(255), PARAMETER_MODEL varchar(255),
PARAMETER_NAME varchar(255), PARAMETER_NAME varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
label_OBJECT_ID bigint, label_OBJECT_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS ( create table CCM_CORE.FORMBUILDER_XML_EMAIL_LISTENERS (
RECIPIENT varchar(255), RECIPIENT varchar(255),
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.GROUP_MEMBERSHIPS ( create table CCM_CORE.GROUP_MEMBERSHIPS (
MEMBERSHIP_ID bigint not null, MEMBERSHIP_ID int8 not null,
GROUP_ID bigint, GROUP_ID int8,
MEMBER_ID bigint, MEMBER_ID int8,
primary key (MEMBERSHIP_ID) primary key (MEMBERSHIP_ID)
); );
create table CCM_CORE.GROUPS ( create table CCM_CORE.GROUPS (
PARTY_ID bigint not null, PARTY_ID int8 not null,
primary key (PARTY_ID) primary key (PARTY_ID)
); );
create table CCM_CORE.HOSTS ( create table CCM_CORE.HOSTS (
HOST_ID bigint not null, HOST_ID int8 not null,
SERVER_NAME varchar(512), SERVER_NAME varchar(512),
SERVER_PORT bigint, SERVER_PORT int8,
primary key (HOST_ID) primary key (HOST_ID)
); );
create table CCM_CORE.INITS ( create table CCM_CORE.INITS (
INITIALIZER_ID bigint not null, INITIALIZER_ID int8 not null,
CLASS_NAME varchar(255), CLASS_NAME varchar(255),
REQUIRED_BY_ID bigint, REQUIRED_BY_ID int8,
primary key (INITIALIZER_ID) primary key (INITIALIZER_ID)
); );
create table CCM_CORE.INSTALLED_MODULES ( create table CCM_CORE.INSTALLED_MODULES (
MODULE_ID integer not null, MODULE_ID int4 not null,
MODULE_CLASS_NAME varchar(2048), MODULE_CLASS_NAME varchar(2048),
STATUS varchar(255), STATUS varchar(255),
primary key (MODULE_ID) primary key (MODULE_ID)
); );
create table CCM_CORE.LUCENE_DOCUMENTS ( create table CCM_CORE.LUCENE_DOCUMENTS (
DOCUMENT_ID bigint not null, DOCUMENT_ID int8 not null,
CONTENT clob, CONTENT text,
CONTENT_SECTION varchar(512), CONTENT_SECTION varchar(512),
COUNTRY varchar(8), COUNTRY varchar(8),
CREATED timestamp, CREATED timestamp,
DIRTY bigint, DIRTY int8,
DOCUMENT_LANGUAGE varchar(8), DOCUMENT_LANGUAGE varchar(8),
LAST_MODIFIED timestamp, LAST_MODIFIED timestamp,
SUMMARY varchar(4096), SUMMARY varchar(4096),
@ -1200,15 +1199,15 @@ create schema CCM_CORE;
TITLE varchar(4096), TITLE varchar(4096),
TYPE varchar(255), TYPE varchar(255),
TYPE_SPECIFIC_INFO varchar(512), TYPE_SPECIFIC_INFO varchar(512),
CREATED_BY_PARTY_ID bigint, CREATED_BY_PARTY_ID int8,
LAST_MODIFIED_BY bigint, LAST_MODIFIED_BY int8,
primary key (DOCUMENT_ID) primary key (DOCUMENT_ID)
); );
create table CCM_CORE.LUCENE_INDEXES ( create table CCM_CORE.LUCENE_INDEXES (
INDEX_ID bigint not null, INDEX_ID int8 not null,
LUCENE_INDEX_ID bigint, LUCENE_INDEX_ID int8,
HOST_ID bigint, HOST_ID int8,
primary key (INDEX_ID) primary key (INDEX_ID)
); );
@ -1217,9 +1216,9 @@ create schema CCM_CORE;
BODY_MIME_TYPE varchar(255), BODY_MIME_TYPE varchar(255),
SENT timestamp, SENT timestamp,
SUBJECT varchar(255), SUBJECT varchar(255),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
IN_REPLY_TO_ID bigint, IN_REPLY_TO_ID int8,
SENDER_ID bigint, SENDER_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
@ -1229,127 +1228,131 @@ create schema CCM_CORE;
EXPUNGE_MESSAGE boolean, EXPUNGE_MESSAGE boolean,
FULFILL_DATE timestamp, FULFILL_DATE timestamp,
HEADER varchar(4096), HEADER varchar(4096),
MAX_RETRIES bigint, MAX_RETRIES int8,
REQUEST_DATE timestamp, REQUEST_DATE timestamp,
SIGNATURE varchar(4096), SIGNATURE varchar(4096),
STATUS varchar(32), STATUS varchar(32),
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
DIGEST_ID bigint, DIGEST_ID int8,
MESSAGE_ID bigint, MESSAGE_ID int8,
RECEIVER_ID bigint, RECEIVER_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.ONE_TIME_AUTH_TOKENS ( create table CCM_CORE.ONE_TIME_AUTH_TOKENS (
TOKEN_ID bigint not null, TOKEN_ID int8 not null,
PURPOSE varchar(255), PURPOSE varchar(255),
TOKEN varchar(255), TOKEN varchar(255),
VALID_UNTIL timestamp, VALID_UNTIL timestamp,
USER_ID bigint, USER_ID int8,
primary key (TOKEN_ID) primary key (TOKEN_ID)
); );
create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS ( create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS (
COMPONENT_MODEL_ID bigint not null, COMPONENT_MODEL_ID int8 not null,
CLASS_ATTRIBUTE varchar(512), CLASS_ATTRIBUTE varchar(512),
ID_ATTRIBUTE varchar(255), ID_ATTRIBUTE varchar(255),
COMPONENT_KEY varchar(255), COMPONENT_KEY varchar(255),
MODEL_UUID varchar(255) not null,
STYLE_ATTRIBUTE varchar(1024), STYLE_ATTRIBUTE varchar(1024),
UUID varchar(255) not null, UUID varchar(255) not null,
PAGE_MODEL_ID bigint, PAGE_MODEL_ID int8,
primary key (COMPONENT_MODEL_ID) primary key (COMPONENT_MODEL_ID)
); );
create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS ( create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS (
PAGE_MODEL_ID bigint not null, PAGE_MODEL_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PAGE_MODEL_ID, LOCALE) primary key (PAGE_MODEL_ID, LOCALE)
); );
create table CCM_CORE.PAGE_MODEL_TITLES ( create table CCM_CORE.PAGE_MODEL_TITLES (
PAGE_MODEL_ID bigint not null, PAGE_MODEL_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (PAGE_MODEL_ID, LOCALE) primary key (PAGE_MODEL_ID, LOCALE)
); );
create table CCM_CORE.PAGE_MODELS ( create table CCM_CORE.PAGE_MODELS (
PAGE_MODEL_ID bigint not null, PAGE_MODEL_ID int8 not null,
MODEL_UUID varchar(255) not null,
NAME varchar(255), NAME varchar(255),
TYPE varchar(255) not null, TYPE varchar(255) not null,
UUID varchar(255) not null, UUID varchar(255) not null,
VERSION varchar(255) not null, VERSION varchar(255) not null,
APPLICATION_ID bigint, APPLICATION_ID int8,
primary key (PAGE_MODEL_ID) primary key (PAGE_MODEL_ID)
); );
create table CCM_CORE.PARTIES ( create table CCM_CORE.PARTIES (
PARTY_ID bigint not null, PARTY_ID int8 not null,
NAME varchar(256) not null, NAME varchar(256) not null,
primary key (PARTY_ID) primary key (PARTY_ID)
); );
create table CCM_CORE.PERMISSIONS ( create table CCM_CORE.PERMISSIONS (
PERMISSION_ID bigint not null, PERMISSION_ID int8 not null,
CREATION_DATE timestamp, CREATION_DATE timestamp,
CREATION_IP varchar(255), CREATION_IP varchar(255),
granted_privilege varchar(255), granted_privilege varchar(255),
CREATION_USER_ID bigint, INHERITED boolean,
GRANTEE_ID bigint, CREATION_USER_ID int8,
OBJECT_ID bigint, GRANTEE_ID int8,
INHERITED_FROM_ID int8,
OBJECT_ID int8,
primary key (PERMISSION_ID) primary key (PERMISSION_ID)
); );
create table CCM_CORE.PORTALS ( create table CCM_CORE.PORTALS (
TEMPLATE boolean, TEMPLATE boolean,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.PORTLETS ( create table CCM_CORE.PORTLETS (
CELL_NUMBER bigint, CELL_NUMBER int8,
SORT_KEY bigint, SORT_KEY int8,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
PORTAL_ID bigint, PORTAL_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.QUEUE_ITEMS ( create table CCM_CORE.QUEUE_ITEMS (
QUEUE_ITEM_ID bigint not null, QUEUE_ITEM_ID int8 not null,
HEADER varchar(4096), HEADER varchar(4096),
RECEIVER_ADDRESS varchar(512), RECEIVER_ADDRESS varchar(512),
RETRY_COUNT bigint, RETRY_COUNT int8,
SIGNATURE varchar(4096), SIGNATURE varchar(4096),
SUCCESSFUL_SENDED boolean, SUCCESSFUL_SENDED boolean,
MESSAGE_ID bigint, MESSAGE_ID int8,
RECEIVER_ID bigint, RECEIVER_ID int8,
primary key (QUEUE_ITEM_ID) primary key (QUEUE_ITEM_ID)
); );
create table CCM_CORE.RESOURCE_DESCRIPTIONS ( create table CCM_CORE.RESOURCE_DESCRIPTIONS (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TITLES ( create table CCM_CORE.RESOURCE_TITLES (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (OBJECT_ID, LOCALE) primary key (OBJECT_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS ( create table CCM_CORE.RESOURCE_TYPE_DESCRIPTIONS (
RESOURCE_TYPE_ID bigint not null, RESOURCE_TYPE_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (RESOURCE_TYPE_ID, LOCALE) primary key (RESOURCE_TYPE_ID, LOCALE)
); );
create table CCM_CORE.RESOURCE_TYPES ( create table CCM_CORE.RESOURCE_TYPES (
RESOURCE_TYPE_ID bigint not null, RESOURCE_TYPE_ID int8 not null,
SINGLETON boolean, SINGLETON boolean,
TITLE varchar(254) not null, TITLE varchar(254) not null,
EMBEDDED_VIEW boolean, EMBEDDED_VIEW boolean,
@ -1360,64 +1363,64 @@ create schema CCM_CORE;
create table CCM_CORE.RESOURCES ( create table CCM_CORE.RESOURCES (
CREATED timestamp, CREATED timestamp,
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
parent_OBJECT_ID bigint, parent_OBJECT_ID int8,
resourceType_RESOURCE_TYPE_ID bigint, resourceType_RESOURCE_TYPE_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.ROLE_DESCRIPTIONS ( create table CCM_CORE.ROLE_DESCRIPTIONS (
ROLE_ID bigint not null, ROLE_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (ROLE_ID, LOCALE) primary key (ROLE_ID, LOCALE)
); );
create table CCM_CORE.ROLE_MEMBERSHIPS ( create table CCM_CORE.ROLE_MEMBERSHIPS (
MEMBERSHIP_ID bigint not null, MEMBERSHIP_ID int8 not null,
MEMBER_ID bigint, MEMBER_ID int8,
ROLE_ID bigint, ROLE_ID int8,
primary key (MEMBERSHIP_ID) primary key (MEMBERSHIP_ID)
); );
create table CCM_CORE.SETTINGS ( create table CCM_CORE.SETTINGS (
DTYPE varchar(31) not null, DTYPE varchar(31) not null,
SETTING_ID bigint not null, SETTING_ID int8 not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE double, SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_BIG_DECIMAL decimal(19,2), SETTING_VALUE_LONG int8,
SETTING_VALUE_LONG bigint,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
create table CCM_CORE.SETTINGS_ENUM_VALUES ( create table CCM_CORE.SETTINGS_ENUM_VALUES (
ENUM_ID bigint not null, ENUM_ID int8 not null,
value varchar(255) value varchar(255)
); );
create table CCM_CORE.SETTINGS_L10N_STR_VALUES ( create table CCM_CORE.SETTINGS_L10N_STR_VALUES (
ENTRY_ID bigint not null, ENTRY_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (ENTRY_ID, LOCALE) primary key (ENTRY_ID, LOCALE)
); );
create table CCM_CORE.SETTINGS_STRING_LIST ( create table CCM_CORE.SETTINGS_STRING_LIST (
LIST_ID bigint not null, LIST_ID int8 not null,
value varchar(255) value varchar(255)
); );
create table CCM_CORE.THREADS ( create table CCM_CORE.THREADS (
OBJECT_ID bigint not null, OBJECT_ID int8 not null,
ROOT_ID bigint, ROOT_ID int8,
primary key (OBJECT_ID) primary key (OBJECT_ID)
); );
create table CCM_CORE.USER_EMAIL_ADDRESSES ( create table CCM_CORE.USER_EMAIL_ADDRESSES (
USER_ID bigint not null, USER_ID int8 not null,
EMAIL_ADDRESS varchar(512) not null, EMAIL_ADDRESS varchar(512) not null,
BOUNCING boolean, BOUNCING boolean,
VERIFIED boolean VERIFIED boolean
@ -1432,92 +1435,92 @@ create schema CCM_CORE;
EMAIL_ADDRESS varchar(512) not null, EMAIL_ADDRESS varchar(512) not null,
BOUNCING boolean, BOUNCING boolean,
VERIFIED boolean, VERIFIED boolean,
PARTY_ID bigint not null, PARTY_ID int8 not null,
primary key (PARTY_ID) primary key (PARTY_ID)
); );
create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS ( create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS (
DUE_DATE timestamp, DUE_DATE timestamp,
DURATION_MINUTES bigint, DURATION_MINUTES int8,
LOCKED boolean, LOCKED boolean,
START_DATE timestamp, START_DATE timestamp,
TASK_ID bigint not null, TASK_ID int8 not null,
LOCKING_USER_ID bigint, LOCKING_USER_ID int8,
NOTIFICATION_SENDER bigint, NOTIFICATION_SENDER int8,
primary key (TASK_ID) primary key (TASK_ID)
); );
create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( create table CCM_CORE.WORKFLOW_DESCRIPTIONS (
WORKFLOW_ID bigint not null, WORKFLOW_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (WORKFLOW_ID, LOCALE) primary key (WORKFLOW_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_NAMES ( create table CCM_CORE.WORKFLOW_NAMES (
WORKFLOW_ID bigint not null, WORKFLOW_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (WORKFLOW_ID, LOCALE) primary key (WORKFLOW_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS ( create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS (
TASK_ASSIGNMENT_ID bigint not null, TASK_ASSIGNMENT_ID int8 not null,
ROLE_ID bigint, ROLE_ID int8,
TASK_ID bigint, TASK_ID int8,
primary key (TASK_ASSIGNMENT_ID) primary key (TASK_ASSIGNMENT_ID)
); );
create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( create table CCM_CORE.WORKFLOW_TASK_COMMENTS (
COMMENT_ID bigint not null, COMMENT_ID int8 not null,
COMMENT longvarchar, COMMENT text,
UUID varchar(255) not null, UUID varchar(255) not null,
AUTHOR_ID bigint, AUTHOR_ID int8,
TASK_ID bigint, TASK_ID int8,
primary key (COMMENT_ID) primary key (COMMENT_ID)
); );
create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES (
DEPENDS_ON_TASK_ID bigint not null, DEPENDS_ON_TASK_ID int8 not null,
DEPENDENT_TASK_ID bigint not null DEPENDENT_TASK_ID int8 not null
); );
create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS ( create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS (
TASK_ID bigint not null, TASK_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE) primary key (TASK_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_TASK_LABELS ( create table CCM_CORE.WORKFLOW_TASK_LABELS (
TASK_ID bigint not null, TASK_ID int8 not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE text,
LOCALE varchar(255) not null, LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE) primary key (TASK_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_TASKS ( create table CCM_CORE.WORKFLOW_TASKS (
TASK_ID bigint not null, TASK_ID int8 not null,
ACTIVE boolean, ACTIVE boolean,
TASK_STATE varchar(512), TASK_STATE varchar(512),
UUID varchar(255) not null, UUID varchar(255) not null,
WORKFLOW_ID bigint, WORKFLOW_ID int8,
primary key (TASK_ID) primary key (TASK_ID)
); );
create table CCM_CORE.WORKFLOW_TEMPLATES ( create table CCM_CORE.WORKFLOW_TEMPLATES (
WORKFLOW_ID bigint not null, WORKFLOW_ID int8 not null,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
create table CCM_CORE.WORKFLOWS ( create table CCM_CORE.WORKFLOWS (
WORKFLOW_ID bigint not null, WORKFLOW_ID int8 not null,
ACTIVE boolean, ACTIVE boolean,
WORKFLOW_STATE varchar(255), WORKFLOW_STATE varchar(255),
TASKS_STATE varchar(255), TASKS_STATE varchar(255),
UUID varchar(255) not null, UUID varchar(255) not null,
OBJECT_ID bigint, OBJECT_ID int8,
TEMPLATE_ID bigint, TEMPLATE_ID int8,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
@ -1547,7 +1550,7 @@ create schema CCM_CORE;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID); add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID);
create sequence hibernate_sequence start with 1 increment by 1; create sequence hibernate_sequence start 1 increment 1;
alter table CCM_CORE.APPLICATIONS alter table CCM_CORE.APPLICATIONS
add constraint FKatcp9ij6mbkx0nfeig1o6n3lm add constraint FKatcp9ij6mbkx0nfeig1o6n3lm
@ -1884,6 +1887,11 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (GRANTEE_ID) foreign key (GRANTEE_ID)
references CCM_CORE.CCM_ROLES; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKkamckexjnffnt8lay9nqeawhm add constraint FKkamckexjnffnt8lay9nqeawhm
foreign key (OBJECT_ID) foreign key (OBJECT_ID)
@ -2077,4 +2085,4 @@ create sequence hibernate_sequence start with 1 increment by 1;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID) foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES; references CCM_CORE.WORKFLOW_TEMPLATES;

View File

@ -19,7 +19,6 @@
package org.libreccm.categorization; package org.libreccm.categorization;
import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import org.libreccm.core.CcmObject; import org.libreccm.core.CcmObject;
import org.libreccm.portation.Portable; import org.libreccm.portation.Portable;
@ -33,11 +32,14 @@ import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries; import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
import static org.libreccm.core.CoreConstants.DB_SCHEMA; import static org.libreccm.core.CoreConstants.DB_SCHEMA;
import org.libreccm.security.RecursivePermissions;
/** /**
* Association class describing the association between a category and an * Association class describing the association between a category and an
* object. Instances of these class should not created manually. The methods * object. Instances of these class should not created manually. The methods
@ -91,6 +93,7 @@ public class Categorization implements Serializable, Portable {
/** /**
* The categorised object. * The categorised object.
*/ */
@RecursivePermissions
@ManyToOne @ManyToOne
@JoinColumn(name = "OBJECT_ID") @JoinColumn(name = "OBJECT_ID")
@JsonBackReference(value = "object-categorization") @JsonBackReference(value = "object-categorization")

View File

@ -29,6 +29,7 @@ import org.libreccm.core.DefaultEntityGraph;
import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedString;
import org.libreccm.portation.Portable; import org.libreccm.portation.Portable;
import org.libreccm.security.InheritsPermissions; import org.libreccm.security.InheritsPermissions;
import org.libreccm.security.RecursivePermissions;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
@ -180,6 +181,7 @@ public class Category extends CcmObject implements InheritsPermissions,
/** /**
* The objects assigned to this category. * The objects assigned to this category.
*/ */
@RecursivePermissions
@OneToMany(mappedBy = "category") @OneToMany(mappedBy = "category")
@XmlElementWrapper(name = "objects", namespace = CAT_XML_NS) @XmlElementWrapper(name = "objects", namespace = CAT_XML_NS)
@JsonManagedReference(value = "category-categorization") @JsonManagedReference(value = "category-categorization")
@ -188,6 +190,7 @@ public class Category extends CcmObject implements InheritsPermissions,
/** /**
* The sub categories of this category. * The sub categories of this category.
*/ */
@RecursivePermissions
@OneToMany(mappedBy = "parentCategory") @OneToMany(mappedBy = "parentCategory")
@XmlElementWrapper(name = "subcategories", namespace = CAT_XML_NS) @XmlElementWrapper(name = "subcategories", namespace = CAT_XML_NS)
@XmlElement(name = "category") @XmlElement(name = "category")

View File

@ -26,6 +26,7 @@ import org.hibernate.validator.constraints.URL;
import org.libreccm.core.CcmObject; import org.libreccm.core.CcmObject;
import org.libreccm.core.DefaultEntityGraph; import org.libreccm.core.DefaultEntityGraph;
import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedString;
import org.libreccm.security.RecursivePermissions;
import org.libreccm.web.CcmApplication; import org.libreccm.web.CcmApplication;
import java.io.Serializable; import java.io.Serializable;
@ -189,6 +190,7 @@ public class Domain extends CcmObject implements Serializable {
/** /**
* The root category of the domain. * The root category of the domain.
*/ */
@RecursivePermissions
@ManyToOne @ManyToOne
@JoinColumn(name = "ROOT_CATEGORY_ID") @JoinColumn(name = "ROOT_CATEGORY_ID")
@XmlElement(name = "root", namespace = CAT_XML_NS) @XmlElement(name = "root", namespace = CAT_XML_NS)

View File

@ -19,7 +19,6 @@
package org.libreccm.security; package org.libreccm.security;
import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import org.hibernate.search.annotations.ContainedIn; import org.hibernate.search.annotations.ContainedIn;
import org.hibernate.search.annotations.Field; import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.IndexedEmbedded; import org.hibernate.search.annotations.IndexedEmbedded;
@ -42,6 +41,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.Objects; import java.util.Objects;
@ -49,6 +49,8 @@ import java.util.Objects;
import static org.libreccm.core.CoreConstants.CORE_XML_NS; import static org.libreccm.core.CoreConstants.CORE_XML_NS;
import static org.libreccm.core.CoreConstants.DB_SCHEMA; import static org.libreccm.core.CoreConstants.DB_SCHEMA;
import javax.persistence.OneToOne;
/** /**
* A permission grants a privilege on an object or system wide to {@link Role}. * A permission grants a privilege on an object or system wide to {@link Role}.
* *
@ -61,15 +63,18 @@ import static org.libreccm.core.CoreConstants.DB_SCHEMA;
query = "SELECT COUNT(p) FROM Permission p " query = "SELECT COUNT(p) FROM Permission p "
+ "WHERE p.grantedPrivilege = :privilege " + "WHERE p.grantedPrivilege = :privilege "
+ "AND p.grantee = :grantee " + "AND p.grantee = :grantee "
+ "AND p.object = :object"), + "AND p.object = :object")
,
@NamedQuery(name = "Permission.existsForPrivilegeAndRole", @NamedQuery(name = "Permission.existsForPrivilegeAndRole",
query = "SELECT count(p) FROM Permission p " query = "SELECT count(p) FROM Permission p "
+ "WHERE p.grantedPrivilege = :privilege " + "WHERE p.grantedPrivilege = :privilege "
+ "AND p.grantee = :grantee " + "AND p.grantee = :grantee "
+ "AND p.object IS NULL"), + "AND p.object IS NULL")
,
@NamedQuery(name = "Permission.findPermissionsForRole", @NamedQuery(name = "Permission.findPermissionsForRole",
query = "SELECT p FROM Permission p " query = "SELECT p FROM Permission p "
+ "WHERE p.grantee = :grantee"), + "WHERE p.grantee = :grantee")
,
@NamedQuery(name = "Permission.findPermissionsForCcmObject", @NamedQuery(name = "Permission.findPermissionsForCcmObject",
query = "SELECT p FROM Permission p " query = "SELECT p FROM Permission p "
+ "WHERE p.object = :object") + "WHERE p.object = :object")
@ -92,7 +97,7 @@ public class Permission implements Serializable, Portable {
/** /**
* The granted privilege. * The granted privilege.
*/ */
@Column(name = "granted_privilege") @Column(name = "GRANTED_PRIVILEGE")
@Field @Field
@XmlElement(name = "privilege", namespace = CORE_XML_NS) @XmlElement(name = "privilege", namespace = CORE_XML_NS)
private String grantedPrivilege; private String grantedPrivilege;
@ -144,6 +149,21 @@ public class Permission implements Serializable, Portable {
@XmlElement(name = "creation-ip", namespace = CORE_XML_NS) @XmlElement(name = "creation-ip", namespace = CORE_XML_NS)
private String creationIp; private String creationIp;
/**
* If the permission is inherited from another object this field is set to
* {@code true}.
*/
@Column(name = "INHERITED")
private boolean inherited;
/**
* If the permission is inherited from another object this field points to
* the object from the which the permission was inherited.
*/
@OneToOne
@JoinColumn(name = "INHERITED_FROM_ID")
private CcmObject inheritedForm;
protected Permission() { protected Permission() {
//Nothing //Nothing
} }
@ -208,6 +228,22 @@ public class Permission implements Serializable, Portable {
this.creationIp = creationIp; this.creationIp = creationIp;
} }
public boolean isInherited() {
return inherited;
}
protected void setInherited(boolean inherited) {
this.inherited = inherited;
}
public CcmObject getInheritedForm() {
return inheritedForm;
}
protected void setInheritedForm(CcmObject inheritedForm) {
this.inheritedForm = inheritedForm;
}
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 3; int hash = 3;
@ -215,6 +251,7 @@ public class Permission implements Serializable, Portable {
hash = 97 * hash + Objects.hashCode(grantedPrivilege); hash = 97 * hash + Objects.hashCode(grantedPrivilege);
hash = 97 * hash + Objects.hashCode(creationDate); hash = 97 * hash + Objects.hashCode(creationDate);
hash = 97 * hash + Objects.hashCode(creationIp); hash = 97 * hash + Objects.hashCode(creationIp);
hash = 97 * hash + Boolean.hashCode(inherited);
return hash; return hash;
} }
@ -241,7 +278,11 @@ public class Permission implements Serializable, Portable {
return false; return false;
} }
return Objects.equals(creationIp, other.getCreationIp()); if (!Objects.equals(creationIp, other.getCreationIp())) {
return false;
}
return inherited == other.isInherited();
} }
public boolean canEqual(final Object obj) { public boolean canEqual(final Object obj) {

View File

@ -0,0 +1,47 @@
/*
* Copyright (C) 2017 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.security;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Marker interface which an be added to a property to indicate that permissions
* granted on the owing object should recursivly applied to the child objects.
*
* The privileges for which this applied can be defined using
* {@link #privileges()}.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface RecursivePermissions {
/**
* If set only permissions for the privileges in listed here will be applied
* recursivly.
*
* @return
*/
String[] privileges() default {};
}

View File

@ -0,0 +1,10 @@
alter table CCM_CORE.PERMISSIONS
add column INHERITED boolean;
alter table CCM_CORE.PERMISSIONS
add column INHERITED_FROM_ID bigint;
alter table CCM_CORE.PERMISSIONS
add constraint FKc1x3h1p3o20qiwmonpmva7t5i
foreign key (INHERITED_FROM_ID)
references CCM_CORE.CCM_OBJECTS;

View File

@ -57,8 +57,12 @@ public class DatasetsTest extends DatasetsVerifier {
"/datasets/org/libreccm/security/PartyRepositoryTest/after-save-new.yml", "/datasets/org/libreccm/security/PartyRepositoryTest/after-save-new.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/data.yml", "/datasets/org/libreccm/security/PermissionManagerTest/data.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/data-recursivly.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/after-grant.yml", "/datasets/org/libreccm/security/PermissionManagerTest/after-grant.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/after-grant-recursivly.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/after-grant-inherited.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/after-revoke.yml", "/datasets/org/libreccm/security/PermissionManagerTest/after-revoke.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/after-revoke-recursivly.yml",
"/datasets/org/libreccm/security/PermissionManagerTest/after-copy.yml", "/datasets/org/libreccm/security/PermissionManagerTest/after-copy.yml",
"/datasets/org/libreccm/security/RoleManagerTest/data.yml", "/datasets/org/libreccm/security/RoleManagerTest/data.yml",

View File

@ -215,6 +215,40 @@ public class PermissionManagerTest {
}); });
} }
/**
* Verifies that permissions are granted recursivly when a permission is
* granted if the object has properties which are annototed with
* {@link RecursivePermissions}.
*/
@Test
@UsingDataSet("datasets/org/libreccm/security/PermissionManagerTest/"
+ "data-recursivly.yml")
@ShouldMatchDataSet(
value = "datasets/org/libreccm/security/PermissionManagerTest/"
+ "after-grant-recursivly.yml",
excludeColumns = {"permission_id"})
@InSequence(211)
public void grantPermissionRecursively() {
fail();
}
/**
* Verifies that granting a permission on a object which is already
* inherited from an object converts the permission to a directly granted
* one.
*/
@Test
@UsingDataSet("datasets/org/libreccm/security/PermissionManagerTest/"
+ "after-grant-recursivly.yml")
@ShouldMatchDataSet(
value = "datasets/org/libreccm/security/PermissionManagerTest/"
+ "after-grant-inherited.yml",
excludeColumns = {"permission_id"})
@InSequence(212)
public void grantInheritedPermission() {
fail();
}
/** /**
* Verifies that * Verifies that
* {@link PermissionManager#grantPrivilege(java.lang.String, org.libreccm.security.Role)} * {@link PermissionManager#grantPrivilege(java.lang.String, org.libreccm.security.Role)}
@ -434,6 +468,21 @@ public class PermissionManagerTest {
() -> permissionManager.revokePrivilege("privilege999", role1)); () -> permissionManager.revokePrivilege("privilege999", role1));
} }
/**
* Verifies that inherited permissions are revoked when they revoked from
* the object on which the permissions were granted.
*/
@Test
@UsingDataSet("datasets/org/libreccm/security/PermissionManagerTest/"
+ "after-grant-recursivly.yml")
@ShouldMatchDataSet(
value = "datasets/org/libreccm/security/PermissionManagerTest/"
+ "after-revoke-recursivly.yml")
@InSequence(311)
public void revokePermissionRecursivly() {
fail();
}
/** /**
* Verifies that * Verifies that
* {@link PermissionManager#revokePrivilege(java.lang.String, org.libreccm.security.Role, org.libreccm.core.CcmObject)} * {@link PermissionManager#revokePrivilege(java.lang.String, org.libreccm.security.Role, org.libreccm.core.CcmObject)}
@ -581,7 +630,8 @@ public class PermissionManagerTest {
} }
/** /**
* Verifies that null null null null null {@link PermissionManager#revokePrivilege(java.lang.String, org.libreccm.security.Role, org.libreccm.core.CcmObject) * Verifies that
* {@link PermissionManager#revokePrivilege(java.lang.String, org.libreccm.security.Role, org.libreccm.core.CcmObject)}
* throws an {@link IllegalArgumentException} if called with {@code null} * throws an {@link IllegalArgumentException} if called with {@code null}
* for the role to revoke the permission from. * for the role to revoke the permission from.
* *

View File

@ -4,7 +4,6 @@ drop sequence if exists HIBERNATE_SEQUENCE;
create schema CCM_CORE; create schema CCM_CORE;
create table CCM_CORE.APPLICATIONS ( create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null, APPLICATION_TYPE varchar(1024) not null,
PRIMARY_URL varchar(1024) not null, PRIMARY_URL varchar(1024) not null,
@ -402,6 +401,7 @@ create schema CCM_CORE;
CLASS_ATTRIBUTE varchar(512), CLASS_ATTRIBUTE varchar(512),
ID_ATTRIBUTE varchar(255), ID_ATTRIBUTE varchar(255),
COMPONENT_KEY varchar(255), COMPONENT_KEY varchar(255),
MODEL_UUID varchar(255) not null,
STYLE_ATTRIBUTE varchar(1024), STYLE_ATTRIBUTE varchar(1024),
UUID varchar(255) not null, UUID varchar(255) not null,
PAGE_MODEL_ID bigint, PAGE_MODEL_ID bigint,
@ -424,6 +424,7 @@ create schema CCM_CORE;
create table CCM_CORE.PAGE_MODELS ( create table CCM_CORE.PAGE_MODELS (
PAGE_MODEL_ID bigint not null, PAGE_MODEL_ID bigint not null,
MODEL_UUID varchar(255) not null,
NAME varchar(255), NAME varchar(255),
TYPE varchar(255) not null, TYPE varchar(255) not null,
UUID varchar(255) not null, UUID varchar(255) not null,
@ -443,8 +444,10 @@ create schema CCM_CORE;
CREATION_DATE timestamp, CREATION_DATE timestamp,
CREATION_IP varchar(255), CREATION_IP varchar(255),
granted_privilege varchar(255), granted_privilege varchar(255),
INHERITED boolean,
CREATION_USER_ID bigint, CREATION_USER_ID bigint,
GRANTEE_ID bigint, GRANTEE_ID bigint,
INHERITED_FROM_ID bigint,
OBJECT_ID bigint, OBJECT_ID bigint,
primary key (PERMISSION_ID) primary key (PERMISSION_ID)
); );
@ -533,10 +536,10 @@ create schema CCM_CORE;
SETTING_ID bigint not null, SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE double, SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_LONG bigint, SETTING_VALUE_LONG bigint,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
@ -1032,6 +1035,11 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (GRANTEE_ID) foreign key (GRANTEE_ID)
references CCM_CORE.CCM_ROLES; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKkamckexjnffnt8lay9nqeawhm add constraint FKkamckexjnffnt8lay9nqeawhm
foreign key (OBJECT_ID) foreign key (OBJECT_ID)
@ -1225,4 +1233,4 @@ create sequence hibernate_sequence start with 1 increment by 1;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID) foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES; references CCM_CORE.WORKFLOW_TEMPLATES;

View File

@ -401,6 +401,7 @@ create schema CCM_CORE;
CLASS_ATTRIBUTE varchar(512), CLASS_ATTRIBUTE varchar(512),
ID_ATTRIBUTE varchar(255), ID_ATTRIBUTE varchar(255),
COMPONENT_KEY varchar(255), COMPONENT_KEY varchar(255),
MODEL_UUID varchar(255) not null,
STYLE_ATTRIBUTE varchar(1024), STYLE_ATTRIBUTE varchar(1024),
UUID varchar(255) not null, UUID varchar(255) not null,
PAGE_MODEL_ID int8, PAGE_MODEL_ID int8,
@ -423,6 +424,7 @@ create schema CCM_CORE;
create table CCM_CORE.PAGE_MODELS ( create table CCM_CORE.PAGE_MODELS (
PAGE_MODEL_ID int8 not null, PAGE_MODEL_ID int8 not null,
MODEL_UUID varchar(255) not null,
NAME varchar(255), NAME varchar(255),
TYPE varchar(255) not null, TYPE varchar(255) not null,
UUID varchar(255) not null, UUID varchar(255) not null,
@ -442,8 +444,10 @@ create schema CCM_CORE;
CREATION_DATE timestamp, CREATION_DATE timestamp,
CREATION_IP varchar(255), CREATION_IP varchar(255),
granted_privilege varchar(255), granted_privilege varchar(255),
INHERITED boolean,
CREATION_USER_ID int8, CREATION_USER_ID int8,
GRANTEE_ID int8, GRANTEE_ID int8,
INHERITED_FROM_ID int8,
OBJECT_ID int8, OBJECT_ID int8,
primary key (PERMISSION_ID) primary key (PERMISSION_ID)
); );
@ -532,10 +536,10 @@ create schema CCM_CORE;
SETTING_ID int8 not null, SETTING_ID int8 not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_BOOLEAN boolean, SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE float8, SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_LONG int8, SETTING_VALUE_LONG int8,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
@ -1031,6 +1035,11 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (GRANTEE_ID) foreign key (GRANTEE_ID)
references CCM_CORE.CCM_ROLES; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKkamckexjnffnt8lay9nqeawhm add constraint FKkamckexjnffnt8lay9nqeawhm
foreign key (OBJECT_ID) foreign key (OBJECT_ID)
@ -1224,4 +1233,4 @@ create sequence hibernate_sequence start 1 increment 1;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID) foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES; references CCM_CORE.WORKFLOW_TEMPLATES;

View File

@ -0,0 +1,84 @@
ccm_core.ccm_roles:
- role_id: -10001
name: role1
- role_id: -10002
name: role2
ccm_core.ccm_objects:
- object_id: -20001
display_name: category1
uuid: 17239bc1-5db3-4448-b37c-cac0fddd7342
- object_id: -20002
display_name: category2
uuid: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
- object_id: -20003
display_name: category3
uuid: 1c31700a-f9db-4188-812f-12dba4186c75
- object_id: -20004
display_name: objectA
ccm_core.categories:
- object_id: -20001
unique_id: 17239bc1-5db3-4448-b37c-cac0fddd7342
name: category1
enabled: true
visible: true
abstract_category: false
category_order: 0
- object_id: -20002
unique_id: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
name: category2
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20001
- object_id: -20003
unique_id: 1c31700a-f9db-4188-812f-12dba4186c75
name: category3
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20002
ccm_core.categorizations:
- categorization_id: -40001
category_id: -20003
object_id: -20004
ccm_core.permissions:
- permission_id: -30001
granted_privilege: privilege1
grantee_id: -10001
inherited: false
- permission_id: -30002
granted_privilege: privilege2
object_id: -20001
grantee_id: -10001
inherited: false
- permission_id: -30003
granted_privilege: privilege2
object_id: -20002
grantee_id: -10002
inherited: false
- permission_id: -30004
granted_privilege: privilege4
object_id: -20001
grantee_id: -10001
inherited: false
- permission_id: -30005
granted_privilege: privilege4
object_id: -20002
grantee_id: -10001
inherited: false
- permission_id: -30006
granted_privilege: privilege4
object_id: -20003
grantee_id: -10001
inherited: true
inherited_from_id: -20002
- permission_id: -30007
granted_privilege: privilege4
object_id: -20004
grantee_id: -10001
inherited: true
inherited_from_id: -20002

View File

@ -0,0 +1,84 @@
ccm_core.ccm_roles:
- role_id: -10001
name: role1
- role_id: -10002
name: role2
ccm_core.ccm_objects:
- object_id: -20001
display_name: category1
uuid: 17239bc1-5db3-4448-b37c-cac0fddd7342
- object_id: -20002
display_name: category2
uuid: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
- object_id: -20003
display_name: category3
uuid: 1c31700a-f9db-4188-812f-12dba4186c75
- object_id: -20004
display_name: objectA
ccm_core.categories:
- object_id: -20001
unique_id: 17239bc1-5db3-4448-b37c-cac0fddd7342
name: category1
enabled: true
visible: true
abstract_category: false
category_order: 0
- object_id: -20002
unique_id: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
name: category2
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20001
- object_id: -20003
unique_id: 1c31700a-f9db-4188-812f-12dba4186c75
name: category3
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20002
ccm_core.categorizations:
- categorization_id: -40001
category_id: -20003
object_id: -20004
ccm_core.permissions:
- permission_id: -30001
granted_privilege: privilege1
grantee_id: -10001
inherited: false
- permission_id: -30002
granted_privilege: privilege2
object_id: -20001
grantee_id: -10001
inherited: false
- permission_id: -30003
granted_privilege: privilege2
object_id: -20002
grantee_id: -10002
inherited: false
- permission_id: -30004
granted_privilege: privilege4
object_id: -20001
grantee_id: -10001
inherited: false
- permission_id: -30005
granted_privilege: privilege4
object_id: -20002
grantee_id: -10001
inherited: true
inherited_from_id: -20001
- permission_id: -30006
granted_privilege: privilege4
object_id: -20003
grantee_id: -10001
inherited: true
inherited_from_id: -20001
- permission_id: -30007
granted_privilege: privilege4
object_id: -20004
grantee_id: -10001
inherited: true
inherited_from_id: -20001

View File

@ -0,0 +1,61 @@
ccm_core.ccm_roles:
- role_id: -10001
name: role1
- role_id: -10002
name: role2
ccm_core.ccm_objects:
- object_id: -20001
display_name: category1
uuid: 17239bc1-5db3-4448-b37c-cac0fddd7342
- object_id: -20002
display_name: category2
uuid: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
- object_id: -20003
display_name: category3
uuid: 1c31700a-f9db-4188-812f-12dba4186c75
- object_id: -20004
display_name: objectA
ccm_core.categories:
- object_id: -20001
unique_id: 17239bc1-5db3-4448-b37c-cac0fddd7342
name: category1
enabled: true
visible: true
abstract_category: false
category_order: 0
- object_id: -20002
unique_id: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
name: category2
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20001
- object_id: -20003
unique_id: 1c31700a-f9db-4188-812f-12dba4186c75
name: category3
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20002
ccm_core.categorizations:
- categorization_id: -40001
category_id: -20003
object_id: -20004
ccm_core.permissions:
- permission_id: -30001
granted_privilege: privilege1
grantee_id: -10001
inherited: false
- permission_id: -30002
granted_privilege: privilege2
object_id: -20001
grantee_id: -10001
inherited: false
- permission_id: -30003
granted_privilege: privilege2
object_id: -20002
grantee_id: -10002
inherited: false

View File

@ -0,0 +1,61 @@
ccm_core.ccm_roles:
- role_id: -10001
name: role1
- role_id: -10002
name: role2
ccm_core.ccm_objects:
- object_id: -20001
display_name: category1
uuid: 17239bc1-5db3-4448-b37c-cac0fddd7342
- object_id: -20002
display_name: category2
uuid: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
- object_id: -20003
display_name: category3
uuid: 1c31700a-f9db-4188-812f-12dba4186c75
- object_id: -20004
display_name: objectA
ccm_core.categories:
- object_id: -20001
unique_id: 17239bc1-5db3-4448-b37c-cac0fddd7342
name: category1
enabled: true
visible: true
abstract_category: false
category_order: 0
- object_id: -20002
unique_id: 686a5d09-36ec-46ba-9c97-a5d6db4b9008
name: category2
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20001
- object_id: -20003
unique_id: 1c31700a-f9db-4188-812f-12dba4186c75
name: category3
enabled: true
visible: true
abstract_category: false
category_order: 0
parent_category_id: -20002
ccm_core.categorizations:
- categorization_id: -40001
category_id: -20003
object_id: -20004
ccm_core.permissions:
- permission_id: -30001
granted_privilege: privilege1
grantee_id: -10001
inherited: false
- permission_id: -30002
granted_privilege: privilege2
object_id: -20001
grantee_id: -10001
inherited: false
- permission_id: -30003
granted_privilege: privilege2
object_id: -20002
grantee_id: -10002
inherited: false

View File

@ -81,6 +81,7 @@ CREATE SCHEMA ccm_shortcuts;
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
REV integer not null, REV integer not null,
REVTYPE tinyint, REVTYPE tinyint,
REVEND integer,
DISPLAY_NAME varchar(255), DISPLAY_NAME varchar(255),
primary key (OBJECT_ID, REV) primary key (OBJECT_ID, REV)
); );
@ -397,6 +398,43 @@ CREATE SCHEMA ccm_shortcuts;
primary key (TOKEN_ID) primary key (TOKEN_ID)
); );
create table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS (
COMPONENT_MODEL_ID bigint not null,
CLASS_ATTRIBUTE varchar(512),
ID_ATTRIBUTE varchar(255),
COMPONENT_KEY varchar(255),
MODEL_UUID varchar(255) not null,
STYLE_ATTRIBUTE varchar(1024),
UUID varchar(255) not null,
PAGE_MODEL_ID bigint,
primary key (COMPONENT_MODEL_ID)
);
create table CCM_CORE.PAGE_MODEL_DESCRIPTIONS (
PAGE_MODEL_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (PAGE_MODEL_ID, LOCALE)
);
create table CCM_CORE.PAGE_MODEL_TITLES (
PAGE_MODEL_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (PAGE_MODEL_ID, LOCALE)
);
create table CCM_CORE.PAGE_MODELS (
PAGE_MODEL_ID bigint not null,
MODEL_UUID varchar(255) not null,
NAME varchar(255),
TYPE varchar(255) not null,
UUID varchar(255) not null,
VERSION varchar(255) not null,
APPLICATION_ID bigint,
primary key (PAGE_MODEL_ID)
);
create table CCM_CORE.PARTIES ( create table CCM_CORE.PARTIES (
PARTY_ID bigint not null, PARTY_ID bigint not null,
NAME varchar(256) not null, NAME varchar(256) not null,
@ -408,8 +446,10 @@ CREATE SCHEMA ccm_shortcuts;
CREATION_DATE timestamp, CREATION_DATE timestamp,
CREATION_IP varchar(255), CREATION_IP varchar(255),
granted_privilege varchar(255), granted_privilege varchar(255),
INHERITED boolean,
CREATION_USER_ID bigint, CREATION_USER_ID bigint,
GRANTEE_ID bigint, GRANTEE_ID bigint,
INHERITED_FROM_ID bigint,
OBJECT_ID bigint, OBJECT_ID bigint,
primary key (PERMISSION_ID) primary key (PERMISSION_ID)
); );
@ -498,11 +538,11 @@ CREATE SCHEMA ccm_shortcuts;
SETTING_ID bigint not null, SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_LONG bigint,
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_BIG_DECIMAL decimal(19,2), SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_LONG bigint,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
@ -523,13 +563,6 @@ CREATE SCHEMA ccm_shortcuts;
value varchar(255) value varchar(255)
); );
create table CCM_CORE.TASK_ASSIGNMENTS (
TASK_ASSIGNMENT_ID bigint not null,
ROLE_ID bigint,
TASK_ID bigint,
primary key (TASK_ASSIGNMENT_ID)
);
create table CCM_CORE.THREADS ( create table CCM_CORE.THREADS (
OBJECT_ID bigint not null, OBJECT_ID bigint not null,
ROOT_ID bigint, ROOT_ID bigint,
@ -556,6 +589,17 @@ CREATE SCHEMA ccm_shortcuts;
primary key (PARTY_ID) primary key (PARTY_ID)
); );
create table CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS (
DUE_DATE timestamp,
DURATION_MINUTES bigint,
LOCKED boolean,
START_DATE timestamp,
TASK_ID bigint not null,
LOCKING_USER_ID bigint,
NOTIFICATION_SENDER bigint,
primary key (TASK_ID)
);
create table CCM_CORE.WORKFLOW_DESCRIPTIONS ( create table CCM_CORE.WORKFLOW_DESCRIPTIONS (
WORKFLOW_ID bigint not null, WORKFLOW_ID bigint not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE longvarchar,
@ -570,9 +614,20 @@ CREATE SCHEMA ccm_shortcuts;
primary key (WORKFLOW_ID, LOCALE) primary key (WORKFLOW_ID, LOCALE)
); );
create table CCM_CORE.WORKFLOW_TASK_ASSIGNMENTS (
TASK_ASSIGNMENT_ID bigint not null,
ROLE_ID bigint,
TASK_ID bigint,
primary key (TASK_ASSIGNMENT_ID)
);
create table CCM_CORE.WORKFLOW_TASK_COMMENTS ( create table CCM_CORE.WORKFLOW_TASK_COMMENTS (
TASK_ID bigint not null, COMMENT_ID bigint not null,
COMMENT clob COMMENT longvarchar,
UUID varchar(255) not null,
AUTHOR_ID bigint,
TASK_ID bigint,
primary key (COMMENT_ID)
); );
create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES (
@ -580,6 +635,13 @@ CREATE SCHEMA ccm_shortcuts;
DEPENDENT_TASK_ID bigint not null DEPENDENT_TASK_ID bigint not null
); );
create table CCM_CORE.WORKFLOW_TASK_DESCRIPTIONS (
TASK_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE)
);
create table CCM_CORE.WORKFLOW_TASK_LABELS ( create table CCM_CORE.WORKFLOW_TASK_LABELS (
TASK_ID bigint not null, TASK_ID bigint not null,
LOCALIZED_VALUE longvarchar, LOCALIZED_VALUE longvarchar,
@ -591,35 +653,23 @@ CREATE SCHEMA ccm_shortcuts;
TASK_ID bigint not null, TASK_ID bigint not null,
ACTIVE boolean, ACTIVE boolean,
TASK_STATE varchar(512), TASK_STATE varchar(512),
UUID varchar(255) not null,
WORKFLOW_ID bigint, WORKFLOW_ID bigint,
primary key (TASK_ID) primary key (TASK_ID)
); );
create table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS (
TASK_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE)
);
create table CCM_CORE.WORKFLOW_TEMPLATES ( create table CCM_CORE.WORKFLOW_TEMPLATES (
WORKFLOW_ID bigint not null, WORKFLOW_ID bigint not null,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
create table CCM_CORE.WORKFLOW_USER_TASKS (
DUE_DATE timestamp,
DURATION_MINUTES bigint,
LOCKED boolean,
START_DATE timestamp,
TASK_ID bigint not null,
LOCKING_USER_ID bigint,
NOTIFICATION_SENDER bigint,
primary key (TASK_ID)
);
create table CCM_CORE.WORKFLOWS ( create table CCM_CORE.WORKFLOWS (
WORKFLOW_ID bigint not null, WORKFLOW_ID bigint not null,
ACTIVE boolean,
WORKFLOW_STATE varchar(255),
TASKS_STATE varchar(255),
UUID varchar(255) not null,
OBJECT_ID bigint,
TEMPLATE_ID bigint, TEMPLATE_ID bigint,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
@ -642,15 +692,14 @@ CREATE SCHEMA ccm_shortcuts;
alter table CCM_CORE.SETTINGS alter table CCM_CORE.SETTINGS
add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME);
create table CCM_SHORTCUTS.SHORTCUTS ( alter table CCM_CORE.WORKFLOW_TASK_COMMENTS
SHORTCUT_ID bigint not null, add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID);
REDIRECT varchar(1024),
URL_KEY varchar(1024),
primary key (SHORTCUT_ID)
);
alter table CCM_SHORTCUTS.SHORTCUTS alter table CCM_CORE.WORKFLOW_TASKS
add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY); add constraint UK_2u6ruatxij8wfojl8a1eigqqd unique (UUID);
alter table CCM_CORE.WORKFLOWS
add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID);
create sequence hibernate_sequence start with 1 increment by 1; create sequence hibernate_sequence start with 1 increment by 1;
alter table CCM_CORE.APPLICATIONS alter table CCM_CORE.APPLICATIONS
@ -708,6 +757,11 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (REV) foreign key (REV)
references CCM_CORE.CCM_REVISIONS; 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 alter table CCM_CORE.DIGESTS
add constraint FKc53g09agnye3w1v4euy3e0gsi add constraint FKc53g09agnye3w1v4euy3e0gsi
foreign key (FROM_PARTY_ID) foreign key (FROM_PARTY_ID)
@ -953,6 +1007,26 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (USER_ID) foreign key (USER_ID)
references CCM_CORE.USERS; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKj9di7pawxgtouxmu2k44bj5c4 add constraint FKj9di7pawxgtouxmu2k44bj5c4
foreign key (CREATION_USER_ID) foreign key (CREATION_USER_ID)
@ -963,6 +1037,11 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (GRANTEE_ID) foreign key (GRANTEE_ID)
references CCM_CORE.CCM_ROLES; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKkamckexjnffnt8lay9nqeawhm add constraint FKkamckexjnffnt8lay9nqeawhm
foreign key (OBJECT_ID) foreign key (OBJECT_ID)
@ -1053,16 +1132,6 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (LIST_ID) foreign key (LIST_ID)
references CCM_CORE.SETTINGS; references CCM_CORE.SETTINGS;
alter table CCM_CORE.TASK_ASSIGNMENTS
add constraint FKe29uwmvxdmol1fjob3auej4qv
foreign key (ROLE_ID)
references CCM_CORE.CCM_ROLES;
alter table CCM_CORE.TASK_ASSIGNMENTS
add constraint FKc1vovbjg9mp5yegx2fdoutx7u
foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_USER_TASKS;
alter table CCM_CORE.THREADS alter table CCM_CORE.THREADS
add constraint FKsx08mpwvwnw97uwdgjs76q39g add constraint FKsx08mpwvwnw97uwdgjs76q39g
foreign key (ROOT_ID) foreign key (ROOT_ID)
@ -1083,6 +1152,21 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (PARTY_ID) foreign key (PARTY_ID)
references CCM_CORE.PARTIES; 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 alter table CCM_CORE.WORKFLOW_DESCRIPTIONS
add constraint FKgx7upkqky82dpxvbs95imfl9l add constraint FKgx7upkqky82dpxvbs95imfl9l
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
@ -1093,6 +1177,21 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
references CCM_CORE.WORKFLOWS; 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 alter table CCM_CORE.WORKFLOW_TASK_COMMENTS
add constraint FKkfqrf9jdvm7livu5if06w0r5t add constraint FKkfqrf9jdvm7livu5if06w0r5t
foreign key (TASK_ID) foreign key (TASK_ID)
@ -1108,6 +1207,11 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (DEPENDS_ON_TASK_ID) foreign key (DEPENDS_ON_TASK_ID)
references CCM_CORE.WORKFLOW_TASKS; 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 alter table CCM_CORE.WORKFLOW_TASK_LABELS
add constraint FKf715qud6g9xv2xeb8rrpnv4xs add constraint FKf715qud6g9xv2xeb8rrpnv4xs
foreign key (TASK_ID) foreign key (TASK_ID)
@ -1118,32 +1222,28 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
references CCM_CORE.WORKFLOWS; references CCM_CORE.WORKFLOWS;
alter table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS
add constraint FK2s2498d2tpojjrtghq7iyaosv
foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_TASKS;
alter table CCM_CORE.WORKFLOW_TEMPLATES alter table CCM_CORE.WORKFLOW_TEMPLATES
add constraint FK8692vdme4yxnkj1m0k1dw74pk add constraint FK8692vdme4yxnkj1m0k1dw74pk
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
references CCM_CORE.WORKFLOWS; references CCM_CORE.WORKFLOWS;
alter table CCM_CORE.WORKFLOW_USER_TASKS alter table CCM_CORE.WORKFLOWS
add constraint FKf09depwj5rgso2dair07vnu33 add constraint FKrm2yfrs6veoxoy304upq2wc64
foreign key (LOCKING_USER_ID) foreign key (OBJECT_ID)
references CCM_CORE.USERS; references CCM_CORE.CCM_OBJECTS;
alter table CCM_CORE.WORKFLOW_USER_TASKS
add constraint FK6evo9y34awhdfcyl8gv78qb7f
foreign key (NOTIFICATION_SENDER)
references CCM_CORE.USERS;
alter table CCM_CORE.WORKFLOW_USER_TASKS
add constraint FKefpdf9ojplu7loo31hfm0wl2h
foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_TASKS;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID) foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES; references CCM_CORE.WORKFLOW_TEMPLATES;
create table CCM_SHORTCUTS.SHORTCUTS (
SHORTCUT_ID bigint not null,
REDIRECT varchar(1024),
URL_KEY varchar(1024),
primary key (SHORTCUT_ID)
);
alter table CCM_SHORTCUTS.SHORTCUTS
add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY);
create sequence hibernate_sequence start with 1 increment by 1;

View File

@ -6,7 +6,7 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
CREATE SCHEMA ccm_core; CREATE SCHEMA ccm_core;
CREATE SCHEMA ccm_shortcuts; CREATE SCHEMA ccm_shortcuts;
create table CCM_CORE.APPLICATIONS ( create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null, APPLICATION_TYPE varchar(1024) not null,
PRIMARY_URL varchar(1024) not null, PRIMARY_URL varchar(1024) not null,
OBJECT_ID int8 not null, OBJECT_ID int8 not null,
@ -81,6 +81,7 @@ CREATE SCHEMA ccm_shortcuts;
OBJECT_ID int8 not null, OBJECT_ID int8 not null,
REV int4 not null, REV int4 not null,
REVTYPE int2, REVTYPE int2,
REVEND int4,
DISPLAY_NAME varchar(255), DISPLAY_NAME varchar(255),
primary key (OBJECT_ID, REV) primary key (OBJECT_ID, REV)
); );
@ -397,6 +398,43 @@ CREATE SCHEMA ccm_shortcuts;
primary key (TOKEN_ID) 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 ( create table CCM_CORE.PARTIES (
PARTY_ID int8 not null, PARTY_ID int8 not null,
NAME varchar(256) not null, NAME varchar(256) not null,
@ -408,8 +446,10 @@ CREATE SCHEMA ccm_shortcuts;
CREATION_DATE timestamp, CREATION_DATE timestamp,
CREATION_IP varchar(255), CREATION_IP varchar(255),
granted_privilege varchar(255), granted_privilege varchar(255),
INHERITED boolean,
CREATION_USER_ID int8, CREATION_USER_ID int8,
GRANTEE_ID int8, GRANTEE_ID int8,
INHERITED_FROM_ID int8,
OBJECT_ID int8, OBJECT_ID int8,
primary key (PERMISSION_ID) primary key (PERMISSION_ID)
); );
@ -498,11 +538,11 @@ CREATE SCHEMA ccm_shortcuts;
SETTING_ID int8 not null, SETTING_ID int8 not null,
CONFIGURATION_CLASS varchar(512) not null, CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null, NAME varchar(512) not null,
SETTING_VALUE_LONG int8,
SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2), SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024), SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_LONG int8,
primary key (SETTING_ID) primary key (SETTING_ID)
); );
@ -523,13 +563,6 @@ CREATE SCHEMA ccm_shortcuts;
value varchar(255) value varchar(255)
); );
create table CCM_CORE.TASK_ASSIGNMENTS (
TASK_ASSIGNMENT_ID int8 not null,
ROLE_ID int8,
TASK_ID int8,
primary key (TASK_ASSIGNMENT_ID)
);
create table CCM_CORE.THREADS ( create table CCM_CORE.THREADS (
OBJECT_ID int8 not null, OBJECT_ID int8 not null,
ROOT_ID int8, ROOT_ID int8,
@ -556,6 +589,17 @@ CREATE SCHEMA ccm_shortcuts;
primary key (PARTY_ID) 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 ( create table CCM_CORE.WORKFLOW_DESCRIPTIONS (
WORKFLOW_ID int8 not null, WORKFLOW_ID int8 not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE text,
@ -570,9 +614,20 @@ CREATE SCHEMA ccm_shortcuts;
primary key (WORKFLOW_ID, LOCALE) 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 ( create table CCM_CORE.WORKFLOW_TASK_COMMENTS (
TASK_ID int8 not null, COMMENT_ID int8 not null,
COMMENT text COMMENT text,
UUID varchar(255) not null,
AUTHOR_ID int8,
TASK_ID int8,
primary key (COMMENT_ID)
); );
create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES ( create table CCM_CORE.WORKFLOW_TASK_DEPENDENCIES (
@ -580,6 +635,13 @@ CREATE SCHEMA ccm_shortcuts;
DEPENDENT_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 ( create table CCM_CORE.WORKFLOW_TASK_LABELS (
TASK_ID int8 not null, TASK_ID int8 not null,
LOCALIZED_VALUE text, LOCALIZED_VALUE text,
@ -591,35 +653,23 @@ CREATE SCHEMA ccm_shortcuts;
TASK_ID int8 not null, TASK_ID int8 not null,
ACTIVE boolean, ACTIVE boolean,
TASK_STATE varchar(512), TASK_STATE varchar(512),
UUID varchar(255) not null,
WORKFLOW_ID int8, WORKFLOW_ID int8,
primary key (TASK_ID) primary key (TASK_ID)
); );
create table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS (
TASK_ID int8 not null,
LOCALIZED_VALUE text,
LOCALE varchar(255) not null,
primary key (TASK_ID, LOCALE)
);
create table CCM_CORE.WORKFLOW_TEMPLATES ( create table CCM_CORE.WORKFLOW_TEMPLATES (
WORKFLOW_ID int8 not null, WORKFLOW_ID int8 not null,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
create table CCM_CORE.WORKFLOW_USER_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.WORKFLOWS ( create table CCM_CORE.WORKFLOWS (
WORKFLOW_ID int8 not null, 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, TEMPLATE_ID int8,
primary key (WORKFLOW_ID) primary key (WORKFLOW_ID)
); );
@ -642,15 +692,14 @@ CREATE SCHEMA ccm_shortcuts;
alter table CCM_CORE.SETTINGS alter table CCM_CORE.SETTINGS
add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME); add constraint UK5whinfxdaepqs09e5ia9y71uk unique (CONFIGURATION_CLASS, NAME);
create table CCM_SHORTCUTS.SHORTCUTS ( alter table CCM_CORE.WORKFLOW_TASK_COMMENTS
SHORTCUT_ID int8 not null, add constraint UK_4nnedf08odyjxalfkg16fmjoi unique (UUID);
REDIRECT varchar(1024),
URL_KEY varchar(1024),
primary key (SHORTCUT_ID)
);
alter table CCM_SHORTCUTS.SHORTCUTS alter table CCM_CORE.WORKFLOW_TASKS
add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY); 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; create sequence hibernate_sequence start 1 increment 1;
alter table CCM_CORE.APPLICATIONS alter table CCM_CORE.APPLICATIONS
@ -708,6 +757,11 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (REV) foreign key (REV)
references CCM_CORE.CCM_REVISIONS; 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 alter table CCM_CORE.DIGESTS
add constraint FKc53g09agnye3w1v4euy3e0gsi add constraint FKc53g09agnye3w1v4euy3e0gsi
foreign key (FROM_PARTY_ID) foreign key (FROM_PARTY_ID)
@ -953,6 +1007,26 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (USER_ID) foreign key (USER_ID)
references CCM_CORE.USERS; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKj9di7pawxgtouxmu2k44bj5c4 add constraint FKj9di7pawxgtouxmu2k44bj5c4
foreign key (CREATION_USER_ID) foreign key (CREATION_USER_ID)
@ -963,6 +1037,11 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (GRANTEE_ID) foreign key (GRANTEE_ID)
references CCM_CORE.CCM_ROLES; 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 alter table CCM_CORE.PERMISSIONS
add constraint FKkamckexjnffnt8lay9nqeawhm add constraint FKkamckexjnffnt8lay9nqeawhm
foreign key (OBJECT_ID) foreign key (OBJECT_ID)
@ -1053,16 +1132,6 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (LIST_ID) foreign key (LIST_ID)
references CCM_CORE.SETTINGS; references CCM_CORE.SETTINGS;
alter table CCM_CORE.TASK_ASSIGNMENTS
add constraint FKe29uwmvxdmol1fjob3auej4qv
foreign key (ROLE_ID)
references CCM_CORE.CCM_ROLES;
alter table CCM_CORE.TASK_ASSIGNMENTS
add constraint FKc1vovbjg9mp5yegx2fdoutx7u
foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_USER_TASKS;
alter table CCM_CORE.THREADS alter table CCM_CORE.THREADS
add constraint FKsx08mpwvwnw97uwdgjs76q39g add constraint FKsx08mpwvwnw97uwdgjs76q39g
foreign key (ROOT_ID) foreign key (ROOT_ID)
@ -1083,6 +1152,21 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (PARTY_ID) foreign key (PARTY_ID)
references CCM_CORE.PARTIES; 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 alter table CCM_CORE.WORKFLOW_DESCRIPTIONS
add constraint FKgx7upkqky82dpxvbs95imfl9l add constraint FKgx7upkqky82dpxvbs95imfl9l
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
@ -1093,6 +1177,21 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
references CCM_CORE.WORKFLOWS; 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 alter table CCM_CORE.WORKFLOW_TASK_COMMENTS
add constraint FKkfqrf9jdvm7livu5if06w0r5t add constraint FKkfqrf9jdvm7livu5if06w0r5t
foreign key (TASK_ID) foreign key (TASK_ID)
@ -1108,6 +1207,11 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (DEPENDS_ON_TASK_ID) foreign key (DEPENDS_ON_TASK_ID)
references CCM_CORE.WORKFLOW_TASKS; 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 alter table CCM_CORE.WORKFLOW_TASK_LABELS
add constraint FKf715qud6g9xv2xeb8rrpnv4xs add constraint FKf715qud6g9xv2xeb8rrpnv4xs
foreign key (TASK_ID) foreign key (TASK_ID)
@ -1118,32 +1222,28 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
references CCM_CORE.WORKFLOWS; references CCM_CORE.WORKFLOWS;
alter table CCM_CORE.WORKFLOW_TASKS_DESCRIPTIONS
add constraint FK2s2498d2tpojjrtghq7iyaosv
foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_TASKS;
alter table CCM_CORE.WORKFLOW_TEMPLATES alter table CCM_CORE.WORKFLOW_TEMPLATES
add constraint FK8692vdme4yxnkj1m0k1dw74pk add constraint FK8692vdme4yxnkj1m0k1dw74pk
foreign key (WORKFLOW_ID) foreign key (WORKFLOW_ID)
references CCM_CORE.WORKFLOWS; references CCM_CORE.WORKFLOWS;
alter table CCM_CORE.WORKFLOW_USER_TASKS alter table CCM_CORE.WORKFLOWS
add constraint FKf09depwj5rgso2dair07vnu33 add constraint FKrm2yfrs6veoxoy304upq2wc64
foreign key (LOCKING_USER_ID) foreign key (OBJECT_ID)
references CCM_CORE.USERS; references CCM_CORE.CCM_OBJECTS;
alter table CCM_CORE.WORKFLOW_USER_TASKS
add constraint FK6evo9y34awhdfcyl8gv78qb7f
foreign key (NOTIFICATION_SENDER)
references CCM_CORE.USERS;
alter table CCM_CORE.WORKFLOW_USER_TASKS
add constraint FKefpdf9ojplu7loo31hfm0wl2h
foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_TASKS;
alter table CCM_CORE.WORKFLOWS alter table CCM_CORE.WORKFLOWS
add constraint FKeixdxau4jebw682gd49tdbsjy add constraint FKeixdxau4jebw682gd49tdbsjy
foreign key (TEMPLATE_ID) foreign key (TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES; references CCM_CORE.WORKFLOW_TEMPLATES;
create table CCM_SHORTCUTS.SHORTCUTS (
SHORTCUT_ID int8 not null,
REDIRECT varchar(1024),
URL_KEY varchar(1024),
primary key (SHORTCUT_ID)
);
alter table CCM_SHORTCUTS.SHORTCUTS
add constraint UK_4otuwtog6qqdbg4e6p8xdpw8h unique (URL_KEY);
create sequence hibernate_sequence start 1 increment 1;