Merged 1.4 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4145 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4146 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4159 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4160 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4164 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4165 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4165 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4166 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4176 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4178 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4179 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4181 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4145 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4146 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4630 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-12-18 11:21:44 +00:00
parent 5d738bdf42
commit df4fd38e52
10 changed files with 32 additions and 65 deletions

View File

@@ -193,13 +193,10 @@
</bean> </bean>
<!-- Hibernate-specific implementations of persistence components --> <!-- Hibernate-specific implementations of persistence components -->
<bean id="versionCounterDaoComponent" class="org.alfresco.repo.domain.hibernate.VersionCounterDaoComponentImpl" init-method="init"> <bean id="versionCounterDaoComponent" class="org.alfresco.repo.domain.hibernate.VersionCounterDaoComponentImpl">
<property name="sessionFactory"> <property name="sessionFactory">
<ref bean="sessionFactory" /> <ref bean="sessionFactory" />
</property> </property>
<property name="policyComponent">
<ref bean="policyComponent" />
</property>
</bean> </bean>
<bean id="permissionsDaoComponent" class="org.alfresco.repo.domain.hibernate.PermissionsDaoComponentImpl"> <bean id="permissionsDaoComponent" class="org.alfresco.repo.domain.hibernate.PermissionsDaoComponentImpl">

View File

@@ -258,6 +258,9 @@
<!-- Mime Type Service --> <!-- Mime Type Service -->
<alias name="mimetypeService" alias="MimetypeService"/>
<!--
<bean id="MimetypeService" class="org.springframework.aop.framework.ProxyFactoryBean"> <bean id="MimetypeService" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"> <property name="proxyInterfaces">
<value>org.alfresco.service.cmr.repository.MimetypeService</value> <value>org.alfresco.service.cmr.repository.MimetypeService</value>
@@ -274,6 +277,7 @@
</list> </list>
</property> </property>
</bean> </bean>
-->
<bean id="MimetypeService_descriptor" parent="AlfrescoServiceDescriptor"> <bean id="MimetypeService_descriptor" parent="AlfrescoServiceDescriptor">
<property name="interface"> <property name="interface">

View File

@@ -53,6 +53,20 @@
</overrides> </overrides>
</type> </type>
<type name="wf:approvedTask">
<parent>bpm:workflowTask</parent>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
<type name="wf:rejectedTask">
<parent>bpm:workflowTask</parent>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
<type name="wf:rejectedParallelTask"> <type name="wf:rejectedParallelTask">
<parent>bpm:workflowTask</parent> <parent>bpm:workflowTask</parent>
<mandatory-aspects> <mandatory-aspects>
@@ -99,6 +113,9 @@
<type name="wf:completedAdhocTask"> <type name="wf:completedAdhocTask">
<parent>bpm:workflowTask</parent> <parent>bpm:workflowTask</parent>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type> </type>

View File

@@ -564,7 +564,7 @@ public class ImportFileUpdater
} }
else else
{ {
System.out.println(" ImportFileUpdater <destination> <source>"); System.out.println(" ImportFileUpdater <source> <destination>");
System.out.println(" source - 1.3 import file name to be updated"); System.out.println(" source - 1.3 import file name to be updated");
System.out.println(" destination - name of the generated 1.4 import file"); System.out.println(" destination - name of the generated 1.4 import file");
} }

View File

