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

@@ -1044,7 +1044,7 @@ deploy_status_failed=FAILED
deploy_status_partial=PARTIAL FAILURE deploy_status_partial=PARTIAL FAILURE
reason=Reason reason=Reason
snapshot=Snapshot snapshot=Snapshot
deploy_to_help=A comma separated list of servers to deploy the website to. Each entry can be a host name or an IP address and may also contain a port number. If a port number is not specified the default of {0} will be used. deploy_to_help=A comma separated list of servers to deploy the website to.<p>Each entry can be a host name or an IP address and may also contain an RMI port number. If an RMI port number is not specified the default of {0} will be used.</p><p>Example: liveserver1, liveserver2:50900</p>
# New User Wizard messages # New User Wizard messages
new_user_title=New User Wizard new_user_title=New User Wizard

View File

@@ -18,7 +18,7 @@
<!-- default RMI port to connect to on remote machine --> <!-- default RMI port to connect to on remote machine -->
<remote-rmi-port>50500</remote-rmi-port> <remote-rmi-port>50500</remote-rmi-port>
<!-- frequency (in seconds) of polling checks to get latest status of a deployment --> <!-- frequency (in seconds) of polling checks to get latest status of a deployment -->
<progress-polling-frequency>5</progress-polling-frequency> <progress-polling-frequency>2</progress-polling-frequency>
<!-- the delay (in seconds) to apply to a deployment (for testing and demo purposes) --> <!-- the delay (in seconds) to apply to a deployment (for testing and demo purposes) -->
<delay>30</delay> <delay>30</delay>
</deployment> </deployment>

View File

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

View File

@@ -820,7 +820,9 @@ public final class AVMConstants
*/ */
public static NodeRef getWebProjectNodeFromPath(final String absoluteAVMPath) 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); 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 // determine the deployment status for the website
determineDeploymentStatus(context, sandbox); determineDeploymentStatus(context, webProjectRef, sandbox, nodeService);
Map requestMap = context.getExternalContext().getRequestMap(); Map requestMap = context.getExternalContext().getRequestMap();
for (int i=versions.size() - 1; i >= 0; i--) // reverse order 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())); requestMap.put(REQUEST_SNAPVERSION, Integer.toString(item.getVersionID()));
Utils.encodeRecursive(context, action); Utils.encodeRecursive(context, action);
out.write("&nbsp;&nbsp;");
// deploy action // deploy action (if there are deployto servers specified)
action = findAction(ACT_SNAPSHOT_DEPLOY, sandbox); if (showDeployAction)
if (action == null)
{ {
Map<String, String> params = new HashMap<String, String>(2, 1.0f); out.write("&nbsp;&nbsp;");
params.put("version", "#{" + REQUEST_SNAPVERSION + "}"); action = findAction(ACT_SNAPSHOT_DEPLOY, sandbox);
action = createAction(context, sandbox, ACT_SNAPSHOT_DEPLOY, "/images/icons/deploy.gif", if (action == null)
"#{DialogManager.setupParameters}", "dialog:deploySnapshot", null, params); {
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 // TODO: restore once preview of a store by version is implemented in vserver
//out.write("&nbsp;&nbsp;");
/*Utils.encodeRecursive(context, aquireAction( /*Utils.encodeRecursive(context, aquireAction(
context, sandbox, ACT_SNAPSHOT_PREVIEW, null, context, sandbox, ACT_SNAPSHOT_PREVIEW, null,
null, null)); null, null));
out.write("&nbsp;");*/ out.write("&nbsp;");*/
requestMap.remove(REQUEST_SNAPVERSION);
out.write("</nobr></td></tr>"); out.write("</nobr></td></tr>");
} }
} }
@@ -463,11 +478,10 @@ public class UISandboxSnapshots extends SelfRenderingComponent
return control; 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 // 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, List<String> selectedServers = (List<String>)nodeService.getProperty(webProjectRef,
WCMAppModel.PROP_SELECTEDDEPLOYTO); WCMAppModel.PROP_SELECTEDDEPLOYTO);
Integer ver = (Integer)nodeService.getProperty(webProjectRef, 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.util.NameMatcher;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.DownloadContentServlet; 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.BrowseBean;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.repository.User; import org.alfresco.web.bean.repository.User;
@@ -1001,7 +1002,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
private UIActionLink findAction(String name, String store) private UIActionLink findAction(String name, String store)
{ {
UIActionLink action = null; UIActionLink action = null;
String actionId = name + '_' + store; String actionId = name + '_' + FacesHelper.makeLegalId(store);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Finding action Id: " + actionId); logger.debug("Finding action Id: " + actionId);
for (UIComponent component : (List<UIComponent>)getChildren()) for (UIComponent component : (List<UIComponent>)getChildren())
@@ -1038,7 +1039,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
javax.faces.application.Application facesApp = fc.getApplication(); javax.faces.application.Application facesApp = fc.getApplication();
UIActionLink control = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK); UIActionLink control = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
String id = name + '_' + store; String id = name + '_' + FacesHelper.makeLegalId(store);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("...creating action Id: " + id); logger.debug("...creating action Id: " + id);
control.setRendererType(UIActions.RENDERER_ACTIONLINK); control.setRendererType(UIActions.RENDERER_ACTIONLINK);

View File

@@ -162,7 +162,7 @@
<f:verbatim> <f:verbatim>
<div id="deploy-to-help" class="summary infoText statusInfoText" style="display: none; padding: 5px; width: 220px;"> <div id="deploy-to-help" class="summary infoText statusInfoText" style="display: none; padding: 5px; width: 220px;">
</f:verbatim> </f:verbatim>
<h:outputText id="deploy-top-help-text" value="#{WizardManager.bean.deployToHelp}" /> <h:outputText id="deploy-top-help-text" value="#{WizardManager.bean.deployToHelp}" escape="false" />
<f:verbatim> <f:verbatim>
</div> </div>
</td> </td>