Author: julien(a)jboss.com
Date: 2007-02-27 03:38:52 -0500 (Tue, 27 Feb 2007)
New Revision: 6417
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/pageNavigation.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/portalNavigation.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/tabTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/windowNavigation.xhtml
Log:
use an unified children navigation but keep nodes splitted by type
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java 2007-02-27
08:01:44 UTC (rev 6416)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java 2007-02-27
08:38:52 UTC (rev 6417)
@@ -331,7 +331,7 @@
public PortalObject getSelectedObject()
{
- PortalObject result = null;
+ PortalObject result;
if (selectedId != null)
{
result = getObjectFromId(selectedId);
@@ -519,10 +519,9 @@
}
}
- public List getPortalNodes()
+ private List getNodes(int mask)
{
- PortalObject root = portalObjectContainer.getRootObject();
- Collection test = root.getChildren(PortalObject.PORTAL_MASK);
+ Collection test = getSelectedObject().getChildren(mask);
// TODO: don't recreate the objects each time !
// TODO: Use a datamodel
ArrayList result = new ArrayList();
@@ -535,34 +534,19 @@
return result;
}
+ public List getPortalNodes()
+ {
+ return getNodes(PortalObject.PORTAL_MASK);
+ }
+
public List getPageNodes()
{
- Collection test = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
- // TODO: don't recreate the objects each time !
- // TODO: Use a datamodel
- ArrayList result = new ArrayList();
- Iterator it = test.iterator();
- while (it.hasNext())
- {
- PortalObject po = (PortalObject)it.next();
- result.add(new PortalObjectBean(po));
- }
- return result;
+ return getNodes(PortalObject.PAGE_MASK);
}
public List getWindowNodes()
{
- Collection test = getSelectedObject().getChildren(PortalObject.WINDOW_MASK);
- // TODO: don't recreate the objects each time !
- // TODO: Use a datamodel
- ArrayList result = new ArrayList();
- Iterator it = test.iterator();
- while (it.hasNext())
- {
- PortalObject po = (PortalObject)it.next();
- result.add(new PortalObjectBean(po));
- }
- return result;
+ return getNodes(PortalObject.WINDOW_MASK);
}
public SelectItem[] getInstanceItems()
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/pageNavigation.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/pageNavigation.xhtml 2007-02-27
08:01:44 UTC (rev 6416)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/pageNavigation.xhtml 2007-02-27
08:38:52 UTC (rev 6417)
@@ -1,51 +1,23 @@
<div
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
- <h:form>
+ <h:form>
<h:commandLink action="#{portalobjectmgr.goBack}">
- <h:outputText value="Go back"/>
+ <h:outputText value="Go back"/>
</h:commandLink>
- </h:form>
-
- <h:form>
- <h:dataTable value="#{portalobjectmgr.pageNodes}" var="page"
style="border-spacing: 20px 7px">
- <h:column>
- <f:facet name="header"><h:outputText value="Portal
Page"/></f:facet>
- <h:commandLink action="pages"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="#{page.name}"/>
- <f:param name="id" value="#{page.id}"/>
- </h:commandLink>
- </h:column>
- <h:column>
- <f:facet name="header"><h:outputText
value="Actions"/></f:facet>
- <h:commandLink action="windows"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Edit"/>
- <f:param name="id" value="#{page.id}"/>
- </h:commandLink> |
- <h:commandLink action="editPageSecurity"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Security"/>
- <f:param name="id" value="#{page.id}"/>
- </h:commandLink> |
- <h:commandLink action="editPageTheme"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Theme"/>
- <f:param name="id" value="#{page.id}"/>
- </h:commandLink> |
- <h:commandLink action="pages"
actionListener="#{portalobjectmgr.destroyObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{page.id}"/>
- </h:commandLink>
- </h:column>
- </h:dataTable>
- </h:form>
+ </h:form>
+ <ui:include src="nodeNavigation.xhtml"/>
+
<h:form id="portal_form">
<h:inputText id="name" value="#{addPageAction.pageName}"
validator="#{addPageAction.validatePageName}"
required="true"/>
- <h:commandButton action="#{addPageAction.execute}" value="Add
portal page" class="portlet-form-button"/>
+ <h:commandButton action="#{addPageAction.execute}" value="Add
portal page" styleClass="portlet-form-button"/>
<h:message for="name" style="color: red"/>
</h:form>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/portalNavigation.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/portalNavigation.xhtml 2007-02-27
08:01:44 UTC (rev 6416)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/portalNavigation.xhtml 2007-02-27
08:38:52 UTC (rev 6417)
@@ -1,45 +1,16 @@
<div
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
- <h:form>
-
- <h:dataTable value="#{portalobjectmgr.portalNodes}"
var="portal" style="border-spacing: 20px 7px">
- <h:column>
- <f:facet name="header"><h:outputText value="Portal
Name"/></f:facet>
- <h:commandLink action="pages"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="#{portal.name}"/>
- <f:param name="id" value="#{portal.id}"/>
- </h:commandLink>
- </h:column>
- <h:column>
- <f:facet name="header"><h:outputText
value="Actions"/></f:facet>
- <h:commandLink action="editPortalPreferences"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Edit"/>
- <f:param name="id" value="#{portal.id}"/>
- </h:commandLink> |
- <h:commandLink action="editPortalSecurity"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Security"/>
- <f:param name="id" value="#{portal.id}"/>
- </h:commandLink> |
- <h:commandLink action="editPortalTheme"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Theme"/>
- <f:param name="id" value="#{portal.id}"/>
- </h:commandLink> |
- <h:commandLink action="portals"
actionListener="#{portalobjectmgr.destroyObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{portal.id}"/>
- </h:commandLink>
- </h:column>
- </h:dataTable>
- </h:form>
+ <ui:include src="nodeNavigation.xhtml"/>
<h:form id="portal_form">
<h:inputText id="name" value="#{portalAction.portalName}"
validator="#{portalAction.validatePortalName}"
required="true"/>
- <h:commandButton action="#{portalAction.addPortal}" value="Add
portal" class="portlet-form-button"/>
+ <h:commandButton action="#{portalAction.addPortal}" value="Add
portal" styleClass="portlet-form-button"/>
<h:message for="name" style="color: red"/>
</h:form>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/tabTemplate.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/tabTemplate.xhtml 2007-02-27
08:01:44 UTC (rev 6416)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/tabTemplate.xhtml 2007-02-27
08:38:52 UTC (rev 6417)
@@ -1,4 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<div
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/windowNavigation.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/windowNavigation.xhtml 2007-02-27
08:01:44 UTC (rev 6416)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/windowNavigation.xhtml 2007-02-27
08:38:52 UTC (rev 6417)
@@ -1,36 +1,9 @@
<div
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
+ <ui:include src="nodeNavigation.xhtml"/>
- <h:form>
- <h:dataTable value="#{portalobjectmgr.windowNodes}"
var="window" style="border-spacing: 20px 7px">
- <h:column>
- <f:facet name="header"><h:outputText
value="Window"/></f:facet>
- <h:outputText value="#{window.name}"/>
- </h:column>
- <h:column>
- <f:facet name="header"><h:outputText
value="Actions"/></f:facet>
- <h:commandLink action="editWindowPreferences"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Edit"/>
- <f:param name="id" value="#{window.id}"/>
- </h:commandLink> |
- <h:commandLink action="editWindowSecurity"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Security"/>
- <f:param name="id" value="#{window.id}"/>
- </h:commandLink> |
- <h:commandLink action="editWindowTheme"
actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Theme"/>
- <f:param name="id" value="#{window.id}"/>
- </h:commandLink> |
- <h:commandLink action="windows"
actionListener="#{portalobjectmgr.destroyObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{window.id}"/>
- </h:commandLink>
- </h:column>
- </h:dataTable>
- </h:form>
-
-
</div>