Merged V2.2 to HEAD
7389: Added Deploy action to user sandboxes Renamed DeploySnapshotDialog to DeployWebsiteDialog and AVMDeploySnapshotAction to AVMDeployWebsiteAction Updated UIDeployWebsite component to list unallocated test or live servers Updated DeployWebsiteDialog to update allocatedto property on server config when necessary 7392: Incorporated panel graphics from Linton for deploy server configuration Applied feedback from Linton on add, edit, remove deploy server config 7412: Added ability to re-deploy to test servers Added ability to view deployment reports for test servers Added ability to preview test servers git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8353 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
@@ -1085,8 +1085,9 @@ sandbox_revertselected=Undo Selected
|
|||||||
sandbox_icon=Browse Website
|
sandbox_icon=Browse Website
|
||||||
sandbox_snapshot=Create Snapshot
|
sandbox_snapshot=Create Snapshot
|
||||||
sandbox_snapshot_info=Create a snaphost of this sandbox.
|
sandbox_snapshot_info=Create a snaphost of this sandbox.
|
||||||
sandbox_remove=Delete Sandbox
|
sandbox_remove=Delete
|
||||||
sandbox_refresh=Refresh
|
sandbox_refresh=Refresh
|
||||||
|
sandbox_deploy=Deploy & Preview
|
||||||
import_website_content=Bulk Import
|
import_website_content=Bulk Import
|
||||||
title_browse_sandbox=Browse Sandbox
|
title_browse_sandbox=Browse Sandbox
|
||||||
sandbox_info=Use this view to browse the files and folders within the sandbox for a web project.
|
sandbox_info=Use this view to browse the files and folders within the sandbox for a web project.
|
||||||
@@ -1198,14 +1199,18 @@ revert_selected_confirm=Are you sure you want to undo the changes to the selecte
|
|||||||
revert_all_title=Undo All Items
|
revert_all_title=Undo All Items
|
||||||
revert_all_desc=To undo the changes to all the files in the sandbox, click OK.
|
revert_all_desc=To undo the changes to all the files in the sandbox, click OK.
|
||||||
revert_all_confirm=Are you sure you want to undo the changes to all files in the sandbox?
|
revert_all_confirm=Are you sure you want to undo the changes to all files in the sandbox?
|
||||||
deploy_title=Deploy Snapshot
|
deploy_snapshot_title=Deploy Snapshot
|
||||||
deploy_desc=Select the servers to deploy to and click OK.
|
deploy_snapshot_desc=Select the servers to deploy to and click OK.
|
||||||
deploy_destination=Select the destination servers to deploy to
|
deploy_sandbox_title=Deploy Sandbox
|
||||||
|
deploy_sandbox_desc=Select a test server to deploy to and click OK.
|
||||||
|
deploy_destination=Select the destination server(s) to deploy to
|
||||||
deploy_status=Snapshot {0} is being deployed in the background, refresh this page until the ''View Deployment Report'' link appears.
|
deploy_status=Snapshot {0} is being deployed in the background, refresh this page until the ''View Deployment Report'' link appears.
|
||||||
deploying=Deploying...
|
deploying=Deploying...
|
||||||
deploy_successful=Deployment Successful
|
deploy_successful=Deployment Successful
|
||||||
deploy_failed=Deployment Failed
|
deploy_failed=Deployment Failed
|
||||||
deploy_server_not_selected=This server has not been selected as the snapshot has already been deployed successfully.
|
deploy_server_not_selected=This server has not been selected as the snapshot has already been deployed successfully.
|
||||||
|
deploy_test_server_not_available=No unallocated test servers are available.
|
||||||
|
deploy_test_server_allocated=The test server ''{0}'' is allocated to this sandbox. To preview the current deployment click the preview link below (if a URL has been provided) or to deploy the latest changes click the OK button.
|
||||||
deploy_started=Started
|
deploy_started=Started
|
||||||
deploy_finished=Finished
|
deploy_finished=Finished
|
||||||
deployed_by=By
|
deployed_by=By
|
||||||
@@ -1236,6 +1241,10 @@ deploy_automatically=Auto Deploy
|
|||||||
edit_deploy_server=Edit Deployment Server Details
|
edit_deploy_server=Edit Deployment Server Details
|
||||||
delete_deploy_server=Delete Deployment Server
|
delete_deploy_server=Delete Deployment Server
|
||||||
no_deploy_servers=No deployment servers have been configured.
|
no_deploy_servers=No deployment servers have been configured.
|
||||||
|
add_alf_deploy_server_info=Provide details of the Alfresco Server Receiver to add
|
||||||
|
add_file_deploy_server_info=Provide details of the File System Receiver to add
|
||||||
|
edit_alf_deploy_server_info=Edit details of the Alfresco Server Receiver
|
||||||
|
edit_file_deploy_server_info=Edit details of the File System Receiver
|
||||||
reason=Reason
|
reason=Reason
|
||||||
snapshot=Snapshot
|
snapshot=Snapshot
|
||||||
content_launch=Content Launch
|
content_launch=Content Launch
|
||||||
|
@@ -270,9 +270,13 @@
|
|||||||
icon="/images/icons/revert_all_large.gif" title-id="revert_all_title"
|
icon="/images/icons/revert_all_large.gif" title-id="revert_all_title"
|
||||||
description-id="revert_all_desc" />
|
description-id="revert_all_desc" />
|
||||||
|
|
||||||
<dialog name="deploySnapshot" page="/jsp/wcm/deploy.jsp" managed-bean="DeploySnapshotDialog"
|
<dialog name="deploySnapshot" page="/jsp/wcm/deploy.jsp" managed-bean="DeployWebsiteDialog"
|
||||||
icon="/images/icons/deploy_large.gif" title-id="deploy_title"
|
icon="/images/icons/deploy_large.gif" title-id="deploy_snapshot_title"
|
||||||
description-id="deploy_desc" />
|
description-id="deploy_snapshot_desc" />
|
||||||
|
|
||||||
|
<dialog name="deploySandbox" page="/jsp/wcm/deploy.jsp" managed-bean="DeployWebsiteDialog"
|
||||||
|
icon="/images/icons/deploy_large.gif" title-id="deploy_sandbox_title"
|
||||||
|
description-id="deploy_sandbox_desc" />
|
||||||
|
|
||||||
<dialog name="viewDeploymentReport" page="/jsp/wcm/deployment-report.jsp"
|
<dialog name="viewDeploymentReport" page="/jsp/wcm/deployment-report.jsp"
|
||||||
managed-bean="ViewDeploymentReportDialog"
|
managed-bean="ViewDeploymentReportDialog"
|
||||||
|
@@ -895,16 +895,17 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
// expression in a 'rendered' attribute, we therefore cache the result
|
// expression in a 'rendered' attribute, we therefore cache the result
|
||||||
// on a per request basis
|
// on a per request basis
|
||||||
|
|
||||||
List<ChildAssociationRef> deployAttempts = null;
|
List<NodeRef> deployAttempts = null;
|
||||||
|
|
||||||
FacesContext context = FacesContext.getCurrentInstance();
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
Map request = context.getExternalContext().getRequestMap();
|
Map request = context.getExternalContext().getRequestMap();
|
||||||
if (request.get(REQUEST_BEEN_DEPLOYED_KEY) == null)
|
if (request.get(REQUEST_BEEN_DEPLOYED_KEY) == null)
|
||||||
{
|
{
|
||||||
// see if there are any deployment attempts for the site
|
// see if there are any deployment attempts for the staging area
|
||||||
NodeRef webProjectRef = this.getWebsite().getNodeRef();
|
NodeRef webProjectRef = this.getWebsite().getNodeRef();
|
||||||
deployAttempts = getNodeService().getChildAssocs(webProjectRef,
|
String store = (String)nodeService.getProperty(webProjectRef,
|
||||||
WCMAppModel.ASSOC_DEPLOYMENTATTEMPT, RegexQNamePattern.MATCH_ALL);
|
WCMAppModel.PROP_AVMSTORE);
|
||||||
|
deployAttempts = DeploymentUtil.findDeploymentAttempts(store);
|
||||||
|
|
||||||
// add a placeholder object in the request so we don't evaluate this again for this request
|
// add a placeholder object in the request so we don't evaluate this again for this request
|
||||||
request.put(REQUEST_BEEN_DEPLOYED_KEY, Boolean.TRUE);
|
request.put(REQUEST_BEEN_DEPLOYED_KEY, Boolean.TRUE);
|
||||||
@@ -912,7 +913,7 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
deployAttempts = (List<ChildAssociationRef>)request.get(REQUEST_BEEN_DEPLOYED_RESULT);
|
deployAttempts = (List<NodeRef>)request.get(REQUEST_BEEN_DEPLOYED_RESULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (deployAttempts != null && deployAttempts.size() > 0);
|
return (deployAttempts != null && deployAttempts.size() > 0);
|
||||||
|
@@ -809,44 +809,6 @@ public final class AVMUtil
|
|||||||
|
|
||||||
return webProjectNode;
|
return webProjectNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves the NodeRef of the deploymentattempt node with the given id
|
|
||||||
*
|
|
||||||
* @param attemptId The deployattemptid of the node to be found
|
|
||||||
* @return The NodeRef of the deploymentattempt node or null if not found
|
|
||||||
*/
|
|
||||||
public static NodeRef findDeploymentAttempt(String attemptId)
|
|
||||||
{
|
|
||||||
FacesContext fc = FacesContext.getCurrentInstance();
|
|
||||||
SearchService searchService = Repository.getServiceRegistry(fc).getSearchService();
|
|
||||||
|
|
||||||
// construct the query
|
|
||||||
String query = "@wca\\:deployattemptid:\"" + attemptId + "\"";
|
|
||||||
|
|
||||||
NodeRef attempt = null;
|
|
||||||
ResultSet results = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// execute the query
|
|
||||||
results = searchService.query(Repository.getStoreRef(),
|
|
||||||
SearchService.LANGUAGE_LUCENE, query);
|
|
||||||
|
|
||||||
if (results.length() == 1)
|
|
||||||
{
|
|
||||||
attempt = results.getNodeRef(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (results != null)
|
|
||||||
{
|
|
||||||
results.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return attempt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates all directories for a path if they do not already exist.
|
* Creates all directories for a path if they do not already exist.
|
||||||
|
@@ -1175,7 +1175,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
|||||||
this.currentDeployServer.setProperties(this.editedDeployServerProps);
|
this.currentDeployServer.setProperties(this.editedDeployServerProps);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Updated deploy server config: " + this.currentDeployServer);
|
logger.debug("Saved transient deploy server config: " + this.currentDeployServer);
|
||||||
|
|
||||||
// reset state
|
// reset state
|
||||||
this.currentDeployServer = null;
|
this.currentDeployServer = null;
|
||||||
|
@@ -33,9 +33,10 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
import org.alfresco.repo.avm.actions.AVMDeploySnapshotAction;
|
import org.alfresco.repo.avm.actions.AVMDeployWebsiteAction;
|
||||||
import org.alfresco.repo.domain.PropertyValue;
|
import org.alfresco.repo.domain.PropertyValue;
|
||||||
import org.alfresco.sandbox.SandboxConstants;
|
import org.alfresco.sandbox.SandboxConstants;
|
||||||
import org.alfresco.service.cmr.action.Action;
|
import org.alfresco.service.cmr.action.Action;
|
||||||
@@ -51,25 +52,27 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deploys a web project snapshot to one or more remote servers.
|
* Deploys a website to one or more remote servers.
|
||||||
*
|
*
|
||||||
* @author gavinc
|
* @author gavinc
|
||||||
*/
|
*/
|
||||||
public class DeploySnapshotDialog extends BaseDialogBean
|
public class DeployWebsiteDialog extends BaseDialogBean
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 62702082716235924L;
|
private static final long serialVersionUID = 62702082716235924L;
|
||||||
|
|
||||||
protected int versionToDeploy;
|
protected int versionToDeploy;
|
||||||
protected String[] deployTo;
|
protected String[] deployTo;
|
||||||
protected String stagingStore;
|
protected String store;
|
||||||
|
protected String deployMode;
|
||||||
protected NodeRef websiteRef;
|
protected NodeRef websiteRef;
|
||||||
protected NodeRef webProjectRef;
|
protected NodeRef webProjectRef;
|
||||||
|
protected boolean updateTestServer;
|
||||||
|
|
||||||
protected AVMBrowseBean avmBrowseBean;
|
protected AVMBrowseBean avmBrowseBean;
|
||||||
transient private AVMService avmService;
|
transient private AVMService avmService;
|
||||||
transient private ActionService actionService;
|
transient private ActionService actionService;
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(DeploySnapshotDialog.class);
|
private static final Log logger = LogFactory.getLog(DeployWebsiteDialog.class);
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Dialog implementation
|
// Dialog implementation
|
||||||
@@ -81,16 +84,35 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
|
|
||||||
// setup context for dialog
|
// setup context for dialog
|
||||||
this.deployTo = null;
|
this.deployTo = null;
|
||||||
this.versionToDeploy = Integer.parseInt(parameters.get("version"));
|
String ver = parameters.get("version");
|
||||||
this.avmBrowseBean.getDeploymentMonitorIds().clear();
|
if (ver != null && ver.length() > 0)
|
||||||
this.webProjectRef = this.avmBrowseBean.getWebsite().getNodeRef();
|
{
|
||||||
this.stagingStore = this.avmBrowseBean.getStagingStore();
|
this.versionToDeploy = Integer.parseInt(ver);
|
||||||
String storeRoot = AVMUtil.buildSandboxRootPath(this.stagingStore);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.versionToDeploy = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.store = parameters.get("store");
|
||||||
|
String storeRoot = AVMUtil.buildSandboxRootPath(this.store);
|
||||||
this.websiteRef = AVMNodeConverter.ToNodeRef(this.versionToDeploy, storeRoot);
|
this.websiteRef = AVMNodeConverter.ToNodeRef(this.versionToDeploy, storeRoot);
|
||||||
|
|
||||||
|
this.deployMode = (this.versionToDeploy == -1) ?
|
||||||
|
WCMAppModel.CONSTRAINT_TESTSERVER : WCMAppModel.CONSTRAINT_LIVESERVER;
|
||||||
|
|
||||||
|
this.updateTestServer = false;
|
||||||
|
String updateTestServerParam = parameters.get("updateTestServer");
|
||||||
|
if (updateTestServerParam != null)
|
||||||
|
{
|
||||||
|
this.updateTestServer = Boolean.parseBoolean(updateTestServerParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.avmBrowseBean.getDeploymentMonitorIds().clear();
|
||||||
|
this.webProjectRef = this.avmBrowseBean.getWebsite().getNodeRef();
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Initialising dialog to deploy version " + this.versionToDeploy +
|
logger.debug("Initialising dialog to deploy: " + this.websiteRef.toString());
|
||||||
" of " + this.websiteRef.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -102,18 +124,17 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
|
|
||||||
if (this.deployTo != null && this.deployTo.length > 0)
|
if (this.deployTo != null && this.deployTo.length > 0)
|
||||||
{
|
{
|
||||||
NodeRef webProjectRef = this.avmBrowseBean.getWebsite().getNodeRef();
|
|
||||||
List<String> selectedDeployToNames = new ArrayList<String>();
|
List<String> selectedDeployToNames = new ArrayList<String>();
|
||||||
|
|
||||||
// create a deploymentattempt node to represent this deployment
|
// create a deploymentattempt node to represent this deployment
|
||||||
String attemptId = GUID.generate();
|
String attemptId = GUID.generate();
|
||||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(8, 1.0f);
|
Map<QName, Serializable> props = new HashMap<QName, Serializable>(8, 1.0f);
|
||||||
props.put(WCMAppModel.PROP_DEPLOYATTEMPTID, attemptId);
|
props.put(WCMAppModel.PROP_DEPLOYATTEMPTID, attemptId);
|
||||||
props.put(WCMAppModel.PROP_DEPLOYATTEMPTTYPE, WCMAppModel.CONSTRAINT_LIVESERVER);
|
props.put(WCMAppModel.PROP_DEPLOYATTEMPTTYPE, this.deployMode);
|
||||||
props.put(WCMAppModel.PROP_DEPLOYATTEMPTSTORE, this.stagingStore);
|
props.put(WCMAppModel.PROP_DEPLOYATTEMPTSTORE, this.store);
|
||||||
props.put(WCMAppModel.PROP_DEPLOYATTEMPTVERSION, this.versionToDeploy);
|
props.put(WCMAppModel.PROP_DEPLOYATTEMPTVERSION, this.versionToDeploy);
|
||||||
props.put(WCMAppModel.PROP_DEPLOYATTEMPTTIME, new Date());
|
props.put(WCMAppModel.PROP_DEPLOYATTEMPTTIME, new Date());
|
||||||
NodeRef attempt = getNodeService().createNode(webProjectRef,
|
NodeRef attempt = getNodeService().createNode(this.webProjectRef,
|
||||||
WCMAppModel.ASSOC_DEPLOYMENTATTEMPT, WCMAppModel.ASSOC_DEPLOYMENTATTEMPT,
|
WCMAppModel.ASSOC_DEPLOYMENTATTEMPT, WCMAppModel.ASSOC_DEPLOYMENTATTEMPT,
|
||||||
WCMAppModel.TYPE_DEPLOYMENTATTEMPT, props).getChildRef();
|
WCMAppModel.TYPE_DEPLOYMENTATTEMPT, props).getChildRef();
|
||||||
|
|
||||||
@@ -128,13 +149,33 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
// get all properties of the target server
|
// get all properties of the target server
|
||||||
Map<QName, Serializable> serverProps = getNodeService().getProperties(serverRef);
|
Map<QName, Serializable> serverProps = getNodeService().getProperties(serverRef);
|
||||||
|
|
||||||
String serverUri = AVMDeploySnapshotAction.calculateServerUri(serverProps);
|
String serverUri = AVMDeployWebsiteAction.calculateServerUri(serverProps);
|
||||||
String serverName = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERNAME);
|
String serverName = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERNAME);
|
||||||
if (serverName == null || serverName.length() == 0)
|
if (serverName == null || serverName.length() == 0)
|
||||||
{
|
{
|
||||||
serverName = serverUri;
|
serverName = serverUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if this is a test server deployment we need to allocate the
|
||||||
|
// test server to the current sandbox so it can re-use it and
|
||||||
|
// more importantly, no one else can. Before doing that however,
|
||||||
|
// we need to make sure no one else has taken the server since
|
||||||
|
// we selected it.
|
||||||
|
if (WCMAppModel.CONSTRAINT_TESTSERVER.equals(this.deployMode) &&
|
||||||
|
this.updateTestServer == false)
|
||||||
|
{
|
||||||
|
String allocatedTo = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERALLOCATEDTO);
|
||||||
|
if (allocatedTo != null)
|
||||||
|
{
|
||||||
|
throw new AlfrescoRuntimeException("testserver.taken", new Object[] {serverName});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getNodeService().setProperty(serverRef, WCMAppModel.PROP_DEPLOYSERVERALLOCATEDTO,
|
||||||
|
this.store);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Issuing deployment request for: " + serverName);
|
logger.debug("Issuing deployment request for: " + serverName);
|
||||||
|
|
||||||
@@ -150,11 +191,11 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
|
|
||||||
// create and execute the action asynchronously
|
// create and execute the action asynchronously
|
||||||
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
|
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
|
||||||
args.put(AVMDeploySnapshotAction.PARAM_WEBSITE, webProjectRef);
|
args.put(AVMDeployWebsiteAction.PARAM_WEBSITE, webProjectRef);
|
||||||
args.put(AVMDeploySnapshotAction.PARAM_SERVER, serverRef);
|
args.put(AVMDeployWebsiteAction.PARAM_SERVER, serverRef);
|
||||||
args.put(AVMDeploySnapshotAction.PARAM_ATTEMPT, attempt);
|
args.put(AVMDeployWebsiteAction.PARAM_ATTEMPT, attempt);
|
||||||
args.put(AVMDeploySnapshotAction.PARAM_CALLBACK, monitor);
|
args.put(AVMDeployWebsiteAction.PARAM_CALLBACK, monitor);
|
||||||
Action action = getActionService().createAction(AVMDeploySnapshotAction.NAME, args);
|
Action action = getActionService().createAction(AVMDeployWebsiteAction.NAME, args);
|
||||||
getActionService().executeAction(action, this.websiteRef, false, true);
|
getActionService().executeAction(action, this.websiteRef, false, true);
|
||||||
}
|
}
|
||||||
else if (logger.isWarnEnabled())
|
else if (logger.isWarnEnabled())
|
||||||
@@ -169,8 +210,8 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
(Serializable)selectedDeployToNames);
|
(Serializable)selectedDeployToNames);
|
||||||
|
|
||||||
// set the deploymentattempid property on the store this deployment was for
|
// set the deploymentattempid property on the store this deployment was for
|
||||||
getAvmService().deleteStoreProperty(this.stagingStore, SandboxConstants.PROP_LAST_DEPLOYMENT_ID);
|
getAvmService().deleteStoreProperty(this.store, SandboxConstants.PROP_LAST_DEPLOYMENT_ID);
|
||||||
getAvmService().setStoreProperty(this.stagingStore, SandboxConstants.PROP_LAST_DEPLOYMENT_ID,
|
getAvmService().setStoreProperty(this.store, SandboxConstants.PROP_LAST_DEPLOYMENT_ID,
|
||||||
new PropertyValue(DataTypeDefinition.TEXT, attemptId));
|
new PropertyValue(DataTypeDefinition.TEXT, attemptId));
|
||||||
|
|
||||||
// close this dialog and immediately open the monitorDeployment dialog
|
// close this dialog and immediately open the monitorDeployment dialog
|
||||||
@@ -178,6 +219,9 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (logger.isWarnEnabled())
|
||||||
|
logger.warn("Deployment of '" + this.websiteRef.toString() + "' skipped as no servers were selected");
|
||||||
|
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -260,6 +304,16 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
return this.deployTo;
|
return this.deployTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the type of server to deploy to, either 'live' or 'test'.
|
||||||
|
*
|
||||||
|
* @return The type of server to deploy to
|
||||||
|
*/
|
||||||
|
public String getDeployMode()
|
||||||
|
{
|
||||||
|
return this.deployMode;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The NodeRef of the web project the deployment reports are being shown for
|
* @return The NodeRef of the web project the deployment reports are being shown for
|
||||||
*/
|
*/
|
||||||
@@ -268,6 +322,14 @@ public class DeploySnapshotDialog extends BaseDialogBean
|
|||||||
return this.webProjectRef;
|
return this.webProjectRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The store being deployed
|
||||||
|
*/
|
||||||
|
public String getStore()
|
||||||
|
{
|
||||||
|
return this.store;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The version of the snapshot to deploy
|
* @return The version of the snapshot to deploy
|
||||||
*/
|
*/
|
275
source/java/org/alfresco/web/bean/wcm/DeploymentUtil.java
Normal file
@@ -0,0 +1,275 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
* As a special exception to the terms and conditions of version 2.0 of
|
||||||
|
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||||
|
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||||
|
* FLOSS exception. You should have recieved a copy of the text describing
|
||||||
|
* the FLOSS exception, and it is also available here:
|
||||||
|
* http://www.alfresco.com/legal/licensing"
|
||||||
|
*/
|
||||||
|
package org.alfresco.web.bean.wcm;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.faces.context.FacesContext;
|
||||||
|
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.model.WCMAppModel;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
|
import org.alfresco.util.ISO9075;
|
||||||
|
import org.alfresco.web.app.Application;
|
||||||
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper methods for deployment
|
||||||
|
*
|
||||||
|
* @author Gavin Cornwell
|
||||||
|
*/
|
||||||
|
public final class DeploymentUtil
|
||||||
|
{
|
||||||
|
public static List<NodeRef> findDeploymentAttempts(String store)
|
||||||
|
{
|
||||||
|
FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
|
SearchService searchService = Repository.getServiceRegistry(fc).getSearchService();
|
||||||
|
|
||||||
|
// query for all deploymentattempt nodes with the deploymentattemptstore
|
||||||
|
// set to the given store id
|
||||||
|
StringBuilder query = new StringBuilder("@");
|
||||||
|
query.append(NamespaceService.WCMAPP_MODEL_PREFIX);
|
||||||
|
query.append("\\:");
|
||||||
|
query.append(WCMAppModel.PROP_DEPLOYATTEMPTSTORE.getLocalName());
|
||||||
|
query.append(":\"");
|
||||||
|
query.append(store);
|
||||||
|
query.append("\"");
|
||||||
|
|
||||||
|
ResultSet results = null;
|
||||||
|
List<NodeRef> attempts = new ArrayList<NodeRef>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// execute the query
|
||||||
|
results = searchService.query(Repository.getStoreRef(),
|
||||||
|
SearchService.LANGUAGE_LUCENE, query.toString());
|
||||||
|
|
||||||
|
for (NodeRef attempt : results.getNodeRefs())
|
||||||
|
{
|
||||||
|
attempts.add(attempt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (results != null)
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return attempts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the NodeRef of the deploymentattempt node with the given id
|
||||||
|
*
|
||||||
|
* @param attemptId The deployattemptid of the node to be found
|
||||||
|
* @return The NodeRef of the deploymentattempt node or null if not found
|
||||||
|
*/
|
||||||
|
public static NodeRef findDeploymentAttempt(String attemptId)
|
||||||
|
{
|
||||||
|
FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
|
SearchService searchService = Repository.getServiceRegistry(fc).getSearchService();
|
||||||
|
|
||||||
|
// construct the query
|
||||||
|
StringBuilder query = new StringBuilder("@");
|
||||||
|
query.append(NamespaceService.WCMAPP_MODEL_PREFIX);
|
||||||
|
query.append("\\:");
|
||||||
|
query.append(WCMAppModel.PROP_DEPLOYATTEMPTID.getLocalName());
|
||||||
|
query.append(":\"");
|
||||||
|
query.append(attemptId);
|
||||||
|
query.append("\"");
|
||||||
|
|
||||||
|
ResultSet results = null;
|
||||||
|
NodeRef attempt = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// execute the query
|
||||||
|
results = searchService.query(Repository.getStoreRef(),
|
||||||
|
SearchService.LANGUAGE_LUCENE, query.toString());
|
||||||
|
|
||||||
|
if (results.length() == 1)
|
||||||
|
{
|
||||||
|
attempt = results.getNodeRef(0);
|
||||||
|
}
|
||||||
|
else if (results.length() > 1)
|
||||||
|
{
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"More than one deployment attempt node was found, there should only be one!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (results != null)
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return attempt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the test server allocated to the given store.
|
||||||
|
*
|
||||||
|
* @param store The store to get the test server for
|
||||||
|
* @return The allocated server or null if there isn't one
|
||||||
|
*/
|
||||||
|
public static NodeRef findAllocatedTestServer(String store)
|
||||||
|
{
|
||||||
|
FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
|
SearchService searchService = Repository.getServiceRegistry(fc).getSearchService();
|
||||||
|
|
||||||
|
// construct the query
|
||||||
|
StringBuilder query = new StringBuilder("@");
|
||||||
|
query.append(NamespaceService.WCMAPP_MODEL_PREFIX);
|
||||||
|
query.append("\\:");
|
||||||
|
query.append(WCMAppModel.PROP_DEPLOYSERVERALLOCATEDTO.getLocalName());
|
||||||
|
query.append(":\"");
|
||||||
|
query.append(store);
|
||||||
|
query.append("\"");
|
||||||
|
|
||||||
|
ResultSet results = null;
|
||||||
|
NodeRef testServer = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// execute the query
|
||||||
|
results = searchService.query(Repository.getStoreRef(),
|
||||||
|
SearchService.LANGUAGE_LUCENE, query.toString());
|
||||||
|
|
||||||
|
if (results.length() == 1)
|
||||||
|
{
|
||||||
|
testServer = results.getNodeRef(0);
|
||||||
|
}
|
||||||
|
else if (results.length() > 1)
|
||||||
|
{
|
||||||
|
throw new IllegalStateException("More than one allocated test server for store '" +
|
||||||
|
store + "' was found, should only be one!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (results != null)
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return testServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of NodeRefs representing the 'live' servers configured
|
||||||
|
* for the given web project.
|
||||||
|
*
|
||||||
|
* @param webProject Web project to get live servers for
|
||||||
|
* @return List of live servers
|
||||||
|
*/
|
||||||
|
public static List<NodeRef> findLiveServers(NodeRef webProject)
|
||||||
|
{
|
||||||
|
return findServers(webProject, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of NodeRefs representing the 'test' servers configured
|
||||||
|
* for the given web project.
|
||||||
|
*
|
||||||
|
* @param webProject Web project to get test servers for
|
||||||
|
* @param allocated true only returns those servers already allocated
|
||||||
|
* @return List of test servers
|
||||||
|
*/
|
||||||
|
public static List<NodeRef> findTestServers(NodeRef webProject, boolean allocated)
|
||||||
|
{
|
||||||
|
return findServers(webProject, false, allocated);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static List<NodeRef> findServers(NodeRef webProject, boolean live, boolean allocated)
|
||||||
|
{
|
||||||
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
|
||||||
|
SearchService searchService = Repository.getServiceRegistry(context).getSearchService();
|
||||||
|
|
||||||
|
// build the query
|
||||||
|
String webProjectName = (String)nodeService.getProperty(webProject, ContentModel.PROP_NAME);
|
||||||
|
String safeProjectName = ISO9075.encode(webProjectName);
|
||||||
|
StringBuilder query = new StringBuilder("PATH:\"/");
|
||||||
|
query.append(Application.getRootPath(context));
|
||||||
|
query.append("/");
|
||||||
|
query.append(Application.getWebsitesFolderName(context));
|
||||||
|
query.append("/cm:");
|
||||||
|
query.append(safeProjectName);
|
||||||
|
query.append("/*\" AND @");
|
||||||
|
query.append(NamespaceService.WCMAPP_MODEL_PREFIX);
|
||||||
|
query.append("\\:");
|
||||||
|
query.append(WCMAppModel.PROP_DEPLOYSERVERTYPE.getLocalName());
|
||||||
|
query.append(":\"");
|
||||||
|
if (live)
|
||||||
|
{
|
||||||
|
query.append(WCMAppModel.CONSTRAINT_LIVESERVER);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
query.append(WCMAppModel.CONSTRAINT_TESTSERVER);
|
||||||
|
}
|
||||||
|
query.append("\"");
|
||||||
|
|
||||||
|
// if required filter the test servers
|
||||||
|
if (live == false && allocated == false)
|
||||||
|
{
|
||||||
|
query.append(" AND ISNULL:\"");
|
||||||
|
query.append(WCMAppModel.PROP_DEPLOYSERVERALLOCATEDTO.toString());
|
||||||
|
query.append("\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
// execute the query
|
||||||
|
ResultSet results = null;
|
||||||
|
List<NodeRef> servers = new ArrayList<NodeRef>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
results = searchService.query(Repository.getStoreRef(),
|
||||||
|
SearchService.LANGUAGE_LUCENE, query.toString());
|
||||||
|
|
||||||
|
for (NodeRef server : results.getNodeRefs())
|
||||||
|
{
|
||||||
|
servers.add(server);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (results != null)
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return servers;
|
||||||
|
}
|
||||||
|
}
|
@@ -28,7 +28,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@@ -43,10 +42,7 @@ public class ViewDeploymentReportDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
private static final long serialVersionUID = -8054466371051782132L;
|
private static final long serialVersionUID = -8054466371051782132L;
|
||||||
|
|
||||||
protected NodeRef webProjectRef;
|
protected String store;
|
||||||
protected Integer deployedVersion;
|
|
||||||
|
|
||||||
protected AVMBrowseBean avmBrowseBean;
|
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(ViewDeploymentReportDialog.class);
|
private static final Log logger = LogFactory.getLog(ViewDeploymentReportDialog.class);
|
||||||
|
|
||||||
@@ -58,11 +54,16 @@ public class ViewDeploymentReportDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
super.init(parameters);
|
super.init(parameters);
|
||||||
|
|
||||||
this.webProjectRef = this.avmBrowseBean.getWebsite().getNodeRef();
|
this.store = parameters.get("store");
|
||||||
|
|
||||||
|
if (this.store == null || this.store.length() == 0)
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException("store parameter is mandatory");
|
||||||
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Initialising dialog to view deployment report for " +
|
logger.debug("Initialising dialog to view deployment report for: " +
|
||||||
this.avmBrowseBean.getStagingStore());
|
this.store);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -81,18 +82,10 @@ public class ViewDeploymentReportDialog extends BaseDialogBean
|
|||||||
// Bean getters and setters
|
// Bean getters and setters
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The NodeRef of the web project the deployment reports are being shown for
|
* @return The store to show deployment reports for
|
||||||
*/
|
*/
|
||||||
public NodeRef getWebProjectRef()
|
public String getStore()
|
||||||
{
|
{
|
||||||
return this.webProjectRef;
|
return this.store;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param avmBrowseBean The AVM BrowseBean instance to use
|
|
||||||
*/
|
|
||||||
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
|
|
||||||
{
|
|
||||||
this.avmBrowseBean = avmBrowseBean;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -26,6 +26,7 @@ package org.alfresco.web.ui.wcm.component;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -36,16 +37,15 @@ import javax.faces.el.ValueBinding;
|
|||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.actions.AVMDeploySnapshotAction;
|
import org.alfresco.repo.avm.actions.AVMDeployWebsiteAction;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||||
import org.alfresco.web.bean.wcm.DeploymentMonitor;
|
import org.alfresco.web.bean.wcm.DeploymentMonitor;
|
||||||
|
import org.alfresco.web.bean.wcm.DeploymentUtil;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -61,6 +61,8 @@ public class UIDeployWebsite extends UIInput
|
|||||||
protected Integer snapshotVersion = -1;
|
protected Integer snapshotVersion = -1;
|
||||||
protected Boolean monitorDeployment;
|
protected Boolean monitorDeployment;
|
||||||
protected List<String> monitorIds;
|
protected List<String> monitorIds;
|
||||||
|
protected String deployMode;
|
||||||
|
protected String store;
|
||||||
|
|
||||||
private static Log logger = LogFactory.getLog(UIDeployWebsite.class);
|
private static Log logger = LogFactory.getLog(UIDeployWebsite.class);
|
||||||
|
|
||||||
@@ -104,18 +106,22 @@ public class UIDeployWebsite extends UIInput
|
|||||||
this.monitorDeployment = (Boolean)values[2];
|
this.monitorDeployment = (Boolean)values[2];
|
||||||
this.monitorIds = (List<String>)values[3];
|
this.monitorIds = (List<String>)values[3];
|
||||||
this.snapshotVersion = (Integer)values[4];
|
this.snapshotVersion = (Integer)values[4];
|
||||||
|
this.deployMode = (String)values[5];
|
||||||
|
this.store = (String)values[6];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object saveState(FacesContext context)
|
public Object saveState(FacesContext context)
|
||||||
{
|
{
|
||||||
Object values[] = new Object[5];
|
Object values[] = new Object[7];
|
||||||
// standard component attributes are saved by the super class
|
// standard component attributes are saved by the super class
|
||||||
values[0] = super.saveState(context);
|
values[0] = super.saveState(context);
|
||||||
values[1] = this.webProjectRef;
|
values[1] = this.webProjectRef;
|
||||||
values[2] = this.monitorDeployment;
|
values[2] = this.monitorDeployment;
|
||||||
values[3] = this.monitorIds;
|
values[3] = this.monitorIds;
|
||||||
values[4] = this.snapshotVersion;
|
values[4] = this.snapshotVersion;
|
||||||
|
values[5] = this.deployMode;
|
||||||
|
values[6] = this.store;
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,54 +181,60 @@ public class UIDeployWebsite extends UIInput
|
|||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Found deployment monitor: " + monitor);
|
logger.debug("Found deployment monitor: " + monitor);
|
||||||
|
|
||||||
renderServer(context, out, nodeService, monitor.getTargetServer(), false, true, id);
|
renderServer(context, out, nodeService, monitor.getTargetServer(), false, true, id, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// get a list of the servers that have been successfully deployed to
|
if (WCMAppModel.CONSTRAINT_TESTSERVER.equals(getDeployMode()))
|
||||||
/*
|
|
||||||
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
|
|
||||||
int deployingVersion = this.getSnapshotVersion();
|
|
||||||
List<String> serversAlreadyDeployed = new ArrayList<String>();
|
|
||||||
List<ChildAssociationRef> deployReportRefs = nodeService.getChildAssocs(
|
|
||||||
webProjectRef, WCMAppModel.ASSOC_DEPLOYMENTREPORT, RegexQNamePattern.MATCH_ALL);
|
|
||||||
for (ChildAssociationRef ref : deployReportRefs)
|
|
||||||
{
|
{
|
||||||
NodeRef report = ref.getChildRef();
|
// determine the state, the sandbox may already have a test server
|
||||||
if (report != null)
|
// allocated, in which case we need to allow the user to preview or
|
||||||
|
// re-deploy. If this is the first deployment or the test server has
|
||||||
|
// been removed then show a list of available test servers to choose
|
||||||
|
// from.
|
||||||
|
|
||||||
|
NodeRef allocatedServer = DeploymentUtil.findAllocatedTestServer(getStore());
|
||||||
|
if (allocatedServer != null)
|
||||||
{
|
{
|
||||||
int deployedVersion = -1;
|
renderAllocatedTestServer(context, out, nodeService, allocatedServer);
|
||||||
Boolean success = (Boolean)nodeService.getProperty(report,
|
}
|
||||||
WCMAppModel.PROP_DEPLOYSUCCESSFUL);
|
else
|
||||||
|
{
|
||||||
Serializable deployVersionObj = nodeService.getProperty(report,
|
List<NodeRef> servers = DeploymentUtil.findTestServers(webProject, false);
|
||||||
WCMAppModel.PROP_DEPLOYVERSION);
|
if (servers.size() > 0)
|
||||||
if (deployVersionObj != null && deployVersionObj instanceof Integer)
|
|
||||||
{
|
{
|
||||||
deployedVersion = (Integer)deployVersionObj;
|
boolean first = true;
|
||||||
|
for (NodeRef server : servers)
|
||||||
|
{
|
||||||
|
renderServer(context, out, nodeService, server, first, false, null, false);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (success != null && success.booleanValue() && (deployingVersion == deployedVersion))
|
|
||||||
{
|
{
|
||||||
serversAlreadyDeployed.add((String)nodeService.getProperty(report,
|
// show the none available message
|
||||||
WCMAppModel.PROP_DEPLOYSERVER));
|
out.write("<div class='deployServersInfo'><img src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/images/icons/info_icon.gif' style='vertical-align: -5px;' /> ");
|
||||||
|
out.write(Application.getMessage(context, "deploy_test_server_not_available"));
|
||||||
|
out.write("</div>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
else
|
||||||
|
|
||||||
// get the servers available to deploy to
|
|
||||||
List<ChildAssociationRef> deployServerRefs = nodeService.getChildAssocs(
|
|
||||||
webProjectRef, WCMAppModel.ASSOC_DEPLOYMENTSERVER, RegexQNamePattern.MATCH_ALL);
|
|
||||||
for (ChildAssociationRef ref : deployServerRefs)
|
|
||||||
{
|
{
|
||||||
NodeRef server = ref.getChildRef();
|
// TODO: get a list of the servers that have been successfully deployed to
|
||||||
|
|
||||||
// TODO: determine if the server has already been successfully deployed to
|
List<NodeRef> servers = DeploymentUtil.findLiveServers(webProject);
|
||||||
|
for (NodeRef server : servers)
|
||||||
renderServer(context, out, nodeService, server, true, false, null);
|
{
|
||||||
|
// TODO: determine if the server has already been successfully deployed to
|
||||||
|
boolean selected = true;
|
||||||
|
|
||||||
|
renderServer(context, out, nodeService, server, selected, false, null, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,15 +344,61 @@ public class UIDeployWebsite extends UIInput
|
|||||||
this.snapshotVersion = snapshotVersion;
|
this.snapshotVersion = snapshotVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The type of server being deployed to, 'live' or 'test'
|
||||||
|
*/
|
||||||
|
public String getDeployMode()
|
||||||
|
{
|
||||||
|
ValueBinding vb = getValueBinding("deployMode");
|
||||||
|
if (vb != null)
|
||||||
|
{
|
||||||
|
this.deployMode = (String)vb.getValue(getFacesContext());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.deployMode == null || this.deployMode.length() == 0)
|
||||||
|
{
|
||||||
|
this.deployMode = WCMAppModel.CONSTRAINT_TESTSERVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.deployMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param deployMode The type of server to deploy to, 'live' or 'test'
|
||||||
|
*/
|
||||||
|
public void setDeployMode(String deployMode)
|
||||||
|
{
|
||||||
|
this.deployMode = deployMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The store being deployed to
|
||||||
|
*/
|
||||||
|
public String getStore()
|
||||||
|
{
|
||||||
|
ValueBinding vb = getValueBinding("store");
|
||||||
|
if (vb != null)
|
||||||
|
{
|
||||||
|
this.store = (String)vb.getValue(getFacesContext());
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.store;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param store The store to deploy to
|
||||||
|
*/
|
||||||
|
public void setStore(String store)
|
||||||
|
{
|
||||||
|
this.store = store;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
private void renderScript(FacesContext context, ResponseWriter out,
|
private void renderScript(FacesContext context, ResponseWriter out,
|
||||||
List<String> monitorIds) throws IOException
|
List<String> monitorIds) throws IOException
|
||||||
{
|
{
|
||||||
// // render supporting Yahoo scripts
|
|
||||||
// Utils.writeYahooScripts(context, out, null);
|
|
||||||
|
|
||||||
// create comma separated list of deplyment ids
|
// create comma separated list of deplyment ids
|
||||||
StringBuilder ids = new StringBuilder();
|
StringBuilder ids = new StringBuilder();
|
||||||
for (int x = 0; x < monitorIds.size(); x++)
|
for (int x = 0; x < monitorIds.size(); x++)
|
||||||
@@ -430,8 +488,8 @@ public class UIDeployWebsite extends UIInput
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void renderServer(FacesContext context, ResponseWriter out, NodeService nodeService,
|
private void renderServer(FacesContext context, ResponseWriter out, NodeService nodeService,
|
||||||
NodeRef server, boolean selected, boolean monitoring, String monitorId)
|
NodeRef server, boolean selected, boolean monitoring, String monitorId,
|
||||||
throws IOException
|
boolean liveServer) throws IOException
|
||||||
{
|
{
|
||||||
String contextPath = context.getExternalContext().getRequestContextPath();
|
String contextPath = context.getExternalContext().getRequestContextPath();
|
||||||
|
|
||||||
@@ -440,7 +498,7 @@ public class UIDeployWebsite extends UIInput
|
|||||||
String serverName = (String)props.get(WCMAppModel.PROP_DEPLOYSERVERNAME);
|
String serverName = (String)props.get(WCMAppModel.PROP_DEPLOYSERVERNAME);
|
||||||
if (serverName == null || serverName.length() == 0)
|
if (serverName == null || serverName.length() == 0)
|
||||||
{
|
{
|
||||||
serverName = AVMDeploySnapshotAction.calculateServerUri(props);
|
serverName = AVMDeployWebsiteAction.calculateServerUri(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
out.write("<table cellspacing='0' cellpadding='0' border='0' width='100%'>");
|
out.write("<table cellspacing='0' cellpadding='0' border='0' width='100%'>");
|
||||||
@@ -461,15 +519,24 @@ public class UIDeployWebsite extends UIInput
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
out.write("<div class='deployPanelCheckbox'>");
|
out.write("<div class='deployPanelControl'>");
|
||||||
out.write("<input type='checkbox' name='");
|
out.write("<input type='");
|
||||||
|
if (liveServer)
|
||||||
|
{
|
||||||
|
out.write("checkbox");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.write("radio");
|
||||||
|
}
|
||||||
|
out.write("' name='");
|
||||||
out.write(this.getClientId(context));
|
out.write(this.getClientId(context));
|
||||||
out.write("' value='");
|
out.write("' value='");
|
||||||
out.write(server.toString());
|
out.write(server.toString());
|
||||||
out.write("'");
|
out.write("'");
|
||||||
if (selected)
|
if (selected)
|
||||||
{
|
{
|
||||||
out.write("checked='checked'");
|
out.write(" checked='checked'");
|
||||||
}
|
}
|
||||||
out.write(" />");
|
out.write(" />");
|
||||||
}
|
}
|
||||||
@@ -499,7 +566,7 @@ public class UIDeployWebsite extends UIInput
|
|||||||
out.write(Application.getMessage(context, "deploying"));
|
out.write(Application.getMessage(context, "deploying"));
|
||||||
out.write("</div>");
|
out.write("</div>");
|
||||||
}
|
}
|
||||||
else if (selected == false)
|
else if (selected == false && liveServer == true)
|
||||||
{
|
{
|
||||||
out.write("<div class='deployPanelServerStatus'><img src='");
|
out.write("<div class='deployPanelServerStatus'><img src='");
|
||||||
out.write(contextPath);
|
out.write(contextPath);
|
||||||
@@ -514,4 +581,45 @@ public class UIDeployWebsite extends UIInput
|
|||||||
// add some padding under each panel
|
// add some padding under each panel
|
||||||
out.write("\n<div style='padding-top:8px;'></div>\n");
|
out.write("\n<div style='padding-top:8px;'></div>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderAllocatedTestServer(FacesContext context, ResponseWriter out, NodeService nodeService,
|
||||||
|
NodeRef server) throws IOException
|
||||||
|
{
|
||||||
|
Map<QName, Serializable> serverProps = nodeService.getProperties(server);
|
||||||
|
String serverName = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERNAME);
|
||||||
|
if (serverName == null || serverName.length() == 0)
|
||||||
|
{
|
||||||
|
serverName = AVMDeployWebsiteAction.calculateServerUri(serverProps);
|
||||||
|
}
|
||||||
|
|
||||||
|
String pattern = Application.getMessage(context, "deploy_test_server_allocated");
|
||||||
|
String msg = MessageFormat.format(pattern, serverName);
|
||||||
|
|
||||||
|
out.write("<div class='deployServersInfo'><img src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/images/icons/info_icon.gif' /> ");
|
||||||
|
out.write(msg);
|
||||||
|
|
||||||
|
String url = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERURL);
|
||||||
|
if (url != null && url.length() > 0)
|
||||||
|
{
|
||||||
|
out.write("<div style='margin: 12px 0px 0px 24px;'><img src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/images/icons/preview_website.gif");
|
||||||
|
out.write("' /><a target='new' href='");
|
||||||
|
out.write(url);
|
||||||
|
out.write("'>");
|
||||||
|
out.write("Preview Deployment");
|
||||||
|
out.write("</a></div>");
|
||||||
|
}
|
||||||
|
|
||||||
|
out.write("</div>");
|
||||||
|
|
||||||
|
// render a hidden field with the value of the allocated test server
|
||||||
|
out.write("<input type='hidden' name='");
|
||||||
|
out.write(this.getClientId(context));
|
||||||
|
out.write("' value='");
|
||||||
|
out.write(server.toString());
|
||||||
|
out.write("' />");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,7 @@ import javax.transaction.UserTransaction;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.actions.AVMDeploySnapshotAction;
|
import org.alfresco.repo.avm.actions.AVMDeployWebsiteAction;
|
||||||
import org.alfresco.repo.domain.PropertyValue;
|
import org.alfresco.repo.domain.PropertyValue;
|
||||||
import org.alfresco.sandbox.SandboxConstants;
|
import org.alfresco.sandbox.SandboxConstants;
|
||||||
import org.alfresco.service.cmr.avm.AVMService;
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
@@ -50,7 +50,7 @@ import org.alfresco.service.namespace.QName;
|
|||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
import org.alfresco.web.bean.wcm.DeploymentUtil;
|
||||||
import org.alfresco.web.ui.common.PanelGenerator;
|
import org.alfresco.web.ui.common.PanelGenerator;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.alfresco.web.ui.common.component.SelfRenderingComponent;
|
import org.alfresco.web.ui.common.component.SelfRenderingComponent;
|
||||||
@@ -65,7 +65,7 @@ import org.springframework.util.StringUtils;
|
|||||||
*/
|
*/
|
||||||
public class UIDeploymentReports extends SelfRenderingComponent
|
public class UIDeploymentReports extends SelfRenderingComponent
|
||||||
{
|
{
|
||||||
protected NodeRef webProjectRef;
|
protected String store;
|
||||||
|
|
||||||
private static Log logger = LogFactory.getLog(UIDeploymentReports.class);
|
private static Log logger = LogFactory.getLog(UIDeploymentReports.class);
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
|||||||
Object values[] = (Object[])state;
|
Object values[] = (Object[])state;
|
||||||
// standard component attributes are restored by the super class
|
// standard component attributes are restored by the super class
|
||||||
super.restoreState(context, values[0]);
|
super.restoreState(context, values[0]);
|
||||||
this.webProjectRef = (NodeRef)values[1];
|
this.store = (String)values[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object saveState(FacesContext context)
|
public Object saveState(FacesContext context)
|
||||||
@@ -93,7 +93,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
|||||||
Object values[] = new Object[2];
|
Object values[] = new Object[2];
|
||||||
// standard component attributes are saved by the super class
|
// standard component attributes are saved by the super class
|
||||||
values[0] = super.saveState(context);
|
values[0] = super.saveState(context);
|
||||||
values[1] = this.webProjectRef;
|
values[1] = this.store;
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,21 +115,20 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
|||||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance(), true);
|
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance(), true);
|
||||||
tx.begin();
|
tx.begin();
|
||||||
|
|
||||||
NodeRef webProject = getValue();
|
String storeName = getValue();
|
||||||
if (webProject == null)
|
if (storeName == null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("The web project must be specified.");
|
throw new IllegalArgumentException("The store must be specified.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Rendering deployment reports for: " + webProject.toString());
|
logger.debug("Rendering deployment reports for store: " + storeName);
|
||||||
|
|
||||||
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
|
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
|
||||||
ContentService contentService = Repository.getServiceRegistry(context).getContentService();
|
ContentService contentService = Repository.getServiceRegistry(context).getContentService();
|
||||||
AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
|
AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
|
||||||
|
|
||||||
String store = (String)nodeService.getProperty(webProject, WCMAppModel.PROP_AVMSTORE);
|
PropertyValue val = avmService.getStoreProperty(storeName, SandboxConstants.PROP_LAST_DEPLOYMENT_ID);
|
||||||
PropertyValue val = avmService.getStoreProperty(store, SandboxConstants.PROP_LAST_DEPLOYMENT_ID);
|
|
||||||
String attemptId = null;
|
String attemptId = null;
|
||||||
|
|
||||||
if (val != null)
|
if (val != null)
|
||||||
@@ -146,7 +145,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
|||||||
logger.debug("Retrieving deployment reports for attempt id: " + attemptId);
|
logger.debug("Retrieving deployment reports for attempt id: " + attemptId);
|
||||||
|
|
||||||
// get the deploymentattempt object
|
// get the deploymentattempt object
|
||||||
NodeRef attempt = AVMUtil.findDeploymentAttempt(attemptId);
|
NodeRef attempt = DeploymentUtil.findDeploymentAttempt(attemptId);
|
||||||
|
|
||||||
if (attempt != null)
|
if (attempt != null)
|
||||||
{
|
{
|
||||||
@@ -179,25 +178,25 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
|||||||
// Strongly typed component property accessors
|
// Strongly typed component property accessors
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The NodeRef representation of the web project to show the deployment reports for
|
* @return The store to show the deployment reports for
|
||||||
*/
|
*/
|
||||||
public NodeRef getValue()
|
public String getValue()
|
||||||
{
|
{
|
||||||
ValueBinding vb = getValueBinding("value");
|
ValueBinding vb = getValueBinding("value");
|
||||||
if (vb != null)
|
if (vb != null)
|
||||||
{
|
{
|
||||||
this.webProjectRef = (NodeRef)vb.getValue(getFacesContext());
|
this.store = (String)vb.getValue(getFacesContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.webProjectRef;
|
return this.store;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param value The NodeRef representation of the web project to show the deployment reports for
|
* @param value The store to show the deployment reports for
|
||||||
*/
|
*/
|
||||||
public void setValue(NodeRef value)
|
public void setValue(String value)
|
||||||
{
|
{
|
||||||
this.webProjectRef = value;
|
this.store = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
@@ -249,7 +248,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
String deployType = WCMAppModel.CONSTRAINT_ALFDEPLOY;
|
String deployType = WCMAppModel.CONSTRAINT_ALFDEPLOY;
|
||||||
if (server.startsWith(AVMDeploySnapshotAction.FILE_SERVER_PREFIX))
|
if (server.startsWith(AVMDeployWebsiteAction.FILE_SERVER_PREFIX))
|
||||||
{
|
{
|
||||||
deployType = WCMAppModel.CONSTRAINT_FILEDEPLOY;
|
deployType = WCMAppModel.CONSTRAINT_FILEDEPLOY;
|
||||||
}
|
}
|
||||||
|
@@ -44,12 +44,13 @@ import javax.faces.model.SelectItem;
|
|||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.actions.AVMDeploySnapshotAction;
|
import org.alfresco.repo.avm.actions.AVMDeployWebsiteAction;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.servlet.FacesHelper;
|
import org.alfresco.web.app.servlet.FacesHelper;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.bean.wcm.DeploymentServerConfig;
|
import org.alfresco.web.bean.wcm.DeploymentServerConfig;
|
||||||
import org.alfresco.web.ui.common.ComponentConstants;
|
import org.alfresco.web.ui.common.ComponentConstants;
|
||||||
|
import org.alfresco.web.ui.common.PanelGenerator;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||||
import org.alfresco.web.ui.common.component.UIListItem;
|
import org.alfresco.web.ui.common.component.UIListItem;
|
||||||
@@ -154,18 +155,6 @@ public class UIDeploymentServers extends UIInput
|
|||||||
out.write("<div class='deployConfig'>");
|
out.write("<div class='deployConfig'>");
|
||||||
|
|
||||||
List<DeploymentServerConfig> servers = getValue();
|
List<DeploymentServerConfig> servers = getValue();
|
||||||
DeploymentServerConfig currentServer = getCurrentServer();
|
|
||||||
for (DeploymentServerConfig server: servers)
|
|
||||||
{
|
|
||||||
if (currentServer != null && currentServer.getId().equals(server.getId()))
|
|
||||||
{
|
|
||||||
renderServerForm(context, out, server, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
renderServer(context, out, server);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getInAddMode())
|
if (getInAddMode())
|
||||||
{
|
{
|
||||||
@@ -183,6 +172,19 @@ public class UIDeploymentServers extends UIInput
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeploymentServerConfig currentServer = getCurrentServer();
|
||||||
|
for (DeploymentServerConfig server: servers)
|
||||||
|
{
|
||||||
|
if (currentServer != null && currentServer.getId().equals(server.getId()))
|
||||||
|
{
|
||||||
|
renderServerForm(context, out, server, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
renderServer(context, out, server);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
out.write("</div>");
|
out.write("</div>");
|
||||||
|
|
||||||
out.write("\n<script type='text/javascript'>");
|
out.write("\n<script type='text/javascript'>");
|
||||||
@@ -304,20 +306,6 @@ public class UIDeploymentServers extends UIInput
|
|||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
protected void renderAddControls(FacesContext context, ResponseWriter out)
|
|
||||||
throws IOException
|
|
||||||
{
|
|
||||||
out.write("");
|
|
||||||
|
|
||||||
UICommand addAlfAction = aquireAddAlfReceiverAction(context);
|
|
||||||
Utils.encodeRecursive(context, addAlfAction);
|
|
||||||
|
|
||||||
UICommand addFileAction = aquireAddFileReceiverAction(context);
|
|
||||||
Utils.encodeRecursive(context, addFileAction);
|
|
||||||
|
|
||||||
out.write("</div>");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void renderServer(FacesContext context, ResponseWriter out,
|
protected void renderServer(FacesContext context, ResponseWriter out,
|
||||||
DeploymentServerConfig server) throws IOException
|
DeploymentServerConfig server) throws IOException
|
||||||
{
|
{
|
||||||
@@ -327,38 +315,44 @@ public class UIDeploymentServers extends UIInput
|
|||||||
String serverName = (String)server.getProperties().get(DeploymentServerConfig.PROP_NAME);
|
String serverName = (String)server.getProperties().get(DeploymentServerConfig.PROP_NAME);
|
||||||
if (serverName == null || serverName.length() == 0)
|
if (serverName == null || serverName.length() == 0)
|
||||||
{
|
{
|
||||||
serverName = AVMDeploySnapshotAction.calculateServerUri(server.getRepoProps());
|
serverName = AVMDeployWebsiteAction.calculateServerUri(server.getRepoProps());
|
||||||
}
|
}
|
||||||
|
|
||||||
out.write("<div class='deployConfigServer'>");
|
out.write("<div class='deployConfigServer'>");
|
||||||
out.write("<table><tr><td valign='top'><img class='deployConfigServerIcon' src='");
|
PanelGenerator.generatePanelStart(out, contextPath, "lightstorm", "#eaeff2");
|
||||||
|
out.write("<table width='100%'><tr><td><img class='deployConfigServerIcon' src='");
|
||||||
out.write(contextPath);
|
out.write(contextPath);
|
||||||
out.write("/images/icons/deploy_server_");
|
out.write("/images/icons/deploy_server_");
|
||||||
out.write(server.getDeployType());
|
out.write(server.getDeployType());
|
||||||
out.write(".gif");
|
out.write(".gif");
|
||||||
out.write("' /></td><td><table class='deployConfigServerDetails'>");
|
out.write("' /></td><td width='100%'><span class='deployPanelServerName'>");
|
||||||
out.write("<tr><td colspan='4'><span class='deployPanelServerName'>");
|
|
||||||
out.write(serverName);
|
out.write(serverName);
|
||||||
out.write("</span></td><td align='right'>");
|
out.write("</span></td><td><div class='deployConfigServerActions'>");
|
||||||
Utils.encodeRecursive(context, aquireEditServerAction(context, server.getId()));
|
Utils.encodeRecursive(context, aquireEditServerAction(context, server.getId()));
|
||||||
Utils.encodeRecursive(context, aquireDeleteServerAction(context, server.getId()));
|
Utils.encodeRecursive(context, aquireDeleteServerAction(context, server.getId()));
|
||||||
out.write("</td></tr><tr><td>");
|
out.write("</div></td></tr>");
|
||||||
|
out.write("<tr><td colspan='3'>");
|
||||||
|
out.write("<table cellpadding='0' cellspacing='0'>");
|
||||||
|
out.write("<tr><td><table cellpadding='3' cellspacing='0' class='deployConfigServerDetailsLeftCol'>");
|
||||||
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_HOST));
|
out.write(bundle.getString(MSG_HOST));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_HOST) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_HOST) != null)
|
||||||
{
|
{
|
||||||
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_HOST));
|
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_HOST));
|
||||||
}
|
}
|
||||||
|
out.write("</td></tr>");
|
||||||
|
|
||||||
out.write("</td><td width='30'> </td><td>");
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_PORT));
|
out.write(bundle.getString(MSG_PORT));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_PORT) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_PORT) != null)
|
||||||
{
|
{
|
||||||
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_PORT));
|
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_PORT));
|
||||||
}
|
}
|
||||||
|
out.write("</td></tr>");
|
||||||
|
|
||||||
out.write("</td></tr><tr><td>");
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_TYPE));
|
out.write(bundle.getString(MSG_TYPE));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_TYPE) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_TYPE) != null)
|
||||||
@@ -373,21 +367,27 @@ public class UIDeploymentServers extends UIInput
|
|||||||
out.write(Application.getMessage(context, MSG_TEST_SERVER));
|
out.write(Application.getMessage(context, MSG_TEST_SERVER));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.write("</td><td width='30'> </td><td>");
|
out.write("</td></tr>");
|
||||||
|
|
||||||
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_URL));
|
out.write(bundle.getString(MSG_URL));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_URL) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_URL) != null)
|
||||||
{
|
{
|
||||||
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_URL));
|
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_URL));
|
||||||
}
|
}
|
||||||
out.write("</td></tr><tr><td>");
|
out.write("</td></tr></table></td>");
|
||||||
|
out.write("<td valign='top'><table cellpadding='3' cellspacing='0' class='deployConfigServerDetailsRightCol'>");
|
||||||
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_USER));
|
out.write(bundle.getString(MSG_USER));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_USER) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_USER) != null)
|
||||||
{
|
{
|
||||||
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_USER));
|
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_USER));
|
||||||
}
|
}
|
||||||
out.write("</td><td width='30'> </td><td>");
|
out.write("</td></tr>");
|
||||||
|
|
||||||
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_SOURCE));
|
out.write(bundle.getString(MSG_SOURCE));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_SOURCE_PATH) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_SOURCE_PATH) != null)
|
||||||
@@ -398,7 +398,7 @@ public class UIDeploymentServers extends UIInput
|
|||||||
|
|
||||||
if (WCMAppModel.CONSTRAINT_FILEDEPLOY.equals(server.getDeployType()))
|
if (WCMAppModel.CONSTRAINT_FILEDEPLOY.equals(server.getDeployType()))
|
||||||
{
|
{
|
||||||
out.write("<tr><td>");
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_TARGET));
|
out.write(bundle.getString(MSG_TARGET));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_TARGET_NAME) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_TARGET_NAME) != null)
|
||||||
@@ -411,7 +411,7 @@ public class UIDeploymentServers extends UIInput
|
|||||||
if (WCMAppModel.CONSTRAINT_LIVESERVER.equals(
|
if (WCMAppModel.CONSTRAINT_LIVESERVER.equals(
|
||||||
server.getProperties().get(DeploymentServerConfig.PROP_TYPE)))
|
server.getProperties().get(DeploymentServerConfig.PROP_TYPE)))
|
||||||
{
|
{
|
||||||
out.write("<tr><td>");
|
out.write("<tr><td align='right'>");
|
||||||
out.write(bundle.getString(MSG_AUTO_DEPLOY));
|
out.write(bundle.getString(MSG_AUTO_DEPLOY));
|
||||||
out.write(":</td><td>");
|
out.write(":</td><td>");
|
||||||
if (server.getProperties().get(DeploymentServerConfig.PROP_ON_APPROVAL) != null)
|
if (server.getProperties().get(DeploymentServerConfig.PROP_ON_APPROVAL) != null)
|
||||||
@@ -429,7 +429,9 @@ public class UIDeploymentServers extends UIInput
|
|||||||
out.write("</td></tr>");
|
out.write("</td></tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
out.write("</table></td></tr></table></div>");
|
out.write("</table></td></tr></table></td></tr></table>");
|
||||||
|
PanelGenerator.generatePanelEnd(out, contextPath, "lightstorm");
|
||||||
|
out.write("</div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -438,12 +440,13 @@ public class UIDeploymentServers extends UIInput
|
|||||||
{
|
{
|
||||||
String contextPath = context.getExternalContext().getRequestContextPath();
|
String contextPath = context.getExternalContext().getRequestContextPath();
|
||||||
ResourceBundle bundle = Application.getBundle(context);
|
ResourceBundle bundle = Application.getBundle(context);
|
||||||
|
|
||||||
out.write("<div class='deployConfigServer'>");
|
out.write("<div class='deployConfigServer'>");
|
||||||
out.write("<table><tr><td valign='top'><img class='deployConfigServerIcon' src='");
|
PanelGenerator.generatePanelStart(out, contextPath, "lightstorm", "#eaeff2");
|
||||||
|
out.write("<table width='100%'><tr><td><img class='deployConfigServerIcon' src='");
|
||||||
out.write(contextPath);
|
out.write(contextPath);
|
||||||
out.write("/images/icons/deploy_server_");
|
out.write("/images/icons/deploy_server_");
|
||||||
if (server != null)
|
if (edit)
|
||||||
{
|
{
|
||||||
out.write(server.getDeployType());
|
out.write(server.getDeployType());
|
||||||
}
|
}
|
||||||
@@ -452,7 +455,31 @@ public class UIDeploymentServers extends UIInput
|
|||||||
out.write(getAddType());
|
out.write(getAddType());
|
||||||
}
|
}
|
||||||
out.write(".gif' /></td>");
|
out.write(".gif' /></td>");
|
||||||
out.write("<td><table class='deployConfigServerForm'>");
|
out.write("<td width='100%'><span class='mainSubTitle'>");
|
||||||
|
if (edit)
|
||||||
|
{
|
||||||
|
if (WCMAppModel.CONSTRAINT_ALFDEPLOY.equals(server.getDeployType()))
|
||||||
|
{
|
||||||
|
out.write(bundle.getString("edit_alf_deploy_server_info"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.write(bundle.getString("edit_file_deploy_server_info"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (WCMAppModel.CONSTRAINT_ALFDEPLOY.equals(getAddType()))
|
||||||
|
{
|
||||||
|
out.write(bundle.getString("add_alf_deploy_server_info"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.write(bundle.getString("add_file_deploy_server_info"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out.write("</span></td></tr>");
|
||||||
|
out.write("<tr><td colspan='2'><table class='deployConfigServerForm'>");
|
||||||
|
|
||||||
// create the server type drop down
|
// create the server type drop down
|
||||||
out.write("<tr><td align='right'>");
|
out.write("<tr><td align='right'>");
|
||||||
@@ -663,73 +690,9 @@ public class UIDeploymentServers extends UIInput
|
|||||||
}
|
}
|
||||||
|
|
||||||
// finish off tables and div
|
// finish off tables and div
|
||||||
out.write("</table></td></tr></table></div>");
|
out.write("</table></td></tr></table>");
|
||||||
}
|
PanelGenerator.generatePanelEnd(out, contextPath, "lightstorm");
|
||||||
|
out.write("</div>");
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected UIActionLink aquireAddAlfReceiverAction(FacesContext context)
|
|
||||||
{
|
|
||||||
UIActionLink action = null;
|
|
||||||
String actionId = "add_alf_receiver";
|
|
||||||
|
|
||||||
// try find the action as a child of this component
|
|
||||||
for (UIComponent component : (List<UIComponent>)getChildren())
|
|
||||||
{
|
|
||||||
if (actionId.equals(component.getId()))
|
|
||||||
{
|
|
||||||
action = (UIActionLink)component;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action == null)
|
|
||||||
{
|
|
||||||
// create the action and add as a child component
|
|
||||||
javax.faces.application.Application facesApp = context.getApplication();
|
|
||||||
action = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
|
|
||||||
action.setId(actionId);
|
|
||||||
action.setValue(Application.getMessage(context, MSG_ALF_SERVER));
|
|
||||||
action.setImage("/images/icons/plus.gif");
|
|
||||||
MethodBinding binding = facesApp.createMethodBinding(
|
|
||||||
"#{WizardManager.bean.addAlfrescoServerReceiver}", new Class[] {});
|
|
||||||
action.setAction(binding);
|
|
||||||
this.getChildren().add(action);
|
|
||||||
}
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected UIActionLink aquireAddFileReceiverAction(FacesContext context)
|
|
||||||
{
|
|
||||||
UIActionLink action = null;
|
|
||||||
String actionId = "add_file_receiver";
|
|
||||||
|
|
||||||
// try find the action as a child of this component
|
|
||||||
for (UIComponent component : (List<UIComponent>)getChildren())
|
|
||||||
{
|
|
||||||
if (actionId.equals(component.getId()))
|
|
||||||
{
|
|
||||||
action = (UIActionLink)component;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action == null)
|
|
||||||
{
|
|
||||||
// create the action and add as a child component
|
|
||||||
javax.faces.application.Application facesApp = context.getApplication();
|
|
||||||
action = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
|
|
||||||
action.setId(actionId);
|
|
||||||
action.setValue(Application.getMessage(context, MSG_FILE_SYSTEM));
|
|
||||||
action.setImage("/images/icons/plus.gif");
|
|
||||||
MethodBinding binding = facesApp.createMethodBinding(
|
|
||||||
"#{WizardManager.bean.addFileSystemReceiver}", new Class[] {});
|
|
||||||
action.setAction(binding);
|
|
||||||
this.getChildren().add(action);
|
|
||||||
}
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@@ -26,7 +26,6 @@ package org.alfresco.web.ui.wcm.component;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -53,6 +52,7 @@ import org.alfresco.service.namespace.RegexQNamePattern;
|
|||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||||
|
import org.alfresco.web.bean.wcm.DeploymentUtil;
|
||||||
import org.alfresco.web.ui.common.ComponentConstants;
|
import org.alfresco.web.ui.common.ComponentConstants;
|
||||||
import org.alfresco.web.ui.common.ConstantMethodBinding;
|
import org.alfresco.web.ui.common.ConstantMethodBinding;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
@@ -297,6 +297,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
|
|||||||
{
|
{
|
||||||
Map<String, String> params = new HashMap<String, String>(2, 1.0f);
|
Map<String, String> params = new HashMap<String, String>(2, 1.0f);
|
||||||
params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
|
params.put("version", "#{" + REQUEST_SNAPVERSION + "}");
|
||||||
|
params.put("store", sandbox);
|
||||||
action = createAction(context, sandbox, ACT_SNAPSHOT_DEPLOY, "/images/icons/deploy.gif",
|
action = createAction(context, sandbox, ACT_SNAPSHOT_DEPLOY, "/images/icons/deploy.gif",
|
||||||
"#{DialogManager.setupParameters}", "dialog:deploySnapshot", null, params);
|
"#{DialogManager.setupParameters}", "dialog:deploySnapshot", null, params);
|
||||||
}
|
}
|
||||||
@@ -496,7 +497,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent
|
|||||||
attemptId = val.getStringValue();
|
attemptId = val.getStringValue();
|
||||||
|
|
||||||
// get the latest deployment attempt
|
// get the latest deployment attempt
|
||||||
NodeRef attempt = AVMUtil.findDeploymentAttempt(attemptId);
|
NodeRef attempt = DeploymentUtil.findDeploymentAttempt(attemptId);
|
||||||
if (attempt != null)
|
if (attempt != null)
|
||||||
{
|
{
|
||||||
// retrieve the snapshot deployed
|
// retrieve the snapshot deployed
|
||||||
|
@@ -46,6 +46,8 @@ import javax.transaction.UserTransaction;
|
|||||||
|
|
||||||
import org.alfresco.model.WCMAppModel;
|
import org.alfresco.model.WCMAppModel;
|
||||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
|
import org.alfresco.repo.domain.PropertyValue;
|
||||||
|
import org.alfresco.sandbox.SandboxConstants;
|
||||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||||
import org.alfresco.service.cmr.avm.AVMService;
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||||
@@ -65,6 +67,7 @@ import org.alfresco.web.bean.repository.Repository;
|
|||||||
import org.alfresco.web.bean.repository.User;
|
import org.alfresco.web.bean.repository.User;
|
||||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||||
import org.alfresco.web.bean.wcm.AVMNode;
|
import org.alfresco.web.bean.wcm.AVMNode;
|
||||||
|
import org.alfresco.web.bean.wcm.DeploymentUtil;
|
||||||
import org.alfresco.web.bean.wcm.WebProject;
|
import org.alfresco.web.bean.wcm.WebProject;
|
||||||
import org.alfresco.web.config.ClientConfigElement;
|
import org.alfresco.web.config.ClientConfigElement;
|
||||||
import org.alfresco.web.data.IDataContainer;
|
import org.alfresco.web.data.IDataContainer;
|
||||||
@@ -114,6 +117,8 @@ public class UIUserSandboxes extends SelfRenderingComponent implements Serializa
|
|||||||
private static final String ACT_SANDBOX_ICON = "sandbox_icon";
|
private static final String ACT_SANDBOX_ICON = "sandbox_icon";
|
||||||
private static final String ACT_REMOVE_SANDBOX = "sandbox_remove";
|
private static final String ACT_REMOVE_SANDBOX = "sandbox_remove";
|
||||||
private static final String ACT_SANDBOX_REFRESH = "sandbox_refresh";
|
private static final String ACT_SANDBOX_REFRESH = "sandbox_refresh";
|
||||||
|
private static final String ACT_SANDBOX_DEPLOY = "sandbox_deploy";
|
||||||
|
private static final String ACT_SANDBOX_DEPLOY_REPORT = "deployment_report_action";
|
||||||
|
|
||||||
private static final String ACTIONS_FILE = "avm_file_modified";
|
private static final String ACTIONS_FILE = "avm_file_modified";
|
||||||
private static final String ACTIONS_FOLDER = "avm_folder_modified";
|
private static final String ACTIONS_FOLDER = "avm_folder_modified";
|
||||||
@@ -141,6 +146,7 @@ public class UIUserSandboxes extends SelfRenderingComponent implements Serializa
|
|||||||
|
|
||||||
private static final String REQUEST_FORM_REF = "formref";
|
private static final String REQUEST_FORM_REF = "formref";
|
||||||
private static final String REQUEST_PREVIEW_REF = "prevhref";
|
private static final String REQUEST_PREVIEW_REF = "prevhref";
|
||||||
|
private static final String REQUEST_UPDATE_TEST_SERVER = "updatetestserver";
|
||||||
|
|
||||||
private static final String SPACE_ICON = "/images/icons/" + BrowseBean.SPACE_SMALL_DEFAULT + ".gif";
|
private static final String SPACE_ICON = "/images/icons/" + BrowseBean.SPACE_SMALL_DEFAULT + ".gif";
|
||||||
|
|
||||||
@@ -315,6 +321,15 @@ public class UIUserSandboxes extends SelfRenderingComponent implements Serializa
|
|||||||
// sort the user list alphabetically and insert the current user at the top of the list
|
// sort the user list alphabetically and insert the current user at the top of the list
|
||||||
List<UserRoleWrapper> userRoleWrappers = buildSortedUserRoles(nodeService, currentUserName, userInfoRefs);
|
List<UserRoleWrapper> userRoleWrappers = buildSortedUserRoles(nodeService, currentUserName, userInfoRefs);
|
||||||
|
|
||||||
|
// determine whether the deploy action should be shown
|
||||||
|
boolean deployServersConfigured = false;
|
||||||
|
List<ChildAssociationRef> deployToServers = nodeService.getChildAssocs(
|
||||||
|
websiteRef, WCMAppModel.ASSOC_DEPLOYMENTSERVER, RegexQNamePattern.MATCH_ALL);
|
||||||
|
if (deployToServers != null && deployToServers.size() > 0)
|
||||||
|
{
|
||||||
|
deployServersConfigured = true;
|
||||||
|
}
|
||||||
|
|
||||||
// output a javascript function we need for multi-select functionality
|
// output a javascript function we need for multi-select functionality
|
||||||
out.write(SCRIPT_MULTISELECT);
|
out.write(SCRIPT_MULTISELECT);
|
||||||
|
|
||||||
@@ -406,6 +421,38 @@ public class UIUserSandboxes extends SelfRenderingComponent implements Serializa
|
|||||||
requestMap.remove(REQUEST_PREVIEW_REF);
|
requestMap.remove(REQUEST_PREVIEW_REF);
|
||||||
out.write(" ");
|
out.write(" ");
|
||||||
|
|
||||||
|
// Deployment actions
|
||||||
|
if (deployServersConfigured)
|
||||||
|
{
|
||||||
|
// if a deployment has already occurred then the next
|
||||||
|
// deployment will be an update (this informs the dialog
|
||||||
|
// that test server allocation checks are not needed).
|
||||||
|
PropertyValue val = avmService.getStoreProperty(mainStore,
|
||||||
|
SandboxConstants.PROP_LAST_DEPLOYMENT_ID);
|
||||||
|
|
||||||
|
boolean reDeploy = (val != null);
|
||||||
|
|
||||||
|
Map<String, String> dialogParams = new HashMap<String, String>(6);
|
||||||
|
dialogParams.put("store", mainStore);
|
||||||
|
dialogParams.put("username", username);
|
||||||
|
requestMap.put(REQUEST_UPDATE_TEST_SERVER, Boolean.toString(reDeploy));
|
||||||
|
dialogParams.put("updateTestServer", "#{" + REQUEST_UPDATE_TEST_SERVER + "}");
|
||||||
|
Utils.encodeRecursive(context, aquireAction(
|
||||||
|
context, mainStore, username, ACT_SANDBOX_DEPLOY, "/images/icons/deploy.gif",
|
||||||
|
"#{DialogManager.setupParameters}", "dialog:deploySandbox", null, dialogParams));
|
||||||
|
out.write(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
// View deployment report (if there are any)
|
||||||
|
List<NodeRef> attempts = DeploymentUtil.findDeploymentAttempts(mainStore);
|
||||||
|
if (attempts != null && attempts.size() > 0)
|
||||||
|
{
|
||||||
|
Utils.encodeRecursive(context, aquireAction(
|
||||||
|
context, mainStore, username, ACT_SANDBOX_DEPLOY_REPORT, "/images/icons/deployment_report.gif",
|
||||||
|
"#{DialogManager.setupParameters}", "dialog:viewDeploymentReport"));
|
||||||
|
out.write(" ");
|
||||||
|
}
|
||||||
|
|
||||||
// Refresh Sandbox
|
// Refresh Sandbox
|
||||||
Utils.encodeRecursive(context, aquireAction(
|
Utils.encodeRecursive(context, aquireAction(
|
||||||
context, mainStore, username, ACT_SANDBOX_REFRESH, "/images/icons/reset.gif",
|
context, mainStore, username, ACT_SANDBOX_REFRESH, "/images/icons/reset.gif",
|
||||||
|
@@ -37,9 +37,11 @@ public class DeployWebsiteTag extends BaseComponentTag
|
|||||||
{
|
{
|
||||||
private String value;
|
private String value;
|
||||||
private String website;
|
private String website;
|
||||||
|
private String store;
|
||||||
private String monitor;
|
private String monitor;
|
||||||
private String monitorIds;
|
private String monitorIds;
|
||||||
private String snapshotVersion;
|
private String snapshotVersion;
|
||||||
|
private String deployMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see javax.faces.webapp.UIComponentTag#getComponentType()
|
* @see javax.faces.webapp.UIComponentTag#getComponentType()
|
||||||
@@ -66,9 +68,11 @@ public class DeployWebsiteTag extends BaseComponentTag
|
|||||||
|
|
||||||
setStringProperty(component, "value", this.value);
|
setStringProperty(component, "value", this.value);
|
||||||
setStringProperty(component, "website", this.website);
|
setStringProperty(component, "website", this.website);
|
||||||
|
setStringProperty(component, "store", this.store);
|
||||||
setBooleanProperty(component, "monitor", this.monitor);
|
setBooleanProperty(component, "monitor", this.monitor);
|
||||||
setStringProperty(component, "monitorIds", this.monitorIds);
|
setStringProperty(component, "monitorIds", this.monitorIds);
|
||||||
setIntProperty(component, "snapshotVersion", this.snapshotVersion);
|
setIntProperty(component, "snapshotVersion", this.snapshotVersion);
|
||||||
|
setStringProperty(component, "deployMode", this.deployMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,9 +83,11 @@ public class DeployWebsiteTag extends BaseComponentTag
|
|||||||
super.release();
|
super.release();
|
||||||
this.value = null;
|
this.value = null;
|
||||||
this.website = null;
|
this.website = null;
|
||||||
|
this.store = null;
|
||||||
this.monitor = null;
|
this.monitor = null;
|
||||||
this.monitorIds = null;
|
this.monitorIds = null;
|
||||||
this.snapshotVersion = null;
|
this.snapshotVersion = null;
|
||||||
|
this.deployMode = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,6 +122,14 @@ public class DeployWebsiteTag extends BaseComponentTag
|
|||||||
this.website = website;
|
this.website = website;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param store The store being deployed to
|
||||||
|
*/
|
||||||
|
public void setStore(String store)
|
||||||
|
{
|
||||||
|
this.store = store;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param snapshotVersion The version of the snapshot to deploy to
|
* @param snapshotVersion The version of the snapshot to deploy to
|
||||||
*/
|
*/
|
||||||
@@ -123,4 +137,12 @@ public class DeployWebsiteTag extends BaseComponentTag
|
|||||||
{
|
{
|
||||||
this.snapshotVersion = snapshotVersion;
|
this.snapshotVersion = snapshotVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param deployMode The type of server being deployed to
|
||||||
|
*/
|
||||||
|
public void setDeployMode(String deployMode)
|
||||||
|
{
|
||||||
|
this.deployMode = deployMode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4019,10 +4019,10 @@
|
|||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
<description>
|
<description>
|
||||||
The bean that backs up the Deploy Snapshot Dialog
|
The bean that backs up the Deploy Website Dialog
|
||||||
</description>
|
</description>
|
||||||
<managed-bean-name>DeploySnapshotDialog</managed-bean-name>
|
<managed-bean-name>DeployWebsiteDialog</managed-bean-name>
|
||||||
<managed-bean-class>org.alfresco.web.bean.wcm.DeploySnapshotDialog</managed-bean-class>
|
<managed-bean-class>org.alfresco.web.bean.wcm.DeployWebsiteDialog</managed-bean-class>
|
||||||
<managed-bean-scope>session</managed-bean-scope>
|
<managed-bean-scope>session</managed-bean-scope>
|
||||||
<managed-property>
|
<managed-property>
|
||||||
<property-name>avmBrowseBean</property-name>
|
<property-name>avmBrowseBean</property-name>
|
||||||
@@ -4075,10 +4075,6 @@
|
|||||||
<managed-bean-name>ViewDeploymentReportDialog</managed-bean-name>
|
<managed-bean-name>ViewDeploymentReportDialog</managed-bean-name>
|
||||||
<managed-bean-class>org.alfresco.web.bean.wcm.ViewDeploymentReportDialog</managed-bean-class>
|
<managed-bean-class>org.alfresco.web.bean.wcm.ViewDeploymentReportDialog</managed-bean-class>
|
||||||
<managed-bean-scope>session</managed-bean-scope>
|
<managed-bean-scope>session</managed-bean-scope>
|
||||||
<managed-property>
|
|
||||||
<property-name>avmBrowseBean</property-name>
|
|
||||||
<value>#{AVMBrowseBean}</value>
|
|
||||||
</managed-property>
|
|
||||||
<managed-property>
|
<managed-property>
|
||||||
<property-name>nodeService</property-name>
|
<property-name>nodeService</property-name>
|
||||||
<value>#{NodeService}</value>
|
<value>#{NodeService}</value>
|
||||||
|
@@ -267,6 +267,20 @@
|
|||||||
<display-name>Deploy Website</display-name>
|
<display-name>Deploy Website</display-name>
|
||||||
<description>Renders a list of servers to deploy to or show deployment progress for</description>
|
<description>Renders a list of servers to deploy to or show deployment progress for</description>
|
||||||
|
|
||||||
|
<attribute>
|
||||||
|
<name>id</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
<description>The component identifier for this component</description>
|
||||||
|
</attribute>
|
||||||
|
|
||||||
|
<attribute>
|
||||||
|
<name>rendered</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
<description>Flag to determine whether component should be rendered</description>
|
||||||
|
</attribute>
|
||||||
|
|
||||||
<attribute>
|
<attribute>
|
||||||
<name>website</name>
|
<name>website</name>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
@@ -289,17 +303,17 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
|
|
||||||
<attribute>
|
<attribute>
|
||||||
<name>id</name>
|
<name>deployMode</name>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<rtexprvalue>true</rtexprvalue>
|
<rtexprvalue>true</rtexprvalue>
|
||||||
<description>The component identifier for this component</description>
|
<description>The type of servers being deployed to, 'live' or 'test'</description>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
|
||||||
<attribute>
|
<attribute>
|
||||||
<name>rendered</name>
|
<name>store</name>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<rtexprvalue>true</rtexprvalue>
|
<rtexprvalue>true</rtexprvalue>
|
||||||
<description>Flag to determine whether component should be rendered</description>
|
<description>The store being deployed</description>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
|
||||||
<attribute>
|
<attribute>
|
||||||
|
@@ -719,67 +719,65 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited
|
|||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deployConfig
|
|
||||||
{
|
|
||||||
padding: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deployNoServers
|
|
||||||
{
|
|
||||||
margin-top: 26px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deployNoServers img
|
|
||||||
{
|
|
||||||
vertical-align: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deployConfigServer
|
.deployConfigServer
|
||||||
{
|
{
|
||||||
margin-top: 14px;
|
margin-top: 10px;
|
||||||
border: 1px solid #555;
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
-moz-border-radius: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.deployConfigServerIcon
|
.deployConfigServerActions
|
||||||
{
|
{
|
||||||
margin: 8px 0px 0px 8px;
|
white-space: nowrap;
|
||||||
|
margin-right: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deployConfigServer td
|
.deployConfigServerActions a
|
||||||
{
|
{
|
||||||
padding: 5px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deployConfigServerDetails
|
.deployConfigServerActions img
|
||||||
{
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deployConfigServerDetails td
|
|
||||||
{
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.deployConfigServerDetails img
|
|
||||||
{
|
{
|
||||||
border: none;
|
border: none;
|
||||||
margin-left: 3px;
|
}
|
||||||
|
|
||||||
|
.deployConfigServerDetailsLeftCol
|
||||||
|
{
|
||||||
|
margin-left: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deployConfigServerDetailsRightCol
|
||||||
|
{
|
||||||
|
margin-left: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deployConfigServerForm
|
.deployConfigServerForm
|
||||||
{
|
{
|
||||||
padding-left: 15px;
|
margin-left: 10px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deployConfigServerForm td
|
||||||
|
{
|
||||||
|
padding: 0px 6px 6px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deployConfigServerForm .inputField
|
.deployConfigServerForm .inputField
|
||||||
{
|
{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.deployServersInfo
|
||||||
|
{
|
||||||
|
margin: 10px 5px 16px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deployServersInfo img
|
||||||
|
{
|
||||||
|
vertical-align: -7px;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
.deployPanelCheckbox
|
.deployPanelControl
|
||||||
{
|
{
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
padding-right: 16px;
|
padding-right: 16px;
|
||||||
|
BIN
source/web/images/parts/lightstorm_01.gif
Normal file
After Width: | Height: | Size: 155 B |
BIN
source/web/images/parts/lightstorm_02.gif
Normal file
After Width: | Height: | Size: 52 B |
BIN
source/web/images/parts/lightstorm_03.gif
Normal file
After Width: | Height: | Size: 159 B |
BIN
source/web/images/parts/lightstorm_04.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
source/web/images/parts/lightstorm_06.gif
Normal file
After Width: | Height: | Size: 57 B |
BIN
source/web/images/parts/lightstorm_07.gif
Normal file
After Width: | Height: | Size: 156 B |
BIN
source/web/images/parts/lightstorm_08.gif
Normal file
After Width: | Height: | Size: 52 B |
BIN
source/web/images/parts/lightstorm_09.gif
Normal file
After Width: | Height: | Size: 154 B |
@@ -156,8 +156,10 @@
|
|||||||
actionListener="#{AVMBrowseBean.refreshSandbox}" image="/images/icons/reset.gif" />
|
actionListener="#{AVMBrowseBean.refreshSandbox}" image="/images/icons/reset.gif" />
|
||||||
|
|
||||||
<a:actionLink id="actViewDeployReport" rendered="#{AVMBrowseBean.hasDeployBeenAttempted}" value="#{msg.deployment_report_action}"
|
<a:actionLink id="actViewDeployReport" rendered="#{AVMBrowseBean.hasDeployBeenAttempted}" value="#{msg.deployment_report_action}"
|
||||||
actionListener="#{AVMBrowseBean.setupSandboxAction}" action="dialog:viewDeploymentReport"
|
actionListener="#{DialogManager.setupParameters}" action="dialog:viewDeploymentReport"
|
||||||
image="/images/icons/deployment_report.gif" />
|
image="/images/icons/deployment_report.gif">
|
||||||
|
<f:param name="store" value="#{AVMBrowseBean.stagingStore}" />
|
||||||
|
</a:actionLink>
|
||||||
|
|
||||||
<%-- Disabled action for GA
|
<%-- Disabled action for GA
|
||||||
<a:actionLink id="actSnap" value="#{msg.sandbox_snapshot}" image="/images/icons/create_snapshot.gif"
|
<a:actionLink id="actSnap" value="#{msg.sandbox_snapshot}" image="/images/icons/create_snapshot.gif"
|
||||||
|
@@ -32,5 +32,6 @@
|
|||||||
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
|
|
||||||
<w:deployWebsite value="#{DialogManager.bean.deployTo}" website="#{DialogManager.bean.webProjectRef}"
|
<w:deployWebsite value="#{DialogManager.bean.deployTo}" deployMode="#{DialogManager.bean.deployMode}"
|
||||||
|
website="#{DialogManager.bean.webProjectRef}" store="#{DialogManager.bean.store}"
|
||||||
snapshotVersion="#{DialogManager.bean.snapshotVersion}" />
|
snapshotVersion="#{DialogManager.bean.snapshotVersion}" />
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
|
|
||||||
<w:deploymentReports value="#{DialogManager.bean.webProjectRef}" />
|
<w:deploymentReports value="#{DialogManager.bean.store}" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|