Merged DEV/BELARUS/HEAD-2010_02_10 to HEAD

19151: SAIL-298: Implemented subsystem changes.
      - We didn't remove the cifs.serverName property because it is independent of host/port/context/protocol.
   Applied following corrections
      - Removed the email 'chain'. OutboundSMTP and InboundSMTP are separate subsystems and don't need to be chained
      - Added the ability for multiple Spring-initialized subsystems to share the same category
      - No need to expose mailService outside of the OutboundSMTP subsystem as far as I can tell
      - GlobalDeskTopActionConfigBean doesn't need dependencies and no longer exposes the webpath property
      - Fixed construction of contexts in ContentDiskDriver.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19266 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2010-03-12 18:41:09 +00:00
parent 8f0ad2d96f
commit a2c2e215a8
29 changed files with 548 additions and 271 deletions

View File

@@ -18,6 +18,7 @@
*/
package org.alfresco.repo.admin;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@@ -33,6 +34,12 @@ import org.springframework.context.ApplicationContextAware;
*/
public class SysAdminParamsImpl implements SysAdminParams, ApplicationContextAware, InitializingBean
{
/** Token name to substitute current servers DNS name or TCP/IP address into a host name **/
private static final String TOKEN_LOCAL_NAME = "${localname}";
/** The local server name to which the above token will expand. */
private final String localName;
/** The application context, to get license component, if installed. */
private ApplicationContext ctx;
@@ -45,6 +52,45 @@ public class SysAdminParamsImpl implements SysAdminParams, ApplicationContextAwa
/** The allow write. */
private boolean allowWrite = true;
/** Alfresco context. */
private String alfrescoContext = "alfresco";
/** Alfresco host. */
private String alfrescoHost = "localhost";
/** Alfresco port. */
private int alfrescoPort = 8080;
/** Alfresco protocol. */
private String alfrescoProtocol = "http";
/** Share context. */
private String shareContext = "alfresco";
/** Share host. */
private String shareHost = "localhost";
/** Share port. */
private int sharePort = 8080;
/** Share protocol. */
private String shareProtocol = "http";
public SysAdminParamsImpl()
{
// Establish the name of the local server so we can use it in token substitutions
String srvName = "localhost";
try
{
srvName = InetAddress.getLocalHost().getHostName();
}
catch (Exception ex)
{
srvName = "localhost";
}
localName = srvName;
}
/*
* (non-Javadoc)
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.
@@ -146,4 +192,95 @@ public class SysAdminParamsImpl implements SysAdminParams, ApplicationContextAwa
return this.allowWrite;
}
public String getAlfrescoContext()
{
return alfrescoContext;
}
public void setAlfrescoContext(String alfrescoContext)
{
this.alfrescoContext = alfrescoContext;
}
public String getAlfrescoHost()
{
return alfrescoHost;
}
public void setAlfrescoHost(String alfrescoHost)
{
this.alfrescoHost = subsituteHost(alfrescoHost);
}
public int getAlfrescoPort()
{
return alfrescoPort;
}
public void setAlfrescoPort(int alfrescoPort)
{
this.alfrescoPort = alfrescoPort;
}
public String getAlfrescoProtocol()
{
return alfrescoProtocol;
}
public void setAlfrescoProtocol(String alfrescoProtocol)
{
this.alfrescoProtocol = alfrescoProtocol;
}
public String getShareContext()
{
return shareContext;
}
public void setShareContext(String shareContext)
{
this.shareContext = shareContext;
}
public String getShareHost()
{
return shareHost;
}
public void setShareHost(String shareHost)
{
this.shareHost = subsituteHost(shareHost);
}
public int getSharePort()
{
return sharePort;
}
public void setSharePort(int sharePort)
{
this.sharePort = sharePort;
}
public String getShareProtocol()
{
return shareProtocol;
}
public void setShareProtocol(String shareProtocol)
{
this.shareProtocol = shareProtocol;
}
/**
* Expands the special ${localname} token within a host name using the resolved DNS name for the local host.
*
* @param hostName
* the host name
* @return the string
*/
public String subsituteHost(String hostName)
{
return hostName.replace(TOKEN_LOCAL_NAME, localName);
}
}