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:
Gavin Cornwell
2008-02-21 12:31:41 +00:00
parent 7f0a4aeabc
commit 9b838b82c4
6 changed files with 175 additions and 68 deletions

View File

@@ -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";
}

View File

@@ -1030,6 +1030,32 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited
clear: both;
padding-bottom: 5px;
margin-bottom: 5px;
}
.nodeBrowserForm
{
border-top: 1px dotted #aaa;
padding: 8px;
margin: 4px 4px 16px 2px;
}
.nodeBrowserTable
{
border-collapse: collapse;
border: 1px solid #aaa;
margin-top: 3px;
}
.nodeBrowserTable th
{
background-color: #dfe6ed;
font-weight: bold;
padding: 4px;
text-align: left;
}
.nodeBrowserTable td
{
padding: 3px;
}

View File

@@ -22,8 +22,10 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<h:form id="node-browser-titlebar">
<h:form id="node-browser-titlebar" style="margin-bottom: 8px;">
<table width="100%">
<tr>
@@ -40,5 +42,3 @@
</table>
</h:form>
<br>

View File

@@ -40,13 +40,13 @@
<%@ include file="admin-title.jsp" %>
<h:form id="searchForm">
<h:form id="searchForm" styleClass="nodeBrowserForm">
<h:commandLink id="selectStores" action="#{AdminNodeBrowseBean.selectStores}">
<h:outputText styleClass="mainSubText" value="Stores"/>
</h:commandLink>
<br>
<br>
<br/>
<br/>
<h:outputText styleClass="mainTitle" value="Search"/>
@@ -73,39 +73,39 @@
</tr>
</table>
<br/>
<h:outputText styleClass="mainTitle" value="Node Identifier"/>
<table>
<tr>
<td><nobr><b>Primary Path:</b></nobr></td><td>
<nobr>
<h:commandLink id="selectPrimaryPath" action="#{AdminNodeBrowseBean.selectPrimaryPath}">
<h:outputText id="primaryPath" value="#{AdminNodeBrowseBean.primaryPath}"/>
</h:commandLink>
</nobr>
</td>
</tr>
<tr>
<td><b>Reference:</b></td><td><h:outputText id="nodeRef" value="#{AdminNodeBrowseBean.nodeRef}"/></td>
</tr>
<tr>
<td><b>Type:</b></td><td><h:outputText id="nodeType" value="#{AdminNodeBrowseBean.nodeType}"/></td>
</tr>
<tr>
<td><b>Parent:</b></td>
<td>
<h:commandLink id="selectPrimaryParent" action="#{AdminNodeBrowseBean.selectPrimaryParent}">
<h:outputText id="primaryParent" value="#{AdminNodeBrowseBean.primaryParent}"/>
</h:commandLink>
</td>
</tr>
<table cellpadding="4" cellspacing="0">
<tr>
<td><nobr><b>Primary Path:</b></nobr></td><td>
<nobr>
<h:commandLink id="selectPrimaryPath" action="#{AdminNodeBrowseBean.selectPrimaryPath}">
<h:outputText id="primaryPath" value="#{AdminNodeBrowseBean.primaryPath}"/>
</h:commandLink>
</nobr>
</td>
</tr>
<tr>
<td><b>Reference:</b></td><td><h:outputText id="nodeRef" value="#{AdminNodeBrowseBean.nodeRef}"/></td>
</tr>
<tr>
<td><b>Type:</b></td><td><h:outputText id="nodeType" value="#{AdminNodeBrowseBean.nodeType}"/></td>
</tr>
<tr>
<td><b>Parent:</b></td>
<td>
<h:commandLink id="selectPrimaryParent" action="#{AdminNodeBrowseBean.selectPrimaryParent}">
<h:outputText id="primaryParent" value="#{AdminNodeBrowseBean.primaryParent}"/>
</h:commandLink>
</td>
</tr>
</table>
<br>
<br/>
<h:outputText styleClass="mainTitle" value="Properties"/>
<h:dataTable id="properties" border="1" value="#{AdminNodeBrowseBean.properties}" var="property">
<h:dataTable id="properties" border="1" value="#{AdminNodeBrowseBean.properties}" var="property" styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>
@@ -154,7 +154,7 @@
</h:column>
</h:dataTable>
<br>
<br/>
<h:outputText styleClass="mainTitle" value="Aspects"/>
<h:dataTable id="aspects" value="#{AdminNodeBrowseBean.aspects}" var="aspect">
@@ -163,7 +163,7 @@
</h:column>
</h:dataTable>
<br>
<br/>
<h:outputText styleClass="mainTitle" value="Permissions"/>
<table>
@@ -172,8 +172,7 @@
</tr>
</table>
<br>
<h:dataTable id="permissions" border="1" value="#{AdminNodeBrowseBean.permissions}" var="permission">
<h:dataTable id="permissions" border="1" value="#{AdminNodeBrowseBean.permissions}" var="permission" styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="Assigned Permission"/>
@@ -194,10 +193,10 @@
</h:column>
</h:dataTable>
<br>
<br/>
<h:outputText styleClass="mainTitle" value="Children"/>
<h:dataTable id="children" border="1" value="#{AdminNodeBrowseBean.children}" var="child">
<h:dataTable id="children" border="1" value="#{AdminNodeBrowseBean.children}" var="child" styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="Child Name"/>
@@ -232,10 +231,10 @@
</h:column>
</h:dataTable>
<br>
<br/>
<h:outputText styleClass="mainTitle" value="Associations"/>
<h:dataTable id="assocs" border="1" value="#{AdminNodeBrowseBean.assocs}" var="assoc">
<h:dataTable id="assocs" border="1" value="#{AdminNodeBrowseBean.assocs}" var="assoc" styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="To Node"/>
@@ -253,10 +252,10 @@
</h:column>
</h:dataTable>
<br>
<br/>
<h:outputText styleClass="mainTitle" value="Parents"/>
<h:dataTable id="parents" border="1" value="#{AdminNodeBrowseBean.parents}" var="parent">
<h:dataTable id="parents" border="1" value="#{AdminNodeBrowseBean.parents}" var="parent" styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="Child Name"/>
@@ -283,7 +282,35 @@
</f:facet>
<h:outputText value="#{parent.typeQName}"/>
</h:column>
</h:dataTable>
</h:dataTable>
<br/>
<h:panelGroup id="storePropsPanel" rendered="#{AdminNodeBrowseBean.inAVMStore}">
<h:outputText styleClass="mainTitle" value="AVM Store Properties"/>
<h:dataTable id="storeProperties" border="1" value="#{AdminNodeBrowseBean.AVMStoreProperties}" var="storeProp"
styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>
</f:facet>
<h:outputText value="#{storeProp.name}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Value"/>
</f:facet>
<h:outputText value="#{storeProp.value}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Type"/>
</f:facet>
<h:outputText value="#{storeProp.type}"/>
</h:column>
</h:dataTable>
</h:panelGroup>
</h:form>

