Merge of all UI clustering changes originally applied to 2.2

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2008-02-15 14:59:11 +00:00
parent d20d8a7007
commit a450598ecb
281 changed files with 17771 additions and 15322 deletions

View File

@@ -67,8 +67,10 @@ import org.w3c.dom.Node;
*
* @author Mike Hatfield
*/
public class ContentUpdateBean
public class ContentUpdateBean implements Serializable
{
private static final long serialVersionUID = -7209326198823950952L;
private static Log logger = LogFactory.getLog(ContentUpdateBean.class);
/**

View File

@@ -70,8 +70,10 @@ import org.w3c.dom.Node;
*
* @author Kevin Roast
*/
public class FileUploadBean
public class FileUploadBean implements Serializable
{
private static final long serialVersionUID = 4555828718375916674L;
private static Log logger = LogFactory.getLog(FileUploadBean.class);
/**

View File

@@ -51,8 +51,10 @@ import org.apache.commons.logging.LogFactory;
*
* @author Kevin Roast
*/
public class MySpacesBean
public class MySpacesBean implements Serializable
{
private static final long serialVersionUID = -5684182834188359483L;
private static Log logger = LogFactory.getLog(MySpacesBean.class);
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_HTML)

View File

@@ -25,6 +25,7 @@
package org.alfresco.web.bean.ajax;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -62,8 +63,10 @@ import org.apache.commons.logging.LogFactory;
*
* @author gavinc
*/
public class NavigatorPluginBean implements IContextListener
public class NavigatorPluginBean implements IContextListener,Serializable
{
private static final long serialVersionUID = 5837326721916936115L;
public static final String BEAN_NAME = "NavigatorPluginBean";
protected List<TreeNode> companyHomeRootNodes;
@@ -74,9 +77,9 @@ public class NavigatorPluginBean implements IContextListener
protected Map<String, TreeNode> guestHomeNodes;
protected NodeRef previouslySelectedNode;
private NodeService nodeService;
private NodeService internalNodeService;
private DictionaryService dictionaryService;
transient private NodeService nodeService;
transient private NodeService internalNodeService;
transient private DictionaryService dictionaryService;
private static final Log logger = LogFactory.getLog(NavigatorPluginBean.class);
@@ -128,7 +131,7 @@ public class NavigatorPluginBean implements IContextListener
parentNode.removeChildren();
// get all the child folder objects for the parent
List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(parentNodeRef,
List<ChildAssociationRef> childRefs = this.getNodeService().getChildAssocs(parentNodeRef,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
List<TreeNode> sortedNodes = new ArrayList<TreeNode>();
for (ChildAssociationRef ref: childRefs)
@@ -328,7 +331,7 @@ public class NavigatorPluginBean implements IContextListener
// query for the child nodes of company home
NodeRef root = new NodeRef(Repository.getStoreRef(), Application.getCompanyRootId(fc));
List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(root,
List<ChildAssociationRef> childRefs = this.getNodeService().getChildAssocs(root,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef ref: childRefs)
@@ -380,7 +383,7 @@ public class NavigatorPluginBean implements IContextListener
// query for the child nodes of the user's home
NodeRef root = new NodeRef(Repository.getStoreRef(),
Application.getCurrentUser(FacesContext.getCurrentInstance()).getHomeSpaceId());
List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(root,
List<ChildAssociationRef> childRefs = this.getNodeService().getChildAssocs(root,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef ref: childRefs)
@@ -434,7 +437,7 @@ public class NavigatorPluginBean implements IContextListener
if (navBean != null)
{
NodeRef root = navBean.getGuestHomeNode().getNodeRef();
List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(root,
List<ChildAssociationRef> childRefs = this.getNodeService().getChildAssocs(root,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef ref: childRefs)
@@ -470,6 +473,15 @@ public class NavigatorPluginBean implements IContextListener
this.nodeService = nodeService;
}
private NodeService getNodeService()
{
if (nodeService == null)
{
nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
}
return nodeService;
}
/**
* @param internalNodeService The internalNodeService to set.
*/
@@ -477,6 +489,17 @@ public class NavigatorPluginBean implements IContextListener
{
this.internalNodeService = internalNodeService;
}
/**
* @return the internalNodeService
*/
private NodeService getInternalNodeService()
{
if (this.internalNodeService == null) {
this.internalNodeService = (NodeService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "nodeService");
}
return this.internalNodeService;
}
/**
* @param dictionaryService The DictionaryService to set.
@@ -486,6 +509,15 @@ public class NavigatorPluginBean implements IContextListener
this.dictionaryService = dictionaryService;
}
private DictionaryService getDictionaryService()
{
if (dictionaryService == null)
{
dictionaryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getDictionaryService();
}
return dictionaryService;
}
// ------------------------------------------------------------------------------
// Helper methods
@@ -630,19 +662,19 @@ public class NavigatorPluginBean implements IContextListener
{
boolean addable = false;
if (this.nodeService.exists(nodeRef))
if (this.getNodeService().exists(nodeRef))
{
// find it's type so we can see if it's a node we are interested in
QName type = this.nodeService.getType(nodeRef);
QName type = this.getNodeService().getType(nodeRef);
// make sure the type is defined in the data dictionary
TypeDefinition typeDef = this.dictionaryService.getType(type);
TypeDefinition typeDef = this.getDictionaryService().getType(type);
if (typeDef != null)
{
// look for folder node types
if (this.dictionaryService.isSubClass(type, ContentModel.TYPE_FOLDER) == true &&
this.dictionaryService.isSubClass(type, ContentModel.TYPE_SYSTEM_FOLDER) == false)
if (this.getDictionaryService().isSubClass(type, ContentModel.TYPE_FOLDER) == true &&
this.getDictionaryService().isSubClass(type, ContentModel.TYPE_SYSTEM_FOLDER) == false)
{
addable = true;
}
@@ -660,8 +692,8 @@ public class NavigatorPluginBean implements IContextListener
protected TreeNode createTreeNode(NodeRef nodeRef)
{
TreeNode node = new TreeNode(nodeRef.toString(),
Repository.getNameForNode(this.internalNodeService, nodeRef),
(String)this.internalNodeService.getProperty(nodeRef, ApplicationModel.PROP_ICON));
Repository.getNameForNode(this.getInternalNodeService(), nodeRef),
(String)this.getInternalNodeService().getProperty(nodeRef, ApplicationModel.PROP_ICON));
return node;
}

View File

@@ -25,6 +25,8 @@
package org.alfresco.web.bean.ajax;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -50,9 +52,11 @@ import org.apache.commons.logging.LogFactory;
*
* @author gavinc
*/
public class NodeInfoBean
public class NodeInfoBean implements Serializable
{
private NodeService nodeService;
private static final long serialVersionUID = 137294178658919187L;
transient private NodeService nodeService;
private static final Log logger = LogFactory.getLog(NodeInfoBean.class);
@@ -80,7 +84,7 @@ public class NodeInfoBean
if (strNodeRef != null && strNodeRef.length() != 0)
{
nodeRef = new NodeRef(strNodeRef);
if (this.nodeService.exists(nodeRef) == false)
if (this.getNodeService().exists(nodeRef) == false)
{
out.write("<span class='errorMessage'>Node could not be found in the repository!</span>");
return;
@@ -102,6 +106,15 @@ public class NodeInfoBean
this.nodeService = nodeService;
}
private NodeService getNodeService()
{
if (nodeService == null)
{
nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
}
return nodeService;
}
// ------------------------------------------------------------------------------
// Helper methods
@@ -143,4 +156,5 @@ public class NodeInfoBean
return Utils.getFileTypeImage(FacesContext.getCurrentInstance(), filename, size);
}
};
}

View File

@@ -27,26 +27,17 @@ package org.alfresco.web.bean.ajax;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.version.VersionModel;
import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionType;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.servlet.BaseServlet;
import org.alfresco.web.app.servlet.ajax.InvokeCommand;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.spaces.CreateSpaceWizard;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -55,8 +46,10 @@ import org.apache.commons.logging.LogFactory;
*
* @author Mike Hatfield
*/
public class PortletActionsBean
public class PortletActionsBean implements Serializable
{
private static final long serialVersionUID = -8230154592621310289L;
private static Log logger = LogFactory.getLog(PortletActionsBean.class);
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_HTML)

View File

@@ -25,6 +25,8 @@
package org.alfresco.web.bean.ajax;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -46,9 +48,11 @@ import org.alfresco.web.ui.common.Utils;
*
* @author Kevin Roast
*/
public class TaskInfoBean
public class TaskInfoBean implements Serializable
{
private WorkflowService workflowService;
private static final long serialVersionUID = -6627537519541525897L;
transient private WorkflowService workflowService;
/**
* Returns information for the workflow task identified by the 'taskId'
@@ -67,7 +71,7 @@ public class TaskInfoBean
throw new IllegalArgumentException("'taskId' parameter is missing");
}
WorkflowTask task = this.workflowService.getTaskById(taskId);
WorkflowTask task = this.getWorkflowService().getTaskById(taskId);
if (task != null)
{
Repository.getServiceRegistry(context).getTemplateService().processTemplate(
@@ -120,6 +124,15 @@ public class TaskInfoBean
this.workflowService = workflowService;
}
private WorkflowService getWorkflowService()
{
if (workflowService == null)
{
workflowService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getWorkflowService();
}
return workflowService;
}
// ------------------------------------------------------------------------------
// Helper methods