diff --git a/config/alfresco/attributes-service-context.xml b/config/alfresco/attributes-service-context.xml
index 4d468fa4c6..8f59d61e67 100644
--- a/config/alfresco/attributes-service-context.xml
+++ b/config/alfresco/attributes-service-context.xml
@@ -4,6 +4,29 @@
+
+
+
+
+
+
+
+ 500
+
+
+ 250
+
+
+
+
+
+
+
+
+ 100
+
+
+
org.alfresco.service.cmr.attributes.AttributeService
@@ -13,7 +36,7 @@
- avmSessionSizeResourceInterceptor
+ attrSessionSizeResourceInterceptor
diff --git a/config/alfresco/avm-services-context.xml b/config/alfresco/avm-services-context.xml
index 3d30520a9e..92412f7ced 100644
--- a/config/alfresco/avm-services-context.xml
+++ b/config/alfresco/avm-services-context.xml
@@ -4,79 +4,58 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -295,27 +274,5 @@
workspace://SpacesStore
-
-
-
-
-
-
-
-
- 500
-
-
- 250
-
-
-
-
-
-
-
-
- 100
-
-
+
diff --git a/config/alfresco/bootstrap-context.xml b/config/alfresco/bootstrap-context.xml
index 415079a0e5..53c7e94a20 100644
--- a/config/alfresco/bootstrap-context.xml
+++ b/config/alfresco/bootstrap-context.xml
@@ -80,6 +80,7 @@
classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-ContentTables.sql
classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-PropertyValueTables.sql
classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-AuditTables.sql
+ classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-AvmTables.sql
diff --git a/config/alfresco/cache-context.xml b/config/alfresco/cache-context.xml
index d74d787452..4de375f170 100644
--- a/config/alfresco/cache-context.xml
+++ b/config/alfresco/cache-context.xml
@@ -530,42 +530,173 @@
+
-
+
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.avm.storeLookupSharedCache
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
- org.alfresco.repo.avm.storeLookupTransactionalCache
-
-
- 200
-
+
+
+
+
+
+
+
+ org.alfresco.cache.avm.avmStoreCache
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avmStoreTransactionalCache
+
+
+ 1000
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avm.avmEntityCache
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avmEntityTransactionalCache
+
+
+ 1000
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avm.avmVersionRootEntityCache
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avmVersionRootEntityTransactionalCache
+
+
+ 100
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avm.avmNodeCache
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avmNodeTransactionalCache
+
+
+ 1000
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avm.avmNodeAspectsCache
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.alfresco.cache.avmNodeAspectsTransactionalCache
+
+
+ 100
+
+
+
diff --git a/config/alfresco/content-services-context.xml b/config/alfresco/content-services-context.xml
index c3fb0224bb..54a7794934 100644
--- a/config/alfresco/content-services-context.xml
+++ b/config/alfresco/content-services-context.xml
@@ -53,7 +53,7 @@
-
+
diff --git a/config/alfresco/dao/dao-context.xml b/config/alfresco/dao/dao-context.xml
index 3d45b80334..aa4cbbb7a5 100644
--- a/config/alfresco/dao/dao-context.xml
+++ b/config/alfresco/dao/dao-context.xml
@@ -64,4 +64,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config/alfresco/dbscripts/create/2.2/org.hibernate.dialect.Dialect/AlfrescoPostCreate-2.2-Extra.sql b/config/alfresco/dbscripts/create/2.2/org.hibernate.dialect.Dialect/AlfrescoPostCreate-2.2-Extra.sql
index 6599634fd8..59423d243f 100644
--- a/config/alfresco/dbscripts/create/2.2/org.hibernate.dialect.Dialect/AlfrescoPostCreate-2.2-Extra.sql
+++ b/config/alfresco/dbscripts/create/2.2/org.hibernate.dialect.Dialect/AlfrescoPostCreate-2.2-Extra.sql
@@ -39,15 +39,3 @@ ALTER TABLE alf_node_properties ADD CONSTRAINT fk_alf_nprop_loc FOREIGN KEY (loc
CREATE INDEX fk_alf_perm_tqn ON alf_permission (type_qname_id);
ALTER TABLE alf_permission ADD CONSTRAINT fk_alf_perm_tqn FOREIGN KEY (type_qname_id) REFERENCES alf_qname (id);
-CREATE INDEX fk_avm_nasp_qn ON avm_aspects (qname_id);
-ALTER TABLE avm_aspects ADD CONSTRAINT fk_avm_nasp_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id);
-
-CREATE INDEX fk_avm_nprop_qn ON avm_node_properties (qname_id);
-ALTER TABLE avm_node_properties ADD CONSTRAINT fk_avm_nprop_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id);
-
-CREATE INDEX fk_avm_sprop_qname ON avm_store_properties (qname_id);
-ALTER TABLE avm_store_properties ADD CONSTRAINT fk_avm_sprop_qname FOREIGN KEY (qname_id) REFERENCES alf_qname (id);
-
-CREATE INDEX idx_avm_hl_revpk ON avm_history_links (descendent, ancestor);
-
-CREATE INDEX idx_avm_vr_revuq ON avm_version_roots (avm_store_id, version_id);
diff --git a/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AvmTables.sql b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AvmTables.sql
new file mode 100644
index 0000000000..a5552fda73
--- /dev/null
+++ b/config/alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AvmTables.sql
@@ -0,0 +1,248 @@
+--
+-- Title: Create AVM tables
+-- Database: MySQL InnoDB
+-- Since: V3.2.0 Schema 3002
+-- Author: janv
+--
+-- Please contact support@alfresco.com if you need assistance with the upgrade.
+--
+
+ create table avm_aspects (
+ node_id bigint not null,
+ qname_id bigint not null,
+ primary key (node_id, qname_id)
+ ) type=InnoDB;
+
+ create table avm_child_entries (
+ parent_id bigint not null,
+ name varchar(160) not null,
+ child_id bigint not null,
+ primary key (parent_id, name)
+ ) type=InnoDB;
+
+ create table avm_history_links (
+ ancestor bigint not null,
+ descendent bigint not null,
+ primary key (ancestor, descendent)
+ ) type=InnoDB;
+
+ create table avm_merge_links (
+ mfrom bigint not null,
+ mto bigint not null,
+ primary key (mfrom, mto)
+ ) type=InnoDB;
+
+ create table avm_node_properties (
+ node_id bigint not null,
+ actual_type_n integer not null,
+ persisted_type_n integer not null,
+ multi_valued bit not null,
+ boolean_value bit,
+ long_value bigint,
+ float_value float,
+ double_value double precision,
+ string_value text,
+ serializable_value blob,
+ qname_id bigint not null,
+ primary key (node_id, qname_id)
+ ) type=InnoDB;
+
+ create table avm_nodes (
+ id bigint not null auto_increment,
+ class_type varchar(20) not null,
+ vers bigint not null,
+ version_id integer not null,
+ guid varchar(36),
+ creator varchar(255) not null,
+ owner varchar(255) not null,
+ lastModifier varchar(255) not null,
+ createDate bigint not null,
+ modDate bigint not null,
+ accessDate bigint not null,
+ is_root bit,
+ store_new_id bigint,
+ acl_id bigint,
+ deletedType integer,
+ layer_id bigint,
+ indirection text,
+ indirection_version integer,
+ primary_indirection bit,
+ opacity bit,
+ content_url varchar(128),
+ mime_type varchar(100),
+ encoding varchar(16),
+ length bigint,
+ primary key (id)
+ ) type=InnoDB;
+
+ create table avm_store_properties (
+ id bigint not null auto_increment,
+ avm_store_id bigint,
+ qname_id bigint not null,
+ actual_type_n integer not null,
+ persisted_type_n integer not null,
+ multi_valued bit not null,
+ boolean_value bit,
+ long_value bigint,
+ float_value float,
+ double_value double precision,
+ string_value text,
+ serializable_value blob,
+ primary key (id)
+ ) type=InnoDB;
+
+ create table avm_stores (
+ id bigint not null auto_increment,
+ vers bigint not null,
+ name varchar(255) unique,
+ next_version_id integer not null,
+ current_root_id bigint,
+ acl_id bigint,
+ primary key (id)
+ ) type=InnoDB;
+
+ create table avm_version_layered_node_entry (
+ version_root_id bigint not null,
+ md5sum varchar(32) not null,
+ path text,
+ primary key (version_root_id, md5sum)
+ ) type=InnoDB;
+
+ create table avm_version_roots (
+ id bigint not null auto_increment,
+ version_id integer not null,
+ avm_store_id bigint not null,
+ create_date bigint not null,
+ creator varchar(255) not null,
+ root_id bigint not null,
+ tag varchar(255),
+ description text,
+ primary key (id),
+ unique (version_id, avm_store_id)
+ ) type=InnoDB;
+
+ alter table avm_aspects
+ add index fk_avm_nasp_n (node_id),
+ add constraint fk_avm_nasp_n
+ foreign key (node_id)
+ references avm_nodes (id);
+
+ alter table avm_child_entries
+ add index fk_avm_ce_child (child_id),
+ add constraint fk_avm_ce_child
+ foreign key (child_id)
+ references avm_nodes (id);
+
+ alter table avm_child_entries
+ add index fk_avm_ce_parent (parent_id),
+ add constraint fk_avm_ce_parent
+ foreign key (parent_id)
+ references avm_nodes (id);
+
+ alter table avm_history_links
+ add index fk_avm_hl_desc (descendent),
+ add constraint fk_avm_hl_desc
+ foreign key (descendent)
+ references avm_nodes (id);
+
+ alter table avm_history_links
+ add index fk_avm_hl_ancestor (ancestor),
+ add constraint fk_avm_hl_ancestor
+ foreign key (ancestor)
+ references avm_nodes (id);
+
+ alter table avm_merge_links
+ add index fk_avm_ml_from (mfrom),
+ add constraint fk_avm_ml_from
+ foreign key (mfrom)
+ references avm_nodes (id);
+
+ alter table avm_merge_links
+ add index fk_avm_ml_to (mto),
+ add constraint fk_avm_ml_to
+ foreign key (mto)
+ references avm_nodes (id);
+
+ alter table avm_node_properties
+ add index fk_avm_nprop_n (node_id),
+ add constraint fk_avm_nprop_n
+ foreign key (node_id)
+ references avm_nodes (id);
+
+ create index idx_avm_n_pi on avm_nodes (primary_indirection);
+
+ alter table avm_nodes
+ add index fk_avm_n_acl (acl_id),
+ add constraint fk_avm_n_acl
+ foreign key (acl_id)
+ references alf_access_control_list (id);
+
+ alter table avm_nodes
+ add index fk_avm_n_store (store_new_id),
+ add constraint fk_avm_n_store
+ foreign key (store_new_id)
+ references avm_stores (id);
+
+ alter table avm_store_properties
+ add index fk_avm_sprop_store (avm_store_id),
+ add constraint fk_avm_sprop_store
+ foreign key (avm_store_id)
+ references avm_stores (id);
+
+ alter table avm_stores
+ add index fk_avm_s_root (current_root_id),
+ add constraint fk_avm_s_root
+ foreign key (current_root_id)
+ references avm_nodes (id);
+
+ alter table avm_stores
+ add index fk_avm_s_acl (acl_id),
+ add constraint fk_avm_s_acl
+ foreign key (acl_id)
+ references alf_access_control_list (id);
+
+ alter table avm_version_layered_node_entry
+ add index fk_avm_vlne_vr (version_root_id),
+ add constraint fk_avm_vlne_vr
+ foreign key (version_root_id)
+ references avm_version_roots (id);
+
+ create index idx_avm_vr_version on avm_version_roots (version_id);
+
+ alter table avm_version_roots
+ add index fk_avm_vr_store (avm_store_id),
+ add constraint fk_avm_vr_store
+ foreign key (avm_store_id)
+ references avm_stores (id);
+
+ alter table avm_version_roots
+ add index fk_avm_vr_root (root_id),
+ add constraint fk_avm_vr_root
+ foreign key (root_id)
+ references avm_nodes (id);
+
+CREATE INDEX fk_avm_nasp_qn ON avm_aspects (qname_id);
+ALTER TABLE avm_aspects ADD CONSTRAINT fk_avm_nasp_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id);
+
+CREATE INDEX fk_avm_nprop_qn ON avm_node_properties (qname_id);
+ALTER TABLE avm_node_properties ADD CONSTRAINT fk_avm_nprop_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id);
+
+CREATE INDEX fk_avm_sprop_qname ON avm_store_properties (qname_id);
+ALTER TABLE avm_store_properties ADD CONSTRAINT fk_avm_sprop_qname FOREIGN KEY (qname_id) REFERENCES alf_qname (id);
+
+CREATE INDEX idx_avm_hl_revpk ON avm_history_links (descendent, ancestor);
+
+CREATE INDEX idx_avm_vr_revuq ON avm_version_roots (avm_store_id, version_id);
+
+
+--
+-- Record script finish
+--
+DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.2-AvmTables';
+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.2-AvmTables', 'Manually executed script upgrade V3.2: AVM Tables',
+ 0, 3001, -1, 3002, null, 'UNKOWN', 1, 1, 'Script completed'
+ );
\ No newline at end of file
diff --git a/config/alfresco/ehcache-default.xml b/config/alfresco/ehcache-default.xml
index b72519221d..81523cfb77 100644
--- a/config/alfresco/ehcache-default.xml
+++ b/config/alfresco/ehcache-default.xml
@@ -195,76 +195,43 @@
/>
-
-
-
-
-
-
-
-
-
-
-
-
+ />
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.avm.lookupSharedCache
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.avm.lookupTransactionalCache
-
-
- 100
-
-
-
-
diff --git a/config/alfresco/extension/ehcache-custom.xml.sample.cluster b/config/alfresco/extension/ehcache-custom.xml.sample.cluster
index d535fa44f7..b829a6c757 100644
--- a/config/alfresco/extension/ehcache-custom.xml.sample.cluster
+++ b/config/alfresco/extension/ehcache-custom.xml.sample.cluster
@@ -442,149 +442,14 @@
replicateAsynchronously = false"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
org/alfresco/repo/domain/hibernate/VersionCount.hbm.xml
org/alfresco/repo/domain/hibernate/AppliedPatch.hbm.xml
org/alfresco/repo/domain/hibernate/Permission.hbm.xml
- org/alfresco/repo/avm/hibernate/AVM.hbm.xml
org/alfresco/repo/attributes/hibernate/Attributes.hbm.xml
org/alfresco/repo/domain/hibernate/UsageDelta.hbm.xml
org/alfresco/repo/activities/hibernate/Activities.hbm.xml
@@ -297,6 +296,12 @@
+
+
+
+
+
+
diff --git a/config/alfresco/ibatis/alfresco-SqlMapConfig.xml b/config/alfresco/ibatis/alfresco-SqlMapConfig.xml
index 73e931a79b..4be2ba87b3 100644
--- a/config/alfresco/ibatis/alfresco-SqlMapConfig.xml
+++ b/config/alfresco/ibatis/alfresco-SqlMapConfig.xml
@@ -18,5 +18,7 @@
+
+
diff --git a/config/alfresco/ibatis/ibatis-context.xml b/config/alfresco/ibatis/ibatis-context.xml
index 617351ad06..018e5e23f7 100644
--- a/config/alfresco/ibatis/ibatis-context.xml
+++ b/config/alfresco/ibatis/ibatis-context.xml
@@ -1,74 +1,79 @@
-
-
-
-
-
-
-
-
-
- org.hibernate.dialect.Dialect
-
-
-
-
-
-
-
-
-
-
-
-
- javax.sql.DataSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getConnection
-
-
-
-
-
-
-
-
- classpath:alfresco/ibatis/activities-SqlMapConfig.xml
-
-
-
-
-
-
-
-
- classpath:alfresco/ibatis/alfresco-SqlMapConfig.xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ org.hibernate.dialect.Dialect
+
+
+
+
+
+
+
+
+
+
+
+
+ javax.sql.DataSource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getConnection
+
+
+
+
+
+
+
+
+ classpath:alfresco/ibatis/activities-SqlMapConfig.xml
+
+
+
+
+
+
+
+
+ classpath:alfresco/ibatis/alfresco-SqlMapConfig.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml
new file mode 100644
index 0000000000..e1b888d240
--- /dev/null
+++ b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/avm-common-SqlMap.xml
@@ -0,0 +1,988 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insert into avm_stores (next_version_id, name, vers, current_root_id, acl_id)
+ values (#version#, #name#, 0, null, null)
+
+
+
+ insert into avm_nodes (class_type, deletedType, version_id, vers, store_new_id, acl_id, guid, owner, creator, createDate, lastModifier, modDate, accessDate, is_root, layer_id, indirection, indirection_version, primary_indirection, opacity, content_url, mime_type, encoding, length)
+ values (#classType#, #deletedType#, #version#, 0, #storeNewId#, #aclId#, #guid#, #owner#, #creator#, #createdDate#, #modifier#, #modifiedDate#, #accessDate#, #isRoot#, #layerId#, #indirection#, #indirectionVersion#, #primaryIndirection#, #opacity#, #contentUrl#, #mimetype#, #encoding#, #length#)
+
+
+
+ insert into avm_version_roots (avm_store_id, root_id, version_id, creator, create_date, tag, description)
+ values (#storeId#, #rootNodeId#, #version#, #creator#, #createdDate#, #tag#, #description#)
+
+
+
+ insert into avm_store_properties (avm_store_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value)
+ values (#avmStoreId#, #qnameId#, #actualType#, #persistedType#, #isMultiValued#, #booleanValue#, #longValue#, #floatValue#, #doubleValue#, #stringValue#, #serializable#)
+
+
+
+
+
+
+
+
+ insert into avm_aspects (node_id, qname_id)
+ values (#nodeId#, #qnameId#)
+
+
+
+ insert into avm_child_entries (parent_id, name, child_id)
+ values (#parentNodeId#, #name#, #childNodeId#)
+
+
+
+ insert into avm_history_links (ancestor, descendent)
+ values (#ancestorNodeId#, #descendentNodeId#)
+
+
+
+ insert into avm_merge_links (mfrom, mto)
+ values (#mergeFromNodeId#, #mergeToNodeId#)
+
+
+
+ insert into avm_version_layered_node_entry (version_root_id, md5sum, path)
+ values (#versionRootId#, #md5sum#, #path#)
+
+
+
+ insert into avm_node_properties (node_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value)
+ values (#nodeId#, #qnameId#, #actualType#, #persistedType#, #isMultiValued#, #booleanValue#, #longValue#, #floatValue#, #doubleValue#, #stringValue#, #serializable#)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ update
+ avm_stores
+ set
+ next_version_id = #nextVersion#,
+ name = #name#,
+ current_root_id = #rootNodeId#,
+ acl_id = #aclId#,
+ vers = (#vers# + 1)
+ where
+ id = #id# and
+ vers = #vers#
+
+
+
+
+ delete
+ from
+ avm_stores
+ where
+ id = ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ update
+ avm_store_properties
+ set
+ actual_type_n = #actualType#,
+ persisted_type_n = #persistedType#,
+ multi_valued = #isMultiValued#,
+ boolean_value = #booleanValue#,
+ long_value = #longValue#,
+ float_value = #floatValue#,
+ double_value = #doubleValue#,
+ string_value = #stringValue#,
+ serializable_value = #serializable#
+ where
+ id = #id#
+
+
+
+ delete
+ from
+ avm_store_properties
+ where
+ avm_store_id = #avmStoreId# and
+ qname_id = #qnameId#
+
+
+
+ delete
+ from
+ avm_store_properties
+ where
+ avm_store_id = ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ update
+ avm_nodes
+ set
+ store_new_id = null
+ where
+ store_new_id = ?
+
+
+
+
+ update
+ avm_nodes
+ set
+ store_new_id = #storeNewId#,
+ acl_id = #aclId#,
+ layer_id = #layerId#,
+ version_id = #version#,
+ class_type = #classType#,
+ deletedType = #deletedType#,
+ owner = #owner#,
+ lastModifier = #modifier#,
+ modDate = #modifiedDate#,
+ accessDate = #accessDate#,
+ is_root = #isRoot#,
+ lastModifier = #modifier#,
+ indirection = #indirection#,
+ indirection_version = #indirectionVersion#,
+ primary_indirection = #primaryIndirection#,
+ opacity = #opacity#,
+ content_url = #contentUrl#,
+ mime_type = #mimetype#,
+ encoding = #encoding#,
+ length = #length#,
+ guid = #guid#,
+ vers = (#vers# + 1)
+ where
+ id = #id# and
+ vers = #vers#
+
+
+
+ update
+ avm_nodes
+ set
+ modDate = #modifiedDate#,
+ guid = #guid#,
+ vers = (#vers# + 1)
+ where
+ id = #id# and
+ vers = #vers#
+
+
+
+ update
+ avm_nodes
+ set
+ modDate = #modifiedDate#,
+ content_url = #contentUrl#,
+ mime_type = #mimetype#,
+ encoding = #encoding#,
+ length = #length#,
+ vers = (#vers# + 1)
+ where
+ id = #id# and
+ vers = #vers#
+
+
+
+ delete
+ from
+ avm_nodes
+ where
+ id = ?
+
+
+
+
+
+
+
+
+
+
+
+
+ update
+ avm_node_properties
+ set
+ actual_type_n = #actualType#,
+ persisted_type_n = #persistedType#,
+ multi_valued = #isMultiValued#,
+ boolean_value = #booleanValue#,
+ long_value = #longValue#,
+ float_value = #floatValue#,
+ double_value = #doubleValue#,
+ string_value = #stringValue#,
+ serializable_value = #serializable#
+ where
+ node_id = #nodeId# and
+ qname_id = #qnameId#
+
+
+
+ delete
+ from
+ avm_node_properties
+ where
+ node_id = #nodeId# and
+ qname_id = #qnameId#
+
+
+
+ delete
+ from
+ avm_node_properties
+ where
+ node_id = ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ update
+ avm_version_roots
+ set
+ tag = #tag#,
+ description = #description#
+ where
+ id = #id#
+
+
+
+ delete
+ from
+ avm_version_roots
+ where
+ id = ?
+
+
+
+
+
+
+
+
+
+ delete
+ from
+ avm_version_layered_node_entry
+ where
+ version_root_id = ?
+
+
+
+
+
+
+
+
+
+
+
+ delete
+ from
+ avm_aspects
+ where
+ node_id = #nodeId# and
+ qname_id = #qnameId#
+
+
+
+ delete
+ from
+ avm_aspects
+ where
+ node_id = ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ delete
+ from
+ avm_child_entries
+ where
+ parent_id = #parentNodeId# and
+ name = #name# and
+ child_id = #childNodeId#
+
+
+
+
+ delete
+ from
+ avm_child_entries
+ where
+ parent_id = #parentNodeId# and
+ name = #name#
+
+
+
+
+ delete
+ from
+ avm_child_entries
+ where
+ parent_id = #parentNodeId# and
+ child_id = #childNodeId#
+
+
+
+
+ delete
+ from
+ avm_child_entries
+ where
+ parent_id = ?
+
+
+
+
+
+
+
+
+
+
+
+
+
+ delete
+ from
+ avm_merge_links
+ where
+ mfrom = #mergeFromNodeId# and
+ mto = #mergeToNodeId#
+
+
+
+
+
+
+
+
+
+
+
+
+
+ delete
+ from
+ avm_history_links
+ where
+ ancestor = #ancestorNodeId# and
+ descendent = #descendentNodeId#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/alfresco/ibatis/org.hibernate.dialect.MySQLInnoDBDialect/avm-insert-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.MySQLInnoDBDialect/avm-insert-SqlMap.xml
new file mode 100644
index 0000000000..d70a735bbd
--- /dev/null
+++ b/config/alfresco/ibatis/org.hibernate.dialect.MySQLInnoDBDialect/avm-insert-SqlMap.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+ KEY_COLUMN:GENERATED_KEY
+
+
+
+
+
+
+ KEY_COLUMN:GENERATED_KEY
+
+
+
+
+
+
+ KEY_COLUMN:GENERATED_KEY
+
+
+
+
+
+
+ KEY_COLUMN:GENERATED_KEY
+
+
+
+
\ No newline at end of file
diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml
index 1015ae3200..fcb207298b 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -658,7 +658,10 @@
51
52
-
+
+
+
+
@@ -704,8 +707,11 @@
0
55
56
-
-
+
+
+
+
+
@@ -1142,28 +1148,6 @@
-
-
-
patch.db-V2.2-0-CreateMissingTables
patch.schemaUpgradeScript.description
@@ -1227,55 +1211,6 @@
-
-
-
-
-
-
-
patch.avmWebProjectInheritPermissions02
patch.avmWebProjectInheritPermissions.description
@@ -1291,13 +1226,6 @@
-
diff --git a/config/alfresco/public-services-context.xml b/config/alfresco/public-services-context.xml
index 8644e419a5..7a43bdd9ff 100644
--- a/config/alfresco/public-services-context.xml
+++ b/config/alfresco/public-services-context.xml
@@ -836,7 +836,6 @@
- avmSessionSizeResourceInterceptor
checkTxnAdvisor
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AVMGuidPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AVMGuidPatch.java
index a331c98c0c..778d7bfd98 100644
--- a/source/java/org/alfresco/repo/admin/patch/impl/AVMGuidPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/impl/AVMGuidPatch.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
+ * Copyright (C) 2005-2009 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
@@ -29,8 +29,9 @@ import java.util.List;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.avm.AVMNode;
-import org.alfresco.repo.avm.AVMNodeDAO;
+import org.alfresco.repo.domain.avm.AVMNodeDAO;
+import org.alfresco.repo.domain.avm.AVMNodeEntity;
+import org.alfresco.repo.domain.patch.PatchDAO;
import org.alfresco.util.GUID;
/**
@@ -40,6 +41,7 @@ import org.alfresco.util.GUID;
public class AVMGuidPatch extends AbstractPatch
{
private AVMNodeDAO fAVMNodeDAO;
+ private PatchDAO patchDAO;
private static final String MSG_SUCCESS = "patch.AVMGuidPatch.result";
@@ -52,6 +54,11 @@ public class AVMGuidPatch extends AbstractPatch
fAVMNodeDAO = dao;
}
+ public void setPatchDao(PatchDAO dao)
+ {
+ patchDAO = dao;
+ }
+
/* (non-Javadoc)
* @see org.alfresco.repo.admin.patch.AbstractPatch#applyInternal()
*/
@@ -60,16 +67,17 @@ public class AVMGuidPatch extends AbstractPatch
{
while (true)
{
- List batch = fAVMNodeDAO.getEmptyGUIDS(200);
- for (AVMNode node : batch)
+ List batch = patchDAO.getEmptyGUIDS(200);
+ for (AVMNodeEntity nodeEntity : batch)
{
- node.setGuid(GUID.generate());
+ nodeEntity.setGuid(GUID.generate());
+
+ fAVMNodeDAO.updateNode(nodeEntity);
}
if (batch.size() == 0)
{
break;
}
- fAVMNodeDAO.flush();
}
return I18NUtil.getMessage(MSG_SUCCESS);
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AVMLayeredSnapshotPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AVMLayeredSnapshotPatch.java
index 7d372113a4..a063102d32 100644
--- a/source/java/org/alfresco/repo/admin/patch/impl/AVMLayeredSnapshotPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/impl/AVMLayeredSnapshotPatch.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
+ * Copyright (C) 2005-2009 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
@@ -29,9 +29,9 @@ import java.util.List;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.avm.AVMNodeDAO;
-import org.alfresco.repo.avm.LayeredDirectoryNode;
-import org.alfresco.repo.avm.LayeredFileNode;
+import org.alfresco.repo.domain.avm.AVMNodeDAO;
+import org.alfresco.repo.domain.avm.AVMNodeEntity;
+import org.alfresco.repo.domain.patch.PatchDAO;
/**
* Patch for changes to Layered Node path traversal.
@@ -40,6 +40,7 @@ import org.alfresco.repo.avm.LayeredFileNode;
public class AVMLayeredSnapshotPatch extends AbstractPatch
{
private AVMNodeDAO fAVMNodeDAO;
+ private PatchDAO patchDAO;
private static final String MSG_SUCCESS = "patch.AVMLayeredSnapshot.result";
@@ -47,9 +48,14 @@ public class AVMLayeredSnapshotPatch extends AbstractPatch
{
}
- public void setAvmNodeDAO(AVMNodeDAO dao)
+ public void setAvmNodeDao(AVMNodeDAO dao)
{
- fAVMNodeDAO = dao;
+ fAVMNodeDAO = dao;
+ }
+
+ public void setPatchDao(PatchDAO dao)
+ {
+ patchDAO = dao;
}
/* (non-Javadoc)
@@ -60,29 +66,31 @@ public class AVMLayeredSnapshotPatch extends AbstractPatch
{
while (true)
{
- List batch = fAVMNodeDAO.getNullVersionLayeredDirectories(200);
- for (LayeredDirectoryNode node : batch)
+ List batch = patchDAO.getNullVersionLayeredDirectories(200);
+ for (AVMNodeEntity nodeEntity : batch)
{
- node.setIndirectionVersion(-1);
+ nodeEntity.setIndirectionVersion(-1);
+
+ fAVMNodeDAO.updateNode(nodeEntity);
}
if (batch.size() == 0)
{
break;
}
- fAVMNodeDAO.flush();
}
while (true)
{
- List batch = fAVMNodeDAO.getNullVersionLayeredFiles(200);
- for (LayeredFileNode node : batch)
+ List batch = patchDAO.getNullVersionLayeredFiles(200);
+ for (AVMNodeEntity nodeEntity : batch)
{
- node.setIndirectionVersion(-1);
+ nodeEntity.setIndirectionVersion(-1);
+
+ fAVMNodeDAO.updateNode(nodeEntity);
}
if (batch.size() == 0)
{
break;
}
- fAVMNodeDAO.flush();
}
return I18NUtil.getMessage(MSG_SUCCESS);
}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AVMPermissionsPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AVMPermissionsPatch.java
deleted file mode 100644
index fd4f4b99ed..0000000000
--- a/source/java/org/alfresco/repo/admin/patch/impl/AVMPermissionsPatch.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2005-2007 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.Map;
-
-import org.alfresco.i18n.I18NUtil;
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.domain.AccessControlListDAO;
-import org.alfresco.repo.domain.hibernate.AclDaoComponentImpl;
-import org.alfresco.repo.security.permissions.ACLType;
-import org.alfresco.repo.transaction.RetryingTransactionHelper;
-import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
-
-/**
- * Migrate permissions from the OLD format to defining, shared and layered
- */
-public class AVMPermissionsPatch extends AbstractPatch
-{
-
- private static final String MSG_SUCCESS = "patch.updateAvmPermissions.result";
-
- private AccessControlListDAO accessControlListDao;
-
- private AclDaoComponentImpl aclDaoComponent;
-
- @Override
- protected String applyInternal() throws Exception
- {
- Thread progressThread = null;
- if (aclDaoComponent.supportsProgressTracking())
- {
- progressThread = new Thread(new ProgressWatcher(), "WCMPactchProgressWatcher");
- progressThread.start();
- }
-
- Map summary = this.accessControlListDao.patchAcls();
-
- if (progressThread != null)
- {
- progressThread.interrupt();
- progressThread.join();
- }
-
- // build the result message
- String msg = I18NUtil.getMessage(AVMPermissionsPatch.MSG_SUCCESS, summary.get(ACLType.DEFINING), summary
- .get(ACLType.LAYERED));
- // done
- return msg;
- }
-
- public void setAccessControlListDao(AccessControlListDAO accessControlListDao)
- {
- this.accessControlListDao = accessControlListDao;
- }
-
- public void setAclDaoComponent(AclDaoComponentImpl aclDaoComponent)
- {
- this.aclDaoComponent = aclDaoComponent;
- }
-
- private class ProgressWatcher implements Runnable
- {
- private boolean running = true;
-
- Long toDo;
-
- Long max;
-
- public void run()
- {
- while (this.running)
- {
- try
- {
- Thread.sleep(60000);
- }
- catch (InterruptedException e)
- {
- this.running = false;
- }
-
- if (this.running)
- {
- RetryingTransactionHelper txHelper = AVMPermissionsPatch.this.transactionService
- .getRetryingTransactionHelper();
- txHelper.setMaxRetries(1);
- Long done = txHelper.doInTransaction(new RetryingTransactionCallback()
- {
-
- public Long execute() throws Throwable
- {
- if (ProgressWatcher.this.toDo == null)
- {
- ProgressWatcher.this.toDo = AVMPermissionsPatch.this.aclDaoComponent
- .getAVMHeadNodeCount();
- ProgressWatcher.this.max = AVMPermissionsPatch.this.aclDaoComponent.getMaxAclId();
- }
- return AVMPermissionsPatch.this.aclDaoComponent
- .getAVMNodeCountWithNewACLS(ProgressWatcher.this.max);
- }
- }, true, true);
-
- reportProgress(this.toDo, done);
- }
- }
- }
-
- }
-
-}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/MoveWCMToGroupBasedPermissionsPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/MoveWCMToGroupBasedPermissionsPatch.java
index dfda2c96dd..3ab8620008 100644
--- a/source/java/org/alfresco/repo/admin/patch/impl/MoveWCMToGroupBasedPermissionsPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/impl/MoveWCMToGroupBasedPermissionsPatch.java
@@ -115,13 +115,6 @@ public class MoveWCMToGroupBasedPermissionsPatch extends AbstractPatch
@Override
protected String applyInternal() throws Exception
{
- Thread progressThread = null;
- if (this.aclDaoComponent.supportsProgressTracking())
- {
- progressThread = new Thread(new ProgressWatcher(), "WCMPactchProgressWatcher");
- progressThread.start();
- }
-
List stores = this.avmService.getStores();
for (AVMStoreDescriptor store : stores)
{
@@ -159,12 +152,6 @@ public class MoveWCMToGroupBasedPermissionsPatch extends AbstractPatch
}
}
- if (progressThread != null)
- {
- progressThread.interrupt();
- progressThread.join();
- }
-
// build the result message
String msg = I18NUtil.getMessage(MoveWCMToGroupBasedPermissionsPatch.MSG_SUCCESS);
// done
@@ -452,58 +439,4 @@ public class MoveWCMToGroupBasedPermissionsPatch extends AbstractPatch
}
return name.substring(0, index);
}
-
- private class ProgressWatcher implements Runnable
- {
- private boolean running = true;
-
- Long toDo;
-
- Long max;
-
- ProgressWatcher()
- {
- }
-
- public void run()
- {
- while (this.running)
- {
- try
- {
- Thread.sleep(60000);
- }
- catch (InterruptedException e)
- {
- this.running = false;
- }
-
- if (this.running)
- {
- RetryingTransactionHelper txHelper = MoveWCMToGroupBasedPermissionsPatch.this.transactionService
- .getRetryingTransactionHelper();
- txHelper.setMaxRetries(1);
- Long done = txHelper.doInTransaction(new RetryingTransactionCallback()
- {
-
- public Long execute() throws Throwable
- {
- if (ProgressWatcher.this.toDo == null)
- {
- ProgressWatcher.this.toDo = MoveWCMToGroupBasedPermissionsPatch.this.aclDaoComponent
- .getAVMHeadNodeCount();
- ProgressWatcher.this.max = MoveWCMToGroupBasedPermissionsPatch.this.aclDaoComponent
- .getMaxAclId();
- }
- return MoveWCMToGroupBasedPermissionsPatch.this.aclDaoComponent
- .getAVMNodeCountWithNewACLS(org.alfresco.repo.admin.patch.impl.MoveWCMToGroupBasedPermissionsPatch.ProgressWatcher.this.max);
- }
- }, true, true);
-
- reportProgress(this.toDo, done);
- }
- }
- }
-
- }
}
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/WCMPermissionPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/WCMPermissionPatch.java
deleted file mode 100644
index cd2fc774e2..0000000000
--- a/source/java/org/alfresco/repo/admin/patch/impl/WCMPermissionPatch.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (C) 2005-2007 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 java.util.Map;
-
-import org.alfresco.i18n.I18NUtil;
-import org.alfresco.model.WCMAppModel;
-import org.alfresco.repo.admin.patch.AbstractPatch;
-import org.alfresco.repo.avm.AVMNodeConverter;
-import org.alfresco.repo.avm.AVMRepository;
-import org.alfresco.repo.domain.PropertyValue;
-import org.alfresco.repo.domain.hibernate.AclDaoComponentImpl;
-import org.alfresco.repo.search.AVMSnapShotTriggeredIndexingMethodInterceptor;
-import org.alfresco.repo.search.AVMSnapShotTriggeredIndexingMethodInterceptor.StoreType;
-import org.alfresco.repo.transaction.RetryingTransactionHelper;
-import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
-import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
-import org.alfresco.service.cmr.avm.AVMService;
-import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
-import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.security.PermissionService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.service.namespace.RegexQNamePattern;
-
-/**
- * Remove ACLs on all but staging area stores On staging area stores, set ACls according to the users and roles as set
- * on the web site Note: runs as the system user
- *
- * @author andyh
- */
-public class WCMPermissionPatch extends AbstractPatch
-{
- private static final String MSG_SUCCESS = "patch.wcmPermissionPatch.result";
-
- AVMSnapShotTriggeredIndexingMethodInterceptor avmSnapShotTriggeredIndexingMethodInterceptor;
-
- AVMService avmService;
-
- PermissionService permissionService;
-
- AclDaoComponentImpl aclDaoComponent;
-
- public void setAvmService(AVMService avmService)
- {
- this.avmService = avmService;
- }
-
- public void setAvmSnapShotTriggeredIndexingMethodInterceptor(
- AVMSnapShotTriggeredIndexingMethodInterceptor avmSnapShotTriggeredIndexingMethodInterceptor)
- {
- this.avmSnapShotTriggeredIndexingMethodInterceptor = avmSnapShotTriggeredIndexingMethodInterceptor;
- }
-
- public void setPermissionService(PermissionService permissionService)
- {
- this.permissionService = permissionService;
- }
-
- public void setAclDaoComponent(AclDaoComponentImpl aclDaoComponent)
- {
- this.aclDaoComponent = aclDaoComponent;
- }
-
- @Override
- protected String applyInternal() throws Exception
- {
- Thread progressThread = null;
- if (this.aclDaoComponent.supportsProgressTracking())
- {
- progressThread = new Thread(new ProgressWatcher(), "WCMPactchProgressWatcher");
- progressThread.start();
- }
-
- List stores = this.avmService.getStores();
- for (AVMStoreDescriptor store : stores)
- {
- Map storeProperties = this.avmService.getStoreProperties(store.getName());
-
- switch (StoreType.getStoreType(store.getName(), store, storeProperties))
- {
- /* Set permissions in staging */
- case STAGING:
- setStagingAreaPermissions(store);
- setStagingAreaMasks(store);
- // TODO: mark read only
- break;
- /* Clear permissions */
- case AUTHOR:
- case AUTHOR_PREVIEW:
- case AUTHOR_WORKFLOW:
- case AUTHOR_WORKFLOW_PREVIEW:
- // TODO: add app access control
- clearPermissions(store);
- setSandBoxMasks(store);
- break;
- case STAGING_PREVIEW:
- clearPermissions(store);
- setStagingAreaMasks(store);
- // TODO: mark read only
- break;
- case WORKFLOW:
- case WORKFLOW_PREVIEW:
- clearPermissions(store);
- break;
- /* non WCM stores - nothing to do */
- case UNKNOWN:
- default:
- }
- }
-
- if (progressThread != null)
- {
- progressThread.interrupt();
- progressThread.join();
- }
-
- // build the result message
- String msg = I18NUtil.getMessage(WCMPermissionPatch.MSG_SUCCESS);
- // done
- return msg;
- }
-
- private void clearPermissions(AVMStoreDescriptor store)
- {
- AVMNodeDescriptor www = this.avmService.lookup(-1, store.getName() + ":/www");
- if (www.isLayeredDirectory() && www.isPrimary())
- {
- // throw away any acl
- AVMRepository.GetInstance().setACL(store.getName() + ":/www", null);
- // build the default layer acl
- this.avmService.retargetLayeredDirectory(store.getName() + ":/www", www.getIndirection());
- }
- }
-
- private void setStagingAreaPermissions(AVMStoreDescriptor store)
- {
- QName propQName = QName.createQName(null, ".web_project.noderef");
-
- NodeRef dirRef = AVMNodeConverter.ToNodeRef(-1, store.getName() + ":/www");
- this.permissionService.setPermission(dirRef, PermissionService.ALL_AUTHORITIES, PermissionService.READ, true);
-
- PropertyValue pValue = this.avmService.getStoreProperty(store.getName(), propQName);
-
- if (pValue != null)
- {
- NodeRef webProjectNodeRef = (NodeRef) pValue.getValue(DataTypeDefinition.NODE_REF);
-
- // Apply sepcific user permissions as set on the web project
- List userInfoRefs = this.nodeService.getChildAssocs(webProjectNodeRef,
- WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL);
- for (ChildAssociationRef ref : userInfoRefs)
- {
- NodeRef userInfoRef = ref.getChildRef();
- String username = (String) this.nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME);
- String userrole = (String) this.nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE);
-
- this.permissionService.setPermission(dirRef, username, userrole, true);
- }
- }
- }
-
- private void setStagingAreaMasks(AVMStoreDescriptor store)
- {
- NodeRef dirRef = AVMNodeConverter.ToNodeRef(-1, store.getName() + ":/www");
- this.permissionService.setPermission(dirRef.getStoreRef(), PermissionService.ALL_AUTHORITIES,
- PermissionService.READ, true);
-
- QName propQName = QName.createQName(null, ".web_project.noderef");
-
- PropertyValue pValue = this.avmService.getStoreProperty(store.getName(), propQName);
-
- if (pValue != null)
- {
- NodeRef webProjectNodeRef = (NodeRef) pValue.getValue(DataTypeDefinition.NODE_REF);
-
- // Apply sepcific user permissions as set on the web project
- List userInfoRefs = this.nodeService.getChildAssocs(webProjectNodeRef,
- WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL);
- for (ChildAssociationRef ref : userInfoRefs)
- {
- NodeRef userInfoRef = ref.getChildRef();
- String username = (String) this.nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME);
- String userrole = (String) this.nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE);
-
- if (userrole.equals("ContentManager"))
- {
- this.permissionService.setPermission(dirRef.getStoreRef(), username,
- PermissionService.CHANGE_PERMISSIONS, true);
- this.permissionService.setPermission(dirRef.getStoreRef(), username,
- PermissionService.READ_PERMISSIONS, true);
- }
- }
- }
-
- }
-
- private void setSandBoxMasks(AVMStoreDescriptor sandBoxStore)
- {
- // get the settings from the staging store ...
-
- String owner = extractOwner(sandBoxStore.getName());
- String stagingAreaName = extractStagingAreaName(sandBoxStore.getName());
-
- QName propQName = QName.createQName(null, ".web_project.noderef");
-
- NodeRef dirRef = AVMNodeConverter.ToNodeRef(-1, sandBoxStore.getName() + ":/www");
-
- this.avmService.getStoreProperties(stagingAreaName);
- PropertyValue pValue = this.avmService.getStoreProperty(stagingAreaName, propQName);
-
- this.permissionService.setPermission(dirRef.getStoreRef(), PermissionService.ALL_AUTHORITIES,
- PermissionService.READ, true);
-
- if (pValue != null)
- {
- NodeRef webProjectNodeRef = (NodeRef) pValue.getValue(DataTypeDefinition.NODE_REF);
-
- // Apply sepcific user permissions as set on the web project
- List userInfoRefs = this.nodeService.getChildAssocs(webProjectNodeRef,
- WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL);
- for (ChildAssociationRef ref : userInfoRefs)
- {
- NodeRef userInfoRef = ref.getChildRef();
- String username = (String) this.nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERNAME);
- String userrole = (String) this.nodeService.getProperty(userInfoRef, WCMAppModel.PROP_WEBUSERROLE);
-
- if (username.equals(owner))
- {
- this.permissionService.setPermission(dirRef.getStoreRef(), username,
- PermissionService.ALL_PERMISSIONS, true);
- }
- else if (userrole.equals("ContentManager"))
- {
- this.permissionService.setPermission(dirRef.getStoreRef(), username, userrole, true);
- }
- }
- }
- }
-
- private String extractOwner(String name)
- {
- int start = name.indexOf("--");
- if (start == -1)
- {
- throw new UnsupportedOperationException(name);
- }
- int end = name.indexOf("--", start + 1);
- if (end == -1)
- {
- return name.substring(start + 2);
- }
- return name.substring(start + 2, end);
- }
-
- private String extractStagingAreaName(String name)
- {
- int index = name.indexOf("--");
- if (index == -1)
- {
- throw new UnsupportedOperationException(name);
- }
- return name.substring(0, index);
- }
-
- private class ProgressWatcher implements Runnable
- {
- private boolean running = true;
-
- Long toDo;
-
- Long max;
-
- public void run()
- {
- while (this.running)
- {
- try
- {
- Thread.sleep(60000);
- }
- catch (InterruptedException e)
- {
- this.running = false;
- }
-
- if (this.running)
- {
- RetryingTransactionHelper txHelper = WCMPermissionPatch.this.transactionService
- .getRetryingTransactionHelper();
- txHelper.setMaxRetries(1);
- Long done = txHelper.doInTransaction(new RetryingTransactionCallback()
- {
-
- public Long execute() throws Throwable
- {
- if (ProgressWatcher.this.toDo == null)
- {
- ProgressWatcher.this.toDo = WCMPermissionPatch.this.aclDaoComponent
- .getAVMHeadNodeCount();
- ProgressWatcher.this.max = WCMPermissionPatch.this.aclDaoComponent.getMaxAclId();
- }
- return WCMPermissionPatch.this.aclDaoComponent
- .getAVMNodeCountWithNewACLS(ProgressWatcher.this.max);
- }
- }, true, true);
-
- reportProgress(this.toDo, done);
- }
- }
- }
-
- }
-}
diff --git a/source/java/org/alfresco/repo/attributes/hibernate/AttributeDAOHibernate.java b/source/java/org/alfresco/repo/attributes/hibernate/AttributeDAOHibernate.java
index ed6b235830..e25b286047 100644
--- a/source/java/org/alfresco/repo/attributes/hibernate/AttributeDAOHibernate.java
+++ b/source/java/org/alfresco/repo/attributes/hibernate/AttributeDAOHibernate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
+ * Copyright (C) 2005-2009 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
@@ -26,11 +26,8 @@
package org.alfresco.repo.attributes.hibernate;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.alfresco.repo.attributes.AttrQueryHelperImpl;
import org.alfresco.repo.attributes.Attribute;
@@ -42,7 +39,6 @@ import org.alfresco.repo.attributes.MapAttribute;
import org.alfresco.repo.attributes.MapEntry;
import org.alfresco.repo.attributes.MapEntryDAO;
import org.alfresco.repo.attributes.Attribute.Type;
-import org.alfresco.repo.avm.hibernate.SessionCacheChecker;
import org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor;
import org.alfresco.service.cmr.attributes.AttrQuery;
import org.alfresco.service.cmr.attributes.AttrQueryHelper;
@@ -50,7 +46,6 @@ import org.alfresco.util.Pair;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
-import org.hibernate.engine.EntityKey;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
diff --git a/source/java/org/alfresco/repo/avm/AVMDAOs.java b/source/java/org/alfresco/repo/avm/AVMDAOs.java
index 2a08d5b2a8..56947e4df2 100644
--- a/source/java/org/alfresco/repo/avm/AVMDAOs.java
+++ b/source/java/org/alfresco/repo/avm/AVMDAOs.java
@@ -27,7 +27,6 @@ import org.alfresco.repo.attributes.AttributeDAO;
import org.alfresco.repo.attributes.GlobalAttributeEntryDAO;
import org.alfresco.repo.attributes.ListEntryDAO;
import org.alfresco.repo.attributes.MapEntryDAO;
-import org.alfresco.repo.domain.QNameDAO;
/**
* This is the (shudder) global context for AVM. It a rendezvous
@@ -59,21 +58,23 @@ public class AVMDAOs
*/
public AVMNodeDAO fAVMNodeDAO;
- /**
- * The QName DAO
- */
- public QNameDAO fQNameDAO;
+ public org.alfresco.repo.domain.avm.AVMNodeDAO newAVMNodeDAO;
+ public org.alfresco.repo.domain.avm.AVMNodeLinksDAO newAVMNodeLinksDAO;
/**
* The AVMStore DAO.
*/
public AVMStoreDAO fAVMStoreDAO;
+ public org.alfresco.repo.domain.avm.AVMStoreDAO newAVMStoreDAO;
+
/**
* The VersionRootDAO.
*/
public VersionRootDAO fVersionRootDAO;
+ public org.alfresco.repo.domain.avm.AVMVersionRootDAO newAVMVersionRootDAO;
+
/**
* The ChildEntryDAO.
*/
@@ -111,10 +112,15 @@ public class AVMDAOs
{
fAVMNodeDAO = nodeDAO;
}
-
- public void setQnameDAO(QNameDAO qnameDAO)
+
+ public void setNewAvmNodeDAO(org.alfresco.repo.domain.avm.AVMNodeDAO newAVMNodeDAO)
{
- this.fQNameDAO = qnameDAO;
+ this.newAVMNodeDAO = newAVMNodeDAO;
+ }
+
+ public void setNewAvmNodeLinksDAO(org.alfresco.repo.domain.avm.AVMNodeLinksDAO newAVMNodeLinksDAO)
+ {
+ this.newAVMNodeLinksDAO = newAVMNodeLinksDAO;
}
/**
@@ -148,6 +154,11 @@ public class AVMDAOs
{
fAVMStoreDAO = aVMStoreDAO;
}
+
+ public void setNewAvmStoreDAO(org.alfresco.repo.domain.avm.AVMStoreDAO newAVMStoreDAO)
+ {
+ this.newAVMStoreDAO = newAVMStoreDAO;
+ }
/**
* @param versionRootDAO the fVersionRootDAO to set
@@ -157,6 +168,11 @@ public class AVMDAOs
fVersionRootDAO = versionRootDAO;
}
+ public void setNewAvmVersionRootDAO(org.alfresco.repo.domain.avm.AVMVersionRootDAO newAVMVersionRootDAO)
+ {
+ this.newAVMVersionRootDAO = newAVMVersionRootDAO;
+ }
+
public void setAvmStorePropertyDAO(AVMStorePropertyDAO avmStorePropertyDAO)
{
fAVMStorePropertyDAO = avmStorePropertyDAO;
diff --git a/source/java/org/alfresco/repo/avm/AVMDiffPerformanceTest.java b/source/java/org/alfresco/repo/avm/AVMDiffPerformanceTest.java
index d5240fd1b2..d71d33fe4d 100644
--- a/source/java/org/alfresco/repo/avm/AVMDiffPerformanceTest.java
+++ b/source/java/org/alfresco/repo/avm/AVMDiffPerformanceTest.java
@@ -1,3 +1,26 @@
+/*
+ * Copyright (C) 2005-2009 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.avm;
import java.util.List;
@@ -11,8 +34,27 @@ import org.alfresco.util.GUID;
public class AVMDiffPerformanceTest extends AVMServiceTestBase
{
+ public void testSetup() throws Exception
+ {
+ super.testSetup();
+ }
+
+ public void xtest_1000() throws Exception
+ {
+ runTest(1000);
+ }
+
+ public void ytest_10000() throws Exception
+ {
+ runTest(10000);
+ }
+
+ public void test_2000() throws Exception
+ {
+ runTest(2000);
+ }
- public void test_10000() throws Exception
+ private void runTest(final int cnt) throws Exception
{
fTransactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback