Merge DEV\WCM_SERVICES2 to HEAD

12513 Implementation of Asset.getProperties
    12469 Implement paths relative to web app.  And unit tests.   Asset Test is now clean of TODOs.
    12413  Implementation of WCM Asset.    Still work remaining but this is 80% of the implementation.
    12404 WCM Services
        - asset service - fix rename/move folder issue (folders are not locked)
        - sandbox service - fix delete sandbox test
    12374 WCM Services - optimise get/is web project
    12347  WCM Services - "asset service" - add/remove/has aspect, get aspects
    12341  WCM Services - "asset service" checkpoint (locking fixes, bulk import, more tests added)




git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12547 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2008-12-23 22:54:46 +00:00
parent eb906a0d52
commit d09673969d
14 changed files with 507 additions and 192 deletions

View File

@@ -36,7 +36,9 @@ import org.alfresco.mbeans.VirtServerRegistry;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMBadArgumentException;
import org.alfresco.service.cmr.avm.AVMNotFoundException;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
@@ -45,6 +47,8 @@ import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.ParameterCheck;
import org.alfresco.util.VirtServerUtils;
import org.alfresco.wcm.sandbox.SandboxConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
@@ -57,6 +61,8 @@ import org.alfresco.wcm.sandbox.SandboxConstants;
*/
public class WCMUtil
{
private static Log logger = LogFactory.getLog(WCMUtil.class);
/**
* Extracts the sandbox store id from the avm path
*
@@ -478,6 +484,29 @@ public class WCMUtil
: null);
}
public static NodeRef getWebProjectNodeFromWebProjectStore(AVMService avmService, String wpStoreId)
{
NodeRef wpNodeRef = null;
String stagingStoreId = wpStoreId; // note: equivalent to WCMUtil.buildStagingStoreName(wpStoreId)
try
{
PropertyValue pValue = avmService.getStoreProperty(stagingStoreId, SandboxConstants.PROP_WEB_PROJECT_NODE_REF);
if (pValue != null)
{
wpNodeRef = (NodeRef)pValue.getValue(DataTypeDefinition.NODE_REF);
}
}
catch (AVMNotFoundException nfe)
{
logger.warn(wpStoreId + " is not a web project: " + nfe);
}
return wpNodeRef;
}
/**
* Converts the provided path to an absolute path within the avm.
*