Merged V2.1 to HEAD

6418: Allow getLayeringInfo on deleted nodes.
   6419: fixes for submitting of deleted directories and regenerate renditions related fixes.
   6420: Added installs to build
   6421: Build fix for sdk
   6423: WCM-710 - Submit All feature reintroducted to WCM My Modified Files views
   6424: OpenOffice connection is now tested on bootstrap.
   6425: AWC-1446 - Space Selector would show spaces you do not have access to
   6426: WCM-699 - Staging area user assets
   6427: Rollback exceptions now explicitly handled by RetryingTransactionHelper to extract the cause of the exception.
   6428: Fix for AWC-1340
   6429: Fixed transaction boundaries for full index recovery components
   6433: AR-1660 - SMB and SMB2 signature check 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6732 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-10 21:50:49 +00:00
parent 26172af267
commit a8023d20a2
14 changed files with 111 additions and 51 deletions

View File

@@ -790,6 +790,24 @@ public abstract class AbstractItemSelector extends UIInput
* @return Node Service bean instance or throws exception if not found
*/
protected static NodeService getNodeService(FacesContext context)
{
NodeService service = Repository.getServiceRegistry(context).getNodeService();
if (service == null)
{
throw new IllegalStateException("Unable to obtain NodeService bean reference.");
}
return service;
}
/**
* Use Spring JSF integration to return the node Service bean instance
*
* @param context FacesContext
*
* @return Node Service bean instance or throws exception if not found
*/
protected static NodeService getFastNodeService(FacesContext context)
{
NodeService service = (NodeService)FacesContextUtils.getRequiredWebApplicationContext(
context).getBean("nodeService");

View File

@@ -91,7 +91,7 @@ public class UICategorySelector extends AbstractItemSelector
if (this.navigationId != null)
{
ChildAssociationRef parentRef = getNodeService(context).getPrimaryParent(
ChildAssociationRef parentRef = getFastNodeService(context).getPrimaryParent(
new NodeRef(Repository.getStoreRef(), this.navigationId));
Node parentNode = new Node(parentRef.getParentRef());

View File

@@ -70,7 +70,7 @@ public class UISpaceSelector extends AbstractItemSelector
{
try
{
ChildAssociationRef parentRef = getNodeService(context).getPrimaryParent(
ChildAssociationRef parentRef = getFastNodeService(context).getPrimaryParent(
new NodeRef(Repository.getStoreRef(), this.navigationId));
id = parentRef.getParentRef().getId();
}
@@ -89,7 +89,7 @@ public class UISpaceSelector extends AbstractItemSelector
List<ChildAssociationRef> allKids = getNodeService(context).getChildAssocs(nodeRef,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
DictionaryService dd = getDictionaryService(context);
NodeService service = getNodeService(context);
NodeService service = getFastNodeService(context);
// filter out those children that are not spaces
List<NodeRef> spaceKids = new ArrayList<NodeRef>();
@@ -126,7 +126,7 @@ public class UISpaceSelector extends AbstractItemSelector
public String getItemIcon(FacesContext context, NodeRef ref)
{
String icon = (String)getNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON);
String icon = (String)getFastNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON);
if (icon != null)
{
icon = "/images/icons/" + icon + "-16.gif";

View File

@@ -142,10 +142,10 @@ public class UIWebProjectFolderSelector extends AbstractItemSelector
public Collection<NodeRef> getRootChildren(FacesContext context)
{
// query for all nodes under the "Web Projects" foler in company home.
// query for all nodes under the "Web Projects" folder in company home.
FacesContext fc = FacesContext.getCurrentInstance();
String xpath = Application.getRootPath(fc) + "/" + Application.getWebsitesFolderName(fc) + "/*";
NodeRef rootNodeRef = getNodeService(fc).getRootNode(Repository.getStoreRef());
NodeRef rootNodeRef = getFastNodeService(fc).getRootNode(Repository.getStoreRef());
NamespaceService resolver = Repository.getServiceRegistry(fc).getNamespaceService();
SearchService searchService = Repository.getServiceRegistry(fc).getSearchService();
List<NodeRef> nodes = searchService.selectNodes(rootNodeRef, xpath, null, resolver, false);
@@ -179,7 +179,7 @@ public class UIWebProjectFolderSelector extends AbstractItemSelector
public String getItemIcon(FacesContext context, NodeRef ref)
{
String icon = (String)getNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON);
String icon = (String)getFastNodeService(context).getProperty(ref, ApplicationModel.PROP_ICON);
if (icon != null)
{
icon = "/images/icons/" + icon + "-16.gif";