Merged V2.2 to HEAD

7653: Update and added deployment icons
   7655: Fixed multithreaded test case to handle case where threads can't get started due to lack of available DB connections.
   7657: AR-1903: Text attachments should be treated the same way as other attachments.
   7661: Fixed duplicate index creation for column that is also declared unique
   7662: Additional indexes related to permissions
   7664: Fixed query for specific property types
   7667: Used existing attachable aspect for email attachments - effectively reversing association direction.
   7682: Added AVM Console page to webapp (admin user protected)
   7683: Merged V2.1 to V2.2
      7642: Fix for WCM-949
      7668: Debugging output for getAPath(). Possible partial fix for LazyInitialization errors seen by some customers
      7672: Fixed sub optimal tree pruning in filesystem deployment


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8442 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-03-06 21:28:43 +00:00
parent ab80624ce0
commit ecb74c1447
19 changed files with 215 additions and 79 deletions

View File

@@ -41,6 +41,8 @@ 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.avm.VersionDescriptor;
import org.alfresco.service.cmr.avm.locking.AVMLock;
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.namespace.QName;
@@ -48,7 +50,9 @@ import org.springframework.context.support.FileSystemXmlApplicationContext;
/**
* An interactive console for the AVM repository.
*
* @author britt
* @author Gavin Cornwell
*/
public class AVMInterpreter
{
@@ -62,6 +66,11 @@ public class AVMInterpreter
*/
private AVMSyncService fSyncService;
/**
* The locking service.
*/
private AVMLockingService fLockingService;
/**
* The reader for interaction.
*/
@@ -83,6 +92,7 @@ public class AVMInterpreter
AVMInterpreter console = new AVMInterpreter();
console.setAvmService((AVMService)context.getBean("AVMService"));
console.setAvmSyncService((AVMSyncService)context.getBean("AVMSyncService"));
console.setAvmLockingService((AVMLockingService)context.getBean("AVMLockingService"));
BulkLoader loader = new BulkLoader();
loader.setAvmService((AVMService)context.getBean("AVMService"));
console.setBulkLoader(loader);
@@ -115,6 +125,15 @@ public class AVMInterpreter
{
fSyncService = syncService;
}
/**
* Set the AVM locking service.
* @param lockService
*/
public void setAvmLockingService(AVMLockingService lockService)
{
fLockingService = lockService;
}
/**
* Set the bulk loader.
@@ -409,6 +428,56 @@ public class AVMInterpreter
out.println(p.getKey() + ": " + p.getValue());
}
}
else if (command[0].equals("descnode"))
{
if (command.length != 3)
{
return "Syntax Error.";
}
String path = command[1];
AVMNodeDescriptor nodeDesc = fService.lookup(Integer.parseInt(command[2]), path);
if (nodeDesc == null)
{
return "Path Not Found.";
}
out.println(nodeDesc.toString());
out.println("isDirectory: " + nodeDesc.isDirectory());
out.println("isFile: " + nodeDesc.isFile());
out.println("isPrimary: " + nodeDesc.isPrimary());
out.println("isOpaque: " + nodeDesc.getOpacity());
out.println("creator: " + nodeDesc.getCreator());
out.println("owner: " + nodeDesc.getOwner());
out.println("lastModifier: " + nodeDesc.getLastModifier());
out.println("created: " + new Date(nodeDesc.getCreateDate()));
out.println("modified: " + new Date(nodeDesc.getModDate()));
out.println("lastAccess: " + new Date(nodeDesc.getAccessDate()));
// get lock information
String lockPath = path.substring(path.indexOf("/"));
String store = path.substring(0, path.indexOf(":"));
String mainStore = store;
if (store.indexOf("--") != -1)
{
mainStore = store.substring(0, store.indexOf("--"));
}
AVMLock lock = fLockingService.getLock(mainStore, lockPath);
out.print("lock: ");
if (lock != null)
{
out.print("store = ");
out.print(lock.getStore());
out.print(", owners = ");
out.println(lock.getOwners());
}
else
{
out.println("No locks found");
}
}
else if (command[0].equals("deletenodeproperty"))
{
if (command.length != 3)