mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged DEV/WCM_SERVICES2 to HEAD
12236: Implementation of Sandbox Revert REST API 12305: WCM Services - "asset service" initial checkpoint (more tests to be added) 12334: placeholder for WCM Asset implementation 12338: Check in to get server working ... 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@12544 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,6 +31,8 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.util.ISO8601DateFormat;
|
||||
import org.alfresco.wcm.asset.AssetInfo;
|
||||
import org.alfresco.wcm.asset.AssetService;
|
||||
import org.alfresco.wcm.sandbox.SandboxInfo;
|
||||
import org.alfresco.wcm.sandbox.SandboxConstants;
|
||||
import org.alfresco.wcm.sandbox.SandboxService;
|
||||
@@ -138,6 +140,7 @@ public class Sandbox implements Serializable
|
||||
|
||||
getSandboxService().submitList(getSandboxRef(), items, submitLabel, submitComment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit the specified files and directories modified contents of this sandbox
|
||||
*/
|
||||
@@ -260,28 +263,55 @@ public class Sandbox implements Serializable
|
||||
*/
|
||||
public Asset[] getModifiedAssets()
|
||||
{
|
||||
List<AVMNodeDescriptor> items = getSandboxService().listChangedAll(getSandboxRef(), true);
|
||||
List<AssetInfo> items = getSandboxService().listChangedAll(getSandboxRef(), true);
|
||||
Asset[] ret = new Asset[items.size()];
|
||||
|
||||
int i = 0;
|
||||
for(AVMNodeDescriptor item : items)
|
||||
for(AssetInfo item : items)
|
||||
{
|
||||
ret[i++] = new Asset(this, item);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the specified asset (Either folder or file)
|
||||
* @param path the full path e.g. /www/web_apps/ROOT/index.html
|
||||
* @return the asset
|
||||
*/
|
||||
public Asset getAsset(String path)
|
||||
{
|
||||
AssetService as = getAssetService();
|
||||
AssetInfo item = as.getAsset(getSandboxRef(), path);
|
||||
Asset newAsset = new Asset(this, item);
|
||||
return newAsset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the specified asset with a path relative to the specified web app.
|
||||
* @param path e.g. index.html
|
||||
* @param webApp e.g. ROOT
|
||||
* @return the asset
|
||||
*/
|
||||
public Asset getAssetWebApp(String webApp, String path)
|
||||
{
|
||||
AssetService as = getAssetService();
|
||||
AssetInfo item = as.getAssetWebApp(getSandboxRef(), webApp, path);
|
||||
Asset newAsset = new Asset(this, item);
|
||||
return newAsset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the modified assets within this sandbox
|
||||
* @return the list of changed assets
|
||||
*/
|
||||
public Asset[] getModifiedAssetsWebApp(String webApp)
|
||||
{
|
||||
List<AVMNodeDescriptor> items = getSandboxService().listChangedWebApp(getSandboxRef(), webApp, true);
|
||||
List<AssetInfo> items = getSandboxService().listChangedWebApp(getSandboxRef(), webApp, true);
|
||||
Asset[] ret = new Asset[items.size()];
|
||||
|
||||
int i = 0;
|
||||
for(AVMNodeDescriptor item : items)
|
||||
for(AssetInfo item : items)
|
||||
{
|
||||
ret[i++] = new Asset(this, item);
|
||||
}
|
||||
@@ -305,4 +335,13 @@ public class Sandbox implements Serializable
|
||||
{
|
||||
return webproject.getWebProjects().getSandboxService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the asset service
|
||||
* @return the asset service
|
||||
*/
|
||||
private AssetService getAssetService()
|
||||
{
|
||||
return webproject.getWebProjects().getAssetService();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user