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

@@ -564,7 +564,7 @@ public class ImportFileUpdater
}
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(" 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
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
* current transaction.

View File

@@ -520,7 +520,7 @@ public class ArchiveAndRestoreTest extends TestCase
public void testInTransactionRestore() throws Exception
{
RestoreNodeReport report = nodeArchiveService.restoreArchivedNode(a);
RestoreNodeReport report = nodeArchiveService.restoreArchivedNode(a_);
// expect a failure due to missing archive node
assertEquals("Expected failure", RestoreStatus.FAILURE_INVALID_ARCHIVE_NODE, report.getStatus());
// check that our transaction was not affected
@@ -529,10 +529,8 @@ public class ArchiveAndRestoreTest extends TestCase
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)
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());
}
@@ -617,6 +615,8 @@ public class ArchiveAndRestoreTest extends TestCase
*/
public void testPermissionsForRestore() throws Exception
{
// user A deletes 'a'
authenticationService.authenticate(USER_A, USER_A.toCharArray());
nodeService.deleteNode(a);
@@ -624,6 +624,7 @@ public class ArchiveAndRestoreTest extends TestCase
authenticationService.authenticate(USER_B, USER_B.toCharArray());
nodeService.deleteNode(b);
commitAndBeginNewTransaction();
// user B can't see archived 'a'
List<RestoreNodeReport> restoredByB = nodeArchiveService.restoreAllArchivedNodes(workStoreRef);
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
{
// get the primary assoc for the node
ChildAssociationRef primaryAssocRef = nodeService.getPrimaryParent(nodeRef);
// reindex
indexer.createNode(primaryAssocRef);
indexer.updateNode(nodeRef);
}
}
// done

View File

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

View File

@@ -26,14 +26,6 @@ import org.alfresco.service.namespace.QName;
*/
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.
*

View File

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