putting jon's change from last night back in and fixing mostly everything (i know of) that it broke

- added utility methods to AVMConstants to extract information about stores from their names.  this has to be reimplemented to look at store properties rather than inferring things from their names - but it works for now.  this also centralizes all the usage of the store name to infer data about it so it'll make it easier later.
- made the problematic constants jon changed private to avoid having this problem happen again
- checked pretty much every usage of buildAVM<bla> to ensure that nothing else was broken.  in the process removed the AVM part from the buildAVM<bla> part of the method to shorten it and since it's redundant with the classname AVMConstants in which their contained.

creating workflow sandboxes in a manner consistent with user sandboxes
- added a method to SandboxFactory to create workflow sandboxes. they're created with the name <storeId>--workflow-<guid>
- centralized workflow package creation code in AVMWorkflowUtil.
- refactored sandbox creation code to use new utility methods in AVMConstants and so that at some point it can be further refactored.
 
getting avm actions to show up in manage task screen for avm workflows
- modified the model to use different packageItemActionGroups for wcm workflows
- modified the AVMWorkflowEvaluator to allow all actions for items in a workflow package
- added some debug output to various classes
- made wcm navigation ids exposed throughout the app since they are now called from workflow jsps.

things that now work that didn't before:
- virtualization now works again with jon's new naming scheme
- some actions from the manage task screen.

