Point checkin.

Reorg to allow sandbox-related constants to be accessed more easily from 
other compilation units.   AVMConstants had become a dumping ground for
things that had nothing to do with const values.   Therefore, this
is now AVMUtil, and sandbox-related constants have been moved to
org.alfresco.sandbox.SandboxConstants, which builds in repository.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5637 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jon Cox
2007-05-08 02:33:18 +00:00
parent 6e0afbf34c
commit 8abfd5ebc8
41 changed files with 289 additions and 528 deletions

View File

@@ -49,7 +49,7 @@ import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.util.Pair;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMConstants;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.WebResources;
import org.springframework.web.jsf.FacesContextUtils;
@@ -382,7 +382,7 @@ public abstract class AbstractItemSelector extends UIInput
{
Pair<Integer, String> avmNode = AVMNodeConverter.ToAVMVersionPath(value);
String avmPath = avmNode.getSecond();
label = avmPath.substring(avmPath.indexOf(AVMConstants.DIR_ROOT)+4);
label = avmPath.substring(avmPath.indexOf(AVMUtil.DIR_ROOT)+4);
}
else
{

View File

@@ -44,7 +44,7 @@ import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMConstants;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.WebProject;
import org.alfresco.web.ui.repo.WebResources;
import org.apache.commons.logging.Log;
@@ -79,7 +79,7 @@ public class UIWebProjectFolderSelector extends AbstractItemSelector
if (this.navigationId != null && this.navigationId.startsWith("-1;"))
{
String rootPath = "-1;" + JNDIConstants.DIR_DEFAULT_WWW + ";" + JNDIConstants.DIR_DEFAULT_APPBASE +
";" + AVMConstants.DIR_ROOT;
";" + AVMUtil.DIR_ROOT;
if (this.navigationId.equals(rootPath) == false)
{
@@ -123,13 +123,13 @@ public class UIWebProjectFolderSelector extends AbstractItemSelector
{
// get the root children for the sandbox of the current user
WebProject webProject = new WebProject(new NodeRef(Repository.getStoreRef(), this.navigationId));
this.avmStore = AVMConstants.buildUserMainStoreName(webProject.getStoreId(),
this.avmStore = AVMUtil.buildUserMainStoreName(webProject.getStoreId(),
Application.getCurrentUser(context).getUserName());
if (logger.isDebugEnabled())
logger.debug("Getting children for store: " + this.avmStore);
String rootPath = AVMConstants.buildStoreWebappPath(this.avmStore, AVMConstants.DIR_ROOT);
String rootPath = AVMUtil.buildStoreWebappPath(this.avmStore, AVMUtil.DIR_ROOT);
if (logger.isDebugEnabled())
logger.debug("Root path for store: "+ rootPath);
@@ -163,7 +163,7 @@ public class UIWebProjectFolderSelector extends AbstractItemSelector
// if they have AddChildren there is probably a sandbox but check to make
// sure as it could have been deleted
WebProject webProject = new WebProject(node);
String storeName = AVMConstants.buildUserMainStoreName(webProject.getStoreId(),
String storeName = AVMUtil.buildUserMainStoreName(webProject.getStoreId(),
currentUserName);
AVMStoreDescriptor storeDesc = avmService.getStore(storeName);
if (storeDesc != null)

View File

@@ -42,7 +42,7 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMConstants;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.DeploymentMonitor;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.logging.Log;
@@ -343,7 +343,7 @@ public class UIDeployWebsite extends UIInput
}
// determine the polling frequency value
int pollFreq = AVMConstants.getRemoteDeploymentPollingFrequency() * 1000;
int pollFreq = AVMUtil.getRemoteDeploymentPollingFrequency() * 1000;
// render the script to handle the progress monitoring
out.write("<script type='text/javascript'>\n");

View File

@@ -50,7 +50,7 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMConstants;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.ui.common.ComponentConstants;
import org.alfresco.web.ui.common.ConstantMethodBinding;
import org.alfresco.web.ui.common.Utils;
@@ -227,7 +227,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
// determine whether the deploy action should be shown
boolean showDeployAction = false;
NodeRef webProjectRef = AVMConstants.getWebProjectNodeFromStore(sandbox);
NodeRef webProjectRef = AVMUtil.getWebProjectNodeFromStore(sandbox);
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
List<String> deployToServers = (List<String>)nodeService.getProperty(webProjectRef,
WCMAppModel.PROP_DEPLOYTO);

View File

@@ -62,7 +62,7 @@ import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.BrowseBean;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.repository.User;
import org.alfresco.web.bean.wcm.AVMConstants;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.AVMNode;
import org.alfresco.web.bean.wcm.WebProject;
import org.alfresco.web.config.ClientConfigElement;
@@ -325,7 +325,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
this.rowToUserLookup.put(username, index);
// build the name of the main store for this user
String mainStore = AVMConstants.buildUserMainStoreName(storeRoot, username);
String mainStore = AVMUtil.buildUserMainStoreName(storeRoot, username);
// check it exists before we render the view
if (avmService.getStore(mainStore) != null)
@@ -334,8 +334,8 @@ public class UIUserSandboxes extends SelfRenderingComponent
if (logger.isDebugEnabled())
logger.debug("Checking user role to view store: " + mainStore);
if (currentUserName.equals(username) ||
AVMConstants.ROLE_CONTENT_MANAGER.equals(currentUserRole) ||
AVMConstants.ROLE_CONTENT_PUBLISHER.equals(currentUserRole))
AVMUtil.ROLE_CONTENT_MANAGER.equals(currentUserRole) ||
AVMUtil.ROLE_CONTENT_PUBLISHER.equals(currentUserRole))
{
if (logger.isDebugEnabled())
logger.debug("Building sandbox view for user store: " + mainStore);
@@ -381,7 +381,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
out.write("&nbsp;&nbsp;");
// Preview Website
String websiteUrl = AVMConstants.buildWebappUrl(mainStore, getWebapp());
String websiteUrl = AVMUtil.buildWebappUrl(mainStore, getWebapp());
Map requestMap = context.getExternalContext().getRequestMap();
requestMap.put(REQUEST_PREVIEW_REF, websiteUrl);
Utils.encodeRecursive(context, aquireAction(
@@ -410,7 +410,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
out.write("&nbsp;&nbsp;");
// Delete Sandbox
if (AVMConstants.ROLE_CONTENT_MANAGER.equals(currentUserRole))
if (AVMUtil.ROLE_CONTENT_MANAGER.equals(currentUserRole))
{
Utils.encodeRecursive(context, aquireAction(
context, mainStore, username, ACT_REMOVE_SANDBOX, "/images/icons/delete_sandbox.gif",
@@ -442,7 +442,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
// content forms panel
if (permissionService.hasPermission(
AVMNodeConverter.ToNodeRef(-1, AVMConstants.buildSandboxRootPath(mainStore)),
AVMNodeConverter.ToNodeRef(-1, AVMUtil.buildSandboxRootPath(mainStore)),
PermissionService.ADD_CHILDREN) == AccessStatus.ALLOWED)
{
out.write("<tr style='padding-top:4px'><td></td><td colspan=2>");
@@ -545,7 +545,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
if (currentUser.isAdmin())
{
// fake the Content Manager role for an admin user
userrole = AVMConstants.ROLE_CONTENT_MANAGER;
userrole = AVMUtil.ROLE_CONTENT_MANAGER;
}
else
{
@@ -588,10 +588,10 @@ public class UIUserSandboxes extends SelfRenderingComponent
ResourceBundle bundle = Application.getBundle(fc);
// build the paths to the stores to compare - filter by current webapp
String userStore = AVMConstants.buildUserMainStoreName(storeRoot, username);
String userStorePath = AVMConstants.buildStoreWebappPath(userStore, getWebapp());
String stagingStore = AVMConstants.buildStagingStoreName(storeRoot);
String stagingStorePath = AVMConstants.buildStoreWebappPath(stagingStore, getWebapp());
String userStore = AVMUtil.buildUserMainStoreName(storeRoot, username);
String userStorePath = AVMUtil.buildStoreWebappPath(userStore, getWebapp());
String stagingStore = AVMUtil.buildStagingStoreName(storeRoot);
String stagingStorePath = AVMUtil.buildStoreWebappPath(stagingStore, getWebapp());
// use the sync service to get the list of diffs between the stores
NameMatcher matcher = (NameMatcher)FacesContextUtils.getRequiredWebApplicationContext(fc).getBean(
@@ -600,8 +600,8 @@ public class UIUserSandboxes extends SelfRenderingComponent
if (diffs.size() != 0)
{
// info we need to calculate preview paths for assets
String dns = AVMConstants.lookupStoreDNS(userStore);
int rootPathIndex = AVMConstants.buildSandboxRootPath(userStore).length();
String dns = AVMUtil.lookupStoreDNS(userStore);
int rootPathIndex = AVMUtil.buildSandboxRootPath(userStore).length();
ClientConfigElement config = Application.getClientConfig(fc);
// get the UIActions component responsible for rendering context related user actions
@@ -624,7 +624,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
out.write("<tr><td colspan=8>");
out.write(bundle.getString(MSG_SELECTED));
out.write(":&nbsp;&nbsp;");
NodeRef userStoreRef = AVMNodeConverter.ToNodeRef(-1, AVMConstants.buildSandboxRootPath(userStore));
NodeRef userStoreRef = AVMNodeConverter.ToNodeRef(-1, AVMUtil.buildSandboxRootPath(userStore));
if (permissionService.hasPermission(userStoreRef, PermissionService.WRITE) == AccessStatus.ALLOWED ||
permissionService.hasPermission(userStoreRef, PermissionService.ADD_CHILDREN) == AccessStatus.ALLOWED)
{
@@ -729,7 +729,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
// build node context required for actions
AVMNode avmNode = new AVMNode(node);
String assetPath = sourcePath.substring(rootPathIndex);
String previewUrl = AVMConstants.buildAssetUrl(
String previewUrl = AVMUtil.buildAssetUrl(
assetPath, config.getWCMDomain(), config.getWCMPort(), dns);
avmNode.getProperties().put("previewUrl", previewUrl);
@@ -820,7 +820,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
{
NodeService nodeService = getNodeService(fc);
Map requestMap = fc.getExternalContext().getRequestMap();
String userStorePrefix = AVMConstants.buildUserMainStoreName(storeRoot, username);
String userStorePrefix = AVMUtil.buildUserMainStoreName(storeRoot, username);
// only need to collect the list of forms once per render
// TODO: execute permission evaluations on a per user basis against each form?