@@ -40,48 +40,8 @@ import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
*/ */
public class VersionCounterDaoComponentImpl public class VersionCounterDaoComponentImpl
extends HibernateDaoSupport extends HibernateDaoSupport
implements VersionCounterService, NodeServicePolicies.BeforeCreateStorePolicy implements VersionCounterService
{ {
private PolicyComponent policyComponent;
/**
* @param policyComponent the component to register behaviour
*/
public void setPolicyComponent(PolicyComponent policyComponent)
{
this.policyComponent = policyComponent;
}
/**
* Bind to receive notifications of store creations
*/
public void init()
{
policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "beforeCreateStore"),
this,
new JavaBehaviour(this, "beforeCreateStore"));
}
/**
* Create a version counter for the store
* @param nodeTypeQName
* @param storeRef
*/
public void beforeCreateStore(QName nodeTypeQName, StoreRef storeRef)
{
final StoreKey storeKey = new StoreKey(storeRef.getProtocol(), storeRef.getIdentifier());
VersionCount versionCount = (VersionCount) getHibernateTemplate().get(VersionCountImpl.class, storeKey);
if (versionCount != null)
{
// already exists
return;
}
versionCount = new VersionCountImpl();
versionCount.setKey(storeKey);
getHibernateTemplate().save(versionCount);
}
/** /**
* Retrieves or creates a version counter. This locks the counter against updates for the * Retrieves or creates a version counter. This locks the counter against updates for the
* current transaction. * current transaction.

View File

@@ -520,7 +520,7 @@ public class ArchiveAndRestoreTest extends TestCase
public void testInTransactionRestore() throws Exception public void testInTransactionRestore() throws Exception
{ {
RestoreNodeReport report = nodeArchiveService.restoreArchivedNode(a); RestoreNodeReport report = nodeArchiveService.restoreArchivedNode(a_);
// expect a failure due to missing archive node // expect a failure due to missing archive node
assertEquals("Expected failure", RestoreStatus.FAILURE_INVALID_ARCHIVE_NODE, report.getStatus()); assertEquals("Expected failure", RestoreStatus.FAILURE_INVALID_ARCHIVE_NODE, report.getStatus());
// check that our transaction was not affected // check that our transaction was not affected
@@ -529,10 +529,8 @@ public class ArchiveAndRestoreTest extends TestCase
public void testInTransactionPurge() throws Exception public void testInTransactionPurge() throws Exception
{ {
nodeArchiveService.purgeArchivedNode(a); nodeArchiveService.purgeArchivedNode(a_);
// the node should still be there (it was not available to the purge transaction) // the node should still be there (it was not available to the purge transaction)
assertTrue("Node should not have been touched", nodeService.exists(a));
// check that our transaction was not affected
assertEquals("Transaction should still be valid", Status.STATUS_ACTIVE, txn.getStatus()); assertEquals("Transaction should still be valid", Status.STATUS_ACTIVE, txn.getStatus());
} }
@@ -617,6 +615,8 @@ public class ArchiveAndRestoreTest extends TestCase
*/ */
public void testPermissionsForRestore() throws Exception public void testPermissionsForRestore() throws Exception
{ {
// user A deletes 'a' // user A deletes 'a'
authenticationService.authenticate(USER_A, USER_A.toCharArray()); authenticationService.authenticate(USER_A, USER_A.toCharArray());
nodeService.deleteNode(a); nodeService.deleteNode(a);
@@ -624,6 +624,7 @@ public class ArchiveAndRestoreTest extends TestCase
authenticationService.authenticate(USER_B, USER_B.toCharArray()); authenticationService.authenticate(USER_B, USER_B.toCharArray());
nodeService.deleteNode(b); nodeService.deleteNode(b);
commitAndBeginNewTransaction();
// user B can't see archived 'a' // user B can't see archived 'a'
List<RestoreNodeReport> restoredByB = nodeArchiveService.restoreAllArchivedNodes(workStoreRef); List<RestoreNodeReport> restoredByB = nodeArchiveService.restoreAllArchivedNodes(workStoreRef);
assertEquals("User B should be able to see only B's delete", 1, restoredByB.size()); assertEquals("User B should be able to see only B's delete", 1, restoredByB.size());

View File

@@ -446,10 +446,8 @@ public abstract class AbstractReindexComponent implements IndexRecovery
} }
else // node created else // node created
{ {
// get the primary assoc for the node
ChildAssociationRef primaryAssocRef = nodeService.getPrimaryParent(nodeRef);
// reindex // reindex
indexer.createNode(primaryAssocRef); indexer.updateNode(nodeRef);
} }
} }
// done // done

View File

@@ -370,9 +370,7 @@ public abstract class AlfrescoTransactionSupport
return txnSynch; return txnSynch;
} }
// we need a unique ID for the transaction // we need a unique ID for the transaction
StringBuilder sb = new StringBuilder(56); String txnId = GUID.generate();
sb.append(System.currentTimeMillis()).append(":").append(GUID.generate());
String txnId = sb.toString();
// register the synchronization // register the synchronization
txnSynch = new TransactionSynchronizationImpl(txnId); txnSynch = new TransactionSynchronizationImpl(txnId);
TransactionSynchronizationManager.registerSynchronization(txnSynch); TransactionSynchronizationManager.registerSynchronization(txnSynch);

View File

@@ -26,14 +26,6 @@ import org.alfresco.service.namespace.QName;
*/ */
public interface VersionCounterService public interface VersionCounterService
{ {
/**
* Helper method for simple patching
*
* @param nodeTypeQName not used
* @param storeRef the store to create a counter for
*/
public void beforeCreateStore(QName nodeTypeQName, StoreRef storeRef);
/** /**
* Get the next available version number for the specified store. * Get the next available version number for the specified store.
* *

View File

@@ -648,7 +648,7 @@ public class WorkflowInterpreter
return "Syntax Error. Workflow Id not specified.\n"; return "Syntax Error. Workflow Id not specified.\n";
} }
workflowService.cancelWorkflow(workflowId); workflowService.cancelWorkflow(workflowId);
out.println("cancelled workflow" + workflowId); out.println("workflow " + workflowId + " cancelled.");
out.print(interpretCommand("show transitions")); out.print(interpretCommand("show transitions"));
} }
else else