CCM NG: New PageModel system, replaces JSP templates for public pages in ccm-cms and ccm-navigation

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4458 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2016-12-02 16:35:24 +00:00
parent f63434ae80
commit bdf9058901
20 changed files with 1826 additions and 2634 deletions

View File

@ -856,6 +856,7 @@ create schema CCM_CORE;
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
add constraint UK_goj42ghwu4tf1akfb2r6ensns unique (WORKFLOW_TEMPLATE_ID);
create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null,
PRIMARY_URL varchar(1024) not null,
@ -1248,6 +1249,41 @@ create schema CCM_CORE;
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),
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,
NAME varchar(255),
TYPE varchar(255) not null,
UUID varchar(255) not null,
VERSION varchar(255) not null,
APPLICATION_ID bigint,
primary key (PAGE_MODEL_ID)
);
create table CCM_CORE.PARTIES (
PARTY_ID bigint not null,
NAME varchar(256) not null,
@ -1349,11 +1385,11 @@ create schema CCM_CORE;
SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_LONG bigint,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_LONG bigint,
primary key (SETTING_ID)
);
@ -1513,766 +1549,6 @@ create schema CCM_CORE;
add constraint UK_o113id7d1cxql0edsrohlnn9x unique (UUID);
create sequence hibernate_sequence start with 1 increment by 1;
alter table CCM_CMS.ARTICLE_TEXTS
add constraint FK1pel1j53h3t3adh9o5cbje2d3
foreign key (OBJECT_ID)
references CCM_CMS.ARTICLES;
alter table CCM_CMS.ARTICLE_TEXTS_AUD
add constraint FKa06qks62tieeba607ykdrv3ry
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ARTICLE_TEXTS_AUD
add constraint FKljfof07259eofkub5g2dx0jlq
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ARTICLES
add constraint FK2pwvn9v2t2pikcw5hn2oq13q
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.ARTICLES_AUD
add constraint FKnevu4il5fu4vy2f5twh50kstr
foreign key (OBJECT_ID, REV)
references CCM_CMS.CONTENT_ITEMS_AUD;
alter table CCM_CMS.ASSET_TITLES
add constraint FKj61sy509dv63u246wlau5f9pa
foreign key (ASSET_ID)
references CCM_CMS.ASSETS;
alter table CCM_CMS.ASSET_TITLES_AUD
add constraint FK6yuimrre2oowjo0diw6b00nhe
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ASSET_TITLES_AUD
add constraint FKcaockxi21ve0irh06vegc77uu
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ASSETS
add constraint FKlbiojib44ujxv9eee1sjn67qk
foreign key (OBJECT_ID)
references CCM_CORE.CCM_OBJECTS;
alter table CCM_CMS.ASSETS_AUD
add constraint FKi5q560xg9357da8gc5sukqbw8
foreign key (OBJECT_ID, REV)
references CCM_CORE.CCM_OBJECTS_AUD;
alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS
add constraint FKeqcryerscpnmqpipwyrvd0lae
foreign key (LIST_ID)
references CCM_CMS.ATTACHMENT_LISTS;
alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD
add constraint FK727detagt51wmejywhteq4jfs
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ATTACHMENT_LIST_CAPTIONS_AUD
add constraint FK7589vpkxegxs8y3wqjx37tig3
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS
add constraint FKixgpo00r1cqq5jw1s7v6fchpn
foreign key (LIST_ID)
references CCM_CMS.ATTACHMENT_LISTS;
alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD
add constraint FKqhqkm6tas9fdmggv4k1vj0nc7
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ATTACHMENT_LIST_DESCRIPTIONS_AUD
add constraint FKqv2o9jffgok4518fb5c85552l
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ATTACHMENT_LISTS
add constraint FKqyj7ifjfyp7kmsj8fiyxn0am3
foreign key (ITEM_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
add constraint FKgdt5p8huh1lhk299hkrytqmqc
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
add constraint FKdn502yobchapgcyj1bu00u67a
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ATTACHMENTS
add constraint FKmn0bm137vwr61iy5nb59cjm22
foreign key (ASSET_ID)
references CCM_CMS.ASSETS;
alter table CCM_CMS.ATTACHMENTS
add constraint FK3mqbt13sbed2ae0esrps4p0oh
foreign key (ATTACHMENT_LIST_ID)
references CCM_CMS.ATTACHMENT_LISTS;
alter table CCM_CMS.ATTACHMENTS_AUD
add constraint FKl19663g6todb5d1e9lok7fl9e
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.ATTACHMENTS_AUD
add constraint FK4n28sostn1hc8bf43qsp1pyuf
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.AUDIO_ASSETS
add constraint FKg9tos3it7lflk5o90jluonpev
foreign key (LEGAL_METADATA_ID)
references CCM_CMS.LEGAL_METADATA;
alter table CCM_CMS.AUDIO_ASSETS
add constraint FKgxpsfjlfsk609c0w2te18y90v
foreign key (OBJECT_ID)
references CCM_CMS.BINARY_ASSETS;
alter table CCM_CMS.AUDIO_ASSETS_AUD
add constraint FKbt11nwbde1en1upceratct6s3
foreign key (OBJECT_ID, REV)
references CCM_CMS.BINARY_ASSETS_AUD;
alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS
add constraint FK31kl9gu49nvhcku7gfsro6hqq
foreign key (ASSET_ID)
references CCM_CMS.BINARY_ASSETS;
alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD
add constraint FKhehi2pvqliq0s2jhv661lar7g
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.BINARY_ASSET_DESCRIPTIONS_AUD
add constraint FK9f5n81i6j0yopog1hvua2wmxc
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.BINARY_ASSETS
add constraint FKltx0jq1u1aflrd20k1c77m8vh
foreign key (OBJECT_ID)
references CCM_CMS.ASSETS;
alter table CCM_CMS.BINARY_ASSETS_AUD
add constraint FK1qfap4mxprjk7gnjdcvdxr5mv
foreign key (OBJECT_ID, REV)
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.BOOKMARK_DESCRIPTIONS
add constraint FKmeydpwmlq0wqw3gab4auiyrqg
foreign key (ASSET_ID)
references CCM_CMS.BOOKMARKS;
alter table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD
add constraint FKfff2ein3uhgwyyyajamy3hfwy
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.BOOKMARK_DESCRIPTIONS_AUD
add constraint FKtl48flnrkr0upvrc1ksy1o92m
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.BOOKMARKS
add constraint FKksnngecvvxmsxdvri4shby2hy
foreign key (OBJECT_ID)
references CCM_CMS.ASSETS;
alter table CCM_CMS.BOOKMARKS_AUD
add constraint FK47cpxaw9vnnes2dbr6h3toirl
foreign key (OBJECT_ID, REV)
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS
add constraint FK6mt4tjnenr79o52wcj99tpeu4
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD
add constraint FK12yrysxv4fxa73ker40e883av
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.CONTENT_ITEM_DESCRIPTIONS_AUD
add constraint FK4pxuq0pf2hrtireo902t21ocx
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.CONTENT_ITEM_NAMES
add constraint FKijrfangf9s3lyncmod651xyg8
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.CONTENT_ITEM_NAMES_AUD
add constraint FKq631ee5ollx5xkliowcrt8wkj
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.CONTENT_ITEM_NAMES_AUD
add constraint FKbjaycalit9pa2u7ae5dwjgtky
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.CONTENT_ITEM_TITLES
add constraint FKbvf67lou4ep94pgi6tur6o2gf
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.CONTENT_ITEM_TITLES_AUD
add constraint FKfbno0rxshoi57y8aehwv3o42j
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.CONTENT_ITEM_TITLES_AUD
add constraint FK4c3exifj1ghwg6htglynlo094
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.CONTENT_ITEMS
add constraint FKg83y3asxi1jr7larwven7ueu0
foreign key (CONTENT_TYPE_ID)
references CCM_CMS.CONTENT_TYPES;
alter table CCM_CMS.CONTENT_ITEMS
add constraint FKfh1nm46qpw6xcwkmgaqw2iu3h
foreign key (LIFECYCLE_ID)
references CCM_CMS.LIFECYCLES;
alter table CCM_CMS.CONTENT_ITEMS
add constraint FKl00ldjygr6as8gqbt3j14ke7j
foreign key (WORKFLOW_ID)
references CCM_CORE.WORKFLOWS;
alter table CCM_CMS.CONTENT_ITEMS
add constraint FK1fr2q5y1wpmrufruja5ivfpuf
foreign key (OBJECT_ID)
references CCM_CORE.CCM_OBJECTS;
alter table CCM_CMS.CONTENT_ITEMS_AUD
add constraint FKsfhj0qok0ksjplvgcaditqekl
foreign key (OBJECT_ID, REV)
references CCM_CORE.CCM_OBJECTS_AUD;
alter table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS
add constraint FKqnsnk1eju8vrbm7x0wr5od4ll
foreign key (LIFECYCLE_DEFINITION_ID)
references CCM_CMS.LIFECYLE_DEFINITIONS;
alter table CCM_CMS.CONTENT_SECTION_LIFECYCLE_DEFINITIONS
add constraint FK7daejlunqsnhgky4b92n019a9
foreign key (CONTENT_SECTION_ID)
references CCM_CMS.CONTENT_SECTIONS;
alter table CCM_CMS.CONTENT_SECTION_ROLES
add constraint FKkn5nygbmub9wd5lxw3402t82d
foreign key (ROLE_ID)
references CCM_CORE.CCM_ROLES;
alter table CCM_CMS.CONTENT_SECTION_ROLES
add constraint FKgcn76piocmkmvl3b0omv9vkv9
foreign key (SECTION_ID)
references CCM_CMS.CONTENT_SECTIONS;
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
add constraint FKrx08cdjm9tutrp5lvfhgslw48
foreign key (WORKFLOW_TEMPLATE_ID)
references CCM_CORE.WORKFLOW_TEMPLATES;
alter table CCM_CMS.CONTENT_SECTION_WORKFLOW_TEMPLATES
add constraint FK6kuejkcl9hcbkr8q6bdlatt8q
foreign key (CONTENT_SECTION_ID)
references CCM_CMS.CONTENT_SECTIONS;
alter table CCM_CMS.CONTENT_SECTIONS
add constraint FKavcn4aakxsb7kt7hmqlx0ecu6
foreign key (ROOT_ASSETS_FOLDER_ID)
references CCM_CMS.FOLDERS;
alter table CCM_CMS.CONTENT_SECTIONS
add constraint FKd5sahsfsycq3i5icf3122ne8e
foreign key (ROOT_DOCUMENTS_FOLDER_ID)
references CCM_CMS.FOLDERS;
alter table CCM_CMS.CONTENT_SECTIONS
add constraint FK72jh0axiiru87i61mppvaiv96
foreign key (OBJECT_ID)
references CCM_CORE.APPLICATIONS;
alter table CCM_CMS.CONTENT_TYPE_DESCRIPTIONS
add constraint FKknyen2aw844b65grp7uys34cb
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_TYPES;
alter table CCM_CMS.CONTENT_TYPE_LABELS
add constraint FK3suusqws1xgffyk3yob7m7dge
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_TYPES;
alter table CCM_CMS.CONTENT_TYPES
add constraint FKriohuo8093its1k5rgoc5yrfc
foreign key (CONTENT_SECTION_ID)
references CCM_CMS.CONTENT_SECTIONS;
alter table CCM_CMS.CONTENT_TYPES
add constraint FK8s83we1tuh9r3j57dyos69wfa
foreign key (DEFAULT_LIFECYCLE_ID)
references CCM_CMS.LIFECYLE_DEFINITIONS;
alter table CCM_CMS.CONTENT_TYPES
add constraint FKhnu9oikw8rpf22lt5fmk41t7k
foreign key (DEFAULT_WORKFLOW)
references CCM_CORE.WORKFLOW_TEMPLATES;
alter table CCM_CMS.CONTENT_TYPES
add constraint FK96vwsbqfbdg33ujeeawajr0v4
foreign key (OBJECT_ID)
references CCM_CORE.CCM_OBJECTS;
alter table CCM_CMS.EVENT_COSTS
add constraint FKrbmepytotc73h5inefeih6rea
foreign key (OBJECT_ID)
references CCM_CMS.EVENTS;
alter table CCM_CMS.EVENT_COSTS_AUD
add constraint FKocok2fj1oflsi16i9guf8bpc6
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_COSTS_AUD
add constraint FKr17panho66n1ixh8tdms01e2c
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_DATES
add constraint FKfsfsbgoeoi511ll69iy1v7ujs
foreign key (OBJECT_ID)
references CCM_CMS.EVENTS;
alter table CCM_CMS.EVENT_DATES_AUD
add constraint FK70p2ayg7fexrb9jogdu3vlwfb
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_DATES_AUD
add constraint FKklmki82kiy0hwwpfdur2s7l3e
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_LOCATIONS
add constraint FK8snwub57evwh6px3n265tcoiv
foreign key (OBJECT_ID)
references CCM_CMS.EVENTS;
alter table CCM_CMS.EVENT_LOCATIONS_AUD
add constraint FKk5thpb1gaktsk213o53y97hno
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_LOCATIONS_AUD
add constraint FKivwe7h7k4myq4rhuh2wkepd9j
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS
add constraint FKlmq881mxd08hthm5dy4ayjq0e
foreign key (OBJECT_ID)
references CCM_CMS.EVENTS;
alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD
add constraint FKqgkj5almojvt913heh1f4kro5
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_MAIN_CONTRIBUTORS_AUD
add constraint FKh8vhg85li7c8yqjrg2plvkgho
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_TEXTS
add constraint FKc46r2g7ry50b9e875dldjhwxp
foreign key (OBJECT_ID)
references CCM_CMS.EVENTS;
alter table CCM_CMS.EVENT_TEXTS_AUD
add constraint FK82mc7uswliij43std6gwyswj3
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_TEXTS_AUD
add constraint FK1s381t783dmpk0fup65mvma0w
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_TYPES
add constraint FKhdbj26ubbhmht44qpin7ony29
foreign key (OBJECT_ID)
references CCM_CMS.EVENTS;
alter table CCM_CMS.EVENT_TYPES_AUD
add constraint FKgby7m27rnb6oeloqycyf4b1kx
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENT_TYPES_AUD
add constraint FKhcpvb5q2geclo5vxk0gt815x8
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.EVENTS
add constraint FKt56odfo39eq13gcj1bbtngoj7
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.EVENTS_AUD
add constraint FK9gofktd490afdwak49x15w6me
foreign key (OBJECT_ID, REV)
references CCM_CMS.CONTENT_ITEMS_AUD;
alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS
add constraint FKrwn3rdmqevi618fthojs0xkkq
foreign key (LEGAL_METADATA_ID)
references CCM_CMS.LEGAL_METADATA;
alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS
add constraint FK36xjlvslk0vlekn9lsc7x1c7a
foreign key (OBJECT_ID)
references CCM_CMS.BOOKMARKS;
alter table CCM_CMS.EXTERNAL_AUDIO_ASSETS_AUD
add constraint FKp3jndaw4k35wb3d6hg5ng4xww
foreign key (OBJECT_ID, REV)
references CCM_CMS.BOOKMARKS_AUD;
alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS
add constraint FK82gxr2se97dl902eu4wvhdvh3
foreign key (LEGAL_METADATA_ID)
references CCM_CMS.LEGAL_METADATA;
alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS
add constraint FKps8bq22n1fxy8svnsrui3f0t2
foreign key (OBJECT_ID)
references CCM_CMS.BOOKMARKS;
alter table CCM_CMS.EXTERNAL_VIDEO_ASSETS_AUD
add constraint FKilxwg8ppd64hl14tojfmupau9
foreign key (OBJECT_ID, REV)
references CCM_CMS.BOOKMARKS_AUD;
alter table CCM_CMS.FILES
add constraint FKpg74w39tfbbuqhcy21u61q138
foreign key (OBJECT_ID)
references CCM_CMS.BINARY_ASSETS;
alter table CCM_CMS.FILES_AUD
add constraint FKdl876a4twd0gkranwqkdmxnwy
foreign key (OBJECT_ID, REV)
references CCM_CMS.BINARY_ASSETS_AUD;
alter table CCM_CMS.FOLDER_CONTENT_SECTION_MAP
add constraint FKnof2m7o4f0ufrugeh4g5wt3g9
foreign key (CONTENT_SECTION_ID)
references CCM_CMS.CONTENT_SECTIONS;
alter table CCM_CMS.FOLDER_CONTENT_SECTION_MAP
add constraint FKmmb7728dp707dljq282ch47k3
foreign key (FOLDER_ID)
references CCM_CMS.FOLDERS;
alter table CCM_CMS.FOLDERS
add constraint FK2ag06r5ywtuji2pkt68etlg48
foreign key (OBJECT_ID)
references CCM_CORE.CATEGORIES;
alter table CCM_CMS.IMAGES
add constraint FK51ja1101epvl74auenv6sqyev
foreign key (LEGAL_METADATA_ID)
references CCM_CMS.LEGAL_METADATA;
alter table CCM_CMS.IMAGES
add constraint FKmdqranhdstkn6m6d73l15amxs
foreign key (OBJECT_ID)
references CCM_CMS.BINARY_ASSETS;
alter table CCM_CMS.IMAGES_AUD
add constraint FK4jsrdpe6d8is0ybx2p7sxivwf
foreign key (OBJECT_ID, REV)
references CCM_CMS.BINARY_ASSETS_AUD;
alter table CCM_CMS.LEGAL_METADATA
add constraint FKnxl7uyv1ks0qabgeienx2t9d1
foreign key (OBJECT_ID)
references CCM_CMS.ASSETS;
alter table CCM_CMS.LEGAL_METADATA_AUD
add constraint FKpt3eqil7iij6t5h1lrnjbb5xs
foreign key (OBJECT_ID, REV)
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS
add constraint FKf9s3kxi6y5r60wksv5bospmx1
foreign key (LEGAL_METADATA_ID)
references CCM_CMS.LEGAL_METADATA;
alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS_AUD
add constraint FKc3lonfk7mn3p14ix96k5u74om
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.LEGAL_METADATA_CONTRIBUTORS_AUD
add constraint FKgxxsteesd2em96fj05f0u4men
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.LEGAL_METADATA_RIGHTS
add constraint FKhsy9u7nrh3slmkkri3nba7e1
foreign key (ASSET_ID)
references CCM_CMS.LEGAL_METADATA;
alter table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD
add constraint FKe2da3kha2nl6sj0dllhepuxtq
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.LEGAL_METADATA_RIGHTS_AUD
add constraint FKr867xswbxlqq6diyqyqnrh670
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.LIFECYCLE_DEFINITION_DESCRIPTIONS
add constraint FKsdr5aoogu4b9x95m8qsbe4t0y
foreign key (OBJECT_ID)
references CCM_CMS.LIFECYLE_DEFINITIONS;
alter table CCM_CMS.LIFECYCLE_DEFINITION_LABELS
add constraint FKt4h71sl91ue18b25pdjty7jex
foreign key (OBJECT_ID)
references CCM_CMS.LIFECYLE_DEFINITIONS;
alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_DESCRIPTIONS
add constraint FKafbeck8qm0nflpt9aedn196ou
foreign key (OBJECT_ID)
references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS;
alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITION_LABELS
add constraint FKqysn500b0sp7bu8gy2sf2q8b9
foreign key (OBJECT_ID)
references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS;
alter table CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS
add constraint FKq5cwomuc9s1f3fsriq9t35407
foreign key (LIFECYCLE_DEFINITION_ID)
references CCM_CMS.LIFECYLE_DEFINITIONS;
alter table CCM_CMS.LIFECYCLES
add constraint FK5yx1a2f8g4w95p1ul77sfhow8
foreign key (DEFINITION_ID)
references CCM_CMS.LIFECYLE_DEFINITIONS;
alter table CCM_CMS.LIFECYLE_PHASES
add constraint FKpqysexvd82e4xd4uibtdfn8j4
foreign key (DEFINITION_ID)
references CCM_CMS.LIFECYCLE_PHASE_DEFINITIONS;
alter table CCM_CMS.LIFECYLE_PHASES
add constraint FKlh2b1nokqxhf790lt7lhgoisc
foreign key (LIFECYCLE_ID)
references CCM_CMS.LIFECYCLES;
alter table CCM_CMS.MPA_SECTION_TEXTS
add constraint FKaruovr4oa07syyhvkixfwc17h
foreign key (OBJECT_ID)
references CCM_CMS.MULTIPART_ARTICLE_SECTIONS;
alter table CCM_CMS.MPA_SECTION_TEXTS_AUD
add constraint FKs4kvqroybq9ldb2rwhr6v8kmt
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MPA_SECTION_TEXTS_AUD
add constraint FKpxvtsycad805c8u0vyh7pcb2c
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MPA_SECTION_TITLES
add constraint FK7qpmrj6yjvad50k5budn5rag4
foreign key (OBJECT_ID)
references CCM_CMS.MULTIPART_ARTICLE_SECTIONS;
alter table CCM_CMS.MPA_SECTION_TITLES_AUD
add constraint FKk64mi5911ybptw4slxh8i0lgb
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MPA_SECTION_TITLES_AUD
add constraint FKq7f0y31r5tk2nesx0lv53d6sb
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MPA_SUMMARIES
add constraint FK5kx5ghrkh6tqa2vms2qabacx8
foreign key (OBJECT_ID)
references CCM_CMS.MULTIPART_ARTICLES;
alter table CCM_CMS.MPA_SUMMARIES_AUD
add constraint FKmmrabpl2gsrdb2udc76x9o6q7
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MPA_SUMMARIES_AUD
add constraint FK3kebu6i1dtwfegp4409hhob4x
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS
add constraint FK30tkd6xp4i1gg6nrse4di2yxx
foreign key (MULTIPART_ARTICLE_ID)
references CCM_CMS.MULTIPART_ARTICLES;
alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS_AUD
add constraint FK8xq6k3a1kmnxv9nh5wae80k6k
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MULTIPART_ARTICLE_SECTIONS_AUD
add constraint FKsudhdaa9hs73447yik8mdy3ts
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MULTIPART_ARTICLES
add constraint FKj7j0ew378cmcta2dfdso4tmey
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.MULTIPART_ARTICLES_AUD
add constraint FKacl2u1cx6tmwfb9cpaxstw39k
foreign key (OBJECT_ID, REV)
references CCM_CMS.CONTENT_ITEMS_AUD;
alter table CCM_CMS.MultiPartArticle_MultiPartArticleSection_AUD
add constraint FK9vexjsvd62ufkgi4g24qiql70
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.MultiPartArticle_MultiPartArticleSection_AUD
add constraint FK4ds2fgwphr74869qkn4e2yia6
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.NEWS
add constraint FKl8jhpvtn0lx9drkhhbbuvqqis
foreign key (OBJECT_ID)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.NEWS_AUD
add constraint FK7akvtda3f51espb46xtjalcl2
foreign key (OBJECT_ID, REV)
references CCM_CMS.CONTENT_ITEMS_AUD;
alter table CCM_CMS.NEWS_TEXTS
add constraint FK1s5m60rf80iaidktawb3ebmf3
foreign key (OBJECT_ID)
references CCM_CMS.NEWS;
alter table CCM_CMS.NEWS_TEXTS_AUD
add constraint FKrand9sf233sgkgp8wfoen468l
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.NEWS_TEXTS_AUD
add constraint FKotjtrajmmjxussl4pvy2vl7ho
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.RELATED_LINKS
add constraint FKb517dnfj56oby2s34jp1omuim
foreign key (BOOKMARK_ID)
references CCM_CMS.BOOKMARKS;
alter table CCM_CMS.RELATED_LINKS
add constraint FK7ts8tmnwxi8kry7cer3egujsv
foreign key (TARGET_ITEM)
references CCM_CMS.CONTENT_ITEMS;
alter table CCM_CMS.RELATED_LINKS
add constraint FK35tv60a9kflo17h6xduvwvgis
foreign key (OBJECT_ID)
references CCM_CMS.ASSETS;
alter table CCM_CMS.RELATED_LINKS_AUD
add constraint FKiuwk6mcj3h5gccu2aviq3d8lt
foreign key (OBJECT_ID, REV)
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.SIDE_NOTE_TEXTS
add constraint FK4mvpioee23u1qswmn1fekipoh
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD
add constraint FKiu4ht1tipeal2csdkvws4fnws
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD
add constraint FKacekagiqks1cj9otxdmryl934
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES
add constraint FKf8c9mw6p4ijiba77t32uh7i0o
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKkuw32q22sotku83khh1xda7sf
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKbqgawobyevpbgxsnbbs9vwooq
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTES
add constraint FKea6cikleenmkgw5bwus22mfr3
foreign key (OBJECT_ID)
references CCM_CMS.ASSETS;
alter table CCM_CMS.SIDE_NOTES_AUD
add constraint FKl5pkg9mp2ymc2uo4kmlubyp3m
foreign key (OBJECT_ID, REV)
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.VIDEO_ASSETS
add constraint FKjuywvv7wq9pyid5b6ivyrc0yk
foreign key (LEGAL_METADATA_ID)
references CCM_CMS.LEGAL_METADATA;
alter table CCM_CMS.VIDEO_ASSETS
add constraint FKqt2cx1r31kqbqkimdld312i9g
foreign key (OBJECT_ID)
references CCM_CMS.BINARY_ASSETS;
alter table CCM_CMS.VIDEO_ASSETS_AUD
add constraint FKdrx9uu9a03ju7vqvkjretohpk
foreign key (OBJECT_ID, REV)
references CCM_CMS.BINARY_ASSETS_AUD;
alter table CCM_CMS.WORKFLOW_TASKS
add constraint FKoon3rwfmg0lhgbj4un4q3otya
foreign key (TASK_ID)
references CCM_CORE.WORKFLOW_ASSIGNABLE_TASKS;
alter table CCM_CORE.APPLICATIONS
add constraint FKatcp9ij6mbkx0nfeig1o6n3lm
foreign key (OBJECT_ID)
@ -2578,6 +1854,26 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (USER_ID)
references CCM_CORE.USERS;
alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS
add constraint FKo696ch035fe7rrueol1po13od
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS
add constraint FKcc5d6eqxu1369k8ycyyt6vn3e
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODEL_TITLES
add constraint FKj14q9911yhd4js9p6rs21rwjf
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODELS
add constraint FKk2lihllrxj89mn3tqv43amafe
foreign key (APPLICATION_ID)
references CCM_CORE.APPLICATIONS;
alter table CCM_CORE.PERMISSIONS
add constraint FKj9di7pawxgtouxmu2k44bj5c4
foreign key (CREATION_USER_ID)

View File

@ -20,6 +20,8 @@ package org.libreccm.modules;
import org.libreccm.configuration.Configuration;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.pagemodel.ComponentModel;
import org.libreccm.pagemodel.PageModelComponentModel;
import org.libreccm.web.ApplicationType;
import java.lang.annotation.Retention;
@ -90,4 +92,6 @@ public @interface Module {
*/
Class<?>[] configurations() default {};
PageModelComponentModel[] pageModelComponentModels() default {};
}

View File

@ -0,0 +1,34 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
/**
* A {@code ComponentBuilder} transforms a {@link ComponentModel} into a
* component.
*
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @param <M> Type of the model the component builder processes.
* @param <C> Type of the component which is build from the model.
*/
public interface ComponentBuilder<M extends ComponentModel, C> {
C buildComponent(M componentModel);
}

View File

@ -0,0 +1,205 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import org.libreccm.core.CoreConstants;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
/**
* Base class for the components model for use in a {@link PageModel}. This
* class is not designed for direct use. Instead the classes for concrete
* components have be used. A component must be annotation with
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Entity
@Table(name = "PAGE_MODEL_COMPONENT_MODELS", schema = CoreConstants.DB_SCHEMA)
public class ComponentModel implements Serializable {
private static final long serialVersionUID = 8585775139379396806L;
@Id
@Column(name = "COMPONENT_MODEL_ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private long componentModelId;
@Column(name = "UUID", length = 255, nullable = false)
@NotNull
private String uuid;
@ManyToOne
@JoinColumn(name = "PAGE_MODEL_ID")
private PageModel pageModel;
@Column(name = "ID_ATTRIBUTE", length = 255)
private String idAttribute;
@Column(name = "CLASS_ATTRIBUTE", length = 512)
private String classAttribute;
@Column(name = "STYLE_ATTRIBUTE", length = 1024)
private String styleAttribute;
@Column(name = "COMPONENT_KEY", length = 255)
private String key;
public long getComponentModelId() {
return componentModelId;
}
protected void setComponentModelId(final long componentModelId) {
this.componentModelId = componentModelId;
}
public String getUuid() {
return uuid;
}
protected void setUUid(final String uuid) {
this.uuid = uuid;
}
public PageModel getPageModel() {
return pageModel;
}
protected void setPageModel(final PageModel pageModel) {
this.pageModel = pageModel;
}
public String getIdAttribute() {
return idAttribute;
}
public void setIdAttribute(final String idAttribute) {
this.idAttribute = idAttribute;
}
public String getClassAttribute() {
return classAttribute;
}
public void setClassAttribute(final String classAttribute) {
this.classAttribute = classAttribute;
}
public String getStyleAttribute() {
return styleAttribute;
}
public void setStyleAttribute(final String styleAttribute) {
this.styleAttribute = styleAttribute;
}
public String getKey() {
return key;
}
public void setKey(final String key) {
this.key = key;
}
@Override
public int hashCode() {
int hash = 7;
hash
= 53 * hash + (int) (componentModelId ^ (componentModelId >>> 32));
hash = 53 * hash + Objects.hashCode(uuid);
hash = 53 * hash + Objects.hashCode(pageModel);
hash = 53 * hash + Objects.hashCode(idAttribute);
hash = 53 * hash + Objects.hashCode(classAttribute);
hash = 53 * hash + Objects.hashCode(styleAttribute);
hash = 53 * hash + Objects.hashCode(key);
return hash;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ComponentModel)) {
return false;
}
final ComponentModel other = (ComponentModel) obj;
if (!other.canEqual(this)) {
return false;
}
if (componentModelId != other.getComponentModelId()) {
return false;
}
if (!Objects.equals(idAttribute, other.getIdAttribute())) {
return false;
}
if (!Objects.equals(classAttribute, other.getClassAttribute())) {
return false;
}
if (!Objects.equals(styleAttribute, other.getStyleAttribute())) {
return false;
}
if (!Objects.equals(key, other.getKey())) {
return false;
}
return Objects.equals(pageModel, other.getPageModel());
}
public boolean canEqual(final Object obj) {
return obj instanceof ComponentModel;
}
@Override
public final String toString() {
return toString("");
}
public String toString(final String data) {
return String.format("%s{ "
+ "componentModelId = %d, "
+ "pageModel = %s, "
+ "idAttribute = \"%s\", "
+ "classAttribute = \"%s\", "
+ "styleAttribute = \"%s\", "
+ "key = \"%s\""
+ " }",
super.hashCode(),
componentModelId,
pageModel,
idAttribute,
classAttribute,
styleAttribute,
key);
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import org.libreccm.core.AbstractEntityRepository;
import java.util.UUID;
import javax.enterprise.context.RequestScoped;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
public class ComponentModelRepository extends AbstractEntityRepository<Long, ComponentModel> {
@Override
public Class<ComponentModel> getEntityClass() {
return ComponentModel.class;
}
@Override
public boolean isNew(final ComponentModel componentModel) {
return componentModel.getComponentModelId() == 0;
}
@Override
public void initNewEntity(final ComponentModel componentModel) {
componentModel.setUUid(UUID.randomUUID().toString());
}
}

View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.inject.Qualifier;
/**
* Specifies for which view technology a {@link ComponentBuilder} builds the
* components.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ComponentModelType {
String type();
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import javax.enterprise.context.RequestScoped;
/**
* Interface for page builders. A page builder is invoked to build a page a
* specific type. An implementation should be a CDI bean which is annotated with
* the qualifier {@link PageModelType}. The recommended scope is
* {@link RequestScoped}.
*
* An implementation should add all default components which have to be present
* in page. The {@link PageModel} should only specify <strong>additional</strong>
* components.
*
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @param <P> The type of page the page builder creates.
*/
public interface PageBuilder<P> {
/**
* Build a page of type {@code P} using the provided {@link PageModel}.
*
* @param pageModel The {@link PageModel} from which the page is generated.
*
* @return The page generated from the provided {@link PageModel}.
*/
P buildPage(PageModel pageModel);
}

View File

@ -0,0 +1,98 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import org.libreccm.web.CcmApplication;
import java.util.Iterator;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Instance;
import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Inject;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
public class PageBuilderManager {
@Inject
private Instance<PageBuilder<?>> pageBuilders;
public PageBuilder<?> findPageBuilder(
final String type,
final Class<? extends CcmApplication> applicationType) {
final PageModelTypeLiteral literal = new PageModelTypeLiteral(
type, applicationType);
final Instance<PageBuilder<?>> instance = pageBuilders.select(literal);
if (instance.isUnsatisfied()) {
throw new IllegalArgumentException(String.format(
"No PageBuilder for type \"%s\" and application type \"%s\" "
+ "available.",
type,
applicationType));
} else if (instance.isAmbiguous()) {
throw new IllegalArgumentException(String.format(
"There are more than one PageBuilders for type \"%s\" and "
+ "application type \"%s\" avilable. Something is wrong.",
type,
applicationType));
} else {
final Iterator<PageBuilder<?>> iterator = instance.iterator();
final PageBuilder<?> pageBuilder = iterator.next();
return pageBuilder;
}
}
private class PageModelTypeLiteral
extends AnnotationLiteral<PageModelType>
implements PageModelType {
private static final long serialVersionUID = 5919950993273871601L;
private final String type;
private final Class<? extends CcmApplication> applicationType;
public PageModelTypeLiteral(
final String type,
final Class<? extends CcmApplication> applicationType) {
this.type = type;
this.applicationType = applicationType;
}
@Override
public String type() {
return type;
}
@Override
public Class<? extends CcmApplication> applicationType() {
return applicationType;
}
}
}

View File

@ -0,0 +1,285 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import org.libreccm.core.CoreConstants;
import org.libreccm.l10n.LocalizedString;
import org.libreccm.web.CcmApplication;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import javax.persistence.AssociationOverride;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
/**
* A {@link PageModel} is used by a {@link PageBuilder} implementation to build
* a page. The {@code PageModel} specifics which components are used on a page.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Entity
@Table(name = "PAGE_MODELS", schema = CoreConstants.DB_SCHEMA)
@NamedQueries({
@NamedQuery(
name = "PageModel.findByApplication",
query = "SELECT p FROM PageModel p WHERE p.application = :application")
,
@NamedQuery(
name = "PageModel.countByApplication",
query = "SELECT COUNT(p) FROM PageModel p "
+ "WHERE p.application = :application")
,
@NamedQuery(
name = "PageModel.findByApplicationAndName",
query = "SELECT p FROM PageModel p "
+ "WHERE p.name = :name AND p.application = :application"
),
@NamedQuery(
name = "PageModel.countByApplicationAndName",
query = "SELECT COUNT(p) FROM PageModel p "
+ "WHERE p.name = :name AND p.application = :application"
)
})
public class PageModel implements Serializable {
private static final long serialVersionUID = 7252512839926020978L;
@Id
@Column(name = "PAGE_MODEL_ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private long pageModelId;
@Column(name = "UUID", length = 255, nullable = false)
@NotNull
private String uuid;
@Column(name = "NAME", length = 255)
private String name;
@Column(name = "VERSION", length = 255, nullable = false)
@Enumerated(EnumType.STRING)
private PageModelVersion version;
@Embedded
@AssociationOverride(
name = "values",
joinTable = @JoinTable(name = "PAGE_MODEL_TITLES",
schema = CoreConstants.DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "PAGE_MODEL_ID")
}))
private LocalizedString title;
@Embedded
@AssociationOverride(
name = "values",
joinTable = @JoinTable(name = "PAGE_MODEL_DESCRIPTIONS",
schema = CoreConstants.DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "PAGE_MODEL_ID")
}))
private LocalizedString description;
@ManyToOne
@JoinColumn(name = "APPLICATION_ID")
private CcmApplication application;
@Column(name = "TYPE", length = 255, nullable = false)
@NotNull
private String type;
@OneToMany(mappedBy = "pageModel")
private List<ComponentModel> components;
public PageModel() {
title = new LocalizedString();
description = new LocalizedString();
}
public long getPageModelId() {
return pageModelId;
}
protected void setPageModelId(final long pageModelId) {
this.pageModelId = pageModelId;
}
public String getUuid() {
return uuid;
}
protected void setUuid(final String uuid) {
this.uuid = uuid;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public PageModelVersion getVersion() {
return version;
}
protected void setPageModelVersion(final PageModelVersion version) {
this.version = version;
}
public LocalizedString getTitle() {
return title;
}
protected void setTitle(final LocalizedString title) {
this.title = title;
}
public LocalizedString getDescription() {
return description;
}
protected void setDescription(final LocalizedString description) {
this.description = description;
}
public CcmApplication getApplication() {
return application;
}
protected void setApplication(final CcmApplication application) {
this.application = application;
}
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
public List<ComponentModel> getComponents() {
return Collections.unmodifiableList(components);
}
protected void setComponents(final List<ComponentModel> components) {
this.components = components;
}
public void addComponent(final ComponentModel component) {
components.add(component);
}
public void removeComponent(final ComponentModel component) {
components.remove(component);
}
@Override
public int hashCode() {
int hash = 7;
hash = 71 * hash + (int) (pageModelId ^ (pageModelId >>> 32));
hash = 71 * hash + Objects.hashCode(uuid);
hash = 71 * hash + Objects.hashCode(name);
hash = 71 * hash + Objects.hashCode(title);
hash = 71 * hash + Objects.hashCode(description);
hash = 71 * hash + Objects.hashCode(type);
return hash;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof PageModel)) {
return false;
}
final PageModel other = (PageModel) obj;
if (!other.canEqual(this)) {
return false;
}
if (pageModelId != other.getPageModelId()) {
return false;
}
if (!Objects.equals(uuid, other.getUuid())) {
return false;
}
if (!Objects.equals(name, other.getName())) {
return false;
}
if (!Objects.equals(type, other.getType())) {
return false;
}
if (!Objects.equals(title, other.getTitle())) {
return false;
}
return Objects.equals(description, other.getDescription());
}
public boolean canEqual(final Object obj) {
return obj instanceof PageModel;
}
@Override
public final String toString() {
return toString("");
}
public String toString(final String data) {
return String.format("%s{ "
+ "pageModelId = %d, "
+ "uuid = %s, "
+ "name = \"%s\", "
+ "title = %s, "
+ "description = %s, "
+ "type = \"%s\""
+ " }",
super.toString(),
pageModelId,
uuid,
name,
Objects.toString(title),
Objects.toString(description),
type);
}
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface PageModelComponentModel {
String descBundle() default "";
String titleKey() default "component_model_title";
String descKey() default "component_model_desc";
Class<? extends ComponentModel> modelClass();
}

View File

@ -0,0 +1,145 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import org.libreccm.core.CoreConstants;
import org.libreccm.security.AuthorizationRequired;
import org.libreccm.security.RequiresPrivilege;
import org.libreccm.web.CcmApplication;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.transaction.Transactional;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
public class PageModelManager {
@Inject
private PageModelRepository pageModelRepo;
@Inject
private ComponentModelRepository componentModelRepo;
/**
* Creates a new {@link PageModel} for the provided application.
*
* @param name The name of the new page model. Must be unique for the
* application.
* @param application The application for which the {@link PageModel} is
* created.
*
* @return The new {@link PageModel}.
*/
@Transactional(Transactional.TxType.REQUIRED)
@AuthorizationRequired
@RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN)
public PageModel createPageModel(final String name,
final CcmApplication application,
final String type) {
if (application == null) {
throw new IllegalArgumentException(
"Can't create a page model for application null");
}
if (name == null || name.trim().isEmpty()) {
throw new IllegalArgumentException(
"The name of a page model can't be null or empty.");
}
final long count = pageModelRepo.countByApplicationAndName(application,
name);
if (count > 0) {
throw new IllegalArgumentException(String.format(
"A page model with the name \"%s\" for the application \"%s\" "
+ "already exists.",
name,
application.getPrimaryUrl()));
}
final PageModel pageModel = new PageModel();
pageModel.setName(name);
pageModel.setApplication(application);
pageModel.setType(type);
return pageModel;
}
/**
* Add a {@link ComponentModel} to a {@link PageModel}.
*
* @param pageModel The {@link PageModel} to which component model is
* added.
* @param componentModel The {@link ComponentModel} to add.
*/
public void addComponentModel(final PageModel pageModel,
final ComponentModel componentModel) {
if (pageModel == null) {
throw new IllegalArgumentException(
"Can't add a component model to page model null.");
}
if (componentModel == null) {
throw new IllegalArgumentException(
"Can't add component model null to a page model.");
}
pageModel.addComponent(componentModel);
componentModel.setPageModel(pageModel);
pageModelRepo.save(pageModel);
componentModelRepo.save(componentModel);
}
/**
* Removes a {@link ComponentModel} from a {@link PageModel}.
*
* @param pageModel The {@link PageModel} from which the
* {@link ComponentModel} is removed.
* @param componentModel The {@link ComponentModel} to remove. The component
* model is also removed from the database.
*/
public void removeComponentModel(final PageModel pageModel,
final ComponentModel componentModel) {
if (pageModel == null) {
throw new IllegalArgumentException(
"Can't remove a component model from page model null.");
}
if (componentModel == null) {
throw new IllegalArgumentException(
"Can't remove component model null from a page model.");
}
pageModel.removeComponent(componentModel);
componentModel.setPageModel(null);
pageModelRepo.save(pageModel);
componentModelRepo.delete(componentModel);
}
}

