Merged V2.2 to HEAD

7307: Re-enabled ability to perform deployments against new model
   7278: Added friendly server name property to model and refactored view deployment report dialog
   7272: Patch for new deployment features


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8245 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-02-11 13:19:19 +00:00
parent a6d2fd9481
commit bd0a362d5d
15 changed files with 314 additions and 439 deletions

View File

@@ -289,58 +289,6 @@ public final class AVMUtil
return (otherStore + ':' + AVMUtil.getStoreRelativePath(avmPath));
}
/**
* Returns the username to connect as on the remote machine being deployed to
* <p>
* This value is read from the &lt;wcm&gt; config section in
* web-client-config-wcm.xml
* </p>
*
* @return Username for remote machine
*/
public static String getRemoteDeploymentUsername()
{
String username = "admin";
ConfigElement deploymentConfig = getDeploymentConfig();
if (deploymentConfig != null)
{
ConfigElement elem = deploymentConfig.getChild("remote-username");
if (elem != null)
{
username = elem.getValue();
}
}
return username;
}
/**
* Returns the password to use on the remote machine being deployed to
* <p>
* This value is read from the &lt;wcm&gt; config section in
* web-client-config-wcm.xml
* </p>
*
* @return Password for remote machine
*/
public static String getRemoteDeploymentPassword()
{
String password = "admin";
ConfigElement deploymentConfig = getDeploymentConfig();
if (deploymentConfig != null)
{
ConfigElement elem = deploymentConfig.getChild("remote-password");
if (elem != null)
{
password = elem.getValue();
}
}
return password;
}
/**
* Returns the number of seconds between each call back to the server to
* obtain the latest status of an in progress deployment.
@@ -380,123 +328,6 @@ public final class AVMUtil
return pollFreq;
}
/**
* Returns the default RMI registry port to use when one is not supplied
* for target Alfresco deployment servers.
* <p>
* This value is read from the &lt;wcm&gt; config section in
* web-client-config-wcm.xml
* </p>
*
* @return The remote RMI registry port to use for deployments.
* The default is 50500.
*/
public static int getRemoteRMIRegistryPort()
{
int rmiPort = 50500;
ConfigElement deploymentConfig = getDeploymentConfig();
if (deploymentConfig != null)
{
ConfigElement elem = deploymentConfig.getChild("remote-rmi-port");
if (elem != null)
{
try
{
int value = Integer.parseInt(elem.getValue());
if (value > 0)
{
rmiPort = value;
}
}
catch (NumberFormatException nfe)
{
// do nothing, just use the default
}
}
}
return rmiPort;
}
/**
* Returns the default RMI port to use when one is not supplied
* for target deployment receivers.
* <p>
* This value is read from the &lt;wcm&gt; config section in
* web-client-config-wcm.xml
* </p>
*
* @return The deployment receiver RMI port to use for deployments.
* The default is 44100.
*/
public static int getRemoteReceiverRMIPort()
{
int rmiPort = 44100;
ConfigElement deploymentConfig = getDeploymentConfig();
if (deploymentConfig != null)
{
ConfigElement elem = deploymentConfig.getChild("receiver-rmi-port");
if (elem != null)
{
try
{
int value = Integer.parseInt(elem.getValue());
if (value > 0)
{
rmiPort = value;
}
}
catch (NumberFormatException nfe)
{
// do nothing, just use the default
}
}
}
return rmiPort;
}
/**
* Returns the delay (in seconds) to apply to the start of a deployment
* operation (mainly for demo and testing purposes).
* <p>
* This value is read from the &lt;wcm&gt; config section in
* web-client-config-wcm.xml
* </p>
*
* @return The delay to use at the start of a deployment.
* The default is 30.
*/
public static int getRemoteDeploymentDelay()
{
int delay = 30;
ConfigElement deploymentConfig = getDeploymentConfig();
if (deploymentConfig != null)
{
ConfigElement elem = deploymentConfig.getChild("delay");
if (elem != null)
{
try
{
int value = Integer.parseInt(elem.getValue());
if (value > 0)
{
delay = value;
}
}
catch (NumberFormatException nfe)
{
// do nothing, just use the default
}
}
}
return delay;
}
/**
* Returns the number of seconds between each call back to the server to
* obtain the latest status of a link validation check.
@@ -978,6 +809,44 @@ public final class AVMUtil
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.