known bugs introduced or remaining as a consequence of this change (i'll filed jira issues for these as soon as i commit this):
- i'm inaccurately counting the number of users in a sandbox since it's harder now to differentiate between user main sandboxes and all the other ones that are being created
- preview does not work on assets within the workflow sandboxes
- review and approve workflow does not appear to actually submit once approved.  not sure if it did before
- lots of actions still do not work from manage tasks, though edit does appear to.
- i commented out the location column in the manage task screen since the path link was causing me troubles - need to put that back in.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4692 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-12-23 01:44:19 +00:00
parent 86f31616ba
commit 15733b9771
32 changed files with 811 additions and 494 deletions

View File

@@ -241,7 +241,7 @@ public class AVMBrowseBean implements IContextListener
{
// count user stores
int users = avmService.queryStoresPropertyKeys(QName.createQName(null,
AVMConstants.PROP_SANDBOX_STORE_PREFIX + storeRoot + "-%" + AVMConstants.STORE_MAIN)).size();
AVMConstants.PROP_SANDBOX_STORE_PREFIX + storeRoot + "-%")).size() / 2;
summary.append(msg.getString(MSG_CREATED_ON)).append(": ")
.append(Utils.getDateFormat(fc).format(new Date(store.getCreateDate())))
.append("<p>");
@@ -263,7 +263,7 @@ public class AVMBrowseBean implements IContextListener
public String getStagingStore()
{
String storeRoot = (String)getWebsite().getProperties().get(WCMAppModel.PROP_AVMSTORE);
return AVMConstants.buildAVMStagingStoreName(storeRoot);
return AVMConstants.buildStagingStoreName(storeRoot);
}
/**
@@ -271,7 +271,7 @@ public class AVMBrowseBean implements IContextListener
*/
public String getStagingPreviewUrl()
{
return AVMConstants.buildAVMWebappUrl(getStagingStore(), getWebapp());
return AVMConstants.buildWebappUrl(getStagingStore(), getWebapp());
}
/**
@@ -279,7 +279,7 @@ public class AVMBrowseBean implements IContextListener
*/
public String getSandboxPreviewUrl()
{
return AVMConstants.buildAVMWebappUrl(getSandbox(), getWebapp());
return AVMConstants.buildWebappUrl(getSandbox(), getWebapp());
}
/**
@@ -387,7 +387,7 @@ public class AVMBrowseBean implements IContextListener
*/
public List<SelectItem> getWebapps()
{
String path = AVMConstants.buildAVMStoreRootPath(getStagingStore());
String path = AVMConstants.buildSandboxRootPath(getStagingStore());
Map<String, AVMNodeDescriptor> folders = this.avmService.getDirectoryListing(-1, path);
List<SelectItem> webapps = new ArrayList<SelectItem>(folders.size());
for (AVMNodeDescriptor node : folders.values())
@@ -496,7 +496,7 @@ public class AVMBrowseBean implements IContextListener
{
if (this.currentPath == null)
{
this.currentPath = AVMConstants.buildAVMStoreWebappPath(getSandbox(), getWebapp());
this.currentPath = AVMConstants.buildStoreWebappPath(getSandbox(), getWebapp());
}
return this.currentPath;
}
@@ -623,7 +623,7 @@ public class AVMBrowseBean implements IContextListener
tx.begin();
String dns = AVMConstants.lookupStoreDNS(getSandbox());
int rootPathIndex = AVMConstants.buildAVMStoreRootPath(getSandbox()).length();
int rootPathIndex = AVMConstants.buildSandboxRootPath(getSandbox()).length();
Map<String, AVMNodeDescriptor> nodes = this.avmService.getDirectoryListing(-1, getCurrentPath());
this.files = new ArrayList<Map>(nodes.size());
@@ -655,7 +655,7 @@ public class AVMBrowseBean implements IContextListener
// common properties
String assetPath = path.substring(rootPathIndex);
String previewUrl = AVMConstants.buildAVMAssetUrl(assetPath, wcmDomain, wcmPort, dns);
String previewUrl = AVMConstants.buildAssetUrl(assetPath, wcmDomain, wcmPort, dns);
node.getProperties().put("previewUrl", previewUrl);
}
@@ -747,7 +747,7 @@ public class AVMBrowseBean implements IContextListener
else
{
// get the staging store from the current website node
setSandbox(AVMConstants.buildAVMStagingStoreName(
setSandbox(AVMConstants.buildStagingStoreName(
(String)getWebsite().getProperties().get(WCMAppModel.PROP_AVMSTORE)));
}
@@ -777,33 +777,39 @@ public class AVMBrowseBean implements IContextListener
setupContentAction(path, true);
}
/*package*/ void setupContentAction(String path, boolean refresh)
/*package*/ void setupContentAction(final String path, final boolean refresh)
{
if (path != null && path.length() != 0)
if (logger.isDebugEnabled())
logger.debug("Setup content action for path: " + path);
if (path == null && path.length() == 0)
{
if (logger.isDebugEnabled())
logger.debug("Setup content action for path: " + path);
// calculate username and store name from specified path
String[] parts = path.split("[-:]");
String storename = parts[0];
String username = parts[2];
if (username.equals(AVMConstants.STORE_STAGING.substring(1)))
{
setupSandboxActionImpl(null, null, false);
}
else
{
setupSandboxActionImpl(AVMConstants.buildAVMUserMainStoreName(storename, username), username, false);
}
// setup the action node
AVMNodeDescriptor node = avmService.lookup(-1, path, true);
setAVMActionNodeDescriptor(node);
setAvmActionNode(null);
}
else
{
setAvmActionNode(null);
// calculate username and store name from specified path
String storeName = AVMConstants.getStoreName(path);
final String storeId = AVMConstants.getStoreId(storeName);
final String username = AVMConstants.getUserName(storeName);
final boolean preview = AVMConstants.isPreviewStore(storeName);
if (username == null)
{
storeName = (preview
? AVMConstants.buildStagingPreviewStoreName(storeId)
: AVMConstants.buildStagingStoreName(storeId));
setupSandboxActionImpl(storeName, null, false);
}
else
{
storeName = (preview
? AVMConstants.buildUserPreviewStoreName(storeId, username)
: AVMConstants.buildUserMainStoreName(storeId, username));
setupSandboxActionImpl(storeName, username, false);
}
// setup the action node
setAVMActionNodeDescriptor(avmService.lookup(-1, path, true));
}
// update UI state ready for return after dialog close
@@ -1028,7 +1034,7 @@ public class AVMBrowseBean implements IContextListener
@Override
public String toString()
{
if (AVMConstants.buildAVMStoreRootPath(getSandbox()).equals(path))
if (AVMConstants.buildSandboxRootPath(getSandbox()).equals(path))
{
// don't display the 'root' webapps path as this will confuse users
// instead display which sandbox we are in