View File

@ -0,0 +1,135 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import org.libreccm.core.AbstractEntityRepository;
import org.libreccm.web.CcmApplication;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import javax.enterprise.context.RequestScoped;
import javax.persistence.TypedQuery;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
public class PageModelRepository extends AbstractEntityRepository<Long, PageModel> {
@Override
public Class<PageModel> getEntityClass() {
return PageModel.class;
}
@Override
public boolean isNew(final PageModel pageModel) {
if (pageModel == null) {
throw new IllegalArgumentException("PageModel can't be null.");
}
return pageModel.getPageModelId() == 0;
}
@Override
public void initNewEntity(final PageModel pageModel) {
if (pageModel == null) {
throw new IllegalArgumentException("PageModel can't be null.");
}
pageModel.setUuid(UUID.randomUUID().toString());
}
public List<PageModel> findByApplication(final CcmApplication application) {
if (application == null) {
throw new IllegalArgumentException(
"Can't find page models for application null");
}
final TypedQuery<PageModel> query = getEntityManager().createNamedQuery(
"PageModel.findByApplication", PageModel.class);
query.setParameter("application", application);
return query.getResultList();
}
public long countByApplication(final CcmApplication application) {
if (application == null) {
throw new IllegalArgumentException(
"Can't count page models for application null");
}
final TypedQuery<Long> query = getEntityManager().createNamedQuery(
"PageModel.countByApplication", Long.class);
query.setParameter("application", application);
return query.getSingleResult();
}
public Optional<PageModel> findByApplicationAndName(
final CcmApplication application,
final String name) {
if (application == null) {
throw new IllegalArgumentException(
"Can't find page models for application null");
}
if (name == null || name.trim().isEmpty()) {
throw new IllegalArgumentException(
"The name of a page model can't be null or empty.");
}
final long count = countByApplicationAndName(application, name);
if (count == 0) {
return Optional.empty();
}
final TypedQuery<PageModel> query = getEntityManager().createNamedQuery(
"PageModel.findByApplicationAndName", PageModel.class);
query.setParameter("application", application);
query.setParameter("name", name);
return Optional.of(query.getSingleResult());
}
public long countByApplicationAndName(final CcmApplication application,
final String name) {
if (application == null) {
throw new IllegalArgumentException(
"Can't count page models for application null");
}
if (name == null || name.trim().isEmpty()) {
throw new IllegalArgumentException(
"The name of a page model can't be null or empty.");
}
final TypedQuery<Long> query = getEntityManager().createNamedQuery(
"PageModel.countByApplicationAndName", Long.class);
query.setParameter("application", application);
query.setParameter("name", name);
return query.getSingleResult();
}
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
import org.libreccm.web.CcmApplication;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.inject.Qualifier;
/**
* Specifies for which application type and which view technology a
* {@link PageBuilder} builds the pages.
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface PageModelType {
String type();
Class<? extends CcmApplication> applicationType();
}

View File

@ -0,0 +1,30 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package org.libreccm.pagemodel;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public enum PageModelVersion {
DRAFT,
LIVE
}

View File

@ -0,0 +1,34 @@
/*
* Copyright (C) 2016 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
/**
* The {@code pagemodel} packages provides an abstraction layer between the data
* model of page and its generating components. This layer replaces the JSP
* templates which were used in previous versions for this purpose.
*
* The Page Model system allows it to specify which components are used on a
* page are therefore which information is displayed on a page. It is intended
* to be used for public pages (like the item page of a content item category
* page in ccm-cms. The Page Model system uses data container which are read by
* some builder classes. Because we are not using an active code in the page
* models this avoids a potential attack point.
*
*
*
*/
package org.libreccm.pagemodel;

View File

@ -62,8 +62,6 @@ public @interface ApplicationType {
* bundle. Defaults to {@code application_title}
*
* @return
*
* @return
*/
String titleKey() default "application_title";

View File

@ -4,6 +4,7 @@ drop sequence if exists HIBERNATE_SEQUENCE;
create schema CCM_CORE;
create table CCM_CORE.APPLICATIONS (
APPLICATION_TYPE varchar(1024) not null,
PRIMARY_URL varchar(1024) not null,
@ -396,6 +397,41 @@ create schema CCM_CORE;
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),
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,
NAME varchar(255),
TYPE varchar(255) not null,
UUID varchar(255) not null,
VERSION varchar(255) not null,
APPLICATION_ID bigint,
primary key (PAGE_MODEL_ID)
);
create table CCM_CORE.PARTIES (
PARTY_ID bigint not null,
NAME varchar(256) not null,
@ -497,11 +533,11 @@ create schema CCM_CORE;
SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_LONG bigint,
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_LONG bigint,
primary key (SETTING_ID)
);
@ -966,6 +1002,26 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (USER_ID)
references CCM_CORE.USERS;
alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS
add constraint FKo696ch035fe7rrueol1po13od
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS
add constraint FKcc5d6eqxu1369k8ycyyt6vn3e
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODEL_TITLES
add constraint FKj14q9911yhd4js9p6rs21rwjf
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODELS
add constraint FKk2lihllrxj89mn3tqv43amafe
foreign key (APPLICATION_ID)
references CCM_CORE.APPLICATIONS;
alter table CCM_CORE.PERMISSIONS
add constraint FKj9di7pawxgtouxmu2k44bj5c4
foreign key (CREATION_USER_ID)

View File

@ -396,6 +396,41 @@ create schema CCM_CORE;
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),
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,
NAME varchar(255),
TYPE varchar(255) not null,
UUID varchar(255) not null,
VERSION varchar(255) not null,
APPLICATION_ID int8,
primary key (PAGE_MODEL_ID)
);
create table CCM_CORE.PARTIES (
PARTY_ID int8 not null,
NAME varchar(256) not null,
@ -497,11 +532,11 @@ create schema CCM_CORE;
SETTING_ID int8 not null,
CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_LONG int8,
SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_LONG int8,
primary key (SETTING_ID)
);
@ -966,6 +1001,26 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (USER_ID)
references CCM_CORE.USERS;
alter table CCM_CORE.PAGE_MODEL_COMPONENT_MODELS
add constraint FKo696ch035fe7rrueol1po13od
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODEL_DESCRIPTIONS
add constraint FKcc5d6eqxu1369k8ycyyt6vn3e
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODEL_TITLES
add constraint FKj14q9911yhd4js9p6rs21rwjf
foreign key (PAGE_MODEL_ID)
references CCM_CORE.PAGE_MODELS;
alter table CCM_CORE.PAGE_MODELS
add constraint FKk2lihllrxj89mn3tqv43amafe
foreign key (APPLICATION_ID)
references CCM_CORE.APPLICATIONS;
alter table CCM_CORE.PERMISSIONS
add constraint FKj9di7pawxgtouxmu2k44bj5c4
foreign key (CREATION_USER_ID)