mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2026-09-16 18:13:21 +00:00
Merged DEV/UI-CLUSTERING2 to HEAD
8348: UI cluster support git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8358 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,12 +26,6 @@ package org.alfresco.web.bean;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.service.descriptor.DescriptorService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
@@ -95,6 +89,7 @@ public class AboutBean extends BaseDialogBean
|
||||
|
||||
DescriptorService getDescriptorService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if (descriptorService == null)
|
||||
{
|
||||
descriptorService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getDescriptorService();
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -1949,7 +1947,7 @@ public class BrowseBean implements IContextListener, Serializable
|
||||
else
|
||||
{
|
||||
// if the breadcrum is in "path" mode just add the given item to the end
|
||||
String name = Repository.getNameForNode(this.nodeService, ref);
|
||||
String name = Repository.getNameForNode(this.getNodeService(), ref);
|
||||
location.add(new BrowseBreadcrumbHandler(ref, name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ import org.alfresco.web.bean.search.SearchContext;
|
||||
|
||||
public class CategoryBrowserBean
|
||||
{
|
||||
public static String BEAN_NAME = "CategoryBrowserBean";
|
||||
|
||||
public static String BEAN_NAME = "CategoryBrowserBean";
|
||||
|
||||
private NodeService nodeService;
|
||||
|
||||
private NodeRef currentCategory = null;
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
package org.alfresco.web.bean;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -39,10 +37,8 @@ import javax.faces.event.ActionEvent;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.filesys.CIFSServerBean;
|
||||
import org.alfresco.filesys.ServerConfigurationBean;
|
||||
import org.alfresco.filesys.repo.ContentContext;
|
||||
import org.alfresco.filesys.repo.ContentDiskInterface;
|
||||
import org.alfresco.jlan.server.config.ServerConfiguration;
|
||||
import org.alfresco.jlan.server.core.SharedDevice;
|
||||
import org.alfresco.jlan.server.core.SharedDeviceList;
|
||||
import org.alfresco.jlan.server.filesys.DiskSharedDevice;
|
||||
@@ -81,7 +77,6 @@ import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler;
|
||||
import org.alfresco.web.ui.repo.component.shelf.UIShelf;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
/**
|
||||
* Bean providing access and management of the various global navigation mechanisms
|
||||
@@ -385,7 +380,7 @@ public class NavigationBean implements Serializable
|
||||
}
|
||||
else
|
||||
{
|
||||
String homeSpaceName = Repository.getNameForNode(this.nodeService, homeSpaceRef);
|
||||
String homeSpaceName = Repository.getNameForNode(this.getNodeService(), homeSpaceRef);
|
||||
elements.add(new NavigationBreadcrumbHandler(homeSpaceRef, homeSpaceName));
|
||||
|
||||
if (s_logger.isDebugEnabled())
|
||||
|
||||
@@ -43,6 +43,8 @@ import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
|
||||
public class SpaceLinkDetailsDialog extends BaseDetailsBean implements NavigationSupport
|
||||
{
|
||||
private static final long serialVersionUID = 8372741472120796169L;
|
||||
|
||||
private static final String MSG_DETAILS_OF = "details_of";
|
||||
private static final String MSG_LOCATION = "location";
|
||||
private final static String MSG_CLOSE = "close";
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
@@ -42,9 +40,8 @@ import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.app.servlet.BaseTemplateContentServlet;
|
||||
import org.alfresco.web.app.servlet.BaseTemplateContentServlet.URLHelper;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.repo.component.template.DefaultModelHelper;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,16 +31,19 @@ import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
|
||||
public class AdminConsoleDialog extends BaseDialogBean
|
||||
{
|
||||
private static final String BUTTON_CLOSE = "close";
|
||||
private static final long serialVersionUID = -2520599525975495006L;
|
||||
|
||||
private static final String BUTTON_CLOSE = "close";
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
return outcome;
|
||||
}
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCancelButtonLabel() {
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_CLOSE);
|
||||
}
|
||||
public String getCancelButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_CLOSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
}
|
||||
else if (queryLanguage.equals("selectnodes"))
|
||||
{
|
||||
List<NodeRef> nodes = getSearchService().selectNodes(getNodeRef(), query, null, namespaceService, false);
|
||||
List<NodeRef> nodes = getSearchService().selectNodes(getNodeRef(), query, null, getNamespaceService(), false);
|
||||
searchResults = new SearchResults(nodes);
|
||||
return "search";
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
*/
|
||||
public class ShowSystemInfoDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 1328587489092603676L;
|
||||
|
||||
private static final String MSG_CURRENT_USER = "current_user";
|
||||
private static final String MSG_CLOSE = "close";
|
||||
private static final String MSG_VERSION = "version";
|
||||
|
||||
@@ -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.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -50,20 +51,19 @@ import org.alfresco.web.ui.repo.component.UITree.TreeNode;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class CategoryBrowserPluginBean
|
||||
public class CategoryBrowserPluginBean implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -1493808456969763500L;
|
||||
|
||||
public static final String BEAN_NAME = "CategoryBrowserPluginBean";
|
||||
|
||||
private static final Log logger = LogFactory.getLog(CategoryBrowserPluginBean.class);
|
||||
|
||||
private CategoryService categoryService;
|
||||
|
||||
private NodeService nodeService;
|
||||
transient private CategoryService categoryService;
|
||||
transient private NodeService nodeService;
|
||||
|
||||
private List<TreeNode> categoryRootNodes;
|
||||
|
||||
private Map<String, TreeNode> categoryNodes;
|
||||
|
||||
protected NodeRef previouslySelectedNode;
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,20 @@ public class CategoryBrowserPluginBean
|
||||
{
|
||||
this.categoryService = categoryService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the categoryService
|
||||
*/
|
||||
private CategoryService getCategoryService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if(categoryService == null)
|
||||
{
|
||||
categoryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getCategoryService();
|
||||
}
|
||||
return categoryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeService
|
||||
* the nodeService to set
|
||||
@@ -84,6 +97,19 @@ public class CategoryBrowserPluginBean
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the nodeService
|
||||
*/
|
||||
private NodeService getNodeService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if(nodeService == null)
|
||||
{
|
||||
nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
|
||||
}
|
||||
return nodeService;
|
||||
}
|
||||
|
||||
public List<TreeNode> getCategoryRootNodes()
|
||||
{
|
||||
if (this.categoryRootNodes == null)
|
||||
@@ -97,7 +123,7 @@ public class CategoryBrowserPluginBean
|
||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance(), true);
|
||||
tx.begin();
|
||||
|
||||
Collection<ChildAssociationRef> childRefs = this.categoryService.getRootCategories(
|
||||
Collection<ChildAssociationRef> childRefs = this.getCategoryService().getRootCategories(
|
||||
Repository.getStoreRef(), ContentModel.ASPECT_GEN_CLASSIFIABLE);
|
||||
|
||||
for (ChildAssociationRef ref : childRefs)
|
||||
@@ -170,7 +196,7 @@ public class CategoryBrowserPluginBean
|
||||
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_SUBCATEGORIES, RegexQNamePattern.MATCH_ALL);
|
||||
List<TreeNode> sortedNodes = new ArrayList<TreeNode>();
|
||||
for (ChildAssociationRef ref : childRefs)
|
||||
@@ -319,8 +345,8 @@ public class CategoryBrowserPluginBean
|
||||
*/
|
||||
protected TreeNode createTreeNode(NodeRef nodeRef)
|
||||
{
|
||||
TreeNode node = new TreeNode(nodeRef.toString(), Repository.getNameForNode(this.nodeService, nodeRef),
|
||||
(String) this.nodeService.getProperty(nodeRef, ApplicationModel.PROP_ICON));
|
||||
TreeNode node = new TreeNode(nodeRef.toString(), Repository.getNameForNode(this.getNodeService(), nodeRef),
|
||||
(String) this.getNodeService().getProperty(nodeRef, ApplicationModel.PROP_ICON));
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,7 @@ package org.alfresco.web.bean.ajax;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.faces.context.ExternalContext;
|
||||
import javax.faces.context.FacesContext;
|
||||
@@ -39,15 +35,10 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.content.filestore.FileContentReader;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
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.forms.XMLUtil;
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
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;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.ajax;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -49,6 +50,7 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.search.CategoryService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.DownloadContentServlet;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.app.servlet.ajax.InvokeCommand;
|
||||
import org.alfresco.web.bean.BrowseBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
@@ -61,8 +63,10 @@ import org.apache.commons.logging.LogFactory;
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class PickerBean
|
||||
public class PickerBean implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 8950457520023294902L;
|
||||
|
||||
private static final String MSG_CATEGORIES = "categories";
|
||||
private static final String ID_URL = "url";
|
||||
private static final String ID_ICON = "icon";
|
||||
@@ -80,10 +84,10 @@ public class PickerBean
|
||||
|
||||
private static Log logger = LogFactory.getLog(PickerBean.class);
|
||||
|
||||
private CategoryService categoryService;
|
||||
private NodeService nodeService;
|
||||
private NodeService internalNodeService;
|
||||
private FileFolderService fileFolderService;
|
||||
transient private CategoryService categoryService;
|
||||
transient private NodeService nodeService;
|
||||
transient private NodeService internalNodeService;
|
||||
transient private FileFolderService fileFolderService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -94,6 +98,19 @@ public class PickerBean
|
||||
this.categoryService = categoryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the categoryService
|
||||
*/
|
||||
private CategoryService getCategoryService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if(categoryService == null)
|
||||
{
|
||||
categoryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getCategoryService();
|
||||
}
|
||||
return categoryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeService The nodeService to set
|
||||
*/
|
||||
@@ -102,6 +119,19 @@ public class PickerBean
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the nodeService
|
||||
*/
|
||||
private NodeService getNodeService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if (nodeService == null)
|
||||
{
|
||||
nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
|
||||
}
|
||||
return nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param internalNodeService The internalNodeService to set.
|
||||
*/
|
||||
@@ -110,6 +140,19 @@ public class PickerBean
|
||||
this.internalNodeService = internalNodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the internalNodeService
|
||||
*/
|
||||
private NodeService getInternalNodeService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if (internalNodeService == null)
|
||||
{
|
||||
internalNodeService = (NodeService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "nodeService");
|
||||
}
|
||||
return internalNodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileFolderService the FileFolderService to set
|
||||
*/
|
||||
@@ -118,7 +161,18 @@ public class PickerBean
|
||||
this.fileFolderService = fileFolderService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the fileFolderService
|
||||
*/
|
||||
private FileFolderService getFileFolderService()
|
||||
{
|
||||
if (fileFolderService == null)
|
||||
{
|
||||
fileFolderService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getFileFolderService();
|
||||
}
|
||||
return fileFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the JSON objects representing a list of categories.
|
||||
*
|
||||
@@ -143,14 +197,14 @@ public class PickerBean
|
||||
String strParentRef = (String)params.get(PARAM_PARENT);
|
||||
if (strParentRef == null || strParentRef.length() == 0)
|
||||
{
|
||||
childRefs = this.categoryService.getRootCategories(
|
||||
childRefs = this.getCategoryService().getRootCategories(
|
||||
Repository.getStoreRef(),
|
||||
ContentModel.ASPECT_GEN_CLASSIFIABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentRef = new NodeRef(strParentRef);
|
||||
childRefs = this.categoryService.getChildren(
|
||||
childRefs = this.getCategoryService().getChildren(
|
||||
parentRef,
|
||||
CategoryService.Mode.SUB_CATEGORIES,
|
||||
CategoryService.Depth.IMMEDIATE);
|
||||
@@ -170,7 +224,7 @@ public class PickerBean
|
||||
else
|
||||
{
|
||||
out.writeValue(ID_ID, strParentRef);
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.internalNodeService, parentRef));
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.getInternalNodeService(), parentRef));
|
||||
}
|
||||
out.endObject();
|
||||
out.endValue();
|
||||
@@ -181,7 +235,7 @@ public class PickerBean
|
||||
NodeRef nodeRef = ref.getChildRef();
|
||||
out.startObject();
|
||||
out.writeValue(ID_ID, nodeRef.toString());
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.internalNodeService, nodeRef));
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.getInternalNodeService(), nodeRef));
|
||||
out.endObject();
|
||||
}
|
||||
out.endArray();
|
||||
@@ -225,14 +279,14 @@ public class PickerBean
|
||||
String strParentRef = (String)params.get(ID_PARENT);
|
||||
if (strParentRef == null || strParentRef.length() == 0)
|
||||
{
|
||||
childRefs = this.categoryService.getRootCategories(
|
||||
childRefs = this.getCategoryService().getRootCategories(
|
||||
Repository.getStoreRef(),
|
||||
ContentModel.ASPECT_TAGGABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentRef = new NodeRef(strParentRef);
|
||||
childRefs = this.categoryService.getChildren(
|
||||
childRefs = this.getCategoryService().getChildren(
|
||||
parentRef,
|
||||
CategoryService.Mode.SUB_CATEGORIES,
|
||||
CategoryService.Depth.IMMEDIATE);
|
||||
@@ -252,7 +306,7 @@ public class PickerBean
|
||||
else
|
||||
{
|
||||
out.writeValue(ID_ID, strParentRef);
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.internalNodeService, parentRef));
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.getInternalNodeService(), parentRef));
|
||||
}
|
||||
out.endObject();
|
||||
out.endValue();
|
||||
@@ -263,7 +317,7 @@ public class PickerBean
|
||||
NodeRef nodeRef = ref.getChildRef();
|
||||
out.startObject();
|
||||
out.writeValue(ID_ID, nodeRef.toString());
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.internalNodeService, nodeRef));
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.getInternalNodeService(), nodeRef));
|
||||
out.endObject();
|
||||
}
|
||||
out.endArray();
|
||||
@@ -301,7 +355,7 @@ public class PickerBean
|
||||
{
|
||||
// TODO: check permission on the parent
|
||||
NodeRef childRef = new NodeRef(strChildRef);
|
||||
parentRef = this.nodeService.getPrimaryParent(childRef).getParentRef();
|
||||
parentRef = this.getNodeService().getPrimaryParent(childRef).getParentRef();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -318,14 +372,14 @@ public class PickerBean
|
||||
}
|
||||
}
|
||||
|
||||
List<FileInfo> folders = this.fileFolderService.listFolders(parentRef);
|
||||
List<FileInfo> folders = this.getFileFolderService().listFolders(parentRef);
|
||||
|
||||
JSONWriter out = new JSONWriter(fc.getResponseWriter());
|
||||
out.startObject();
|
||||
out.startValue(ID_PARENT);
|
||||
out.startObject();
|
||||
out.writeValue(ID_ID, parentRef.toString());
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.internalNodeService, parentRef));
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.getInternalNodeService(), parentRef));
|
||||
if (parentRef.equals(companyHomeRef))
|
||||
{
|
||||
out.writeValue(ID_ISROOT, true);
|
||||
@@ -399,7 +453,7 @@ public class PickerBean
|
||||
{
|
||||
// TODO: check permission on the parent
|
||||
NodeRef childRef = new NodeRef(strChildRef);
|
||||
parentRef = this.nodeService.getPrimaryParent(childRef).getParentRef();
|
||||
parentRef = this.getNodeService().getPrimaryParent(childRef).getParentRef();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -429,14 +483,14 @@ public class PickerBean
|
||||
}
|
||||
}
|
||||
|
||||
List<FileInfo> items = this.fileFolderService.list(parentRef);
|
||||
List<FileInfo> items = this.getFileFolderService().list(parentRef);
|
||||
|
||||
JSONWriter out = new JSONWriter(fc.getResponseWriter());
|
||||
out.startObject();
|
||||
out.startValue(ID_PARENT);
|
||||
out.startObject();
|
||||
out.writeValue(ID_ID, parentRef.toString());
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.internalNodeService, parentRef));
|
||||
out.writeValue(ID_NAME, Repository.getNameForNode(this.getInternalNodeService(), parentRef));
|
||||
if (parentRef.equals(companyHomeRef))
|
||||
{
|
||||
out.writeValue(ID_ISROOT, true);
|
||||
@@ -449,7 +503,7 @@ public class PickerBean
|
||||
|
||||
for (FileInfo item : items)
|
||||
{
|
||||
if (dd.isSubClass(this.internalNodeService.getType(item.getNodeRef()), ContentModel.TYPE_FOLDER))
|
||||
if (dd.isSubClass(this.getInternalNodeService().getType(item.getNodeRef()), ContentModel.TYPE_FOLDER))
|
||||
{
|
||||
// found a folder
|
||||
out.startObject();
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
package org.alfresco.web.bean.ajax;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
@@ -47,8 +48,10 @@ import org.apache.commons.logging.LogFactory;
|
||||
*
|
||||
* @author Mike Hatfield
|
||||
*/
|
||||
public class PresenceProxyBean
|
||||
public class PresenceProxyBean implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -3041576848188629589L;
|
||||
|
||||
private static Log logger = LogFactory.getLog(PresenceProxyBean.class);
|
||||
|
||||
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_HTML)
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
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;
|
||||
@@ -100,7 +99,7 @@ public class TaskInfoBean implements Serializable
|
||||
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(
|
||||
|
||||
@@ -44,9 +44,11 @@ import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class CreateCategoryDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 1905920932992642119L;
|
||||
|
||||
private static final String DEFAULT_OUTCOME = "finish";
|
||||
|
||||
protected CategoryService categoryService;
|
||||
transient protected CategoryService categoryService;
|
||||
|
||||
/** Current category ref */
|
||||
private NodeRef categoryRef = null;
|
||||
@@ -72,9 +74,17 @@ public class CreateCategoryDialog extends BaseDialogBean
|
||||
}
|
||||
}
|
||||
|
||||
public CategoryService getCategoryService()
|
||||
/**
|
||||
* @return the categoryService
|
||||
*/
|
||||
private CategoryService getCategoryService()
|
||||
{
|
||||
return categoryService;
|
||||
//check for null in cluster environment
|
||||
if(categoryService == null)
|
||||
{
|
||||
categoryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getCategoryService();
|
||||
}
|
||||
return categoryService;
|
||||
}
|
||||
|
||||
public void setCategoryService(CategoryService categoryService)
|
||||
|
||||
@@ -56,13 +56,15 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class DeleteCategoryDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = -8929785826091612856L;
|
||||
|
||||
private static final String DEFAULT_OUTCOME = "finish";
|
||||
private final static String MSG_DELETE_CATEGORY = "delete_category";
|
||||
private final static String MSG_DELETE = "delete";
|
||||
|
||||
private static final String MSG_CATEGORIES = "categories";
|
||||
|
||||
protected CategoryService categoryService;
|
||||
transient protected CategoryService categoryService;
|
||||
|
||||
/** Dialog properties */
|
||||
private String name = null;
|
||||
@@ -151,9 +153,17 @@ public class DeleteCategoryDialog extends BaseDialogBean
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public CategoryService getCategoryService()
|
||||
/**
|
||||
* @return the categoryService
|
||||
*/
|
||||
private CategoryService getCategoryService()
|
||||
{
|
||||
return categoryService;
|
||||
//check for null in cluster environment
|
||||
if(categoryService == null)
|
||||
{
|
||||
categoryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getCategoryService();
|
||||
}
|
||||
return categoryService;
|
||||
}
|
||||
|
||||
public void setCategoryService(CategoryService categoryService)
|
||||
|
||||
@@ -54,12 +54,14 @@ import org.alfresco.web.ui.repo.component.IRepoBreadcrumbHandler;
|
||||
|
||||
public class EditCategoryDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 3316665625854694278L;
|
||||
|
||||
private static final String DEFAULT_OUTCOME = "finish";
|
||||
private final static String MSG_EDIT_CATEGORY = "edit_category";
|
||||
private final static String MSG_FINISH = "finish_button";
|
||||
private static final String MSG_CATEGORIES = "categories";
|
||||
|
||||
protected CategoryService categoryService;
|
||||
transient protected CategoryService categoryService;
|
||||
|
||||
/** Action category node */
|
||||
private Node actionCategory = null;
|
||||
@@ -129,8 +131,16 @@ public class EditCategoryDialog extends BaseDialogBean
|
||||
this.categoriesRichList = categoriesRichList;
|
||||
}
|
||||
|
||||
public CategoryService getCategoryService()
|
||||
/**
|
||||
* @return the categoryService
|
||||
*/
|
||||
private CategoryService getCategoryService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if(categoryService == null)
|
||||
{
|
||||
categoryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getCategoryService();
|
||||
}
|
||||
return categoryService;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.alfresco.web.bean.repository.Node;
|
||||
*/
|
||||
public class EditNodeCategoriesDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = -1879847736997772606L;
|
||||
|
||||
protected Node node;
|
||||
protected NodeRef addedCategory;
|
||||
protected List categories;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.clipboard;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
@@ -7,6 +7,8 @@ import org.alfresco.web.app.Application;
|
||||
public class CCCheckinFileDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -3591701539727090905L;
|
||||
|
||||
private static final String MSG_CHECK_IN = "check_in";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,6 +42,8 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class CCCheckoutFileDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = 1137163500648349730L;
|
||||
|
||||
public static final String LBL_SAVE = "save";
|
||||
public static final String LBL_CHECKOUT = "check_out";
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class CCCheckoutFileLinkDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = -4732775752517417543L;
|
||||
|
||||
public static final String MSG_CHECKOUT_OF = "check_out_of";
|
||||
public static final String LBL_UNDO_CHECKOUT = "undo_checkout";
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ import org.alfresco.web.app.Application;
|
||||
|
||||
public class CCEditFileDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = -1145049277343144264L;
|
||||
|
||||
public static final String LBL_CLOSE = "close";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,6 +30,8 @@ import org.alfresco.web.app.Application;
|
||||
|
||||
public class CCEditHtmlInlineDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = 5971155828037579931L;
|
||||
|
||||
public static final String LBL_SAVE = "save";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,6 +30,8 @@ import org.alfresco.web.app.Application;
|
||||
|
||||
public class CCEditTextInlineDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = 4657371875928010937L;
|
||||
|
||||
public static final String LBL_SAVE = "save";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,24 +25,30 @@
|
||||
package org.alfresco.web.bean.coci;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
public class CCProperties
|
||||
public class CCProperties implements Serializable
|
||||
{
|
||||
|
||||
/** The VersionOperationsService to be used by the bean */
|
||||
protected CheckOutCheckInService versionOperationsService;
|
||||
private static final long serialVersionUID = -79530354521757202L;
|
||||
|
||||
/** The VersionOperationsService to be used by the bean */
|
||||
transient protected CheckOutCheckInService versionOperationsService;
|
||||
|
||||
/** The ContentService to be used by the bean */
|
||||
protected ContentService contentService;
|
||||
transient protected ContentService contentService;
|
||||
|
||||
/** The WorkflowService to be used by the bean */
|
||||
protected WorkflowService workflowService;
|
||||
transient protected WorkflowService workflowService;
|
||||
|
||||
/** Content of the document returned from in-line editing */
|
||||
private String editorOutput;
|
||||
@@ -77,7 +83,12 @@ public class CCProperties
|
||||
*/
|
||||
public CheckOutCheckInService getVersionOperationsService()
|
||||
{
|
||||
return this.versionOperationsService;
|
||||
//check for null in cluster environment
|
||||
if (versionOperationsService == null)
|
||||
{
|
||||
versionOperationsService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getCheckOutCheckInService();
|
||||
}
|
||||
return versionOperationsService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,7 +105,12 @@ public class CCProperties
|
||||
*/
|
||||
public ContentService getContentService()
|
||||
{
|
||||
return this.contentService;
|
||||
//check for null in cluster environment
|
||||
if (contentService == null)
|
||||
{
|
||||
contentService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getContentService();
|
||||
}
|
||||
return contentService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +136,12 @@ public class CCProperties
|
||||
*/
|
||||
public WorkflowService getWorkflowService()
|
||||
{
|
||||
return this.workflowService;
|
||||
//check for null for cluster environment
|
||||
if (workflowService == null)
|
||||
{
|
||||
workflowService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getWorkflowService();
|
||||
}
|
||||
return workflowService;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,6 +35,8 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class CCUndoCheckoutFileDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = -6957120889259486975L;
|
||||
|
||||
public static final String LBL_UNDO_CHECKOUT = "undo_checkout";
|
||||
public static final String MSG_UNDO_CHECKOUT_FOR = "undo_checkout_for";
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ import org.alfresco.web.app.Application;
|
||||
|
||||
public class CCUpdateFileDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = 8230565659041530809L;
|
||||
|
||||
private final static String MSG_UPDATE = "update";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,8 @@ import org.alfresco.web.app.Application;
|
||||
|
||||
public class CCWorkingCopyMissingDialog extends CheckinCheckoutDialog
|
||||
{
|
||||
private static final long serialVersionUID = 8067485292477557683L;
|
||||
|
||||
public static final String MSG_WORKING_COPY_FOR = "working_copy_for";
|
||||
public static final String LBL_CLOSE = "close";
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.data.IDataContainer;
|
||||
import org.alfresco.web.data.QuickSort;
|
||||
@@ -70,10 +71,10 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
protected String content = null;
|
||||
protected List<SelectItem> createMimeTypes;
|
||||
|
||||
protected FormsService formsService;
|
||||
transient protected FormsService formsService;
|
||||
protected String formName;
|
||||
protected FormProcessor.Session formProcessorSession = null;
|
||||
protected Document instanceDataDocument = null;
|
||||
transient protected Document instanceDataDocument = null;
|
||||
|
||||
private static Log logger = LogFactory.getLog(CreateContentWizard.class);
|
||||
|
||||
@@ -86,9 +87,23 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
this.formsService = formsService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the formsService
|
||||
*/
|
||||
private FormsService getFormsService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (formsService == null)
|
||||
{
|
||||
formsService = (FormsService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "FormsService");
|
||||
}
|
||||
return formsService;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
|
||||
@Override
|
||||
public String finish()
|
||||
{
|
||||
@@ -294,7 +309,7 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
*/
|
||||
public List<SelectItem> getFormsList()
|
||||
{
|
||||
Collection<Form> forms = this.formsService.getForms();
|
||||
Collection<Form> forms = this.getFormsService().getForms();
|
||||
List<SelectItem> items = new ArrayList<SelectItem>(forms.size()+1);
|
||||
items.add(new SelectItem("", ""));
|
||||
for (Form form : forms)
|
||||
@@ -317,7 +332,7 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
public Form getForm() throws FormNotFoundException
|
||||
{
|
||||
return (this.getFormName() != null
|
||||
? formsService.getForm(formName)
|
||||
? getFormsService().getForm(formName)
|
||||
: null);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
|
||||
public class DocumentLinkDetailsDialog extends BaseDetailsBean implements NavigationSupport
|
||||
{
|
||||
private static final long serialVersionUID = 4716260640608281667L;
|
||||
|
||||
private static final String MSG_DETAILS_OF = "details_of";
|
||||
private static final String MSG_LOCATION = "location";
|
||||
private final static String MSG_CLOSE = "close";
|
||||
|
||||
@@ -78,6 +78,7 @@ public class DocumentPropertiesDialog implements Serializable
|
||||
transient private NodeService nodeService;
|
||||
transient private FileFolderService fileFolderService;
|
||||
transient private DictionaryService dictionaryService;
|
||||
|
||||
protected BrowseBean browseBean;
|
||||
private List<SelectItem> contentTypes;
|
||||
private Node editableNode;
|
||||
|
||||
@@ -38,14 +38,14 @@ import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.forms.Form;
|
||||
import org.alfresco.web.forms.FormNotFoundException;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Bean implementation for the "Edit Content Wizard" dialog
|
||||
*/
|
||||
public class EditContentWizard extends CreateContentWizard
|
||||
{
|
||||
private static final long serialVersionUID = 1640754719164511019L;
|
||||
|
||||
private NodeRef nodeRef;
|
||||
private Form form;
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
public class EditSimpleWorkflowDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 7203447561571625990L;
|
||||
|
||||
private static final String MSG_ERROR_UPDATE_SIMPLEWORKFLOW = "error_update_simpleworkflow";
|
||||
|
||||
protected Map<String, Serializable> workflowProperties;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.forums;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
public class ForumDetailsDialog extends BaseDetailsBean implements NavigationSupport
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -1358474435876806449L;
|
||||
|
||||
private static final String MSG_DETAILS_OF = "details_of";
|
||||
private static final String MSG_LOCATION = "location";
|
||||
private final static String MSG_CLOSE = "close";
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
public class ForumsDetailsDialog extends BaseDetailsBean implements NavigationSupport
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 279622505413904654L;
|
||||
|
||||
private static final String MSG_DETAILS_OF = "details_of";
|
||||
private static final String MSG_LOCATION = "location";
|
||||
private final static String MSG_CLOSE = "close";
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
public class TopicDetailsDialog extends BaseDetailsBean implements NavigationSupport
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -5879020614355773789L;
|
||||
|
||||
private static final String MSG_DETAILS_OF = "details_of";
|
||||
private static final String MSG_LOCATION = "location";
|
||||
private final static String MSG_CLOSE = "close";
|
||||
|
||||
@@ -61,6 +61,8 @@ import org.alfresco.web.ui.common.component.UIGenericPicker;
|
||||
*/
|
||||
public class AddUsersDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 4893334797091942357L;
|
||||
|
||||
/** The id of the group to add users to */
|
||||
protected String group;
|
||||
|
||||
@@ -68,16 +70,16 @@ public class AddUsersDialog extends BaseDialogBean
|
||||
protected String groupName;
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
protected AuthorityService authService;
|
||||
transient private AuthorityService authService;
|
||||
|
||||
/** personService bean reference */
|
||||
protected PersonService personService;
|
||||
transient private PersonService personService;
|
||||
|
||||
/** selected users to be added to a group */
|
||||
protected List<UserAuthorityDetails> usersForGroup;
|
||||
|
||||
/** datamodel for table of users added to group */
|
||||
protected DataModel usersDataModel = null;
|
||||
transient protected DataModel usersDataModel = null;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dialog implementation
|
||||
@@ -100,7 +102,7 @@ public class AddUsersDialog extends BaseDialogBean
|
||||
// add each selected user to the current group in turn
|
||||
for (UserAuthorityDetails wrapper : this.usersForGroup)
|
||||
{
|
||||
this.authService.addAuthority(this.group, wrapper.getAuthority());
|
||||
this.getAuthService().addAuthority(this.group, wrapper.getAuthority());
|
||||
}
|
||||
|
||||
return outcome;
|
||||
@@ -126,11 +128,37 @@ public class AddUsersDialog extends BaseDialogBean
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the authService
|
||||
*/
|
||||
protected AuthorityService getAuthService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if (authService == null)
|
||||
{
|
||||
authService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAuthorityService();
|
||||
}
|
||||
return authService;
|
||||
}
|
||||
|
||||
public void setPersonService(PersonService personService)
|
||||
{
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the personService
|
||||
*/
|
||||
protected PersonService getPersonService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if (personService == null)
|
||||
{
|
||||
personService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPersonService();
|
||||
}
|
||||
return personService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the usersDataModel.
|
||||
*/
|
||||
@@ -176,7 +204,7 @@ public class AddUsersDialog extends BaseDialogBean
|
||||
|
||||
// build xpath to match available User/Person objects
|
||||
ServiceRegistry services = Repository.getServiceRegistry(context);
|
||||
NodeRef peopleRef = personService.getPeopleContainer();
|
||||
NodeRef peopleRef = getPersonService().getPeopleContainer();
|
||||
String xpath = "*[like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" + "firstName, '%" + contains +
|
||||
"%', false)" + " or " + "like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" +
|
||||
"lastName, '%" + contains + "%', false)]";
|
||||
@@ -254,10 +282,10 @@ public class AddUsersDialog extends BaseDialogBean
|
||||
StringBuilder label = new StringBuilder(48);
|
||||
|
||||
// build a display label showing the user person name
|
||||
if (this.personService.personExists(authority) == true)
|
||||
if (this.getPersonService().personExists(authority) == true)
|
||||
{
|
||||
// found a Person with a User authority
|
||||
NodeRef ref = this.personService.getPerson(authority);
|
||||
NodeRef ref = this.getPersonService().getPerson(authority);
|
||||
String firstName = (String)getNodeService().getProperty(ref, ContentModel.PROP_FIRSTNAME);
|
||||
String lastName = (String)getNodeService().getProperty(ref, ContentModel.PROP_LASTNAME);
|
||||
|
||||
|
||||
@@ -36,16 +36,19 @@ import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class CreateGroupDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = -8074475974375860695L;
|
||||
|
||||
protected String parentGroup;
|
||||
protected String parentGroupName;
|
||||
protected String name;
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
protected AuthorityService authService;
|
||||
transient private AuthorityService authService;
|
||||
|
||||
private static final String MSG_ERR_EXISTS = "groups_err_exists";
|
||||
private static final String MSG_ERR_NAME = "groups_err_group_name";
|
||||
@@ -72,10 +75,10 @@ public class CreateGroupDialog extends BaseDialogBean
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
// create new Group using Authentication Service
|
||||
String groupName = this.authService.getName(AuthorityType.GROUP, this.name);
|
||||
if (this.authService.authorityExists(groupName) == false)
|
||||
String groupName = this.getAuthService().getName(AuthorityType.GROUP, this.name);
|
||||
if (this.getAuthService().authorityExists(groupName) == false)
|
||||
{
|
||||
this.authService.createAuthority(AuthorityType.GROUP, this.parentGroup, this.name);
|
||||
this.getAuthService().createAuthority(AuthorityType.GROUP, this.parentGroup, this.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -127,6 +130,18 @@ public class CreateGroupDialog extends BaseDialogBean
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the authService
|
||||
*/
|
||||
protected AuthorityService getAuthService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if (authService == null)
|
||||
{
|
||||
authService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAuthorityService();
|
||||
}
|
||||
return authService;
|
||||
}
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
||||
|
||||
@@ -32,9 +32,12 @@ import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
public class DeleteGroupDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = -8743700617152460027L;
|
||||
|
||||
/** The group to be deleted */
|
||||
protected String group = null;
|
||||
protected String groupName = null;
|
||||
@@ -43,7 +46,7 @@ public class DeleteGroupDialog extends BaseDialogBean
|
||||
protected int numItemsInGroup = 0;
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
protected AuthorityService authService;
|
||||
transient private AuthorityService authService;
|
||||
|
||||
private static final String MSG_DELETE = "delete";
|
||||
private static final String MSG_DELETE_GROUP = "delete_group";
|
||||
@@ -63,9 +66,9 @@ public class DeleteGroupDialog extends BaseDialogBean
|
||||
// calculate the number of items the givev group has
|
||||
if (this.group != null)
|
||||
{
|
||||
numItemsInGroup = this.authService.getContainedAuthorities(
|
||||
numItemsInGroup = this.getAuthService().getContainedAuthorities(
|
||||
AuthorityType.GROUP, this.group, false).size();
|
||||
numItemsInGroup += this.authService.getContainedAuthorities(
|
||||
numItemsInGroup += this.getAuthService().getContainedAuthorities(
|
||||
AuthorityType.USER, this.group, false).size();
|
||||
}
|
||||
}
|
||||
@@ -74,7 +77,7 @@ public class DeleteGroupDialog extends BaseDialogBean
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
// delete group using the Authentication Service
|
||||
this.authService.deleteAuthority(this.group);
|
||||
this.getAuthService().deleteAuthority(this.group);
|
||||
|
||||
return outcome;
|
||||
}
|
||||
@@ -126,4 +129,17 @@ public class DeleteGroupDialog extends BaseDialogBean
|
||||
{
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the authService
|
||||
*/
|
||||
protected AuthorityService getAuthService()
|
||||
{
|
||||
//check for null in cluster environment
|
||||
if (authService == null)
|
||||
{
|
||||
authService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAuthorityService();
|
||||
}
|
||||
return authService;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.ml;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -36,10 +34,10 @@ import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.ml.MultilingualContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.web.bean.users.UserPreferencesBean;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.users.UserPreferencesBean;
|
||||
|
||||
/**
|
||||
* Dialog bean to add a new translation without content. I means, a new node is created
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.ml;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.ml;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -37,10 +35,10 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.ml.MultilingualContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.users.UserPreferencesBean;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.users.UserPreferencesBean;
|
||||
|
||||
/**
|
||||
* Dialog bean to make a node multilingual
|
||||
|
||||
@@ -57,6 +57,8 @@ import org.alfresco.web.ui.common.component.UIPanel.ExpandedEvent;
|
||||
|
||||
public class MultilingualManageDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 4168804472130450812L;
|
||||
|
||||
private final String MSG_MANAGE_DETAILS_FOR="manage_multilingual_details_for";
|
||||
private static final String MSG_CURRENT = "current";
|
||||
private static final String ML_VERSION_PANEL_ID = "ml-versions-panel";
|
||||
@@ -64,10 +66,10 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
|
||||
protected Map<String, Boolean> panels = new HashMap<String, Boolean>(4, 1.0f);
|
||||
|
||||
protected MultilingualContentService multilingualContentService;
|
||||
protected ContentFilterLanguagesService contentFilterLanguagesService;
|
||||
protected EditionService editionService;
|
||||
protected VersionService versionService;
|
||||
transient private MultilingualContentService multilingualContentService;
|
||||
transient private ContentFilterLanguagesService contentFilterLanguagesService;
|
||||
transient private EditionService editionService;
|
||||
transient private VersionService versionService;
|
||||
|
||||
private Node translationDocument;
|
||||
|
||||
@@ -105,6 +107,19 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return multilingualContentService
|
||||
*/
|
||||
protected MultilingualContentService getMultilingualContentService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (multilingualContentService == null)
|
||||
{
|
||||
multilingualContentService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getMultilingualContentService();
|
||||
}
|
||||
return multilingualContentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contentFilterLanguagesService The Content Filter Languages Service to set.
|
||||
*/
|
||||
@@ -113,6 +128,19 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
this.contentFilterLanguagesService = contentFilterLanguagesService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return contentFilterLanguagesService
|
||||
*/
|
||||
protected ContentFilterLanguagesService getContentFilterLanguagesService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (contentFilterLanguagesService == null)
|
||||
{
|
||||
contentFilterLanguagesService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getContentFilterLanguagesService();
|
||||
}
|
||||
return contentFilterLanguagesService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EditionService The Edition Service to set.
|
||||
*/
|
||||
@@ -121,6 +149,19 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
this.editionService = editionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return editionService
|
||||
*/
|
||||
protected EditionService getEditionService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (editionService == null)
|
||||
{
|
||||
editionService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getEditionService();
|
||||
}
|
||||
return editionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the version service instance the bean should use
|
||||
*
|
||||
@@ -131,6 +172,19 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
this.versionService = versionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return versionService
|
||||
*/
|
||||
protected VersionService getVersionService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (versionService == null)
|
||||
{
|
||||
versionService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getVersionService();
|
||||
}
|
||||
return versionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Before opening the ml container details, remeber the translation
|
||||
* from which the action comes.
|
||||
@@ -186,7 +240,7 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
|
||||
if (document.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT) || ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(document.getType()))
|
||||
{
|
||||
Map<Locale, NodeRef> translationsMap = this.multilingualContentService.getTranslations(getDocument().getNodeRef());
|
||||
Map<Locale, NodeRef> translationsMap = getMultilingualContentService().getTranslations(getDocument().getNodeRef());
|
||||
|
||||
if (translationsMap != null && translationsMap.size() > 0)
|
||||
{
|
||||
@@ -201,7 +255,7 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
|
||||
String lgge = (locale != null) ?
|
||||
// convert the locale into new ISO codes
|
||||
contentFilterLanguagesService.convertToNewISOCode(locale.getLanguage()).toUpperCase()
|
||||
getContentFilterLanguagesService().convertToNewISOCode(locale.getLanguage()).toUpperCase()
|
||||
: null;
|
||||
|
||||
mapNode.put("name", getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME));
|
||||
@@ -365,7 +419,7 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
{
|
||||
NodeRef nodeRef = getNode().getNodeRef();
|
||||
|
||||
return new Node(multilingualContentService.getTranslationContainer(nodeRef));
|
||||
return new Node(getMultilingualContentService().getTranslationContainer(nodeRef));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,7 +436,7 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
NodeRef mlContainer = getDocumentMlContainer().getNodeRef();
|
||||
|
||||
// get all editions and sort them ascending according their version label
|
||||
List<Version> orderedEditionList = new ArrayList<Version>(editionService.getEditions(mlContainer).getAllVersions());
|
||||
List<Version> orderedEditionList = new ArrayList<Version>(getEditionService().getEditions(mlContainer).getAllVersions());
|
||||
Collections.sort(orderedEditionList, new VersionLabelComparator());
|
||||
|
||||
// the list of Single Edition Bean to return
|
||||
@@ -418,16 +472,16 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
{
|
||||
// Get the translations because the current edition doesn't content link with its
|
||||
// translation in the version store.
|
||||
Map<Locale, NodeRef> translations = multilingualContentService.getTranslations(mlContainer);
|
||||
Map<Locale, NodeRef> translations = getMultilingualContentService().getTranslations(mlContainer);
|
||||
translationHistories = new ArrayList<VersionHistory>(translations.size());
|
||||
for (NodeRef translation : translations.values())
|
||||
{
|
||||
translationHistories.add(versionService.getVersionHistory(translation));
|
||||
translationHistories.add(getVersionService().getVersionHistory(translation));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
translationHistories = editionService.getVersionedTranslations(edition);
|
||||
translationHistories = getEditionService().getVersionedTranslations(edition);
|
||||
}
|
||||
|
||||
// add each translation in the SingleEditionBean
|
||||
@@ -441,7 +495,7 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
Version lastVersion = orderedVersions.get(0);
|
||||
|
||||
// get the properties of the lastVersion
|
||||
Map<QName, Serializable> lastVersionProperties = editionService.getVersionedMetadatas(lastVersion);
|
||||
Map<QName, Serializable> lastVersionProperties = getEditionService().getVersionedMetadatas(lastVersion);
|
||||
Locale language = (Locale) lastVersionProperties.get(ContentModel.PROP_LOCALE);
|
||||
|
||||
// create a map node representation of the last version
|
||||
@@ -453,7 +507,7 @@ public class MultilingualManageDialog extends BaseDialogBean
|
||||
clientLastVersion.put("versionAuthor", lastVersionProperties.get(ContentModel.PROP_AUTHOR));
|
||||
clientLastVersion.put("versionCreatedDate", lastVersionProperties.get(ContentModel.PROP_CREATED));
|
||||
clientLastVersion.put("versionModifiedDate", lastVersionProperties.get(ContentModel.PROP_MODIFIED));
|
||||
clientLastVersion.put("versionLanguage", this.contentFilterLanguagesService.convertToNewISOCode(language.getLanguage()).toUpperCase());
|
||||
clientLastVersion.put("versionLanguage", getContentFilterLanguagesService().convertToNewISOCode(language.getLanguage()).toUpperCase());
|
||||
|
||||
if(getNodeService().hasAspect(lastVersion.getFrozenStateNodeRef(), ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
|
||||
{
|
||||
|
||||
@@ -46,6 +46,8 @@ public class CreateProjectDialog extends CreateSpaceWizard
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
private static final long serialVersionUID = -7140719588223514104L;
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
|
||||
@@ -24,10 +24,13 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
@@ -41,9 +44,11 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author gavinc
|
||||
*/
|
||||
public final class DataDictionary
|
||||
public final class DataDictionary implements Serializable
|
||||
{
|
||||
private DictionaryService dictionaryService;
|
||||
private static final long serialVersionUID = -4922351610793587592L;
|
||||
|
||||
transient private DictionaryService dictionaryService;
|
||||
private Map<QName, TypeDefinition> types = new HashMap<QName, TypeDefinition>(11, 1.0f);
|
||||
|
||||
/**
|
||||
@@ -56,6 +61,19 @@ public final class DataDictionary
|
||||
this.dictionaryService = dictionaryService;
|
||||
}
|
||||
|
||||
/**
|
||||
*@return dictionaryService
|
||||
*/
|
||||
private DictionaryService getDictionaryService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (dictionaryService == null)
|
||||
{
|
||||
dictionaryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getDictionaryService();
|
||||
}
|
||||
return dictionaryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type definition for the type represented by the given qname
|
||||
*
|
||||
@@ -68,7 +86,7 @@ public final class DataDictionary
|
||||
|
||||
if (typeDef == null)
|
||||
{
|
||||
typeDef = this.dictionaryService.getType(type);
|
||||
typeDef = getDictionaryService().getType(type);
|
||||
|
||||
if (typeDef != null)
|
||||
{
|
||||
@@ -89,7 +107,7 @@ public final class DataDictionary
|
||||
*/
|
||||
public TypeDefinition getTypeDef(QName type, Collection<QName> optionalAspects)
|
||||
{
|
||||
return this.dictionaryService.getAnonymousType(type, optionalAspects);
|
||||
return getDictionaryService().getAnonymousType(type, optionalAspects);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,24 +25,30 @@
|
||||
package org.alfresco.web.bean.repository.admin;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.admin.RepoAdminInterpreter;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Backing bean to support the Repository Admin Console
|
||||
*/
|
||||
public class RepoAdminConsoleBean
|
||||
public class RepoAdminConsoleBean implements Serializable
|
||||
{
|
||||
// command
|
||||
private static final long serialVersionUID = -8131607149189675180L;
|
||||
|
||||
// command
|
||||
private String command = "";
|
||||
private String submittedCommand = "none";
|
||||
private long duration = 0L;
|
||||
private String result = null;
|
||||
|
||||
// supporting repository services
|
||||
private RepoAdminInterpreter repoAdminInterpreter;
|
||||
transient private RepoAdminInterpreter repoAdminInterpreter;
|
||||
|
||||
|
||||
/**
|
||||
@@ -53,6 +59,19 @@ public class RepoAdminConsoleBean
|
||||
this.repoAdminInterpreter = repoAdminInterpreter;
|
||||
}
|
||||
|
||||
/**
|
||||
*@return repoAdminInterpreter
|
||||
*/
|
||||
private RepoAdminInterpreter getRepoAdminInterpreter()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (repoAdminInterpreter == null)
|
||||
{
|
||||
repoAdminInterpreter = (RepoAdminInterpreter) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "repoAdminInterpreter");
|
||||
}
|
||||
return repoAdminInterpreter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the command result
|
||||
*
|
||||
@@ -155,7 +174,7 @@ public class RepoAdminConsoleBean
|
||||
*/
|
||||
public String getCurrentUserName()
|
||||
{
|
||||
return repoAdminInterpreter.getCurrentUserName();
|
||||
return getRepoAdminInterpreter().getCurrentUserName();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +187,7 @@ public class RepoAdminConsoleBean
|
||||
try
|
||||
{
|
||||
long startms = System.currentTimeMillis();
|
||||
String result = repoAdminInterpreter.interpretCommand(command);
|
||||
String result = getRepoAdminInterpreter().interpretCommand(command);
|
||||
setDuration(System.currentTimeMillis() - startms);
|
||||
setResult(result);
|
||||
setCommand("");
|
||||
|
||||
@@ -25,24 +25,30 @@
|
||||
package org.alfresco.web.bean.repository.tenant;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.tenant.TenantInterpreter;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Backing bean to support the Tenant Admin Console
|
||||
*/
|
||||
public class TenantAdminConsoleBean
|
||||
public class TenantAdminConsoleBean implements Serializable
|
||||
{
|
||||
// command
|
||||
private static final long serialVersionUID = -9116623180660597894L;
|
||||
|
||||
// command
|
||||
private String command = "";
|
||||
private String submittedCommand = "none";
|
||||
private long duration = 0L;
|
||||
private String result = null;
|
||||
|
||||
// supporting repository services
|
||||
private TenantInterpreter tenantInterpreter;
|
||||
transient private TenantInterpreter tenantInterpreter;
|
||||
|
||||
|
||||
/**
|
||||
@@ -52,6 +58,19 @@ public class TenantAdminConsoleBean
|
||||
{
|
||||
this.tenantInterpreter = tenantInterpreter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return tenantInterpreter
|
||||
*/
|
||||
private TenantInterpreter geTenantInterpreter()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (tenantInterpreter == null)
|
||||
{
|
||||
tenantInterpreter = (TenantInterpreter) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "tenantInterpreter");
|
||||
}
|
||||
return tenantInterpreter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the command result
|
||||
@@ -155,7 +174,7 @@ public class TenantAdminConsoleBean
|
||||
*/
|
||||
public String getCurrentUserName()
|
||||
{
|
||||
return (tenantInterpreter != null) ? tenantInterpreter.getCurrentUserName() : null;
|
||||
return (geTenantInterpreter() != null) ? geTenantInterpreter().getCurrentUserName() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +187,7 @@ public class TenantAdminConsoleBean
|
||||
try
|
||||
{
|
||||
long startms = System.currentTimeMillis();
|
||||
String result = (tenantInterpreter != null) ? tenantInterpreter.interpretCommand(command) : "Tenant AdminConsole is not available - check that multi-tenancy is enabled !";
|
||||
String result = (geTenantInterpreter() != null) ? geTenantInterpreter().interpretCommand(command) : "Tenant AdminConsole is not available - check that multi-tenancy is enabled !";
|
||||
setDuration(System.currentTimeMillis() - startms);
|
||||
setResult(result);
|
||||
setCommand("");
|
||||
|
||||
@@ -27,7 +27,6 @@ package org.alfresco.web.bean.rules;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.rule.Rule;
|
||||
@@ -36,20 +35,22 @@ import org.alfresco.util.ParameterCheck;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class DeleteRuleDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 2009345695752548885L;
|
||||
|
||||
private static final String MSG_ERROR_DELETE_RULE = "error_delete_rule";
|
||||
private static final String MSG_DELETE_RULE = "delete_rule";
|
||||
private static final String MSG_YES = "yes";
|
||||
private static final String MSG_NO = "no";
|
||||
|
||||
private Rule currentRule;
|
||||
protected RuleService ruleService;
|
||||
transient private Rule currentRule;
|
||||
transient private RuleService ruleService;
|
||||
private static Log logger = LogFactory.getLog(DeleteRuleDialog.class);
|
||||
|
||||
@Override
|
||||
@@ -65,7 +66,7 @@ public class DeleteRuleDialog extends BaseDialogBean
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Rule clicked, it's nodeRef is: " + nodeRef);
|
||||
|
||||
this.currentRule = this.ruleService.getRule(new NodeRef(nodeRef));
|
||||
this.currentRule = getRuleService().getRule(new NodeRef(nodeRef));
|
||||
|
||||
}
|
||||
|
||||
@@ -76,6 +77,19 @@ public class DeleteRuleDialog extends BaseDialogBean
|
||||
{
|
||||
this.ruleService = ruleService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ruleService
|
||||
*/
|
||||
protected RuleService getRuleService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (ruleService == null)
|
||||
{
|
||||
ruleService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getRuleService();
|
||||
}
|
||||
return ruleService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current rule
|
||||
@@ -104,7 +118,7 @@ public class DeleteRuleDialog extends BaseDialogBean
|
||||
{
|
||||
String ruleTitle = this.currentRule.getTitle();
|
||||
|
||||
this.ruleService.removeRule(getSpace().getNodeRef(), this.currentRule);
|
||||
getRuleService().removeRule(getSpace().getNodeRef(), this.currentRule);
|
||||
|
||||
// clear the current rule
|
||||
this.currentRule = null;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.rules;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -82,7 +83,7 @@ public class RulesDialog extends BaseDialogBean implements IContextListener, Fil
|
||||
|
||||
transient private RuleService ruleService;
|
||||
private List<WrappedRule> rules;
|
||||
private Rule currentRule;
|
||||
transient private Rule currentRule;
|
||||
private UIRichList richList;
|
||||
transient private ActionService actionService;
|
||||
|
||||
@@ -373,9 +374,11 @@ public class RulesDialog extends BaseDialogBean implements IContextListener, Fil
|
||||
* Inner class to wrap the Rule objects so we can expose a flag to indicate whether
|
||||
* the rule is a local or inherited rule
|
||||
*/
|
||||
public static class WrappedRule
|
||||
public static class WrappedRule implements Serializable
|
||||
{
|
||||
private Rule rule;
|
||||
private static final long serialVersionUID = -8887443730660109283L;
|
||||
|
||||
transient private Rule rule;
|
||||
private boolean isLocal;
|
||||
private Date createdDate;
|
||||
private Date modifiedDate;
|
||||
|
||||
@@ -43,6 +43,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class EditSearchDialog extends AdvancedSearchDialog
|
||||
{
|
||||
private static final long serialVersionUID = -8914819218709478527L;
|
||||
|
||||
private static final String MSG_ERROR_SAVE_SEARCH = "error_save_search";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,6 +48,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
public class SaveSearchDialog extends AdvancedSearchDialog
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 237262751601280456L;
|
||||
|
||||
private static final String MSG_ERROR_SAVE_SEARCH = "error_save_search";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1032,8 +1032,10 @@ public class SearchContext implements Serializable
|
||||
/**
|
||||
* Simple wrapper class for range query attribute properties
|
||||
*/
|
||||
static class RangeProperties
|
||||
static class RangeProperties implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 5627339191207625169L;
|
||||
|
||||
QName qname;
|
||||
String lower;
|
||||
String upper;
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.search;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -40,9 +43,11 @@ import org.alfresco.util.ExpiringValueCache;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.config.AdvancedSearchConfigElement;
|
||||
|
||||
public class SearchProperties
|
||||
public class SearchProperties implements Serializable
|
||||
{
|
||||
private static final String MODE_ALL = "all";
|
||||
private static final long serialVersionUID = 8583342903708013641L;
|
||||
|
||||
private static final String MODE_ALL = "all";
|
||||
private static final String LOOKIN_ALL = "all";
|
||||
private static final String SAVED_SEARCHES_USER = "user";
|
||||
|
||||
@@ -62,7 +67,7 @@ public class SearchProperties
|
||||
/**
|
||||
* lookup of custom property QName string to DataTypeDefinition for the property
|
||||
*/
|
||||
private Map<String, DataTypeDefinition> customPropertyLookup = null;
|
||||
transient private Map<String, DataTypeDefinition> customPropertyLookup = null;
|
||||
|
||||
/** content format list restricting searches */
|
||||
private List<SelectItem> contentFormats;
|
||||
@@ -98,7 +103,7 @@ public class SearchProperties
|
||||
private List<Node> categories = new ArrayList<Node>(2);
|
||||
|
||||
/** datamodel for table of categories to search */
|
||||
private DataModel categoriesDataModel = new ListDataModel();
|
||||
transient private DataModel categoriesDataModel = new ListDataModel();
|
||||
|
||||
/** title attribute to search */
|
||||
private String title = null;
|
||||
@@ -494,4 +499,11 @@ public class SearchProperties
|
||||
this.cachedSavedSearches = cachedSavedSearches;
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
|
||||
categoriesDataModel = new ListDataModel();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
public class ApplyDocTemplateDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -9098279672434597354L;
|
||||
|
||||
protected String template;
|
||||
|
||||
private static final String DIALOG_CLOSE = "dialog:close";
|
||||
|
||||
@@ -41,6 +41,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
public class ApplyRssTemplateDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 9207265799149337182L;
|
||||
|
||||
private static final String DIALOG_CLOSE = "dialog:close";
|
||||
|
||||
private static final String MSG_APPLY_RSS_FEED = "apply_rss_feed";
|
||||
|
||||
@@ -41,6 +41,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
public class ApplySpaceTemplateDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -3019234033026890265L;
|
||||
|
||||
protected String template;
|
||||
|
||||
private static final String DIALOG_CLOSE = "dialog:close";
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class EditSimpleWorkflowDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 5997327694341960824L;
|
||||
|
||||
protected Map<String, Serializable> workflowProperties;
|
||||
|
||||
private static final String MSG_ERROR_UPDATE_SIMPLEWORKFLOW = "error_update_simpleworkflow";
|
||||
|
||||
@@ -34,6 +34,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class TrashcanDeleteAllItemsDialog extends TrashcanDialog
|
||||
{
|
||||
private static final long serialVersionUID = 2537803727179629546L;
|
||||
|
||||
private static final String MSG_YES = "yes";
|
||||
private static final String MSG_NO = "no";
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class TrashcanDeleteItemDialog extends TrashcanDialog
|
||||
{
|
||||
private static final long serialVersionUID = 519967126630923155L;
|
||||
|
||||
private static final String RICHLIST_ID = "trashcan-list";
|
||||
private static final String RICHLIST_MSG_ID = "trashcan" + ':' + RICHLIST_ID;
|
||||
private static final String MSG_YES = "yes";
|
||||
|
||||
@@ -38,6 +38,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class TrashcanDeleteListedItemsDialog extends TrashcanDialog
|
||||
{
|
||||
private static final long serialVersionUID = 5576836588148974609L;
|
||||
|
||||
private static final String MSG_YES = "yes";
|
||||
private static final String MSG_NO = "no";
|
||||
|
||||
|
||||
@@ -24,23 +24,27 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.trashcan;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.ui.common.component.data.UIRichList;
|
||||
|
||||
public class TrashcanDialogProperty
|
||||
public class TrashcanDialogProperty implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -8007742798807270570L;
|
||||
|
||||
private static final String FILTER_DATE_ALL = "all";
|
||||
private static final String FILTER_USER_ALL = "all";
|
||||
|
||||
/** NodeArchiveService bean reference */
|
||||
protected NodeArchiveService nodeArchiveService;
|
||||
transient private NodeArchiveService nodeArchiveService;
|
||||
|
||||
/** Component reference for Deleted Items RichList control */
|
||||
protected UIRichList itemsRichList;
|
||||
@@ -294,8 +298,16 @@ public class TrashcanDialogProperty
|
||||
this.inProgress = inProgress;
|
||||
}
|
||||
|
||||
/**
|
||||
*@return nodeArchiveService
|
||||
*/
|
||||
public NodeArchiveService getNodeArchiveService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (nodeArchiveService == null)
|
||||
{
|
||||
nodeArchiveService = (NodeArchiveService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "nodeArchiveService");
|
||||
}
|
||||
return nodeArchiveService;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,13 +29,16 @@ import javax.faces.context.FacesContext;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
public class TrashcanItemDetailsDialog extends TrashcanDialog
|
||||
{
|
||||
private static final long serialVersionUID = 1767515883530860417L;
|
||||
|
||||
private static final String MSG_DETAILS_OF = "details_of";
|
||||
private static final String MSG_CLOSE = "close";
|
||||
|
||||
protected PermissionService permissionService;
|
||||
transient private PermissionService permissionService;
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
@@ -71,4 +74,17 @@ public class TrashcanItemDetailsDialog extends TrashcanDialog
|
||||
{
|
||||
this.permissionService = permissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
*@return permissionService
|
||||
*/
|
||||
protected PermissionService getPermissionService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (permissionService == null)
|
||||
{
|
||||
permissionService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPermissionService();
|
||||
}
|
||||
return permissionService;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
public class TrashcanRecoverAllItemsDialog extends TrashcanDialog
|
||||
{
|
||||
private static final long serialVersionUID = -1869377322722271833L;
|
||||
|
||||
private static final String OUTCOME_RECOVERY_REPORT = "dialog:recoveryReport";
|
||||
private static final String MSG_NO = "no";
|
||||
private static final String MSG_YES = "yes";
|
||||
|
||||
@@ -35,6 +35,8 @@ import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
public class TrashcanRecoverItemDialog extends TrashcanDialog
|
||||
{
|
||||
private static final long serialVersionUID = -8237457079397611071L;
|
||||
|
||||
private static final String RICHLIST_ID = "trashcan-list";
|
||||
private static final String RICHLIST_MSG_ID = "trashcan" + ':' + RICHLIST_ID;
|
||||
private static final String MSG_RECOVERED_ITEM_SUCCESS = "recovered_item_success";
|
||||
|
||||
@@ -36,6 +36,8 @@ import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
public class TrashcanRecoverListedItemsDialog extends TrashcanDialog
|
||||
{
|
||||
private static final long serialVersionUID = 5500454626559426051L;
|
||||
|
||||
private static final String OUTCOME_RECOVERY_REPORT = "dialog:recoveryReport";
|
||||
private static final String MSG_NO = "no";
|
||||
private static final String MSG_YES = "yes";
|
||||
|
||||
@@ -31,6 +31,8 @@ import org.alfresco.web.app.Application;
|
||||
public class TrashcanRecoveryReportDialog extends TrashcanDialog
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -3381444990908748991L;
|
||||
|
||||
private final static String MSG_CLOSE = "close";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,6 +36,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
public class ChangeMyPasswordDialog extends UsersDialog
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1965846039555088108L;
|
||||
|
||||
private static final String MSG_FINISH_BUTTON = "finish_button";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,6 +36,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
public class ChangePasswordDialog extends UsersDialog
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -1570967895811499123L;
|
||||
|
||||
private static final String MSG_FINISH_BUTTON = "finish_button";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.context.UIContextService;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.spaces.CreateSpaceWizard;
|
||||
import org.alfresco.web.bean.wizard.BaseWizardBean;
|
||||
@@ -66,6 +67,8 @@ import org.apache.log4j.Logger;
|
||||
*/
|
||||
public class CreateUserWizard extends BaseWizardBean
|
||||
{
|
||||
private static final long serialVersionUID = 8008464794715380019L;
|
||||
|
||||
private static Logger logger = Logger.getLogger(CreateUserWizard.class);
|
||||
protected static final String ERROR = "error_person";
|
||||
|
||||
@@ -93,22 +96,22 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
protected String sizeQuotaUnits = null;
|
||||
|
||||
/** AuthenticationService bean reference */
|
||||
private AuthenticationService authenticationService;
|
||||
transient private AuthenticationService authenticationService;
|
||||
|
||||
/** PersonService bean reference */
|
||||
private PersonService personService;
|
||||
transient private PersonService personService;
|
||||
|
||||
/** TenantService bean reference */
|
||||
private TenantService tenantService;
|
||||
transient private TenantService tenantService;
|
||||
|
||||
/** PermissionService bean reference */
|
||||
private PermissionService permissionService;
|
||||
transient private PermissionService permissionService;
|
||||
|
||||
/** OwnableService bean reference */
|
||||
private OwnableService ownableService;
|
||||
transient private OwnableService ownableService;
|
||||
|
||||
/** ContentUsageService bean reference */
|
||||
private ContentUsageService contentUsageService;
|
||||
transient private ContentUsageService contentUsageService;
|
||||
|
||||
|
||||
/** ref to the company home space folder */
|
||||
@@ -125,6 +128,22 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
this.authenticationService = authenticationService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return authenticationService
|
||||
*/
|
||||
private AuthenticationService getAuthenticationService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (authenticationService == null)
|
||||
{
|
||||
authenticationService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAuthenticationService();
|
||||
}
|
||||
return authenticationService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param personService The person service.
|
||||
*/
|
||||
@@ -133,12 +152,40 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return personService
|
||||
*/
|
||||
private PersonService getPersonService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (personService == null)
|
||||
{
|
||||
personService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPersonService();
|
||||
}
|
||||
return personService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param tenantService The tenantService to set.
|
||||
*/
|
||||
public void setTenantService(TenantService tenantService)
|
||||
{
|
||||
this.tenantService = tenantService;
|
||||
this.tenantService = tenantService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return tenantService
|
||||
*/
|
||||
private TenantService geTenantService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if(tenantService == null)
|
||||
{
|
||||
tenantService = (TenantService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "tenantService");
|
||||
}
|
||||
return tenantService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,6 +195,19 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
{
|
||||
this.permissionService = permissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return permissionService
|
||||
*/
|
||||
private PermissionService getPermissionService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (permissionService == null)
|
||||
{
|
||||
permissionService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPermissionService();
|
||||
}
|
||||
return permissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ownableService The ownableService to set.
|
||||
@@ -156,6 +216,19 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
{
|
||||
this.ownableService = ownableService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ownableService
|
||||
*/
|
||||
private OwnableService getOwnableService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (ownableService == null)
|
||||
{
|
||||
ownableService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getOwnableService();
|
||||
}
|
||||
return ownableService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contentUsageService The contentUsageService to set.
|
||||
@@ -164,6 +237,19 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
{
|
||||
this.contentUsageService = contentUsageService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return contentUsageService
|
||||
*/
|
||||
private ContentUsageService getContentUsageService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (contentUsageService == null)
|
||||
{
|
||||
contentUsageService = (ContentUsageService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "ContentUsageService");
|
||||
}
|
||||
return contentUsageService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialises the wizard
|
||||
@@ -198,7 +284,7 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
*/
|
||||
public String getSummary()
|
||||
{
|
||||
if (tenantService.isEnabled())
|
||||
if (geTenantService().isEnabled())
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -667,22 +753,22 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
{
|
||||
// Admin Authority has full permissions by default (automatic - set in the permission config)
|
||||
// give full permissions to the new user
|
||||
this.permissionService.setPermission(homeSpaceRef, this.userName, permissionService.getAllPermission(), true);
|
||||
getPermissionService().setPermission(homeSpaceRef, this.userName, getPermissionService().getAllPermission(), true);
|
||||
|
||||
// by default other users will only have GUEST access to the space contents
|
||||
// or whatever is configured as the default in the web-client-xml config
|
||||
String permission = getDefaultPermission();
|
||||
if (permission != null && permission.length() != 0)
|
||||
{
|
||||
this.permissionService.setPermission(homeSpaceRef, permissionService.getAllAuthorities(), permission, true);
|
||||
getPermissionService().setPermission(homeSpaceRef, getPermissionService().getAllAuthorities(), permission, true);
|
||||
}
|
||||
|
||||
// the new user is the OWNER of their own space and always has full permissions
|
||||
this.ownableService.setOwner(homeSpaceRef, this.userName);
|
||||
this.permissionService.setPermission(homeSpaceRef, permissionService.getOwnerAuthority(), permissionService.getAllPermission(), true);
|
||||
getOwnableService().setOwner(homeSpaceRef, this.userName);
|
||||
getPermissionService().setPermission(homeSpaceRef, getPermissionService().getOwnerAuthority(), getPermissionService().getAllPermission(), true);
|
||||
|
||||
// now detach (if we did this first we could not set any permissions!)
|
||||
this.permissionService.setInheritParentPermissions(homeSpaceRef, false);
|
||||
getPermissionService().setInheritParentPermissions(homeSpaceRef, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -707,7 +793,7 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
{
|
||||
if (this.password.equals(this.confirm))
|
||||
{
|
||||
if (tenantService.isEnabled())
|
||||
if (geTenantService().isEnabled())
|
||||
{
|
||||
checkTenantUserName();
|
||||
}
|
||||
@@ -744,16 +830,16 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
props.put(ContentModel.PROP_PRESENCEUSERNAME, this.presenceUsername);
|
||||
|
||||
// create the node to represent the Person
|
||||
NodeRef newPerson = this.personService.createPerson(props);
|
||||
NodeRef newPerson = getPersonService().createPerson(props);
|
||||
|
||||
// ensure the user can access their own Person object
|
||||
this.permissionService.setPermission(newPerson, this.userName, permissionService.getAllPermission(), true);
|
||||
getPermissionService().setPermission(newPerson, this.userName, getPermissionService().getAllPermission(), true);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Created Person node for username: " + this.userName);
|
||||
|
||||
// create the ACEGI Authentication instance for the new user
|
||||
this.authenticationService.createAuthentication(this.userName, this.password.toCharArray());
|
||||
getAuthenticationService().createAuthentication(this.userName, this.password.toCharArray());
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Created User Authentication instance for username: " + this.userName);
|
||||
@@ -813,7 +899,7 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
}
|
||||
}
|
||||
|
||||
this.contentUsageService.setUserQuota(userName, (quota == null ? -1 : quota));
|
||||
getContentUsageService().setUserQuota(userName, (quota == null ? -1 : quota));
|
||||
}
|
||||
|
||||
protected long convertToBytes(long size, String units)
|
||||
@@ -863,20 +949,20 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
|
||||
protected void checkTenantUserName()
|
||||
{
|
||||
String currentDomain = tenantService.getCurrentUserDomain();
|
||||
String currentDomain = geTenantService().getCurrentUserDomain();
|
||||
if (! currentDomain.equals(TenantService.DEFAULT_DOMAIN))
|
||||
{
|
||||
if (! tenantService.isTenantUser(this.userName))
|
||||
if (! geTenantService().isTenantUser(this.userName))
|
||||
{
|
||||
// force domain onto the end of the username
|
||||
this.userName = tenantService.getDomainUser(this.userName, currentDomain);
|
||||
this.userName = geTenantService().getDomainUser(this.userName, currentDomain);
|
||||
logger.warn("Added domain to username: " + this.userName);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
tenantService.checkDomainUser(this.userName);
|
||||
geTenantService().checkDomainUser(this.userName);
|
||||
}
|
||||
catch (RuntimeException re)
|
||||
{
|
||||
|
||||
@@ -52,207 +52,260 @@ import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class DeleteUserDialog extends BaseDialogBean {
|
||||
|
||||
private static Logger logger = Logger.getLogger(DeleteUserDialog.class);
|
||||
public class DeleteUserDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
private static final String ERROR_DELETE = "error_delete_user";
|
||||
private static final long serialVersionUID = -4977064287365766306L;
|
||||
|
||||
private static final String ERROR_USER_DELETE = "error_delete_user_object";
|
||||
private static Logger logger = Logger.getLogger(DeleteUserDialog.class);
|
||||
|
||||
private static final String BUTTON_YES = "yes";
|
||||
private static final String ERROR_DELETE = "error_delete_user";
|
||||
|
||||
private static final String MSG_TITLE_DELETE_USER = "title_delete_user";
|
||||
private static final String ERROR_USER_DELETE = "error_delete_user_object";
|
||||
|
||||
private static final String BUTTON_NO = "no";
|
||||
private static final String BUTTON_YES = "yes";
|
||||
|
||||
private AuthenticationService authenticationService;
|
||||
private static final String MSG_TITLE_DELETE_USER = "title_delete_user";
|
||||
|
||||
private List<Node> users = Collections.<Node> emptyList();
|
||||
private static final String BUTTON_NO = "no";
|
||||
|
||||
private PersonService personService;
|
||||
transient private AuthenticationService authenticationService;
|
||||
|
||||
private Node person = null;
|
||||
private List<Node> users = Collections.<Node> emptyList();
|
||||
|
||||
private String searchCriteria = null;
|
||||
transient private PersonService personService;
|
||||
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled() {
|
||||
return false;
|
||||
}
|
||||
private Node person = null;
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception {
|
||||
try {
|
||||
String userName = (String) getPerson().getProperties().get("userName");
|
||||
private String searchCriteria = null;
|
||||
|
||||
// we only delete the user auth if Alfresco is managing the authentication
|
||||
Map session = context.getExternalContext().getSessionMap();
|
||||
if (session.get(LoginBean.LOGIN_EXTERNAL_AUTH) == null) {
|
||||
// delete the User authentication
|
||||
try {
|
||||
authenticationService.deleteAuthentication(userName);
|
||||
} catch (AuthenticationException authErr) {
|
||||
Utils.addErrorMessage(Application.getMessage(context, ERROR_USER_DELETE));
|
||||
}
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
String userName = (String) getPerson().getProperties().get("userName");
|
||||
|
||||
// we only delete the user auth if Alfresco is managing the authentication
|
||||
Map session = context.getExternalContext().getSessionMap();
|
||||
if (session.get(LoginBean.LOGIN_EXTERNAL_AUTH) == null)
|
||||
{
|
||||
// delete the User authentication
|
||||
try
|
||||
{
|
||||
getAuthenticationService().deleteAuthentication(userName);
|
||||
}
|
||||
|
||||
// delete the associated Person
|
||||
this.personService.deletePerson(userName);
|
||||
|
||||
// re-do the search to refresh the list
|
||||
search();
|
||||
} catch (Throwable e) {
|
||||
// rollback the transaction
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, ERROR_DELETE), e.getMessage()),
|
||||
e);
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
public String search() {
|
||||
|
||||
if (this.searchCriteria == null || this.searchCriteria.length() == 0) {
|
||||
this.users = Collections.<Node> emptyList();
|
||||
} else {
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
UserTransaction tx = null;
|
||||
|
||||
try {
|
||||
tx = Repository.getUserTransaction(context, true);
|
||||
tx.begin();
|
||||
|
||||
// define the query to find people by their first or last name
|
||||
String search = ISO9075.encode(this.searchCriteria);
|
||||
String query = "( TYPE:\"{http://www.alfresco.org/model/content/1.0}person\") AND "
|
||||
+ "((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:" + search
|
||||
+ "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:" + search
|
||||
+ "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + search + "*)))";
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Query: " + query);
|
||||
|
||||
// define the search parameters
|
||||
SearchParameters params = new SearchParameters();
|
||||
params.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||
params.addStore(Repository.getStoreRef());
|
||||
params.setQuery(query);
|
||||
|
||||
List<NodeRef> people = this.getSearchService().query(params).getNodeRefs();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Found " + people.size() + " users");
|
||||
|
||||
this.users = new ArrayList<Node>(people.size());
|
||||
|
||||
for (NodeRef nodeRef : people) {
|
||||
// create our Node representation
|
||||
MapNode node = new MapNode(nodeRef);
|
||||
|
||||
// set data binding properties
|
||||
// this will also force initialisation of the props now during the UserTransaction
|
||||
// it is much better for performance to do this now rather than during page bind
|
||||
Map<String, Object> props = node.getProperties();
|
||||
props.put("fullName", ((String) props.get("firstName")) + ' ' + ((String) props.get("lastName")));
|
||||
NodeRef homeFolderNodeRef = (NodeRef) props.get("homeFolder");
|
||||
if (homeFolderNodeRef != null) {
|
||||
props.put("homeSpace", homeFolderNodeRef);
|
||||
}
|
||||
|
||||
this.users.add(node);
|
||||
}
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
} catch (InvalidNodeRefException refErr) {
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_NODEREF),
|
||||
new Object[] { "root" }));
|
||||
this.users = Collections.<Node> emptyList();
|
||||
try {
|
||||
if (tx != null) {
|
||||
tx.rollback();
|
||||
}
|
||||
} catch (Exception tex) {
|
||||
}
|
||||
} catch (Exception err) {
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_GENERIC),
|
||||
err.getMessage()), err);
|
||||
this.users = Collections.<Node> emptyList();
|
||||
try {
|
||||
if (tx != null) {
|
||||
tx.rollback();
|
||||
}
|
||||
} catch (Exception tex) {
|
||||
}
|
||||
catch (AuthenticationException authErr)
|
||||
{
|
||||
Utils.addErrorMessage(Application.getMessage(context, ERROR_USER_DELETE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return null to stay on the same page
|
||||
return null;
|
||||
}
|
||||
// delete the associated Person
|
||||
getPersonService().deletePerson(userName);
|
||||
|
||||
// re-do the search to refresh the list
|
||||
search();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
// rollback the transaction
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, ERROR_DELETE), e.getMessage()), e);
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
public String search()
|
||||
{
|
||||
|
||||
if (this.searchCriteria == null || this.searchCriteria.length() == 0)
|
||||
{
|
||||
this.users = Collections.<Node> emptyList();
|
||||
}
|
||||
else
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
UserTransaction tx = null;
|
||||
|
||||
try
|
||||
{
|
||||
tx = Repository.getUserTransaction(context, true);
|
||||
tx.begin();
|
||||
|
||||
// define the query to find people by their first or last name
|
||||
String search = ISO9075.encode(this.searchCriteria);
|
||||
String query = "( TYPE:\"{http://www.alfresco.org/model/content/1.0}person\") AND " + "((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:" + search
|
||||
+ "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:" + search + "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + search
|
||||
+ "*)))";
|
||||
|
||||
public void setupUserAction(ActionEvent event) {
|
||||
UIActionLink link = (UIActionLink) event.getComponent();
|
||||
Map<String, String> params = link.getParameterMap();
|
||||
String id = params.get("id");
|
||||
if (id != null && id.length() != 0) {
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Setup for action, setting current Person to: " + id);
|
||||
logger.debug("Query: " + query);
|
||||
|
||||
try {
|
||||
// create the node ref, then our node representation
|
||||
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
|
||||
Node node = new Node(ref);
|
||||
// define the search parameters
|
||||
SearchParameters params = new SearchParameters();
|
||||
params.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||
params.addStore(Repository.getStoreRef());
|
||||
params.setQuery(query);
|
||||
|
||||
// remember the Person node
|
||||
setPerson(node);
|
||||
} catch (InvalidNodeRefException refErr) {
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(),
|
||||
Repository.ERROR_NODEREF), new Object[] { id }));
|
||||
List<NodeRef> people = this.getSearchService().query(params).getNodeRefs();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Found " + people.size() + " users");
|
||||
|
||||
this.users = new ArrayList<Node>(people.size());
|
||||
|
||||
for (NodeRef nodeRef : people)
|
||||
{
|
||||
// create our Node representation
|
||||
MapNode node = new MapNode(nodeRef);
|
||||
|
||||
// set data binding properties
|
||||
// this will also force initialisation of the props now during the UserTransaction
|
||||
// it is much better for performance to do this now rather than during page bind
|
||||
Map<String, Object> props = node.getProperties();
|
||||
props.put("fullName", ((String) props.get("firstName")) + ' ' + ((String) props.get("lastName")));
|
||||
NodeRef homeFolderNodeRef = (NodeRef) props.get("homeFolder");
|
||||
if (homeFolderNodeRef != null)
|
||||
{
|
||||
props.put("homeSpace", homeFolderNodeRef);
|
||||
}
|
||||
|
||||
this.users.add(node);
|
||||
}
|
||||
} else {
|
||||
setPerson(null);
|
||||
}
|
||||
}
|
||||
|
||||
public AuthenticationService getAuthenticationService() {
|
||||
return authenticationService;
|
||||
}
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
}
|
||||
catch (InvalidNodeRefException refErr)
|
||||
{
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_NODEREF), new Object[] { "root" }));
|
||||
this.users = Collections.<Node> emptyList();
|
||||
try
|
||||
{
|
||||
if (tx != null)
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Exception tex)
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(context, Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||
this.users = Collections.<Node> emptyList();
|
||||
try
|
||||
{
|
||||
if (tx != null)
|
||||
{
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
catch (Exception tex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setAuthenticationService(AuthenticationService authenticationService) {
|
||||
this.authenticationService = authenticationService;
|
||||
}
|
||||
// return null to stay on the same page
|
||||
return null;
|
||||
}
|
||||
|
||||
public PersonService getPersonService() {
|
||||
return personService;
|
||||
}
|
||||
public void setupUserAction(ActionEvent event)
|
||||
{
|
||||
UIActionLink link = (UIActionLink) event.getComponent();
|
||||
Map<String, String> params = link.getParameterMap();
|
||||
String id = params.get("id");
|
||||
if (id != null && id.length() != 0)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Setup for action, setting current Person to: " + id);
|
||||
|
||||
public void setPersonService(PersonService personService) {
|
||||
this.personService = personService;
|
||||
}
|
||||
try
|
||||
{
|
||||
// create the node ref, then our node representation
|
||||
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
|
||||
Node node = new Node(ref);
|
||||
|
||||
public Node getPerson() {
|
||||
return person;
|
||||
}
|
||||
// remember the Person node
|
||||
setPerson(node);
|
||||
}
|
||||
catch (InvalidNodeRefException refErr)
|
||||
{
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] { id }));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setPerson(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPerson(Node person) {
|
||||
this.person = person;
|
||||
}
|
||||
/**
|
||||
*@return authenticationService
|
||||
*/
|
||||
public AuthenticationService getAuthenticationService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (authenticationService == null)
|
||||
{
|
||||
authenticationService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAuthenticationService();
|
||||
}
|
||||
return authenticationService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCancelButtonLabel() {
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_NO);
|
||||
}
|
||||
public void setAuthenticationService(AuthenticationService authenticationService)
|
||||
{
|
||||
this.authenticationService = authenticationService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel() {
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_YES);
|
||||
}
|
||||
public PersonService getPersonService()
|
||||
{
|
||||
if (personService == null)
|
||||
{
|
||||
personService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPersonService();
|
||||
}
|
||||
return personService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContainerTitle() {
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_TITLE_DELETE_USER) + " '"
|
||||
+ getPerson().getProperties().get("userName") + "'";
|
||||
}
|
||||
public void setPersonService(PersonService personService)
|
||||
{
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
public Node getPerson()
|
||||
{
|
||||
return person;
|
||||
}
|
||||
|
||||
public void setPerson(Node person)
|
||||
{
|
||||
this.person = person;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCancelButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_NO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_YES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContainerTitle()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_TITLE_DELETE_USER) + " '" + getPerson().getProperties().get("userName") + "'";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
|
||||
public class EditContentUserRolesDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = -1690749440382024258L;
|
||||
|
||||
ContentUsersBean contentUsersBean;
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled()
|
||||
|
||||
@@ -31,7 +31,9 @@ import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
public class EditFileDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
@Override
|
||||
private static final long serialVersionUID = -4237199472024493269L;
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -39,7 +39,6 @@ import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.MimetypeService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.web.app.Application;
|
||||
@@ -54,6 +53,8 @@ import org.alfresco.web.ui.common.Utils;
|
||||
*/
|
||||
public class EditUserDetailsDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = 8663254425262484L;
|
||||
|
||||
private Node person;
|
||||
protected UsersBeanProperties properties;
|
||||
private NodeRef photoRef;
|
||||
|
||||
@@ -33,6 +33,8 @@ import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
|
||||
public class EditUserRolesDialog extends BaseDialogBean {
|
||||
|
||||
private static final long serialVersionUID = 614541023231055676L;
|
||||
|
||||
private static final String MSG_MODIFY_USER_ROLE = "modify_user_roles";
|
||||
|
||||
SpaceUsersBean spaceUsersBean;
|
||||
|
||||
@@ -46,6 +46,8 @@ import org.apache.log4j.Logger;
|
||||
*/
|
||||
public class EditUserWizard extends CreateUserWizard
|
||||
{
|
||||
private static final long serialVersionUID = 7529989488476324511L;
|
||||
|
||||
private static Logger logger = Logger.getLogger(EditUserWizard.class);
|
||||
|
||||
protected UsersBeanProperties properties;
|
||||
|
||||
@@ -37,6 +37,8 @@ import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
*/
|
||||
public class RemoveContentUserDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = -3090054828215666084L;
|
||||
|
||||
private static final String MSG_REMOVE_USER = "remove_user";
|
||||
|
||||
private ContentUsersBean contentUsersBean;
|
||||
|
||||
@@ -31,7 +31,9 @@ import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
|
||||
public class RemoveInvitedUserDialog extends BaseDialogBean {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -7457234588814115434L;
|
||||
|
||||
private static final String BUTTON_NO = "no";
|
||||
|
||||
private static final String BUTTON_YES = "yes";
|
||||
|
||||
@@ -31,6 +31,8 @@ import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
|
||||
public class UserConsoleDialog extends BaseDialogBean
|
||||
{
|
||||
private static final long serialVersionUID = -217662039833342921L;
|
||||
|
||||
private static final String MSG_CLOSE = "close";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.users;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
@@ -39,27 +40,30 @@ import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.cmr.usage.ContentUsageService;
|
||||
import org.alfresco.web.app.servlet.DownloadContentServlet;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.data.UIRichList;
|
||||
|
||||
public class UsersBeanProperties
|
||||
public class UsersBeanProperties implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 8874192805959149144L;
|
||||
|
||||
/** NodeService bean reference */
|
||||
private NodeService nodeService;
|
||||
transient private NodeService nodeService;
|
||||
|
||||
/** SearchService bean reference */
|
||||
private SearchService searchService;
|
||||
transient private SearchService searchService;
|
||||
|
||||
/** AuthenticationService bean reference */
|
||||
private AuthenticationService authenticationService;
|
||||
transient private AuthenticationService authenticationService;
|
||||
|
||||
/** PersonService bean reference */
|
||||
private PersonService personService;
|
||||
transient private PersonService personService;
|
||||
|
||||
/** ContentUsageService bean reference */
|
||||
private ContentUsageService contentUsageService;
|
||||
transient private ContentUsageService contentUsageService;
|
||||
|
||||
|
||||
/** Component reference for Users RichList control */
|
||||
@@ -82,6 +86,11 @@ public class UsersBeanProperties
|
||||
*/
|
||||
public NodeService getNodeService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (nodeService == null)
|
||||
{
|
||||
nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
|
||||
}
|
||||
return nodeService;
|
||||
}
|
||||
|
||||
@@ -90,6 +99,12 @@ public class UsersBeanProperties
|
||||
*/
|
||||
public SearchService getSearchService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (searchService == null)
|
||||
{
|
||||
searchService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getSearchService();
|
||||
}
|
||||
|
||||
return searchService;
|
||||
}
|
||||
|
||||
@@ -98,6 +113,11 @@ public class UsersBeanProperties
|
||||
*/
|
||||
public AuthenticationService getAuthenticationService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (authenticationService == null)
|
||||
{
|
||||
authenticationService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAuthenticationService();
|
||||
}
|
||||
return authenticationService;
|
||||
}
|
||||
|
||||
@@ -106,10 +126,29 @@ public class UsersBeanProperties
|
||||
*/
|
||||
public PersonService getPersonService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if(personService == null)
|
||||
{
|
||||
personService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPersonService();
|
||||
}
|
||||
return personService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*@return contentUsageService
|
||||
*/
|
||||
public ContentUsageService getContentUsageService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if(contentUsageService == null)
|
||||
{
|
||||
contentUsageService = (ContentUsageService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "ContentUsageService");
|
||||
}
|
||||
return contentUsageService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeService The NodeService to set.
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
@@ -248,25 +287,25 @@ public class UsersBeanProperties
|
||||
|
||||
public Long getUserUsage(String userName)
|
||||
{
|
||||
long usage = this.contentUsageService.getUserUsage(userName);
|
||||
long usage = getContentUsageService().getUserUsage(userName);
|
||||
return (usage == -1 ? null : usage);
|
||||
}
|
||||
|
||||
public Long getUserUsage()
|
||||
{
|
||||
long usage = this.contentUsageService.getUserUsage(this.userName);
|
||||
long usage = getContentUsageService().getUserUsage(this.userName);
|
||||
return (usage == -1 ? null : usage);
|
||||
}
|
||||
|
||||
public Long getUserQuota()
|
||||
{
|
||||
long quota = this.contentUsageService.getUserQuota(this.userName);
|
||||
long quota = getContentUsageService().getUserQuota(this.userName);
|
||||
return (quota == -1 ? null : quota);
|
||||
}
|
||||
|
||||
public boolean getUsagesEnabled()
|
||||
{
|
||||
return this.contentUsageService.getEnabled();
|
||||
return getContentUsageService().getEnabled();
|
||||
}
|
||||
|
||||
public String getPersonDescription()
|
||||
@@ -287,11 +326,11 @@ public class UsersBeanProperties
|
||||
{
|
||||
String avatarUrl = null;
|
||||
|
||||
List<AssociationRef> refs = this.nodeService.getTargetAssocs(this.person.getNodeRef(), ContentModel.ASSOC_AVATAR);
|
||||
List<AssociationRef> refs = getNodeService().getTargetAssocs(this.person.getNodeRef(), ContentModel.ASSOC_AVATAR);
|
||||
if (refs.size() == 1)
|
||||
{
|
||||
NodeRef photoRef = refs.get(0).getTargetRef();
|
||||
String name = (String)this.nodeService.getProperty(photoRef, ContentModel.PROP_NAME);
|
||||
String name = (String)getNodeService().getProperty(photoRef, ContentModel.PROP_NAME);
|
||||
avatarUrl = DownloadContentServlet.generateBrowserURL(photoRef, name);
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ public class AVMBrowseBean implements IContextListener
|
||||
transient private FormsService formsService;
|
||||
|
||||
/** The SearchService reference */
|
||||
protected SearchService searchService;
|
||||
transient private SearchService searchService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -307,6 +307,20 @@ public class AVMBrowseBean implements IContextListener
|
||||
this.searchService = searchService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return searchService
|
||||
*/
|
||||
public SearchService getSearchService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if(searchService == null)
|
||||
{
|
||||
searchService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getSearchService();
|
||||
}
|
||||
return searchService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter used by the Inline Edit XML JSP
|
||||
*
|
||||
@@ -1041,7 +1055,7 @@ public class AVMBrowseBean implements IContextListener
|
||||
sp.setLimit(searchLimit);
|
||||
}
|
||||
|
||||
results = this.searchService.query(sp);
|
||||
results = getSearchService().query(sp);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Search results returned: " + results.length());
|
||||
@@ -1067,7 +1081,7 @@ public class AVMBrowseBean implements IContextListener
|
||||
}
|
||||
if (path.length() > sandboxPathLength)
|
||||
{
|
||||
AVMNodeDescriptor avmRef = this.avmService.lookup(-1, path);
|
||||
AVMNodeDescriptor avmRef = getAvmService().lookup(-1, path);
|
||||
if (avmRef != null)
|
||||
{
|
||||
AVMNode node = addAVMNodeResult(avmRef);
|
||||
|
||||
@@ -28,11 +28,11 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.model.WCMModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.avm.AVMNodeType;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.LayeringDescriptor;
|
||||
@@ -136,6 +136,8 @@ public class AVMNode extends Node implements Map<String, Object>
|
||||
public final static NodePropertyResolver RESOLVER_DISPLAY_PATH =
|
||||
new NodePropertyResolver()
|
||||
{
|
||||
private static final long serialVersionUID = 368552730555134975L;
|
||||
|
||||
public Object get(final Node node)
|
||||
{
|
||||
if (! (node instanceof AVMNode))
|
||||
@@ -152,6 +154,8 @@ public class AVMNode extends Node implements Map<String, Object>
|
||||
public final static NodePropertyResolver RESOLVER_PARENT_PATH =
|
||||
new NodePropertyResolver()
|
||||
{
|
||||
private static final long serialVersionUID = -798036430912409497L;
|
||||
|
||||
public Object get(final Node node)
|
||||
{
|
||||
if (! (node instanceof AVMNode))
|
||||
|
||||
@@ -89,6 +89,8 @@ public class CreateFormWizard extends BaseWizardBean
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private static final long serialVersionUID = 4038447699556408567L;
|
||||
|
||||
/**
|
||||
* Simple wrapper class to represent a form data renderer
|
||||
*/
|
||||
@@ -1113,7 +1115,7 @@ public class CreateFormWizard extends BaseWizardBean
|
||||
boolean isWebForm = true;
|
||||
// TODO - need better way to determine WCM vs ECM context
|
||||
// can create form from CreateWebProject Wizard, or from Forms DataDictionary space or Web Forms DataDictionary space
|
||||
if (this.navigator.getCurrentNode().getNodeRef().equals(this.formsService.getContentFormsNodeRef()))
|
||||
if (this.navigator.getCurrentNode().getNodeRef().equals(getFormsService().getContentFormsNodeRef()))
|
||||
{
|
||||
// ECM form
|
||||
isWebForm = false;
|
||||
|
||||
@@ -688,7 +688,7 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
*/
|
||||
public List<SelectItem> getFormsList()
|
||||
{
|
||||
Collection<Form> forms = this.formsService.getWebForms();
|
||||
Collection<Form> forms = getFormsService().getWebForms();
|
||||
List<SelectItem> items = new ArrayList<SelectItem>(forms.size()+1);
|
||||
items.add(new SelectItem("", ""));
|
||||
for (Form form : forms)
|
||||
|
||||
@@ -274,8 +274,8 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
||||
{
|
||||
String stagingStore = AVMUtil.buildStagingStoreName(avmStore);
|
||||
String stagingStoreRoot = AVMUtil.buildSandboxRootPath(stagingStore);
|
||||
this.avmService.createDirectory(stagingStoreRoot, webapp);
|
||||
this.avmService.addAspect(AVMNodeConverter.ExtendAVMPath(stagingStoreRoot, webapp),
|
||||
getAvmService().createDirectory(stagingStoreRoot, webapp);
|
||||
getAvmService().addAspect(AVMNodeConverter.ExtendAVMPath(stagingStoreRoot, webapp),
|
||||
WCMAppModel.ASPECT_WEBAPP);
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
||||
{
|
||||
NodeRef wfRef = wChildRef.getChildRef();
|
||||
String wfName = (String)getNodeService().getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME);
|
||||
WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName);
|
||||
WorkflowDefinition wfDef = getWorkflowService().getDefinitionByName(wfName);
|
||||
if (wfDef != null)
|
||||
{
|
||||
WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription());
|
||||
|
||||
@@ -40,7 +40,6 @@ import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
@@ -72,6 +71,8 @@ import org.apache.commons.logging.LogFactory;
|
||||
public class RegenerateRenditionsWizard
|
||||
extends BaseWizardBean
|
||||
{
|
||||
private static final long serialVersionUID = -8573877482412328963L;
|
||||
|
||||
public final String REGENERATE_SCOPE_ALL = "all";
|
||||
public final String REGENERATE_SCOPE_FORM = "form";
|
||||
public final String REGENERATE_SCOPE_RENDERING_ENGINE_TEMPLATE = "rendering_engine_template";
|
||||
|
||||
@@ -35,7 +35,6 @@ import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.avm.actions.AVMUndoSandboxListAction;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
@@ -47,6 +46,7 @@ import org.alfresco.util.NameMatcher;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.VirtServerUtils;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
@@ -67,7 +67,7 @@ public class RevertAllDialog extends BaseDialogBean
|
||||
transient private AVMSyncService avmSyncService;
|
||||
transient private ActionService actionService;
|
||||
|
||||
protected NameMatcher nameMatcher;
|
||||
transient private NameMatcher nameMatcher;
|
||||
|
||||
// The virtualization server might need to be notified
|
||||
// because one or more of the files reverted could alter
|
||||
@@ -145,6 +145,19 @@ public class RevertAllDialog extends BaseDialogBean
|
||||
this.nameMatcher = nameMatcher;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return nameMatcher
|
||||
*/
|
||||
protected NameMatcher getNameMatcher()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (nameMatcher == null)
|
||||
{
|
||||
nameMatcher = (NameMatcher) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "globalPathExcluder");
|
||||
}
|
||||
return nameMatcher;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#finishImpl(javax.faces.context.FacesContext, java.lang.String)
|
||||
@@ -158,7 +171,7 @@ public class RevertAllDialog extends BaseDialogBean
|
||||
|
||||
// calcluate the list of differences between the user store and the staging area
|
||||
List<AVMDifference> diffs = this.getAvmSyncService().compare(
|
||||
-1, userStore, -1, stagingStore, this.nameMatcher);
|
||||
-1, userStore, -1, stagingStore, getNameMatcher());
|
||||
|
||||
List<Pair<Integer, String>> versionPaths = new ArrayList<Pair<Integer, String>>();
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public class SubmitDialog extends BaseDialogBean
|
||||
transient private AVMLockingService avmLockingService;
|
||||
transient private FormsService formsService;
|
||||
|
||||
protected NameMatcher nameMatcher;
|
||||
transient private NameMatcher nameMatcher;
|
||||
|
||||
|
||||
/** Current workflow for dialog context */
|
||||
@@ -224,6 +224,19 @@ public class SubmitDialog extends BaseDialogBean
|
||||
{
|
||||
this.nameMatcher = nameMatcher;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return nameMatcher
|
||||
*/
|
||||
protected NameMatcher getNameMatcher()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (nameMatcher == null)
|
||||
{
|
||||
nameMatcher = (NameMatcher) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "globalPathExcluder");
|
||||
}
|
||||
return nameMatcher;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param formsService The FormsService to set.
|
||||
@@ -991,7 +1004,7 @@ public class SubmitDialog extends BaseDialogBean
|
||||
String webapp = this.avmBrowseBean.getWebapp();
|
||||
String userStore = AVMUtil.buildStoreWebappPath(this.avmBrowseBean.getSandbox(), webapp);
|
||||
String stagingStore = AVMUtil.buildStoreWebappPath(this.avmBrowseBean.getStagingStore(), webapp);
|
||||
List<AVMDifference> diffs = this.getAvmSyncService().compare(-1, userStore, -1, stagingStore, nameMatcher);
|
||||
List<AVMDifference> diffs = this.getAvmSyncService().compare(-1, userStore, -1, stagingStore, getNameMatcher());
|
||||
selected = new ArrayList<AVMNodeDescriptor>(diffs.size());
|
||||
for (AVMDifference diff : diffs)
|
||||
{
|
||||
|
||||
@@ -44,6 +44,8 @@ import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
|
||||
public class WebSiteDetailsDialog extends BaseDetailsBean implements NavigationSupport
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -7951329243417867229L;
|
||||
|
||||
private static final String MSG_DETAILS_OF = "details_of";
|
||||
private static final String MSG_LOCATION = "location";
|
||||
|
||||
@@ -234,8 +234,10 @@ public class AdvancedSearchConfigElement extends ConfigElementAdapter implements
|
||||
* Simple wrapper class for custom advanced search property
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public static class CustomProperty
|
||||
public static class CustomProperty implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1457092137913897740L;
|
||||
|
||||
CustomProperty(String type, String aspect, String property, String labelId)
|
||||
{
|
||||
Type = type;
|
||||
|
||||
@@ -26,8 +26,6 @@ package org.alfresco.web.ui.common.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user