Merged V2.0 to HEAD

5457: Merge error on copy web project action
   5459: AR-1278
   5461:
   5462: A few deployment fixes
   5469: Dictionary messages
   5470: L2 cache checks
   5478: WCM-374


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5485 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-04-12 02:02:42 +00:00
parent 69694b7ac0
commit 24a483f73d
7 changed files with 41 additions and 22 deletions

View File

@@ -170,8 +170,10 @@ public final class FacesHelper
// replace illegal ID characters with an underscore
id = id.replace(':', '_');
id = id.replace(' ', '_');
id = id.replace('.', '_');
// TODO: check all other illegal characters - only allowed dash and underscore
// TODO: use regular expression to do check and replacment of characters
}
return id;

View File

@@ -820,7 +820,9 @@ public final class AVMConstants
*/
public static NodeRef getWebProjectNodeFromPath(final String absoluteAVMPath)
{
return getWebProjectNodeFromStore(AVMConstants.getStoreName(absoluteAVMPath));
String storeName = AVMConstants.getStoreName(absoluteAVMPath);
String storeId = AVMConstants.getStoreId(storeName);
return getWebProjectNodeFromStore(storeId);
}
/**

View File

@@ -225,8 +225,19 @@ public class UISandboxSnapshots extends SelfRenderingComponent
versions = avmService.getStoreVersions(sandbox, fromDate, toDate);
}
// determine whether the deploy action should be shown
boolean showDeployAction = false;
NodeRef webProjectRef = AVMConstants.getWebProjectNodeFromStore(sandbox);
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
List<String> deployToServers = (List<String>)nodeService.getProperty(webProjectRef,
WCMAppModel.PROP_DEPLOYTO);
if (deployToServers != null && deployToServers.size() > 0)
{
showDeployAction = true;
}
// determine the deployment status for the website
determineDeploymentStatus(context, sandbox);
determineDeploymentStatus(context, webProjectRef, sandbox, nodeService);
Map requestMap = context.getExternalContext().getRequestMap();
for (int i=versions.size() - 1; i >= 0; i--) // reverse order
@@ -274,28 +285,32 @@ public class UISandboxSnapshots extends SelfRenderingComponent
}
requestMap.put(REQUEST_SNAPVERSION, Integer.toString(item.getVersionID()));
Utils.encodeRecursive(context, action);
out.write("&nbsp;&nbsp;");
// deploy action
action = findAction(ACT_SNAPSHOT_DEPLOY, sandbox);
if (action == null)
// deploy action (if there are deployto servers specified)
if (showDeployAction)
{
Map<String, String> params = new HashMap<String, String>(2, 1.0f);
params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
action = createAction(context, sandbox, ACT_SNAPSHOT_DEPLOY, "/images/icons/deploy.gif",
"#{DialogManager.setupParameters}", "dialog:deploySnapshot", null, params);
out.write("&nbsp;&nbsp;");
action = findAction(ACT_SNAPSHOT_DEPLOY, sandbox);
if (action == null)
{
Map<String, String> params = new HashMap<String, String>(2, 1.0f);
params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
action = createAction(context, sandbox, ACT_SNAPSHOT_DEPLOY, "/images/icons/deploy.gif",
"#{DialogManager.setupParameters}", "dialog:deploySnapshot", null, params);
}
Utils.encodeRecursive(context, action);
}
Utils.encodeRecursive(context, action);
requestMap.remove(REQUEST_SNAPVERSION);
//out.write("&nbsp;");
// TODO: restore once preview of a store by version is implemented in vserver
//out.write("&nbsp;&nbsp;");
/*Utils.encodeRecursive(context, aquireAction(
context, sandbox, ACT_SNAPSHOT_PREVIEW, null,
null, null));
out.write("&nbsp;");*/
requestMap.remove(REQUEST_SNAPVERSION);
out.write("</nobr></td></tr>");
}
}
@@ -463,11 +478,10 @@ public class UISandboxSnapshots extends SelfRenderingComponent
return control;
}
private void determineDeploymentStatus(FacesContext context, String sandbox)
private void determineDeploymentStatus(FacesContext context, NodeRef webProjectRef,
String sandbox, NodeService nodeService)
{
// work out what status to show against which snapshot
NodeRef webProjectRef = AVMConstants.getWebProjectNodeFromStore(sandbox);
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
List<String> selectedServers = (List<String>)nodeService.getProperty(webProjectRef,
WCMAppModel.PROP_SELECTEDDEPLOYTO);
Integer ver = (Integer)nodeService.getProperty(webProjectRef,

View File

@@ -58,6 +58,7 @@ import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.NameMatcher;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet;
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;
@@ -1001,7 +1002,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
private UIActionLink findAction(String name, String store)
{
UIActionLink action = null;
String actionId = name + '_' + store;
String actionId = name + '_' + FacesHelper.makeLegalId(store);
if (logger.isDebugEnabled())
logger.debug("Finding action Id: " + actionId);
for (UIComponent component : (List<UIComponent>)getChildren())
@@ -1038,7 +1039,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
javax.faces.application.Application facesApp = fc.getApplication();
UIActionLink control = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
String id = name + '_' + store;
String id = name + '_' + FacesHelper.makeLegalId(store);
if (logger.isDebugEnabled())
logger.debug("...creating action Id: " + id);
control.setRendererType(UIActions.RENDERER_ACTIONLINK);