mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged V3.1 to HEAD
13265: Fix incorrect wiring of guest user name 13266: Merged V2.1A to V3.1 13252: Fix ADB-159: Generation of content model xml throws exception 13267: Remove accidental addition of folders 13280: IndexTransactionTracker logging changes 13281: Added bean to push properties from repository properties into the VM properties 13283: Added forgotten Hibernate diff file after JAWS-223 fix 13291: Fix ETHREEOH-1340: Alfresco Repository Draft CMIS Implementation" link refers to localhost 13297: Fix ETHREEOH-885: workflow mapAuthorityToName tests don't handle sub-classed objects correctly. 13308: First part of JAWS-215 - permission migration from V2.1-A to V3.1 13313: Build fix for 2.1-A to 3.1 ACL patch ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V2.1-A:r13252 Merged /alfresco/BRANCHES/V3.1:r13265-13267,13277-13283,13286,13289,13291,13295,13297,13308-13313 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13615 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -535,7 +535,7 @@
|
|||||||
<!-- Authentication Util initialization -->
|
<!-- Authentication Util initialization -->
|
||||||
<bean id="authenticationUtil" class="org.alfresco.repo.security.authentication.AuthenticationUtil">
|
<bean id="authenticationUtil" class="org.alfresco.repo.security.authentication.AuthenticationUtil">
|
||||||
<property name="defaultAdminUserName"><value>${alfresco_user_store.adminusername}</value></property>
|
<property name="defaultAdminUserName"><value>${alfresco_user_store.adminusername}</value></property>
|
||||||
<property name="defaultGuestUserName"><value>${alfresco_user_store.adminpassword}</value></property>
|
<property name="defaultGuestUserName"><value>${alfresco_user_store.guestusername}</value></property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
@@ -77,7 +77,8 @@
|
|||||||
<ref bean="patch.schemaUpdateScript-V1.4-1" />
|
<ref bean="patch.schemaUpdateScript-V1.4-1" />
|
||||||
<ref bean="patch.schemaUpdateScript-V1.4-2" />
|
<ref bean="patch.schemaUpdateScript-V1.4-2" />
|
||||||
<ref bean="patch.db-V2.1-NotNullColumns" />
|
<ref bean="patch.db-V2.1-NotNullColumns" />
|
||||||
<ref bean="patch.db-V2.2-ACL" />
|
<ref bean="patch.db-V2.2-ACL-From-2.1-A" />
|
||||||
|
<ref bean="patch.db-V2.2-ACL" />
|
||||||
<ref bean="patch.db-V2.2-0-CreateMissingTables" />
|
<ref bean="patch.db-V2.2-0-CreateMissingTables" />
|
||||||
<ref bean="patch.db-V2.2-Upgrade-From-2.1" />
|
<ref bean="patch.db-V2.2-Upgrade-From-2.1" />
|
||||||
<ref bean="patch.db-V2.2-Upgrade-From-2.2SP1" />
|
<ref bean="patch.db-V2.2-Upgrade-From-2.2SP1" />
|
||||||
|
@@ -53,6 +53,28 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="jgroupsPropertySetter" class="org.alfresco.config.SystemPropertiesSetterBean" init-method="init">
|
||||||
|
<property name="propertyMap">
|
||||||
|
<map>
|
||||||
|
<entry key="alfresco.tcp.start_port">
|
||||||
|
<value>${alfresco.tcp.start_port}</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="alfresco.tcp.initial_hosts">
|
||||||
|
<value>${alfresco.tcp.initial_hosts}</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="alfresco.tcp.port_range">
|
||||||
|
<value>${alfresco.tcp.port_range}</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="alfresco.udp.mcast_addr">
|
||||||
|
<value>${alfresco.udp.mcast_addr}</value>
|
||||||
|
</entry>
|
||||||
|
<entry key="alfresco.udp.mcast_port">
|
||||||
|
<value>${alfresco.udp.mcast_port}</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<!-- Custom MBeanServer -->
|
<!-- Custom MBeanServer -->
|
||||||
<bean id="alfrescoMBeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
|
<bean id="alfrescoMBeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
|
||||||
<property name="locateExistingServerIfPossible" value="true" />
|
<property name="locateExistingServerIfPossible" value="true" />
|
||||||
|
@@ -0,0 +1,191 @@
|
|||||||
|
--
|
||||||
|
-- Title: Update for permissions schema changes
|
||||||
|
-- Database: MySQL InnoDB
|
||||||
|
-- Since: V2.2 Schema 85
|
||||||
|
-- Author: Andy Hind
|
||||||
|
--
|
||||||
|
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE alf_acl_change_set (
|
||||||
|
id BIGINT NOT NULL AUTO_INCREMENT,
|
||||||
|
version BIGINT NOT NULL,
|
||||||
|
primary key (id)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
|
||||||
|
-- Add to ACL
|
||||||
|
ALTER TABLE alf_access_control_list
|
||||||
|
ADD COLUMN type INT NOT NULL DEFAULT 0,
|
||||||
|
ADD COLUMN latest BOOLEAN NOT NULL DEFAULT TRUE,
|
||||||
|
ADD COLUMN acl_id VARCHAR(36) NOT NULL DEFAULT 'UNSET',
|
||||||
|
ADD COLUMN acl_version BIGINT NOT NULL DEFAULT 1,
|
||||||
|
ADD COLUMN inherited_acl BIGINT,
|
||||||
|
ADD COLUMN is_versioned BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN requires_version BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN acl_change_set BIGINT,
|
||||||
|
ADD COLUMN inherits_from BIGINT,
|
||||||
|
ADD INDEX fk_alf_acl_acs (acl_change_set),
|
||||||
|
ADD CONSTRAINT fk_alf_acl_acs FOREIGN KEY (acl_change_set) REFERENCES alf_acl_change_set (id),
|
||||||
|
ADD INDEX idx_alf_acl_inh (inherits, inherits_from);
|
||||||
|
|
||||||
|
UPDATE alf_access_control_list acl
|
||||||
|
set acl_id = (acl.id);
|
||||||
|
|
||||||
|
ALTER TABLE alf_access_control_list
|
||||||
|
ADD UNIQUE (acl_id, latest, acl_version);
|
||||||
|
|
||||||
|
-- Create ACL member list
|
||||||
|
CREATE TABLE alf_acl_member (
|
||||||
|
id BIGINT NOT NULL AUTO_INCREMENT,
|
||||||
|
version BIGINT NOT NULL,
|
||||||
|
acl_id BIGINT NOT NULL,
|
||||||
|
ace_id BIGINT NOT NULL,
|
||||||
|
pos INT NOT NULL,
|
||||||
|
INDEX fk_alf_aclm_acl (acl_id),
|
||||||
|
CONSTRAINT fk_alf_aclm_acl FOREIGN KEY (acl_id) REFERENCES alf_access_control_list (id),
|
||||||
|
INDEX fk_alf_aclm_ace (ace_id),
|
||||||
|
CONSTRAINT fk_alf_aclm_ace FOREIGN KEY (ace_id) REFERENCES alf_access_control_entry (id),
|
||||||
|
primary key (id),
|
||||||
|
unique(acl_id, ace_id, pos)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
ALTER TABLE alf_access_control_entry DROP INDEX acl_id;
|
||||||
|
|
||||||
|
-- Extend ACE
|
||||||
|
-- not required from 2.1-A
|
||||||
|
-- ADD COLUMN auth_id BIGINT NOT NULL DEFAULT -1,
|
||||||
|
ALTER TABLE alf_access_control_entry
|
||||||
|
ADD COLUMN applies INT NOT NULL DEFAULT 0,
|
||||||
|
ADD COLUMN context_id BIGINT;
|
||||||
|
|
||||||
|
-- remove unused
|
||||||
|
DROP TABLE alf_auth_ext_keys;
|
||||||
|
|
||||||
|
|
||||||
|
-- not required from 2.1-A
|
||||||
|
-- remove authority constraint
|
||||||
|
ALTER TABLE alf_access_control_entry DROP INDEX FKFFF41F99B25A50BF, DROP FOREIGN KEY FKFFF41F99B25A50BF; -- (optional)
|
||||||
|
|
||||||
|
|
||||||
|
-- not required from 2.1-A
|
||||||
|
-- restructure authority
|
||||||
|
-- ALTER TABLE alf_authority
|
||||||
|
-- DROP PRIMARY KEY,
|
||||||
|
-- ADD COLUMN id BIGINT NOT NULL AUTO_INCREMENT,
|
||||||
|
-- ADD COLUMN crc BIGINT,
|
||||||
|
-- CHANGE recipient authority VARCHAR(100),
|
||||||
|
-- ADD INDEX idx_alf_auth_aut (authority),
|
||||||
|
-- ADD primary key (id),
|
||||||
|
-- ADD UNIQUE (authority, crc);
|
||||||
|
|
||||||
|
-- migrate data - fix up FK refs to authority
|
||||||
|
-- UPDATE alf_access_control_entry ace
|
||||||
|
-- set auth_id = (select id from alf_authority a where a.authority = ace.authority_id);
|
||||||
|
|
||||||
|
|
||||||
|
-- migrate data - build equivalent ACL entries
|
||||||
|
INSERT INTO alf_acl_member (version, acl_id, ace_id, pos)
|
||||||
|
select 1, ace.acl_id, ace.id, 0 from alf_access_control_entry ace join alf_access_control_list acl on acl.id = ace.acl_id;
|
||||||
|
|
||||||
|
-- Create ACE context
|
||||||
|
CREATE TABLE alf_ace_context (
|
||||||
|
id BIGINT NOT NULL AUTO_INCREMENT,
|
||||||
|
version BIGINT NOT NULL,
|
||||||
|
class_context VARCHAR(1024),
|
||||||
|
property_context VARCHAR(1024),
|
||||||
|
kvp_context VARCHAR(1024),
|
||||||
|
primary key (id)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
|
||||||
|
-- Create auth aliases table
|
||||||
|
CREATE TABLE alf_authority_alias (
|
||||||
|
id BIGINT NOT NULL AUTO_INCREMENT,
|
||||||
|
version BIGINT NOT NULL,
|
||||||
|
auth_id BIGINT NOT NULL,
|
||||||
|
alias_id BIGINT NOT NULL,
|
||||||
|
INDEX fk_alf_autha_ali (alias_id),
|
||||||
|
CONSTRAINT fk_alf_autha_ali FOREIGN KEY (alias_id) REFERENCES alf_authority (id),
|
||||||
|
INDEX fk_alf_autha_aut (auth_id),
|
||||||
|
CONSTRAINT fk_alf_autha_aut FOREIGN KEY (auth_id) REFERENCES alf_authority (id),
|
||||||
|
primary key (id),
|
||||||
|
UNIQUE (auth_id, alias_id)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
|
||||||
|
-- Tidy up unused cols on ace table and add the FK contstraint back
|
||||||
|
-- finish take out of ACL_ID
|
||||||
|
-- DROP COLUMN authority_id,
|
||||||
|
-- not required from 2.1-A
|
||||||
|
-- CHANGE auth_id authority_id BIGINT NOT NULL,
|
||||||
|
ALTER TABLE alf_access_control_entry
|
||||||
|
DROP INDEX FKFFF41F99B9553F6C, DROP FOREIGN KEY FKFFF41F99B9553F6C,
|
||||||
|
DROP INDEX FKFFF41F9960601995, DROP FOREIGN KEY FKFFF41F9960601995,
|
||||||
|
DROP COLUMN acl_id,
|
||||||
|
ADD INDEX fk_alf_ace_auth (authority_id),
|
||||||
|
ADD CONSTRAINT fk_alf_ace_auth FOREIGN KEY (authority_id) REFERENCES alf_authority (id),
|
||||||
|
ADD INDEX fk_alf_ace_perm (permission_id),
|
||||||
|
ADD CONSTRAINT fk_alf_ace_perm FOREIGN KEY (permission_id) REFERENCES alf_permission (id),
|
||||||
|
ADD INDEX fk_alf_ace_ctx (context_id),
|
||||||
|
ADD CONSTRAINT fk_alf_ace_ctx FOREIGN KEY (context_id) REFERENCES alf_ace_context (id)
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE alf_tmp_min_ace (
|
||||||
|
min BIGINT NOT NULL,
|
||||||
|
permission_id BIGINT NOT NULL,
|
||||||
|
authority_id BIGINT NOT NULL,
|
||||||
|
allowed BIT(1) NOT NULL,
|
||||||
|
applies INT NOT NULL,
|
||||||
|
UNIQUE (permission_id, authority_id, allowed, applies)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
INSERT INTO alf_tmp_min_ace (min, permission_id, authority_id, allowed, applies)
|
||||||
|
SELECT
|
||||||
|
min(ace1.id),
|
||||||
|
ace1.permission_id,
|
||||||
|
ace1.authority_id,
|
||||||
|
ace1.allowed,
|
||||||
|
ace1.applies
|
||||||
|
FROM
|
||||||
|
alf_access_control_entry ace1
|
||||||
|
GROUP BY
|
||||||
|
ace1.permission_id, ace1.authority_id, ace1.allowed, ace1.applies
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
-- Update members to point to the first use of an access control entry
|
||||||
|
UPDATE alf_acl_member mem
|
||||||
|
SET ace_id = (SELECT help.min FROM alf_access_control_entry ace
|
||||||
|
JOIN alf_tmp_min_ace help
|
||||||
|
ON help.permission_id = ace.permission_id AND
|
||||||
|
help.authority_id = ace.authority_id AND
|
||||||
|
help.allowed = ace.allowed AND
|
||||||
|
help.applies = ace.applies
|
||||||
|
WHERE ace.id = mem.ace_id );
|
||||||
|
|
||||||
|
DROP TABLE alf_tmp_min_ace;
|
||||||
|
|
||||||
|
-- Remove duplicate aces the mysql way (as you can not use the deleted table in the where clause ...)
|
||||||
|
|
||||||
|
CREATE TABLE tmp_to_delete SELECT ace.id FROM alf_acl_member mem RIGHT OUTER JOIN alf_access_control_entry ace ON mem.ace_id = ace.id WHERE mem.ace_id IS NULL;
|
||||||
|
DELETE FROM ace USING alf_access_control_entry ace JOIN tmp_to_delete t ON ace.id = t.id;
|
||||||
|
DROP TABLE tmp_to_delete;
|
||||||
|
|
||||||
|
-- Add constraint for duplicate acls
|
||||||
|
|
||||||
|
ALTER TABLE alf_access_control_entry
|
||||||
|
ADD UNIQUE (permission_id, authority_id, allowed, applies, context_id);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Record script finish
|
||||||
|
--
|
||||||
|
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V2.2-ACL';
|
||||||
|
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-V2.2-ACL-From-2.1-A', 'Manually executed script upgrade V2.2: Update acl schema',
|
||||||
|
81, 82, -1, 120, null, 'UNKOWN', 1, 1, 'Script completed'
|
||||||
|
);
|
@@ -1138,6 +1138,23 @@
|
|||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="patch.db-V2.2-ACL-From-2.1-A" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||||
|
<property name="id"><value>patch.db-V2.2-ACL-From-2.1-A</value></property>
|
||||||
|
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||||
|
<property name="fixesFromSchema"><value>0</value></property>
|
||||||
|
<property name="fixesToSchema"><value>${V2.1-A.fixes.to.schema}</value></property>
|
||||||
|
<property name="targetSchema"><value>120</value></property>
|
||||||
|
<property name="scriptUrl">
|
||||||
|
<value>classpath:alfresco/dbscripts/upgrade/2.2/${db.script.dialect}/AlfrescoSchemaUpdate-2.1-A--to--2.2-ACL.sql</value>
|
||||||
|
</property>
|
||||||
|
<property name="dependsOn" >
|
||||||
|
<list>
|
||||||
|
<ref bean="patch.db-V2.1-NotNullColumns" />
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<bean id="patch.db-V2.2-ACL" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
<bean id="patch.db-V2.2-ACL" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||||
<property name="id"><value>patch.db-V2.2-ACL</value></property>
|
<property name="id"><value>patch.db-V2.2-ACL</value></property>
|
||||||
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||||
@@ -1151,6 +1168,11 @@
|
|||||||
<list>
|
<list>
|
||||||
<ref bean="patch.db-V2.1-NotNullColumns" />
|
<ref bean="patch.db-V2.1-NotNullColumns" />
|
||||||
</list>
|
</list>
|
||||||
|
</property>
|
||||||
|
<property name="alternatives" >
|
||||||
|
<list>
|
||||||
|
<ref bean="patch.db-V2.2-ACL-From-2.1-A" />
|
||||||
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
@@ -306,3 +306,7 @@ img.root=./ImageMagick
|
|||||||
img.dyn=${img.root}/lib
|
img.dyn=${img.root}/lib
|
||||||
img.exe=${img.root}/bin/convert
|
img.exe=${img.root}/bin/convert
|
||||||
swf.exe=./bin/pdf2swf
|
swf.exe=./bin/pdf2swf
|
||||||
|
|
||||||
|
# Property to enable upgrade from 2.1-A
|
||||||
|
V2.1-A.fixes.to.schema=0
|
||||||
|
#V2.1-A.fixes.to.schema=82
|
||||||
|
@@ -24,6 +24,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.dictionary;
|
package org.alfresco.repo.dictionary;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -33,6 +37,7 @@ import net.sf.ehcache.Cache;
|
|||||||
import net.sf.ehcache.CacheManager;
|
import net.sf.ehcache.CacheManager;
|
||||||
|
|
||||||
import org.alfresco.i18n.I18NUtil;
|
import org.alfresco.i18n.I18NUtil;
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.cache.EhCacheAdapter;
|
import org.alfresco.repo.cache.EhCacheAdapter;
|
||||||
import org.alfresco.repo.dictionary.constraint.RegexConstraint;
|
import org.alfresco.repo.dictionary.constraint.RegexConstraint;
|
||||||
import org.alfresco.repo.dictionary.constraint.StringLengthConstraint;
|
import org.alfresco.repo.dictionary.constraint.StringLengthConstraint;
|
||||||
@@ -44,10 +49,12 @@ import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
|||||||
import org.alfresco.service.cmr.dictionary.Constraint;
|
import org.alfresco.service.cmr.dictionary.Constraint;
|
||||||
import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
|
import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
|
||||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||||
|
import org.alfresco.service.cmr.dictionary.DictionaryException;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.dictionary.ModelDefinition;
|
import org.alfresco.service.cmr.dictionary.ModelDefinition;
|
||||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||||
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
|
||||||
|
|
||||||
@@ -372,4 +379,82 @@ public class DictionaryDAOTest extends TestCase
|
|||||||
childAssocDef = (ChildAssociationDefinition) assocDef;
|
childAssocDef = (ChildAssociationDefinition) assocDef;
|
||||||
assertTrue("Expected 'true' for timestamp propagation", childAssocDef.getPropagateTimestamps());
|
assertTrue("Expected 'true' for timestamp propagation", childAssocDef.getPropagateTimestamps());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testADB159() throws UnsupportedEncodingException
|
||||||
|
{
|
||||||
|
// source dictionary
|
||||||
|
TenantService tenantService = new SingleTServiceImpl();
|
||||||
|
NamespaceDAOImpl namespaceDAO = new NamespaceDAOImpl();
|
||||||
|
namespaceDAO.setTenantService(tenantService);
|
||||||
|
initNamespaceCaches(namespaceDAO);
|
||||||
|
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(namespaceDAO);
|
||||||
|
dictionaryDAO.setTenantService(tenantService);
|
||||||
|
initDictionaryCaches(dictionaryDAO);
|
||||||
|
|
||||||
|
// destination dictionary
|
||||||
|
NamespaceDAOImpl namespaceDAO2 = new NamespaceDAOImpl();
|
||||||
|
namespaceDAO2.setTenantService(tenantService);
|
||||||
|
initNamespaceCaches(namespaceDAO2);
|
||||||
|
DictionaryDAOImpl dictionaryDAO2 = new DictionaryDAOImpl(namespaceDAO2);
|
||||||
|
dictionaryDAO2.setTenantService(tenantService);
|
||||||
|
initDictionaryCaches(dictionaryDAO2);
|
||||||
|
|
||||||
|
List<String> models = new ArrayList<String>();
|
||||||
|
models.add("alfresco/model/dictionaryModel.xml");
|
||||||
|
models.add("alfresco/model/systemModel.xml");
|
||||||
|
models.add("alfresco/model/contentModel.xml");
|
||||||
|
models.add("alfresco/model/wcmModel.xml");
|
||||||
|
models.add("alfresco/model/applicationModel.xml");
|
||||||
|
models.add("org/alfresco/repo/security/authentication/userModel.xml");
|
||||||
|
models.add("org/alfresco/repo/action/actionModel.xml");
|
||||||
|
models.add("org/alfresco/repo/rule/ruleModel.xml");
|
||||||
|
models.add("org/alfresco/repo/version/version_model.xml");
|
||||||
|
|
||||||
|
// round-trip default models
|
||||||
|
for (String bootstrapModel : models)
|
||||||
|
{
|
||||||
|
InputStream modelStream = getClass().getClassLoader().getResourceAsStream(bootstrapModel);
|
||||||
|
if (modelStream == null)
|
||||||
|
{
|
||||||
|
throw new DictionaryException("Could not find bootstrap model " + bootstrapModel);
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// parse model from xml
|
||||||
|
M2Model model = M2Model.createModel(modelStream);
|
||||||
|
dictionaryDAO.putModel(model);
|
||||||
|
|
||||||
|
// regenerate xml from model
|
||||||
|
ByteArrayOutputStream xml1 = new ByteArrayOutputStream();
|
||||||
|
model.toXML(xml1);
|
||||||
|
|
||||||
|
// register regenerated xml with other dictionary
|
||||||
|
M2Model model2 = M2Model.createModel(new ByteArrayInputStream(xml1.toByteArray()));
|
||||||
|
dictionaryDAO2.putModel(model2);
|
||||||
|
}
|
||||||
|
catch(DictionaryException e)
|
||||||
|
{
|
||||||
|
throw new DictionaryException("Could not import bootstrap model " + bootstrapModel, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// specific test case
|
||||||
|
M2Model model = M2Model.createModel("test:adb25");
|
||||||
|
model.createNamespace(TEST_URL, "test");
|
||||||
|
model.createImport(NamespaceService.DICTIONARY_MODEL_1_0_URI, NamespaceService.DICTIONARY_MODEL_PREFIX);
|
||||||
|
model.createImport(NamespaceService.SYSTEM_MODEL_1_0_URI, NamespaceService.SYSTEM_MODEL_PREFIX);
|
||||||
|
model.createImport(NamespaceService.CONTENT_MODEL_1_0_URI, NamespaceService.CONTENT_MODEL_PREFIX);
|
||||||
|
|
||||||
|
M2Type testType = model.createType("test:adb25" );
|
||||||
|
testType.setParentName("cm:" + ContentModel.TYPE_CONTENT.getLocalName());
|
||||||
|
|
||||||
|
M2Property prop1 = testType.createProperty("test:prop1");
|
||||||
|
prop1.setMandatory(false);
|
||||||
|
prop1.setType("d:" + DataTypeDefinition.TEXT.getLocalName());
|
||||||
|
prop1.setMultiValued(false);
|
||||||
|
|
||||||
|
ByteArrayOutputStream xml1 = new ByteArrayOutputStream();
|
||||||
|
model.toXML(xml1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -171,6 +171,10 @@ public abstract class M2ClassAssociation
|
|||||||
this.targetRoleName = name;
|
this.targetRoleName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getTargetMandatory()
|
||||||
|
{
|
||||||
|
return isTargetMandatory();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isTargetMandatory()
|
public boolean isTargetMandatory()
|
||||||
{
|
{
|
||||||
@@ -183,6 +187,10 @@ public abstract class M2ClassAssociation
|
|||||||
this.isTargetMandatory = isTargetMandatory;
|
this.isTargetMandatory = isTargetMandatory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getTargetMandatoryEnforced()
|
||||||
|
{
|
||||||
|
return isTargetMandatoryEnforced();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isTargetMandatoryEnforced()
|
public boolean isTargetMandatoryEnforced()
|
||||||
{
|
{
|
||||||
|
@@ -34,8 +34,8 @@ import java.util.List;
|
|||||||
public class M2NamedValue
|
public class M2NamedValue
|
||||||
{
|
{
|
||||||
private String name;
|
private String name;
|
||||||
private String simpleValue;
|
private String simpleValue = null;
|
||||||
private List<String> listValue;
|
private List<String> listValue = null;
|
||||||
|
|
||||||
/*package*/ M2NamedValue()
|
/*package*/ M2NamedValue()
|
||||||
{
|
{
|
||||||
|
@@ -61,7 +61,6 @@
|
|||||||
<value name="description" field="description" usage="optional"/>
|
<value name="description" field="description" usage="optional"/>
|
||||||
<value name="parent" field="parentName" usage="optional"/>
|
<value name="parent" field="parentName" usage="optional"/>
|
||||||
<value name="archive" field="archive" usage="optional"/>
|
<value name="archive" field="archive" usage="optional"/>
|
||||||
|
|
||||||
<structure name="properties" usage="optional">
|
<structure name="properties" usage="optional">
|
||||||
<collection field="properties" item-type="org.alfresco.repo.dictionary.M2Property" factory="org.alfresco.repo.dictionary.M2Model.createList"/>
|
<collection field="properties" item-type="org.alfresco.repo.dictionary.M2Property" factory="org.alfresco.repo.dictionary.M2Model.createList"/>
|
||||||
</structure>
|
</structure>
|
||||||
@@ -74,18 +73,18 @@
|
|||||||
<value style="attribute" name="name" field="name"/>
|
<value style="attribute" name="name" field="name"/>
|
||||||
<structure name="mandatory" usage="optional">
|
<structure name="mandatory" usage="optional">
|
||||||
<value style="attribute" name="enforced" field="isMandatoryEnforced" usage="optional" />
|
<value style="attribute" name="enforced" field="isMandatoryEnforced" usage="optional" />
|
||||||
<value style="text" field="isMandatory" />
|
<value style="text" field="isMandatory" usage="optional"/>
|
||||||
</structure>
|
</structure>
|
||||||
<value name="default" field="defaultValue" usage="optional"/>
|
<value name="default" field="defaultValue" usage="optional"/>
|
||||||
<structure name="constraints" usage="optional">
|
<structure name="constraints" usage="optional">
|
||||||
<collection field="constraints" item-type="org.alfresco.repo.dictionary.M2Constraint" factory="org.alfresco.repo.dictionary.M2Model.createList"/>
|
<collection field="constraints" item-type="org.alfresco.repo.dictionary.M2Constraint" usage="optional" factory="org.alfresco.repo.dictionary.M2Model.createList"/>
|
||||||
</structure>
|
</structure>
|
||||||
</structure>
|
</structure>
|
||||||
</collection>
|
</collection>
|
||||||
</structure>
|
</structure>
|
||||||
<structure name="mandatory-aspects" usage="optional">
|
<structure name="mandatory-aspects" usage="optional">
|
||||||
<collection field="mandatoryAspects" factory="org.alfresco.repo.dictionary.M2Model.createList">
|
<collection field="mandatoryAspects" factory="org.alfresco.repo.dictionary.M2Model.createList">
|
||||||
<value name="aspect"/>
|
<value name="aspect" type="java.lang.String"/>
|
||||||
</collection>
|
</collection>
|
||||||
</structure>
|
</structure>
|
||||||
</mapping>
|
</mapping>
|
||||||
@@ -94,7 +93,7 @@
|
|||||||
<structure map-as="org.alfresco.repo.dictionary.M2Class"/>
|
<structure map-as="org.alfresco.repo.dictionary.M2Class"/>
|
||||||
</mapping>
|
</mapping>
|
||||||
|
|
||||||
<mapping name="aspect" class="org.alfresco.repo.dictionary.M2Aspect" extends="org.alfresco.repo.dictionary.M2Class">
|
<mapping name="aspect" class="org.alfresco.repo.dictionary.M2Aspect" extends="org.alfresco.repo.dictionary.M2Class">
|
||||||
<structure map-as="org.alfresco.repo.dictionary.M2Class"/>
|
<structure map-as="org.alfresco.repo.dictionary.M2Class"/>
|
||||||
</mapping>
|
</mapping>
|
||||||
|
|
||||||
@@ -117,20 +116,16 @@
|
|||||||
<value name="tokenised" field="indexTokenisationMode" usage="optional" serializer="org.alfresco.repo.dictionary.IndexTokenisationMode.serializer" deserializer="org.alfresco.repo.dictionary.IndexTokenisationMode.deserializer"/>
|
<value name="tokenised" field="indexTokenisationMode" usage="optional" serializer="org.alfresco.repo.dictionary.IndexTokenisationMode.serializer" deserializer="org.alfresco.repo.dictionary.IndexTokenisationMode.deserializer"/>
|
||||||
</structure>
|
</structure>
|
||||||
<structure name="constraints" usage="optional">
|
<structure name="constraints" usage="optional">
|
||||||
<collection field="constraints" item-type="org.alfresco.repo.dictionary.M2Constraint" factory="org.alfresco.repo.dictionary.M2Model.createList"/>
|
<collection field="constraints" item-type="org.alfresco.repo.dictionary.M2Constraint" factory="org.alfresco.repo.dictionary.M2Model.createList" usage="optional"/>
|
||||||
</structure>
|
</structure>
|
||||||
</mapping>
|
</mapping>
|
||||||
|
|
||||||
<mapping abstract="true" class="org.alfresco.repo.dictionary.M2NamedValue">
|
<mapping abstract="true" class="org.alfresco.repo.dictionary.M2NamedValue">
|
||||||
<value style="attribute" name="name" field="name" />
|
<value style="attribute" name="name" field="name" />
|
||||||
<structure name="value" usage="optional">
|
<value name="value" field="simpleValue" usage="optional" />
|
||||||
<value style="text" field="simpleValue" />
|
|
||||||
</structure>
|
|
||||||
<structure name="list" usage="optional">
|
<structure name="list" usage="optional">
|
||||||
<collection field="listValue" factory="org.alfresco.repo.dictionary.M2Model.createList" usage="optional" >
|
<collection field="listValue" factory="org.alfresco.repo.dictionary.M2Model.createList" usage="optional">
|
||||||
<structure name="value" usage="optional" >
|
<value name="value" style="element" usage="optional" type="java.lang.String"/>
|
||||||
<value style="text" />
|
|
||||||
</structure>
|
|
||||||
</collection>
|
</collection>
|
||||||
</structure>
|
</structure>
|
||||||
</mapping>
|
</mapping>
|
||||||
@@ -158,8 +153,8 @@
|
|||||||
<value name="class" field="targetClassName"/>
|
<value name="class" field="targetClassName"/>
|
||||||
<value name="role" field="targetRoleName" usage="optional"/>
|
<value name="role" field="targetRoleName" usage="optional"/>
|
||||||
<structure name="mandatory" usage="optional">
|
<structure name="mandatory" usage="optional">
|
||||||
<value style="attribute" name="enforced" field="isTargetMandatoryEnforced" usage="optional"/>
|
<value style="attribute" name="enforced" field="isTargetMandatoryEnforced" get-method="getTargetMandatoryEnforced" usage="optional"/>
|
||||||
<value style="text" field="isTargetMandatory" />
|
<value style="text" field="isTargetMandatory" get-method="getTargetMandatory"/>
|
||||||
</structure>
|
</structure>
|
||||||
<value name="many" field="isTargetMany" usage="optional"/>
|
<value name="many" field="isTargetMany" usage="optional"/>
|
||||||
</structure>
|
</structure>
|
||||||
|
@@ -198,7 +198,10 @@ public class IndexTransactionTracker extends AbstractReindexComponent
|
|||||||
|
|
||||||
public void resetFromTxn(long txnId)
|
public void resetFromTxn(long txnId)
|
||||||
{
|
{
|
||||||
logger.info("resetFromTxn: "+txnId);
|
if (logger.isInfoEnabled())
|
||||||
|
{
|
||||||
|
logger.info("resetFromTxn: " + txnId);
|
||||||
|
}
|
||||||
|
|
||||||
this.fromTxnId = txnId;
|
this.fromTxnId = txnId;
|
||||||
this.started = false; // this will cause index tracker to break out (so that it can be re-started)
|
this.started = false; // this will cause index tracker to break out (so that it can be re-started)
|
||||||
@@ -207,9 +210,9 @@ public class IndexTransactionTracker extends AbstractReindexComponent
|
|||||||
@Override
|
@Override
|
||||||
protected void reindexImpl()
|
protected void reindexImpl()
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isInfoEnabled())
|
||||||
{
|
{
|
||||||
logger.debug("reindexImpl started: " + this);
|
logger.info("reindexImpl started: " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
RetryingTransactionHelper retryingTransactionHelper = transactionService.getRetryingTransactionHelper();
|
RetryingTransactionHelper retryingTransactionHelper = transactionService.getRetryingTransactionHelper();
|
||||||
@@ -229,7 +232,10 @@ public class IndexTransactionTracker extends AbstractReindexComponent
|
|||||||
|
|
||||||
if (this.fromTxnId != 0L)
|
if (this.fromTxnId != 0L)
|
||||||
{
|
{
|
||||||
logger.info("reindexImpl: start fromTxnId: "+fromTxnId+" "+this);
|
if (logger.isInfoEnabled())
|
||||||
|
{
|
||||||
|
logger.info("reindexImpl: start fromTxnId: " + fromTxnId);
|
||||||
|
}
|
||||||
|
|
||||||
Long fromTxnCommitTime = getTxnCommitTime(this.fromTxnId);
|
Long fromTxnCommitTime = getTxnCommitTime(this.fromTxnId);
|
||||||
|
|
||||||
@@ -248,7 +254,12 @@ public class IndexTransactionTracker extends AbstractReindexComponent
|
|||||||
fromTxnId = 0L;
|
fromTxnId = 0L;
|
||||||
started = true;
|
started = true;
|
||||||
|
|
||||||
logger.info("reindexImpl: start fromTimeInclusive: "+ISO8601DateFormat.format(new Date(fromTimeInclusive))+" "+this);
|
if (logger.isInfoEnabled())
|
||||||
|
{
|
||||||
|
logger.info(
|
||||||
|
"reindexImpl: start fromTimeInclusive: " +
|
||||||
|
ISO8601DateFormat.format(new Date(fromTimeInclusive)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
@@ -32,6 +32,7 @@ import org.alfresco.model.ContentModel;
|
|||||||
import org.alfresco.repo.jscript.ScriptNode;
|
import org.alfresco.repo.jscript.ScriptNode;
|
||||||
import org.alfresco.repo.security.authority.AuthorityDAO;
|
import org.alfresco.repo.security.authority.AuthorityDAO;
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.workflow.WorkflowException;
|
import org.alfresco.service.cmr.workflow.WorkflowException;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
@@ -50,6 +51,7 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
|
|||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1025667849552265719L;
|
private static final long serialVersionUID = 1025667849552265719L;
|
||||||
private ServiceRegistry services;
|
private ServiceRegistry services;
|
||||||
|
private DictionaryService dictionaryService;
|
||||||
private AuthorityDAO authorityDAO;
|
private AuthorityDAO authorityDAO;
|
||||||
|
|
||||||
private Element actor;
|
private Element actor;
|
||||||
@@ -63,6 +65,7 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
|
|||||||
protected void initialiseHandler(BeanFactory factory)
|
protected void initialiseHandler(BeanFactory factory)
|
||||||
{
|
{
|
||||||
services = (ServiceRegistry)factory.getBean(ServiceRegistry.SERVICE_REGISTRY);
|
services = (ServiceRegistry)factory.getBean(ServiceRegistry.SERVICE_REGISTRY);
|
||||||
|
dictionaryService = services.getDictionaryService();
|
||||||
authorityDAO = (AuthorityDAO)factory.getBean("authorityDAO");
|
authorityDAO = (AuthorityDAO)factory.getBean("authorityDAO");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +165,10 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
|
|||||||
if (node instanceof ScriptNode)
|
if (node instanceof ScriptNode)
|
||||||
{
|
{
|
||||||
String actor = mapAuthorityToName((ScriptNode)node, true);
|
String actor = mapAuthorityToName((ScriptNode)node, true);
|
||||||
|
if (actor == null)
|
||||||
|
{
|
||||||
|
throw new WorkflowException("pooledactors expression does not evaluate to a collection of authorities");
|
||||||
|
}
|
||||||
actors.add(actor);
|
actors.add(actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,15 +225,16 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
|
|||||||
{
|
{
|
||||||
String name = null;
|
String name = null;
|
||||||
QName type = authority.getQNameType();
|
QName type = authority.getQNameType();
|
||||||
if (type.equals(ContentModel.TYPE_PERSON))
|
|
||||||
|
if (dictionaryService.isSubClass(type, ContentModel.TYPE_PERSON))
|
||||||
{
|
{
|
||||||
name = (String)authority.getProperties().get(ContentModel.PROP_USERNAME);
|
name = (String)authority.getProperties().get(ContentModel.PROP_USERNAME);
|
||||||
}
|
}
|
||||||
else if (type.equals(ContentModel.TYPE_AUTHORITY))
|
else if (allowGroup && dictionaryService.isSubClass(type, ContentModel.TYPE_AUTHORITY_CONTAINER))
|
||||||
{
|
{
|
||||||
name = authorityDAO.getAuthorityName(authority.getNodeRef());
|
name = authorityDAO.getAuthorityName(authority.getNodeRef());
|
||||||
}
|
}
|
||||||
else if (allowGroup && type.equals(ContentModel.TYPE_AUTHORITY_CONTAINER))
|
else if (type.equals(ContentModel.TYPE_AUTHORITY))
|
||||||
{
|
{
|
||||||
name = authorityDAO.getAuthorityName(authority.getNodeRef());
|
name = authorityDAO.getAuthorityName(authority.getNodeRef());
|
||||||
}
|
}
|
||||||
|
@@ -2576,7 +2576,8 @@ public class JBPMEngine extends BPMEngine
|
|||||||
{
|
{
|
||||||
String name = null;
|
String name = null;
|
||||||
QName type = nodeService.getType(authority);
|
QName type = nodeService.getType(authority);
|
||||||
if (type.equals(ContentModel.TYPE_PERSON))
|
|
||||||
|
if (dictionaryService.isSubClass(type, ContentModel.TYPE_PERSON))
|
||||||
{
|
{
|
||||||
name = (String)nodeService.getProperty(authority, ContentModel.PROP_USERNAME);
|
name = (String)nodeService.getProperty(authority, ContentModel.PROP_USERNAME);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user