As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<bean id="webscript.bla.fileStates.get" class="bla.FileStatesList" parent="webscript"> <property name="cifsServerBean" ref="cifsServer" /> </bean>
<bean id="fileServerConfiguration" parent="fileServerConfigurationBase" factory-bean="fileServerConfigurationFactory" factory-method="createFileServerConfiguration">
public ServerConfigurationBean createFileServerConfiguration() { return new ServerConfigurationBean(); }
import org.alfresco.repo.management.subsystems.ChildApplicationContextFactory; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.extensions.webscripts.AbstractWebScript; import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptResponse; import org.alfresco.filesys.CIFSServerBean; import org.alfresco.jlan.server.config.ServerConfiguration; public class FileServerStatusWebScript extends AbstractWebScript implements ApplicationContextAware{ private ApplicationContext applicationContext; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException { ChildApplicationContextFactory subsystem = (ChildApplicationContextFactory)applicationContext.getBean("fileServers"); CIFSServerBean cifsServer = (CIFSServerBean) subsystem.getApplicationContext().getBean("cifsServer");//get cifs server bean ServerConfiguration sc = cifsServer.getConfiguration(); //get configuration // do what you want to do } }