Author: chris.laprun(a)jboss.com
Date: 2007-09-04 22:26:05 -0400 (Tue, 04 Sep 2007)
New Revision: 8169
Removed:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
Log:
- JBPORTAL-1671: Split functionality into several pages (though everything is handled by
portlets.xhtml), removed now useless showPortletInfo.xhtml.
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-09-05
02:24:28 UTC (rev 8168)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-09-05
02:26:05 UTC (rev 8169)
@@ -24,7 +24,6 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
-import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.portlet.Portlet;
@@ -61,7 +60,7 @@
/** . */
private static final Logger log = Logger.getLogger(PortletManagerBean.class);
-
+
/** . */
private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
@@ -276,22 +275,22 @@
{
if (portlets == null)
{
- portlets = new ArrayList();
- List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
-
+ portlets = new ArrayList();
+ List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+
// Remove content editors
nextPortlet:
- for (Iterator i = tmpPortlets.iterator();i.hasNext();)
+ for (Iterator i = tmpPortlets.iterator(); i.hasNext();)
{
Portlet portlet = (Portlet)i.next();
PortletInfo info = portlet.getInfo();
- for (Iterator j =
info.getCapabilities().getAllModes().iterator();j.hasNext();)
+ for (Iterator j = info.getCapabilities().getAllModes().iterator();
j.hasNext();)
{
ModeInfo modeInfo = (ModeInfo)j.next();
if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
{
- continue nextPortlet;
+ continue nextPortlet;
}
}
//
@@ -356,33 +355,42 @@
selectedPlugin =
(String)ctx.getExternalContext().getRequestParameterMap().get("plugin");
selectedFrom = 0;
- try
+ if (selectedPortletId != null && selectedPortletId.length() != 0)
{
- // Get portlet
- PortletContext portletCtx =
PortletContext.createPortletContext(selectedPortletId);
- FederatedPortlet portlet =
(FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
+ try
+ {
+ // Get portlet
+ PortletContext portletCtx =
PortletContext.createPortletContext(selectedPortletId);
+ FederatedPortlet portlet =
(FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
- //
- selectedPortletInvokerId = portlet.getFederatedId();
+ //
+ selectedPortletInvokerId = portlet.getFederatedId();
- // Get sorted portlets
- List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
- Collections.sort(portlets, comparator);
+ // Get sorted portlets
+ List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+ Collections.sort(portlets, comparator);
- // Find the portlet index in the list
- for (int i = 0; i < portlets.size(); i++)
- {
- Portlet current = (Portlet)portlets.get(i);
- if (portlet.getContext().getId().equals(current.getContext().getId()))
+ // Find the portlet index in the list
+ for (int i = 0; i < portlets.size(); i++)
{
- selectedFrom = (i / paginationSize) * paginationSize;
- break;
+ Portlet current = (Portlet)portlets.get(i);
+ if (portlet.getContext().getId().equals(current.getContext().getId()))
+ {
+ selectedFrom = (i / paginationSize) * paginationSize;
+ break;
+ }
}
}
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
}
- catch (PortletInvokerException e)
+ else
{
- e.printStackTrace();
+ // make sure that nothing is selected portlet-wise
+ selectedPortletId = null;
+ selectedPortlet = null;
}
// It may be called from the instance stuff so we need to returns portlet
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-09-05
02:24:28 UTC (rev 8168)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-09-05
02:26:05 UTC (rev 8169)
@@ -3,12 +3,13 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
class="admin-ui">
-
+
<!-- Common nav -->
<h:form>
<ul class="topnav">
<li>
- <h:commandLink value="Portal Objects" action="objects"
actionListener="#{portalobjectmgr.selectRootObject}"/>
+ <h:commandLink value="Portal Objects"
action="objects"
+
actionListener="#{portalobjectmgr.selectRootObject}"/>
</li>
<li id="currentTab">Portlet Instances</li>
<li>
@@ -19,11 +20,12 @@
</li>
</ul>
</h:form>
-
+
<!-- Status message -->
- <h:message id="status" for="status"/>
+ <h:message id="status" for="status"
infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error"
warnClass="portlet-msg-alert"/>
<!-- Content -->
<ui:insert name="content">Content</ui:insert>
-
+
</div>
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05
02:24:28 UTC (rev 8168)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05
02:26:05 UTC (rev 8169)
@@ -7,93 +7,146 @@
xmlns:c="http://java.sun.com/jstl/core"
xmlns:pfc="http://www.jboss.com/portal/facelet/common">
- <ui:composition template="portletsTemplate.xhtml">
+<ui:composition template="portletsTemplate.xhtml">
- <ui:define name="content">
+<ui:define name="content">
- <h:form>
- <h:outputLabel for="menu">
- <h:outputText value="Portlet provider: "
styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- <h:selectOneMenu id="menu"
styleClass="portlet-form-field"
value="#{portletmgr.selectedPortletInvokerId}">
- <f:selectItems
value="#{portletmgr.portletInvokerItems}"/>
- </h:selectOneMenu>
- <h:commandButton value="Change"
styleClass="portlet-form-button"/>
- </h:form>
+<c:if test="#{empty portletmgr.selectedPlugin}">
+ <h:form>
+ <h:outputLabel for="menu">
+ <h:outputText value="View portlets provided by the portlet provider
named: "
+ styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:selectOneMenu id="menu" styleClass="portlet-form-field"
+ value="#{portletmgr.selectedPortletInvokerId}">
+ <f:selectItems value="#{portletmgr.portletInvokerItems}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="View portlets"
styleClass="portlet-form-button"/>
+ </h:form>
- <h:form>
- <table width="100%">
- <thead class="portlet-section-header">
- <tr>
- <th>Name</th>
- <th>Description</th>
- <th>Remote</th>
- <th>Remotable</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{portletmgr.selectedPortlets}"
var="portlet" varStatus="status">
- <tr
- class="#{portlet.context.id ==
portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index
% 2 == 0 ? 'portlet-section-body' :
'portlet-section-alternate')}">
- <td>
- <h:commandLink
- action="#{portletmgr.selectPortlet}"
- title="#{portlet.context.id}">
- <f:param name="id"
value="#{portlet.context.id}"/>
- <f:param name="plugin"
value="manager"/>
- <h:outputText
- rendered="#{not empty
portlet.name.value}">#{portlet.name.value}</h:outputText>
- <h:outputText title="#{portlet.context.id}"
rendered="#{empty
portlet.name.value}">#{portlet.context.id}</h:outputText>
- </h:commandLink>
- </td>
- <td>#{portlet.description.value}</td>
- <td><h:selectBooleanCheckbox disabled="true"
value="#{portlet.remote}"/></td>
- <td><h:selectBooleanCheckbox disabled="true"
value="#{portlet.remotable}"/></td>
- <td>
- <h:commandLink
action="#{portletmgr.selectPortlet}">
- <f:param name="id"
value="#{portlet.context.id}"/>
- <f:param name="plugin"
value="manager"/>
- Info
- </h:commandLink> | <h:commandLink
action="#{portletmgr.selectPortlet}">
- <f:param name="id"
value="#{portlet.context.id}"/>
- <f:param name="plugin"
value="preferences"/>
- Preferences
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <ul class="pagination">
- <c:if test="#{portletmgr.portletCount >
portletmgr.paginationSize}">
- <c:forEach begin="0" end="#{(portletmgr.portletCount
- 1) / portletmgr.paginationSize}" step="1"
- var="index">
- <li class="#{index == (portletmgr.selectedFrom /
portletmgr.paginationSize)? 'selected' : ''}">
- <h:commandLink
action="#{portletmgr.selectFrom}"><f:param name="from"
-
value="#{index * portletmgr.paginationSize}"/><h:outputText
- value="#{index *
portletmgr.paginationSize}"/></h:commandLink>
- </li>
- </c:forEach>
- </c:if>
- </ul>
- </h:form>
+ <h:form>
- <c:if test="#{portletmgr.selectedPortlet != null}">
- <c:if test="#{portletmgr.selectedPlugin ==
'manager'}">
- <hr/>
- <h3>Portlet details</h3>
- <ui:include src="showPortletInfo.xhtml"/>
- </c:if>
- <c:if test="#{portletmgr.selectedPlugin ==
'preferences'}">
- <hr/>
- <h3>Portlet preferences</h3>
- <ui:include src="common/editPreferences.xhtml">
- <ui:param name="prefs"
value="#{portletmgr.selectedPreferences}"/>
- </ui:include>
- </c:if>
+ <table width="100%">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Name</th>
+ <th>Description</th>
+ <th>Remote</th>
+ <th>Remotable</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portletmgr.selectedPortlets}"
var="portlet" varStatus="status">
+ <tr
+ class="#{portlet.context.id ==
portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index
% 2 == 0 ? 'portlet-section-body' :
'portlet-section-alternate')}">
+ <td>
+ <h:commandLink
+ action="#{portletmgr.selectPortlet}"
+ title="#{portlet.context.id}">
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="plugin"
value="manager"/>
+ <h:outputText
+ rendered="#{not empty
portlet.name.value}">#{portlet.name.value}</h:outputText>
+ <h:outputText title="#{portlet.context.id}"
rendered="#{empty
portlet.name.value}">#{portlet.context.id}</h:outputText>
+ </h:commandLink>
+ </td>
+ <td>#{portlet.description.value}</td>
+ <td><h:selectBooleanCheckbox disabled="true"
value="#{portlet.remote}"/></td>
+ <td><h:selectBooleanCheckbox disabled="true"
value="#{portlet.remotable}"/></td>
+ <td>
+ <h:commandLink
action="#{portletmgr.selectPortlet}">
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="plugin"
value="preferences"/>
+ Preferences
+ </h:commandLink> | <h:commandLink
action="#{portletmgr.selectPortlet}">
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="plugin"
value="createInstance"/>
+ Create instance
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <ul class="pagination">
+ <c:if test="#{portletmgr.portletCount >
portletmgr.paginationSize}">
+ <c:forEach begin="0" end="#{(portletmgr.portletCount - 1) /
portletmgr.paginationSize}" step="1"
+ var="index">
+ <li class="#{index == (portletmgr.selectedFrom /
portletmgr.paginationSize)? 'selected' : ''}">
+ <h:commandLink action="#{portletmgr.selectFrom}">
+ <f:param name="from" value="#{index *
portletmgr.paginationSize}"/>
+ #{index * portletmgr.paginationSize}
+ </h:commandLink>
+ </li>
+ </c:forEach>
</c:if>
+ </ul>
+ </h:form>
+</c:if>
- </ui:define>
- </ui:composition>
+<c:if test="#{portletmgr.selectedPlugin == 'manager'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet
Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} details
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/showPortletDetails.xhtml">
+ <ui:param name="portlet"
value="#{portletmgr.selectedPortlet}"/>
+ </ui:include>
+</c:if>
+
+<c:if test="#{portletmgr.selectedPlugin == 'preferences'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet
Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} preferences
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/editPreferences.xhtml">
+ <ui:param name="prefs"
value="#{portletmgr.selectedPreferences}"/>
+ </ui:include>
+</c:if>
+
+<c:if test="#{portletmgr.selectedPlugin == 'createInstance'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet
Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} instance creation
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <h:form id="add_instance_form"
styleClass="createObjectForm">
+ <span class="portlet-font">Create an instance named: </span>
+ <h:inputText id="instanceId"
value="#{createInstanceAction.instanceId}"
styleClass="portlet-form-input-field"
+ required="true"/>
+ <h:commandButton action="#{createInstanceAction.execute}"
value="Create instance"
+ styleClass="portlet-form-button"/>
+ <h:message for="instanceId"
errorClass="portlet-msg-error"/>
+ </h:form>
+</c:if>
+
+</ui:define>
+</ui:composition>
</div>
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-09-05
02:24:28 UTC (rev 8168)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-09-05
02:26:05 UTC (rev 8169)
@@ -8,7 +8,8 @@
<h:form>
<ul class="topnav">
<li>
- <h:commandLink value="Portal Objects" action="objects"
actionListener="#{portalobjectmgr.selectRootObject}"/>
+ <h:commandLink value="Portal Objects"
action="objects"
+
actionListener="#{portalobjectmgr.selectRootObject}"/>
</li>
<li>
<h:commandLink value="Portlet Instances"
action="instances"/>
@@ -19,11 +20,12 @@
</li>
</ul>
</h:form>
-
+
<!-- Status message -->
- <h:message id="status" for="status"/>
+ <h:message id="status" for="status"
infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error"
warnClass="portlet-msg-alert"/>
<!-- Content -->
<ui:insert name="content">Content</ui:insert>
-
+
</div>
Deleted:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-09-05
02:24:28 UTC (rev 8168)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-09-05
02:26:05 UTC (rev 8169)
@@ -1,29 +0,0 @@
-<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"
-
xmlns:c="http://java.sun.com/jstl/core">
- <br/>
-
- <!-- Portlet details -->
-
- <c:if test="#{portletmgr.selectedPortlet != null}">
- <ui:include src="common/showPortletDetails.xhtml">
- <ui:param name="portlet"
value="#{portletmgr.selectedPortlet}"/>
- </ui:include>
- </c:if>
-
- <!-- Instance creation -->
-
- <hr/>
- <h:form id="add_instance_form"
styleClass="createObjectForm">
- <span class="portlet-font">Create an instance named: </span>
- <h:inputText id="instanceId"
value="#{createInstanceAction.instanceId}"
styleClass="portlet-form-input-field"
- required="true"/>
- <h:commandButton action="#{createInstanceAction.execute}"
value="Create instance"
- styleClass="portlet-form-button"/>
- <h:message for="instanceId"
errorClass="portlet-msg-error"/>
- </h:form>
-
-</div>