From 7ed214059f1655e77d237597de7c7ebf2ede0c8a Mon Sep 17 00:00:00 2001 From: Dave Ward Date: Fri, 3 Apr 2009 17:31:00 +0000 Subject: [PATCH] Merged missing changes to file-servers.xml and file-servers.properties from 13521 in V3.1 Synchronized new file-servers-context.xml with these changes Debugged NFS and Desktop Action Initialization via Spring git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13831 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/file-servers.xml | 276 +++--- .../fileServers/file-servers-context.xml | 813 ++++++++++-------- .../fileServers/file-servers.properties | 12 + .../ldap-authentication-context.xml | 3 + .../passthru-authentication-context.xml | 3 + .../filesys/alfresco/AlfrescoContext.java | 44 +- .../filesys/alfresco/AlfrescoDiskDriver.java | 18 + .../filesys/alfresco/DesktopAction.java | 42 +- .../filesys/auth/PassthruServerFactory.java | 15 + .../auth/nfs/AlfrescoRpcAuthenticator.java | 49 +- .../org/alfresco/filesys/avm/AVMContext.java | 11 +- .../alfresco/filesys/avm/AVMDiskDriver.java | 4 +- .../filesys/config/CIFSConfigBean.java | 4 +- .../alfresco/filesys/repo/ContentContext.java | 7 +- .../filesys/repo/ContentDiskDriver.java | 5 +- .../repo/desk/JavaScriptDesktopAction.java | 20 +- 16 files changed, 750 insertions(+), 576 deletions(-) diff --git a/config/alfresco/file-servers.xml b/config/alfresco/file-servers.xml index 603f19f345..5f3f078953 100644 --- a/config/alfresco/file-servers.xml +++ b/config/alfresco/file-servers.xml @@ -1,176 +1,244 @@ - + + Alfresco CIFS Server ${cifs.broadcast} + ${cifs.bindto} - + - - + - - + --> + + + + - + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + --> + + + + - - - - + + + + + - - + + + + - - - - - - + + + + + + + + + + + + workspace://SpacesStore /app:company_home - - - __AlfrescoClient.url + + + __Alfresco.url http://${localname}:8080/alfresco/ - - + + - - - - - - - - - + + + + + + + + + + + + alfresco/desktop/Alfresco.exe + http://${localname}:8080/alfresco/ + + + org.alfresco.filesys.repo.desk.CheckInOutDesktopAction + CheckInOut + __CheckInOut.exe + + + org.alfresco.filesys.repo.desk.JavaScriptDesktopAction + JavaScriptURL + __ShowDetails.exe + + anyFiles + copyToTarget + - + + - ---> - - + + + --> - - - + + + - + - + - + + - + + + + --> - diff --git a/config/alfresco/subsystems/fileServers/file-servers-context.xml b/config/alfresco/subsystems/fileServers/file-servers-context.xml index 94f934e073..b2f900d0b4 100644 --- a/config/alfresco/subsystems/fileServers/file-servers-context.xml +++ b/config/alfresco/subsystems/fileServers/file-servers-context.xml @@ -3,396 +3,457 @@ "http://www.springframework.org/dtd/spring-beans.dtd"> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - - - - - - + + + + + + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - ${cifs.enabled} - - - ${cifs.serverName} - - - ${cifs.domain} - - - Alfresco CIFS Server - - - - ${cifs.broadcast} - - - - ${cifs.bindto} - - - - - - - ${cifs.tcpipSMB.port} - - - linux,solaris,macosx - + + + ${cifs.enabled} + + + ${cifs.serverName} + + + ${cifs.domain} + + + Alfresco CIFS Server + + + + ${cifs.broadcast} + + + + ${cifs.bindto} + + + + + + + ${cifs.tcpipSMB.port} + + + linux,solaris,macosx + + + ${cifs.ipv6.enabled} + + + + + + + ${cifs.bindto} + + + ${cifs.netBIOSSMB.sessionPort} + + + ${cifs.netBIOSSMB.namePort} + + + ${cifs.netBIOSSMB.datagramPort} + + + linux,solaris,macosx + + + + + + ${cifs.hostannounce} + + + 5 + + + + + + + + ${cifs.hostannounce} + + + 5 + + + + + + + + + + ${cifs.disableNIO} + + + + + + ${cifs.disableNativeCode} + + + + + + + ${cifs.sessionTimeout} + + + + + + + ${cifs.WINS.autoDetectEnabled} + + + ${cifs.WINS.primary} + + + ${cifs.WINS.secondary} + + + + + + + + + + ${ftp.enabled} + + + + ${ftp.port} + + + + + + + + + + + + + + + + ${nfs.enabled} + + + + + + + + + + ${alfresco_user_store.adminusername} + + + 0 + + + 0 + + + + + + + + + + + + + + + ${filesystem.name} + + + ${spaces.store} + + + /${spaces.company_home.childname} + + + + __Alfresco.url + + + ${cifs.urlfile.prefix} + + + + true + + + + + + + + + + + + + + + alfresco/desktop/Alfresco.exe + + + ${cifs.urlfile.prefix} + + + + + + + + CheckInOut + + + __CheckInOut.exe + + + + + JavaScriptURL + + + __ShowDetails.exe + + + alfresco/desktop/showDetails.js + + + anyFiles + + + copyToTarget + + + + + + + + + - - - - - ${cifs.bindto} - - - ${cifs.netBIOSSMB.sessionPort} - - - ${cifs.netBIOSSMB.namePort} - - - ${cifs.netBIOSSMB.datagramPort} - - - linux,solaris,macosx - + + + + + AVM + + + true + + + site,staging,author + - + + + - - true - - - 5 - - - - - - - - true - - - 5 - - - - - - - - - - - ${cifs.WINS.autoDetectEnabled} - - - ${cifs.WINS.primary} - - - ${cifs.WINS.secondary} - + + + + - - Negotiate,Socket - - + + - - - ${ftp.enabled} - - - - ${ftp.port} - - - - - - - - - - - - - - ${nfs.enabled} - - - - - - - - - - ${filesystem.name} - - - workspace://SpacesStore - - - /app:company_home - - - - __AlfrescoClient.url - - - http://${localname}:8080/alfresco/ - - - - true - - - - - - - - - - - - - - - - - - - AVM - - - true - - - site,staging,author - - - - - - - - - + + + - + + + 192.168.1.2 + + + 255.255.255.0 + + + Write + + + + + --> + \ No newline at end of file diff --git a/config/alfresco/subsystems/fileServers/file-servers.properties b/config/alfresco/subsystems/fileServers/file-servers.properties index 02e6030a82..53d8a60601 100644 --- a/config/alfresco/subsystems/fileServers/file-servers.properties +++ b/config/alfresco/subsystems/fileServers/file-servers.properties @@ -6,6 +6,16 @@ cifs.domain= cifs.broadcast=255.255.255.255 # An empty value indicates bind to all available network adapters cifs.bindto= +cifs.ipv6.enabled=false +cifs.hostannounce=true +# Enable the use of asynchronous sockets/NIO code +cifs.disableNIO=false +# Disable the use of JNI code. Only currently affects Windows +cifs.disableNativeCode=false +# Session timeout, in seconds. Defaults to 15 minutes, to match the default Windows client setting. +# If no I/O is received within that time the session is closed by the server +cifs.sessionTimeout=900 + # Can be mapped to non-privileged ports, then use firewall rules to forward requests from the standard ports cifs.tcpipSMB.port=445 cifs.netBIOSSMB.sessionPort=139 @@ -21,3 +31,5 @@ ftp.enabled=true ftp.port=21 nfs.enabled=false + +cifs.urlfile.prefix=http://${localname}:8080/alfresco/ diff --git a/config/alfresco/subsystems/ldapAuthentication/ldap-authentication-context.xml b/config/alfresco/subsystems/ldapAuthentication/ldap-authentication-context.xml index 2438344fb0..5840f2dd77 100644 --- a/config/alfresco/subsystems/ldapAuthentication/ldap-authentication-context.xml +++ b/config/alfresco/subsystems/ldapAuthentication/ldap-authentication-context.xml @@ -136,6 +136,9 @@ ${ldap.passthru.authentication.protocolOrder} + + true + diff --git a/config/alfresco/subsystems/passthruAuthentication/passthru-authentication-context.xml b/config/alfresco/subsystems/passthruAuthentication/passthru-authentication-context.xml index 9ea8c40caf..37dd17aff8 100644 --- a/config/alfresco/subsystems/passthruAuthentication/passthru-authentication-context.xml +++ b/config/alfresco/subsystems/passthruAuthentication/passthru-authentication-context.xml @@ -39,6 +39,9 @@ ${passthru.authentication.protocolOrder} + + true + diff --git a/source/java/org/alfresco/filesys/alfresco/AlfrescoContext.java b/source/java/org/alfresco/filesys/alfresco/AlfrescoContext.java index 5390f21635..4b0efcaa15 100644 --- a/source/java/org/alfresco/filesys/alfresco/AlfrescoContext.java +++ b/source/java/org/alfresco/filesys/alfresco/AlfrescoContext.java @@ -37,7 +37,6 @@ import org.alfresco.jlan.server.filesys.DiskInterface; import org.alfresco.jlan.server.filesys.FileSystem; import org.alfresco.jlan.server.filesys.SrvDiskInfo; import org.alfresco.jlan.server.filesys.pseudo.PseudoFileInterface; -import org.springframework.beans.factory.InitializingBean; /** @@ -47,7 +46,7 @@ import org.springframework.beans.factory.InitializingBean; * * @author GKSpencer */ -public abstract class AlfrescoContext extends DiskDeviceContext implements InitializingBean +public abstract class AlfrescoContext extends DiskDeviceContext { // Token name to substitute current servers DNS name or TCP/IP address into the webapp URL @@ -71,6 +70,7 @@ public abstract class AlfrescoContext extends DiskDeviceContext implements Initi private GlobalDesktopActionConfigBean m_globalDesktopActionConfig = new GlobalDesktopActionConfigBean(); private DesktopActionTable m_desktopActions; + private List m_desktopActionsToInitialize; // I/O control handler @@ -94,10 +94,29 @@ public abstract class AlfrescoContext extends DiskDeviceContext implements Initi enableChangeHandler(!disableChangeNotification); } - public void afterPropertiesSet() - { + /** + * Complete initialization by registering with a disk driver + */ + public void initialize(AlfrescoDiskDriver filesysDriver) + { + if (m_desktopActionsToInitialize != null) + { + for (DesktopAction desktopAction : m_desktopActionsToInitialize) + { + // Initialize the desktop action + try + { + desktopAction.initializeAction(filesysDriver, this); + } + catch (DesktopActionException ex) + { + throw new AlfrescoRuntimeException("Failed to initialize desktop action", ex); + } + addDesktopAction(desktopAction); + } + } } - + /** * Return the filesystem type, either FileSystem.TypeFAT or FileSystem.TypeNTFS. * @@ -400,19 +419,12 @@ public abstract class AlfrescoContext extends DiskDeviceContext implements Initi * * @param desktopActions DesktopAction List */ - public final void setDesktopActions(List desktopActions) + public final void setDesktopActionList(List desktopActions) { - // Enumerate the desktop actions and add to this filesystem - - for (DesktopAction desktopAction : desktopActions) - { - addDesktopAction(desktopAction); - } - - // Note it is assumed that a AlfrescoDiskDriver.register() call will initialise the I/O control handler + m_desktopActionsToInitialize = desktopActions; } - protected void setGlobalDesktopActionConfig(GlobalDesktopActionConfigBean desktopActionConfig) + public void setGlobalDesktopActionConfig(GlobalDesktopActionConfigBean desktopActionConfig) { m_globalDesktopActionConfig = desktopActionConfig; } @@ -422,6 +434,8 @@ public abstract class AlfrescoContext extends DiskDeviceContext implements Initi { return m_globalDesktopActionConfig; } + + /** diff --git a/source/java/org/alfresco/filesys/alfresco/AlfrescoDiskDriver.java b/source/java/org/alfresco/filesys/alfresco/AlfrescoDiskDriver.java index 19810bdb1b..28396f8b4f 100644 --- a/source/java/org/alfresco/filesys/alfresco/AlfrescoDiskDriver.java +++ b/source/java/org/alfresco/filesys/alfresco/AlfrescoDiskDriver.java @@ -29,6 +29,8 @@ import javax.transaction.UserTransaction; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.filesys.state.FileStateReaper; import org.alfresco.jlan.server.SrvSession; +import org.alfresco.jlan.server.core.DeviceContext; +import org.alfresco.jlan.server.core.DeviceContextException; import org.alfresco.jlan.server.filesys.IOControlNotImplementedException; import org.alfresco.jlan.server.filesys.IOCtlInterface; import org.alfresco.jlan.server.filesys.NetworkFile; @@ -346,4 +348,20 @@ public abstract class AlfrescoDiskDriver implements IOCtlInterface, Transactiona sess.setTransaction( this); } + + /** + * Registers a device context object for this instance + * of the shared device. The same DeviceInterface implementation may be used for multiple + * shares. In this base class, we initialize all desktop actions. + * + * @param ctx the context + * @exception DeviceContextException + */ + public void registerContext(DeviceContext ctx) throws DeviceContextException + { + if (ctx instanceof AlfrescoContext) + { + ((AlfrescoContext) ctx).initialize(this); + } + } } diff --git a/source/java/org/alfresco/filesys/alfresco/DesktopAction.java b/source/java/org/alfresco/filesys/alfresco/DesktopAction.java index b8ab347a80..2a6754e041 100644 --- a/source/java/org/alfresco/filesys/alfresco/DesktopAction.java +++ b/source/java/org/alfresco/filesys/alfresco/DesktopAction.java @@ -30,21 +30,20 @@ import java.net.InetAddress; import java.net.URL; import java.net.URLDecoder; +import org.alfresco.config.ConfigElement; import org.alfresco.jlan.server.filesys.DiskSharedDevice; import org.alfresco.jlan.server.filesys.pseudo.LocalPseudoFile; import org.alfresco.jlan.server.filesys.pseudo.PseudoFile; -import org.alfresco.config.ConfigElement; import org.alfresco.service.ServiceRegistry; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.InitializingBean; /** * Desktop Action Class * * @author gkspencer */ -public abstract class DesktopAction implements InitializingBean{ +public abstract class DesktopAction { // Logging @@ -118,7 +117,6 @@ public abstract class DesktopAction implements InitializingBean{ // Filesystem driver and context - private DiskSharedDevice m_diskSharedDevice; private AlfrescoDiskDriver m_filesysDriver; private AlfrescoContext m_filesysContext; @@ -312,13 +310,14 @@ public abstract class DesktopAction implements InitializingBean{ public void initializeAction(ConfigElement global, ConfigElement config, DiskSharedDevice fileSys) throws DesktopActionException { + if ( !(fileSys.getContext() instanceof AlfrescoContext)) + throw new DesktopActionException("Desktop action requires an Alfresco filesystem driver"); // Perform standard initialization standardInitialize(global, config, fileSys); // Complete initialization - - afterPropertiesSet(); + initializeAction((AlfrescoDiskDriver) fileSys.getDiskInterface(), (AlfrescoContext) fileSys.getDiskContext()); } /** @@ -332,8 +331,6 @@ public abstract class DesktopAction implements InitializingBean{ public void standardInitialize(ConfigElement global, ConfigElement config, DiskSharedDevice fileSys) throws DesktopActionException { - setDiskSharedDevice(fileSys); - // Check for standard config values ConfigElement elem = config.getChild("name"); if ( elem != null && elem.getValue().length() > 0) @@ -380,20 +377,17 @@ public abstract class DesktopAction implements InitializingBean{ } - public void afterPropertiesSet() throws DesktopActionException + /** + * Initialize the desktop action + * + * @exception DesktopActionException + */ + public void initializeAction(AlfrescoDiskDriver filesysDriver, AlfrescoContext filesysContext) throws DesktopActionException { - if (m_diskSharedDevice == null) - throw new DesktopActionException("Desktop action requires an Alfresco filesystem driver"); - // Save the filesystem device and I/O handler - if ( m_diskSharedDevice.getContext() instanceof AlfrescoContext) - { - m_filesysDriver = (AlfrescoDiskDriver) m_diskSharedDevice.getDiskInterface(); - m_filesysContext = (AlfrescoContext) m_diskSharedDevice.getDiskContext(); - } - else - throw new DesktopActionException("Desktop action requires an Alfresco filesystem driver"); + m_filesysDriver = filesysDriver; + m_filesysContext = filesysContext; // Check for standard config values @@ -602,15 +596,6 @@ public abstract class DesktopAction implements InitializingBean{ m_debug = ena; } - /** - * Sets the disk shared device. - * @param diskSharedDevice - */ - public void setDiskSharedDevice(DiskSharedDevice diskSharedDevice) - { - m_diskSharedDevice = diskSharedDevice; - } - /** * Set the webapp URL * @@ -663,4 +648,5 @@ public abstract class DesktopAction implements InitializingBean{ return str.toString(); } + } diff --git a/source/java/org/alfresco/filesys/auth/PassthruServerFactory.java b/source/java/org/alfresco/filesys/auth/PassthruServerFactory.java index 411b6500b1..07377320f8 100644 --- a/source/java/org/alfresco/filesys/auth/PassthruServerFactory.java +++ b/source/java/org/alfresco/filesys/auth/PassthruServerFactory.java @@ -68,6 +68,8 @@ public class PassthruServerFactory implements FactoryBean, InitializingBean, Dis private Integer offlineCheckInterval; private PassthruServers passthruServers; + + private boolean nullDomainUseAnyServer; /** * Sets the timeout for opening a session to an authentication server @@ -123,6 +125,17 @@ public class PassthruServerFactory implements FactoryBean, InitializingBean, Dis { this.offlineCheckInterval = offlineCheckInterval; } + + /** + * Set the null domain to use any available server option + * + * @param nullDomain boolean + */ + public final void setNullDomainUseAnyServer( boolean nullDomain) + { + this.nullDomainUseAnyServer = nullDomain; + } + /** * Set the protocol order for passthru connections @@ -233,6 +246,8 @@ public class PassthruServerFactory implements FactoryBean, InitializingBean, Dis passthruServers.setConnectionTimeout(this.timeout); } + + passthruServers.setNullDomainUseAnyServer(this.nullDomainUseAnyServer); // Check if a server name has been specified diff --git a/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java b/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java index 1de1ef6e83..362a7d607e 100644 --- a/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java +++ b/source/java/org/alfresco/filesys/auth/nfs/AlfrescoRpcAuthenticator.java @@ -479,40 +479,33 @@ public class AlfrescoRpcAuthenticator implements RpcAuthenticator, InitializingB for ( UserMapping userElem : this.userMappings) { - // Validate the element type + // Get the user name, user id and group id - if ( userElem.getName().equalsIgnoreCase( "user")) + String userName = userElem.getName(); + + if ( userName == null || userName.length() == 0) + throw new InvalidConfigurationException("Empty user name, or name not specified"); + + // Check if the mapping already exists + + Integer idKey = new Integer(( userElem.getGid() << 16) + userElem.getUid()); + if ( m_idMap.containsKey( idKey) == false) { - // Get the user name, user id and group id + // Add the username uid/gid mapping - String userName = userElem.getName(); + m_idMap.put( idKey, userName); - if ( userName == null || userName.length() == 0) - throw new InvalidConfigurationException("Empty user name, or name not specified"); + // DEBUG - // Check if the mapping already exists - - Integer idKey = new Integer(( userElem.getGid() << 16) + userElem.getUid()); - if ( m_idMap.containsKey( idKey) == false) - { - // Add the username uid/gid mapping - - m_idMap.put( idKey, userName); - - // DEBUG - - if ( logger.isDebugEnabled()) - logger.debug("Added RPC user mapping for user " + userName + " uid=" + userElem.getUid() + ", gid=" + userElem.getGid()); - } - else if ( logger.isDebugEnabled()) - { - // DEBUG - - logger.debug("Ignored duplicate mapping for uid=" + userElem.getUid() + ", gid=" + userElem.getGid()); - } + if ( logger.isDebugEnabled()) + logger.debug("Added RPC user mapping for user " + userName + " uid=" + userElem.getUid() + ", gid=" + userElem.getGid()); + } + else if ( logger.isDebugEnabled()) + { + // DEBUG + + logger.debug("Ignored duplicate mapping for uid=" + userElem.getUid() + ", gid=" + userElem.getGid()); } - else - throw new InvalidConfigurationException( "Invalid user mapping, " + userElem.getName()); } } diff --git a/source/java/org/alfresco/filesys/avm/AVMContext.java b/source/java/org/alfresco/filesys/avm/AVMContext.java index 4ff2854fe9..25d8902bba 100644 --- a/source/java/org/alfresco/filesys/avm/AVMContext.java +++ b/source/java/org/alfresco/filesys/avm/AVMContext.java @@ -29,6 +29,7 @@ import java.util.StringTokenizer; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.filesys.alfresco.AlfrescoContext; +import org.alfresco.filesys.alfresco.AlfrescoDiskDriver; import org.alfresco.filesys.alfresco.IOControlHandler; import org.alfresco.filesys.state.FileState; import org.alfresco.filesys.state.FileStateTable; @@ -126,8 +127,6 @@ public class AVMContext extends AlfrescoContext // Set the store version to use setVersion(version); - - afterPropertiesSet(); } /** @@ -146,8 +145,6 @@ public class AVMContext extends AlfrescoContext // Enable the virtualization view setVirtualView(true); setShowOptions(showOptions); - - afterPropertiesSet(); } public void setStorePath(String path) @@ -213,10 +210,10 @@ public class AVMContext extends AlfrescoContext m_createStore = createStore; } + @Override - public void afterPropertiesSet() + public void initialize(AlfrescoDiskDriver filesysDriver) { - if (m_virtualView) { // A context for a view onto all stores/versions within AVM. @@ -241,7 +238,7 @@ public class AVMContext extends AlfrescoContext setShareName(m_storePath + "(" + m_version + ")"); } - super.afterPropertiesSet(); + super.initialize(filesysDriver); } /** diff --git a/source/java/org/alfresco/filesys/avm/AVMDiskDriver.java b/source/java/org/alfresco/filesys/avm/AVMDiskDriver.java index f83be0f7f6..75449bc3ce 100644 --- a/source/java/org/alfresco/filesys/avm/AVMDiskDriver.java +++ b/source/java/org/alfresco/filesys/avm/AVMDiskDriver.java @@ -426,9 +426,12 @@ public class AVMDiskDriver extends AlfrescoDiskDriver implements DiskInterface * @param context the device context * @exception DeviceContextException */ + @Override public void registerContext(DeviceContext ctx) throws DeviceContextException { + super.registerContext(ctx); + AVMContext context = (AVMContext)ctx; // Use the system user as the authenticated context for the filesystem initialization @@ -625,7 +628,6 @@ public class AVMDiskDriver extends AlfrescoDiskDriver implements DiskInterface { AuthenticationUtil.popAuthentication(); } - } /** diff --git a/source/java/org/alfresco/filesys/config/CIFSConfigBean.java b/source/java/org/alfresco/filesys/config/CIFSConfigBean.java index f8826ecdd0..da24003cf7 100644 --- a/source/java/org/alfresco/filesys/config/CIFSConfigBean.java +++ b/source/java/org/alfresco/filesys/config/CIFSConfigBean.java @@ -499,7 +499,7 @@ public class CIFSConfigBean * * @return the session timeout */ - protected Integer getSessionTimeout() + public Integer getSessionTimeout() { return sessionTimeout; } @@ -510,7 +510,7 @@ public class CIFSConfigBean * @param sessionTimeout * the new session timeout */ - protected void setSessionTimeout(Integer sessionTimeout) + public void setSessionTimeout(Integer sessionTimeout) { this.sessionTimeout = sessionTimeout; } diff --git a/source/java/org/alfresco/filesys/repo/ContentContext.java b/source/java/org/alfresco/filesys/repo/ContentContext.java index 7230004971..6b84bc4f36 100644 --- a/source/java/org/alfresco/filesys/repo/ContentContext.java +++ b/source/java/org/alfresco/filesys/repo/ContentContext.java @@ -28,6 +28,7 @@ import java.util.List; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.filesys.alfresco.AlfrescoContext; +import org.alfresco.filesys.alfresco.AlfrescoDiskDriver; import org.alfresco.filesys.alfresco.IOControlHandler; import org.alfresco.jlan.server.auth.acl.AccessControl; import org.alfresco.jlan.server.core.DeviceContextException; @@ -100,8 +101,6 @@ public class ContentContext extends AlfrescoContext setStoreName(storeName); setRootPath(rootPath); setRootNodeRef(rootNodeRef); - - afterPropertiesSet(); } public void setStoreName(String name) @@ -148,9 +147,9 @@ public class ContentContext extends AlfrescoContext @Override - public void afterPropertiesSet() + public void initialize(AlfrescoDiskDriver filesysDriver) { - super.afterPropertiesSet(); + super.initialize(filesysDriver); if (m_storeName == null || m_storeName.length() == 0) { diff --git a/source/java/org/alfresco/filesys/repo/ContentDiskDriver.java b/source/java/org/alfresco/filesys/repo/ContentDiskDriver.java index 5b1963a9df..0528532da4 100644 --- a/source/java/org/alfresco/filesys/repo/ContentDiskDriver.java +++ b/source/java/org/alfresco/filesys/repo/ContentDiskDriver.java @@ -426,8 +426,6 @@ public class ContentDiskDriver extends AlfrescoDiskDriver implements DiskInterfa context.setDisableNodeMonitor(true); } - context.afterPropertiesSet(); - registerContext(context); // Return the context for this shared filesystem @@ -444,8 +442,11 @@ public class ContentDiskDriver extends AlfrescoDiskDriver implements DiskInterfa * @param ctx the context * @exception DeviceContextException */ + @Override public void registerContext(DeviceContext ctx) throws DeviceContextException { + super.registerContext(ctx); + ContentContext context = (ContentContext)ctx; // Wrap the initialization in a transaction diff --git a/source/java/org/alfresco/filesys/repo/desk/JavaScriptDesktopAction.java b/source/java/org/alfresco/filesys/repo/desk/JavaScriptDesktopAction.java index 0874e7d304..1abaa90439 100644 --- a/source/java/org/alfresco/filesys/repo/desk/JavaScriptDesktopAction.java +++ b/source/java/org/alfresco/filesys/repo/desk/JavaScriptDesktopAction.java @@ -35,6 +35,8 @@ import java.util.Map; import java.util.StringTokenizer; import org.alfresco.config.ConfigElement; +import org.alfresco.filesys.alfresco.AlfrescoContext; +import org.alfresco.filesys.alfresco.AlfrescoDiskDriver; import org.alfresco.filesys.alfresco.DesktopAction; import org.alfresco.filesys.alfresco.DesktopActionException; import org.alfresco.filesys.alfresco.DesktopParams; @@ -42,7 +44,6 @@ import org.alfresco.filesys.alfresco.DesktopResponse; import org.alfresco.jlan.server.filesys.DiskSharedDevice; import org.alfresco.scripts.ScriptException; import org.alfresco.service.cmr.repository.ScriptService; -import org.alfresco.service.transaction.TransactionService; /** * Javascript Desktop Action Class @@ -126,7 +127,7 @@ public class JavaScriptDesktopAction extends DesktopAction { throw new DesktopActionException("Empty desktop action attributes"); // Parse the attribute string - setAttributes(elem.getValue()); + setAttributeList(elem.getValue()); } // Check if the desktop action pre-processing options have been specified @@ -134,16 +135,17 @@ public class JavaScriptDesktopAction extends DesktopAction { elem = config.getChild("preprocess"); if ( elem != null) { - setPreProcessActions(elem.getValue()); + setPreprocess(elem.getValue()); } } @Override - public void afterPropertiesSet() throws DesktopActionException + public void initializeAction(AlfrescoDiskDriver filesysDriver, AlfrescoContext filesysContext) + throws DesktopActionException { // Perform standard initialization - - super.afterPropertiesSet(); + + super.initializeAction(filesysDriver, filesysContext); // Get the script file name and check that it exists @@ -368,7 +370,7 @@ public class JavaScriptDesktopAction extends DesktopAction { * * @param name String */ - protected final void setScriptName(String name) + public final void setScriptName(String name) { m_scriptName = name; } @@ -379,7 +381,7 @@ public class JavaScriptDesktopAction extends DesktopAction { * @param attributes String * @throws DesktopActionException */ - protected void setAttributes(String attributes) throws DesktopActionException + public void setAttributeList(String attributes) throws DesktopActionException { // Check if the attribute string is empty if ( attributes == null || attributes.length() == 0) @@ -431,7 +433,7 @@ public class JavaScriptDesktopAction extends DesktopAction { * @param preProcessActions String * @throws DesktopActionException */ - protected void setPreProcessActions(String preProcessActions) throws DesktopActionException + public void setPreprocess(String preProcessActions) throws DesktopActionException { // Check if the pre-process string is empty