diff --git a/core-api/src/main/java/org/silverpeas/core/admin/user/model/Group.java b/core-api/src/main/java/org/silverpeas/core/admin/user/model/Group.java index 795a67096b..8d9c02321f 100644 --- a/core-api/src/main/java/org/silverpeas/core/admin/user/model/Group.java +++ b/core-api/src/main/java/org/silverpeas/core/admin/user/model/Group.java @@ -203,4 +203,12 @@ static List getAllRootsInDomain(String domainId) { * @return the date of last state save (when it changes) as {@link Date}. */ Date getStateSaveDate(); + + /** + * Is this group of users is a group of the memberships of a community, and in this case it is + * managed by a community space? + * @return true if this group is managed by a community space. False if it is managed by a + * user domain. + */ + boolean isCommunityGroup(); } diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_constraint.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_constraint.sql new file mode 100644 index 0000000000..05cbb7060f --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_constraint.sql @@ -0,0 +1,85 @@ +ALTER TABLE ST_AccessLevel ADD CONSTRAINT PK_AccessLevel PRIMARY KEY (id); +ALTER TABLE ST_AccessLevel ADD CONSTRAINT UN_AccessLevel_1 UNIQUE (name); + +ALTER TABLE ST_User ADD CONSTRAINT PK_User PRIMARY KEY (id); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_2 UNIQUE(login, domainId); +ALTER TABLE ST_User ADD CONSTRAINT FK_User_1 FOREIGN KEY(accessLevel) REFERENCES ST_AccessLevel(id); + +ALTER TABLE ST_Group ADD CONSTRAINT PK_Group PRIMARY KEY (id); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_2 UNIQUE(superGroupId, name, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT FK_Group_1 FOREIGN KEY (superGroupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT PK_Group_User_Rel PRIMARY KEY (groupId, userId); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES ST_Group(id); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_Space ADD CONSTRAINT PK_Space PRIMARY KEY (id); +ALTER TABLE ST_Space ADD CONSTRAINT UN_Space_1 UNIQUE(domainFatherId, name); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_1 FOREIGN KEY (createdBy) REFERENCES ST_User(id); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_2 FOREIGN KEY (domainFatherId) REFERENCES ST_Space(id); + +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT PK_ComponentInstance PRIMARY KEY (id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT UN_ComponentInstance_1 UNIQUE(spaceId, name); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_2 FOREIGN KEY (createdBy) REFERENCES ST_User(id); + +ALTER TABLE ST_Instance_Data ADD CONSTRAINT PK_Instance_Data PRIMARY KEY (id); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT UN_Instance_Data_1 UNIQUE(componentId, name); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT FK_Instance_Data_1 FOREIGN KEY (componentId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole ADD CONSTRAINT PK_UserRole PRIMARY KEY (id); +ALTER TABLE ST_UserRole ADD CONSTRAINT UN_UserRole_1 UNIQUE(instanceId, roleName, isInherited, objectId); +ALTER TABLE ST_UserRole ADD CONSTRAINT FK_UserRole_1 FOREIGN KEY (instanceId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT PK_UserRole_User_Rel PRIMARY KEY (userRoleId, userId); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT PK_UserRole_Group_Rel PRIMARY KEY (userRoleId, groupId); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT PK_SpaceUserRole PRIMARY KEY (id); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT UN_SpaceUserRole_1 UNIQUE(spaceId, roleName, isInherited); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT FK_SpaceUserRole_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); + +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT PK_SpaceUserRole_User_Rel PRIMARY KEY (spaceUserRoleId, userId); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT PK_SpaceUserRole_Group_Rel PRIMARY KEY (spaceUserRoleId, groupId); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE DomainSP_Group ADD CONSTRAINT PK_DomainSP_Group PRIMARY KEY (id); +ALTER TABLE DomainSP_Group ADD CONSTRAINT UN_DomainSP_Group_1 UNIQUE(superGroupId, name); +ALTER TABLE DomainSP_Group ADD CONSTRAINT FK_DomainSP_Group_1 FOREIGN KEY (superGroupId) REFERENCES DomainSP_Group(id); + +ALTER TABLE DomainSP_User ADD CONSTRAINT PK_DomainSP_User PRIMARY KEY (id); +ALTER TABLE DomainSP_User ADD CONSTRAINT UN_DomainSP_User_1 UNIQUE(login); + +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES DomainSP_Group(id); +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES DomainSP_User(id); + +ALTER TABLE ST_Domain ADD CONSTRAINT PK_ST_Domain PRIMARY KEY (id); + +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT PK_DomainSP_Group_User_Rel PRIMARY KEY (groupId,userId); + +ALTER TABLE ST_LongText ADD CONSTRAINT PK_ST_LongText PRIMARY KEY (id,orderNum); + +ALTER TABLE st_instance_modelused ADD + CONSTRAINT PK_st_instance_modelused PRIMARY KEY + ( + instanceId, + modelId, + objectId + ) +; + +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT PK_UserFavoriteSpaces PRIMARY KEY (id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_1 FOREIGN KEY (userid) REFERENCES ST_User(id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_2 FOREIGN KEY (spaceid) REFERENCES ST_Space(id); + +ALTER TABLE SB_Contribution_Tracking ADD CONSTRAINT PK_CONTRIBUTION_TRACKING PRIMARY KEY (id); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_constraint_production.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_constraint_production.sql new file mode 100644 index 0000000000..647c3598cb --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_constraint_production.sql @@ -0,0 +1,96 @@ +ALTER TABLE UniqueId ADD + CONSTRAINT PK_UniqueId PRIMARY KEY + ( + tableName + ); + +ALTER TABLE Personalization ADD + CONSTRAINT PK_Personalization PRIMARY KEY + ( + id + ); + +ALTER TABLE readingControl ADD + CONSTRAINT PK_readingControl PRIMARY KEY + ( + pubId, actorId, space, componentName + ); + +ALTER TABLE model_contact ADD + CONSTRAINT PK_model_contact PRIMARY KEY + ( + id + ); + +ALTER TABLE model ADD + CONSTRAINT PK_model PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarJournal ADD + CONSTRAINT PK_CalendarJournal PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarCategory ADD + CONSTRAINT PK_CalendarCategory PRIMARY KEY + ( + categoryId + ); + +ALTER TABLE calendarJournalAttendee ADD + CONSTRAINT PK_calendarJournalAttendee PRIMARY KEY + ( + journalId, userId + ); + + +ALTER TABLE calendarJournalCategory ADD + CONSTRAINT PK_calendarJournalCategory PRIMARY KEY + ( + journalId, categoryId + ); + +ALTER TABLE calendarToDo ADD + CONSTRAINT PK_calendarToDo PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarToDoAttendee ADD + CONSTRAINT PK_calendarToDoAttendee PRIMARY KEY + ( + todoId, userId + ); + +ALTER TABLE ST_FormDesigner_FormDesign ADD + CONSTRAINT PK_ST_FormDesigner_FormDesign PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormDesigner_Connectors ADD + CONSTRAINT PK_ST_FormDesigner_Connectors PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEdited ADD + CONSTRAINT PK_ST_FormEditor_FormEdited PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEditedData ADD + CONSTRAINT PK_ST_FormEditor_FED PRIMARY KEY + ( + ID + ); + +ALTER TABLE sb_agenda_import_settings ADD + CONSTRAINT PK_sb_agenda_import_settings_SET PRIMARY KEY + ( + userid + ); diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_index.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_index.sql new file mode 100644 index 0000000000..86821e71e5 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_index.sql @@ -0,0 +1,2 @@ +CREATE INDEX IDX_SB_CONTRIBUTION_TRACKING_CONTRIBUTION + ON SB_Contribution_Tracking (contrib_id, contrib_type, contrib_instanceId); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_index_production.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_index_production.sql new file mode 100644 index 0000000000..403e6ebc97 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_index_production.sql @@ -0,0 +1,2 @@ +CREATE INDEX IND_st_instance_modelused ON st_instance_modelused (instanceId,modelId) +; \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_table.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_table.sql new file mode 100644 index 0000000000..d61a823db3 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_table.sql @@ -0,0 +1,274 @@ +CREATE TABLE ST_AccessLevel +( + id char(1) NOT NULL, + name varchar(100) NOT NULL +); + +CREATE TABLE ST_User +( + id INT NOT NULL, + domainId INT NOT NULL, + specificId VARCHAR(500) NOT NULL, + firstName VARCHAR(100), + lastName VARCHAR(100) NOT NULL, + email VARCHAR(100), + login VARCHAR(100) NOT NULL, + loginMail VARCHAR(100), + accessLevel CHAR(1) DEFAULT 'U' NOT NULL, + loginquestion VARCHAR(200), + loginanswer VARCHAR(200), + creationDate TIMESTAMP, + saveDate TIMESTAMP, + version INT DEFAULT 0 NOT NULL, + tosAcceptanceDate TIMESTAMP, + lastLoginDate TIMESTAMP, + nbSuccessfulLoginAttempts INT DEFAULT 0 NOT NULL, + lastLoginCredentialUpdateDate TIMESTAMP, + expirationDate TIMESTAMP, + state VARCHAR(30) NOT NULL, + stateSaveDate TIMESTAMP NOT NULL, + notifManualReceiverLimit INT, + sensitiveData BOOLEAN DEFAULT FALSE NOT NULL +); + +CREATE TABLE ST_Group +( + id int NOT NULL, + domainId int NOT NULL, + specificId varchar(500) NOT NULL, + spaceId varchar(500), + superGroupId int, + name varchar(100) NOT NULL, + description varchar(400), + synchroRule varchar(2000), + creationDate timestamp, + saveDate timestamp, + state varchar(30) NOT NULL, + stateSaveDate timestamp NOT NULL +); + +CREATE TABLE ST_Group_User_Rel +( + groupId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_Space +( + id int NOT NULL, + domainFatherId int, + name varchar(100) NOT NULL, + description varchar(400), + createdBy int, + firstPageType int NOT NULL, + firstPageExtraParam varchar(400), + orderNum int DEFAULT(0) NOT NULL, + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + spaceStatus char(1), + updatedBy int, + removedBy int, + lang char(2), + isInheritanceBlocked int DEFAULT(0) NOT NULL, + isCommunity smallint DEFAULT(0) NOT NULL, + look varchar(50), + displaySpaceFirst smallint, + isPersonal smallint +); + +CREATE TABLE ST_SpaceI18N +( + id int NOT NULL, + spaceId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_ComponentInstance +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NOT NULL, + componentName varchar(100) NOT NULL, + description varchar(400), + createdBy int, + orderNum int DEFAULT (0) NOT NULL, + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + componentStatus char(1), + updatedBy int, + removedBy int, + isPublic int DEFAULT(0) NOT NULL, + isHidden int DEFAULT(0) NOT NULL, + lang char(2), + isInheritanceBlocked int default(0) NOT NULL +); + +CREATE TABLE ST_ComponentInstanceI18N +( + id int NOT NULL, + componentId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_Instance_Data +( + id int NOT NULL, + componentId int NOT NULL, + name varchar(100) NOT NULL, + label varchar(100) NOT NULL, + "value" varchar(1000) +); + +CREATE TABLE ST_UserRole +( + id int NOT NULL, + instanceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int default(0) NOT NULL, + objectId int, + objectType varchar(50) +); + +CREATE TABLE ST_UserRole_User_Rel +( + userRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_UserRole_Group_Rel +( + userRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int default(0) NOT NULL +); + +CREATE TABLE ST_SpaceUserRole_User_Rel +( + spaceUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole_Group_Rel +( + spaceUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE DomainSP_Group ( + id int NOT NULL, + superGroupId int NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL +); + +CREATE TABLE DomainSP_User ( + id int NOT NULL, + firstName varchar (100) NULL , + lastName varchar (100) NOT NULL , + phone varchar (20) NULL , + homePhone varchar (20) NULL , + cellPhone varchar (20) NULL , + fax varchar (20) NULL , + address varchar (500) NULL , + title varchar (100) NULL , + company varchar (100) NULL , + position varchar (100) NULL , + boss varchar (100) NULL , + login varchar (50) NOT NULL , + password varchar (123) NULL , + passwordValid char (1) DEFAULT ('Y') NOT NULL , + loginMail varchar (100) NULL , + email varchar (100) NULL +); + +CREATE TABLE DomainSP_Group_User_Rel ( + groupId int NOT NULL , + userId int NOT NULL +); + +CREATE TABLE ST_Domain ( + id int NOT NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL , + propFileName varchar (100) NOT NULL , + className varchar (100) NOT NULL , + authenticationServer varchar (100) NOT NULL , + theTimeStamp varchar (100) DEFAULT('0') NOT NULL , + silverpeasServerURL varchar (400) NULL +); + +CREATE TABLE ST_KeyStore ( + userKey decimal(18, 0) NOT NULL , + login varchar(100) NOT NULL , + domainId int NOT NULL +); + + +CREATE TABLE ST_LongText ( + id int NOT NULL , + orderNum int NOT NULL , + bodyContent varchar(2000) NOT NULL +); + +CREATE TABLE ST_GroupUserRole +( + id int NOT NULL, + groupId int NOT NULL, + roleName varchar(100) NOT NULL +); + +CREATE TABLE ST_GroupUserRole_User_Rel +( + groupUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_GroupUserRole_Group_Rel +( + groupUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE st_instance_modelused +( + instanceId varchar(50) NOT NULL, + modelId varchar(50) NOT NULL, + objectId varchar(50) DEFAULT('0') NOT NULL +) +; + +CREATE TABLE ST_UserFavoriteSpaces +( + id INT NOT NULL, + userid INT NOT NULL, + spaceid INT NOT NULL +); + +CREATE TABLE SB_Contribution_Tracking +( + id VARCHAR(40) NOT NULL, + context VARCHAR(255) DEFAULT '', + contrib_id VARCHAR(40) NOT NULL, + contrib_type VARCHAR(40) NOT NULL, + contrib_instanceId VARCHAR(50) NOT NULL, + action_type VARCHAR(20) NOT NULL, + action_date TIMESTAMP NOT NULL, + action_by VARCHAR(50) NOT NULL +); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_table_production.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_table_production.sql new file mode 100644 index 0000000000..e70f270af6 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/create_table_production.sql @@ -0,0 +1,167 @@ +CREATE TABLE UniqueId ( + maxId BIGINT NOT NULL, + tableName varchar(100) NOT NULL +); + +CREATE TABLE Personalization ( + id varchar(100) NOT NULL , + languages varchar(100) NULL, + zoneId varchar(100) NULL, + look varchar(50) NULL, + personalWSpace varchar(50) NULL, + thesaurusStatus int NOT NULL, + dragAndDropStatus int DEFAULT 1, + webdavEditingStatus int DEFAULT 0, + menuDisplay varchar(50) DEFAULT 'DEFAULT' +); + + +CREATE TABLE readingControl ( + pubId int NOT NULL , + actorId varchar(100) NOT NULL , + space varchar(50) NOT NULL , + componentName varchar(50) NOT NULL +); + +CREATE TABLE subscribe ( + subscriberId VARCHAR(100) NOT NULL, + subscriberType VARCHAR(50) NOT NULL, + subscriptionMethod VARCHAR(50) NOT NULL, + resourceId VARCHAR(100) NOT NULL, + resourceType VARCHAR(50) NOT NULL, + space VARCHAR(50) NOT NULL, + instanceId VARCHAR(50) NOT NULL, + creatorId VARCHAR(100) NOT NULL, + creationDate TIMESTAMP NOT NULL +); + +CREATE TABLE model_contact ( + id int NOT NULL , + name varchar(50) NOT NULL , + description varchar(50) NULL , + imageName varchar(50) NULL , + htmlDisplayer varchar(3000) NOT NULL , + htmlEditor varchar(3000) NOT NULL +); + + +CREATE TABLE model ( + id int NOT NULL , + name varchar(50) NOT NULL , + description varchar(100) NULL , + imageName varchar(100) NULL , + htmlDisplayer varchar(3500) NOT NULL , + htmlEditor varchar(3500) NOT NULL , + partId int default 1 NOT NULL +); + +CREATE TABLE calendarJournal ( + id int NOT NULL , + name varchar(2000) NOT NULL , + description varchar(4000) NULL , + delegatorId varchar(100) NOT NULL , + startDay varchar(50) NOT NULL , + endDay varchar(50) NULL , + startHour varchar(50) NULL , + endHour varchar(50) NULL , + classification varchar(20) NULL , + priority int NULL , + lastModification varchar(50) NULL, + externalid varchar(50) NULL +); + +CREATE TABLE calendarCategory ( + categoryId varchar(50) NOT NULL , + name varchar(50) NOT NULL +); + +CREATE TABLE calendarJournalAttendee ( + journalId int NOT NULL , + userId varchar(100) NOT NULL , + participationStatus varchar(50) NULL +); + +CREATE TABLE calendarJournalCategory ( + journalId int NOT NULL , + categoryId varchar(50) NOT NULL +); + +CREATE TABLE days ( + "day" varchar(50) NOT NULL +); + +CREATE TABLE calendarToDo ( + id int NOT NULL , + name varchar(2000) NOT NULL , + description varchar(4000) NULL , + delegatorId varchar(100) NOT NULL , + startDay varchar(50) NULL , + endDay varchar(50) NULL , + startHour varchar(50) NULL , + endHour varchar(50) NULL , + classification varchar(20) NULL , + priority int NULL , + lastModification varchar(50) NULL , + percentCompleted int NULL , + completedDay varchar(20) NULL , + duration int NULL , + componentId varchar(100) NULL , + spaceId varchar(100) NULL , + externalId varchar(100) NULL +); + + +CREATE TABLE calendarToDoAttendee ( + todoId int NOT NULL , + userId varchar(100) NOT NULL , + participationStatus varchar(50) NULL +); + +CREATE TABLE ST_FormDesigner_FormDesign ( + ID int NOT NULL , + REFIDFORM int NOT NULL , + COMPONENTID varchar(100) NOT NULL , + NAME varchar(1000) NOT NULL , + DESCRIPTION varchar(2000) NOT NULL , + CREATIONDATE varchar(10) NOT NULL , + AUTHOR int NOT NULL +); + +CREATE TABLE ST_FormDesigner_Connectors ( + ID int NOT NULL , + NAME varchar(1000) NOT NULL , + DESCRIPTION varchar(2000) NOT NULL, + DRIVER varchar(1000) NOT NULL, + URL varchar(1000) NOT NULL, + LOGIN varchar(1000) NOT NULL, + PASSWD varchar(1000) NULL, + SQLQUERY varchar(4000) NOT NULL, + TYPE varchar(50) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEdited ( + ID int NOT NULL , + FORMID int NOT NULL , + USERID int NOT NULL, + CREATEDATE varchar(10) NOT NULL, + MODIFYDATE varchar(10) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEditedData ( + ID int NOT NULL , + FORMEDITEDID int NOT NULL , + EDITEDKEY varchar(50) NOT NULL, + EDITEDVALUE varchar(500) NOT NULL +); + +CREATE TABLE sb_agenda_import_settings +( + userid int NOT NULL, + hostname varchar(500) NOT NULL, + synchrotype int NOT NULL, + synchrodelay int NOT NULL, + url varchar(500) NULL, + remotelogin varchar(200) NULL, + remotepwd varchar(200) NULL, + charset varchar(20) NULL +); diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/init.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/init.sql new file mode 100644 index 0000000000..a8d7eb33b9 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/init.sql @@ -0,0 +1,18 @@ +insert into ST_AccessLevel(id, name) values ('U', 'User'); +insert into ST_AccessLevel(id, name) values ('A', 'Administrator'); +insert into ST_AccessLevel(id, name) values ('G', 'Guest'); +insert into ST_AccessLevel(id, name) values ('R', 'Removed'); +insert into ST_AccessLevel(id, name) values ('K', 'KMManager'); +insert into ST_AccessLevel(id, name) values ('D', 'DomainManager'); + +INSERT INTO ST_User (id, specificId, domainId, lastName, email, login, accessLevel, state, stateSaveDate) + VALUES (0, '0', 0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_EMAIL}', '${SILVERPEAS_ADMIN_LOGIN}', 'A', 'VALID', CURRENT_TIMESTAMP); + +insert into DomainSP_User(id, lastName, login, password, email) +values (0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_LOGIN}', '${SILVERPEAS_ADMIN_PASSWORD}', '${SILVERPEAS_ADMIN_EMAIL}'); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (-1, 'internal', 'Do not remove - Used by Silverpeas engine', '-', '-', '-', '0', ''); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (0, 'domainSilverpeas', 'default domain for Silverpeas', 'org.silverpeas.domains.domainSP', 'org.silverpeas.core.admin.domain.driver.SilverpeasDomainDriver', 'autDomainSP', '0', '${SERVER_URL}'); diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/047/init_production.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/047/init_production.sql new file mode 100644 index 0000000000..ce7beadd1c --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/047/init_production.sql @@ -0,0 +1,80 @@ +insert into calendarCategory(categoryId, name) values (1, 'Réunion') +; +insert into calendarCategory(categoryId, name) values (2, 'Déplacement') +; +insert into calendarCategory(categoryId, name) values (3, 'Vacances') +; +insert into calendarCategory(categoryId, name) values (4, 'Personnel') +; +insert into calendarCategory(categoryId, name) values (5, 'Brain Storming') +; +insert into calendarCategory(categoryId, name) values (6, 'Formation') +; + +insert into days("day") values ('01') +; +insert into days("day") values ('02') +; +insert into days("day") values ('03') +; +insert into days("day") values ('04') +; +insert into days("day") values ('05') +; +insert into days("day") values ('06') +; +insert into days("day") values ('07') +; +insert into days("day") values ('08') +; +insert into days("day") values ('09') +; +insert into days("day") values ('10') +; +insert into days("day") values ('11') +; +insert into days("day") values ('12') +; +insert into days("day") values ('13') +; +insert into days("day") values ('14') +; +insert into days("day") values ('15') +; +insert into days("day") values ('16') +; +insert into days("day") values ('17') +; +insert into days("day") values ('18') +; +insert into days("day") values ('19') +; +insert into days("day") values ('20') +; +insert into days("day") values ('21') +; +insert into days("day") values ('22') +; +insert into days("day") values ('23') +; +insert into days("day") values ('24') +; +insert into days("day") values ('25') +; +insert into days("day") values ('26') +; +insert into days("day") values ('27') +; +insert into days("day") values ('28') +; +insert into days("day") values ('29') +; +insert into days("day") values ('30') +; +insert into days("day") values ('31') +; + +insert into ST_FormDesigner_Connectors + (ID, NAME, DESCRIPTION, DRIVER, URL, LOGIN, PASSWD, SQLQUERY, TYPE) values + (0, '________', ' ', ' ', ' ', ' ', ' ', ' ', ' ') +; diff --git a/core-configuration/src/main/config/migrations/db/h2/busCore/up046/alter_table.sql b/core-configuration/src/main/config/migrations/db/h2/busCore/up046/alter_table.sql new file mode 100644 index 0000000000..809161ca0b --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/h2/busCore/up046/alter_table.sql @@ -0,0 +1,5 @@ +ALTER TABLE ST_Space +ADD COLUMN isCommunity SMALLINT DEFAULT(0) NOT NULL; + +ALTER TABLE ST_Group +ADD COLUMN spaceId VARCHAR(500) NULL; diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_constraint.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_constraint.sql new file mode 100644 index 0000000000..b8c413b830 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_constraint.sql @@ -0,0 +1,85 @@ +ALTER TABLE ST_AccessLevel WITH NOCHECK ADD CONSTRAINT PK_AccessLevel PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_AccessLevel ADD CONSTRAINT UN_AccessLevel_1 UNIQUE (name); + +ALTER TABLE ST_User WITH NOCHECK ADD CONSTRAINT PK_User PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_2 UNIQUE(login, domainId); +ALTER TABLE ST_User ADD CONSTRAINT FK_User_1 FOREIGN KEY (accessLevel) REFERENCES ST_AccessLevel(id); + +ALTER TABLE ST_Group WITH NOCHECK ADD CONSTRAINT PK_Group PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_2 UNIQUE(superGroupId, name, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT FK_Group_1 FOREIGN KEY (superGroupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_Group_User_Rel WITH NOCHECK ADD CONSTRAINT PK_Group_User_Rel PRIMARY KEY CLUSTERED(groupId, userId); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES ST_Group(id); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_Space WITH NOCHECK ADD CONSTRAINT PK_Space PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_Space ADD CONSTRAINT UN_Space_1 UNIQUE(domainFatherId, name); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_1 FOREIGN KEY (createdBy) REFERENCES ST_User(id); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_2 FOREIGN KEY (domainFatherId) REFERENCES ST_Space(id); + +ALTER TABLE ST_ComponentInstance WITH NOCHECK ADD CONSTRAINT PK_ComponentInstance PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT UN_ComponentInstance_1 UNIQUE(spaceId, name); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_2 FOREIGN KEY (createdBy) REFERENCES ST_User(id); + +ALTER TABLE ST_Instance_Data WITH NOCHECK ADD CONSTRAINT PK_Instance_Data PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT UN_Instance_Data_1 UNIQUE(componentId, name); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT FK_Instance_Data_1 FOREIGN KEY (componentId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole WITH NOCHECK ADD CONSTRAINT PK_UserRole PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_UserRole ADD CONSTRAINT UN_UserRole_1 UNIQUE(instanceId, roleName, isInherited, objectId, objectType); +ALTER TABLE ST_UserRole ADD CONSTRAINT FK_UserRole_1 FOREIGN KEY (instanceId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole_User_Rel WITH NOCHECK ADD CONSTRAINT PK_UserRole_User_Rel PRIMARY KEY CLUSTERED(userRoleId, userId); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_UserRole_Group_Rel WITH NOCHECK ADD CONSTRAINT PK_UserRole_Group_Rel PRIMARY KEY CLUSTERED(userRoleId, groupId); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_SpaceUserRole WITH NOCHECK ADD CONSTRAINT PK_SpaceUserRole PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT UN_SpaceUserRole_1 UNIQUE(spaceId, roleName, isInherited); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT FK_SpaceUserRole_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); + +ALTER TABLE ST_SpaceUserRole_User_Rel WITH NOCHECK ADD CONSTRAINT PK_SpaceUserRole_User_Rel PRIMARY KEY CLUSTERED(spaceUserRoleId, userId); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_SpaceUserRole_Group_Rel WITH NOCHECK ADD CONSTRAINT PK_SpaceUserRole_Group_Rel PRIMARY KEY CLUSTERED(spaceUserRoleId, groupId); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE DomainSP_Group WITH NOCHECK ADD CONSTRAINT PK_DomainSP_Group PRIMARY KEY CLUSTERED(id); +ALTER TABLE DomainSP_Group ADD CONSTRAINT UN_DomainSP_Group_1 UNIQUE(superGroupId, name); +ALTER TABLE DomainSP_Group ADD CONSTRAINT FK_DomainSP_Group_1 FOREIGN KEY (superGroupId) REFERENCES DomainSP_Group(id); + +ALTER TABLE DomainSP_User WITH NOCHECK ADD CONSTRAINT PK_DomainSP_User PRIMARY KEY CLUSTERED(id); +ALTER TABLE DomainSP_User ADD CONSTRAINT UN_DomainSP_User_1 UNIQUE(login); + +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES DomainSP_Group(id); +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES DomainSP_User(id); + +ALTER TABLE ST_Domain WITH NOCHECK ADD CONSTRAINT PK_ST_Domain PRIMARY KEY CLUSTERED(id); + +ALTER TABLE DomainSP_Group_User_Rel WITH NOCHECK ADD CONSTRAINT PK_DomainSP_Group_User_Rel PRIMARY KEY CLUSTERED(groupId,userId); + +ALTER TABLE ST_LongText WITH NOCHECK ADD CONSTRAINT PK_ST_LongText PRIMARY KEY CLUSTERED (id,orderNum); + +ALTER TABLE st_instance_modelused WITH NOCHECK ADD + CONSTRAINT PK_st_instance_modelused PRIMARY KEY CLUSTERED + ( + instanceId, + modelId, + objectId + ) +; + +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT PK_UserFavoriteSpaces PRIMARY KEY CLUSTERED(id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_1 FOREIGN KEY (userid) REFERENCES ST_User(id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_2 FOREIGN KEY (spaceid) REFERENCES ST_Space(id); + +ALTER TABLE SB_Contribution_Tracking ADD CONSTRAINT PK_CONTRIBUTION_TRACKING PRIMARY KEY (id); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_constraint_production.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_constraint_production.sql new file mode 100644 index 0000000000..5c397b092a --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_constraint_production.sql @@ -0,0 +1,96 @@ +ALTER TABLE UniqueId WITH NOCHECK ADD + CONSTRAINT PK_UniqueId PRIMARY KEY NONCLUSTERED + ( + tableName + ); + +ALTER TABLE Personalization WITH NOCHECK ADD + CONSTRAINT PK_Personalization PRIMARY KEY NONCLUSTERED + ( + id + ); + +ALTER TABLE readingControl WITH NOCHECK ADD + CONSTRAINT PK_readingControl PRIMARY KEY NONCLUSTERED + ( + pubId, actorId, space, componentName + ); + +ALTER TABLE model_contact WITH NOCHECK ADD + CONSTRAINT PK_model_contact PRIMARY KEY NONCLUSTERED + ( + id + ); + +ALTER TABLE model WITH NOCHECK ADD + CONSTRAINT PK_model PRIMARY KEY NONCLUSTERED + ( + id + ); + +ALTER TABLE calendarJournal WITH NOCHECK ADD + CONSTRAINT PK_CalendarJournal PRIMARY KEY NONCLUSTERED + ( + id + ); + +ALTER TABLE calendarCategory WITH NOCHECK ADD + CONSTRAINT PK_CalendarCategory PRIMARY KEY NONCLUSTERED + ( + categoryId + ); + +ALTER TABLE calendarJournalAttendee WITH NOCHECK ADD + CONSTRAINT PK_calendarJournalAttendee PRIMARY KEY NONCLUSTERED + ( + journalId, userId + ); + + +ALTER TABLE calendarJournalCategory WITH NOCHECK ADD + CONSTRAINT PK_calendarJournalCategory PRIMARY KEY NONCLUSTERED + ( + journalId, categoryId + ); + +ALTER TABLE calendarToDo WITH NOCHECK ADD + CONSTRAINT PK_calendarToDo PRIMARY KEY NONCLUSTERED + ( + id + ); + +ALTER TABLE calendarToDoAttendee WITH NOCHECK ADD + CONSTRAINT PK_calendarToDoAttendee PRIMARY KEY NONCLUSTERED + ( + todoId, userId + ); + +ALTER TABLE ST_FormDesigner_FormDesign WITH NOCHECK ADD + CONSTRAINT PK_ST_FormDesigner_FormDesign PRIMARY KEY NONCLUSTERED + ( + ID + ); + +ALTER TABLE ST_FormDesigner_Connectors WITH NOCHECK ADD + CONSTRAINT PK_ST_FormDesigner_Connectors PRIMARY KEY NONCLUSTERED + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEdited WITH NOCHECK ADD + CONSTRAINT PK_ST_FormEditor_FormEdited PRIMARY KEY NONCLUSTERED + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEditedData WITH NOCHECK ADD + CONSTRAINT PK_ST_FormEditor_FED PRIMARY KEY NONCLUSTERED + ( + ID + ); + +ALTER TABLE sb_agenda_import_settings WITH NOCHECK ADD + CONSTRAINT PK_sb_agenda_import_settings_SET PRIMARY KEY NONCLUSTERED + ( + userid + ); diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_index.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_index.sql new file mode 100644 index 0000000000..86821e71e5 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_index.sql @@ -0,0 +1,2 @@ +CREATE INDEX IDX_SB_CONTRIBUTION_TRACKING_CONTRIBUTION + ON SB_Contribution_Tracking (contrib_id, contrib_type, contrib_instanceId); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_index_production.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_index_production.sql new file mode 100644 index 0000000000..403e6ebc97 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_index_production.sql @@ -0,0 +1,2 @@ +CREATE INDEX IND_st_instance_modelused ON st_instance_modelused (instanceId,modelId) +; \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_table.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_table.sql new file mode 100644 index 0000000000..be6e51a2cf --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_table.sql @@ -0,0 +1,273 @@ +CREATE TABLE ST_AccessLevel +( + id char(1) NOT NULL, + name varchar(100) NOT NULL +); + +CREATE TABLE ST_User +( + id INT NOT NULL, + domainId INT NOT NULL, + specificId VARCHAR(500) NOT NULL, + firstName VARCHAR(100), + lastName VARCHAR(100) NOT NULL, + email VARCHAR(100), + login VARCHAR(100) NOT NULL, + loginMail VARCHAR(100), + accessLevel CHAR(1) NOT NULL DEFAULT 'U', + loginquestion VARCHAR(200), + loginanswer VARCHAR(200), + creationDate DATETIME, + saveDate DATETIME, + version INT DEFAULT 0 NOT NULL, + tosAcceptanceDate DATETIME, + lastLoginDate DATETIME, + nbSuccessfulLoginAttempts INT DEFAULT 0 NOT NULL, + lastLoginCredentialUpdateDate DATETIME, + expirationDate DATETIME, + state VARCHAR(30) NOT NULL, + stateSaveDate DATETIME NOT NULL, + notifManualReceiverLimit INT, + sensitiveData BIT DEFAULT 0 NOT NULL +); + +CREATE TABLE ST_Group +( + id int NOT NULL, + domainId int NOT NULL, + specificId varchar(500) NOT NULL, + spaceId varchar(500), + superGroupId int, + name varchar(100) NOT NULL, + description varchar(400), + synchroRule varchar(2000), + creationDate datetime, + saveDate datetime, + state varchar(30) NOT NULL, + stateSaveDate datetime NOT NULL +); + +CREATE TABLE ST_Group_User_Rel +( + groupId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_Space +( + id int NOT NULL, + domainFatherId int, + name varchar(100) NOT NULL, + description varchar(400), + createdBy int, + firstPageType int NOT NULL, + firstPageExtraParam varchar(400), + orderNum int NOT NULL DEFAULT(0), + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + spaceStatus char(1), + updatedBy int, + removedBy int, + lang char(2), + isInheritanceBlocked int NOT NULL default(0), + isCommunity bit DEFAULT(0) NOT NULL, + look varchar(50), + displaySpaceFirst int, + isPersonal int +); + +CREATE TABLE ST_SpaceI18N +( + id int NOT NULL, + spaceId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_ComponentInstance +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NOT NULL, + componentName varchar(100) NOT NULL, + description varchar(400), + createdBy int, + orderNum int NOT NULL DEFAULT(0), + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + componentStatus char(1), + updatedBy int, + removedBy int, + isPublic int NOT NULL DEFAULT(0), + isHidden int NOT NULL DEFAULT(0), + lang char(2), + isInheritanceBlocked int NOT NULL default(0) +); + +CREATE TABLE ST_ComponentInstanceI18N +( + id int NOT NULL, + componentId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_Instance_Data +( + id int NOT NULL, + componentId int NOT NULL, + name varchar(100) NOT NULL, + label varchar(100) NOT NULL, + value varchar(1000) +); + +CREATE TABLE ST_UserRole +( + id int NOT NULL, + instanceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int NOT NULL default(0), + objectId int, + objectType char(1) +); + +CREATE TABLE ST_UserRole_User_Rel +( + userRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_UserRole_Group_Rel +( + userRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int NOT NULL default(0) +); + +CREATE TABLE ST_SpaceUserRole_User_Rel +( + spaceUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole_Group_Rel +( + spaceUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE DomainSP_Group ( + id int NOT NULL, + superGroupId int NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL +); + +CREATE TABLE DomainSP_User ( + id int NOT NULL, + firstName varchar (100) NULL , + lastName varchar (100) NOT NULL , + phone varchar (20) NULL , + homePhone varchar (20) NULL , + cellPhone varchar (20) NULL , + fax varchar (20) NULL , + address varchar (500) NULL , + title varchar (100) NULL , + company varchar (100) NULL , + position varchar (100) NULL , + boss varchar (100) NULL , + login varchar (50) NOT NULL , + password varchar (123) NULL , + passwordValid char (1) NOT NULL DEFAULT ('Y'), + loginMail varchar (100) NULL , + email varchar (100) NULL +); + +CREATE TABLE DomainSP_Group_User_Rel ( + groupId int NOT NULL , + userId int NOT NULL +); + +CREATE TABLE ST_Domain ( + id int NOT NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL , + propFileName varchar (100) NOT NULL , + className varchar (100) NOT NULL , + authenticationServer varchar (100) NOT NULL , + theTimeStamp varchar (100) NOT NULL DEFAULT('0') , + silverpeasServerURL varchar (400) NULL +); + +CREATE TABLE ST_KeyStore ( + userKey decimal(18, 0) NOT NULL , + login varchar(100) NOT NULL , + domainId int NOT NULL +); + +CREATE TABLE ST_LongText ( + id int NOT NULL , + orderNum int NOT NULL , + bodyContent nvarchar(2000) NOT NULL +); + +CREATE TABLE ST_GroupUserRole +( + id int NOT NULL, + groupId int NOT NULL, + roleName varchar(100) NOT NULL +); + +CREATE TABLE ST_GroupUserRole_User_Rel +( + groupUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_GroupUserRole_Group_Rel +( + groupUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE st_instance_modelused +( + instanceId varchar(50) NOT NULL, + modelId varchar(50) NOT NULL, + objectId varchar(50) NOT NULL DEFAULT ('0') +) +; + +CREATE TABLE ST_UserFavoriteSpaces +( + id INT NOT NULL, + userid INT NOT NULL, + spaceid INT NOT NULL +); + +CREATE TABLE SB_Contribution_Tracking +( + id VARCHAR(40) NOT NULL, + context VARCHAR(255) DEFAULT '', + contrib_id VARCHAR(40) NOT NULL, + contrib_type VARCHAR(40) NOT NULL, + contrib_instanceId VARCHAR(50) NOT NULL, + action_type VARCHAR(20) NOT NULL, + action_date DATETIME2 NOT NULL, + action_by VARCHAR(50) NOT NULL +); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_table_production.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_table_production.sql new file mode 100644 index 0000000000..53024c9414 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/create_table_production.sql @@ -0,0 +1,168 @@ +CREATE TABLE UniqueId ( + maxId BIGINT NOT NULL , + tableName varchar(100) NOT NULL +); + +CREATE TABLE Personalization ( + id varchar(100) NOT NULL , + languages varchar(100) NULL, + zoneId varchar(100) NULL, + look varchar(50) NULL, + personalWSpace varchar(50) NULL, + thesaurusStatus int NOT NULL, + dragAndDropStatus int NOT NULL default 1, + webdavEditingStatus int NOT NULL default 0, + menuDisplay varchar(50) DEFAULT 'DEFAULT' +); + + +CREATE TABLE readingControl ( + pubId int NOT NULL , + actorId varchar(100) NOT NULL , + space varchar(50) NOT NULL , + componentName varchar(50) NOT NULL +); + +CREATE TABLE subscribe ( + subscriberId VARCHAR(100) NOT NULL, + subscriberType VARCHAR(50) NOT NULL, + subscriptionMethod VARCHAR(50) NOT NULL, + resourceId VARCHAR(100) NOT NULL, + resourceType VARCHAR(50) NOT NULL, + space VARCHAR(50) NOT NULL, + instanceId VARCHAR(50) NOT NULL, + creatorId VARCHAR(100) NOT NULL, + creationDate DATETIME NOT NULL +); + + +CREATE TABLE model_contact ( + id int NOT NULL , + name varchar(50) NOT NULL , + description varchar(50) NULL , + imageName varchar(50) NULL , + htmlDisplayer varchar(3000) NOT NULL , + htmlEditor varchar(3000) NOT NULL +); + + +CREATE TABLE model ( + id int NOT NULL , + name varchar(50) NOT NULL , + description varchar(100) NULL , + imageName varchar(100) NULL , + htmlDisplayer varchar(3500) NOT NULL , + htmlEditor varchar(3500) NOT NULL , + partId int NOT NULL default 1 +); + +CREATE TABLE calendarJournal ( + id int NOT NULL , + name varchar(2000) NOT NULL , + description varchar(4000) NULL , + delegatorId varchar(100) NOT NULL , + startDay varchar(50) NOT NULL , + endDay varchar(50) NULL , + startHour varchar(50) NULL , + endHour varchar(50) NULL , + classification varchar(20) NULL , + priority int NULL , + lastModification varchar(50) NULL, + externalid varchar(50) NULL +); + +CREATE TABLE calendarCategory ( + categoryId varchar(50) NOT NULL , + name varchar(50) NOT NULL +); + +CREATE TABLE calendarJournalAttendee ( + journalId int NOT NULL , + userId varchar(100) NOT NULL , + participationStatus varchar(50) NULL +); + +CREATE TABLE calendarJournalCategory ( + journalId int NOT NULL , + categoryId varchar(50) NOT NULL +); + +CREATE TABLE days ( + day varchar(50) NOT NULL +); + +CREATE TABLE calendarToDo ( + id int NOT NULL , + name varchar(2000) NOT NULL , + description varchar(4000) NULL , + delegatorId varchar(100) NOT NULL , + startDay varchar(50) NULL , + endDay varchar(50) NULL , + startHour varchar(50) NULL , + endHour varchar(50) NULL , + classification varchar(20) NULL , + priority int NULL , + lastModification varchar(50) NULL , + percentCompleted int NULL , + completedDay varchar(20) NULL , + duration int NULL , + componentId varchar(100) NULL , + spaceId varchar(100) NULL , + externalId varchar(100) NULL +); + + +CREATE TABLE calendarToDoAttendee ( + todoId int NOT NULL , + userId varchar(100) NOT NULL , + participationStatus varchar(50) NULL +); + +CREATE TABLE ST_FormDesigner_FormDesign ( + ID int NOT NULL , + REFIDFORM int NOT NULL , + COMPONENTID varchar(100) NOT NULL , + NAME varchar(1000) NOT NULL , + DESCRIPTION varchar(2000) NOT NULL , + CREATIONDATE varchar(10) NOT NULL , + AUTHOR int NOT NULL +); + +CREATE TABLE ST_FormDesigner_Connectors ( + ID int NOT NULL , + NAME varchar(1000) NOT NULL , + DESCRIPTION varchar(2000) NOT NULL, + DRIVER varchar(1000) NOT NULL, + URL varchar(1000) NOT NULL, + LOGIN varchar(1000) NOT NULL, + PASSWD varchar(1000) NULL, + SQLQUERY varchar(5000) NOT NULL, + TYPE varchar(50) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEdited ( + ID int NOT NULL , + FORMID int NOT NULL , + USERID int NOT NULL, + CREATEDATE varchar(10) NOT NULL, + MODIFYDATE varchar(10) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEditedData ( + ID int NOT NULL , + FORMEDITEDID int NOT NULL , + EDITEDKEY varchar(50) NOT NULL, + EDITEDVALUE varchar(500) NOT NULL +); + +CREATE TABLE sb_agenda_import_settings +( + userid int NOT NULL, + hostname varchar(500) NOT NULL, + synchrotype int NOT NULL, + synchrodelay int NOT NULL, + url varchar(500) NULL, + remotelogin varchar(200) NULL, + remotepwd varchar(200) NULL, + charset varchar(20) NULL +); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/init.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/init.sql new file mode 100644 index 0000000000..a8d7eb33b9 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/init.sql @@ -0,0 +1,18 @@ +insert into ST_AccessLevel(id, name) values ('U', 'User'); +insert into ST_AccessLevel(id, name) values ('A', 'Administrator'); +insert into ST_AccessLevel(id, name) values ('G', 'Guest'); +insert into ST_AccessLevel(id, name) values ('R', 'Removed'); +insert into ST_AccessLevel(id, name) values ('K', 'KMManager'); +insert into ST_AccessLevel(id, name) values ('D', 'DomainManager'); + +INSERT INTO ST_User (id, specificId, domainId, lastName, email, login, accessLevel, state, stateSaveDate) + VALUES (0, '0', 0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_EMAIL}', '${SILVERPEAS_ADMIN_LOGIN}', 'A', 'VALID', CURRENT_TIMESTAMP); + +insert into DomainSP_User(id, lastName, login, password, email) +values (0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_LOGIN}', '${SILVERPEAS_ADMIN_PASSWORD}', '${SILVERPEAS_ADMIN_EMAIL}'); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (-1, 'internal', 'Do not remove - Used by Silverpeas engine', '-', '-', '-', '0', ''); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (0, 'domainSilverpeas', 'default domain for Silverpeas', 'org.silverpeas.domains.domainSP', 'org.silverpeas.core.admin.domain.driver.SilverpeasDomainDriver', 'autDomainSP', '0', '${SERVER_URL}'); diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/047/init_production.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/init_production.sql new file mode 100644 index 0000000000..f6bf3c54c9 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/047/init_production.sql @@ -0,0 +1,80 @@ +insert into calendarCategory(categoryId, name) values (1, 'Réunion') +; +insert into calendarCategory(categoryId, name) values (2, 'Déplacement') +; +insert into calendarCategory(categoryId, name) values (3, 'Vacances') +; +insert into calendarCategory(categoryId, name) values (4, 'Personnel') +; +insert into calendarCategory(categoryId, name) values (5, 'Brain Storming') +; +insert into calendarCategory(categoryId, name) values (6, 'Formation') +; + +insert into days(day) values ('01') +; +insert into days(day) values ('02') +; +insert into days(day) values ('03') +; +insert into days(day) values ('04') +; +insert into days(day) values ('05') +; +insert into days(day) values ('06') +; +insert into days(day) values ('07') +; +insert into days(day) values ('08') +; +insert into days(day) values ('09') +; +insert into days(day) values ('10') +; +insert into days(day) values ('11') +; +insert into days(day) values ('12') +; +insert into days(day) values ('13') +; +insert into days(day) values ('14') +; +insert into days(day) values ('15') +; +insert into days(day) values ('16') +; +insert into days(day) values ('17') +; +insert into days(day) values ('18') +; +insert into days(day) values ('19') +; +insert into days(day) values ('20') +; +insert into days(day) values ('21') +; +insert into days(day) values ('22') +; +insert into days(day) values ('23') +; +insert into days(day) values ('24') +; +insert into days(day) values ('25') +; +insert into days(day) values ('26') +; +insert into days(day) values ('27') +; +insert into days(day) values ('28') +; +insert into days(day) values ('29') +; +insert into days(day) values ('30') +; +insert into days(day) values ('31') +; + +insert into ST_FormDesigner_Connectors + (ID, NAME, DESCRIPTION, DRIVER, URL, LOGIN, PASSWD, SQLQUERY, TYPE) values + (0, '________', ' ', ' ', ' ', ' ', ' ', ' ', '') +; diff --git a/core-configuration/src/main/config/migrations/db/mssql/busCore/up046/alter_table.sql b/core-configuration/src/main/config/migrations/db/mssql/busCore/up046/alter_table.sql new file mode 100644 index 0000000000..aa728feebc --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/mssql/busCore/up046/alter_table.sql @@ -0,0 +1,5 @@ +ALTER TABLE ST_Space +ADD isCommunity BIT DEFAULT(0) NOT NULL; + +ALTER TABLE ST_Group +ADD spaceId VARCHAR(500) NULL; diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_constraint.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_constraint.sql new file mode 100644 index 0000000000..e77797d31e --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_constraint.sql @@ -0,0 +1,85 @@ +ALTER TABLE ST_AccessLevel ADD CONSTRAINT PK_AccessLevel PRIMARY KEY (id); +ALTER TABLE ST_AccessLevel ADD CONSTRAINT UN_AccessLevel_1 UNIQUE (name); + +ALTER TABLE ST_User ADD CONSTRAINT PK_User PRIMARY KEY (id); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_2 UNIQUE(login, domainId); +ALTER TABLE ST_User ADD CONSTRAINT FK_User_1 FOREIGN KEY (accessLevel) REFERENCES ST_AccessLevel(id); + +ALTER TABLE ST_Group ADD CONSTRAINT PK_Group PRIMARY KEY (id); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_2 UNIQUE(superGroupId, name, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT FK_Group_1 FOREIGN KEY (superGroupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT PK_Group_User_Rel PRIMARY KEY (groupId, userId); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES ST_Group(id); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_Space ADD CONSTRAINT PK_Space PRIMARY KEY (id); +ALTER TABLE ST_Space ADD CONSTRAINT UN_Space_1 UNIQUE(domainFatherId, name); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_1 FOREIGN KEY (createdBy) REFERENCES ST_User(id); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_2 FOREIGN KEY (domainFatherId) REFERENCES ST_Space(id); + +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT PK_ComponentInstance PRIMARY KEY (id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT UN_ComponentInstance_1 UNIQUE(spaceId, name); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_2 FOREIGN KEY (createdBy) REFERENCES ST_User(id); + +ALTER TABLE ST_Instance_Data ADD CONSTRAINT PK_Instance_Data PRIMARY KEY (id); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT UN_Instance_Data_1 UNIQUE(componentId, name); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT FK_Instance_Data_1 FOREIGN KEY (componentId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole ADD CONSTRAINT PK_UserRole PRIMARY KEY (id); +ALTER TABLE ST_UserRole ADD CONSTRAINT UN_UserRole_1 UNIQUE(instanceId, roleName, isInherited, objectId, objectType); +ALTER TABLE ST_UserRole ADD CONSTRAINT FK_UserRole_1 FOREIGN KEY (instanceId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT PK_UserRole_User_Rel PRIMARY KEY (userRoleId, userId); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT PK_UserRole_Group_Rel PRIMARY KEY (userRoleId, groupId); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT PK_SpaceUserRole PRIMARY KEY (id); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT UN_SpaceUserRole_1 UNIQUE(spaceId, roleName, isInherited); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT FK_SpaceUserRole_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); + +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT PK_SpaceUserRole_User_Rel PRIMARY KEY (spaceUserRoleId, userId); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT PK_SpaceUserRole_Group_Rel PRIMARY KEY (spaceUserRoleId, groupId); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE DomainSP_Group ADD CONSTRAINT PK_DomainSP_Group PRIMARY KEY (id); +ALTER TABLE DomainSP_Group ADD CONSTRAINT UN_DomainSP_Group_1 UNIQUE(superGroupId, name); +ALTER TABLE DomainSP_Group ADD CONSTRAINT FK_DomainSP_Group_1 FOREIGN KEY (superGroupId) REFERENCES DomainSP_Group(id); + +ALTER TABLE DomainSP_User ADD CONSTRAINT PK_DomainSP_User PRIMARY KEY (id); +ALTER TABLE DomainSP_User ADD CONSTRAINT UN_DomainSP_User_1 UNIQUE(login); + +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES DomainSP_Group(id); +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES DomainSP_User(id); + +ALTER TABLE ST_Domain ADD CONSTRAINT PK_ST_Domain PRIMARY KEY (id); + +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT PK_DomainSP_Group_User_Rel PRIMARY KEY (groupId,userId); + +ALTER TABLE ST_LongText ADD CONSTRAINT PK_ST_LongText PRIMARY KEY (id,orderNum); + +ALTER TABLE st_instance_modelused +ADD CONSTRAINT PK_st_instance_modelused PRIMARY KEY + ( + instanceId, + modelId, + objectId + ) +; + +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT PK_UserFavoriteSpaces PRIMARY KEY (id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_1 FOREIGN KEY (userid) REFERENCES ST_User(id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_2 FOREIGN KEY (spaceid) REFERENCES ST_Space(id); + +ALTER TABLE SB_Contribution_Tracking ADD CONSTRAINT PK_CONTRIBUTION_TRACKING PRIMARY KEY (id); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_constraint_production.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_constraint_production.sql new file mode 100644 index 0000000000..8eb5bd60fb --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_constraint_production.sql @@ -0,0 +1,96 @@ +ALTER TABLE UniqueId ADD + CONSTRAINT PK_UniqueId PRIMARY KEY + ( + tableName + ); + +ALTER TABLE Personalization ADD + CONSTRAINT PK_Personalization PRIMARY KEY + ( + id + ); + +ALTER TABLE readingControl ADD + CONSTRAINT PK_readingControl PRIMARY KEY + ( + pubId, actorId, space, componentName + ); + +ALTER TABLE model_contact ADD + CONSTRAINT PK_model_contact PRIMARY KEY + ( + id + ); + +ALTER TABLE model ADD + CONSTRAINT PK_model PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarJournal ADD + CONSTRAINT PK_CalendarJournal PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarCategory ADD + CONSTRAINT PK_CalendarCategory PRIMARY KEY + ( + categoryId + ); + +ALTER TABLE calendarJournalAttendee ADD + CONSTRAINT PK_calendarJournalAttendee PRIMARY KEY + ( + journalId, userId + ); + + +ALTER TABLE calendarJournalCategory ADD + CONSTRAINT PK_calendarJournalCategory PRIMARY KEY + ( + journalId, categoryId + ); + +ALTER TABLE calendarToDo ADD + CONSTRAINT PK_calendarToDo PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarToDoAttendee ADD + CONSTRAINT PK_calendarToDoAttendee PRIMARY KEY + ( + todoId, userId + ); + +ALTER TABLE ST_FormDesigner_FormDesign ADD + CONSTRAINT PK_ST_FormDesigner_FormDesign PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormDesigner_Connectors ADD + CONSTRAINT PK_ST_FormDesigner_Connectors PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEdited ADD + CONSTRAINT PK_ST_FormEditor_FormEdited PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEditedData ADD + CONSTRAINT PK_ST_FormEditor_FED PRIMARY KEY + ( + ID + ); + +ALTER TABLE sb_agenda_import_settings ADD + CONSTRAINT PK_sb_agenda_import_settings PRIMARY KEY + ( + userid + ); diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_index.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_index.sql new file mode 100644 index 0000000000..16d1b348dd --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_index.sql @@ -0,0 +1,2 @@ +CREATE INDEX IDX_CONTRIBUTION_TRACKING + ON SB_Contribution_Tracking (contrib_id, contrib_type, contrib_instanceId); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_index_production.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_index_production.sql new file mode 100644 index 0000000000..403e6ebc97 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_index_production.sql @@ -0,0 +1,2 @@ +CREATE INDEX IND_st_instance_modelused ON st_instance_modelused (instanceId,modelId) +; \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_table.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_table.sql new file mode 100644 index 0000000000..b7e3ab1302 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_table.sql @@ -0,0 +1,274 @@ +CREATE TABLE ST_AccessLevel +( + id char(1) NOT NULL, + name varchar(100) NOT NULL +); + +CREATE TABLE ST_User +( + id INT NOT NULL, + domainId INT NOT NULL, + specificId VARCHAR(500) NOT NULL, + firstName VARCHAR(100), + lastName VARCHAR(100) NOT NULL, + email VARCHAR(100), + login VARCHAR(100) NOT NULL, + loginMail VARCHAR(100), + accessLevel CHAR(1) DEFAULT 'U' NOT NULL, + loginquestion VARCHAR(200), + loginanswer VARCHAR(200), + creationDate TIMESTAMP, + saveDate TIMESTAMP, + version INT DEFAULT 0 NOT NULL, + tosAcceptanceDate TIMESTAMP, + lastLoginDate TIMESTAMP, + nbSuccessfulLoginAttempts INT DEFAULT 0 NOT NULL, + lastLoginCredentialUpdateDate TIMESTAMP, + expirationDate TIMESTAMP, + state VARCHAR(30) NOT NULL, + stateSaveDate TIMESTAMP NOT NULL, + notifManualReceiverLimit INT, + sensitiveData INT DEFAULT 0 NOT NULL +); + +CREATE TABLE ST_Group +( + id int NOT NULL, + domainId int NOT NULL, + specificId varchar(500) NOT NULL, + spaceId varchar(500), + superGroupId int, + name varchar(100) NOT NULL, + description varchar(400), + synchroRule varchar(2000), + creationDate timestamp, + saveDate timestamp, + state varchar(30) NOT NULL, + stateSaveDate timestamp NOT NULL +); + +CREATE TABLE ST_Group_User_Rel +( + groupId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_Space +( + id int NOT NULL, + domainFatherId int, + name varchar(100) NOT NULL, + description varchar(400), + createdBy int, + firstPageType int NOT NULL, + firstPageExtraParam varchar(400), + orderNum int DEFAULT (0) NOT NULL, + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + spaceStatus char(1), + updatedBy int, + removedBy int, + lang char(2), + isInheritanceBlocked int DEFAULT(0) NOT NULL, + isCommunity int DEFAULT(0) NOT NULL, + look varchar(50), + displaySpaceFirst int, + isPersonal int +); + +CREATE TABLE ST_SpaceI18N +( + id int NOT NULL, + spaceId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_ComponentInstance +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NOT NULL, + componentName varchar(100) NOT NULL, + description varchar(400), + createdBy int, + orderNum int DEFAULT (0) NOT NULL, + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + componentStatus char(1), + updatedBy int, + removedBy int, + isPublic int DEFAULT(0) NOT NULL, + isHidden int DEFAULT(0) NOT NULL, + lang char(2), + isInheritanceBlocked int default(0) NOT NULL +); + +CREATE TABLE ST_ComponentInstanceI18N +( + id int NOT NULL, + componentId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_Instance_Data +( + id int NOT NULL, + componentId int NOT NULL, + name varchar(100) NOT NULL, + label varchar(100) NOT NULL, + value varchar(1000) +); + +CREATE TABLE ST_UserRole +( + id int NOT NULL, + instanceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int default(0) NOT NULL, + objectId int, + objectType char(1) +); + +CREATE TABLE ST_UserRole_User_Rel +( + userRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_UserRole_Group_Rel +( + userRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int default(0) NOT NULL +); + +CREATE TABLE ST_SpaceUserRole_User_Rel +( + spaceUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole_Group_Rel +( + spaceUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE DomainSP_Group ( + id int NOT NULL, + superGroupId int NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL +); + +CREATE TABLE DomainSP_User ( + id int NOT NULL, + firstName varchar (100) NULL , + lastName varchar (100) NOT NULL , + phone varchar (20) NULL , + homePhone varchar (20) NULL , + cellPhone varchar (20) NULL , + fax varchar (20) NULL , + address varchar (500) NULL , + title varchar (100) NULL , + company varchar (100) NULL , + position varchar (100) NULL , + boss varchar (100) NULL , + login varchar (50) NOT NULL , + password varchar (123) NULL , + passwordValid char (1) DEFAULT ('Y') NOT NULL , + loginMail varchar (100) NULL , + email varchar (100) NULL +); + +CREATE TABLE DomainSP_Group_User_Rel ( + groupId int NOT NULL , + userId int NOT NULL +); + +CREATE TABLE ST_Domain ( + id int NOT NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL , + propFileName varchar (100) NOT NULL , + className varchar (100) NOT NULL , + authenticationServer varchar (100) NOT NULL , + theTimeStamp varchar (100) DEFAULT('0') NOT NULL , + silverpeasServerURL varchar (400) NULL +); + +CREATE TABLE ST_KeyStore ( + userKey decimal(18, 0) NOT NULL , + login varchar(100) NOT NULL , + domainId int NOT NULL +); + + +CREATE TABLE ST_LongText ( + id int NOT NULL , + orderNum int NOT NULL , + bodyContent varchar(2000) NOT NULL +); + +CREATE TABLE ST_GroupUserRole +( + id int NOT NULL, + groupId int NOT NULL, + roleName varchar(100) NOT NULL +); + +CREATE TABLE ST_GroupUserRole_User_Rel +( + groupUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_GroupUserRole_Group_Rel +( + groupUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE st_instance_modelused +( + instanceId varchar(50) NOT NULL, + modelId varchar(50) NOT NULL, + objectId varchar(50) DEFAULT('0') NOT NULL +) +; + +CREATE TABLE ST_UserFavoriteSpaces +( + id int NOT NULL, + userid int NOT NULL, + spaceid int NOT NULL +); + +CREATE TABLE SB_Contribution_Tracking +( + id VARCHAR(40) NOT NULL, + context VARCHAR(255) DEFAULT '', + contrib_id VARCHAR(40) NOT NULL, + contrib_type VARCHAR(40) NOT NULL, + contrib_instanceId VARCHAR(50) NOT NULL, + action_type VARCHAR(20) NOT NULL, + action_date TIMESTAMP NOT NULL, + action_by VARCHAR(50) NOT NULL +); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_table_production.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_table_production.sql new file mode 100644 index 0000000000..c3a9b7f56b --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/create_table_production.sql @@ -0,0 +1,167 @@ +CREATE TABLE UniqueId ( + maxId NUMBER(19, 0) NOT NULL , + tableName varchar2(100) NOT NULL +); + +CREATE TABLE Personalization ( + id varchar2(100) NOT NULL , + languages varchar2(100) NULL, + zoneId varchar2(100) NULL, + look varchar2(50) NULL, + personalWSpace varchar2(50) NULL, + thesaurusStatus int NOT NULL, + dragAndDropStatus int default 1 NOT NULL, + webdavEditingStatus int default 0 NOT NULL, + menuDisplay varchar2(50) DEFAULT 'DEFAULT' +); + + +CREATE TABLE readingControl ( + pubId int NOT NULL , + actorId varchar2(100) NOT NULL , + space varchar2(50) NOT NULL , + componentName varchar2(50) NOT NULL +); + +CREATE TABLE subscribe ( + subscriberId VARCHAR2(100) NOT NULL, + subscriberType VARCHAR2(50) NOT NULL, + subscriptionMethod VARCHAR2(50) NOT NULL, + resourceId VARCHAR2(100) NOT NULL, + resourceType VARCHAR2(50) NOT NULL, + space VARCHAR2(50) NOT NULL, + instanceId VARCHAR2(50) NOT NULL, + creatorId VARCHAR2(100) NOT NULL, + creationDate TIMESTAMP NOT NULL +); + + +CREATE TABLE model_contact ( + id int NOT NULL , + name varchar2(50) NOT NULL , + description varchar2(50) NULL , + imageName varchar2(50) NULL , + htmlDisplayer varchar2(3000) NOT NULL , + htmlEditor varchar2(3000) NOT NULL +); + + +CREATE TABLE model ( + id int NOT NULL , + name varchar2(50) NOT NULL , + description varchar2(100) NULL , + imageName varchar2(100) NULL , + htmlDisplayer varchar2(3500) NOT NULL , + htmlEditor varchar2(3500) NOT NULL , + partId int default 1 NOT NULL +); + +CREATE TABLE calendarJournal ( + id int NOT NULL , + name varchar2(2000) NOT NULL , + description varchar2(4000) NULL , + delegatorId varchar2(100) NOT NULL , + startDay varchar2(50) NOT NULL , + endDay varchar2(50) NULL , + startHour varchar2(50) NULL , + endHour varchar2(50) NULL , + classification varchar2(20) NULL , + priority int NULL , + lastModification varchar2(50) NULL, + externalid varchar2(50) NULL +); + +CREATE TABLE calendarCategory ( + categoryId varchar2(50) NOT NULL , + name varchar2(50) NOT NULL +); + +CREATE TABLE calendarJournalAttendee ( + journalId int NOT NULL , + userId varchar2(100) NOT NULL , + participationStatus varchar2(50) NULL +); + +CREATE TABLE calendarJournalCategory ( + journalId int NOT NULL , + categoryId varchar2(50) NOT NULL +); + +CREATE TABLE days ( + day varchar2(50) NOT NULL +); + +CREATE TABLE calendarToDo ( + id int NOT NULL , + name varchar2(2000) NOT NULL , + description varchar2(4000) NULL , + delegatorId varchar2(100) NOT NULL , + startDay varchar2(50) NULL , + endDay varchar2(50) NULL , + startHour varchar2(50) NULL , + endHour varchar2(50) NULL , + classification varchar2(20) NULL , + priority int NULL , + lastModification varchar2(50) NULL , + percentCompleted int NULL , + completedDay varchar2(20) NULL , + duration int NULL , + componentId varchar2(100) NULL , + spaceId varchar2(100) NULL , + externalId varchar2(100) NULL +); + + +CREATE TABLE calendarToDoAttendee ( + todoId int NOT NULL , + userId varchar2(100) NOT NULL , + participationStatus varchar2(50) NULL +); + +CREATE TABLE ST_FormDesigner_FormDesign ( + ID int NOT NULL , + REFIDFORM int NOT NULL , + COMPONENTID varchar2(100) NOT NULL , + NAME varchar2(1000) NOT NULL , + DESCRIPTION varchar2(2000) NOT NULL , + CREATIONDATE varchar2(10) NOT NULL , + AUTHOR int NOT NULL +); + +CREATE TABLE ST_FormDesigner_Connectors ( + ID int NOT NULL , + NAME varchar2(1000) NOT NULL , + DESCRIPTION varchar2(2000) NOT NULL, + DRIVER varchar2(1000) NOT NULL, + URL varchar2(1000) NOT NULL, + LOGIN varchar2(1000) NOT NULL, + PASSWD varchar2(1000) NULL, + SQLQUERY varchar2(4000) NOT NULL, + TYPE varchar2(50) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEdited ( + ID int NOT NULL , + FORMID int NOT NULL , + USERID int NOT NULL, + CREATEDATE varchar2(10) NOT NULL, + MODIFYDATE varchar2(10) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEditedData ( + ID int NOT NULL , + FORMEDITEDID int NOT NULL , + EDITEDKEY varchar2(50) NOT NULL, + EDITEDVALUE varchar2(500) NOT NULL +); + +CREATE TABLE sb_agenda_import_settings ( + userid int NOT NULL, + hostname varchar2(500) NOT NULL, + synchrotype int NOT NULL, + synchrodelay int NOT NULL, + url varchar2(500) NULL, + remotelogin varchar2(200) NULL, + remotepwd varchar2(200) NULL, + charset varchar2(20) NULL +); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/init.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/init.sql new file mode 100644 index 0000000000..a8d7eb33b9 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/init.sql @@ -0,0 +1,18 @@ +insert into ST_AccessLevel(id, name) values ('U', 'User'); +insert into ST_AccessLevel(id, name) values ('A', 'Administrator'); +insert into ST_AccessLevel(id, name) values ('G', 'Guest'); +insert into ST_AccessLevel(id, name) values ('R', 'Removed'); +insert into ST_AccessLevel(id, name) values ('K', 'KMManager'); +insert into ST_AccessLevel(id, name) values ('D', 'DomainManager'); + +INSERT INTO ST_User (id, specificId, domainId, lastName, email, login, accessLevel, state, stateSaveDate) + VALUES (0, '0', 0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_EMAIL}', '${SILVERPEAS_ADMIN_LOGIN}', 'A', 'VALID', CURRENT_TIMESTAMP); + +insert into DomainSP_User(id, lastName, login, password, email) +values (0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_LOGIN}', '${SILVERPEAS_ADMIN_PASSWORD}', '${SILVERPEAS_ADMIN_EMAIL}'); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (-1, 'internal', 'Do not remove - Used by Silverpeas engine', '-', '-', '-', '0', ''); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (0, 'domainSilverpeas', 'default domain for Silverpeas', 'org.silverpeas.domains.domainSP', 'org.silverpeas.core.admin.domain.driver.SilverpeasDomainDriver', 'autDomainSP', '0', '${SERVER_URL}'); diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/047/init_production.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/init_production.sql new file mode 100644 index 0000000000..3bc70acd2e --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/047/init_production.sql @@ -0,0 +1,80 @@ +insert into calendarCategory(categoryId, name) values (1, 'Réunion') +; +insert into calendarCategory(categoryId, name) values (2, 'Déplacement') +; +insert into calendarCategory(categoryId, name) values (3, 'Vacances') +; +insert into calendarCategory(categoryId, name) values (4, 'Personnel') +; +insert into calendarCategory(categoryId, name) values (5, 'Brain Storming') +; +insert into calendarCategory(categoryId, name) values (6, 'Formation') +; + +insert into days(day) values ('01') +; +insert into days(day) values ('02') +; +insert into days(day) values ('03') +; +insert into days(day) values ('04') +; +insert into days(day) values ('05') +; +insert into days(day) values ('06') +; +insert into days(day) values ('07') +; +insert into days(day) values ('08') +; +insert into days(day) values ('09') +; +insert into days(day) values ('10') +; +insert into days(day) values ('11') +; +insert into days(day) values ('12') +; +insert into days(day) values ('13') +; +insert into days(day) values ('14') +; +insert into days(day) values ('15') +; +insert into days(day) values ('16') +; +insert into days(day) values ('17') +; +insert into days(day) values ('18') +; +insert into days(day) values ('19') +; +insert into days(day) values ('20') +; +insert into days(day) values ('21') +; +insert into days(day) values ('22') +; +insert into days(day) values ('23') +; +insert into days(day) values ('24') +; +insert into days(day) values ('25') +; +insert into days(day) values ('26') +; +insert into days(day) values ('27') +; +insert into days(day) values ('28') +; +insert into days(day) values ('29') +; +insert into days(day) values ('30') +; +insert into days(day) values ('31') +; + +insert into ST_FormDesigner_Connectors + (ID, NAME, DESCRIPTION, DRIVER, URL, LOGIN, PASSWD, SQLQUERY, TYPE) values + (0, '________', ' ', ' ', ' ', ' ', ' ', ' ', ' ') +; diff --git a/core-configuration/src/main/config/migrations/db/oracle/busCore/up046/alter_table.sql b/core-configuration/src/main/config/migrations/db/oracle/busCore/up046/alter_table.sql new file mode 100644 index 0000000000..b130564b70 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/oracle/busCore/up046/alter_table.sql @@ -0,0 +1,5 @@ +ALTER TABLE ST_Space +ADD isCommunity INT DEFAULT(0) NOT NULL; + +ALTER TABLE ST_Group +ADD spaceId VARCHAR(500) NULL; diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_constraint.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_constraint.sql new file mode 100644 index 0000000000..05cbb7060f --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_constraint.sql @@ -0,0 +1,85 @@ +ALTER TABLE ST_AccessLevel ADD CONSTRAINT PK_AccessLevel PRIMARY KEY (id); +ALTER TABLE ST_AccessLevel ADD CONSTRAINT UN_AccessLevel_1 UNIQUE (name); + +ALTER TABLE ST_User ADD CONSTRAINT PK_User PRIMARY KEY (id); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_User ADD CONSTRAINT UN_User_2 UNIQUE(login, domainId); +ALTER TABLE ST_User ADD CONSTRAINT FK_User_1 FOREIGN KEY(accessLevel) REFERENCES ST_AccessLevel(id); + +ALTER TABLE ST_Group ADD CONSTRAINT PK_Group PRIMARY KEY (id); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_1 UNIQUE(specificId, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT UN_Group_2 UNIQUE(superGroupId, name, domainId); +ALTER TABLE ST_Group ADD CONSTRAINT FK_Group_1 FOREIGN KEY (superGroupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT PK_Group_User_Rel PRIMARY KEY (groupId, userId); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES ST_Group(id); +ALTER TABLE ST_Group_User_Rel ADD CONSTRAINT FK_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_Space ADD CONSTRAINT PK_Space PRIMARY KEY (id); +ALTER TABLE ST_Space ADD CONSTRAINT UN_Space_1 UNIQUE(domainFatherId, name); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_1 FOREIGN KEY (createdBy) REFERENCES ST_User(id); +ALTER TABLE ST_Space ADD CONSTRAINT FK_Space_2 FOREIGN KEY (domainFatherId) REFERENCES ST_Space(id); + +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT PK_ComponentInstance PRIMARY KEY (id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT UN_ComponentInstance_1 UNIQUE(spaceId, name); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); +ALTER TABLE ST_ComponentInstance ADD CONSTRAINT FK_ComponentInstance_2 FOREIGN KEY (createdBy) REFERENCES ST_User(id); + +ALTER TABLE ST_Instance_Data ADD CONSTRAINT PK_Instance_Data PRIMARY KEY (id); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT UN_Instance_Data_1 UNIQUE(componentId, name); +ALTER TABLE ST_Instance_Data ADD CONSTRAINT FK_Instance_Data_1 FOREIGN KEY (componentId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole ADD CONSTRAINT PK_UserRole PRIMARY KEY (id); +ALTER TABLE ST_UserRole ADD CONSTRAINT UN_UserRole_1 UNIQUE(instanceId, roleName, isInherited, objectId); +ALTER TABLE ST_UserRole ADD CONSTRAINT FK_UserRole_1 FOREIGN KEY (instanceId) REFERENCES ST_ComponentInstance(id); + +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT PK_UserRole_User_Rel PRIMARY KEY (userRoleId, userId); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_User_Rel ADD CONSTRAINT FK_UserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT PK_UserRole_Group_Rel PRIMARY KEY (userRoleId, groupId); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_1 FOREIGN KEY (userRoleId) REFERENCES ST_UserRole(id); +ALTER TABLE ST_UserRole_Group_Rel ADD CONSTRAINT FK_UserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT PK_SpaceUserRole PRIMARY KEY (id); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT UN_SpaceUserRole_1 UNIQUE(spaceId, roleName, isInherited); +ALTER TABLE ST_SpaceUserRole ADD CONSTRAINT FK_SpaceUserRole_1 FOREIGN KEY (spaceId) REFERENCES ST_Space(id); + +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT PK_SpaceUserRole_User_Rel PRIMARY KEY (spaceUserRoleId, userId); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_User_Rel ADD CONSTRAINT FK_SpaceUserRole_User_Rel_2 FOREIGN KEY (userId) REFERENCES ST_User(id); + +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT PK_SpaceUserRole_Group_Rel PRIMARY KEY (spaceUserRoleId, groupId); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_1 FOREIGN KEY (spaceUserRoleId) REFERENCES ST_SpaceUserRole(id); +ALTER TABLE ST_SpaceUserRole_Group_Rel ADD CONSTRAINT FK_SpaceUserRole_Group_Rel_2 FOREIGN KEY (groupId) REFERENCES ST_Group(id); + +ALTER TABLE DomainSP_Group ADD CONSTRAINT PK_DomainSP_Group PRIMARY KEY (id); +ALTER TABLE DomainSP_Group ADD CONSTRAINT UN_DomainSP_Group_1 UNIQUE(superGroupId, name); +ALTER TABLE DomainSP_Group ADD CONSTRAINT FK_DomainSP_Group_1 FOREIGN KEY (superGroupId) REFERENCES DomainSP_Group(id); + +ALTER TABLE DomainSP_User ADD CONSTRAINT PK_DomainSP_User PRIMARY KEY (id); +ALTER TABLE DomainSP_User ADD CONSTRAINT UN_DomainSP_User_1 UNIQUE(login); + +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_1 FOREIGN KEY (groupId) REFERENCES DomainSP_Group(id); +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT FK_DomainSP_Group_User_Rel_2 FOREIGN KEY (userId) REFERENCES DomainSP_User(id); + +ALTER TABLE ST_Domain ADD CONSTRAINT PK_ST_Domain PRIMARY KEY (id); + +ALTER TABLE DomainSP_Group_User_Rel ADD CONSTRAINT PK_DomainSP_Group_User_Rel PRIMARY KEY (groupId,userId); + +ALTER TABLE ST_LongText ADD CONSTRAINT PK_ST_LongText PRIMARY KEY (id,orderNum); + +ALTER TABLE st_instance_modelused ADD + CONSTRAINT PK_st_instance_modelused PRIMARY KEY + ( + instanceId, + modelId, + objectId + ) +; + +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT PK_UserFavoriteSpaces PRIMARY KEY (id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_1 FOREIGN KEY (userid) REFERENCES ST_User(id); +ALTER TABLE ST_UserFavoriteSpaces ADD CONSTRAINT FK_UserFavoriteSpaces_2 FOREIGN KEY (spaceid) REFERENCES ST_Space(id); + +ALTER TABLE SB_Contribution_Tracking ADD CONSTRAINT PK_CONTRIBUTION_TRACKING PRIMARY KEY (id); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_constraint_production.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_constraint_production.sql new file mode 100644 index 0000000000..647c3598cb --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_constraint_production.sql @@ -0,0 +1,96 @@ +ALTER TABLE UniqueId ADD + CONSTRAINT PK_UniqueId PRIMARY KEY + ( + tableName + ); + +ALTER TABLE Personalization ADD + CONSTRAINT PK_Personalization PRIMARY KEY + ( + id + ); + +ALTER TABLE readingControl ADD + CONSTRAINT PK_readingControl PRIMARY KEY + ( + pubId, actorId, space, componentName + ); + +ALTER TABLE model_contact ADD + CONSTRAINT PK_model_contact PRIMARY KEY + ( + id + ); + +ALTER TABLE model ADD + CONSTRAINT PK_model PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarJournal ADD + CONSTRAINT PK_CalendarJournal PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarCategory ADD + CONSTRAINT PK_CalendarCategory PRIMARY KEY + ( + categoryId + ); + +ALTER TABLE calendarJournalAttendee ADD + CONSTRAINT PK_calendarJournalAttendee PRIMARY KEY + ( + journalId, userId + ); + + +ALTER TABLE calendarJournalCategory ADD + CONSTRAINT PK_calendarJournalCategory PRIMARY KEY + ( + journalId, categoryId + ); + +ALTER TABLE calendarToDo ADD + CONSTRAINT PK_calendarToDo PRIMARY KEY + ( + id + ); + +ALTER TABLE calendarToDoAttendee ADD + CONSTRAINT PK_calendarToDoAttendee PRIMARY KEY + ( + todoId, userId + ); + +ALTER TABLE ST_FormDesigner_FormDesign ADD + CONSTRAINT PK_ST_FormDesigner_FormDesign PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormDesigner_Connectors ADD + CONSTRAINT PK_ST_FormDesigner_Connectors PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEdited ADD + CONSTRAINT PK_ST_FormEditor_FormEdited PRIMARY KEY + ( + ID + ); + +ALTER TABLE ST_FormEditor_FormEditedData ADD + CONSTRAINT PK_ST_FormEditor_FED PRIMARY KEY + ( + ID + ); + +ALTER TABLE sb_agenda_import_settings ADD + CONSTRAINT PK_sb_agenda_import_settings_SET PRIMARY KEY + ( + userid + ); diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_index.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_index.sql new file mode 100644 index 0000000000..86821e71e5 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_index.sql @@ -0,0 +1,2 @@ +CREATE INDEX IDX_SB_CONTRIBUTION_TRACKING_CONTRIBUTION + ON SB_Contribution_Tracking (contrib_id, contrib_type, contrib_instanceId); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_index_production.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_index_production.sql new file mode 100644 index 0000000000..403e6ebc97 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_index_production.sql @@ -0,0 +1,2 @@ +CREATE INDEX IND_st_instance_modelused ON st_instance_modelused (instanceId,modelId) +; \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_table.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_table.sql new file mode 100644 index 0000000000..2db8955185 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_table.sql @@ -0,0 +1,274 @@ +CREATE TABLE ST_AccessLevel +( + id char(1) NOT NULL, + name varchar(100) NOT NULL +); + +CREATE TABLE ST_User +( + id INT NOT NULL, + domainId INT NOT NULL, + specificId VARCHAR(500) NOT NULL, + firstName VARCHAR(100), + lastName VARCHAR(100) NOT NULL, + email VARCHAR(100), + login VARCHAR(100) NOT NULL, + loginMail VARCHAR(100), + accessLevel CHAR(1) DEFAULT 'U' NOT NULL, + loginquestion VARCHAR(200), + loginanswer VARCHAR(200), + creationDate TIMESTAMP, + saveDate TIMESTAMP, + version INT DEFAULT 0 NOT NULL, + tosAcceptanceDate TIMESTAMP, + lastLoginDate TIMESTAMP, + nbSuccessfulLoginAttempts INT DEFAULT 0 NOT NULL, + lastLoginCredentialUpdateDate TIMESTAMP, + expirationDate TIMESTAMP, + state VARCHAR(30) NOT NULL, + stateSaveDate TIMESTAMP NOT NULL, + notifManualReceiverLimit INT, + sensitiveData BOOLEAN DEFAULT FALSE NOT NULL +); + +CREATE TABLE ST_Group +( + id int NOT NULL, + domainId int NOT NULL, + specificId varchar(500) NOT NULL, + spaceId varchar(500), + superGroupId int, + name varchar(100) NOT NULL, + description varchar(400), + synchroRule varchar(2000), + creationDate timestamp, + saveDate timestamp, + state varchar(30) NOT NULL, + stateSaveDate timestamp NOT NULL +); + +CREATE TABLE ST_Group_User_Rel +( + groupId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_Space +( + id int NOT NULL, + domainFatherId int, + name varchar(100) NOT NULL, + description varchar(400), + createdBy int, + firstPageType int NOT NULL, + firstPageExtraParam varchar(400), + orderNum int DEFAULT(0) NOT NULL, + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + spaceStatus char(1), + updatedBy int, + removedBy int, + lang char(2), + isInheritanceBlocked int DEFAULT(0) NOT NULL, + isCommunity smallint DEFAULT(0) NOT NULL, + look varchar(50), + displaySpaceFirst smallint, + isPersonal smallint +); + +CREATE TABLE ST_SpaceI18N +( + id int NOT NULL, + spaceId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_ComponentInstance +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NOT NULL, + componentName varchar(100) NOT NULL, + description varchar(400), + createdBy int, + orderNum int DEFAULT (0) NOT NULL, + createTime varchar(20), + updateTime varchar(20), + removeTime varchar(20), + componentStatus char(1), + updatedBy int, + removedBy int, + isPublic int DEFAULT(0) NOT NULL, + isHidden int DEFAULT(0) NOT NULL, + lang char(2), + isInheritanceBlocked int default(0) NOT NULL +); + +CREATE TABLE ST_ComponentInstanceI18N +( + id int NOT NULL, + componentId int NOT NULL, + lang char(2) NOT NULL, + name varchar(100) NOT NULL, + description varchar(400) +); + +CREATE TABLE ST_Instance_Data +( + id int NOT NULL, + componentId int NOT NULL, + name varchar(100) NOT NULL, + label varchar(100) NOT NULL, + value varchar(1000) +); + +CREATE TABLE ST_UserRole +( + id int NOT NULL, + instanceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int default(0) NOT NULL, + objectId int, + objectType varchar(50) +); + +CREATE TABLE ST_UserRole_User_Rel +( + userRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_UserRole_Group_Rel +( + userRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole +( + id int NOT NULL, + spaceId int NOT NULL, + name varchar(100) NULL, + roleName varchar(100) NOT NULL, + description varchar(400), + isInherited int default(0) NOT NULL +); + +CREATE TABLE ST_SpaceUserRole_User_Rel +( + spaceUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_SpaceUserRole_Group_Rel +( + spaceUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE DomainSP_Group ( + id int NOT NULL, + superGroupId int NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL +); + +CREATE TABLE DomainSP_User ( + id int NOT NULL, + firstName varchar (100) NULL , + lastName varchar (100) NOT NULL , + phone varchar (20) NULL , + homePhone varchar (20) NULL , + cellPhone varchar (20) NULL , + fax varchar (20) NULL , + address varchar (500) NULL , + title varchar (100) NULL , + company varchar (100) NULL , + position varchar (100) NULL , + boss varchar (100) NULL , + login varchar (50) NOT NULL , + password varchar (123) NULL , + passwordValid char (1) DEFAULT ('Y') NOT NULL , + loginMail varchar (100) NULL , + email varchar (100) NULL +); + +CREATE TABLE DomainSP_Group_User_Rel ( + groupId int NOT NULL , + userId int NOT NULL +); + +CREATE TABLE ST_Domain ( + id int NOT NULL , + name varchar (100) NOT NULL , + description varchar (400) NULL , + propFileName varchar (100) NOT NULL , + className varchar (100) NOT NULL , + authenticationServer varchar (100) NOT NULL , + theTimeStamp varchar (100) DEFAULT('0') NOT NULL , + silverpeasServerURL varchar (400) NULL +); + +CREATE TABLE ST_KeyStore ( + userKey decimal(18, 0) NOT NULL , + login varchar(100) NOT NULL , + domainId int NOT NULL +); + + +CREATE TABLE ST_LongText ( + id int NOT NULL , + orderNum int NOT NULL , + bodyContent varchar(2000) NOT NULL +); + +CREATE TABLE ST_GroupUserRole +( + id int NOT NULL, + groupId int NOT NULL, + roleName varchar(100) NOT NULL +); + +CREATE TABLE ST_GroupUserRole_User_Rel +( + groupUserRoleId int NOT NULL, + userId int NOT NULL +); + +CREATE TABLE ST_GroupUserRole_Group_Rel +( + groupUserRoleId int NOT NULL, + groupId int NOT NULL +); + +CREATE TABLE st_instance_modelused +( + instanceId varchar(50) NOT NULL, + modelId varchar(50) NOT NULL, + objectId varchar(50) DEFAULT('0') NOT NULL +) +; + +CREATE TABLE ST_UserFavoriteSpaces +( + id INT NOT NULL, + userid INT NOT NULL, + spaceid INT NOT NULL +); + +CREATE TABLE SB_Contribution_Tracking +( + id VARCHAR(40) NOT NULL, + context VARCHAR(255) DEFAULT '', + contrib_id VARCHAR(40) NOT NULL, + contrib_type VARCHAR(40) NOT NULL, + contrib_instanceId VARCHAR(50) NOT NULL, + action_type VARCHAR(20) NOT NULL, + action_date TIMESTAMP NOT NULL, + action_by VARCHAR(50) NOT NULL +); \ No newline at end of file diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_table_production.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_table_production.sql new file mode 100644 index 0000000000..0a8ba016b5 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/create_table_production.sql @@ -0,0 +1,167 @@ +CREATE TABLE UniqueId ( + maxId BIGINT NOT NULL, + tableName varchar(100) NOT NULL +); + +CREATE TABLE Personalization ( + id varchar(100) NOT NULL , + languages varchar(100) NULL, + zoneId varchar(100) NULL, + look varchar(50) NULL, + personalWSpace varchar(50) NULL, + thesaurusStatus int NOT NULL, + dragAndDropStatus int DEFAULT 1, + webdavEditingStatus int DEFAULT 0, + menuDisplay varchar(50) DEFAULT 'DEFAULT' +); + + +CREATE TABLE readingControl ( + pubId int NOT NULL , + actorId varchar(100) NOT NULL , + space varchar(50) NOT NULL , + componentName varchar(50) NOT NULL +); + +CREATE TABLE subscribe ( + subscriberId VARCHAR(100) NOT NULL, + subscriberType VARCHAR(50) NOT NULL, + subscriptionMethod VARCHAR(50) NOT NULL, + resourceId VARCHAR(100) NOT NULL, + resourceType VARCHAR(50) NOT NULL, + space VARCHAR(50) NOT NULL, + instanceId VARCHAR(50) NOT NULL, + creatorId VARCHAR(100) NOT NULL, + creationDate TIMESTAMP NOT NULL +); + +CREATE TABLE model_contact ( + id int NOT NULL , + name varchar(50) NOT NULL , + description varchar(50) NULL , + imageName varchar(50) NULL , + htmlDisplayer varchar(3000) NOT NULL , + htmlEditor varchar(3000) NOT NULL +); + + +CREATE TABLE model ( + id int NOT NULL , + name varchar(50) NOT NULL , + description varchar(100) NULL , + imageName varchar(100) NULL , + htmlDisplayer varchar(3500) NOT NULL , + htmlEditor varchar(3500) NOT NULL , + partId int default 1 NOT NULL +); + +CREATE TABLE calendarJournal ( + id int NOT NULL , + name varchar(2000) NOT NULL , + description varchar(4000) NULL , + delegatorId varchar(100) NOT NULL , + startDay varchar(50) NOT NULL , + endDay varchar(50) NULL , + startHour varchar(50) NULL , + endHour varchar(50) NULL , + classification varchar(20) NULL , + priority int NULL , + lastModification varchar(50) NULL, + externalid varchar(50) NULL +); + +CREATE TABLE calendarCategory ( + categoryId varchar(50) NOT NULL , + name varchar(50) NOT NULL +); + +CREATE TABLE calendarJournalAttendee ( + journalId int NOT NULL , + userId varchar(100) NOT NULL , + participationStatus varchar(50) NULL +); + +CREATE TABLE calendarJournalCategory ( + journalId int NOT NULL , + categoryId varchar(50) NOT NULL +); + +CREATE TABLE days ( + day varchar(50) NOT NULL +); + +CREATE TABLE calendarToDo ( + id int NOT NULL , + name varchar(2000) NOT NULL , + description varchar(4000) NULL , + delegatorId varchar(100) NOT NULL , + startDay varchar(50) NULL , + endDay varchar(50) NULL , + startHour varchar(50) NULL , + endHour varchar(50) NULL , + classification varchar(20) NULL , + priority int NULL , + lastModification varchar(50) NULL , + percentCompleted int NULL , + completedDay varchar(20) NULL , + duration int NULL , + componentId varchar(100) NULL , + spaceId varchar(100) NULL , + externalId varchar(100) NULL +); + + +CREATE TABLE calendarToDoAttendee ( + todoId int NOT NULL , + userId varchar(100) NOT NULL , + participationStatus varchar(50) NULL +); + +CREATE TABLE ST_FormDesigner_FormDesign ( + ID int NOT NULL , + REFIDFORM int NOT NULL , + COMPONENTID varchar(100) NOT NULL , + NAME varchar(1000) NOT NULL , + DESCRIPTION varchar(2000) NOT NULL , + CREATIONDATE varchar(10) NOT NULL , + AUTHOR int NOT NULL +); + +CREATE TABLE ST_FormDesigner_Connectors ( + ID int NOT NULL , + NAME varchar(1000) NOT NULL , + DESCRIPTION varchar(2000) NOT NULL, + DRIVER varchar(1000) NOT NULL, + URL varchar(1000) NOT NULL, + LOGIN varchar(1000) NOT NULL, + PASSWD varchar(1000) NULL, + SQLQUERY varchar(4000) NOT NULL, + TYPE varchar(50) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEdited ( + ID int NOT NULL , + FORMID int NOT NULL , + USERID int NOT NULL, + CREATEDATE varchar(10) NOT NULL, + MODIFYDATE varchar(10) NOT NULL +); + +CREATE TABLE ST_FormEditor_FormEditedData ( + ID int NOT NULL , + FORMEDITEDID int NOT NULL , + EDITEDKEY varchar(50) NOT NULL, + EDITEDVALUE varchar(500) NOT NULL +); + +CREATE TABLE sb_agenda_import_settings +( + userid int NOT NULL, + hostname varchar(500) NOT NULL, + synchrotype int NOT NULL, + synchrodelay int NOT NULL, + url varchar(500) NULL, + remotelogin varchar(200) NULL, + remotepwd varchar(200) NULL, + charset varchar(20) NULL +); diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/init.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/init.sql new file mode 100644 index 0000000000..a8d7eb33b9 --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/init.sql @@ -0,0 +1,18 @@ +insert into ST_AccessLevel(id, name) values ('U', 'User'); +insert into ST_AccessLevel(id, name) values ('A', 'Administrator'); +insert into ST_AccessLevel(id, name) values ('G', 'Guest'); +insert into ST_AccessLevel(id, name) values ('R', 'Removed'); +insert into ST_AccessLevel(id, name) values ('K', 'KMManager'); +insert into ST_AccessLevel(id, name) values ('D', 'DomainManager'); + +INSERT INTO ST_User (id, specificId, domainId, lastName, email, login, accessLevel, state, stateSaveDate) + VALUES (0, '0', 0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_EMAIL}', '${SILVERPEAS_ADMIN_LOGIN}', 'A', 'VALID', CURRENT_TIMESTAMP); + +insert into DomainSP_User(id, lastName, login, password, email) +values (0, '${SILVERPEAS_ADMIN_NAME}', '${SILVERPEAS_ADMIN_LOGIN}', '${SILVERPEAS_ADMIN_PASSWORD}', '${SILVERPEAS_ADMIN_EMAIL}'); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (-1, 'internal', 'Do not remove - Used by Silverpeas engine', '-', '-', '-', '0', ''); + +insert into ST_Domain(id, name, description, propFileName, className, authenticationServer, theTimeStamp, silverpeasServerURL) +values (0, 'domainSilverpeas', 'default domain for Silverpeas', 'org.silverpeas.domains.domainSP', 'org.silverpeas.core.admin.domain.driver.SilverpeasDomainDriver', 'autDomainSP', '0', '${SERVER_URL}'); diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/init_production.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/init_production.sql new file mode 100644 index 0000000000..3bc70acd2e --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/047/init_production.sql @@ -0,0 +1,80 @@ +insert into calendarCategory(categoryId, name) values (1, 'Réunion') +; +insert into calendarCategory(categoryId, name) values (2, 'Déplacement') +; +insert into calendarCategory(categoryId, name) values (3, 'Vacances') +; +insert into calendarCategory(categoryId, name) values (4, 'Personnel') +; +insert into calendarCategory(categoryId, name) values (5, 'Brain Storming') +; +insert into calendarCategory(categoryId, name) values (6, 'Formation') +; + +insert into days(day) values ('01') +; +insert into days(day) values ('02') +; +insert into days(day) values ('03') +; +insert into days(day) values ('04') +; +insert into days(day) values ('05') +; +insert into days(day) values ('06') +; +insert into days(day) values ('07') +; +insert into days(day) values ('08') +; +insert into days(day) values ('09') +; +insert into days(day) values ('10') +; +insert into days(day) values ('11') +; +insert into days(day) values ('12') +; +insert into days(day) values ('13') +; +insert into days(day) values ('14') +; +insert into days(day) values ('15') +; +insert into days(day) values ('16') +; +insert into days(day) values ('17') +; +insert into days(day) values ('18') +; +insert into days(day) values ('19') +; +insert into days(day) values ('20') +; +insert into days(day) values ('21') +; +insert into days(day) values ('22') +; +insert into days(day) values ('23') +; +insert into days(day) values ('24') +; +insert into days(day) values ('25') +; +insert into days(day) values ('26') +; +insert into days(day) values ('27') +; +insert into days(day) values ('28') +; +insert into days(day) values ('29') +; +insert into days(day) values ('30') +; +insert into days(day) values ('31') +; + +insert into ST_FormDesigner_Connectors + (ID, NAME, DESCRIPTION, DRIVER, URL, LOGIN, PASSWD, SQLQUERY, TYPE) values + (0, '________', ' ', ' ', ' ', ' ', ' ', ' ', ' ') +; diff --git a/core-configuration/src/main/config/migrations/db/postgresql/busCore/up046/alter_table.sql b/core-configuration/src/main/config/migrations/db/postgresql/busCore/up046/alter_table.sql new file mode 100644 index 0000000000..809161ca0b --- /dev/null +++ b/core-configuration/src/main/config/migrations/db/postgresql/busCore/up046/alter_table.sql @@ -0,0 +1,5 @@ +ALTER TABLE ST_Space +ADD COLUMN isCommunity SMALLINT DEFAULT(0) NOT NULL; + +ALTER TABLE ST_Group +ADD COLUMN spaceId VARCHAR(500) NULL; diff --git a/core-configuration/src/main/config/migrations/modules/busCore-migration.xml b/core-configuration/src/main/config/migrations/modules/busCore-migration.xml index bdf4c2c97b..17a39f850e 100644 --- a/core-configuration/src/main/config/migrations/modules/busCore-migration.xml +++ b/core-configuration/src/main/config/migrations/modules/busCore-migration.xml @@ -29,7 +29,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://silverpeas.org/xml/ns/migration https://www.silverpeas.org/xsd/migration.xsd"> - + + + +
+
+ + + + + + + + ${iconPanel} + ${silfn:escapeHtml(group.name)} + ${group.totalUsersCount} + + + + + +
+
+
@@ -378,7 +418,7 @@ out.println(window.printBefore()); - + @@ -403,7 +443,7 @@ out.println(window.printBefore()); diff --git a/core-war/src/main/webapp/jobDomainPeas/jsp/domainCreate.jsp b/core-war/src/main/webapp/jobDomainPeas/jsp/domainCreate.jsp index b5225ec5ae..91f10c4841 100644 --- a/core-war/src/main/webapp/jobDomainPeas/jsp/domainCreate.jsp +++ b/core-war/src/main/webapp/jobDomainPeas/jsp/domainCreate.jsp @@ -62,7 +62,7 @@ - + diff --git a/core-war/src/main/webapp/jobDomainPeas/jsp/domainNavigation.jsp b/core-war/src/main/webapp/jobDomainPeas/jsp/domainNavigation.jsp index b2300ccad6..08e2d23001 100644 --- a/core-war/src/main/webapp/jobDomainPeas/jsp/domainNavigation.jsp +++ b/core-war/src/main/webapp/jobDomainPeas/jsp/domainNavigation.jsp @@ -49,8 +49,10 @@ - - + + + + <%@ include file="check.jsp" %> @@ -97,15 +99,25 @@ - +
- + ${groupLabel} -  ${silfn:escapeHtml(group.name).concat(' (').concat(group.totalUsersCount).concat(')')} -
+  
+ + +
+
+
+ + ${groupLabel} +  
+
+
+
\ No newline at end of file diff --git a/core-war/src/main/webapp/jobDomainPeas/jsp/domainSQLCreate.jsp b/core-war/src/main/webapp/jobDomainPeas/jsp/domainSQLCreate.jsp index dcaf810b2a..a777c166ad 100644 --- a/core-war/src/main/webapp/jobDomainPeas/jsp/domainSQLCreate.jsp +++ b/core-war/src/main/webapp/jobDomainPeas/jsp/domainSQLCreate.jsp @@ -55,7 +55,7 @@ function SubmitWithVerif() { } else if (isWhitespace(urlfld)) { errorMsg = "<% out.print(resource.getString("JDP.silverpeasServerURL")); %>"; } else { - <% if (JobDomainSettings.usersInDomainQuotaActivated) { %> + <% if (JobDomainSettings.isUsersInDomainQuotaEnabled()) { %> var maxCount = stripInitialWhitespace(document.domainForm.userDomainQuotaMaxCount.value); if (isWhitespace(maxCount)) { errorMsg = "<% out.print(resource.getString("JDP.userDomainQuotaMaxCount")); %>"; @@ -102,7 +102,7 @@ out.println(board.printBefore());  " width="5" height="5"/> - <% if (JobDomainSettings.usersInDomainQuotaActivated) { %> + <% if (JobDomainSettings.isUsersInDomainQuotaEnabled()) { %> <%=resource.getString("JDP.userDomainQuotaMaxCount")%> : diff --git a/core-war/src/main/webapp/jobDomainPeas/jsp/groupContent.jsp b/core-war/src/main/webapp/jobDomainPeas/jsp/groupContent.jsp index 63959ea2a8..ac59edec55 100644 --- a/core-war/src/main/webapp/jobDomainPeas/jsp/groupContent.jsp +++ b/core-war/src/main/webapp/jobDomainPeas/jsp/groupContent.jsp @@ -81,7 +81,7 @@ if (groupsPath != null) { browseBar.setPath(groupsPath); } - if (isDomainRW) { + if (isDomainRW && !grObject.isCommunityGroup()) { if (!isGroupManager) { showTabs = true; // Group operations @@ -138,9 +138,11 @@ operationPane.addOperation(resource.getIcon("JDP.groupSynchro"), resource.getString("JDP.groupSynchro"), "javascript:doSynchronization()"); operationPane.addOperation(resource.getIcon("JDP.groupUnsynchro"), resource.getString("JDP.groupUnsynchro"), "groupUnSynchro?Idgroup=" + thisGroupId); } - operationPane.addLine(); + if (operationPane.nbOperations() > 0) { + operationPane.addLine(); + } operationPane.addOperation("useless", resource.getString("JDP.user.rights.action"), "groupViewRights"); - if (isRightCopyReplaceEnabled) { + if (isRightCopyReplaceEnabled && !grObject.isCommunityGroup()) { operationPane.addOperation("useless", resource.getString("JDP.rights.assign"), "javascript:assignSameRights()"); } if (onlySpaceManager) { @@ -174,7 +176,7 @@ const $dialog = jQuery('#deletionFormDialog'); $dialog.popup('confirmation', { callback : function() { - var $deletionForm = jQuery('#deletionForm'); + const $deletionForm = jQuery('#deletionForm'); if (jQuery('#definitiveDeletion')[0].checked) { $deletionForm.attr("action", "groupDelete"); } else { @@ -283,11 +285,11 @@ $(document).ready(function() { }); }); -var arrayBeforeAjaxRequest = function () { - if (${fn:length(subGroupList)} > 25) { - spProgressMessage.show(); - } -} + const arrayBeforeAjaxRequest = function () { + if (${fn:length(subGroupList)} > 25) { + spProgressMessage.show(); + } + }; @@ -342,6 +344,7 @@ if (showTabs) { + @@ -353,7 +356,7 @@ if (showTabs) {
@@ -383,6 +386,7 @@ if (showTabs) {

+
<% Map> bundleCache = new HashMap<>(UserState.values().length); for (UserState userState : UserState.values()) { @@ -393,7 +397,7 @@ if (showTabs) { %> - + @@ -403,7 +407,7 @@ if (showTabs) {
@@ -504,8 +508,9 @@ if (showTabs) { <%= JobDomainPeasSessionController.REPLACE_RIGHTS %> <% if (isRightCopyReplaceEnabled) { %> +
"> -
diff --git a/core-war/src/main/webapp/jobDomainPeas/jsp/userContent.jsp b/core-war/src/main/webapp/jobDomainPeas/jsp/userContent.jsp index 8958fa9328..f228eb391c 100644 --- a/core-war/src/main/webapp/jobDomainPeas/jsp/userContent.jsp +++ b/core-war/src/main/webapp/jobDomainPeas/jsp/userContent.jsp @@ -110,8 +110,6 @@ boolean isX509Enabled = (Boolean) request.getAttribute("isX509Enabled"); boolean isGroupManager = (Boolean) request.getAttribute("isOnlyGroupManager"); boolean onlySpaceManager = (Boolean) request.getAttribute("isOnlySpaceManager"); - boolean isUserManageableByGroupManager = - (Boolean) request.getAttribute("userManageableByGroupManager"); boolean isRightCopyReplaceEnabled = (Boolean) request.getAttribute("IsRightCopyReplaceEnabled"); String thisUserId = userObject.getId(); @@ -129,7 +127,7 @@ browseBar.setPath(groupsPath); } - if (isDomainRW && isUserRW && (!isGroupManager || isUserManageableByGroupManager)) { + if (isDomainRW && isUserRW && !isGroupManager) { if (isUserFull) { operationPane .addOperation(resource.getIcon("JDP.userUpdate"), resource.getString("GML.modify"), @@ -243,10 +241,10 @@ - + <% out.println(window.printBefore()); @@ -155,7 +156,7 @@ out.println(board.printBefore());  " width="5" height="5" border="0"> <%=resource.getString("JSPP.dataStorageQuotaHelp")%> <% } %> - <% if (isInHeritanceEnable && spaceId != null) { %> + <% if (isInheritanceEnable && spaceId != null) { %> <%=resource.getString("JSPP.inheritanceBlockedComponent") %> : diff --git a/core-war/src/main/webapp/jobStartPagePeas/jsp/startPageInfo.jsp b/core-war/src/main/webapp/jobStartPagePeas/jsp/startPageInfo.jsp index 9c1fc45e52..7e8c299818 100644 --- a/core-war/src/main/webapp/jobStartPagePeas/jsp/startPageInfo.jsp +++ b/core-war/src/main/webapp/jobStartPagePeas/jsp/startPageInfo.jsp @@ -54,14 +54,15 @@ + - + - + @@ -92,6 +93,9 @@ + + + @@ -116,6 +120,7 @@ + @@ -222,7 +227,9 @@ + + @@ -234,7 +241,7 @@ - + @@ -243,9 +250,9 @@ - + - + @@ -257,9 +264,14 @@ - - + + + + + @@ -292,16 +304,6 @@
- -
<%=space.getComponentSpaceQuotaReachedErrorMessage(resource.getLanguage())%>
-
-
- - -
<%=space.getDataStorageQuotaReachedErrorMessage(resource.getLanguage())%>
-
-
-
diff --git a/core-war/src/main/webapp/jobStartPagePeas/jsp/updateInstance.jsp b/core-war/src/main/webapp/jobStartPagePeas/jsp/updateInstance.jsp index 4323e9a112..f0ee374e3b 100644 --- a/core-war/src/main/webapp/jobStartPagePeas/jsp/updateInstance.jsp +++ b/core-war/src/main/webapp/jobStartPagePeas/jsp/updateInstance.jsp @@ -131,7 +131,7 @@ String m_JobPeas = (String) request.getAttribute("JobPeas"); AllComponentParameters parameters = (AllComponentParameters) request.getAttribute("Parameters"); List m_Profiles = (List) request.getAttribute("Profiles"); String translation = (String) request.getParameter("Translation"); -boolean isInHeritanceEnable = JobStartPagePeasSettings.isInheritanceEnable; +boolean isInHeritanceEnable = JobStartPagePeasSettings.IS_INHERITANCE_ENABLED; int scope = ((Integer) request.getAttribute("Scope")).intValue(); if (scope == JobStartPagePeasSessionController.SCOPE_FRONTOFFICE) { diff --git a/core-war/src/main/webapp/jobStartPagePeas/jsp/updateSpace.jsp b/core-war/src/main/webapp/jobStartPagePeas/jsp/updateSpace.jsp index a30de47e45..950c0ea083 100644 --- a/core-war/src/main/webapp/jobStartPagePeas/jsp/updateSpace.jsp +++ b/core-war/src/main/webapp/jobStartPagePeas/jsp/updateSpace.jsp @@ -24,7 +24,6 @@ --%> <%@page import="org.silverpeas.core.util.UnitUtil"%> -<%@ page import="org.silverpeas.core.util.memory.MemoryData" %> <%@ page import="org.silverpeas.core.util.memory.MemoryUnit" %> <%@ page import="org.silverpeas.core.i18n.I18NHelper" %> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> @@ -38,18 +37,19 @@ <% String translation = request.getParameter("Translation"); -boolean isInHeritanceEnable = JobStartPagePeasSettings.isInheritanceEnable; +boolean isInheritanceEnable = JobStartPagePeasSettings.IS_INHERITANCE_ENABLED + && (Boolean) request.getAttribute("inheritanceSupported"); boolean isUserAdmin = (Boolean) request.getAttribute("isUserAdmin"); // Component space quota -boolean isComponentSpaceQuotaActivated = isUserAdmin && JobStartPagePeasSettings.componentsInSpaceQuotaActivated; +boolean isComponentSpaceQuotaActivated = isUserAdmin && JobStartPagePeasSettings.COMPONENTS_IN_SPACE_QUOTA_ENABLED; String componentSpaceQuotaMaxCount = ""; if (isComponentSpaceQuotaActivated) { componentSpaceQuotaMaxCount = String.valueOf(space.getComponentSpaceQuota().getMaxCount()); } // Data storage quota -boolean isDataStorageQuotaActivated = isUserAdmin && JobStartPagePeasSettings.dataStorageInSpaceQuotaActivated; +boolean isDataStorageQuotaActivated = isUserAdmin && JobStartPagePeasSettings.DATA_STORAGE_IN_SPACE_QUOTA_ENABLED; String dataStorageQuotaMaxCount = ""; if (isDataStorageQuotaActivated) { dataStorageQuotaMaxCount = String.valueOf(UnitUtil.convertTo(space.getDataStorageQuota().getMaxCount(), @@ -78,59 +78,58 @@ function B_CANCEL_ONCLICK() { } function ifCorrectFormExecute(callback) { - var errorMsg = ""; - var errorNb = 0; + let errorMsg = ""; + let errorNb = 0; - var name = stripInitialWhitespace(document.infoSpace.NameObject.value); - var desc = document.infoSpace.Description; + const name = stripInitialWhitespace(document.infoSpace.NameObject.value); + const desc = document.infoSpace.Description; - if (isWhitespace(name)) { - errorMsg+=" - '<%=resource.getString("GML.name")%>' <%=resource.getString("MustContainsText")%>\n"; - errorNb++; - } - - var textAreaLength = 400; - var s = desc.value; - if (! (s.length <= textAreaLength)) { - errorMsg+=" - '<%=resource.getString("GML.description")%>' <%=resource.getString("ContainsTooLargeText")+"400 "+resource.getString("Characters")%>\n"; - errorNb++; - } + if (isWhitespace(name)) { + errorMsg += " - '<%=resource.getString("GML.name")%>' <%=resource.getString("MustContainsText")%>\n"; + errorNb++; + } - <% if (isComponentSpaceQuotaActivated) { %> - var componentSpaceQuota = document.infoSpace.ComponentSpaceQuota.value; - if (isWhitespace(componentSpaceQuota)) { - errorMsg += " - '<%=resource.getString("JSPP.componentSpaceQuotaMaxCount")%>' <%=resource.getString("MustContainsText")%>\n"; - errorNb++; - } - <% } %> + const textAreaLength = 400; + const s = desc.value; + if (!(s.length <= textAreaLength)) { + errorMsg += " - '<%=resource.getString("GML.description")%>' <%=resource.getString("ContainsTooLargeText")+"400 "+resource.getString("Characters")%>\n"; + errorNb++; + } - <% if (isDataStorageQuotaActivated) { %> - var dataStorageQuota = document.infoSpace.DataStorageQuota.value; - if (isWhitespace(dataStorageQuota)) { - errorMsg += " - '<%=resource.getString("JSPP.dataStorageQuota")%>' <%=resource.getString("MustContainsText")%>\n"; - errorNb++; - } - <% } %> + <% if (isComponentSpaceQuotaActivated) { %> + const componentSpaceQuota = document.infoSpace.ComponentSpaceQuota.value; + if (isWhitespace(componentSpaceQuota)) { + errorMsg += " - '<%=resource.getString("JSPP.componentSpaceQuotaMaxCount")%>' <%=resource.getString("MustContainsText")%>\n"; + errorNb++; + } + <% } %> - switch(errorNb) { - case 0 : - callback.call(this); - break; - case 1 : - errorMsg = "<%=resource.getString("ThisFormContains")%> 1 <%=resource.getString("GML.error")%> : \n" + errorMsg; - jQuery.popup.error(errorMsg); - break; - default : - errorMsg = "<%=resource.getString("ThisFormContains")%> " + errorNb + " <%=resource.getString("GML.errors")%> :\n" + errorMsg; - jQuery.popup.error(errorMsg); - } + <% if (isDataStorageQuotaActivated) { %> + const dataStorageQuota = document.infoSpace.DataStorageQuota.value; + if (isWhitespace(dataStorageQuota)) { + errorMsg += " - '<%=resource.getString("JSPP.dataStorageQuota")%>' <%=resource.getString("MustContainsText")%>\n"; + errorNb++; + } + <% } %> + + switch (errorNb) { + case 0 : + callback.call(this); + break; + case 1 : + errorMsg = "<%=resource.getString("ThisFormContains")%> 1 <%=resource.getString("GML.error")%> : \n" + errorMsg; + jQuery.popup.error(errorMsg); + break; + default : + errorMsg = "<%=resource.getString("ThisFormContains")%> " + errorNb + " <%=resource.getString("GML.errors")%> :\n" + errorMsg; + jQuery.popup.error(errorMsg); + } } <% String lang = ""; -Iterator codes = space.getTranslations().keySet().iterator(); -while (codes.hasNext()) { - lang = codes.next(); +for(String s: space.getTranslations().keySet()){ + lang = s; out.println("var name_"+lang+" = \""+WebEncodeHelper.javaStringToJsString(space.getName(lang))+"\";\n"); out.println("var desc_"+lang+" = \""+WebEncodeHelper.javaStringToJsString(space.getDescription(lang))+"\";\n"); } @@ -145,6 +144,7 @@ function removeTranslation() { document.infoSpace.submit(); } + @@ -153,32 +153,34 @@ function removeTranslation() { out.println(frame.printBefore()); out.println(board.printBefore()); %> - +
+ <%=I18NHelper.getFormLine(resource, space, translation)%> - + - + <% if (isComponentSpaceQuotaActivated) { %> - + <% } %> <% if (isDataStorageQuotaActivated) { %> - + <% } %> - <% if (isInHeritanceEnable && !space.isRoot()) { %> + <% if (isInheritanceEnable && !space.isRoot()) { %> - - + <% } %> - +
<%=resource.getString("GML.name")%> : " width="5" height="5" border="0"/> ${mandatory}" width="5" height="5"/>
<%=resource.getString("GML.description")%> :<%=resource.getString("GML.description")%> :
<%=resource.getString("JSPP.componentSpaceQuotaMaxCount")%> : " width="5" height="5" border="0"/> <%=resource.getString("JSPP.componentSpaceQuotaMaxCountHelp")%> ${mandatory}" width="5" height="5"/> <%=resource.getString("JSPP.componentSpaceQuotaMaxCountHelp")%>
<%=resource.getString("JSPP.dataStorageQuota")%> : " width="5" height="5" border="0"> <%=resource.getString("JSPP.dataStorageQuotaHelp")%> ${mandatory}" width="5" height="5"> <%=resource.getString("JSPP.dataStorageQuotaHelp")%>
<%=resource.getString("JSPP.inheritanceBlockedComponent") %> : + <%=resource.getString("JSPP.inheritanceBlockedComponent") %> : <% if (space.isInheritanceBlocked()) { %> <%=resource.getString("JSPP.inheritanceSpaceNotUsed")%>
<%=resource.getString("JSPP.inheritanceSpaceUsed")%> @@ -190,7 +192,7 @@ function removeTranslation() {
" width="5" height="5"/> : <%=resource.getString("GML.requiredField")%>${mandatory}" width="5" height="5"/> : <%=resource.getString("GML.requiredField")%>
<% diff --git a/core-war/src/main/webapp/jobStartPagePeas/jsp/welcome.jsp b/core-war/src/main/webapp/jobStartPagePeas/jsp/welcome.jsp index bc2d6b678c..6ee498a1a3 100644 --- a/core-war/src/main/webapp/jobStartPagePeas/jsp/welcome.jsp +++ b/core-war/src/main/webapp/jobStartPagePeas/jsp/welcome.jsp @@ -41,6 +41,7 @@ + @@ -50,7 +51,6 @@ <%=resource.getString("GML.popupTitle")%> @@ -69,36 +68,46 @@ function recoverRights() { - + + + + + + + + - + - + - + - + - + - + diff --git a/core-war/src/main/webapp/util/icons/create-action/add-community2.png b/core-war/src/main/webapp/util/icons/create-action/add-community2.png new file mode 100644 index 0000000000..eb77c932b7 Binary files /dev/null and b/core-war/src/main/webapp/util/icons/create-action/add-community2.png differ diff --git a/core-war/src/test/java/org/silverpeas/web/jobdomain/control/JobDomainPeasSessionControllerAccessGrantedTest.java b/core-war/src/test/java/org/silverpeas/web/jobdomain/control/JobDomainPeasSessionControllerAccessGrantedTest.java index c424da3a96..c21b3b3949 100644 --- a/core-war/src/test/java/org/silverpeas/web/jobdomain/control/JobDomainPeasSessionControllerAccessGrantedTest.java +++ b/core-war/src/test/java/org/silverpeas/web/jobdomain/control/JobDomainPeasSessionControllerAccessGrantedTest.java @@ -295,19 +295,6 @@ void simpleUserDomainAccessWhenSpaceManager() { assertForbidden(() -> controller.checkDomainAccessGranted(OTHER_DOMAIN_ID, false)); } - @DisplayName("User with user access level, without managed groups and community manager " + - "right, has granted access in read only mode") - @Test - void simpleUserDomainAccessWhenCommunityManager() { - controller.setCommunityManager(true); - controller.checkDomainAccessGranted(MIXED_DOMAIN_ID); - assertForbidden(() -> controller.checkDomainAccessGranted(MIXED_DOMAIN_ID, false)); - controller.checkDomainAccessGranted(LOGGED_USER_DOMAIN_ID); - assertForbidden(() -> controller.checkDomainAccessGranted(LOGGED_USER_DOMAIN_ID, false)); - assertForbidden(() -> controller.checkDomainAccessGranted(OTHER_DOMAIN_ID)); - assertForbidden(() -> controller.checkDomainAccessGranted(OTHER_DOMAIN_ID, false)); - } - /** * USER */ @@ -462,7 +449,6 @@ private static class JobDomainPeasSessionController4Test extends JobDomainPeasSe private static final long serialVersionUID = -2464677549792058075L; private final UserDetail loggedUser = mock(UserDetail.class); - private boolean communityManager = false; private String[] manageableSpaceIds = new String[]{}; private List manageableGroupIds = List.of(); private Domain targetDomain = null; @@ -483,10 +469,6 @@ private void setupDefaultLoggedUser() { when(loggedUser.getAccessLevel()).thenReturn(USER); } - public void setCommunityManager(final boolean communityManager) { - this.communityManager = communityManager; - } - public void setManageableSpaceIds(String... spaceIds) { manageableSpaceIds = spaceIds; } @@ -518,11 +500,6 @@ public Domain getTargetDomain() { return targetDomain; } - @Override - public boolean isCommunityManager() { - return communityManager; - } - @Override public UserDetail getUserDetail() { return loggedUser; diff --git a/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-domain-user-group.sql b/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-domain-user-group.sql index e9b93cc6fc..e1fe502f29 100644 --- a/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-domain-user-group.sql +++ b/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-domain-user-group.sql @@ -121,6 +121,7 @@ CREATE TABLE ST_Group ( id INT NOT NULL, domainId INT NOT NULL, specificId VARCHAR(500) NOT NULL, + spaceId VARCHAR(500), superGroupId INT, name VARCHAR(100) NOT NULL, description VARCHAR(400), diff --git a/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-space-component.sql b/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-space-component.sql index e56dd96137..a46579a2cb 100644 --- a/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-space-component.sql +++ b/core-web-test/src/main/resources/org/silverpeas/web/test/environment/create-table-space-component.sql @@ -24,7 +24,8 @@ CREATE TABLE ST_Space ( isInheritanceBlocked INT DEFAULT (0) NOT NULL, look VARCHAR(50), displaySpaceFirst SMALLINT, - isPersonal SMALLINT + isPersonal SMALLINT, + isCommunity SMALLINT DEFAULT(0) NOT NULL ); ALTER TABLE ST_Space ADD CONSTRAINT PK_Space PRIMARY KEY (id); ALTER TABLE ST_Space ADD CONSTRAINT UN_Space_1 UNIQUE(domainFatherId, name); diff --git a/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileEntity.java b/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileEntity.java index 185ddd3c33..5d7ca6321a 100644 --- a/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileEntity.java +++ b/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileEntity.java @@ -90,12 +90,15 @@ public static UserGroupProfileEntity[] fromGroups(final List gr private int userCount = -1; @XmlElement @NotNull @Size(min=1) private String domainName; + @XmlElement + private boolean isCommunity = false; private final GroupDetail group; private UserGroupProfileEntity(Group group) { this.group = (GroupDetail) group; this.domainName = GroupDetail.getOrganisationController().getDomain(group.getDomainId()).getName(); this.userCount = group.getTotalUsersCount(); + this.isCommunity = group.isCommunityGroup(); } @SuppressWarnings("unused") @@ -114,28 +117,6 @@ public UserGroupProfileEntity withAsUri(URI groupUri) { return this; } - /** - * Gets the URI of its parent group. - * - * @return the URI of its parent group or null if this group is a root one. - */ - public URI getParentUri() { - return parentUri; - } - - /** - * Gets the URI at which its direct children groups can be retrieved. - * - * @return the URI at which its subgroups can be get. - */ - public URI getChildrenUri() { - return childrenUri; - } - - public URI getUsersUri() { - return usersUri; - } - @Override @XmlElement public String getDescription() { @@ -246,6 +227,11 @@ public boolean isRoot() { return group.isRoot(); } + @Override + public boolean isCommunityGroup() { + return isCommunity; + } + @Override public String[] getUserIds() { return group.getUserIds(); @@ -279,4 +265,5 @@ public int hashCode() { public URI getURI() { return this.uri; } + } diff --git a/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileResource.java b/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileResource.java index 03a25d29d0..e42154c24f 100644 --- a/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileResource.java +++ b/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupProfileResource.java @@ -118,7 +118,7 @@ public Response getAllRootGroups(@QueryParam("ids") Set groupIds, criteriaBuilder.withDomainId(domainId).withName(name).withPaginationPage(fromPage(page)); SilverpeasList allGroups = - getOrganisationController().searchGroups(criteriaBuilder.build()); + getOrganisationController().searchGroups(criteriaBuilder.build(), true); UserGroupProfileEntity[] entities = asWebEntity(allGroups, locatedAt(getUri().getAbsolutePath())); return Response.ok(entities). @@ -196,7 +196,7 @@ public Response getGroupsInApplication(@PathParam("instanceId") String instanceI userStateFilter(criteriaBuilder, userStatesToExclude); SilverpeasList groups = - getOrganisationController().searchGroups(criteriaBuilder.build()); + getOrganisationController().searchGroups(criteriaBuilder.build(), true); URI groupsUri = getUri().getBaseUriBuilder().path(GROUPS_BASE_URI).build(); return Response.ok(asWebEntity(groups, locatedAt(groupsUri))). header(RESPONSE_HEADER_GROUPSIZE, groups.originalListSize()). @@ -268,7 +268,7 @@ public Response getSubGroups(@PathParam("path") String groups, @QueryParam("name userStateFilter(criteriaBuilder, userStatesToExclude); SilverpeasList subgroups = - getOrganisationController().searchGroups(criteriaBuilder.build()); + getOrganisationController().searchGroups(criteriaBuilder.build(), true); return Response.ok(asWebEntity(subgroups, locatedAt(getUri().getAbsolutePath()))). header(RESPONSE_HEADER_GROUPSIZE, subgroups.originalListSize()). header(RESPONSE_HEADER_ARRAYSIZE, subgroups.originalListSize()).build(); diff --git a/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupsSearchCriteriaBuilder.java b/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupsSearchCriteriaBuilder.java index c843fab19e..7e12caddb9 100644 --- a/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupsSearchCriteriaBuilder.java +++ b/core-web/src/main/java/org/silverpeas/core/webapi/profile/UserGroupsSearchCriteriaBuilder.java @@ -35,7 +35,7 @@ */ public class UserGroupsSearchCriteriaBuilder { - private GroupsSearchCriteria searchCriteria; + private final GroupsSearchCriteria searchCriteria; private String domainId = null; private boolean withMixedDomain = false;