View File

@@ -40,23 +40,17 @@
<%@ include file="admin-title.jsp" %>
<h:form id="searchForm">
<table>
<tr>
<td>
<h:commandLink action="#{AdminNodeBrowseBean.selectStores}">
<h:outputText value="Stores"/>
</h:commandLink>
</td>
<td>&nbsp;|&nbsp;</td>
<td>
<h:commandLink action="nodeBrowser">
<h:outputText value="Node Browser"/>
</h:commandLink>
</td>
</table>
<h:form id="searchForm" styleClass="nodeBrowserForm">
<h:commandLink action="#{AdminNodeBrowseBean.selectStores}">
<h:outputText styleClass="mainSubText" value="Stores"/>
</h:commandLink>
<span class="mainSubText">&nbsp;|&nbsp;</span>
<h:commandLink action="nodeBrowser">
<h:outputText styleClass="mainSubText" value="Node Browser"/>
</h:commandLink>
<br>
<br/>
<br/>
<h:outputText styleClass="mainTitle" value="Search"/>
<table>
@@ -68,10 +62,10 @@
</tr>
</table>
<br>
<br/>
<span class="mainTitle">Results (<h:outputText value="#{AdminNodeBrowseBean.searchResults.length}"/> rows)</span>
<h:dataTable id="searchResults" border="1" value="#{AdminNodeBrowseBean.searchResults.rows}" var="row">
<h:dataTable id="searchResults" border="1" value="#{AdminNodeBrowseBean.searchResults.rows}" var="row" styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>

View File

@@ -40,17 +40,17 @@
<%@ include file="admin-title.jsp" %>
<h:form id="searchForm">
<h:form id="searchForm" styleClass="nodeBrowserForm">
<h:commandLink action="#{AdminNodeBrowseBean.selectStores}">
<h:outputText styleClass="mainSubText" value="Refresh view"/>
</h:commandLink>
<br>
<br>
<br/>
<br/>
<h:outputText styleClass="mainTitle" value="Stores"/>
<br>
<br/>
<h:dataTable id="stores" border="1" value="#{AdminNodeBrowseBean.stores}" var="store">
<h:dataTable id="stores" border="1" value="#{AdminNodeBrowseBean.stores}" var="store" styleClass="nodeBrowserTable">
<h:column>
<f:facet name="header">
<h:outputText value="Reference"/>