Author: julien(a)jboss.com
Date: 2007-02-27 18:58:43 -0500 (Tue, 27 Feb 2007)
New Revision: 6442
Added:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editPreferences.xhtml
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPortalSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/instances.xhtml
trunk/faces/src/main/org/jboss/portal/faces/matrix/Cell.java
Log:
started revamp of instances management
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java 2007-02-27
23:47:08 UTC (rev 6441)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java 2007-02-27
23:58:43 UTC (rev 6442)
@@ -196,6 +196,8 @@
}
}
+ public abstract String execute();
+
public abstract RoleModule getRoleModule();
public abstract DomainConfigurator getDomainConfigurator();
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java 2007-02-27
23:47:08 UTC (rev 6441)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java 2007-02-27
23:58:43 UTC (rev 6442)
@@ -34,6 +34,7 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
+import javax.faces.application.FacesMessage;
import org.jboss.logging.Logger;
import org.jboss.portal.common.util.LocalizedString;
@@ -88,14 +89,12 @@
/** . */
private Integer selectedRow;
+ /** . */
private String sortColumn;
+ /** . */
private boolean sortAscending;
- public InstanceManagerBean()
- {
- }
-
public String getSortColumn()
{
return sortColumn;
@@ -252,8 +251,8 @@
ExternalContext ectx = ctx.getExternalContext();
Map params = ectx.getRequestParameterMap();
selectedId = (String)params.get("id");
+ selectedPlugin = (String)params.get("plugin");
selectedPreferences = null;
- selectedPlugin = "preferences";
}
public void deleteInstance()
@@ -436,6 +435,16 @@
}
}
+ public String execute()
+ {
+ String stringMessage = "Security has been correctly updated";
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
+ selectedId = null;
+ selectedPlugin = null;
+ return null;
+ }
+
public RoleModule getRoleModule()
{
return roleModule;
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
23:47:08 UTC (rev 6441)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java 2007-02-27
23:58:43 UTC (rev 6442)
@@ -354,38 +354,6 @@
{
return selectedPlugin;
}
-
- public String modifySecurity()
- {
- // Update is made by JSF
- // Just need to give the correct outcome
- PortalObject po = getSelectedObject();
- if (po.getType() == PortalObject.TYPE_PORTAL)
- {
- String stringMessage = "Security has been correctly updated on the portal
named: " + po.getName();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
- FacesContext.getCurrentInstance().addMessage("status", message);
- setSelectedObject(po.getParent());
- return "portals";
- }
- else if (po.getType() == PortalObject.TYPE_PAGE)
- {
- String stringMessage = "Security has been correctly updated on the page
named: " + po.getName();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
- FacesContext.getCurrentInstance().addMessage("status", message);
- setSelectedObject(po.getParent());
- return "pages";
- }
- else if (po.getType() == PortalObject.TYPE_WINDOW)
- {
- String stringMessage = "Security has been correctly updated on the window
named: " + po.getName();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
- FacesContext.getCurrentInstance().addMessage("status", message);
- setSelectedObject(po.getParent());
- return "windows";
- }
- return "";
- }
public void selectPlugin()
{
@@ -727,6 +695,32 @@
};
}
+ public String execute()
+ {
+ String stringMessage = "Security has been correctly updated on the
page";
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
+
+ //
+ PortalObject po = getSelectedObject();
+ setSelectedObject(po.getParent());
+
+ //
+ if (po.getType() == PortalObject.TYPE_PORTAL)
+ {
+ return "portals";
+ }
+ else if (po.getType() == PortalObject.TYPE_PAGE)
+ {
+ return "pages";
+ }
+ else if (po.getType() == PortalObject.TYPE_WINDOW)
+ {
+ return "windows";
+ }
+ return null;
+ }
+
public RoleModule getRoleModule()
{
return roleModule;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java 2007-02-27
23:47:08 UTC (rev 6441)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java 2007-02-27
23:58:43 UTC (rev 6442)
@@ -428,6 +428,11 @@
}
}
+ public String execute()
+ {
+ return null;
+ }
+
public RoleModule getRoleModule()
{
return roleModule;
Added:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editPreferences.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editPreferences.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editPreferences.xhtml 2007-02-27
23:58:43 UTC (rev 6442)
@@ -0,0 +1,72 @@
+<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">
+
+<h:form>
+ <h:dataTable value="#{preferences.model}" var="row"
style="border-spacing: 20px 7px">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Key"/>
+ </f:facet>
+ <h:outputText value="#{row.key}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Name"/>
+ </f:facet>
+ <h:outputText value="#{row.name}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="ReadOnly"/>
+ </f:facet>
+ <h:outputText value="#{row.readOnly}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Actions"/>
+ </f:facet>
+ <h:commandLink
+ rendered="#{row.cell.value != null and preferences.model.mutable}"
+ action="#{action.selectRow}">Edit</h:commandLink> |
+ <h:commandLink
+ rendered="#{row.cell.value != null and preferences.model.mutable}"
+ action="#{action.deleteCell}">Delete</h:commandLink>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Value"/>
+ </f:facet>
+ <h:outputText value="#{row.cell.description}"/>
+ </h:column>
+ </h:dataTable>
+</h:form>
+
+<c:if test="#{preferences.selectedPreference != null}">
+ <h:form>
+ <h:dataTable
+ id="string_values"
+ var="row"
+ value="#{preferences.selectedPreference.valueIndices}">
+ <h:column>
+ <h:outputLabel for="value_#{row}">
+ <h:outputText value="Value #{row}: "
styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:inputText
value="#{preferences.selectedPreference.value[row]}"
styleClass="portlet-form-input-field"/>
+ <h:commandButton id="value_#{row}"
action="#{action.deleteLine}" value="Delete"
styleClass="portlet-form-button"/>
+ </h:column>
+ </h:dataTable>
+ <h:commandButton action="#{action.updateCell}"
value="Update" styleClass="portlet-form-button"/>
+ </h:form>
+ <h:form>
+ <h:outputLabel for="new_value">
+ <h:outputText value="New value: "
styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:inputText id="new_value" value="#{action.appendedValue}"
styleClass="portlet-form-input-field"/>
+ <h:commandButton action="#{action.appendLine}"
value="Append" styleClass="portlet-form-button"/>
+ </h:form>
+</c:if>
+</div>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editSecurity.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editSecurity.xhtml 2007-02-27
23:47:08 UTC (rev 6441)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/common/editSecurity.xhtml 2007-02-27
23:58:43 UTC (rev 6442)
@@ -7,18 +7,20 @@
<h:form>
<h:dataTable
var="role"
- value="#{portalobjectmgr.auth.roles}">
+ value="#{auth.roles}">
<h:column>
- <b><h:outputText value="#{role == '__unchecked__' ?
'Unchecked' : (portalobjectmgr.auth.roleDisplayNameMap[role] != null ?
portalobjectmgr.auth.roleDisplayNameMap[role] : role)}"/></b>
+ <b><h:outputText value="#{role == '__unchecked__' ?
'Unchecked' : (auth.roleDisplayNameMap[role] != null ?
auth.roleDisplayNameMap[role] : role)}"/></b>
</h:column>
<h:column>
<h:selectManyCheckbox id="cars"
- value="#{portalobjectmgr.auth.forRole[role]}">
- <f:selectItems
value="#{portalobjectmgr.auth.availableActions}"/>
+ value="#{auth.forRole[role]}">
+ <f:selectItems value="#{auth.availableActions}"/>
</h:selectManyCheckbox>
</h:column>
</h:dataTable>
- <h:commandButton action="#{portalobjectmgr.modifySecurity}"
value="Update" class="portlet-form-button"/>
+
+ <h:commandButton action="#{auth.execute}" value="Update"
styleClass="portlet-form-button"/>
+
</h:form>
</h:panelGroup>
</div>
\ No newline at end of file
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPortalSecurity.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPortalSecurity.xhtml 2007-02-27
23:47:08 UTC (rev 6441)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPortalSecurity.xhtml 2007-02-27
23:58:43 UTC (rev 6442)
@@ -9,7 +9,9 @@
<h3>Please set the permissions for the portal: <h:outputText
value="#{portalobjectmgr.selectedObject.name}"/></h3>
- <ui:include src="/WEB-INF/jsp/management/common/editSecurity.xhtml"/>
+ <ui:include src="/WEB-INF/jsp/management/common/editSecurity.xhtml">
+ <ui:param name="auth" value="#{portalobjectmgr.auth}"/>
+ </ui:include>
</ui:define>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/instances.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/instances.xhtml 2007-02-27
23:47:08 UTC (rev 6441)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/instances.xhtml 2007-02-27
23:58:43 UTC (rev 6442)
@@ -3,106 +3,71 @@
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:jbp="http://www.jboss.com/portal">
+
xmlns:jbp="http://www.jboss.com/portal"
+
xmlns:c="http://java.sun.com/jstl/core">
<ui:composition
template="/WEB-INF/jsp/management/instancesTemplate.xhtml">
<ui:define name="content">
-
-<h:panelGrid
- id="thepanel"
- columns="3"
- rowClasses="vertTop"
- columnClasses="menu,,content">
-<h:panelGroup
- id="panel1">
- <h:form id="instance_list">
- <h:dataTable
- id="instancesTable"
- var="instance"
- value="#{instancemgr.instances}"
- rows="15">
- <h:column>
- <f:facet name="header">
- <h:outputText value="Id"/>
- </f:facet>
- <h:commandLink action="#{instancemgr.selectInstance}">
- <h:outputText value="#{instance[0].id}"/>
- <f:param name="id" value="#{instance[0].id}"/>
- </h:commandLink>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Portlet"/>
- </f:facet>
- <h:commandLink rendered="#{instance[1] != null}"
action="#{portletmgr.selectPortlet}">
- <f:param name="id"
value="#{instance[1].context.id}"/>
- <h:outputText value="#{instance[1].name}"/>
- </h:commandLink>
- <h:outputText rendered="#{instance[1] == null}"
value="Portlet not deployed"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Action"/>
- </f:facet>
- <h:commandLink action="#{instancemgr.deleteInstance}">
- <h:graphicImage value="/images/management/delete.png"
alt="Delete"
-
style="vertical-align:middle;border-width:0"/>
- <f:param name="id" value="#{instance[0].id}"/>
- </h:commandLink>
- </h:column>
- </h:dataTable>
-
- <jbp:scroller for="instancesTable"
styleClass="portlet-form-button"/>
-
- </h:form>
-</h:panelGroup>
-<h:panelGroup id="splitter">
- <h:graphicImage value="/images/management/line-trunk.gif"
height="100%" width="3"/>
-</h:panelGroup>
-<h:panelGroup id="pg2">
- <div align="center">
- <h:form id="plugin_nav">
- <h:panelGrid columns="2" border="0"
cellspacing="0" cellpadding="0" rowClasses="vertTop">
- <h:commandLink
- action="#{instancemgr.selectPlugin}"
- style="#{instancemgr.selectedPlugin == 'preferences' ?
'font-weight:bold' : ''}">
- <h:graphicImage value="/images/management/preferences.png"
style="vertical-align:middle;border-width:0"/>
- <h:outputText> </h:outputText>
- <h:outputText value="Preferences"/>
- <f:param name="plugin" value="preferences"/>
- <h:outputText>   </h:outputText>
- </h:commandLink>
- <h:commandLink
- action="#{instancemgr.selectPlugin}"
- style="#{instancemgr.selectedPlugin == 'security' ?
'font-weight:bold' : ''}">
- <h:graphicImage value="/images/management/security.png"
style="vertical-align:middle;border-width:0"/>
- <h:outputText> </h:outputText>
- <h:outputText value="Security"/>
- <f:param name="plugin" value="security"/>
- </h:commandLink>
- </h:panelGrid>
- </h:form>
- </div>
- <h:panelGroup
- id="pg3"
- rendered="#{instancemgr.selectedInstance != null}">
- <h:panelGroup
- rendered="#{instancemgr.selectedPlugin == 'security'}">
- <ui:include
src="/WEB-INF/jsp/management/plugins/security.xhtml">
- <ui:param name="auth"
value="#{instancemgr.auth}"/>
- </ui:include>
- </h:panelGroup>
- <h:panelGroup
- rendered="#{instancemgr.selectedPlugin == 'preferences'}">
- <ui:include
src="/WEB-INF/jsp/management/plugins/preferences.xhtml">
- <ui:param name="preferences"
value="#{instancemgr.selectedPreferences}"/>
- <ui:param name="action"
value="#{preferenceAction}"/>
- </ui:include>
- </h:panelGroup>
- </h:panelGroup>
-</h:panelGroup>
-</h:panelGrid>
+
+ <h:form>
+ <h:dataTable id="instancesTable2"
value="#{instancemgr.instances}" var="instance"
style="border-spacing: 20px 7px" rows="15" rendered="#{not empty
instancemgr.instances}">
+ <h:column>
+ <f:facet name="header">Id</f:facet>
+ <h:commandLink action="#{instancemgr.selectInstance}">
+ <h:outputText value="#{instance[0].id}"/>
+ <f:param name="id" value="#{instance[0].id}"/>
+ <f:param name="plugin" value="info"/>
+ </h:commandLink>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Actions</f:facet>
+ <h:commandLink action="#{instancemgr.selectInstance}">
+ <h:outputText value="Preferences"/>
+ <f:param name="id" value="#{instance[0].id}"/>
+ <f:param name="plugin" value="preferences"/>
+ </h:commandLink> |
+ <h:commandLink action="#{instancemgr.selectInstance}">
+ <h:outputText value="Security"/>
+ <f:param name="id" value="#{instance[0].id}"/>
+ <f:param name="plugin" value="security"/>
+ </h:commandLink> |
+ <h:commandLink action="#{instancemgr.deleteInstance}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id" value="#{instance[0].id}"/>
+ </h:commandLink>
+ </h:column>
+ </h:dataTable>
+ <jbp:scroller for="instancesTable2"
styleClass="portlet-form-button"/>
+ </h:form>
+
+ <c:if test="#{instancemgr.selectedPlugin != null}">
+
+ <hr/>
+
+ <c:if test="#{instancemgr.selectedPlugin == 'info'}">
+ Info
+ </c:if>
+
+ <c:if test="#{instancemgr.selectedPlugin ==
'preferences'}">
+ <h3>Editing preferences of : </h3>
+ <ui:include
src="/WEB-INF/jsp/management/common/editPreferences.xhtml">
+ <ui:param name="preferences"
value="#{instancemgr.selectedPreferences}"/>
+ <ui:param name="action"
value="#{preferenceAction}"/>
+ </ui:include>
+ </c:if>
+
+ <c:if test="#{instancemgr.selectedPlugin == 'security'}">
+ <h3>Editing security of : </h3>
+ <ui:include
src="/WEB-INF/jsp/management/common/editSecurity.xhtml">
+ <ui:param name="auth" value="#{instancemgr.auth}"/>
+ </ui:include>
+ </c:if>
+
+ </c:if>
+
+
+
</ui:define>
</ui:composition>
</div>
Modified: trunk/faces/src/main/org/jboss/portal/faces/matrix/Cell.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/matrix/Cell.java 2007-02-27 23:47:08 UTC
(rev 6441)
+++ trunk/faces/src/main/org/jboss/portal/faces/matrix/Cell.java 2007-02-27 23:58:43 UTC
(rev 6442)
@@ -71,6 +71,33 @@
this.value = value;
}
+ public String getDescription()
+ {
+ if (value != null)
+ {
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0;i < value.length;i++)
+ {
+ String string = value[i];
+ if (i > 2)
+ {
+ buffer.append(" ...");
+ break;
+ }
+ if (i > 0)
+ {
+ buffer.append(" / ");
+ }
+ buffer.append(string);
+ }
+ return buffer.toString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
public List getValueIndices()
{
if (value != null)