Fixed NullPointerException on navigation to company home

- NavigationBean was trying to access the CIFSServer directly. Now goes through the ServerConfigurationAccessor interface exported by the fileServers subsystem.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13847 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-04-06 11:46:17 +00:00
parent 0128ded2e1
commit 7d62731277
2 changed files with 14 additions and 14 deletions

View File

@@ -36,9 +36,9 @@ import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent; import javax.faces.event.ActionEvent;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.filesys.CIFSServerBean;
import org.alfresco.filesys.repo.ContentContext; import org.alfresco.filesys.repo.ContentContext;
import org.alfresco.filesys.repo.ContentDiskInterface; import org.alfresco.filesys.repo.ContentDiskInterface;
import org.alfresco.jlan.server.config.ServerConfigurationAccessor;
import org.alfresco.jlan.server.core.SharedDevice; import org.alfresco.jlan.server.core.SharedDevice;
import org.alfresco.jlan.server.core.SharedDeviceList; import org.alfresco.jlan.server.core.SharedDeviceList;
import org.alfresco.jlan.server.filesys.DiskSharedDevice; import org.alfresco.jlan.server.filesys.DiskSharedDevice;
@@ -168,18 +168,18 @@ public class NavigationBean implements Serializable
} }
/** /**
* @param cifsServer The cifsServer to set. * @param serverConfiguration The serverConfiguration to set.
*/ */
public void setCifsServer(CIFSServerBean cifsServer) public void setServerConfiguration(ServerConfigurationAccessor serverConfiguration)
{ {
this.cifsServer = cifsServer; this.serverConfiguration = serverConfiguration;
} }
protected CIFSServerBean getCifsServer() protected ServerConfigurationAccessor getServerConfiguration()
{ {
if (cifsServer == null) if (serverConfiguration == null)
this.cifsServer = (CIFSServerBean) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "cifsServer"); this.serverConfiguration = (ServerConfigurationAccessor) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "fileServerConfiguration");
return cifsServer; return serverConfiguration;
} }
/** /**
@@ -699,7 +699,7 @@ public class NavigationBean implements Serializable
Path path = node.getNodePath(); Path path = node.getNodePath();
// resolve CIFS network folder location for this node // resolve CIFS network folder location for this node
FilesystemsConfigSection filesysConfig = (FilesystemsConfigSection)getCifsServer().getConfiguration().getConfigSection(FilesystemsConfigSection.SectionName); FilesystemsConfigSection filesysConfig = (FilesystemsConfigSection)getServerConfiguration().getConfigSection(FilesystemsConfigSection.SectionName);
DiskSharedDevice diskShare = null; DiskSharedDevice diskShare = null;
SharedDeviceList shares = filesysConfig.getShares(); SharedDeviceList shares = filesysConfig.getShares();
@@ -963,7 +963,7 @@ public class NavigationBean implements Serializable
{ {
StringBuilder buf = new StringBuilder(32); StringBuilder buf = new StringBuilder(32);
String serverName = this.getCifsServer().getConfiguration().getServerName(); String serverName = this.getServerConfiguration().getServerName();
if (serverName != null && serverName.length() != 0) if (serverName != null && serverName.length() != 0)
{ {
buf.append("\\\\"); buf.append("\\\\");
@@ -1134,8 +1134,8 @@ public class NavigationBean implements Serializable
/** RuleService bean reference*/ /** RuleService bean reference*/
transient private RuleService ruleService; transient private RuleService ruleService;
/** CIFSServer bean reference */ /** File server configuration reference */
transient private CIFSServerBean cifsServer; transient private ServerConfigurationAccessor serverConfiguration;
/** CIFS content disk driver bean reference */ /** CIFS content disk driver bean reference */
protected ContentDiskInterface contentDiskDriver; protected ContentDiskInterface contentDiskDriver;

View File

@@ -280,8 +280,8 @@
<value>#{NamespaceService}</value> <value>#{NamespaceService}</value>
</managed-property> </managed-property>
<managed-property> <managed-property>
<property-name>cifsServer</property-name> <property-name>serverConfiguration</property-name>
<value>#{cifsServer}</value> <value>#{fileServerConfiguration}</value>
</managed-property> </managed-property>
<managed-property> <managed-property>
<property-name>ruleService</property-name> <property-name>ruleService</property-name>