mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
7410: Node Browser changes git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8350 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,6 +27,7 @@ package org.alfresco.web.bean.admin;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -37,6 +38,8 @@ import javax.faces.model.ListDataModel;
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
@@ -99,6 +102,7 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
transient private DataModel assocs = null;
|
||||
private Boolean inheritPermissions = null;
|
||||
transient private DataModel permissions = null;
|
||||
transient private DataModel avmStoreProps = null;
|
||||
|
||||
// supporting repository services
|
||||
transient private NodeService nodeService;
|
||||
@@ -106,6 +110,7 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
transient private SearchService searchService;
|
||||
transient private NamespaceService namespaceService;
|
||||
transient private PermissionService permissionService;
|
||||
transient private AVMService avmService;
|
||||
|
||||
/**
|
||||
* @param nodeService node service
|
||||
@@ -191,6 +196,23 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
}
|
||||
return permissionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param avmService AVM service
|
||||
*/
|
||||
public void setAVMService(AVMService avmService)
|
||||
{
|
||||
this.avmService = avmService;
|
||||
}
|
||||
|
||||
private AVMService getAVMService()
|
||||
{
|
||||
if (avmService == null)
|
||||
{
|
||||
avmService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMService();
|
||||
}
|
||||
return avmService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of repository stores
|
||||
@@ -401,6 +423,41 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
}
|
||||
return assocs;
|
||||
}
|
||||
|
||||
public boolean getInAVMStore()
|
||||
{
|
||||
return nodeRef.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM);
|
||||
}
|
||||
|
||||
public DataModel getAVMStoreProperties()
|
||||
{
|
||||
if (avmStoreProps == null)
|
||||
{
|
||||
// work out the store name from current nodeRef
|
||||
String store = nodeRef.getStoreRef().getIdentifier();
|
||||
Map<QName, PropertyValue> props = getAVMService().getStoreProperties(store);
|
||||
List<Map<String, String>> storeProperties = new ArrayList<Map<String, String>>();
|
||||
|
||||
for (Map.Entry<QName, PropertyValue> property : props.entrySet())
|
||||
{
|
||||
Map<String, String> map = new HashMap<String, String>(2);
|
||||
map.put("name", property.getKey().toString());
|
||||
map.put("type", property.getValue().getActualType());
|
||||
String val = property.getValue().getStringValue();
|
||||
if (val == null)
|
||||
{
|
||||
val = "null";
|
||||
}
|
||||
map.put("value", val);
|
||||
|
||||
storeProperties.add(map);
|
||||
}
|
||||
|
||||
avmStoreProps = new ListDataModel(storeProperties);
|
||||
}
|
||||
|
||||
return avmStoreProps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current query language
|
||||
@@ -472,6 +529,9 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
StoreRef storeRef = (StoreRef)getStores().getRowData();
|
||||
NodeRef rootNode = getNodeService().getRootNode(storeRef);
|
||||
setNodeRef(rootNode);
|
||||
|
||||
this.avmStoreProps = null;
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user