Merged V3.2 to HEAD

16030: Merged V3.1 to V3.2
        16001: Merged V2.2 to V3.1
            15999: Temp build/test (AVM permissions - testSimpleInternalLayer)
    16223: WCM UI - simple perf improvement when displaying modified list (lock icon)
    16472: Merged V3.1 to V3.2
        16180: ETHREEOH-2821 - fix deployment of WCM layered (ie. across web project) file
        16188: WCM - minor: display (localisable) "File" text (follow-on fix for r15970)
        16255: WCM - ETHREEOH-2836
        16257: AVM - minor updates to unit tests
        16275: WCM - ETHREEOH-2844
        16277: WCM - ETHREEOH-2829 - added simple unit test
        16341: AVM - minor update to reuse core (path) utils
        16344: Merged V2.2 to V3.1
            16323: Fix ETWOTWO-1266 (unexpected AVM conflict)
        16457: Fix ETHREEOH-2836 (WCM layered files) - follow-on fix, with additional unit test
    16649: Fix ETHREEOH-1878 - configure WCM locking for CIFS/FTP
    16654: Merged V3.1 to V3.2
        16507: Fix ETHREEOH-2604 - update unsecured-public-services-security-context.xml.sample (to allow server to start)
        16527: Fix ETHREEOH-2868 - can't submit removal of WCM layered file (Older version prevents update)
        16607: AVM - additional tests when deleting LD + fix to avoid cycle
        16612: AVM - console improvement (lsver, rmvers) to enable admin/support to list & purge snapshots between dates
        16638: Fix ETHREEOH-2893 - stale WCM/AVM layered dir
        16643: AVM - console improvement (setopacity) -> eg. to set stale/modifed WCM layered folder as opaque


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16895 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-10-14 09:20:15 +00:00
parent 51e37ecf1a
commit e096d59076
30 changed files with 2414 additions and 447 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2008 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
@@ -56,6 +56,8 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ISO8601DateFormat;
import org.alfresco.wcm.util.WCMUtil;
import org.springframework.context.support.FileSystemXmlApplicationContext;
/**
@@ -63,6 +65,7 @@ import org.springframework.context.support.FileSystemXmlApplicationContext;
*
* @author britt
* @author Gavin Cornwell
* @author janv
*/
public class AVMInterpreter
{
@@ -256,11 +259,28 @@ public class AVMInterpreter
}
else if (command[0].equals("lsver"))
{
if (command.length != 2)
if ((command.length < 2) || (command.length > 4))
{
return "Syntax Error.";
}
List<VersionDescriptor> listing = fService.getStoreVersions(command[1]);
List<VersionDescriptor> listing = null;
String storeName = command[1];
if (command.length == 2)
{
listing = fService.getStoreVersions(storeName);
}
else
{
Date fromDate = ISO8601DateFormat.parse(command[2]);
Date toDate = new Date();
if (command.length == 4)
{
toDate = ISO8601DateFormat.parse(command[3]);
}
listing = fService.getStoreVersions(storeName, fromDate, toDate);
}
for (VersionDescriptor desc : listing)
{
out.println(desc);
@@ -306,6 +326,15 @@ public class AVMInterpreter
}
fService.createLayeredDirectory(command[1], command[2], command[3]);
}
else if (command[0].equals("setopacity"))
{
if (command.length != 3)
{
return "Syntax Error.";
}
boolean isOpaque = new Boolean(command[2]);
fService.setOpacity(command[1], isOpaque);
}
else if (command[0].equals("rename"))
{
if (command.length != 5)
@@ -406,7 +435,38 @@ public class AVMInterpreter
{
return "Syntax Error.";
}
fService.purgeVersion(Integer.parseInt(command[2]), command[1]);
String storeName = command[1];
int ver =Integer.parseInt(command[2]);
String wpStoreId = getWebProject(storeName);
if ((wpStoreId != null) && (ver <= 2))
{
return "WCM store - cannot delete versions 0-2";
}
fService.purgeVersion(ver, storeName);
}
else if (command[0].equals("rmvers"))
{
if (command.length != 4)
{
return "Syntax Error.";
}
String storeName = command[1];
String wpStoreId = getWebProject(storeName);
Date fromDate = ISO8601DateFormat.parse(command[2]);
Date toDate = ISO8601DateFormat.parse(command[3]);
List<VersionDescriptor> listing = fService.getStoreVersions(storeName, fromDate, toDate);
for (VersionDescriptor desc : listing)
{
int ver = desc.getVersionID();
if ((wpStoreId != null) && (ver <= 2))
{
return "WCM store - cannot delete versions 0-2";
}
fService.purgeVersion(ver, storeName);
}
}
else if (command[0].equals("write"))
{
@@ -916,4 +976,14 @@ public class AVMInterpreter
}
return elements;
}
private String getWebProject(String name)
{
String wpStoreId = WCMUtil.getWebProjectStoreId(name);
if (WCMUtil.getWebProjectNodeFromWebProjectStore(fService, wpStoreId) != null)
{
return wpStoreId;
}
return null;
}
}