diff --git a/config/alfresco/dbscripts/create/org.hibernate.dialect.Dialect/AlfrescoPostCreate-JBPM-FK-indexes.sql b/config/alfresco/dbscripts/create/org.hibernate.dialect.Dialect/AlfrescoPostCreate-JBPM-FK-indexes.sql
index c33e74115a..c559403afd 100644
--- a/config/alfresco/dbscripts/create/org.hibernate.dialect.Dialect/AlfrescoPostCreate-JBPM-FK-indexes.sql
+++ b/config/alfresco/dbscripts/create/org.hibernate.dialect.Dialect/AlfrescoPostCreate-JBPM-FK-indexes.sql
@@ -94,16 +94,3 @@ CREATE INDEX FK_VARINST_TKVARMP ON JBPM_VARIABLEINSTANCE (TOKENVARIABLEMAP_); --
CREATE INDEX FK_VARINST_TK ON JBPM_VARIABLEINSTANCE (TOKEN_); --(optional)
CREATE INDEX FK_BYTEINST_ARRAY ON JBPM_VARIABLEINSTANCE (BYTEARRAYVALUE_); --(optional)
CREATE INDEX FK_VAR_TSKINST ON JBPM_VARIABLEINSTANCE (TASKINSTANCE_); --(optional)
-
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.4-JBPM-FK-indexes';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V3.4-JBPM-FK-indexes', 'Manually executed script upgrade to add FK indexes for JBPM',
- 0, 4305, -1, 4306, null, 'UNKOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
diff --git a/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoCreate-SubscriptionTables.sql b/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoCreate-SubscriptionTables.sql
index 4f937c7ce4..0d95cc6bfc 100644
--- a/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoCreate-SubscriptionTables.sql
+++ b/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoCreate-SubscriptionTables.sql
@@ -15,15 +15,3 @@ CREATE TABLE alf_subscriptions
CONSTRAINT fk_alf_sub_user FOREIGN KEY (user_node_id) REFERENCES alf_node(id) ON DELETE CASCADE,
CONSTRAINT fk_alf_sub_node FOREIGN KEY (node_id) REFERENCES alf_node(id) ON DELETE CASCADE
) ENGINE=InnoDB;
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-SubscriptionTables';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-SubscriptionTables', 'Manually executed script upgrade V4.0: Subscription Tables',
- 0, 5010, -1, 5011, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
\ No newline at end of file
diff --git a/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-JBPM-FK-indexes.sql b/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-JBPM-FK-indexes.sql
index 3df4d6fd47..68f8345313 100644
--- a/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-JBPM-FK-indexes.sql
+++ b/config/alfresco/dbscripts/create/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-JBPM-FK-indexes.sql
@@ -8,15 +8,3 @@
--
-- do nothing for mysql
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.4-JBPM-FK-indexes';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V3.4-JBPM-FK-indexes', 'Manually executed script upgrade to add FK indexes for JBPM',
- 0, 4305, -1, 4306, null, 'UNKOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
diff --git a/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/AlfrescoCreate-SubscriptionTables.sql b/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/AlfrescoCreate-SubscriptionTables.sql
index 51adfd9209..43e5e949fb 100644
--- a/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/AlfrescoCreate-SubscriptionTables.sql
+++ b/config/alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/AlfrescoCreate-SubscriptionTables.sql
@@ -16,15 +16,3 @@ CREATE TABLE alf_subscriptions
CONSTRAINT fk_alf_sub_node FOREIGN KEY (node_id) REFERENCES alf_node(id) ON DELETE CASCADE
);
CREATE INDEX fk_alf_sub_node ON alf_subscriptions (node_id);
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-SubscriptionTables';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-SubscriptionTables', 'Manually executed script upgrade V4.0: Subscription Tables',
- 0, 5010, -1, 5011, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
diff --git a/config/alfresco/dbscripts/db-schema-context.xml b/config/alfresco/dbscripts/db-schema-context.xml
index 68f770b93c..224f8b9563 100644
--- a/config/alfresco/dbscripts/db-schema-context.xml
+++ b/config/alfresco/dbscripts/db-schema-context.xml
@@ -46,11 +46,6 @@
-
-
-
-
-
@@ -94,7 +89,6 @@
-
diff --git a/config/alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.Dialect/varchar-field-sizes-quadruple-increasing.sql b/config/alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.Dialect/varchar-field-sizes-quadruple-increasing.sql
deleted file mode 100644
index 29bd0ec2e6..0000000000
--- a/config/alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.Dialect/varchar-field-sizes-quadruple-increasing.sql
+++ /dev/null
@@ -1,21 +0,0 @@
---
--- Title: Increasing 'VARCHAR' field sizes quadruply for DB2 dialect
--- Database: Generic
--- Since: V3.4
--- Author: Dmitry Velichkevich
---
--- Please contact support@alfresco.com if you need assistance with the upgrade.
---
--- ALF-4300: DB2: Review schema (eg. VARCHAR columns) with respect to multi-byte support (when using DB2 / UTF-8)
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.4-VarcharFieldSizesQuadrupleIncreasing';
-INSERT INTO
- alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
-VALUES (
- 'patch.db-V3.4-VarcharFieldSizesQuadrupleIncreasing', 'Increasing VARCHAR field sizes quadruply for DB2 dialect V3.4',
- 0, 4303, -1, 4304, null, 'UNKOWN', ${TRUE}, ${TRUE}, 'Script completed'
-);
diff --git a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/AclChangeSet-Tracking.sql b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/AclChangeSet-Tracking.sql
deleted file mode 100644
index 7da3bc6583..0000000000
--- a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/AclChangeSet-Tracking.sql
+++ /dev/null
@@ -1,36 +0,0 @@
---
--- Title: Update ACL Change Set for Change Tracking
--- Database: MySQL
--- Since: V4.0 Schema 5008
--- Author: Derek Hulley
---
--- Please contact support@alfresco.com if you need assistance with the upgrade.
---
-
--- Rename redundant 'version' to indexed 'commit_time_ms'
-ALTER TABLE alf_acl_change_set
- CHANGE COLUMN version commit_time_ms BIGINT(20) NULL;
-
--- Fill with data
---FOREACH alf_acl_change_set.id system.upgrade.alf_acl_change_set.batchsize
-UPDATE alf_acl_change_set
- SET
- commit_time_ms = ${NOW} + id
- WHERE
- id >= ${LOWERBOUND} AND id <= ${UPPERBOUND}
-;
-
--- Add index on new data
-CREATE INDEX idx_alf_acs_ctms ON alf_acl_change_set (commit_time_ms);
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-AclChangeSet';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-AclChangeSet', 'Manually executed script upgrade V4.0: Update ACL Change Set for Change Tracking',
- 0, 5007, -1, 5008, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
\ No newline at end of file
diff --git a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/Node-Locale.sql b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/Node-Locale.sql
deleted file mode 100644
index b222e08e8a..0000000000
--- a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/Node-Locale.sql
+++ /dev/null
@@ -1,30 +0,0 @@
---
--- Title: Add 'locale_id' column to 'alf_node'
--- Database: MySQL
--- Since: V4.0 Schema 5010
--- Author: Derek Hulley
---
--- Please contact support@alfresco.com if you need assistance with the upgrade.
---
-
---ASSIGN:def_locale_id=id
-SELECT id FROM alf_locale WHERE locale_str = '.default';
-
--- Add the column, using a default to fill
-ALTER TABLE alf_node
- ADD COLUMN locale_id INT8 NOT NULL DEFAULT ${def_locale_id} AFTER type_qname_id,
- ADD KEY fk_alf_node_loc (locale_id),
- ADD CONSTRAINT fk_alf_node_loc FOREIGN KEY (locale_id) REFERENCES alf_locale (id)
-;
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-Node-Locale';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-Node-Locale', 'Manually executed script upgrade V4.0: Add locale_id column to alf_node',
- 0, 5009, -1, 5010, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
\ No newline at end of file
diff --git a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/NodeAssoc-Ordering.sql b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/NodeAssoc-Ordering.sql
deleted file mode 100644
index d37596e552..0000000000
--- a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.MySQLInnoDBDialect/NodeAssoc-Ordering.sql
+++ /dev/null
@@ -1,68 +0,0 @@
---
--- Title: Add 'assoc_index' column to 'alf_node_assoc'
--- Database: MySQL
--- Since: V4.0 Schema 5008
--- Author: Derek Hulley
---
--- Please contact support@alfresco.com if you need assistance with the upgrade.
---
-
--- Cut the original table to just the data
-ALTER TABLE alf_node_assoc
- DROP FOREIGN KEY fk_alf_nass_snode,
- DROP FOREIGN KEY fk_alf_nass_tnode,
- DROP FOREIGN KEY fk_alf_nass_tqn,
- DROP INDEX source_node_id,
- DROP INDEX fk_alf_nass_snode,
- DROP INDEX fk_alf_nass_tnode,
- DROP INDEX fk_alf_nass_tqn;
-ALTER TABLE alf_node_assoc
- RENAME TO t_alf_node_assoc;
-
--- So now it's just raw data
--- Reconstruct the table
-CREATE TABLE alf_node_assoc
-(
- id BIGINT NOT NULL AUTO_INCREMENT,
- version BIGINT NOT NULL,
- source_node_id BIGINT NOT NULL,
- target_node_id BIGINT NOT NULL,
- type_qname_id BIGINT NOT NULL,
- assoc_index BIGINT NOT NULL,
- PRIMARY KEY (id),
- UNIQUE KEY source_node_id (source_node_id, target_node_id, type_qname_id),
- KEY fk_alf_nass_snode (source_node_id, type_qname_id, assoc_index),
- KEY fk_alf_nass_tnode (target_node_id, type_qname_id),
- KEY fk_alf_nass_tqn (type_qname_id),
- CONSTRAINT fk_alf_nass_snode FOREIGN KEY (source_node_id) REFERENCES alf_node (id),
- CONSTRAINT fk_alf_nass_tnode FOREIGN KEY (target_node_id) REFERENCES alf_node (id),
- CONSTRAINT fk_alf_nass_tqn FOREIGN KEY (type_qname_id) REFERENCES alf_qname (id)
-) ENGINE=InnoDB;
-
--- Copy the data over
---FOREACH t_alf_node_assoc.id system.upgrade.alf_node_assoc.batchsize
-INSERT INTO alf_node_assoc
- (id, version, source_node_id, target_node_id, type_qname_id, assoc_index)
- (
- SELECT
- id, 1, source_node_id, target_node_id, type_qname_id, 1
- FROM
- t_alf_node_assoc
- WHERE
- id >= ${LOWERBOUND} AND id <= ${UPPERBOUND}
- );
-
--- Drop old data
-DROP TABLE t_alf_node_assoc;
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-NodeAssoc-Ordering';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-NodeAssoc-Ordering', 'Manually executed script upgrade V4.0: Add assoc_index column to alf_node_assoc',
- 0, 5008, -1, 5009, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
\ No newline at end of file
diff --git a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/AclChangeSet-Tracking.sql b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/AclChangeSet-Tracking.sql
deleted file mode 100644
index f55aedb476..0000000000
--- a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/AclChangeSet-Tracking.sql
+++ /dev/null
@@ -1,38 +0,0 @@
---
--- Title: Update ACL Change Set for Change Tracking
--- Database: PostgreSQL
--- Since: V4.0 Schema 5008
--- Author: Derek Hulley
---
--- Please contact support@alfresco.com if you need assistance with the upgrade.
---
-
--- Rename redundant 'version' to indexed 'commit_time_ms'
-ALTER TABLE alf_acl_change_set
- RENAME "version" TO commit_time_ms;
-ALTER TABLE alf_acl_change_set
- ALTER COLUMN commit_time_ms DROP NOT NULL;
-
--- Fill with data
---FOREACH alf_acl_change_set.id system.upgrade.alf_acl_change_set.batchsize
-UPDATE alf_acl_change_set
- SET
- commit_time_ms = ${NOW} + id
- WHERE
- id >= ${LOWERBOUND} AND id <= ${UPPERBOUND}
-;
-
--- Add index on new data
-CREATE INDEX idx_alf_acs_ctms ON alf_acl_change_set (commit_time_ms);
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-AclChangeSet';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-AclChangeSet', 'Manually executed script upgrade V4.0: Update ACL Change Set for Change Tracking',
- 0, 5007, -1, 5008, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
\ No newline at end of file
diff --git a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/Node-Locale.sql b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/Node-Locale.sql
deleted file mode 100644
index a617442cd1..0000000000
--- a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/Node-Locale.sql
+++ /dev/null
@@ -1,32 +0,0 @@
---
--- Title: Add 'locale_id' column to 'alf_node'
--- Database: PostgreSQL
--- Since: V4.0 Schema 5010
--- Author: Derek Hulley
---
--- Please contact support@alfresco.com if you need assistance with the upgrade.
---
-
---ASSIGN:def_locale_id=id
-SELECT id FROM alf_locale WHERE locale_str = '.default';
-
--- Add the column, using a default to fill
-ALTER TABLE alf_node
- ADD COLUMN locale_id INT8 NOT NULL DEFAULT ${def_locale_id}
-;
-ALTER TABLE alf_node
- ADD CONSTRAINT fk_alf_node_loc FOREIGN KEY (locale_id) REFERENCES alf_locale (id)
-;
-CREATE INDEX fk_alf_node_loc ON alf_node (locale_id);
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-Node-Locale';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-Node-Locale', 'Manually executed script upgrade V4.0: Add locale_id column to alf_node',
- 0, 5009, -1, 5010, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
\ No newline at end of file
diff --git a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/NodeAssoc-Ordering.sql b/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/NodeAssoc-Ordering.sql
deleted file mode 100644
index a533ebde41..0000000000
--- a/config/alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/NodeAssoc-Ordering.sql
+++ /dev/null
@@ -1,70 +0,0 @@
---
--- Title: Add 'assoc_index' column to 'alf_node_assoc'
--- Database: PostgreSQL
--- Since: V4.0 Schema 5008
--- Author: Derek Hulley
---
--- Please contact support@alfresco.com if you need assistance with the upgrade.
---
-
--- Cut the original table to just the data
-DROP INDEX source_node_id; --(optional)
-DROP INDEX alf_node_assoc_source_node_id_key; --(optional)
-DROP INDEX fk_alf_nass_snode;
-DROP INDEX fk_alf_nass_tnode;
-DROP INDEX fk_alf_nass_tqn;
-ALTER TABLE alf_node_assoc
- DROP CONSTRAINT fk_alf_nass_snode;
-ALTER TABLE alf_node_assoc
- DROP CONSTRAINT fk_alf_nass_tnode;
-ALTER TABLE alf_node_assoc
- DROP CONSTRAINT fk_alf_nass_tqn;
-ALTER TABLE alf_node_assoc RENAME TO t_alf_node_assoc;
-
--- So now it's just raw data
--- Reconstruct the table (leave the sequence as is)
-CREATE TABLE alf_node_assoc
-(
- id INT8 NOT NULL,
- version INT8 NOT NULL,
- source_node_id INT8 NOT NULL,
- target_node_id INT8 NOT NULL,
- type_qname_id INT8 NOT NULL,
- assoc_index INT8 NOT NULL,
- PRIMARY KEY (id),
- CONSTRAINT fk_alf_nass_snode FOREIGN KEY (source_node_id) REFERENCES alf_node (id),
- CONSTRAINT fk_alf_nass_tnode FOREIGN KEY (target_node_id) REFERENCES alf_node (id),
- CONSTRAINT fk_alf_nass_tqn FOREIGN KEY (type_qname_id) REFERENCES alf_qname (id)
-);
-CREATE UNIQUE INDEX source_node_id ON alf_node_assoc (source_node_id, target_node_id, type_qname_id);
-CREATE INDEX fk_alf_nass_snode ON alf_node_assoc (source_node_id, type_qname_id, assoc_index);
-CREATE INDEX fk_alf_nass_tnode ON alf_node_assoc (target_node_id, type_qname_id);
-CREATE INDEX fk_alf_nass_tqn ON alf_node_assoc (type_qname_id);
-
--- Copy the data over
---FOREACH t_alf_node_assoc.id system.upgrade.alf_node_assoc.batchsize
-INSERT INTO alf_node_assoc
- (id, version, source_node_id, target_node_id, type_qname_id, assoc_index)
- (
- SELECT
- id, 1, source_node_id, target_node_id, type_qname_id, 1
- FROM
- t_alf_node_assoc
- WHERE
- id >= ${LOWERBOUND} AND id <= ${UPPERBOUND}
- );
-
--- Drop old data
-DROP TABLE t_alf_node_assoc;
-
---
--- Record script finish
---
-DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-NodeAssoc-Ordering';
-INSERT INTO alf_applied_patch
- (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
- VALUES
- (
- 'patch.db-V4.0-NodeAssoc-Ordering', 'Manually executed script upgrade V4.0: Add assoc_index column to alf_node_assoc',
- 0, 5008, -1, 5009, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
- );
\ No newline at end of file
diff --git a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/patch-common-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/patch-common-SqlMap.xml
index 28bda761f7..40d9ba6f59 100644
--- a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/patch-common-SqlMap.xml
+++ b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/patch-common-SqlMap.xml
@@ -8,68 +8,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -84,25 +27,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -161,138 +90,6 @@
np.string_value like #{namePattern}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- classpath:alfresco/dbscripts/upgrade/3.4/${db.script.dialect}/varchar-field-sizes-quadruple-increasing.sql
-
-
-
-
- patch.fixAclInheritance
- patch.fixAclInheritance.description
- 0
- 5005
- 5006
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- patch.db-V3.4-JBPM-FK-indexes
- patch.schemaUpgradeScript.description
- 0
- 5005
- 5006
-
- classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoPostCreate-JBPM-FK-indexes.sql
-
-
-
-
- patch.imap.clear.old.messages
- patch.imap.clear.old.messages.description
- 0
- 5005
- 5006
-
-
-
-
-
-
- patch.imap.clear.old.messages
- patch.imap.clear.old.messages.description
- 0
- 5005
- 5006
-
-
-
-
-
-
- patch.imapSpacesTemplates2
- patch.imapSpacesLocaleTemplates2.description
- 0
- 5005
- 5006
-
-
-
-
-
- /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.imapConfig.childname}/${spaces.imap_templates.childname}
- alfresco/bootstrap/imapSpacesTemplates.xml
- alfresco/messages/bootstrap-spaces
-
-
-
-
-
- patch.migrateAttrDropOldTables
- patch.migrateAttrDropOldTables.description
- 0
- 5006
- 5007
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- classpath:alfresco/dbscripts/upgrade/4.0/${db.script.dialect}/AclChangeSet-Tracking.sql
-
-
-
-
-
-
-
-
-
-
- classpath:alfresco/dbscripts/upgrade/4.0/${db.script.dialect}/NodeAssoc-Ordering.sql
-
-
-
-
-
-
-
-
-
-
- classpath:alfresco/dbscripts/upgrade/4.0/${db.script.dialect}/Node-Locale.sql
-
-
-
-
-
- patch.activitiesTemplatesUpdate
-
-
- patch.activitiesTemplatesUpdate.description
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- patch.followingMailTemplates
- patch.followingMailTemplates.description
- 0
- 5010
- 5011
-
-
-
-
-
-
-
-
-
-
-
- /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}
- alfresco/templates/following-email-templates.xml
- alfresco/messages/bootstrap-spaces
-
-
-
-
-
- patch.db-V4.0-SubscriptionTables
- patch.schemaUpgradeScript.description
- 0
- 5010
- 5011
-
- classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-SubscriptionTables.sql
-
-
-
-
-
- patch.copiedFromAspect
- patch.copiedFromAspect.description
- 0
- 5012
- 5013
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
- patch.publishing.root
- patch.publishing.root.description
- 0
- 5013
- 5014
-
-
-
-
-
-
-
-
-
- ${publishing.root}
-
-
-
- ${publishing.root.path}
- alfresco/bootstrap/publishingRootFolder.xml
- alfresco/messages/bootstrap-spaces
-
-
-
-
-
-
- patch.workflowNotification
- patch.workflowNotification.description
- 0
- 5014
- 5015
-
-
-
-
-
-
-
-
-
-
- /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}/${spaces.templates.email.workflowemailnotification.childname}
-
-
-
- /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}
- alfresco/bootstrap/notification/workflow-email-notification.xml
- alfresco/messages/bootstrap-spaces
-
-
-
-
-
-
- patch.nodeTemplatesFolder
- patch.nodeTemplatesFolder.description
- 0
- 5015
- 5016
-
-
-
-
- /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.nodetemplates.childname}
-
-
-
- /${spaces.company_home.childname}/${spaces.dictionary.childname}
- alfresco/bootstrap/nodeTemplatesSpace.xml
- alfresco/messages/bootstrap-spaces
-
-
-
-
-
- patch.updateMimetypes3
- patch.updateMimetypes3.description
- 0
- 5016
- 5017
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
- patch.sitesSpacePermissions
- patch.sitesSpacePermissions.description
- 0
- 5017
- 5018
- true
- true
-
-
-
-
patch.updateWorkflowNotificationTemplates
patch.updateWorkflowNotificationTemplates.description
diff --git a/config/alfresco/patch/retired-patches-context.xml b/config/alfresco/patch/retired-patches-context.xml
index 14c0fa3de8..fd4889afab 100644
--- a/config/alfresco/patch/retired-patches-context.xml
+++ b/config/alfresco/patch/retired-patches-context.xml
@@ -1237,5 +1237,276 @@
4.2.x
-
+
+ patch.redeployJbpmAdhocWorkflow
+ patch.redeployJbpmAdhocWorkflow.description
+ 0
+ 4204
+ 4205
+
+ 4.2.x
+
+
+
+ patch.imapSpacesLocaleTemplates
+ patch.noOpPatch.description
+ 0
+ 4302
+ 4305
+
+ 4.2.x
+
+
+
+ patch.mtFixAdminExistingTenants
+ patch.mtFixAdminExistingTenants.description
+
+
+
+
+ 4.2.x
+
+
+
+ patch.fixUserQNames
+ patch.fixUserQNames.description
+
+
+
+
+ 4.2.x
+
+
+
+ patch.activitiesEmailTemplate
+ patch.activitiesEmailTemplate.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.newUserEmailTemplates
+ patch.newUserEmailTemplates.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.inviteEmailTemplates
+ patch.inviteEmailTemplates.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.htmlNotificationMailTemplates
+ patch.htmlNotificationMailTemplates.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+
+
+
+
+
+
+ 4.2.x
+
+
+
+ patch.fixAclInheritance
+ patch.fixAclInheritance.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.db-V3.4-JBPM-FK-indexes
+ patch.schemaUpgradeScript.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.imap.clear.old.messages
+ patch.imap.clear.old.messages.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.imap.clear.old.messages
+ patch.imap.clear.old.messages.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.imapSpacesTemplates2
+ patch.imapSpacesLocaleTemplates2.description
+ 0
+ 5005
+ 5006
+
+ 4.2.x
+
+
+
+ patch.migrateAttrDropOldTables
+ patch.migrateAttrDropOldTables.description
+ 0
+ 5006
+ 5007
+ false
+
+ 4.2.x
+
+
+
+
+
+
+
+
+
+ 4.2.x
+
+
+
+
+
+
+
+
+
+ 4.2.x
+
+
+
+
+
+
+
+
+
+ 4.2.x
+
+
+
+
+
+
+
+
+
+ 4.2.x
+
+
+
+ patch.followingMailTemplates
+ patch.followingMailTemplates.description
+ 0
+ 5010
+ 5011
+
+ 4.2.x
+
+
+
+ patch.db-V4.0-SubscriptionTables
+ patch.schemaUpgradeScript.description
+ 0
+ 5010
+ 5011
+
+ 4.2.x
+
+
+
+ patch.copiedFromAspect
+ patch.copiedFromAspect.description
+ 0
+ 5012
+ 5013
+
+ 4.2.x
+
+
+
+ patch.publishing.root
+ patch.publishing.root.description
+ 0
+ 5013
+ 5014
+
+ 4.2.x
+
+
+
+ patch.workflowNotification
+ patch.workflowNotification.description
+ 0
+ 5014
+ 5015
+
+ 4.2.x
+
+
+
+ patch.nodeTemplatesFolder
+ patch.nodeTemplatesFolder.description
+ 0
+ 5015
+ 5016
+
+ 4.2.x
+
+
+
+ patch.updateMimetypes3
+ patch.updateMimetypes3.description
+ 0
+ 5016
+ 5017
+
+ 4.2.x
+
+
+
+ patch.sitesSpacePermissions
+ patch.sitesSpacePermissions.description
+ 0
+ 5017
+ 5018
+
+ 4.2.x
+
+
+
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/ActivitiesTemplatesUpdatePatch.java b/source/java/org/alfresco/repo/admin/patch/impl/ActivitiesTemplatesUpdatePatch.java
deleted file mode 100644
index efed8d21ff..0000000000
--- a/source/java/org/alfresco/repo/admin/patch/impl/ActivitiesTemplatesUpdatePatch.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.repo.admin.patch.impl;
-
-import java.util.List;
-
-import org.alfresco.error.AlfrescoRuntimeException;
-import org.alfresco.repo.model.Repository;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.springframework.extensions.surf.util.I18NUtil;
-
-/**
- * Patch to update the activities email templates. Current templates become
- * versions of the new templates.
- *
- * @author Florian Mueller
- */
-public class ActivitiesTemplatesUpdatePatch extends GenericEMailTemplateUpdatePatch
-{
- private Repository repository;
-
- private static final String[] LOCALES = new String[] {"de", "es", "fr", "it", "ja"};
- private static final String PATH = "alfresco/templates/activities-email-templates/";
- private static final String BASE_FILE = "activities-email.ftl";
- private static final String XPATH ="/app:company_home/app:dictionary/app:email_templates/cm:activities/cm:activities-email.ftl";
-
- public void setRepository(Repository repository)
- {
- this.repository = repository;
- }
-
- @Override
- protected String getPath()
- {
- return PATH;
- }
-
- @Override
- protected String getBaseFileName()
- {
- return BASE_FILE;
- }
-
- @Override
- protected String[] getLocales()
- {
- return LOCALES;
- }
-
- @Override
- protected NodeRef getBaseTemplate()
- {
- List refs = searchService.selectNodes(
- repository.getRootHome(),
- XPATH,
- null,
- namespaceService,
- false);
- if (refs.size() != 1)
- {
- throw new AlfrescoRuntimeException(I18NUtil.getMessage("patch.activitiesTemplatesUpdate.error"));
- }
- return refs.get(0);
- }
-
- /**
- * @see org.alfresco.repo.admin.patch.AbstractPatch#applyInternal()
- */
- @Override
- protected String applyInternal() throws Exception
- {
- updateTemplates();
- return I18NUtil.getMessage("patch.activitiesTemplatesUpdate.result");
- }
-}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/ClearOldImapMessgesPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/ClearOldImapMessgesPatch.java
deleted file mode 100644
index ec85a34738..0000000000
--- a/source/java/org/alfresco/repo/admin/patch/impl/ClearOldImapMessgesPatch.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.repo.admin.patch.impl;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.importer.ImporterBootstrap;
-import org.alfresco.service.cmr.admin.PatchException;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.StoreRef;
-import org.springframework.extensions.surf.util.I18NUtil;
-
-public class ClearOldImapMessgesPatch extends AbstractPatch
-{
- private static final String MSG_REMOVED = "patch.imap.clear.old.messages.description.cleared";
-
- private static final String PROPERTY_COMPANY_HOME_CHILDNAME = "spaces.company_home.childname";
- private static final String PROPERTY_DICTIONARY_CHILDNAME = "spaces.dictionary.childname";
- private static final String PROPERTY_SCRIPTS_CHILDNAME = "spaces.scripts.childname";
- private static final String PROPERTY_IMAP_CONFIG_CHILDNAME = "spaces.imapConfig.childname";
- private static final String PROPERTY_IMAP_TEMPLATES_CHILDNAME = "spaces.imap_templates.childname";
-
- private ImporterBootstrap importerBootstrap;
- protected Properties configuration;
- private NodeRef imapTemplatesFolderNodeRef;
-
- public void setImporterBootstrap(ImporterBootstrap importerBootstrap)
- {
- this.importerBootstrap = importerBootstrap;
- }
-
- protected void setUp() throws Exception
- {
- // get the node store that we must work against
- StoreRef storeRef = importerBootstrap.getStoreRef();
- if (storeRef == null)
- {
- throw new PatchException("Bootstrap store has not been set");
- }
- NodeRef storeRootNodeRef = nodeService.getRootNode(storeRef);
-
- this.configuration = importerBootstrap.getConfiguration();
- // get the association names that form the path
- String companyHomeChildName = configuration.getProperty(PROPERTY_COMPANY_HOME_CHILDNAME);
- if (companyHomeChildName == null || companyHomeChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_COMPANY_HOME_CHILDNAME + "' is not present");
- }
- String dictionaryChildName = configuration.getProperty(PROPERTY_DICTIONARY_CHILDNAME);
- if (dictionaryChildName == null || dictionaryChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_DICTIONARY_CHILDNAME + "' is not present");
- }
- String scriptsChildName = configuration.getProperty(PROPERTY_SCRIPTS_CHILDNAME);
- if (scriptsChildName == null || scriptsChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_SCRIPTS_CHILDNAME + "' is not present");
- }
-
- String imapConfigChildName = configuration.getProperty(PROPERTY_IMAP_CONFIG_CHILDNAME);
- if (imapConfigChildName == null || imapConfigChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_IMAP_CONFIG_CHILDNAME + "' is not present");
- }
-
- String imapTemplatesChildName = configuration.getProperty(PROPERTY_IMAP_TEMPLATES_CHILDNAME);
- if (imapConfigChildName == null || imapConfigChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_IMAP_CONFIG_CHILDNAME + "' is not present");
- }
-
- // build the search string to get the company home node
- StringBuilder sb = new StringBuilder(256);
- sb.append("/").append(companyHomeChildName);
- sb.append("/").append(dictionaryChildName);
- sb.append("/").append(imapConfigChildName);
- sb.append("/").append(imapTemplatesChildName);
-
- String xpath = sb.toString();
- List nodeRefs = searchService.selectNodes(storeRootNodeRef, xpath, null, namespaceService, false);
- if (nodeRefs.size() > 1)
- {
- throw new PatchException("XPath returned too many results: \n" + " root: " + storeRootNodeRef + "\n" + " xpath: " + xpath + "\n" + " results: " + nodeRefs);
- }
- else if (nodeRefs.size() == 0)
- {
- this.imapTemplatesFolderNodeRef = null;
- }
- else
- {
- this.imapTemplatesFolderNodeRef = nodeRefs.get(0);
- }
-
- }
-
- @Override
- protected String applyInternal() throws Exception
- {
- setUp();
- if (imapTemplatesFolderNodeRef != null)
- {
- NodeRef oldTextPlain = nodeService.getChildByName(imapTemplatesFolderNodeRef, ContentModel.ASSOC_CONTAINS, "emailbody-textplain.ftl");
- NodeRef oldTextHTML = nodeService.getChildByName(imapTemplatesFolderNodeRef, ContentModel.ASSOC_CONTAINS, "emailbody-texthtml.ftl");
-
- if (oldTextPlain != null)
- {
- nodeService.deleteNode(oldTextPlain);
- }
- if (oldTextHTML != null)
- {
- nodeService.deleteNode(oldTextHTML);
- }
- }
-
- return I18NUtil.getMessage(MSG_REMOVED);
- }
-
-}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/ClearOldImapTemplatesPatch2.java b/source/java/org/alfresco/repo/admin/patch/impl/ClearOldImapTemplatesPatch2.java
deleted file mode 100644
index f7064d45bb..0000000000
--- a/source/java/org/alfresco/repo/admin/patch/impl/ClearOldImapTemplatesPatch2.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.repo.admin.patch.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.importer.ImporterBootstrap;
-import org.alfresco.service.cmr.admin.PatchException;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.StoreRef;
-import org.springframework.extensions.surf.util.I18NUtil;
-
-public class ClearOldImapTemplatesPatch2 extends AbstractPatch
-{
- private static final String MSG_REMOVED = "patch.imap.clear.old.messages.description.cleared";
-
- private static final String PROPERTY_COMPANY_HOME_CHILDNAME = "spaces.company_home.childname";
- private static final String PROPERTY_DICTIONARY_CHILDNAME = "spaces.dictionary.childname";
- private static final String PROPERTY_SCRIPTS_CHILDNAME = "spaces.scripts.childname";
- private static final String PROPERTY_IMAP_CONFIG_CHILDNAME = "spaces.imapConfig.childname";
- private static final String PROPERTY_IMAP_TEMPLATES_CHILDNAME = "spaces.imap_templates.childname";
-
- private ImporterBootstrap importerBootstrap;
- protected Properties configuration;
- private NodeRef imapTemplatesFolderNodeRef;
-
- public void setImporterBootstrap(ImporterBootstrap importerBootstrap)
- {
- this.importerBootstrap = importerBootstrap;
- }
-
- protected void setUp() throws Exception
- {
- // get the node store that we must work against
- StoreRef storeRef = importerBootstrap.getStoreRef();
- if (storeRef == null)
- {
- throw new PatchException("Bootstrap store has not been set");
- }
- NodeRef storeRootNodeRef = nodeService.getRootNode(storeRef);
-
- this.configuration = importerBootstrap.getConfiguration();
- // get the association names that form the path
- String companyHomeChildName = configuration.getProperty(PROPERTY_COMPANY_HOME_CHILDNAME);
- if (companyHomeChildName == null || companyHomeChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_COMPANY_HOME_CHILDNAME + "' is not present");
- }
- String dictionaryChildName = configuration.getProperty(PROPERTY_DICTIONARY_CHILDNAME);
- if (dictionaryChildName == null || dictionaryChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_DICTIONARY_CHILDNAME + "' is not present");
- }
- String scriptsChildName = configuration.getProperty(PROPERTY_SCRIPTS_CHILDNAME);
- if (scriptsChildName == null || scriptsChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_SCRIPTS_CHILDNAME + "' is not present");
- }
-
- String imapConfigChildName = configuration.getProperty(PROPERTY_IMAP_CONFIG_CHILDNAME);
- if (imapConfigChildName == null || imapConfigChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_IMAP_CONFIG_CHILDNAME + "' is not present");
- }
-
- String imapTemplatesChildName = configuration.getProperty(PROPERTY_IMAP_TEMPLATES_CHILDNAME);
- if (imapConfigChildName == null || imapConfigChildName.length() == 0)
- {
- throw new PatchException("Bootstrap property '" + PROPERTY_IMAP_CONFIG_CHILDNAME + "' is not present");
- }
-
- // build the search string to get the company home node
- StringBuilder sb = new StringBuilder(256);
- sb.append("/").append(companyHomeChildName);
- sb.append("/").append(dictionaryChildName);
- sb.append("/").append(imapConfigChildName);
- sb.append("/").append(imapTemplatesChildName);
-
- String xpath = sb.toString();
- List nodeRefs = searchService.selectNodes(storeRootNodeRef, xpath, null, namespaceService, false);
- if (nodeRefs.size() > 1)
- {
- throw new PatchException("XPath returned too many results: \n" + " root: " + storeRootNodeRef + "\n" + " xpath: " + xpath + "\n" + " results: " + nodeRefs);
- }
- else if (nodeRefs.size() == 0)
- {
- this.imapTemplatesFolderNodeRef = null;
- }
- else
- {
- this.imapTemplatesFolderNodeRef = nodeRefs.get(0);
- }
-
- }
-
- @Override
- protected String applyInternal() throws Exception
- {
- setUp();
- if (imapTemplatesFolderNodeRef != null)
- {
- List templatesToDelete = new ArrayList();
-
- templatesToDelete.add("emailbody-textplain.ftl");
- templatesToDelete.add("emailbody-textplain_de.ftl");
- templatesToDelete.add("emailbody-textplain_it.ftl");
- templatesToDelete.add("emailbody-textplain_fr.ftl");
- templatesToDelete.add("emailbody-textplain_ja.ftl");
- templatesToDelete.add("emailbody-textplain_es.ftl");
-
- templatesToDelete.add("emailbody-texthtml.ftl");
- templatesToDelete.add("emailbody-texthtml_de.ftl");
- templatesToDelete.add("emailbody-texthtml_it.ftl");
- templatesToDelete.add("emailbody-texthtml_fr.ftl");
- templatesToDelete.add("emailbody-texthtml_ja.ftl");
- templatesToDelete.add("emailbody-texthtml_es.ftl");
-
- for(String template : templatesToDelete)
- {
- NodeRef nodeRef = nodeService.getChildByName(imapTemplatesFolderNodeRef, ContentModel.ASSOC_CONTAINS, template);
- if(nodeRef != null)
- {
- nodeService.deleteNode(nodeRef);
- }
-
- }
- }
-
- return I18NUtil.getMessage(MSG_REMOVED);
- }
-
-}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/CopiedFromAspectPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/CopiedFromAspectPatch.java
deleted file mode 100644
index dfca2b905f..0000000000
--- a/source/java/org/alfresco/repo/admin/patch/impl/CopiedFromAspectPatch.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.repo.admin.patch.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.admin.patch.PatchExecuter;
-import org.alfresco.repo.batch.BatchProcessWorkProvider;
-import org.alfresco.repo.batch.BatchProcessor;
-import org.alfresco.repo.batch.BatchProcessor.BatchProcessWorker;
-import org.alfresco.repo.batch.BatchProcessor.BatchProcessWorkerAdaptor;
-import org.alfresco.repo.domain.node.NodeDAO;
-import org.alfresco.repo.domain.node.NodeDAO.NodeRefQueryCallback;
-import org.alfresco.repo.domain.patch.PatchDAO;
-import org.alfresco.repo.policy.BehaviourFilter;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.StoreRef;
-import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
-import org.alfresco.service.cmr.rule.RuleService;
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.Pair;
-import org.alfresco.util.TempFileProvider;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.extensions.surf.util.I18NUtil;
-
-/**
- * Patch to break the link between {@link ContentModel#ASPECT_WORKING_COPY working copies}
- * and {@link ContentModel#ASPECT_COPIEDFROM copies}.
- *
- * Formerly, when a document was copied, it was given a cm:source property on the
- * cm:copiedfrom aspect - a d:noderef property. During checkout, the
- * working copy was given the cm:workingcopy aspect and the cm:copiedfrom
- * aspect was assumed to be present. However, the ordinality of the cm:copiedfrom's
- * cm:source property didn't match up with the checkin-checkout 1:1 relationship.
- *
- * This patch works in two parts:
- *
- * cm:copiedfrom
- *
- * - cm:source is transformed into a peer association, cm:original
- * - The aspect is removed where the source no longer exists
- *
- *
- * cm:workingcopy
- *
- * - cm:source is transformed into a peer association, cm:workingcopylink
- * - The original is given aspect cm:checkedout
- * - The copy keeps cm:workingcopy
- *
- *
- * @author Derek Hulley
- * @since 4.0
- */
-public class CopiedFromAspectPatch extends AbstractPatch
-{
- private static final String MSG_SUCCESS = "patch.copiedFromAspect.result";
-
- private PatchDAO patchDAO;
- private NodeDAO nodeDAO;
- private DictionaryService dictionaryService;
- private BehaviourFilter behaviourFilter;
- private RuleService ruleService;
-
- private int batchThreads = 2;
- private int batchSize = 1000;
- private int batchMaxQueryRange = 10000;
-
- private static Log logger = LogFactory.getLog(CopiedFromAspectPatch.class);
- private static Log progress_logger = LogFactory.getLog(PatchExecuter.class);
-
- public CopiedFromAspectPatch()
- {
- }
-
- /**
- * @param patchDAO additional queries
- */
- public void setPatchDAO(PatchDAO patchDAO)
- {
- this.patchDAO = patchDAO;
- }
-
- /**
- * @param nodeDAO provides query support
- */
- public void setNodeDAO(NodeDAO nodeDAO)
- {
- this.nodeDAO = nodeDAO;
- }
-
- /**
- * @param dictionaryService type and aspect resolution
- */
- public void setDictionaryService(DictionaryService dictionaryService)
- {
- this.dictionaryService = dictionaryService;
- }
-
- /**
- * @param behaviourFilter used to switch off cm:auditable behaviour
- */
- public void setBehaviourFilter(BehaviourFilter behaviourFilter)
- {
- this.behaviourFilter = behaviourFilter;
- }
-
- /**
- * @param ruleService used to disable rules
- */
- public void setRuleService(RuleService ruleService)
- {
- this.ruleService = ruleService;
- }
-
- /**
- * @param batchThreads the number of threads that will write child association changes
- */
- public void setBatchThreads(int batchThreads)
- {
- this.batchThreads = batchThreads;
- }
-
- /**
- * @param batchSize the number of child associations that will be modified per transaction
- */
- public void setBatchSize(int batchSize)
- {
- this.batchSize = batchSize;
- }
-
- /**
- * @param batchMaxQueryRange the largest ID range that the work provider can query for.
- * Lower this if the DB resultset retrieval causes memory issues
- * prior to the {@link #setBatchQuerySize(int) query limit} being
- * applied.
- */
- public void setBatchMaxQueryRange(int batchMaxQueryRange)
- {
- this.batchMaxQueryRange = batchMaxQueryRange;
- }
-
- @Override
- protected void checkProperties()
- {
- super.checkProperties();
- checkPropertyNotNull(patchDAO, "patchDAO");
- checkPropertyNotNull(nodeDAO, "nodeDAO");
- checkPropertyNotNull(dictionaryService, "dictionaryService");
- checkPropertyNotNull(applicationEventPublisher, "applicationEventPublisher");
- }
-
- private CopiedFromAspectPatch write(FileChannel file, Object obj)
- {
- try
- {
- file.write(ByteBuffer.wrap(obj.toString().getBytes("UTF-8")));
- }
- catch (IOException e)
- {
- logger.error("Failed to write object to file: " + obj.toString());
- }
- return this;
- }
- private CopiedFromAspectPatch writeLine(FileChannel file, Object obj)
- {
- write(file, obj);
- write(file, "\n");
- return this;
- }
-
- @Override
- protected String applyInternal() throws Exception
- {
- // put the log file into a long life temp directory
- File tempDir = TempFileProvider.getLongLifeTempDir("patches");
- File logFile = new File(tempDir, "CopiedFromAspectPatch.log");
-
- // open the file for appending
- RandomAccessFile outputFile = new RandomAccessFile(logFile, "rw");
- FileChannel file = outputFile.getChannel();
- try
- {
- // move to the end of the file
- file.position(file.size());
- // add a newline and it's ready
- writeLine(file, "").writeLine(file, "");
- writeLine(file, "CopiedFromAspectPatch.log executing on " + new Date());
- if (logger.isDebugEnabled())
- {
- logger.debug("Starting CopiedFromAspectPatch. [Q=Query; P=Process]");
- }
-
- int updated = process(file);
- // done
- String msg = I18NUtil.getMessage(MSG_SUCCESS, updated, logFile);
- return msg;
- }
- finally
- {
- try { outputFile.close(); } catch (IOException e) {}
- try { file.close(); } catch (IOException e) {}
- }
- }
-
- /**
- * Does the actual work, writing results to the given file channel
-
- * @return Returns a status message after completion
- */
- private int process(final FileChannel file)
- {
- // Authentication
- final String user = AuthenticationUtil.getRunAsUser();
-
- Set qnames = new HashSet();
- qnames.add(ContentModel.ASPECT_COPIEDFROM);
- qnames.add(ContentModel.ASPECT_WORKING_COPY);
-
- // Instance to provide raw data to process
- BatchProcessWorkProvider> workProvider = new WorkProvider(qnames);
-
- // Instance to handle each item of work
- BatchProcessWorker> worker = new BatchProcessWorkerAdaptor>()
- {
- @Override
- public void beforeProcess() throws Throwable
- {
- // Run as the correct user
- AuthenticationUtil.setRunAsUser(user);
- }
- @Override
- public void process(Pair entry) throws Throwable
- {
- // Disable auditable aspect
- behaviourFilter.disableBehaviour();
- // Disable rules
- ruleService.disableRules();
- try
- {
- CopiedFromAspectPatch.this.process(file, entry);
- }
- finally
- {
- ruleService.enableRules();
- behaviourFilter.enableBehaviour();
- }
- }
- @Override
- public void afterProcess() throws Throwable
- {
- AuthenticationUtil.clearCurrentSecurityContext();
- }
- };
-
- BatchProcessor> batchProcessor = new BatchProcessor>(
- "CopiedFromAspectPatch",
- transactionService.getRetryingTransactionHelper(),
- workProvider,
- this.batchThreads, this.batchSize,
- null,
- progress_logger,
- 1000);
- int updated = batchProcessor.process(worker, true);
- return updated;
- }
-
- /**
- * Work provider that performs incremental queries to find nodes with the
- * required aspects.
- *
- * @author Derek Hulley
- * @since 4.0
- */
- private class WorkProvider implements BatchProcessWorkProvider>
- {
- private long maxId = Long.MAX_VALUE;
- private long workCount = Long.MAX_VALUE;
- private long currentId = 0L;
- private final Set aspectQNames;
-
- private WorkProvider(Set aspectQNames)
- {
- this.aspectQNames = aspectQNames;
- }
-
- @Override
- public synchronized int getTotalEstimatedWorkSize()
- {
- if (maxId == Long.MAX_VALUE)
- {
- maxId = patchDAO.getMaxAdmNodeID();
- if (logger.isDebugEnabled())
- {
- logger.debug("\tQ: Max node id: " + maxId);
- }
- }
- if (workCount == Long.MAX_VALUE)
- {
- workCount = patchDAO.getCountNodesWithAspects(aspectQNames);
- if (logger.isDebugEnabled())
- {
- logger.debug("\tQ: Work count: " + workCount);
- }
- }
- return (int) workCount;
- }
-
- @Override
- public synchronized Collection> getNextWork()
- {
- // Record the results
- final Set> results = new HashSet>(batchMaxQueryRange*2);
- // Record the node IDs for bulk loading
- final List nodeIds = new ArrayList(batchMaxQueryRange);
-
- NodeRefQueryCallback callback = new NodeRefQueryCallback()
- {
- @Override
- public boolean handle(Pair nodePair)
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("\tQ: Recording node work: " + nodePair);
- }
- results.add(nodePair);
- nodeIds.add(nodePair.getFirst());
- return true;
- }
- };
- // Keep querying until we have enough results to give back
- int minResults = batchMaxQueryRange / 2;
- while (currentId <= maxId && results.size() < minResults)
- {
- nodeDAO.getNodesWithAspects(
- aspectQNames,
- currentId,
- currentId + batchMaxQueryRange,
- callback);
- // Increment the minimum ID
- currentId += batchMaxQueryRange;
- }
- // Preload the nodes for quicker access
- nodeDAO.cacheNodesById(nodeIds);
- // Done
- return results;
- }
- }
-
- private static final QName PROP_SOURCE = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "source");
- private static final StoreRef VERSION_STORE = new StoreRef("workspace://version2Store"); // see http://wiki.alfresco.com/wiki/Version_Store
- /**
- * Does the per-node manipulation as stated in the class's docs
- *
- * @param file the file to write output to
- * @param nodePair the node to operate on
- */
- private void process(FileChannel file, Pair nodePair)
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Processing node: " + nodePair);
- }
- NodeRef nodeRef = nodePair.getSecond();
- // First check if the source property is present and valid
- NodeRef sourceNodeRef = DefaultTypeConverter.INSTANCE.convert(
- NodeRef.class,
- nodeService.getProperty(nodeRef, PROP_SOURCE));
-
- // Does the source exist?
- if (sourceNodeRef == null || !nodeService.exists(sourceNodeRef))
- {
- boolean isNewModel = true;
- if (
- nodeService.hasAspect(nodeRef, ContentModel.ASPECT_COPIEDFROM) &&
- nodeService.getSourceAssocs(nodeRef, ContentModel.ASSOC_ORIGINAL).size() == 0)
- {
- // There is no association pointing back to the original and the source node is invalid
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Removing cm:copiedfrom: " + nodePair);
- }
- writeLine(file, "Removing cm:copiedfrom from node: " + nodePair);
- nodeService.removeAspect(nodeRef, ContentModel.ASPECT_COPIEDFROM);
- isNewModel = false;
- }
- if (
- nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY) &&
- nodeService.getSourceAssocs(nodeRef, ContentModel.ASSOC_WORKING_COPY_LINK).size() == 0)
- {
- // There is no association from the checked out node and the source node is invalid
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Removing cm:workingcopy: " + nodePair);
- }
- writeLine(file, "Removing cm:workingcopy from node: " + nodePair);
- nodeService.removeAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY);
- isNewModel = false;
- }
- // If nothing was done, then it's a node with the new data model and we can leave it
- if (isNewModel)
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Ignoring data with new model: " + nodePair);
- }
- writeLine(file, "Ignoring data with new model: " + nodePair);
- }
- }
- else
- {
- // The cm:source property points to a valid node.
- // This needs to be fixed up to use the new model.
- if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_COPIEDFROM))
- {
- if (nodeService.getSourceAssocs(nodeRef, ContentModel.ASSOC_ORIGINAL).size() > 0)
- {
- // The association is already present, so just remove the property (we'll do that later)
- }
- else
- {
- QName sourceTypeQName = nodeService.getType(sourceNodeRef);
- // cm:copiedfrom target must be a cm:object
- if (dictionaryService.isSubClass(sourceTypeQName, ContentModel.TYPE_CMOBJECT))
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Adding association cm:original: " + nodePair);
- }
- writeLine(file, "Adding association cm:original: " + nodePair);
- nodeService.createAssociation(nodeRef, sourceNodeRef, ContentModel.ASSOC_ORIGINAL);
- }
- else
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Removing incompatible aspect cm:copiedfrom " + nodePair);
- }
- writeLine(file, "Removing incompatible aspect cm:copiedfrom " + nodePair);
- nodeService.removeAspect(nodeRef, ContentModel.ASPECT_COPIEDFROM);
- }
- }
- }
- if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
- {
- if (nodeService.getSourceAssocs(nodeRef, ContentModel.ASSOC_WORKING_COPY_LINK).size() > 0)
- {
- // The association is already present, so just remove the property (we'll do that later)
- }
- else if (nodeService.hasAspect(sourceNodeRef, ContentModel.ASPECT_CHECKED_OUT))
- {
- // ALF-9569: copiedFromAspect patch does not take documents with
- // more than one working copy into account
- // So there are multiple working copies
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Found node with multiple working copies: " + sourceNodeRef);
- logger.debug("\tP: Removing cm:workingcopy: " + nodePair);
- }
- writeLine(file, "Found node with multiple working copies: " + nodePair);
- writeLine(file, "Removing cm:workingcopy from node: " + nodePair);
- nodeService.removeAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY);
- }
- else if (!VERSION_STORE.equals(nodeRef.getStoreRef()))
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Adding aspect cm:checkedout: " + sourceNodeRef);
- logger.debug("\tP: Adding association cm:workingcopylink: " + nodePair);
- }
- writeLine(file, "Adding aspect cm:checkedout: " + sourceNodeRef);
- writeLine(file, "Adding association cm:workingcopylink to " + nodePair);
- // Add aspect to source
- nodeService.addAspect(sourceNodeRef, ContentModel.ASPECT_CHECKED_OUT, null);
- // Create the association
- nodeService.createAssociation(sourceNodeRef, nodeRef, ContentModel.ASSOC_WORKING_COPY_LINK);
- }
- else
- {
- // ALF-11479:
- // - No cm:workingcopylink to the target node.
- // - Source node hasn't got the cm:checkedout aspect.
- // - But don't fix up the association, since the target node is in the version store
- // and *versions* of a working copy shouldn't have the cm:workingcopy aspect: there should
- // be one, and only one working copy.
- // - Therefore, remove this phantom cm:workingcopy aspect.
- if (logger.isDebugEnabled())
- {
- logger.debug("\tP: Found version of working copy marked as actual working copy: " + nodeRef);
- logger.debug("\tP: Removing cm:workingcopy: " + nodePair);
- }
- writeLine(file, "Found version of working copy marked as actual working copy: " + nodePair);
- writeLine(file, "Removing cm:workingcopy: " + nodePair);
- nodeService.removeAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY);
- }
- }
- }
- // Remove the property if it exists
- nodeService.removeProperty(nodeRef, PROP_SOURCE);
- }
-}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/FixAclInheritancePatch.java b/source/java/org/alfresco/repo/admin/patch/impl/FixAclInheritancePatch.java
deleted file mode 100644
index d60896494e..0000000000
--- a/source/java/org/alfresco/repo/admin/patch/impl/FixAclInheritancePatch.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.repo.admin.patch.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.domain.patch.PatchDAO;
-import org.alfresco.repo.domain.permissions.AccessControlListDAO;
-import org.alfresco.repo.domain.permissions.AclDAO;
-import org.alfresco.repo.security.permissions.ACLType;
-import org.alfresco.repo.security.permissions.AccessControlListProperties;
-import org.alfresco.repo.security.permissions.impl.AclChange;
-import org.alfresco.repo.transaction.RetryingTransactionHelper;
-import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.extensions.surf.util.I18NUtil;
-
-/**
- * Fix ACLs that inherit and have issues with inheritance to correctly inherit from their primary parent, that may have
- * failed on upgrade or that have any other issue according to the DB
- */
-public class FixAclInheritancePatch extends AbstractPatch
-{
- private static final String MSG_SUCCESS = "patch.fixAclInheritance.result";
-
- private static Log logger = LogFactory.getLog(FixAclInheritancePatch.class);
-
- private AclDAO aclDAO;
-
- private PatchDAO patchDAO;
-
- private AccessControlListDAO accessControlListDao;
-
- private RetryingTransactionHelper retryingTransactionHelper;
-
- private long count = 0;
-
- /**
- * @param aclDaoComponent
- * the aclDaoComponent to set
- */
- public void setAclDAO(AclDAO aclDAO)
- {
- this.aclDAO = aclDAO;
- }
-
- public void setPatchDAO(PatchDAO patchDAO)
- {
- this.patchDAO = patchDAO;
- }
-
- public void setAccessControlListDao(AccessControlListDAO accessControlListDao)
- {
- this.accessControlListDao = accessControlListDao;
- }
-
- /**
- * @param retryingTransactionHelper
- * the retryingTransactionHelper to set
- */
- public void setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
- {
- this.retryingTransactionHelper = retryingTransactionHelper;
- }
-
- @Override
- protected String applyInternal() throws Exception
- {
- // Fix unwired inheritance first as the other fixes depend on it and the fix can create D-D issues
-
- List