diff --git a/src/main/java/org/olat/core/util/mail/_spring/mailContext.xml b/src/main/java/org/olat/core/util/mail/_spring/mailContext.xml index 6f5206bbcdaafe10587fd6f1f7d248bd92359275..0d3bfac8b41a355f80120eda87ff1eb4d428493b 100644 --- a/src/main/java/org/olat/core/util/mail/_spring/mailContext.xml +++ b/src/main/java/org/olat/core/util/mail/_spring/mailContext.xml @@ -74,6 +74,11 @@ <property name="mailModule" ref="mailModule"/> </bean> + <!-- Inbox in users Home --> + <bean id="mailBoxExtension" class="org.olat.core.util.mail.MailBoxExtension"> + <constructor-arg index="0" ref="userDeletionManager" /> + <property name="mailManager" ref="mailManager" /> + </bean> <!-- the email-parent-menu --> <bean class="org.olat.core.util.mail.ui.MailActionExtension" name="mailAEparent" init-method="initExtensionPoints"> diff --git a/src/main/java/org/olat/user/_spring/userContext.xml b/src/main/java/org/olat/user/_spring/userContext.xml index 6d3d5be18369e3b878ee9ee53479ba361b1c8209..26ac40d95a78a70e22742abb8c6465ec6d0bccb3 100644 --- a/src/main/java/org/olat/user/_spring/userContext.xml +++ b/src/main/java/org/olat/user/_spring/userContext.xml @@ -273,10 +273,4 @@ <constructor-arg ref="userDeletionManager"></constructor-arg> </bean> - <!-- Inbox in users Home --> - <bean id="mailBoxExtension" class="org.olat.user.MailBoxExtension"> - <constructor-arg index="0" ref="userDeletionManager" /> - <property name="mailManager" ref="mailManager" /> - </bean> - </beans> \ No newline at end of file diff --git a/src/main/resources/database/mysql/setupDatabase.sql b/src/main/resources/database/mysql/setupDatabase.sql index 66c49d9b213bcbc0eb3621d1bfcfb30c8a1e4194..2cb812dca6a11a2751c88c9dd9fddd48c1395d5b 100644 --- a/src/main/resources/database/mysql/setupDatabase.sql +++ b/src/main/resources/database/mysql/setupDatabase.sql @@ -191,6 +191,7 @@ create table if not exists o_user ( notification_interval varchar(16), presencemessagespublic bit, informsessiontimeout bit not null, + receiverealmail varchar(16), primary key (user_id) ); create table if not exists o_userproperty ( diff --git a/src/main/resources/database/postgresql/alter_7_1_x_to_7_1_1.sql b/src/main/resources/database/postgresql/alter_7_1_x_to_7_1_1.sql new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/main/resources/database/postgresql/alter_7_1_x_to_8_0_0.sql b/src/main/resources/database/postgresql/alter_7_1_x_to_8_0_0.sql new file mode 100644 index 0000000000000000000000000000000000000000..21c9e7e923f4e115922791dd4484d5c0b79b3df6 --- /dev/null +++ b/src/main/resources/database/postgresql/alter_7_1_x_to_8_0_0.sql @@ -0,0 +1,168 @@ +-- mail preferences +alter table o_user add column receiverealmail varchar(16); + + +create table o_mail ( + mail_id int8 not null, + meta_mail_id varchar(64), + creationdate timestamp, + lastmodified timestamp, + resname varchar(50), + resid int8, + ressubpath varchar(2048), + businesspath varchar(2048), + subject varchar(512), + body text, + fk_from_id int8, + primary key (mail_id) +); + +-- mail recipient +create table o_mail_to_recipient ( + pos int4 NOT NULL default 0, + fk_mail_id int8, + fk_recipient_id int8 +); + +create table o_mail_recipient ( + recipient_id int8 NOT NULL, + recipientvisible boolean, + deleted boolean, + mailread boolean, + mailmarked boolean, + email varchar(255), + recipientgroup varchar(255), + creationdate timestamp, + fk_recipient_id int8, + primary key (recipient_id) +); + +-- mail attachments +create table o_mail_attachment ( + attachment_id int8 NOT NULL, + creationdate timestamp, + datas bytea, + datas_size int8, + datas_name varchar(255), + mimetype varchar(255), + fk_att_mail_id int8, + primary key (attachment_id) +); + + +-- access control +alter table o_repositoryentry add column fk_tutorgroup int8; +alter table o_repositoryentry add column fk_participantgroup int8; +alter table o_repositoryentry add column membersonly boolean default false; +create index repo_members_only_idx on o_repositoryentry (membersonly); +alter table o_repositoryentry add constraint repo_tutor_sec_group_ctx foreign key (fk_tutorgroup) references o_bs_secgroup (id); +alter table o_repositoryentry add constraint repo_parti_sec_group_ctx foreign key (fk_participantgroup) references o_bs_secgroup (id); + + +-- access control +create table o_ac_offer ( + offer_id int8 NOT NULL, + creationdate timestamp, + lastmodified timestamp, + is_valid boolean default true, + validfrom timestamp, + validto timestamp, + version int4 not null, + resourceid int8, + resourcetypename varchar(255), + resourcedisplayname varchar(255), + token varchar(255), + price_amount DECIMAL, + price_currency_code VARCHAR(3), + offer_desc VARCHAR(2000), + fk_resource_id int8, + primary key (offer_id) +); +create table o_ac_method ( + method_id int8 NOT NULL, + access_method varchar(32), + version int4 not null, + creationdate timestamp, + lastmodified timestamp, + is_valid boolean default true, + is_enabled boolean default true, + validfrom timestamp, + validto timestamp, + primary key (method_id) +); +create table o_ac_offer_access ( + offer_method_id int8 NOT NULL, + version int4 not null, + creationdate timestamp, + is_valid boolean default true, + validfrom timestamp, + validto timestamp, + fk_offer_id int8, + fk_method_id int8, + primary key (offer_method_id) +); +-- access cart +create table o_ac_order ( + order_id int8 NOT NULL, + version int4 not null, + creationdate timestamp, + lastmodified timestamp, + is_valid boolean default true, + total_lines_amount DECIMAL, + total_lines_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), + discount_amount DECIMAL, + discount_currency_code VARCHAR(3), + order_status VARCHAR(32) default 'NEW', + fk_delivery_id int8, + primary key (order_id) +); +create table o_ac_order_part ( + order_part_id int8 NOT NULL, + version int4 not null, + pos int4, + creationdate timestamp, + total_lines_amount DECIMAL, + total_lines_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), + fk_order_id int8, + primary key (order_part_id) +); +create table o_ac_order_line ( + order_item_id int8 NOT NULL, + version int4 not null, + pos int4, + creationdate timestamp, + unit_price_amount DECIMAL, + unit_price_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), + fk_order_part_id int8, + fk_offer_id int8, + primary key (order_item_id) +); +create table o_ac_transaction ( + transaction_id int8 NOT NULL, + version int4 not null, + creationdate timestamp, + trx_status VARCHAR(32) default 'NEW', + amount_amount DECIMAL, + amount_currency_code VARCHAR(3), + fk_order_part_id int8, + fk_order_id int8, + fk_method_id int8, + primary key (transaction_id) +); + +create index ac_offer_to_resource_idx on o_ac_offer (fk_resource_id); +alter table o_ac_offer_access add constraint off_to_meth_meth_ctx foreign key (fk_method_id) references o_ac_method (method_id); +alter table o_ac_offer_access add constraint off_to_meth_off_ctx foreign key (fk_offer_id) references o_ac_offer (offer_id); +create index ac_order_to_delivery_idx on o_ac_order (fk_delivery_id); +alter table o_ac_order_part add constraint ord_part_ord_ctx foreign key (fk_order_id) references o_ac_order (order_id); +alter table o_ac_order_line add constraint ord_item_ord_part_ctx foreign key (fk_order_part_id) references o_ac_order_part (order_part_id); +alter table o_ac_order_line add constraint ord_item_offer_ctx foreign key (fk_offer_id) references o_ac_offer (offer_id); +alter table o_ac_transaction add constraint trans_ord_ctx foreign key (fk_order_id) references o_ac_order (order_id); +alter table o_ac_transaction add constraint trans_ord_part_ctx foreign key (fk_order_part_id) references o_ac_order_part (order_part_id); +alter table o_ac_transaction add constraint trans_method_ctx foreign key (fk_method_id) references o_ac_method (method_id); diff --git a/src/main/resources/database/postgresql/setupDatabase.sql b/src/main/resources/database/postgresql/setupDatabase.sql index 822815ac63f1b16ff86a4498cb2b5ee78ddb00ae..afd1c770f3bf7c3d335451e5c4cb672b19c0d776 100644 --- a/src/main/resources/database/postgresql/setupDatabase.sql +++ b/src/main/resources/database/postgresql/setupDatabase.sql @@ -187,6 +187,7 @@ create table o_user ( language varchar(30), fontsize varchar(10), notification_interval varchar(16), + receiverealmail varchar(16), presencemessagespublic bool, informsessiontimeout bool not null, primary key (user_id) @@ -288,9 +289,12 @@ create table o_repositoryentry ( resourcename varchar(100) not null, fk_olatresource int8 unique, fk_ownergroup int8 unique, + fk_tutorgroup int8, + fk_participantgroup int8, description text, initialauthor varchar(128) not null, accesscode int4 not null, + membersonly boolean default false, statuscode int4, canlaunch bool not null, candownload bool not null, @@ -517,7 +521,7 @@ create table o_ep_artefact ( collection_date timestamp, title varchar(512), description varchar(4000), - signature int8 default 0, + signature int4 default 0, businesspath varchar(2048), fulltextcontent text, reflexion text, @@ -622,6 +626,151 @@ create table o_tag ( primary key (tag_id) ); +create table o_mail ( + mail_id int8 not null, + meta_mail_id varchar(64), + creationdate timestamp, + lastmodified timestamp, + resname varchar(50), + resid int8, + ressubpath varchar(2048), + businesspath varchar(2048), + subject varchar(512), + body text, + fk_from_id int8, + primary key (mail_id) +); + +-- mail recipient +create table o_mail_to_recipient ( + pos int4 NOT NULL default 0, + fk_mail_id int8, + fk_recipient_id int8 +); + +create table o_mail_recipient ( + recipient_id int8 NOT NULL, + recipientvisible boolean, + deleted boolean, + mailread boolean, + mailmarked boolean, + email varchar(255), + recipientgroup varchar(255), + creationdate timestamp, + fk_recipient_id int8, + primary key (recipient_id) +); + +-- mail attachments +create table o_mail_attachment ( + attachment_id int8 NOT NULL, + creationdate timestamp, + datas bytea, + datas_size int8, + datas_name varchar(255), + mimetype varchar(255), + fk_att_mail_id int8, + primary key (attachment_id) +); + +-- access control +create table o_ac_offer ( + offer_id int8 NOT NULL, + creationdate timestamp, + lastmodified timestamp, + is_valid boolean default true, + validfrom timestamp, + validto timestamp, + version int4 not null, + resourceid int8, + resourcetypename varchar(255), + resourcedisplayname varchar(255), + token varchar(255), + price_amount DECIMAL, + price_currency_code VARCHAR(3), + offer_desc VARCHAR(2000), + fk_resource_id int8, + primary key (offer_id) +); +create table o_ac_method ( + method_id int8 NOT NULL, + access_method varchar(32), + version int4 not null, + creationdate timestamp, + lastmodified timestamp, + is_valid boolean default true, + is_enabled boolean default true, + validfrom timestamp, + validto timestamp, + primary key (method_id) +); +create table o_ac_offer_access ( + offer_method_id int8 NOT NULL, + version int4 not null, + creationdate timestamp, + is_valid boolean default true, + validfrom timestamp, + validto timestamp, + fk_offer_id int8, + fk_method_id int8, + primary key (offer_method_id) +); +-- access cart +create table o_ac_order ( + order_id int8 NOT NULL, + version int4 not null, + creationdate timestamp, + lastmodified timestamp, + is_valid boolean default true, + total_lines_amount DECIMAL, + total_lines_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), + discount_amount DECIMAL, + discount_currency_code VARCHAR(3), + order_status VARCHAR(32) default 'NEW', + fk_delivery_id int8, + primary key (order_id) +); +create table o_ac_order_part ( + order_part_id int8 NOT NULL, + version int4 not null, + pos int4, + creationdate timestamp, + total_lines_amount DECIMAL, + total_lines_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), + fk_order_id int8, + primary key (order_part_id) +); +create table o_ac_order_line ( + order_item_id int8 NOT NULL, + version int4 not null, + pos int4, + creationdate timestamp, + unit_price_amount DECIMAL, + unit_price_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), + fk_order_part_id int8, + fk_offer_id int8, + primary key (order_item_id) +); +create table o_ac_transaction ( + transaction_id int8 NOT NULL, + version int4 not null, + creationdate timestamp, + trx_status VARCHAR(32) default 'NEW', + amount_amount DECIMAL, + amount_currency_code VARCHAR(3), + fk_order_part_id int8, + fk_order_id int8, + fk_method_id int8, + primary key (transaction_id) +); + + create table o_stat_lastupdated ( lastupdated timestamp not null @@ -844,6 +993,9 @@ create index displayname_idx on o_repositoryentry (displayname); create index softkey_idx on o_repositoryentry (softkey); alter table o_repositoryentry add constraint FK2F9C439888C31018 foreign key (fk_olatresource) references o_olatresource; alter table o_repositoryentry add constraint FK2F9C4398A1FAC766 foreign key (fk_ownergroup) references o_bs_secgroup; +create index repo_members_only_idx on o_repositoryentry (membersonly); +alter table o_repositoryentry add constraint repo_tutor_sec_group_ctx foreign key (fk_tutorgroup) references o_bs_secgroup (id); +alter table o_repositoryentry add constraint repo_parti_sec_group_ctx foreign key (fk_participantgroup) references o_bs_secgroup (id); alter table o_bookmark add constraint FK68C4E30663219E27 foreign key (owner_id) references o_bs_identity; alter table o_bs_membership add constraint FK7B6288B45259603C foreign key (identity_id) references o_bs_identity; alter table o_bs_membership add constraint FK7B6288B4B85B522C foreign key (secgroup_id) references o_bs_secgroup; @@ -888,5 +1040,22 @@ alter table o_bs_invitation add constraint FKF26C8375236F27X foreign key (fk_sec alter table o_tag add constraint FK6491FCA5A4FA5DC foreign key (fk_author_id) references o_bs_identity (id); +alter table o_mail_to_recipient add constraint FKF86663165A4FA5DE foreign key (fk_mail_id) references o_mail (mail_id); +alter table o_mail_recipient add constraint FKF86663165A4FA5DG foreign key (fk_recipient_id) references o_bs_identity (id); +alter table o_mail add constraint FKF86663165A4FA5DC foreign key (fk_from_id) references o_mail_recipient (recipient_id); +alter table o_mail_to_recipient add constraint FKF86663165A4FA5DD foreign key (fk_recipient_id) references o_mail_recipient (recipient_id); +alter table o_mail_attachment add constraint FKF86663165A4FA5DF foreign key (fk_att_mail_id) references o_mail (mail_id); + +create index ac_offer_to_resource_idx on o_ac_offer (fk_resource_id); +alter table o_ac_offer_access add constraint off_to_meth_meth_ctx foreign key (fk_method_id) references o_ac_method (method_id); +alter table o_ac_offer_access add constraint off_to_meth_off_ctx foreign key (fk_offer_id) references o_ac_offer (offer_id); +create index ac_order_to_delivery_idx on o_ac_order (fk_delivery_id); +alter table o_ac_order_part add constraint ord_part_ord_ctx foreign key (fk_order_id) references o_ac_order (order_id); +alter table o_ac_order_line add constraint ord_item_ord_part_ctx foreign key (fk_order_part_id) references o_ac_order_part (order_part_id); +alter table o_ac_order_line add constraint ord_item_offer_ctx foreign key (fk_offer_id) references o_ac_offer (offer_id); +alter table o_ac_transaction add constraint trans_ord_ctx foreign key (fk_order_id) references o_ac_order (order_id); +alter table o_ac_transaction add constraint trans_ord_part_ctx foreign key (fk_order_part_id) references o_ac_order_part (order_part_id); +alter table o_ac_transaction add constraint trans_method_ctx foreign key (fk_method_id) references o_ac_method (method_id); + insert into hibernate_unique_key values ( 0 ); diff --git a/src/test/java/org/olat/test/OlatTestCase.java b/src/test/java/org/olat/test/OlatTestCase.java index 2b511aea6da4ded2e4d68d8530c4fdf9d0e4f496..978ab5850221c95653f797ce0752cfae4baee83b 100644 --- a/src/test/java/org/olat/test/OlatTestCase.java +++ b/src/test/java/org/olat/test/OlatTestCase.java @@ -30,6 +30,7 @@ import org.junit.Before; import org.olat.core.CoreSpringFactory; import org.olat.core.commons.persistence.OLATLocalSessionFactoryBean; import org.olat.core.helpers.Settings; +import org.olat.core.util.event.FrameworkStartupEventChannel; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.test.context.ContextConfiguration; @@ -84,6 +85,7 @@ public abstract class OlatTestCase extends AbstractJUnit4SpringContextTests { private boolean hsqlDBConfigured = false; private boolean postgresqlConfigured = false; + private static boolean started = false;; /** * If you like to disable a test method for some time just add the @@ -101,6 +103,10 @@ public abstract class OlatTestCase extends AbstractJUnit4SpringContextTests { } @Before public void printBanner(){ + if(started) return; + + FrameworkStartupEventChannel.fireEvent(); + OLATLocalSessionFactoryBean bean = (OLATLocalSessionFactoryBean)CoreSpringFactory.getBean(OLATLocalSessionFactoryBean.class); Configuration configuration = bean.getConfiguration(); @@ -117,6 +123,8 @@ public abstract class OlatTestCase extends AbstractJUnit4SpringContextTests { hsqlDBConfigured = connectionURL != null && connectionURL.toLowerCase().indexOf("hsqldb") > 0; postgresqlConfigured = connectionURL != null && connectionURL.toLowerCase().indexOf("postgres") > 0; + + System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); for (int i = 0; i < propsOfInterest.length; i++) { System.out.println("++" + propsOfInterest[i] + " -> "+properties.getProperty(propsOfInterest[i])); @@ -128,7 +136,7 @@ public abstract class OlatTestCase extends AbstractJUnit4SpringContextTests { System.out.println("+ OLAT configuration initialized, starting now with junit tests +"); System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); - + started = true; } @SuppressWarnings("unchecked") diff --git a/src/test/profile/cluster/tomcat-one/lib/olat.local.properties b/src/test/profile/cluster/tomcat-one/lib/olat.local.properties index 8d52e1860e5b2c9009fa688d0fc68a01efc1fc7b..5e4cac61cb8866d68a532497d241b7913ee91e25 100644 --- a/src/test/profile/cluster/tomcat-one/lib/olat.local.properties +++ b/src/test/profile/cluster/tomcat-one/lib/olat.local.properties @@ -17,6 +17,10 @@ db.show_sql=false instance.id=${test.env.instance.id} +history.back.enabled=false +history.resume.enabled=false +history.resume.enabled.default=none + generate.index.at.startup=false # for UserTest diff --git a/src/test/profile/cluster/tomcat-two/lib/olat.local.properties b/src/test/profile/cluster/tomcat-two/lib/olat.local.properties index e83abc460205cfa97303a1087e13a0d0af31f20b..a99922700e7967d7cbc714c42aeb6d5aec0a3af6 100644 --- a/src/test/profile/cluster/tomcat-two/lib/olat.local.properties +++ b/src/test/profile/cluster/tomcat-two/lib/olat.local.properties @@ -16,6 +16,10 @@ db.show_sql=false instance.id=${test.env.instance.id} +history.back.enabled=false +history.resume.enabled=false +history.resume.enabled.default=none + generate.index.at.startup=false # for UserTest diff --git a/src/test/resources/org/olat/search/service/document/file/test.doc b/src/test/resources/org/olat/search/service/document/file/test.doc new file mode 100644 index 0000000000000000000000000000000000000000..7511e47a7c49354834da4e371367ea0ffb5c65f6 Binary files /dev/null and b/src/test/resources/org/olat/search/service/document/file/test.doc differ diff --git a/src/test/resources/org/olat/search/service/document/file/test.html b/src/test/resources/org/olat/search/service/document/file/test.html new file mode 100644 index 0000000000000000000000000000000000000000..e1153f6bba59fe3fab57b9f5dbe23aabf955292b --- /dev/null +++ b/src/test/resources/org/olat/search/service/document/file/test.html @@ -0,0 +1,8 @@ +<html> + <head> + <title>Hello</title> + </head> + <body> + <h4>Hello</h4> + </body> +</html> \ No newline at end of file diff --git a/src/test/resources/org/olat/search/service/document/file/test2.DOC b/src/test/resources/org/olat/search/service/document/file/test2.DOC new file mode 100644 index 0000000000000000000000000000000000000000..7511e47a7c49354834da4e371367ea0ffb5c65f6 Binary files /dev/null and b/src/test/resources/org/olat/search/service/document/file/test2.DOC differ