mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ACE-2030: Clean up patches on unsupported upgrade paths to 5.0
88058: ACE-2030: Start process of retiring patches leading up to 4.0a 88061: ACE-2030: Remove unused SQL scripts for newly-retired patches 88062: ACE-2030: Change class names for all generic patches. 88064: ACE-2030: Remove unused patch implementation classes and fixes to get upgrade working again. 88067: ACE-2030: Clean up unused code and SQL for PatchDAO git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@88070 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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'
|
||||
);
|
||||
|
@@ -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'
|
||||
);
|
@@ -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'
|
||||
);
|
||||
|
@@ -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'
|
||||
);
|
||||
|
@@ -46,11 +46,6 @@
|
||||
</property>
|
||||
<property name="postUpdateScriptPatches">
|
||||
<list>
|
||||
<ref bean="patch.db-V3.4-VarcharFieldSizesQuadrupleIncreasing" />
|
||||
<ref bean="patch.db-V4.0-AclChangeSet" />
|
||||
<ref bean="patch.db-V4.0-NodeAssoc-Ordering" />
|
||||
<ref bean="patch.db-V4.0-Node-Locale" />
|
||||
<ref bean="patch.db-V4.0-SubscriptionTables" />
|
||||
<ref bean="patch.db-V4.0-SolrTracking" />
|
||||
<ref bean="patch.db-V4.0-AclChangeSet2" />
|
||||
<ref bean="patch.db-V4.0-TenantTables" />
|
||||
@@ -94,7 +89,6 @@
|
||||
<property name="schemaBootstrap" ref="schemaBootstrap" />
|
||||
<property name="postUpdateScriptPatches">
|
||||
<list>
|
||||
<ref bean="patch.db-V3.4-JBPM-FK-indexes" />
|
||||
<ref bean="patch.db-V3.4-alter-jBPM331-CLOB-columns-to-nvarchar" />
|
||||
<ref bean="patch.db-V3.4-JBPM-varinst-indexes" />
|
||||
<ref bean="patch.db-V3.4-remove-redundant-jbpm-indexes" />
|
||||
|
@@ -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'
|
||||
);
|
@@ -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'
|
||||
);
|
@@ -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'
|
||||
);
|
@@ -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'
|
||||
);
|
@@ -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'
|
||||
);
|
@@ -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'
|
||||
);
|
@@ -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'
|
||||
);
|
@@ -8,68 +8,11 @@
|
||||
<!-- Result Maps -->
|
||||
<!-- -->
|
||||
|
||||
<resultMap id="result_admOldContentProp" type="java.util.HashMap">
|
||||
<result property="nodeId" column="node_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameId" column="qname_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="listIndex" column="list_index" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<result property="localeId" column="locale_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="stringValue" column="string_value" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_authoritiesAndCrc" type="java.util.HashMap">
|
||||
<result property="authority" column="authority" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="crc" column="crc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_childAssocsForCrc" type="java.util.HashMap">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="typeQNameId" column="type_qname_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameNamespaceId" column="qname_ns_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameLocalName" column="qname_localname" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="childNodeNameCrc" column="child_node_name_crc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="qnameCrc" column="qname_crc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="childNodeUuid" column="child_node_uuid" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="childNodeName" column="child_node_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_nodeIdAndName" type="java.util.HashMap">
|
||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="java.util.HashMap" id="result_admTenant">
|
||||
<result property="tenantDomain" column="tenantDomain" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="isEnabled" column="isEnabled" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||
<result property="rootDir" column="rootDir" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="java.util.HashMap" id="result_PBB">
|
||||
<result property="componentName" column="componentName" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="propName" column="propName" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="propValue" column="propValue" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="java.util.HashMap" id="result_ChainingURS">
|
||||
<result property="label" column="label" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="zoneId" column="zoneId" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="lastModified" column="lastModified" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_aclIneritanceIssue" type="java.util.HashMap">
|
||||
<result property="childAclId" column="child_acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="childAclType" column="child_acl_type" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="primaryParentAclId" column="primary_parent_acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="primaryParentAclType" column="primary_parent_acl_type" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="childNodeId" column="child_node_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl" type="java.util.HashMap">
|
||||
<result property="inheritedAclId" column="inherited_acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="inheritedAclType" column="inherited_acl_type" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="aclId" column="acl_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="aclType" column="acl_type" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="result_nodeNameUuidMap" type="java.util.HashMap">
|
||||
<result property="uuid" column="uuid" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<result property="protocol" column="protocol" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
@@ -84,25 +27,11 @@
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_admNewContentProp" type="map">
|
||||
<parameter property="longValue" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="nodeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="qnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="listIndex" jdbcType="INTEGER" javaType="java.lang.Integer"/>
|
||||
<parameter property="localeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_contentMimetype" type="map">
|
||||
<parameter property="newMimetypeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="oldMimetypeId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_childAssocCrcs" type="map">
|
||||
<parameter property="childNodeNameCrc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="qnameCrc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_nodeTypeAndNamePattern" type="map">
|
||||
<parameter property="typeQNameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="propQNameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
@@ -161,138 +90,6 @@
|
||||
np.string_value like #{namePattern} <include refid="alfresco.util.escape"/>
|
||||
</select>
|
||||
|
||||
<select id="select_sharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
childAcl.type as child_acl_type,
|
||||
acl.id as primary_parent_acl_id,
|
||||
acl.type as primary_parent_acl_type,
|
||||
child.id as child_node_id
|
||||
from
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #{trueOrFalse} AND childAcl.type = 2
|
||||
where
|
||||
(
|
||||
acl.id = childAcl.inherits_from
|
||||
AND NOT EXISTS (
|
||||
select 1
|
||||
from alf_acl_member childMem
|
||||
where
|
||||
childMem.acl_id = childAcl.id
|
||||
and childMem.ace_id = mem.ace_id
|
||||
and childMem.pos = mem.pos +1
|
||||
)
|
||||
)
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_definingAclsThatDoNotInheritCorrectlyFromThePrimaryParent" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
childAcl.type as child_acl_type,
|
||||
acl.id as primary_parent_acl_id,
|
||||
acl.type as primary_parent_acl_type,
|
||||
child.id as child_node_id
|
||||
from
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #{trueOrFalse} AND childAcl.type = 1
|
||||
where
|
||||
(
|
||||
acl.inherited_acl = childAcl.inherits_from
|
||||
AND acl.id <> childAcl.inherits_from
|
||||
AND NOT EXISTS (
|
||||
select 1 from alf_acl_member childMem
|
||||
where
|
||||
childMem.acl_id = childAcl.id
|
||||
and childMem.ace_id = mem.ace_id
|
||||
and childMem.pos = mem.pos + 2
|
||||
)
|
||||
)
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_aclsThatInheritFromNonPrimaryParent" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
childAcl.type as child_acl_type,
|
||||
acl.id as primary_parent_acl_id,
|
||||
acl.type as primary_parent_acl_type,
|
||||
child.id as child_node_id
|
||||
from
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #{trueOrFalse}
|
||||
where
|
||||
(
|
||||
childAcl.id is not null
|
||||
AND acl.id <> childAcl.id
|
||||
AND acl.id <> childAcl.inherits_from
|
||||
AND acl.inherited_acl <> childAcl.inherits_from
|
||||
)
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_aclsThatInheritWithInheritanceUnset" parameterType="boolean" resultMap="result_aclIneritanceIssue">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
childAcl.id as child_acl_id,
|
||||
childAcl.type as child_acl_type,
|
||||
acl.id as primary_parent_acl_id,
|
||||
acl.type as primary_parent_acl_type,
|
||||
child.id as child_node_id
|
||||
from
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_node node on node.acl_id = acl.id
|
||||
join alf_child_assoc priChild on priChild.parent_node_id = node.id and is_primary = #{trueOrFalse}
|
||||
join alf_node child on priChild.child_node_id = child.id
|
||||
join alf_access_control_list childAcl on childAcl.id = child.acl_id AND childAcl.inherits = #{trueOrFalse}
|
||||
where
|
||||
(
|
||||
childAcl.id is not null
|
||||
AND childAcl.inherits_from is null
|
||||
AND childAcl.id <> acl.id
|
||||
)
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl" parameterType="boolean" resultMap="result_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl">
|
||||
<![CDATA[
|
||||
select distinct
|
||||
inheritedAcl.id as inherited_acl_id,
|
||||
inheritedAcl.type as inherited_acl_type,
|
||||
acl.id as acl_id,
|
||||
acl.type as acl_type
|
||||
from
|
||||
alf_access_control_list acl
|
||||
join alf_acl_member mem on mem.acl_id = acl.id
|
||||
join alf_access_control_list inheritedAcl on inheritedAcl.inherits_from = acl.id AND inheritedAcl.inherits = #{trueOrFalse} AND inheritedAcl.type = 1
|
||||
where acl.id = inheritedAcl.inherits_from
|
||||
AND NOT EXISTS (
|
||||
select 1
|
||||
from alf_acl_member childMem
|
||||
where
|
||||
childMem.acl_id = inheritedAcl.id
|
||||
and childMem.ace_id = mem.ace_id
|
||||
and childMem.pos = mem.pos +1
|
||||
)
|
||||
]]>
|
||||
</select>
|
||||
|
||||
<select id="select_CountNodesWithAspectIds" parameterType="Ids" resultType="long" >
|
||||
select
|
||||
count(*)
|
||||
@@ -443,26 +240,6 @@
|
||||
content_mimetype_id = ?
|
||||
</update>
|
||||
|
||||
<update id="drop_oldAttrAlfListAttributeEntries">
|
||||
drop table alf_list_attribute_entries
|
||||
</update>
|
||||
|
||||
<update id="drop_oldAttrAlfMapAttributeEntries">
|
||||
drop table alf_map_attribute_entries
|
||||
</update>
|
||||
|
||||
<update id="drop_oldAttrAlfGlobalAttributes">
|
||||
drop table alf_global_attributes
|
||||
</update>
|
||||
|
||||
<update id="drop_oldAttrAlfAttributes">
|
||||
drop table alf_attributes
|
||||
</update>
|
||||
|
||||
<update id="drop_oldAttrAlfAttributes_seq">
|
||||
drop sequence alf_attributes_seq
|
||||
</update>
|
||||
|
||||
<!-- -->
|
||||
<!-- Deletes -->
|
||||
<!-- -->
|
||||
|
@@ -35,7 +35,6 @@ patch.marker.description=Marker patch to record installations and upgrades
|
||||
patch.marker.result=Marker patch applied
|
||||
|
||||
patch.schemaUpgradeScript.description=Ensures that the database upgrade script has been run.
|
||||
patch.schemaUpgradeScript.err.not_executed=The schema upgrade script, ''{0}'', has not been run against this database.
|
||||
|
||||
# Individual patch messages
|
||||
|
||||
@@ -123,8 +122,8 @@ patch.webscripts2.description=Adds Web Scripts (second set) to Data Dictionary.
|
||||
patch.webscripts3.description=Update Web Scripts ReadMe.
|
||||
patch.webscriptsExtension.description=Adds Web Scripts Extension to Data Dictionary.
|
||||
patch.imap.messages.share.description=Adds email template for txt files to the Imap Configs/Templates
|
||||
|
||||
patch.imap.clear.old.messages.description=Remove old IMAP message templates
|
||||
patch.imap.clear.old.messages.description.cleared=Old IMAP message templates have been removed from the repository
|
||||
|
||||
patch.groupMembersAsIdentifiers.description=Reindex usr:authorityContainer members as identifiers
|
||||
|
||||
@@ -216,10 +215,8 @@ patch.migrateAttrPropBackedBeans.description=Migrate old Property-Backed Bean co
|
||||
patch.migrateAttrChainingURS.description=Migrate old Chaining User Registry Synchronizer attributes
|
||||
|
||||
patch.redeployJbpmAdhocWorkflow.description=Redeploy JBPM adhoc workflow
|
||||
patch.redeployJbpmAdhocWorkflow.result=JBPM adhoc workflow redeployed
|
||||
|
||||
patch.migrateAttrDropOldTables.description=Drops old alf_*attribute* tables and sequence
|
||||
patch.migrateAttrDropOldTables.result=Drop tables alf_attributes, alf_global_attributes, alf_list_attribute_entries, alf_map_attribute_entries and sequence alf_attributes_seq
|
||||
|
||||
patch.transfer.targetrulefolder.description=Creates the transfer target rule folder for the default transfer group.
|
||||
|
||||
@@ -231,16 +228,12 @@ patch.publishing.root.description=Creates the publishing root folder in the Data
|
||||
patch.varcharFieldSizesQuadrupleIncreasing.description=ALF-4300: Increasing 'VARCHAR' field sizes quadruply for DB2 dialect
|
||||
|
||||
patch.mtFixAdminExistingTenants.description=Fix bootstrapped creator/modifier
|
||||
patch.mtFixAdminExistingTenants.result=Fix bootstrapped creator/modifier
|
||||
|
||||
patch.fixUserQNames.description=Fixes user store qnames to improve native authentication performance
|
||||
patch.fixUserQNames.result=Generated qnames for {0} users.
|
||||
|
||||
patch.newUserEmailTemplates.description=Adds the email templates for notifying new users of their accounts
|
||||
patch.newUserEmailTemplates.created=Email templates added: {0}
|
||||
|
||||
patch.inviteEmailTemplates.description=Adds the email templates for inviting users to a Site
|
||||
patch.inviteEmailTemplates.created=Email templates added: {0}
|
||||
|
||||
patch.htmlNotificationMailTemplates.description=Adds HTML email templates for notifying users of new content
|
||||
|
||||
@@ -251,26 +244,20 @@ patch.imapSpacesLocaleTemplates2.description=Replaces content templates for IMAP
|
||||
patch.exampleJavaScript.description=Loads sample Javascript file into datadictionary scripts folder
|
||||
|
||||
patch.fixAclInheritance.description=Fixes any ACL inheritance issues.
|
||||
patch.fixAclInheritance.result=Fixed {0} ACLs.
|
||||
|
||||
patch.followingMailTemplates.description=Adds email templates for following notifications
|
||||
|
||||
patch.activitiesTemplatesUpdate.description=Updates activities email templates.
|
||||
patch.activitiesTemplatesUpdate.error=Error retrieving base template when trying to patch the activity email templates.
|
||||
patch.activitiesTemplatesUpdate.result=Updated activities email templates.
|
||||
|
||||
patch.activitiesEmailTemplate.description=Creates activities email templates.
|
||||
|
||||
patch.copiedFromAspect.description=Adds peer associations for cm:copiedfrom and cm:workingcopy (new model) and removes cm:source property
|
||||
patch.copiedFromAspect.result=Fixed cm:copiedfrom model for {0} nodes. See file {1} for details.
|
||||
|
||||
patch.workflowNotification.description=Patch to add workflow email notification email folder and template.
|
||||
|
||||
patch.nodeTemplatesFolder.description=Patch to create new Data Dictionary folder for Share - Create Node by Template
|
||||
|
||||
patch.sitesSpacePermissions.description=Patch to remove the EVERYONE Contributor permissions on the Sites Space (parent container of all Sites)
|
||||
patch.sitesSpacePermissions.result=Permissions corrected.
|
||||
patch.sitesSpacePermissions.result.none=Permissions corrections not required.
|
||||
|
||||
patch.updateWorkflowNotificationTemplates.description=Patch to update the workflow notification templates.
|
||||
patch.updateWorkflowNotificationTemplates.result=Workflow Notification Templates successfully updated.
|
||||
|
@@ -113,163 +113,6 @@
|
||||
<!--====== LIVE PATCHES =======-->
|
||||
<!--===========================-->
|
||||
|
||||
<bean id="patch.redeployJbpmAdhocWorkflow" class="org.alfresco.repo.admin.patch.impl.GenericWorkflowPatch" parent="baseWorkflowPatch" >
|
||||
<property name="id"><value>patch.redeployJbpmAdhocWorkflow</value></property>
|
||||
<property name="description"><value>patch.redeployJbpmAdhocWorkflow.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>4204</value></property>
|
||||
<property name="targetSchema"><value>4205</value></property>
|
||||
<property name="dependsOn" >
|
||||
<list>
|
||||
<ref bean="patch.updateDmPermissions" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="workflowDefinitions">
|
||||
<list>
|
||||
<props>
|
||||
<prop key="engineId">jbpm</prop>
|
||||
<prop key="location">alfresco/workflow/adhoc_processdefinition.xml</prop>
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
</props>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Used to bootstrap imapSpacesLocales Prior to share/alfresco split of 3.5 -->
|
||||
<bean id="patch.imapSpacesLocaleTemplates" class="org.alfresco.repo.admin.patch.impl.NoOpPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.imapSpacesLocaleTemplates</value></property>
|
||||
<property name="description"><value>patch.noOpPatch.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>4302</value></property>
|
||||
<property name="targetSchema"><value>4305</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.mtFixAdminExistingTenants" class="org.alfresco.repo.admin.patch.impl.MultiTFixAdminExistingTenantsPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.mtFixAdminExistingTenants</value></property>
|
||||
<property name="description"><value>patch.mtFixAdminExistingTenants.description</value></property>
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5002" />
|
||||
<property name="targetSchema" value="5003" />
|
||||
<property name="nodeDAO">
|
||||
<ref bean="nodeDAO"/>
|
||||
</property>
|
||||
<property name="tenantService">
|
||||
<ref bean="tenantService"/>
|
||||
</property>
|
||||
<property name="policyBehaviourFilter">
|
||||
<ref bean="policyBehaviourFilter"/>
|
||||
</property>
|
||||
<property name="pathsToNodes">
|
||||
<list>
|
||||
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.models.childname}</value>
|
||||
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.workflow.definitions.childname}</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.fixUserQNames" class="org.alfresco.repo.admin.patch.impl.FixUserQNamesPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.fixUserQNames</value></property>
|
||||
<property name="description"><value>patch.fixUserQNames.description</value></property>
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5003" />
|
||||
<property name="targetSchema" value="5004" />
|
||||
<property name="dependsOn" >
|
||||
<list>
|
||||
<ref bean="patch.fixNameCrcValues-2" />
|
||||
<ref bean="patch.migrateTenantsFromAttrsToTable" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="qnameDAO">
|
||||
<ref bean="qnameDAO" />
|
||||
</property>
|
||||
<property name="ruleService">
|
||||
<ref bean="ruleService" />
|
||||
</property>
|
||||
<property name="userBootstrap">
|
||||
<ref bean="userBootstrap" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.activitiesEmailTemplate" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.activitiesEmailTemplate</value></property>
|
||||
<property name="description"><value>patch.activitiesEmailTemplate.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="dependsOn" >
|
||||
<list>
|
||||
<ref bean="patch.updateDmPermissions" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="checkPath">
|
||||
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}/${spaces.templates.email.activities.childname}</value>
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}</prop>
|
||||
<prop key="location">alfresco/templates/activities-email-templates.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.newUserEmailTemplates" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.newUserEmailTemplates</value></property>
|
||||
<property name="description"><value>patch.newUserEmailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}/${spaces.templates.email.invite.childname}</prop>
|
||||
<prop key="location">alfresco/templates/new-user-templates.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.inviteEmailTemplates" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.inviteEmailTemplates</value></property>
|
||||
<property name="description"><value>patch.inviteEmailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}/${spaces.templates.email.invite.childname}</prop>
|
||||
<prop key="location">alfresco/templates/invite-email-templates.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.htmlNotificationMailTemplates" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.htmlNotificationMailTemplates</value></property>
|
||||
<property name="description"><value>patch.htmlNotificationMailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}/${spaces.templates.email.notify.childname}</prop>
|
||||
<prop key="location">alfresco/templates/notify_email_templates.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- For importing whole sites -->
|
||||
<bean id="patch.siteLoadPatch.swsdp" class="org.alfresco.repo.admin.patch.impl.SiteLoadPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.siteLoadPatch.swsdp</value></property>
|
||||
@@ -336,341 +179,6 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V3.4-VarcharFieldSizesQuadrupleIncreasing" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V3.4-VarcharFieldSizesQuadrupleIncreasing" />
|
||||
<property name="description" value="patch.varcharFieldSizesQuadrupleIncreasing.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5005" />
|
||||
<property name="targetSchema" value="5006" />
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/upgrade/3.4/${db.script.dialect}/varchar-field-sizes-quadruple-increasing.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.fixAclInheritance" class="org.alfresco.repo.admin.patch.impl.FixAclInheritancePatch" parent="basePatch">
|
||||
<property name="id"><value>patch.fixAclInheritance</value></property>
|
||||
<property name="description"><value>patch.fixAclInheritance.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="patchDAO">
|
||||
<ref bean="patchDAO" />
|
||||
</property>
|
||||
<property name="aclDAO">
|
||||
<ref bean="aclDAO" />
|
||||
</property>
|
||||
<property name="retryingTransactionHelper">
|
||||
<ref bean="retryingTransactionHelper" />
|
||||
</property>
|
||||
<property name="accessControlListDao">
|
||||
<ref bean="admNodeACLDAO"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V3.4-JBPM-FK-indexes" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.db-V3.4-JBPM-FK-indexes</value></property>
|
||||
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoPostCreate-JBPM-FK-indexes.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.imap.clear.old.messages" class="org.alfresco.repo.admin.patch.impl.ClearOldImapMessgesPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.imap.clear.old.messages</value></property>
|
||||
<property name="description"><value>patch.imap.clear.old.messages.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.imap.clear.old.templates2" class="org.alfresco.repo.admin.patch.impl.ClearOldImapTemplatesPatch2" parent="basePatch" >
|
||||
<property name="id"><value>patch.imap.clear.old.messages</value></property>
|
||||
<property name="description"><value>patch.imap.clear.old.messages.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.imapSpacesTemplates2" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.imapSpacesTemplates2</value></property>
|
||||
<property name="description"><value>patch.imapSpacesLocaleTemplates2.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.imapConfig.childname}/${spaces.imap_templates.childname}</prop>
|
||||
<prop key="location">alfresco/bootstrap/imapSpacesTemplates.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.migrateAttrDropOldTables" class="org.alfresco.repo.admin.patch.impl.MigrateAttrDropOldTablesPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.migrateAttrDropOldTables</value></property>
|
||||
<property name="description"><value>patch.migrateAttrDropOldTables.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5006</value></property>
|
||||
<property name="targetSchema"><value>5007</value></property>
|
||||
<property name="applyToTenants"><value>false</value></property>
|
||||
<property name="dependsOn" >
|
||||
<list>
|
||||
<ref bean="patch.migrateAttrTenants"/>
|
||||
<ref bean="patch.migrateAttrPropBackedBeans"/>
|
||||
<ref bean="patch.migrateAttrChainingURS"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="patchDAO">
|
||||
<ref bean="patchDAO"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V4.0-AclChangeSet" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V4.0-AclChangeSet" />
|
||||
<property name="description" value="patch.schemaUpgradeScript.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5007" />
|
||||
<property name="targetSchema" value="5008" />
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/upgrade/4.0/${db.script.dialect}/AclChangeSet-Tracking.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V4.0-NodeAssoc-Ordering" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V4.0-NodeAssoc-Ordering" />
|
||||
<property name="description" value="patch.schemaUpgradeScript.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5008" />
|
||||
<property name="targetSchema" value="5009" />
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/upgrade/4.0/${db.script.dialect}/NodeAssoc-Ordering.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V4.0-Node-Locale" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V4.0-Node-Locale" />
|
||||
<property name="description" value="patch.schemaUpgradeScript.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5009" />
|
||||
<property name="targetSchema" value="5010" />
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/upgrade/4.0/${db.script.dialect}/Node-Locale.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.activitiesEmailTemplateUpdate" class="org.alfresco.repo.admin.patch.impl.ActivitiesTemplatesUpdatePatch" parent="basePatch">
|
||||
<property name="id">
|
||||
<value>patch.activitiesTemplatesUpdate</value>
|
||||
</property>
|
||||
<property name="description">
|
||||
<value>patch.activitiesTemplatesUpdate.description</value>
|
||||
</property>
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5010" />
|
||||
<property name="targetSchema" value="5011" />
|
||||
<property name="dependsOn">
|
||||
<list>
|
||||
<ref bean="patch.activitiesEmailTemplate" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="contentService" ref="ContentService"/>
|
||||
<property name="fileFolderService" ref="FileFolderService"/>
|
||||
<property name="repository" ref="repositoryHelper"/>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.followingMailTemplates" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.followingMailTemplates</value></property>
|
||||
<property name="description"><value>patch.followingMailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5010</value></property>
|
||||
<property name="targetSchema"><value>5011</value></property>
|
||||
<property name="dependsOn" >
|
||||
<list>
|
||||
<ref bean="patch.migrateTenantsFromAttrsToTable" />
|
||||
<ref bean="patch.migrateAttrTenants" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}</prop>
|
||||
<prop key="location">alfresco/templates/following-email-templates.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V4.0-SubscriptionTables" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.db-V4.0-SubscriptionTables</value></property>
|
||||
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5010</value></property>
|
||||
<property name="targetSchema"><value>5011</value></property>
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-SubscriptionTables.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Fix data related to cm:copiedfrom aspect -->
|
||||
<bean id="patch.copiedFromAspect" class="org.alfresco.repo.admin.patch.impl.CopiedFromAspectPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.copiedFromAspect</value></property>
|
||||
<property name="description"><value>patch.copiedFromAspect.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5012</value></property>
|
||||
<property name="targetSchema"><value>5013</value></property>
|
||||
<property name="requiresTransaction"><value>false</value></property>
|
||||
<property name="applyToTenants"><value>false</value></property>
|
||||
|
||||
<property name="patchDAO" ref="patchDAO" />
|
||||
<property name="nodeDAO" ref="nodeDAO" />
|
||||
<property name="dictionaryService" ref="dictionaryService" />
|
||||
<property name="behaviourFilter" ref="policyBehaviourFilter" />
|
||||
<property name="ruleService" ref="ruleService" />
|
||||
<property name="batchThreads" value="2"/>
|
||||
<property name="batchSize" value="1000"/>
|
||||
<property name="batchMaxQueryRange" value="5000"/>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.publishing.root" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.publishing.root</value></property>
|
||||
<property name="description"><value>patch.publishing.root.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5013</value></property>
|
||||
<property name="targetSchema"><value>5014</value></property>
|
||||
<property name="dependsOn" >
|
||||
<list>
|
||||
<ref bean="patch.updateDmPermissions" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="checkPath">
|
||||
<value>${publishing.root}</value>
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">${publishing.root.path}</prop>
|
||||
<prop key="location">alfresco/bootstrap/publishingRootFolder.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- TODO .. update to install workflow email folder ... -->
|
||||
<bean id="patch.workflowNotification" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.workflowNotification</value></property>
|
||||
<property name="description"><value>patch.workflowNotification.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5014</value></property>
|
||||
<property name="targetSchema"><value>5015</value></property>
|
||||
<property name="dependsOn" >
|
||||
<list>
|
||||
<ref bean="patch.updateDmPermissions" />
|
||||
<ref bean="patch.emailTemplatesFolder" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="checkPath">
|
||||
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}/${spaces.templates.email.workflowemailnotification.childname}</value>
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}</prop>
|
||||
<prop key="location">alfresco/bootstrap/notification/workflow-email-notification.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Patch to create new Data Dictionary folder for Share - Create Node by Template patch -->
|
||||
<bean id="patch.nodeTemplatesFolder" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.nodeTemplatesFolder</value></property>
|
||||
<property name="description"><value>patch.nodeTemplatesFolder.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5015</value></property>
|
||||
<property name="targetSchema"><value>5016</value></property>
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="checkPath">
|
||||
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.nodetemplates.childname}</value>
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
|
||||
<prop key="location">alfresco/bootstrap/nodeTemplatesSpace.xml</prop>
|
||||
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.updateMimetypes3" class="org.alfresco.repo.admin.patch.impl.GenericMimetypeRenamePatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.updateMimetypes3</value></property>
|
||||
<property name="description"><value>patch.updateMimetypes3.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5016</value></property>
|
||||
<property name="targetSchema"><value>5017</value></property>
|
||||
<property name="applyToTenants"><value>false</value></property>
|
||||
<property name="dependsOn">
|
||||
<list>
|
||||
<ref bean="patch.db-V3.2-ContentTables2"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="mimetypeDAO">
|
||||
<ref bean="mimetypeDAO"/>
|
||||
</property>
|
||||
<property name="patchDAO">
|
||||
<ref bean="patchDAO"/>
|
||||
</property>
|
||||
<property name="nodeService">
|
||||
<ref bean="nodeService" />
|
||||
</property>
|
||||
<property name="nodeDAO">
|
||||
<ref bean="nodeDAO"/>
|
||||
</property>
|
||||
<property name="retryingTransactionHelper">
|
||||
<ref bean="retryingTransactionHelper"/>
|
||||
</property>
|
||||
<property name="mimetypeMappings">
|
||||
<map>
|
||||
<entry key="audio/x-mpeg" value="audio/mpeg"></entry>
|
||||
</map>
|
||||
</property>
|
||||
<property name="reindex">
|
||||
<value>true</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Fix data related to cm:copiedfrom aspect -->
|
||||
<bean id="patch.sitesSpacePermissions" class="org.alfresco.repo.admin.patch.impl.SitesSpacePermissionsPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.sitesSpacePermissions</value></property>
|
||||
<property name="description"><value>patch.sitesSpacePermissions.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5017</value></property>
|
||||
<property name="targetSchema"><value>5018</value></property>
|
||||
<property name="requiresTransaction"><value>true</value></property>
|
||||
<property name="applyToTenants"><value>true</value></property>
|
||||
<property name="permissionService" ref="permissionService" />
|
||||
<property name="importerBootstrap" ref="spacesBootstrap" />
|
||||
</bean>
|
||||
|
||||
<bean id="patch.updateWorkflowNotificationTemplates" class="org.alfresco.repo.admin.patch.impl.UpdateWorkflowNotificationTemplatesPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.updateWorkflowNotificationTemplates</value></property>
|
||||
<property name="description"><value>patch.updateWorkflowNotificationTemplates.description</value></property>
|
||||
|
@@ -1237,5 +1237,276 @@
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.redeployJbpmAdhocWorkflow" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="baseWorkflowPatch" >
|
||||
<property name="id"><value>patch.redeployJbpmAdhocWorkflow</value></property>
|
||||
<property name="description"><value>patch.redeployJbpmAdhocWorkflow.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>4204</value></property>
|
||||
<property name="targetSchema"><value>4205</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.imapSpacesLocaleTemplates" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.imapSpacesLocaleTemplates</value></property>
|
||||
<property name="description"><value>patch.noOpPatch.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>4302</value></property>
|
||||
<property name="targetSchema"><value>4305</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.mtFixAdminExistingTenants" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.mtFixAdminExistingTenants</value></property>
|
||||
<property name="description"><value>patch.mtFixAdminExistingTenants.description</value></property>
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5002" />
|
||||
<property name="targetSchema" value="5003" />
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.fixUserQNames" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.fixUserQNames</value></property>
|
||||
<property name="description"><value>patch.fixUserQNames.description</value></property>
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5003" />
|
||||
<property name="targetSchema" value="5004" />
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.activitiesEmailTemplate" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.activitiesEmailTemplate</value></property>
|
||||
<property name="description"><value>patch.activitiesEmailTemplate.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.newUserEmailTemplates" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.newUserEmailTemplates</value></property>
|
||||
<property name="description"><value>patch.newUserEmailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.inviteEmailTemplates" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.inviteEmailTemplates</value></property>
|
||||
<property name="description"><value>patch.inviteEmailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.htmlNotificationMailTemplates" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.htmlNotificationMailTemplates</value></property>
|
||||
<property name="description"><value>patch.htmlNotificationMailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.db-V3.4-VarcharFieldSizesQuadrupleIncreasing" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V3.4-VarcharFieldSizesQuadrupleIncreasing" />
|
||||
<property name="description" value="patch.varcharFieldSizesQuadrupleIncreasing.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5005" />
|
||||
<property name="targetSchema" value="5006" />
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.fixAclInheritance" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.fixAclInheritance</value></property>
|
||||
<property name="description"><value>patch.fixAclInheritance.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.db-V3.4-JBPM-FK-indexes" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.db-V3.4-JBPM-FK-indexes</value></property>
|
||||
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.imap.clear.old.messages" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.imap.clear.old.messages</value></property>
|
||||
<property name="description"><value>patch.imap.clear.old.messages.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.imap.clear.old.templates2" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.imap.clear.old.messages</value></property>
|
||||
<property name="description"><value>patch.imap.clear.old.messages.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.imapSpacesTemplates2" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.imapSpacesTemplates2</value></property>
|
||||
<property name="description"><value>patch.imapSpacesLocaleTemplates2.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5005</value></property>
|
||||
<property name="targetSchema"><value>5006</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.migrateAttrDropOldTables" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.migrateAttrDropOldTables</value></property>
|
||||
<property name="description"><value>patch.migrateAttrDropOldTables.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5006</value></property>
|
||||
<property name="targetSchema"><value>5007</value></property>
|
||||
<property name="applyToTenants"><value>false</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.db-V4.0-AclChangeSet" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V4.0-AclChangeSet" />
|
||||
<property name="description" value="patch.schemaUpgradeScript.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5007" />
|
||||
<property name="targetSchema" value="5008" />
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.db-V4.0-NodeAssoc-Ordering" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V4.0-NodeAssoc-Ordering" />
|
||||
<property name="description" value="patch.schemaUpgradeScript.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5008" />
|
||||
<property name="targetSchema" value="5009" />
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.db-V4.0-Node-Locale" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id" value="patch.db-V4.0-Node-Locale" />
|
||||
<property name="description" value="patch.schemaUpgradeScript.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5009" />
|
||||
<property name="targetSchema" value="5010" />
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.activitiesEmailTemplateUpdate" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id" value="patch.activitiesTemplatesUpdate" />
|
||||
<property name="description" value="patch.activitiesTemplatesUpdate.description" />
|
||||
<property name="fixesFromSchema" value="0" />
|
||||
<property name="fixesToSchema" value="5010" />
|
||||
<property name="targetSchema" value="5011" />
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.followingMailTemplates" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.followingMailTemplates</value></property>
|
||||
<property name="description"><value>patch.followingMailTemplates.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5010</value></property>
|
||||
<property name="targetSchema"><value>5011</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.db-V4.0-SubscriptionTables" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.db-V4.0-SubscriptionTables</value></property>
|
||||
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5010</value></property>
|
||||
<property name="targetSchema"><value>5011</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.copiedFromAspect" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.copiedFromAspect</value></property>
|
||||
<property name="description"><value>patch.copiedFromAspect.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5012</value></property>
|
||||
<property name="targetSchema"><value>5013</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.publishing.root" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.publishing.root</value></property>
|
||||
<property name="description"><value>patch.publishing.root.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5013</value></property>
|
||||
<property name="targetSchema"><value>5014</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.workflowNotification" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.workflowNotification</value></property>
|
||||
<property name="description"><value>patch.workflowNotification.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5014</value></property>
|
||||
<property name="targetSchema"><value>5015</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.nodeTemplatesFolder" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.nodeTemplatesFolder</value></property>
|
||||
<property name="description"><value>patch.nodeTemplatesFolder.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5015</value></property>
|
||||
<property name="targetSchema"><value>5016</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.updateMimetypes3" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.updateMimetypes3</value></property>
|
||||
<property name="description"><value>patch.updateMimetypes3.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5016</value></property>
|
||||
<property name="targetSchema"><value>5017</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="patch.sitesSpacePermissions" class="org.alfresco.repo.admin.patch.impl.NoLongerSupportedPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.sitesSpacePermissions</value></property>
|
||||
<property name="description"><value>patch.sitesSpacePermissions.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>5017</value></property>
|
||||
<property name="targetSchema"><value>5018</value></property>
|
||||
<property name="lastSupportedVersion" >
|
||||
<value>4.2.x</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<NodeRef> 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");
|
||||
}
|
||||
}
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<NodeRef> 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);
|
||||
}
|
||||
|
||||
}
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<NodeRef> 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<String> templatesToDelete = new ArrayList<String>();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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}.
|
||||
* <p/>
|
||||
* Formerly, when a document was copied, it was given a <b>cm:source</b> property on the
|
||||
* <b>cm:copiedfrom</b> aspect - a <b>d:noderef</b> property. During checkout, the
|
||||
* working copy was given the <b>cm:workingcopy</b> aspect and the <b>cm:copiedfrom</b>
|
||||
* aspect was assumed to be present. However, the ordinality of the <b>cm:copiedfrom</b>'s
|
||||
* <b>cm:source</b> property didn't match up with the checkin-checkout 1:1 relationship.
|
||||
* <p/>
|
||||
* This patch works in two parts:
|
||||
* <p/>
|
||||
* <u><b>cm:copiedfrom</b></u><br/>
|
||||
* <ul>
|
||||
* <li><b>cm:source</b> is transformed into a peer association, <b>cm:original</b></li>
|
||||
* <li>The aspect is removed where the source no longer exists</li>
|
||||
* </ul>
|
||||
* <p/>
|
||||
* <u><b>cm:workingcopy</b></u><br/>
|
||||
* <ul>
|
||||
* <li><b>cm:source</b> is transformed into a peer association, <b>cm:workingcopylink</b></li>
|
||||
* <li>The original is given aspect <b>cm:checkedout</b></li>
|
||||
* <li>The copy keeps <b>cm:workingcopy</b></li>
|
||||
* </ul>
|
||||
*
|
||||
* @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 <b>cm:auditable</b> 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<QName> qnames = new HashSet<QName>();
|
||||
qnames.add(ContentModel.ASPECT_COPIEDFROM);
|
||||
qnames.add(ContentModel.ASPECT_WORKING_COPY);
|
||||
|
||||
// Instance to provide raw data to process
|
||||
BatchProcessWorkProvider<Pair<Long, NodeRef>> workProvider = new WorkProvider(qnames);
|
||||
|
||||
// Instance to handle each item of work
|
||||
BatchProcessWorker<Pair<Long, NodeRef>> worker = new BatchProcessWorkerAdaptor<Pair<Long, NodeRef>>()
|
||||
{
|
||||
@Override
|
||||
public void beforeProcess() throws Throwable
|
||||
{
|
||||
// Run as the correct user
|
||||
AuthenticationUtil.setRunAsUser(user);
|
||||
}
|
||||
@Override
|
||||
public void process(Pair<Long, NodeRef> 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<Pair<Long, NodeRef>> batchProcessor = new BatchProcessor<Pair<Long, NodeRef>>(
|
||||
"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<Pair<Long, NodeRef>>
|
||||
{
|
||||
private long maxId = Long.MAX_VALUE;
|
||||
private long workCount = Long.MAX_VALUE;
|
||||
private long currentId = 0L;
|
||||
private final Set<QName> aspectQNames;
|
||||
|
||||
private WorkProvider(Set<QName> 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<Pair<Long, NodeRef>> getNextWork()
|
||||
{
|
||||
// Record the results
|
||||
final Set<Pair<Long, NodeRef>> results = new HashSet<Pair<Long, NodeRef>>(batchMaxQueryRange*2);
|
||||
// Record the node IDs for bulk loading
|
||||
final List<Long> nodeIds = new ArrayList<Long>(batchMaxQueryRange);
|
||||
|
||||
NodeRefQueryCallback callback = new NodeRefQueryCallback()
|
||||
{
|
||||
@Override
|
||||
public boolean handle(Pair<Long, NodeRef> 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<Long, NodeRef> 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);
|
||||
}
|
||||
}
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Map<String, Object>> rows = retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<List<Map<String, Object>>>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> execute() throws Throwable
|
||||
{
|
||||
return patchDAO.getAclsThatInheritWithInheritanceUnset();
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
for (Map<String, Object> row : rows)
|
||||
{
|
||||
Long childAclId = (Long) row.get("childAclId");
|
||||
Long childAclType = (Long) row.get("childAclType");
|
||||
Long primaryParentAclId = (Long) row.get("primaryParentAclId");
|
||||
Long primaryParentAclType = (Long) row.get("primaryParentAclType");
|
||||
Long childNodeId = (Long) row.get("childNodeId");
|
||||
|
||||
ACLType childType = ACLType.getACLTypeFromId(childAclType.intValue());
|
||||
ACLType parentType = ACLType.getACLTypeFromId(primaryParentAclType.intValue());
|
||||
|
||||
RetryingTransactionCallback<Void> cb = null;
|
||||
|
||||
switch (childType)
|
||||
{
|
||||
case DEFINING:
|
||||
cb = new FixInherited(primaryParentAclId, childAclId);
|
||||
retryingTransactionHelper.doInTransaction(cb, false, true);
|
||||
count++;
|
||||
break;
|
||||
case FIXED:
|
||||
break;
|
||||
case GLOBAL:
|
||||
break;
|
||||
case LAYERED:
|
||||
break;
|
||||
case OLD:
|
||||
break;
|
||||
case SHARED:
|
||||
cb = new FixSharedUnsetInheritanceCallback(childNodeId, primaryParentAclId, childAclId);
|
||||
retryingTransactionHelper.doInTransaction(cb, false, true);
|
||||
count++;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If we fixed up any D - S relationships with and create a new inherited ACL we may break some D - D
|
||||
// relationships
|
||||
// Fix these up after as they appear as broken inheritance
|
||||
|
||||
rows = retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<List<Map<String, Object>>>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> execute() throws Throwable
|
||||
{
|
||||
return patchDAO.getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl();
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
for (Map<String, Object> row : rows)
|
||||
{
|
||||
Long inheritedAclId = (Long) row.get("inheritedAclId");
|
||||
Long inheritedAclType = (Long) row.get("inheritedAclType");
|
||||
Long aclId = (Long) row.get("aclId");
|
||||
Long aclType = (Long) row.get("aclType");
|
||||
|
||||
ACLType inheritedType = ACLType.getACLTypeFromId(inheritedAclType.intValue());
|
||||
ACLType type = ACLType.getACLTypeFromId(aclType.intValue());
|
||||
|
||||
FixSharedAclCallback cb = new FixSharedAclCallback(inheritedAclId, aclId);
|
||||
retryingTransactionHelper.doInTransaction(cb, false, true);
|
||||
count++;
|
||||
}
|
||||
|
||||
rows = retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<List<Map<String, Object>>>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> execute() throws Throwable
|
||||
{
|
||||
return patchDAO.getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent();
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
for (Map<String, Object> row : rows)
|
||||
{
|
||||
Long childAclId = (Long) row.get("childAclId");
|
||||
Long childAclType = (Long) row.get("childAclType");
|
||||
Long primaryParentAclId = (Long) row.get("primaryParentAclId");
|
||||
Long primaryParentAclType = (Long) row.get("primaryParentAclType");
|
||||
Long childNodeId = (Long) row.get("childNodeId");
|
||||
|
||||
ACLType childType = ACLType.getACLTypeFromId(childAclType.intValue());
|
||||
ACLType parentType = ACLType.getACLTypeFromId(primaryParentAclType.intValue());
|
||||
|
||||
FixSharedAclCallback cb = new FixSharedAclCallback(primaryParentAclId, childAclId);
|
||||
retryingTransactionHelper.doInTransaction(cb, false, true);
|
||||
count++;
|
||||
}
|
||||
|
||||
rows = retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<List<Map<String, Object>>>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> execute() throws Throwable
|
||||
{
|
||||
return patchDAO.getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent();
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
for (Map<String, Object> row : rows)
|
||||
{
|
||||
Long childAclId = (Long) row.get("childAclId");
|
||||
Long childAclType = (Long) row.get("childAclType");
|
||||
Long primaryParentAclId = (Long) row.get("primaryParentAclId");
|
||||
Long primaryParentAclType = (Long) row.get("primaryParentAclType");
|
||||
Long childNodeId = (Long) row.get("childNodeId");
|
||||
|
||||
ACLType childType = ACLType.getACLTypeFromId(childAclType.intValue());
|
||||
ACLType parentType = ACLType.getACLTypeFromId(primaryParentAclType.intValue());
|
||||
|
||||
FixInherited cb = new FixInherited(primaryParentAclId, childAclId);
|
||||
retryingTransactionHelper.doInTransaction(cb, false, true);
|
||||
count++;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
rows = retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<List<Map<String, Object>>>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> execute() throws Throwable
|
||||
{
|
||||
return patchDAO.getAclsThatInheritFromNonPrimaryParent();
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
for (Map<String, Object> row : rows)
|
||||
{
|
||||
Long childAclId = (Long) row.get("childAclId");
|
||||
Long childAclType = (Long) row.get("childAclType");
|
||||
Long primaryParentAclId = (Long) row.get("primaryParentAclId");
|
||||
Long primaryParentAclType = (Long) row.get("primaryParentAclType");
|
||||
Long childNodeId = (Long) row.get("childNodeId");
|
||||
|
||||
ACLType childType = ACLType.getACLTypeFromId(childAclType.intValue());
|
||||
ACLType parentType = ACLType.getACLTypeFromId(primaryParentAclType.intValue());
|
||||
|
||||
RetryingTransactionCallback<Void> cb = null;
|
||||
switch (childType)
|
||||
{
|
||||
case DEFINING:
|
||||
cb = new FixInherited(primaryParentAclId, childAclId);
|
||||
retryingTransactionHelper.doInTransaction(cb, false, true);
|
||||
count++;
|
||||
break;
|
||||
case FIXED:
|
||||
break;
|
||||
case GLOBAL:
|
||||
break;
|
||||
case LAYERED:
|
||||
break;
|
||||
case OLD:
|
||||
break;
|
||||
case SHARED:
|
||||
cb = new SetFixedAclsCallback(childNodeId, primaryParentAclId, childAclId);
|
||||
retryingTransactionHelper.doInTransaction(cb, false, true);
|
||||
count++;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// build the result message
|
||||
String msg = I18NUtil.getMessage(FixAclInheritancePatch.MSG_SUCCESS, count);
|
||||
// done
|
||||
return msg;
|
||||
|
||||
}
|
||||
|
||||
private class FixSharedUnsetInheritanceCallback implements RetryingTransactionCallback<Void>
|
||||
{
|
||||
|
||||
Long childNodeId;
|
||||
|
||||
Long primaryParentAclId;
|
||||
|
||||
Long childAclId;
|
||||
|
||||
FixSharedUnsetInheritanceCallback(Long childNodeId, Long primaryParentAclId, Long childAclId)
|
||||
{
|
||||
this.childNodeId = childNodeId;
|
||||
this.primaryParentAclId = primaryParentAclId;
|
||||
this.childAclId = childAclId;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback#execute()
|
||||
*/
|
||||
@Override
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
Long inheritedAclId = aclDAO.getInheritedAccessControlList(primaryParentAclId);
|
||||
if (inheritedAclId.equals(childAclId))
|
||||
{
|
||||
// child acl does match inherited from primary parent
|
||||
// needs to set inherits_from correctly and fix up
|
||||
aclDAO.fixSharedAcl(primaryParentAclId, childAclId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// child acl does not match inherited from primary parent
|
||||
// need to replace the shared acl
|
||||
List<AclChange> changes = new ArrayList<AclChange>();
|
||||
accessControlListDao.setFixedAcls(childNodeId, primaryParentAclId, null, childAclId, changes, true);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class SetFixedAclsCallback implements RetryingTransactionCallback<Void>
|
||||
{
|
||||
Long childNodeId;
|
||||
|
||||
Long primaryParentAclId;
|
||||
|
||||
Long childAclId;
|
||||
|
||||
SetFixedAclsCallback(Long childNodeId, Long primaryParentAclId, Long childAclId)
|
||||
{
|
||||
this.childNodeId = childNodeId;
|
||||
this.primaryParentAclId = primaryParentAclId;
|
||||
this.childAclId = childAclId;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback#execute()
|
||||
*/
|
||||
@Override
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
List<AclChange> changes = new ArrayList<AclChange>();
|
||||
accessControlListDao.setFixedAcls(childNodeId, primaryParentAclId, null, childAclId, changes, true);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private class FixSharedAclCallback implements RetryingTransactionCallback<Void>
|
||||
{
|
||||
|
||||
Long inheritedAclId;
|
||||
|
||||
Long aclId;
|
||||
|
||||
FixSharedAclCallback(Long inheritedAclId, Long aclId)
|
||||
{
|
||||
this.inheritedAclId = inheritedAclId;
|
||||
this.aclId = aclId;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback#execute()
|
||||
*/
|
||||
@Override
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
aclDAO.fixSharedAcl(inheritedAclId, aclId);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class FixInherited implements RetryingTransactionCallback<Void>
|
||||
{
|
||||
|
||||
Long primaryParentAclId;
|
||||
|
||||
Long childAclId;
|
||||
|
||||
FixInherited(Long primaryParentAclId, Long childAclId)
|
||||
{
|
||||
this.primaryParentAclId = primaryParentAclId;
|
||||
this.childAclId = childAclId;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback#execute()
|
||||
*/
|
||||
@Override
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
aclDAO.enableInheritance(childAclId, primaryParentAclId);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,180 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program 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 General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.repo.admin.patch.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.admin.patch.AbstractPatch;
|
||||
import org.alfresco.repo.batch.BatchProcessor;
|
||||
import org.alfresco.repo.batch.BatchProcessor.BatchProcessWorker;
|
||||
import org.alfresco.repo.domain.qname.QNameDAO;
|
||||
import org.alfresco.repo.importer.ImporterBootstrap;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.rule.RuleService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.context.ApplicationEventPublisherAware;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Gives user store entries unique qnames to allow fast database lookup of local authentication information.
|
||||
*
|
||||
* @author David Ward
|
||||
* @since 3.3.5
|
||||
*/
|
||||
public class FixUserQNamesPatch extends AbstractPatch implements ApplicationEventPublisherAware
|
||||
{
|
||||
private static final Log logger = LogFactory.getLog(FixUserQNamesPatch.class);
|
||||
private static final String MSG_SUCCESS = "patch.fixUserQNames.result";
|
||||
|
||||
private QNameDAO qnameDAO;
|
||||
private RuleService ruleService;
|
||||
private ImporterBootstrap userBootstrap;
|
||||
|
||||
public FixUserQNamesPatch()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param qnameDAO
|
||||
* resolved QNames
|
||||
*/
|
||||
public void setQnameDAO(QNameDAO qnameDAO)
|
||||
{
|
||||
this.qnameDAO = qnameDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ruleService
|
||||
* the rule service
|
||||
*/
|
||||
public void setRuleService(RuleService ruleService)
|
||||
{
|
||||
this.ruleService = ruleService;
|
||||
}
|
||||
|
||||
public void setUserBootstrap(ImporterBootstrap userBootstrap)
|
||||
{
|
||||
this.userBootstrap = userBootstrap;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkProperties()
|
||||
{
|
||||
super.checkProperties();
|
||||
checkPropertyNotNull(qnameDAO, "qnameDAO");
|
||||
checkPropertyNotNull(userBootstrap, "userBootstrap");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String applyInternal() throws Exception
|
||||
{
|
||||
// Get the ChildAssociationRefs
|
||||
List<ChildAssociationRef> toProcess = nodeService.getChildAssocs(
|
||||
getUserFolderLocation(),
|
||||
ContentModel.ASSOC_CHILDREN,
|
||||
ContentModel.TYPE_USER,
|
||||
false);
|
||||
BatchProcessor<ChildAssociationRef> batchProcessor = new BatchProcessor<ChildAssociationRef>(
|
||||
"FixUserQNamesPatch",
|
||||
transactionHelper,
|
||||
toProcess,
|
||||
2,
|
||||
20,
|
||||
this.applicationEventPublisher, logger, 1000);
|
||||
|
||||
final String runAsUser = AuthenticationUtil.getRunAsUser();
|
||||
|
||||
int updated = batchProcessor.process(new BatchProcessWorker<ChildAssociationRef>()
|
||||
{
|
||||
public void beforeProcess() throws Throwable
|
||||
{
|
||||
// Disable rules
|
||||
ruleService.disableRules();
|
||||
AuthenticationUtil.setRunAsUser(runAsUser);
|
||||
}
|
||||
|
||||
public void afterProcess() throws Throwable
|
||||
{
|
||||
// Enable rules
|
||||
ruleService.enableRules();
|
||||
AuthenticationUtil.clearCurrentSecurityContext();
|
||||
}
|
||||
|
||||
public String getIdentifier(ChildAssociationRef entry)
|
||||
{
|
||||
return entry.getChildRef().toString();
|
||||
}
|
||||
|
||||
public void process(ChildAssociationRef entry) throws Throwable
|
||||
{
|
||||
QName userQName = QName.createQName(
|
||||
ContentModel.USER_MODEL_URI,
|
||||
(String) nodeService.getProperty(entry.getChildRef(), ContentModel.PROP_USER_USERNAME));
|
||||
|
||||
// Only a user called "user" will stay in place
|
||||
if (!userQName.equals(ContentModel.TYPE_USER))
|
||||
{
|
||||
nodeService.moveNode(entry.getChildRef(), entry.getParentRef(), entry.getTypeQName(), userQName);
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
return I18NUtil.getMessage(MSG_SUCCESS, updated);
|
||||
}
|
||||
|
||||
private NodeRef getUserFolderLocation()
|
||||
{
|
||||
NodeRef rootNode = this.nodeService.getRootNode(this.userBootstrap.getStoreRef());
|
||||
QName qnameAssocSystem = QName.createQName("sys", "system", namespaceService);
|
||||
QName qnameAssocUsers = QName.createQName("sys", "people", namespaceService);
|
||||
List<ChildAssociationRef> results = nodeService.getChildAssocs(rootNode, RegexQNamePattern.MATCH_ALL,
|
||||
qnameAssocSystem);
|
||||
NodeRef sysNodeRef = null;
|
||||
if (results.size() == 0)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Required authority system folder path not found: "
|
||||
+ qnameAssocSystem);
|
||||
}
|
||||
else
|
||||
{
|
||||
sysNodeRef = results.get(0).getChildRef();
|
||||
}
|
||||
results = nodeService.getChildAssocs(sysNodeRef, RegexQNamePattern.MATCH_ALL, qnameAssocUsers);
|
||||
if (results.size() == 0)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Required user folder path not found: " + qnameAssocUsers);
|
||||
}
|
||||
else
|
||||
{
|
||||
return results.get(0).getChildRef();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,52 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.admin.patch.impl;
|
||||
|
||||
import org.alfresco.repo.admin.patch.AbstractPatch;
|
||||
import org.alfresco.repo.domain.patch.PatchDAO;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Migrate attributes (drop tables 'alf_*attribute*')
|
||||
*
|
||||
* @author Derek Hulley
|
||||
* @since 4.0
|
||||
*/
|
||||
public class MigrateAttrDropOldTablesPatch extends AbstractPatch
|
||||
{
|
||||
private static final String MSG_SUCCESS = "patch.migrateAttrDropOldTables.result";
|
||||
|
||||
private PatchDAO patchDAO;
|
||||
|
||||
public void setPatchDAO(PatchDAO patchDAO)
|
||||
{
|
||||
this.patchDAO = patchDAO;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String applyInternal() throws Exception
|
||||
{
|
||||
patchDAO.migrateOldAttrDropTables();
|
||||
|
||||
// build the result message
|
||||
String msg = I18NUtil.getMessage(MSG_SUCCESS);
|
||||
// done
|
||||
return msg;
|
||||
}
|
||||
}
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.admin.patch.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.admin.patch.AbstractPatch;
|
||||
import org.alfresco.repo.domain.node.NodeDAO;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* MT ALF-6029 - fix bootstrapped creator/modifier and change "admin" to "System@xxx" (or "System" in case of default domain) for given nodes (ie. "Models" and "Workflow Definitions")
|
||||
*/
|
||||
public class MultiTFixAdminExistingTenantsPatch extends AbstractPatch
|
||||
{
|
||||
private static final String MSG_RESULT = "patch.mtFixAdminExistingTenants.result";
|
||||
|
||||
private TenantService tenantService;
|
||||
private BehaviourFilter policyBehaviourFilter;
|
||||
private NodeDAO nodeDAO;
|
||||
|
||||
private List<String> pathsToNodes;
|
||||
|
||||
public void setTenantService(TenantService tenantService)
|
||||
{
|
||||
this.tenantService = tenantService;
|
||||
}
|
||||
|
||||
public void setNodeDAO(NodeDAO nodeDAO)
|
||||
{
|
||||
this.nodeDAO = nodeDAO;
|
||||
}
|
||||
|
||||
public void setPolicyBehaviourFilter(BehaviourFilter policyBehaviourFilter)
|
||||
{
|
||||
this.policyBehaviourFilter = policyBehaviourFilter;
|
||||
}
|
||||
|
||||
public void setPathsToNodes(List<String> pathsToNodes)
|
||||
{
|
||||
this.pathsToNodes = pathsToNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.admin.patch.AbstractPatch#checkProperties()
|
||||
*/
|
||||
@Override
|
||||
protected void checkProperties()
|
||||
{
|
||||
super.checkProperties();
|
||||
|
||||
checkPropertyNotNull(this.tenantService, "tenantService");
|
||||
checkPropertyNotNull(this.nodeDAO, "nodeDAO");
|
||||
checkPropertyNotNull(this.pathsToNodes, "pathsToNodes");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.admin.patch.AbstractPatch#applyInternal()
|
||||
*/
|
||||
@Override
|
||||
protected String applyInternal() throws Exception
|
||||
{
|
||||
String currentUserDomain = tenantService.getCurrentUserDomain();
|
||||
|
||||
for (String xpathToNode : pathsToNodes)
|
||||
{
|
||||
fixAuditable(currentUserDomain, xpathToNode);
|
||||
}
|
||||
|
||||
return I18NUtil.getMessage(MSG_RESULT);
|
||||
}
|
||||
|
||||
private void fixAuditable(String currentUserDomain, String xpathToNode)
|
||||
{
|
||||
NodeRef rootNodeRef = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
|
||||
List<NodeRef> nodeRefs = searchService.selectNodes(rootNodeRef,
|
||||
xpathToNode,
|
||||
null,
|
||||
namespaceService,
|
||||
false,
|
||||
SearchService.LANGUAGE_XPATH);
|
||||
|
||||
if (nodeRefs.size() > 0)
|
||||
{
|
||||
NodeRef nodeRef = nodeRefs.get(0);
|
||||
|
||||
Pair<Long, NodeRef> nodePair = nodeDAO.getNodePair(tenantService.getName(nodeRef)); // add tenant domain (since going via nodeDAO)
|
||||
if (nodePair != null)
|
||||
{
|
||||
String tenantSystem = tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), currentUserDomain);
|
||||
|
||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(2);
|
||||
props.put(ContentModel.PROP_MODIFIER, tenantSystem);
|
||||
props.put(ContentModel.PROP_CREATOR, tenantSystem);
|
||||
|
||||
try
|
||||
{
|
||||
policyBehaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
|
||||
nodeDAO.addNodeProperties(nodePair.getFirst(), props); // update only
|
||||
}
|
||||
finally
|
||||
{
|
||||
policyBehaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,159 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.admin.patch.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
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.alfresco.service.cmr.security.PermissionService;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Patch to remove the GROUP_EVERYONE Contributor permissions on the
|
||||
* Sites Space (/
|
||||
* <p/>
|
||||
* Formerly, all users could create anything in this folder. As only
|
||||
* Sites should live there, and the SiteService handles permissions itself,
|
||||
* the Contributor permission can be removed.
|
||||
*
|
||||
* @author Nick Burch
|
||||
* @since 4.0
|
||||
*/
|
||||
public class SitesSpacePermissionsPatch extends AbstractPatch
|
||||
{
|
||||
// Message IDs
|
||||
private static final String MSG_SUCCESS = "patch.sitesSpacePermissions.result";
|
||||
private static final String MSG_SUCCESS_NONE = "patch.sitesSpacePermissions.result.none";
|
||||
|
||||
// Folders' names for path building
|
||||
private static final String PROPERTY_COMPANY_HOME_CHILDNAME = "spaces.company_home.childname";
|
||||
private static final String PROPERTY_SITES_CHILDNAME = "spaces.sites.childname";
|
||||
|
||||
// Things we've found
|
||||
private NodeRef sitesNodeRef;
|
||||
|
||||
// Dependencies
|
||||
private ImporterBootstrap importerBootstrap;
|
||||
private PermissionService permissionService;
|
||||
|
||||
public void setImporterBootstrap(ImporterBootstrap importerBootstrap)
|
||||
{
|
||||
this.importerBootstrap = importerBootstrap;
|
||||
}
|
||||
public void setPermissionService(PermissionService permissionService)
|
||||
{
|
||||
this.permissionService = permissionService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkProperties()
|
||||
{
|
||||
super.checkProperties();
|
||||
checkPropertyNotNull(importerBootstrap, "importerBootstrap");
|
||||
checkPropertyNotNull(permissionService, "permissionService");
|
||||
}
|
||||
|
||||
public SitesSpacePermissionsPatch()
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
// Build up the Assocation Names that form the path
|
||||
Properties configuration = importerBootstrap.getConfiguration();
|
||||
|
||||
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 sitesChildName = configuration.getProperty(PROPERTY_SITES_CHILDNAME);
|
||||
if (sitesChildName == null || sitesChildName.length() == 0)
|
||||
{
|
||||
throw new PatchException("Bootstrap property '" + PROPERTY_SITES_CHILDNAME + "' is not present");
|
||||
}
|
||||
|
||||
// build the search string to get the sites node
|
||||
StringBuilder sb = new StringBuilder(256);
|
||||
sb.append("/").append(companyHomeChildName);
|
||||
sb.append("/").append(sitesChildName);
|
||||
String xpath = sb.toString();
|
||||
// get the sites node
|
||||
List<NodeRef> nodeRefs = searchService.selectNodes(storeRootNodeRef, xpath, null, namespaceService, false);
|
||||
if (nodeRefs.size() == 0)
|
||||
{
|
||||
throw new PatchException("XPath didn't return any results: \n" + " root: " + storeRootNodeRef + "\n" + " xpath: " + xpath);
|
||||
}
|
||||
else if (nodeRefs.size() > 1)
|
||||
{
|
||||
throw new PatchException("XPath returned too many results: \n" + " root: " + storeRootNodeRef + "\n" + " xpath: " + xpath + "\n" + " results: " + nodeRefs);
|
||||
}
|
||||
this.sitesNodeRef = nodeRefs.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String applyInternal() throws Exception
|
||||
{
|
||||
setUp();
|
||||
|
||||
// Get the sites space
|
||||
NodeRef sitesSpace = sitesNodeRef;
|
||||
if(sitesSpace == null || !nodeService.exists(sitesSpace))
|
||||
{
|
||||
throw new IllegalStateException("Sites Space not found in Company Home!");
|
||||
}
|
||||
|
||||
String msg = I18NUtil.getMessage(MSG_SUCCESS);
|
||||
try
|
||||
{
|
||||
// Remove the permission
|
||||
permissionService.deletePermission(
|
||||
sitesSpace,
|
||||
PermissionService.ALL_AUTHORITIES,
|
||||
PermissionService.CONTRIBUTOR
|
||||
);
|
||||
}
|
||||
catch (IllegalStateException e)
|
||||
{
|
||||
if (e.getMessage().contains("SHARED"))
|
||||
{
|
||||
// ALF-11489: 'patch.sitesSpacePermissions' failed on upgrade 2.2.8 -> 3.4.6
|
||||
// We are catching "Can not delete from this acl in a node context SHARED"
|
||||
msg = I18NUtil.getMessage(MSG_SUCCESS_NONE);
|
||||
}
|
||||
// Something else
|
||||
}
|
||||
|
||||
// All done
|
||||
return msg;
|
||||
}
|
||||
}
|
@@ -19,7 +19,6 @@
|
||||
package org.alfresco.repo.domain.patch;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -57,36 +56,6 @@ public interface PatchDAO
|
||||
*/
|
||||
public List<Pair<NodeRef, String>> getNodesOfTypeWithNamePattern(QName typeQName, String namePattern);
|
||||
|
||||
/**
|
||||
* Drop old attribute alf_*attribute* tables
|
||||
*/
|
||||
public void migrateOldAttrDropTables();
|
||||
|
||||
/**
|
||||
* Get shared acls with inheritance issues
|
||||
*/
|
||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent();
|
||||
|
||||
/**
|
||||
* Get defining acls with inheritance issues
|
||||
*/
|
||||
public List<Map<String, Object>> getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent();
|
||||
|
||||
/**
|
||||
* Get acls that do not inherit from the primary parent.
|
||||
*/
|
||||
public List<Map<String, Object>> getAclsThatInheritFromNonPrimaryParent();
|
||||
|
||||
/**
|
||||
* Get acls that inherit with inheritance unset
|
||||
*/
|
||||
public List<Map<String, Object>> getAclsThatInheritWithInheritanceUnset();
|
||||
|
||||
/**
|
||||
* Get shared acls that do not inherit correctly from the defining acl
|
||||
*/
|
||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl();
|
||||
|
||||
/**
|
||||
* @param qnames the qnames to search for
|
||||
* @return Returns a count of the number of nodes that have either of the aspects
|
||||
|
@@ -60,18 +60,6 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
|
||||
private static final String UPDATE_CONTENT_MIMETYPE_ID = "alfresco.patch.update_contentMimetypeId";
|
||||
|
||||
private static final String DROP_OLD_ATTR_LIST = "alfresco.patch.drop_oldAttrAlfListAttributeEntries";
|
||||
private static final String DROP_OLD_ATTR_MAP = "alfresco.patch.drop_oldAttrAlfMapAttributeEntries";
|
||||
private static final String DROP_OLD_ATTR_GLOBAL = "alfresco.patch.drop_oldAttrAlfGlobalAttributes";
|
||||
private static final String DROP_OLD_ATTR = "alfresco.patch.drop_oldAttrAlfAttributes";
|
||||
private static final String DROP_OLD_ATTR_SEQ = "alfresco.patch.drop_oldAttrAlfAttributes_seq";
|
||||
|
||||
private static final String SELECT_ACLS_THAT_INHERIT_FROM_NON_PRIMARY_PARENT = "alfresco.patch.select_aclsThatInheritFromNonPrimaryParent";
|
||||
private static final String SELECT_ACLS_THAT_INHERIT_WITH_INHERITANCE_UNSET = "alfresco.patch.select_aclsThatInheritWithInheritanceUnset";
|
||||
private static final String SELECT_DEFINING_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT = "alfresco.patch.select_definingAclsThatDoNotInheritCorrectlyFromThePrimaryParent";
|
||||
private static final String SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT = "alfresco.patch.select_sharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent";
|
||||
private static final String SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THEIR_DEFINING_ACL = "alfresco.patch.select_sharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl";
|
||||
|
||||
private static final String SELECT_COUNT_NODES_WITH_ASPECTS = "alfresco.patch.select_CountNodesWithAspectIds";
|
||||
|
||||
private static final String SELECT_NODES_BY_TYPE_QNAME = "alfresco.patch.select_NodesByTypeQName";
|
||||
@@ -199,60 +187,6 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void migrateOldAttrDropTables()
|
||||
{
|
||||
template.update(DROP_OLD_ATTR_LIST);
|
||||
template.update(DROP_OLD_ATTR_MAP);
|
||||
template.update(DROP_OLD_ATTR_GLOBAL);
|
||||
template.update(DROP_OLD_ATTR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getAclsThatInheritFromNonPrimaryParent()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.selectList(
|
||||
SELECT_ACLS_THAT_INHERIT_FROM_NON_PRIMARY_PARENT,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getAclsThatInheritWithInheritanceUnset()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.selectList(
|
||||
SELECT_ACLS_THAT_INHERIT_WITH_INHERITANCE_UNSET,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.selectList(
|
||||
SELECT_DEFINING_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.selectList(
|
||||
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THE_PRIMARY_PARENT,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl()
|
||||
{
|
||||
List<Map<String, Object>> rows = template.selectList(
|
||||
SELECT_SHARED_ACLS_THAT_DO_NOT_INHERIT_CORRECTLY_FROM_THEIR_DEFINING_ACL,
|
||||
Boolean.TRUE);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCountNodesWithAspects(Set<QName> qnames)
|
||||
{
|
||||
@@ -388,12 +322,6 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
*/
|
||||
public static class PostgreSQL extends PatchDAOImpl
|
||||
{
|
||||
@Override
|
||||
public void migrateOldAttrDropTables()
|
||||
{
|
||||
super.migrateOldAttrDropTables();
|
||||
template.update(DROP_OLD_ATTR_SEQ);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,11 +332,5 @@ public class PatchDAOImpl extends AbstractPatchDAOImpl
|
||||
*/
|
||||
public static class Oracle extends PatchDAOImpl
|
||||
{
|
||||
@Override
|
||||
public void migrateOldAttrDropTables()
|
||||
{
|
||||
super.migrateOldAttrDropTables();
|
||||
template.update(DROP_OLD_ATTR_SEQ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user