JBoss Portal SVN: r8020 - in trunk: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-21 15:11:48 -0400 (Tue, 21 Aug 2007)
New Revision: 8020
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml
Log:
- JBPORTAL-1643: Replaced Destroy by Delete.
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-21 19:11:48 UTC (rev 8020)
@@ -1,78 +1,84 @@
<div
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html">
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
-
- <h:form>
- <h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PAGE}"><h:commandLink action="editPageLayout" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Page layout"/>
- <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | </h:panelGroup><h:commandLink action="editPageSecurity" actionListener="#{portalobjectmgr.selectObject}">
+
+ <h:form>
+ <h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PAGE}"><h:commandLink
+ action="editPageLayout" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Page layout"/>
+ <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink action="editPageSecurity"
+ actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Security"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
</h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | <h:panelGroup rendered="#{!((portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL) and ((portalobjectmgr.selectedObject.name == 'admin') or (portalobjectmgr.selectedObject.name == 'template') or (portalobjectmgr.selectedObject.name == 'default')))}"><h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
+ </h:commandLink> | <h:panelGroup
+ rendered="#{!((portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL) and ((portalobjectmgr.selectedObject.name == 'admin') or (portalobjectmgr.selectedObject.name == 'template') or (portalobjectmgr.selectedObject.name == 'default')))}"><h:commandLink
+ action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Rename"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | </h:panelGroup><h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink action="confirm"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
</h:commandLink>
- </h:form>
+ </h:form>
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
<table>
<tr>
- <h:form>
- <td>
- <span class="portlet-font">Create a page:</span>
- </td>
- <td>
- <h:inputText id="pageName" value="#{addPageAction.pageName}" styleClass="portlet-form-input-field" required="true"/>
- </td>
- <td>
- <h:commandButton action="#{addPageAction.execute}" value="Add" styleClass="portlet-form-button"/>
- </td>
- <td>
- <h:message for="pageName" errorClass="portlet-msg-error"/>
- </td>
- </h:form>
+ <h:form>
+ <td>
+ <span class="portlet-font">Create a page:</span>
+ </td>
+ <td>
+ <h:inputText id="pageName" value="#{addPageAction.pageName}"
+ styleClass="portlet-form-input-field" required="true"/>
+ </td>
+ <td>
+ <h:commandButton action="#{addPageAction.execute}" value="Add"
+ styleClass="portlet-form-button"/>
+ </td>
+ <td>
+ <h:message for="pageName" errorClass="portlet-msg-error"/>
+ </td>
+ </h:form>
</tr>
<!-- Default page -->
<h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL}">
- <tr>
- <h:form>
- <td>
- <span class="portlet-font">Default page:</span>
- </td>
- <td>
- <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultObjectName}">
- <f:selectItems value="#{portalobjectmgr.portalPageItems}" />
- </h:selectOneMenu>
- </td>
- <td colspan="2">
- <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
- </td>
- </h:form>
- </tr>
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Default page:</span>
+ </td>
+ <td>
+ <h:selectOneMenu id="name" styleClass="portlet-form-field"
+ value="#{portalAction.defaultObjectName}">
+ <f:selectItems value="#{portalobjectmgr.portalPageItems}"/>
+ </h:selectOneMenu>
+ </td>
+ <td colspan="2">
+ <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
+ </td>
+ </h:form>
+ </tr>
</h:panelGroup>
</table>
</div>
-
-
<!-- Separation -->
<hr/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-08-21 19:11:48 UTC (rev 8020)
@@ -34,13 +34,16 @@
<h:outputText value="Security"/>
<f:param name="id" value="#{instance.id}"/>
<f:param name="plugin" value="security"/>
- </h:commandLink> | <h:panelGroup rendered="#{! empty(instancemgr.selectedInstancesPrefs[instance.id])}"><h:commandLink action="#{instancemgr.selectInstance}">
- <h:outputText value="Preferences"/>
- <f:param name="id" value="#{instance.id}"/>
- <f:param name="plugin" value="preferences"/>
- </h:commandLink> | </h:panelGroup><h:commandLink action="confirmDeleteInstance" actionListener="#{instancemgr.selectInstance}">
- <h:outputText value="Destroy"/>
+ </h:commandLink> | <h:panelGroup
+ rendered="#{! empty(instancemgr.selectedInstancesPrefs[instance.id])}"><h:commandLink
+ action="#{instancemgr.selectInstance}">
+ <h:outputText value="Preferences"/>
<f:param name="id" value="#{instance.id}"/>
+ <f:param name="plugin" value="preferences"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink action="confirmDeleteInstance"
+ actionListener="#{instancemgr.selectInstance}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{instance.id}"/>
</h:commandLink>
</td>
</tr>
@@ -52,7 +55,8 @@
<c:forEach begin="0" end="#{(instancemgr.instanceCount - 1)/ instancemgr.paginationSize}" step="1"
var="index">
<li class="#{index == instancemgr.selectedFrom ? 'selected' : ''}">
- <h:commandLink action="#{instancemgr.selectFrom}"><f:param name="from" value="#{index * instancemgr.paginationSize}"/><h:outputText
+ <h:commandLink action="#{instancemgr.selectFrom}"><f:param name="from"
+ value="#{index * instancemgr.paginationSize}"/><h:outputText
value="#{index * instancemgr.paginationSize}"/></h:commandLink>
</li>
</c:forEach>
@@ -95,9 +99,9 @@
<c:if test="#{instancemgr.selectedPlugin == 'security'}">
<h3>Editing security of #{instancemgr.selectedInstance.id}: </h3>
-
+
<ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
- <ui:param name="auth" value="#{instancemgr.auth}"/>
+ <ui:param name="auth" value="#{instancemgr.auth}"/>
</ui:decorate>
</c:if>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-08-21 19:11:48 UTC (rev 8020)
@@ -30,20 +30,24 @@
<h:commandLink action="editPortalSecurity" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Security"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editPortalTheme"
+ </h:commandLink> | <h:commandLink action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editPortalTheme"
+ actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink><h:panelGroup rendered="#{(object.name != 'admin') and (object.name != 'template') and (object.name != 'default')}"> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
+ </h:commandLink><h:panelGroup
+ rendered="#{(object.name != 'admin') and (object.name != 'template') and (object.name != 'default')}"> |
+ <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Rename"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink></h:panelGroup> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
+ </h:commandLink></h:panelGroup> | <h:commandLink action="confirm"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
</td>
</tr>
</c:forEach>
@@ -75,17 +79,17 @@
<h:outputText value="Security"/>
<f:param name="id" value="#{object.id}"/>
</h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{object.id}"/>
</h:commandLink> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Rename"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
+ <h:outputText value="Rename"/>
<f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{object.id}"/>
</h:commandLink>
</td>
</tr>
@@ -113,16 +117,17 @@
<h:commandLink action="editWindowTheme" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Rename"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
+ </h:commandLink> | <h:commandLink action="editProperties"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Rename"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
</td>
</tr>
</c:forEach>
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-08-21 19:11:48 UTC (rev 8020)
@@ -58,7 +58,7 @@
</h:commandLink>
</c:if> | <h:commandLink action="#{consumersMgr.destroyConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
- <h:outputText value="Destroy"/>
+ <h:outputText value="Delete"/>
</h:commandLink>
</td>
</tr>
18 years, 8 months
JBoss Portal SVN: r8019 - in branches/JBoss_Portal_Branch_2_6: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-21 15:11:06 -0400 (Tue, 21 Aug 2007)
New Revision: 8019
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml
Log:
- JBPORTAL-1643: Replaced Destroy by Delete.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-21 17:08:08 UTC (rev 8018)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
@@ -1,78 +1,84 @@
<div
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html">
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
-
- <h:form>
- <h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PAGE}"><h:commandLink action="editPageLayout" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Page layout"/>
- <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | </h:panelGroup><h:commandLink action="editPageSecurity" actionListener="#{portalobjectmgr.selectObject}">
+
+ <h:form>
+ <h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PAGE}"><h:commandLink
+ action="editPageLayout" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Page layout"/>
+ <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink action="editPageSecurity"
+ actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Security"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
</h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | <h:panelGroup rendered="#{!((portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL) and ((portalobjectmgr.selectedObject.name == 'admin') or (portalobjectmgr.selectedObject.name == 'template') or (portalobjectmgr.selectedObject.name == 'default')))}"><h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
+ </h:commandLink> | <h:panelGroup
+ rendered="#{!((portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL) and ((portalobjectmgr.selectedObject.name == 'admin') or (portalobjectmgr.selectedObject.name == 'template') or (portalobjectmgr.selectedObject.name == 'default')))}"><h:commandLink
+ action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Rename"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
- </h:commandLink> | </h:panelGroup><h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink action="confirm"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
<f:param name="id" value="#{portalobjectmgr.selectedObject.id}"/>
</h:commandLink>
- </h:form>
+ </h:form>
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
<table>
<tr>
- <h:form>
- <td>
- <span class="portlet-font">Create a page:</span>
- </td>
- <td>
- <h:inputText id="pageName" value="#{addPageAction.pageName}" styleClass="portlet-form-input-field" required="true"/>
- </td>
- <td>
- <h:commandButton action="#{addPageAction.execute}" value="Add" styleClass="portlet-form-button"/>
- </td>
- <td>
- <h:message for="pageName" errorClass="portlet-msg-error"/>
- </td>
- </h:form>
+ <h:form>
+ <td>
+ <span class="portlet-font">Create a page:</span>
+ </td>
+ <td>
+ <h:inputText id="pageName" value="#{addPageAction.pageName}"
+ styleClass="portlet-form-input-field" required="true"/>
+ </td>
+ <td>
+ <h:commandButton action="#{addPageAction.execute}" value="Add"
+ styleClass="portlet-form-button"/>
+ </td>
+ <td>
+ <h:message for="pageName" errorClass="portlet-msg-error"/>
+ </td>
+ </h:form>
</tr>
<!-- Default page -->
<h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL}">
- <tr>
- <h:form>
- <td>
- <span class="portlet-font">Default page:</span>
- </td>
- <td>
- <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultObjectName}">
- <f:selectItems value="#{portalobjectmgr.portalPageItems}" />
- </h:selectOneMenu>
- </td>
- <td colspan="2">
- <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
- </td>
- </h:form>
- </tr>
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Default page:</span>
+ </td>
+ <td>
+ <h:selectOneMenu id="name" styleClass="portlet-form-field"
+ value="#{portalAction.defaultObjectName}">
+ <f:selectItems value="#{portalobjectmgr.portalPageItems}"/>
+ </h:selectOneMenu>
+ </td>
+ <td colspan="2">
+ <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
+ </td>
+ </h:form>
+ </tr>
</h:panelGroup>
</table>
</div>
-
-
<!-- Separation -->
<hr/>
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-08-21 17:08:08 UTC (rev 8018)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
@@ -34,13 +34,16 @@
<h:outputText value="Security"/>
<f:param name="id" value="#{instance.id}"/>
<f:param name="plugin" value="security"/>
- </h:commandLink> | <h:panelGroup rendered="#{! empty(instancemgr.selectedInstancesPrefs[instance.id])}"><h:commandLink action="#{instancemgr.selectInstance}">
- <h:outputText value="Preferences"/>
- <f:param name="id" value="#{instance.id}"/>
- <f:param name="plugin" value="preferences"/>
- </h:commandLink> | </h:panelGroup><h:commandLink action="confirmDeleteInstance" actionListener="#{instancemgr.selectInstance}">
- <h:outputText value="Destroy"/>
+ </h:commandLink> | <h:panelGroup
+ rendered="#{! empty(instancemgr.selectedInstancesPrefs[instance.id])}"><h:commandLink
+ action="#{instancemgr.selectInstance}">
+ <h:outputText value="Preferences"/>
<f:param name="id" value="#{instance.id}"/>
+ <f:param name="plugin" value="preferences"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink action="confirmDeleteInstance"
+ actionListener="#{instancemgr.selectInstance}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{instance.id}"/>
</h:commandLink>
</td>
</tr>
@@ -52,7 +55,8 @@
<c:forEach begin="0" end="#{(instancemgr.instanceCount - 1)/ instancemgr.paginationSize}" step="1"
var="index">
<li class="#{index == instancemgr.selectedFrom ? 'selected' : ''}">
- <h:commandLink action="#{instancemgr.selectFrom}"><f:param name="from" value="#{index * instancemgr.paginationSize}"/><h:outputText
+ <h:commandLink action="#{instancemgr.selectFrom}"><f:param name="from"
+ value="#{index * instancemgr.paginationSize}"/><h:outputText
value="#{index * instancemgr.paginationSize}"/></h:commandLink>
</li>
</c:forEach>
@@ -95,9 +99,9 @@
<c:if test="#{instancemgr.selectedPlugin == 'security'}">
<h3>Editing security of #{instancemgr.selectedInstance.id}: </h3>
-
+
<ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
- <ui:param name="auth" value="#{instancemgr.auth}"/>
+ <ui:param name="auth" value="#{instancemgr.auth}"/>
</ui:decorate>
</c:if>
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-08-21 17:08:08 UTC (rev 8018)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
@@ -30,20 +30,24 @@
<h:commandLink action="editPortalSecurity" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Security"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editPortalTheme"
+ </h:commandLink> | <h:commandLink action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editPortalTheme"
+ actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink><h:panelGroup rendered="#{(object.name != 'admin') and (object.name != 'template') and (object.name != 'default')}"> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
+ </h:commandLink><h:panelGroup
+ rendered="#{(object.name != 'admin') and (object.name != 'template') and (object.name != 'default')}"> |
+ <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Rename"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink></h:panelGroup> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
+ </h:commandLink></h:panelGroup> | <h:commandLink action="confirm"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
</td>
</tr>
</c:forEach>
@@ -75,17 +79,17 @@
<h:outputText value="Security"/>
<f:param name="id" value="#{object.id}"/>
</h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editPageTheme" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{object.id}"/>
</h:commandLink> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Rename"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
+ <h:outputText value="Rename"/>
<f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{object.id}"/>
</h:commandLink>
</td>
</tr>
@@ -113,16 +117,17 @@
<h:commandLink action="editWindowTheme" actionListener="#{portalobjectmgr.selectObject}">
<h:outputText value="Theme"/>
<f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="editProperties" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Properties"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Rename"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
- <h:outputText value="Destroy"/>
- <f:param name="id" value="#{object.id}"/>
- </h:commandLink>
+ </h:commandLink> | <h:commandLink action="editProperties"
+ actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="renameObject" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Rename"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="confirm" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Delete"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
</td>
</tr>
</c:forEach>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-08-21 17:08:08 UTC (rev 8018)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-08-21 19:11:06 UTC (rev 8019)
@@ -58,7 +58,7 @@
</h:commandLink>
</c:if> | <h:commandLink action="#{consumersMgr.destroyConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
- <h:outputText value="Destroy"/>
+ <h:outputText value="Delete"/>
</h:commandLink>
</td>
</tr>
18 years, 8 months
JBoss Portal SVN: r8018 - in trunk/core-identity/src/main/org/jboss/portal/core/identity/services: captcha and 1 other directory.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-21 13:08:08 -0400 (Tue, 21 Aug 2007)
New Revision: 8018
Added:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/ImageCaptchaServlet.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java
Log:
jcaptcha services commit
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/ImageCaptchaServlet.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/ImageCaptchaServlet.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/ImageCaptchaServlet.java 2007-08-21 17:08:08 UTC (rev 8018)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity.services.captcha;
+
+import com.octo.captcha.service.CaptchaServiceException;
+import com.sun.image.codec.jpeg.JPEGCodec;
+import com.sun.image.codec.jpeg.JPEGImageEncoder;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+
+
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ImageCaptchaServlet extends HttpServlet {
+
+
+ public void init(ServletConfig servletConfig) throws ServletException {
+
+ super.init(servletConfig);
+
+ }
+
+ protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
+
+ byte[] captchaChallengeAsJpeg = null;
+ // the output stream to render the captcha image as jpeg into
+ ByteArrayOutputStream jpegOutputStream = new ByteArrayOutputStream();
+ try {
+ // get the session id that will identify the generated captcha.
+ //the same id must be used to validate the response, the session id is a good candidate!
+ String captchaId = httpServletRequest.getSession().getId();
+ // call the ImageCaptchaService getChallenge method
+ BufferedImage challenge =
+ JCaptchaService.getInstance().getImageChallengeForID(captchaId,
+ httpServletRequest.getLocale());
+
+ // a jpeg encoder
+ JPEGImageEncoder jpegEncoder =
+ JPEGCodec.createJPEGEncoder(jpegOutputStream);
+ jpegEncoder.encode(challenge);
+ } catch (IllegalArgumentException e) {
+ httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ } catch (CaptchaServiceException e) {
+ httpServletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
+
+ captchaChallengeAsJpeg = jpegOutputStream.toByteArray();
+
+ // flush it in the response
+ httpServletResponse.setHeader("Cache-Control", "no-store");
+ httpServletResponse.setHeader("Pragma", "no-cache");
+ httpServletResponse.setDateHeader("Expires", 0);
+ httpServletResponse.setContentType("image/jpeg");
+ ServletOutputStream responseOutputStream =
+ httpServletResponse.getOutputStream();
+ responseOutputStream.write(captchaChallengeAsJpeg);
+ responseOutputStream.flush();
+ responseOutputStream.close();
+ }
+}
\ No newline at end of file
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java 2007-08-21 17:08:08 UTC (rev 8018)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity.services.captcha;
+
+import java.awt.image.BufferedImage;
+
+import com.octo.captcha.service.image.DefaultManageableImageCaptchaService;
+import com.octo.captcha.service.image.ImageCaptchaService;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JCaptchaService
+{
+
+ private static ImageCaptchaService instance = new DefaultManageableImageCaptchaService();
+
+ public static ImageCaptchaService getInstance()
+ {
+ return instance;
+ }
+
+ public BufferedImage challenge(String challengeId)
+ {
+ return instance.getImageChallengeForID(challengeId);
+ }
+
+
+}
+
18 years, 8 months
JBoss Portal SVN: r8017 - in trunk/core-identity: src/etc and 14 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-21 12:55:37 -0400 (Tue, 21 Aug 2007)
New Revision: 8017
Added:
trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTestCase.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml
Removed:
trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTest.java
Modified:
trunk/core-identity/.classpath
trunk/core-identity/build.xml
trunk/core-identity/src/etc/
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/userTemplate.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lostTemplate.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
Log:
added jcaptcha to verify the registration process
modifcation of "edit profile" in the user management
Modified: trunk/core-identity/.classpath
===================================================================
--- trunk/core-identity/.classpath 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/.classpath 2007-08-21 16:55:37 UTC (rev 8017)
@@ -50,5 +50,6 @@
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jnp-client.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jnpserver.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/namespace.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jcaptcha/lib/jcaptcha.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/core-identity/build.xml
===================================================================
--- trunk/core-identity/build.xml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/build.xml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -97,6 +97,7 @@
<path refid="apache.log4j.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="facelets.facelets.classpath"/>
+ <path refid="jcaptcha.jcaptcha.classpath"/>
<path refid="el.el.classpath"/>
<path refid="jakarta.cactus.classpath"/>
<path refid="junit.junit.classpath"/>
@@ -220,6 +221,7 @@
<copy todir="${build.resources}/portal-identity.sar/lib">
<fileset dir="${build.lib}" includes="portal-core-identity-services-lib.jar" />
<fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-loader-lib.jar"/>
+ <fileset dir="${jcaptcha.jcaptcha.root}/lib" includes="jcaptcha.jar"/>
</copy>
<copy todir="${build.resources}/portal-identity.sar/portal-identity.war">
Property changes on: trunk/core-identity/src/etc
___________________________________________________________________
Name: svn:ignore
+ ui.xsd
ui.xml
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -112,7 +112,7 @@
int aLength = aRequest.length;
// Values: action / userId / hash / default / default / IdentityUserPorletWindow
- if (aLength > 5)
+ if (aLength > 2)
{
// TODO - UTF-8 decode
String action = aRequest[0];
Deleted: trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTest.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTest.java 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTest.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -1,327 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.identity.test.validators;
-
-import javax.faces.validator.ValidatorException;
-
-import org.jboss.portal.core.identity.ui.validators.EmailValidator;
-
-import junit.framework.TestCase;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class EmailValidatorTest extends TestCase
-{
- public void test01()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "12.blah(a)foo.com");
- }
- catch(ValidatorException e)
- {
- fail("12.blah(a)foo.com should be valid");
- }
- }
-
- public void test02()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "12.blah@");
- fail("12.blah@ should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test03()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "@blah");
- fail("@blah should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test04()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "@blah.com");
- fail("@blah.com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test05()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user.name(a)email.info");
- }
- catch(ValidatorException e)
- {
- fail("user.name(a)email.info should be valid");
- }
- }
-
- public void test06()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user_name(a)email.org");
- }
- catch(ValidatorException e)
- {
- fail("user_name(a)email.org should be valid");
- }
- }
-
- public void test07()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "e*mail(a)email.com");
- fail("e*mail(a)email.com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test08()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "*(a)blah.com");
- fail("*@blah should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test09()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@.com");
- fail("user@.com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test10()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user(a)a\\.com");
- fail("user(a)a\\.com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test11()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@abc-com");
- fail("user@abc-com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test12()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "us/er(a)a.com");
- fail("us/er(a)a.com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test13()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@ab)com");
- fail("user@ab)com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test14()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@ab/com");
- fail("user@ab/com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test15()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@abc_com");
- fail("user@abc_com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test16()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@a*com");
- fail("user@a*com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test17()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user(a)w-h.com");
- }
- catch(ValidatorException e)
- {
- fail("user(a)w-h.com should be valid");
- }
- }
-
- public void test18()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@abc..com");
- fail("user@abc..com should not be valid");
- }
- catch(ValidatorException e)
- {
-
- }
- }
-
- public void test19()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user@.abc.com");
- fail("user@.abc.com should be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test20()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "@blah.com");
- fail("@blah.com should not be valid");
- }
- catch(ValidatorException e)
- {
- // Success
- }
- }
-
- public void test21()
- {
- EmailValidator emailValidator = new EmailValidator();
- try
- {
- emailValidator.validate(null, null, "user(a)ab.museum");
- }
- catch(ValidatorException e)
- {
- fail("user(a)ab.museum should not be valid");
- }
- }
-
-}
-
Copied: trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTestCase.java (from rev 7984, trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTest.java)
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTestCase.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/test/validators/EmailValidatorTestCase.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -0,0 +1,327 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity.test.validators;
+
+import javax.faces.validator.ValidatorException;
+
+import org.jboss.portal.core.identity.ui.validators.EmailValidator;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class EmailValidatorTestCase extends TestCase
+{
+ public void test01()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "12.blah(a)foo.com");
+ }
+ catch(ValidatorException e)
+ {
+ fail("12.blah(a)foo.com should be valid");
+ }
+ }
+
+ public void test02()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "12.blah@");
+ fail("12.blah@ should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test03()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "@blah");
+ fail("@blah should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test04()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "@blah.com");
+ fail("@blah.com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test05()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user.name(a)email.info");
+ }
+ catch(ValidatorException e)
+ {
+ fail("user.name(a)email.info should be valid");
+ }
+ }
+
+ public void test06()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user_name(a)email.org");
+ }
+ catch(ValidatorException e)
+ {
+ fail("user_name(a)email.org should be valid");
+ }
+ }
+
+ public void test07()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "e*mail(a)email.com");
+ fail("e*mail(a)email.com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test08()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "*(a)blah.com");
+ fail("*@blah should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test09()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@.com");
+ fail("user@.com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test10()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user(a)a\\.com");
+ fail("user(a)a\\.com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test11()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@abc-com");
+ fail("user@abc-com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test12()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "us/er(a)a.com");
+ fail("us/er(a)a.com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test13()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@ab)com");
+ fail("user@ab)com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test14()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@ab/com");
+ fail("user@ab/com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test15()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@abc_com");
+ fail("user@abc_com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test16()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@a*com");
+ fail("user@a*com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test17()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user(a)w-h.com");
+ }
+ catch(ValidatorException e)
+ {
+ fail("user(a)w-h.com should be valid");
+ }
+ }
+
+ public void test18()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@abc..com");
+ fail("user@abc..com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+
+ }
+ }
+
+ public void test19()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user@.abc.com");
+ fail("user@.abc.com should be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test20()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "@blah.com");
+ fail("@blah.com should not be valid");
+ }
+ catch(ValidatorException e)
+ {
+ // Success
+ }
+ }
+
+ public void test21()
+ {
+ EmailValidator emailValidator = new EmailValidator();
+ try
+ {
+ emailValidator.validate(null, null, "user(a)ab.museum");
+ }
+ catch(ValidatorException e)
+ {
+ fail("user(a)ab.museum should not be valid");
+ }
+ }
+
+}
+
Property changes on: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui
___________________________________________________________________
Name: svn:ignore
+ faces
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
+import java.awt.image.BufferedImage;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.ArrayList;
@@ -36,6 +37,7 @@
import javax.faces.context.FacesContext;
import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.services.captcha.JCaptchaService;
import org.jboss.portal.core.identity.ui.IdentityConstants;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
@@ -63,7 +65,7 @@
/** . */
private SendMailBean sendMailBean;
-
+
/** .*/
private String subscriptionMode;
@@ -119,7 +121,7 @@
{
this.sendMailBean = sendMailBean;
}
-
+
public String register()
{
if (uiUser.getUsername() != null && uiUser.getPassword() != null)
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
import java.util.HashMap;
import java.util.Map;
@@ -32,7 +30,6 @@
import javax.faces.context.FacesContext;
import org.jboss.logging.Logger;
-import org.jboss.portal.common.util.Tools;
import org.jboss.portal.core.identity.ui.IdentityConstants;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
@@ -156,6 +153,20 @@
{
try
{
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ExternalContext ectx = ctx.getExternalContext();
+ String checkUser = ectx.getRemoteUser();
+ // Checking if password needs to updated
+ // TODO get Metadata required length
+ if (uiUser.getPassword() != null && uiUser.getPassword().trim().length() > 6 )
+ {
+ log.error("hilffe - update -"+ uiUser.getPassword());
+ }
+ else
+ {
+ log.error("hilffe - " + checkUser);
+ }
+
User user = identityUserBean.findUserByUserName(this.currentUser);
// Adding dynamically set properties
identityUserBean.updateProfile(user, uiUser.getAttribute().getProfileAttributes());
@@ -172,7 +183,7 @@
}
return "editProfile";
}
-
+
public String changePassword()
{
if (this.password != null)
@@ -191,7 +202,7 @@
}
return "start";
}
-
+
public String changeEmail()
{
String subscriptionMode = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -28,6 +28,7 @@
import java.util.Map;
import javax.faces.application.FacesMessage;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -125,11 +126,20 @@
{
this.passwordCharacters = passwordCharacters;
}
-
+
public String doomed()
{
User user = null;
+ // Used by the user management to reset passwords
+ if (username == null )
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ExternalContext ectx = ctx.getExternalContext();
+ Map params = ectx.getRequestParameterMap();
+ this.username = (String) params.get("currentUser");
+ }
+
if (username != null && !username.equals(""))
{
try
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity.ui.validators;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import javax.portlet.PortletRequest;
+
+import org.jboss.portal.core.identity.services.captcha.JCaptchaService;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CaptchaValidator implements Validator
+{
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+ {
+ Boolean tester = Boolean.FALSE;
+ PortletRequest portletRequest = (PortletRequest) context.getExternalContext().getRequest();
+ String captchaId = portletRequest.getRequestedSessionId();
+ try
+ {
+ tester = JCaptchaService.getInstance().validateResponseForID(captchaId, (String) value);
+ }
+ catch (Exception e)
+ {
+ throw new ValidatorException(new FacesMessage("Error while validating."));
+ }
+ if ( tester.equals(Boolean.FALSE))
+ {
+ throw new ValidatorException(new FacesMessage("captcha incorrect."));
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java 2007-08-21 16:55:37 UTC (rev 8017)
@@ -42,7 +42,7 @@
{
String password = (String) ((HtmlInputSecret) passwordComponent).getValue();
- if (!password.equals((String) value))
+ if (value == null || !password.equals((String) value))
{
throw new ValidatorException(new FacesMessage("The passwords don't match."));
}
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties 2007-08-21 16:55:37 UTC (rev 8017)
@@ -90,6 +90,11 @@
IDENTITY_MANAGEMENT_CREATE_ROLE=Create new role
IDENTITY_MANAGEMENT_EDIT_ROLE=Edit role
IDENTITY_MANAGEMENT_CREATE_ROLE=Create role
+IDENTITY_MANAGEMENT_DISABLE=Disable
+IDENTITY_MANAGEMENT_ENABLE=Enable
+IDENTITY_MANAGEMENT_RESET_PASSWORD=Reset password
+IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION=The user will get a random password sent by email.
+IDENTITY_REGISTER_VERIFY_CAPTCHA=Verify captcha
IDENTITY_REGISTER_TITLE_CONFIRM_DELETE=Confirmation: Delete Object
IDENTITY_REGISTER_CONFIRMATIONEMAIL=Confirm your subscription
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -28,7 +28,10 @@
<faces-config>
<application>
- <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
+ <variable-resolver>org.jboss.portal.core.identity.ui.faces.JBossPortletVariableResolver</variable-resolver>
+ <property-resolver>org.jboss.portal.core.identity.ui.faces.JBossPortletPropertyResolver</property-resolver>
+<!-- <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
+ -->
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
</application>
@@ -222,6 +225,10 @@
<validator-id>CurrentPasswordValidator</validator-id>
<validator-class>org.jboss.portal.core.identity.ui.validators.CurrentPasswordValidator</validator-class>
</validator>
+ <validator>
+ <validator-id>CaptchaValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.CaptchaValidator</validator-class>
+ </validator>
<navigation-rule>
<navigation-case>
@@ -395,6 +402,25 @@
<to-view-id>/WEB-INF/jsf/admin/roles/deleteRole.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/editProfile.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>resetPassword</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/user/resetPassword.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/user/resetPassword.xhtml</from-view-id>
+ <navigation-case>
+ <from-action>#{lostpasswordmgr.doomed}</from-action>
+ <from-outcome>status</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/index.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-action>#{lostpasswordmgr.doomed}</from-action>
+ <from-outcome>lostPassword</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/editProfile.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
-
</faces-config>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -14,6 +14,7 @@
<ui:decorate template="/WEB-INF/jsf/common/profile.xhtml">
<ui:param name="manager" value="#{editprofilemgr}"/>
+ <ui:param name="adminMode" value="true"/>
</ui:decorate>
</ui:define>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -48,11 +48,6 @@
<h:outputText value="#{bundle.IDENTITY_ENABLED}"/>
</f:facet>
<h:selectBooleanCheckbox id="enabled" value="#{uiUser.attribute.enabled}" disabled="true" />
- <h:commandLink action="#{useradministrationbean.enableUser}">
- <h:outputText value="#{uiUser.attribute.enabled == true ? 'disable' : 'enable'}" />
- <f:param name="currentUser" value="#{uiUser.username}"/>
- <f:param name="enableAction" value="#{uiUser.attribute.enabled == true ? 'disable' : 'enable'}" />
- </h:commandLink>
</h:column>
<h:column>
<f:facet name="header">
@@ -66,6 +61,11 @@
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_ROLES}"/>
<f:param name="currentUser" value="#{uiUser.username}"/>
</h:commandLink> |
+ <h:commandLink action="#{useradministrationbean.enableUser}">
+ <h:outputText value="#{uiUser.attribute.enabled == true ? bundle.IDENTITY_MANAGEMENT_DISABLE : bundle.IDENTITY_MANAGEMENT_ENABLE}" />
+ <f:param name="currentUser" value="#{uiUser.username}"/>
+ <f:param name="enableAction" value="#{uiUser.attribute.enabled == true ? 'disable' : 'enable'}" />
+ </h:commandLink> |
<h:commandLink action="#{useradministrationbean.deleteUser}">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION_DELETE}"/>
<f:param name="currentUser" value="#{uiUser.username}"/>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -16,6 +16,7 @@
<ui:decorate template="/WEB-INF/jsf/common/register.xhtml">
<ui:param name="manager" value="#{userregistermgr}"/>
+ <ui:param name="showCaptcha" value="false" />
</ui:decorate>
</ui:define>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -0,0 +1,27 @@
+<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"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/user/userTemplate.xhtml">
+
+<ui:define name="title">
+ reset password for user #{editprofilemgr.uiUser.username}
+</ui:define>
+
+<ui:define name="content">
+ <h:form>
+ <p><h:outputText value="#{bundle.IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION}" /></p>
+ <hr/>
+ <h:commandLink action="#{lostpasswordmgr.doomed}">
+ <h:outputText value="#{bundle.IDENTITY_BUTTON_SUBMIT}" />
+ <f:param name="currentUser" value="#{editprofilemgr.uiUser.username}" />
+ </h:commandLink>
+
+ </h:form>
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/userTemplate.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/userTemplate.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/userTemplate.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -18,7 +18,7 @@
</h:form>
<!-- Status message -->
- <h:messages infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+ <h:message infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<!-- Title -->
<h4><ui:insert name="title">Title</ui:insert></h4>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -6,19 +6,43 @@
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
- <h:panelGrid columns="2">
- <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>
- <h:outputText id="username" value="#{manager.uiUser.username}"/>
-
- <h:outputText for="email" value="#{bundle.IDENTITY_EMAIL}"/>
- <h:outputText id="email" value="#{manager.uiUser.attribute.email}"/>
- </h:panelGrid>
+<h:form>
+ <c:choose>
+ <c:when test="#{adminMode == true}">
+ <h:panelGrid columns="3">
+ <h:outputText value="#{bundle.IDENTITY_USERNAME}"/>
+ <h:outputText id="username" value="#{manager.uiUser.username}"/>
+ <h:message for="username"/>
+
+ <h:outputText for="#{metadataservice.email.name}" value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:inputText id="#{metadataservice.email.name}" value="#{manager.uiUser.attribute.email}" required="#{metadataservice.email.required}">
+ <f:validator validatorId="#{metadataservice.email.validator}"/>
+ </h:inputText>
+ <h:message for="#{metadataservice.email.name}"/>
+
+ <h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:commandLink action="resetPassword">
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_RESET_PASSWORD}" />
+ <f:param name="currentUser" value="#{manager.uiUser.username}" />
+ </h:commandLink>
+ <h:message for="password"/>
+ </h:panelGrid>
+ </c:when>
+ <c:otherwise>
+ <h:panelGrid columns="2">
+ <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>
+ <h:outputText id="username" value="#{manager.uiUser.username}"/>
+
+ <h:outputText for="email" value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:outputText id="email" value="#{manager.uiUser.attribute.email}"/>
+ </h:panelGrid>
+ </c:otherwise>
+ </c:choose>
<ul class="topnav">
<li id="currentTab">Personal Information</li>
</ul>
- <h:form>
<h:panelGrid columns="3" cellpadding="3">
<h:outputText for="givenname" value="#{bundle.IDENTITY_GIVENNAME}"/>
<h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"/>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -26,13 +26,22 @@
<f:validateLength minimum="6"/>
</h:inputSecret>
<h:message for="password"/>
-
<h:outputText for="passwordCheck" value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
<h:inputSecret id="passwordCheck" required="true">
<f:validator validatorId="PasswordValidator"/>
</h:inputSecret>
<h:message for="passwordCheck"/>
</h:panelGrid>
+ <c:if test="#{showCaptcha == true}">
+ <h:graphicImage id="captchaimage" url="/jcaptcha" />
+ <h:panelGrid columns="3">
+ <h:outputText value="#{bundle.IDENTITY_REGISTER_VERIFY_CAPTCHA}" />
+ <h:inputText id="validateCaptcha" value="" required="true">
+ <f:validator validatorId="CaptchaValidator" />
+ </h:inputText>
+ <h:message for="validateCaptcha" />
+ </h:panelGrid>
+ </c:if>
<hr/>
<h:commandButton id="submit" action="register" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" styleClass="portlet-form-button"/>
</h:form>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -5,6 +5,8 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
+
+#{portletPreferenceValues}
<c:choose>
<c:when test="#{facesContext.externalContext.remoteUser != null}">
<ui:include src="/WEB-INF/jsf/profile/viewProfile.xhtml"/>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -19,6 +19,14 @@
<h:inputText id="username" value="#{lostpasswordmgr.username}" />
<h:message for="username" />
</h:panelGrid>
+ <h:graphicImage id="captchaimage" url="/jcaptcha" />
+ <h:panelGrid columns="3">
+ <h:outputText value="#{bundle.IDENTITY_REGISTER_VERIFY_CAPTCHA}" />
+ <h:inputText id="validateCaptcha" value="" required="true">
+ <f:validator validatorId="CaptchaValidator" />
+ </h:inputText>
+ <h:message for="validateCaptcha" />
+ </h:panelGrid>
<hr/>
<h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" action="#{lostpasswordmgr.doomed}" styleClass="portlet-form-button"/>
</h:form>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lostTemplate.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lostTemplate.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lostTemplate.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -23,7 +23,7 @@
</h:form>
<!-- Status message -->
- <h:messages infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+ <h:message infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<!-- Title -->
<h4><ui:insert name="title">Title</ui:insert></h4>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -25,6 +25,7 @@
<ui:decorate template="/WEB-INF/jsf/common/profile.xhtml">
<ui:param name="manager" value="#{editprofilemgr}"/>
+ <ui:param name="adminMode" value="false" />
</ui:decorate>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -16,6 +16,7 @@
<ui:decorate template="/WEB-INF/jsf/common/register.xhtml">
<ui:param name="manager" value="#{userregistermgr}"/>
+ <ui:param name="showCaptcha" value="true"/>
</ui:decorate>
</ui:define>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -51,6 +51,10 @@
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
<portlet-info>
<title>User portlet</title>
<keywords>management,user</keywords>
@@ -80,6 +84,10 @@
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
<portlet-info>
<title>User management portlet</title>
<keywords>management,admin</keywords>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2007-08-21 16:35:48 UTC (rev 8016)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2007-08-21 16:55:37 UTC (rev 8017)
@@ -81,4 +81,15 @@
<load-on-startup>1</load-on-startup>
</servlet>
+ <!-- Captcha Servlet and Mapping -->
+ <servlet>
+ <servlet-name>jcaptcha</servlet-name>
+ <servlet-class>org.jboss.portal.core.identity.services.captcha.ImageCaptchaServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>jcaptcha</servlet-name>
+ <url-pattern>/jcaptcha</url-pattern>
+ </servlet-mapping>
+
</web-app>
18 years, 8 months
JBoss Portal SVN: r8016 - trunk/build.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-21 12:35:48 -0400 (Tue, 21 Aug 2007)
New Revision: 8016
Modified:
trunk/build/build-thirdparty.xml
Log:
added jcaptcha
Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml 2007-08-21 14:52:58 UTC (rev 8015)
+++ trunk/build/build-thirdparty.xml 2007-08-21 16:35:48 UTC (rev 8016)
@@ -95,6 +95,7 @@
<componentref name="jflex" version="1.4.0"/>
<componentref name="jwebunit" version="1.2"/>
<componentref name="jcr" version="1.0"/>
+ <componentref name="jcaptcha" version="1.0.6"/>
<componentref name="jetty" version="6.0"/>
<componentref name="jgroups" version="2.2.8"/>
<componentref name="jsunit" version="2.1"/>
18 years, 8 months
JBoss Portal SVN: r8015 - modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-21 10:52:58 -0400 (Tue, 21 Aug 2007)
New Revision: 8015
Modified:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java
Log:
- somehow the portal servlet can almost render portlets
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 14:27:39 UTC (rev 8014)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 14:52:58 UTC (rev 8015)
@@ -25,6 +25,16 @@
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
+import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
+import org.jboss.portal.portlet.support.spi.InstanceContextSupport;
+import org.jboss.portal.portlet.support.spi.UserContextSupport;
+import org.jboss.portal.portlet.spi.WindowContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.MarkupInfo;
@@ -54,24 +64,50 @@
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
+ PortletInvoker invoker = (PortletInvoker)getServletContext().getAttribute("ConsumerPortletInvoker");
+ writer.print("<html><body>");
- writer.print("<html><body>");
- for (Iterator i = registry.getPortletApplications().iterator(); i.hasNext();)
+ try
{
- PortletApplication application = (PortletApplication)i.next();
- writer.print("<div><div>" + application.getId() + "</div>");
- for (Iterator j = application.getPortletContainers().iterator();j.hasNext();)
+ for (Iterator i = invoker.getPortlets().iterator(); i.hasNext();)
{
- PortletContainer container = (PortletContainer)j.next();
- writer.print("<div><div>" + container.getId() + "</div>");
- writer.print("<div>Content</div>");
+ Portlet portlet = (Portlet)i.next();
+ writer.print("<div><div>" + portlet.getContext() + "</div>");
+
+ TestRenderContext renderContext = new TestRenderContext(Mode.VIEW, WindowState.NORMAL, null, new MarkupInfo(MediaType.HTML, "UTF8"), req, resp);
+ RenderInvocation render = new RenderInvocation(renderContext);
+ render.setRequestContext(new AbstractRequestContext(req, resp));
+ render.setInstanceContext(new InstanceContextImpl("Whatever"));
+ render.setUserContext(new UserContextSupport());
+ render.setWindowContext(new WindowContext()
+ {
+ public String getId()
+ {
+ return "blah";
+ }
+ });
+ render.setPortalContext(new TestPortalContext());
+ render.setSecurityContext(new AbstractSecurityContext(req));
+ render.setTarget(portlet.getContext());
+
+ try
+ {
+ invoker.invoke(render);
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+
writer.print("</div>");
}
- writer.print("</div>");
}
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
- TestRenderContext renderContext = new TestRenderContext(Mode.VIEW, WindowState.NORMAL, null, new MarkupInfo(MediaType.HTML, "UTF8"), req, resp);
writer.print("</body></html>");
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-08-21 14:27:39 UTC (rev 8014)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-08-21 14:52:58 UTC (rev 8015)
@@ -45,7 +45,6 @@
import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
import org.jboss.beans.metadata.plugins.AbstractInstallMetaData;
import org.jboss.beans.metadata.plugins.ThisValueMetaData;
-import org.jboss.dependency.spi.ControllerState;
import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2007-08-21 14:27:39 UTC (rev 8014)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2007-08-21 14:52:58 UTC (rev 8015)
@@ -28,6 +28,9 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.invocation.Scope;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -54,8 +57,14 @@
HttpServletResponse resp)
{
super(mode, windowState, navigationalState, markupInfo);
+
+ //
this.req = req;
this.resp = resp;
+
+ //
+ addResolver(Scope.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(req));
+ addResolver(Scope.INVOCATION_SCOPE, new MapAttributeResolver());
}
public HttpServletRequest getClientRequest() throws IllegalStateException
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java 2007-08-21 14:27:39 UTC (rev 8014)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java 2007-08-21 14:52:58 UTC (rev 8015)
@@ -27,6 +27,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.invocation.Scope;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
18 years, 8 months
JBoss Portal SVN: r8014 - in modules/portlet/trunk: test and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-21 10:27:39 -0400 (Tue, 21 Aug 2007)
New Revision: 8014
Added:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
modules/portlet/trunk/test/build.xml
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
Log:
- forgot to wire the PortletContainer to the PortletApplication
Modified: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java 2007-08-21 13:58:06 UTC (rev 8013)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java 2007-08-21 14:27:39 UTC (rev 8014)
@@ -44,6 +44,10 @@
/** Return the porlet application context. */
PortletApplicationContext getContext();
+ void addContainer(PortletContainer container);
+
+ void removeContainer(PortletContainer container);
+
/**
* Starts the application only. It does not take care of starting its components.
*
Modified: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2007-08-21 13:58:06 UTC (rev 8013)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2007-08-21 14:27:39 UTC (rev 8014)
@@ -57,6 +57,8 @@
*/
PortletApplication getApplication();
+ void setApplication(PortletApplication application);
+
/**
*
*/
Modified: modules/portlet/trunk/test/build.xml
===================================================================
--- modules/portlet/trunk/test/build.xml 2007-08-21 13:58:06 UTC (rev 8013)
+++ modules/portlet/trunk/test/build.xml 2007-08-21 14:27:39 UTC (rev 8014)
@@ -162,6 +162,8 @@
<fileset dir="${build.lib}" includes="portlet-test-lib.jar"/>
<fileset dir="${jboss.portal/modules/common.lib}" includes="*.jar"/>
<fileset dir="${jboss.portal-portlet.lib}" includes="*.jar"/>
+
+ <fileset dir="${sun.jaf.lib}" includes="*.jar"/>
<fileset dir="${jboss.microcontainer.lib}" includes="*.jar"/>
<fileset dir="${jboss/common.core.lib}" includes="*.jar"/>
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 13:58:06 UTC (rev 8013)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 14:27:39 UTC (rev 8014)
@@ -23,6 +23,12 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.util.MediaType;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -48,12 +54,26 @@
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
+
+
+ writer.print("<html><body>");
for (Iterator i = registry.getPortletApplications().iterator(); i.hasNext();)
{
- Object o = i.next();
- System.out.println("o = " + o);
+ PortletApplication application = (PortletApplication)i.next();
+ writer.print("<div><div>" + application.getId() + "</div>");
+ for (Iterator j = application.getPortletContainers().iterator();j.hasNext();)
+ {
+ PortletContainer container = (PortletContainer)j.next();
+ writer.print("<div><div>" + container.getId() + "</div>");
+ writer.print("<div>Content</div>");
+ writer.print("</div>");
+ }
+ writer.print("</div>");
}
+ TestRenderContext renderContext = new TestRenderContext(Mode.VIEW, WindowState.NORMAL, null, new MarkupInfo(MediaType.HTML, "UTF8"), req, resp);
+ writer.print("</body></html>");
+
}
}
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-08-21 13:58:06 UTC (rev 8013)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-08-21 14:27:39 UTC (rev 8014)
@@ -111,16 +111,24 @@
bmd.setStart(new AbstractLifecycleMetaData("start"));
bmd.setStop(new AbstractLifecycleMetaData("stop"));
bmd.setProperties(Collections.singleton(new AbstractPropertyMetaData("application", new AbstractDependencyValueMetaData(id))));
- AbstractInstallMetaData installmd = new AbstractInstallMetaData();
- installmd.setBean("PortletApplicationDeployer");
- installmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
- installmd.setMethodName("installPortletContainer");
- bmd.setInstalls(Collections.singletonList(installmd));
- AbstractInstallMetaData uninstallmd = new AbstractInstallMetaData();
- uninstallmd.setBean("PortletApplicationDeployer");
- uninstallmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
- uninstallmd.setMethodName("uninstallPortletContainer");
- bmd.setUninstalls(Collections.singletonList(uninstallmd));
+ AbstractInstallMetaData deployerinstallmd = new AbstractInstallMetaData();
+ deployerinstallmd.setBean("PortletApplicationDeployer");
+ deployerinstallmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ deployerinstallmd.setMethodName("installPortletContainer");
+ AbstractInstallMetaData applicationinstallmd = new AbstractInstallMetaData();
+ applicationinstallmd.setBean(id);
+ applicationinstallmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ applicationinstallmd.setMethodName("addContainer");
+ bmd.setInstalls(new CollectionBuilder().add(deployerinstallmd).add(applicationinstallmd).toArrayList());
+ AbstractInstallMetaData deployeruninstallmd = new AbstractInstallMetaData();
+ deployeruninstallmd.setBean("PortletApplicationDeployer");
+ deployeruninstallmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ deployeruninstallmd.setMethodName("uninstallPortletContainer");
+ AbstractInstallMetaData applicationuninstallmd = new AbstractInstallMetaData();
+ applicationuninstallmd.setBean(id);
+ applicationuninstallmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ applicationuninstallmd.setMethodName("removeContainer");
+ bmd.setUninstalls(new CollectionBuilder().add(deployeruninstallmd).add(applicationuninstallmd).toArrayList());
try
{
KernelControllerContext portletContainerControllerContext = kernel.getController().install(bmd);
Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2007-08-21 14:27:39 UTC (rev 8014)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test;
+
+import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.MarkupInfo;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestPortletInvocationContext extends AbstractPortletInvocationContext
+{
+
+ /** . */
+ private HttpServletRequest req;
+
+ /** . */
+ private HttpServletResponse resp;
+
+ public TestPortletInvocationContext(
+ Mode mode,
+ WindowState windowState,
+ StateString navigationalState,
+ MarkupInfo markupInfo,
+ HttpServletRequest req,
+ HttpServletResponse resp)
+ {
+ super(mode, windowState, navigationalState, markupInfo);
+ this.req = req;
+ this.resp = resp;
+ }
+
+ public HttpServletRequest getClientRequest() throws IllegalStateException
+ {
+ return req;
+ }
+
+ public HttpServletResponse getClientResponse() throws IllegalStateException
+ {
+ return resp;
+ }
+
+ public String renderURL(PortletURL portletURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
+ {
+ return "TODO";
+ }
+}
Added: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java (rev 0)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/TestRenderContext.java 2007-08-21 14:27:39 UTC (rev 8014)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test;
+
+import org.jboss.portal.portlet.spi.RenderContext;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.MarkupInfo;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestRenderContext extends TestPortletInvocationContext implements RenderContext
+{
+ public TestRenderContext(Mode mode, WindowState windowState, StateString navigationalState, MarkupInfo markupInfo, HttpServletRequest req, HttpServletResponse resp)
+ {
+ super(mode, windowState, navigationalState, markupInfo, req, resp);
+ }
+}
18 years, 8 months
JBoss Portal SVN: r8013 - modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-21 09:58:06 -0400 (Tue, 21 Aug 2007)
New Revision: 8013
Modified:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
Log:
added few comments
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 13:49:37 UTC (rev 8012)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 13:58:06 UTC (rev 8013)
@@ -53,5 +53,7 @@
Object o = i.next();
System.out.println("o = " + o);
}
+
+
}
}
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2007-08-21 13:49:37 UTC (rev 8012)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2007-08-21 13:58:06 UTC (rev 8013)
@@ -78,6 +78,16 @@
/** . */
private final Map registrationContextMap = new HashMap();
+ public PortletApplicationRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(PortletApplicationRegistry registry)
+ {
+ this.registry = registry;
+ }
+
public void onEvent(WebAppEvent event)
{
if (event instanceof WebAppLifeCycleEvent)
@@ -208,36 +218,38 @@
return null;
}
+ /**
+ * Called by MC to install application.
+ */
public void installPortletApplication(PortletApplication application)
{
PortletApplicationRegistrationContext context = registry.registerPortletApplication(application);
registrationContextMap.put(application, context);
}
+ /**
+ * Called by MC to install container.
+ */
public void installPortletContainer(PortletContainer container)
{
PortletApplicationRegistrationContext context = (PortletApplicationRegistrationContext)registrationContextMap.get(container.getApplication());
context.registerPortlet(container);
}
+ /**
+ * Called by MC to uninstall application.
+ */
public void uninstallPortletApplication(PortletApplication application)
{
registry.unregisterPortletApplication(application);
}
+ /**
+ * Called by MC to uninstall container.
+ */
public void uninstallPortletContainer(PortletContainer container)
{
PortletApplicationRegistrationContext context = (PortletApplicationRegistrationContext)registrationContextMap.get(container.getApplication());
context.unregisterPortlet(container);
}
-
- public PortletApplicationRegistry getRegistry()
- {
- return registry;
- }
-
- public void setRegistry(PortletApplicationRegistry registry)
- {
- this.registry = registry;
- }
}
18 years, 8 months
JBoss Portal SVN: r8012 - in modules/portlet/trunk/test/src: resources/portlet-test-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-21 09:49:37 -0400 (Tue, 21 Aug 2007)
New Revision: 8012
Modified:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/web.xml
Log:
leverage MC install/uninstall to update the PortletApplicationRegistry upon life cycle changes
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 13:05:42 UTC (rev 8011)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalServlet.java 2007-08-21 13:49:37 UTC (rev 8012)
@@ -22,8 +22,15 @@
******************************************************************************/
package org.jboss.portal.portlet.test;
+import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+
import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -32,7 +39,19 @@
public class PortalServlet extends HttpServlet
{
- public void init() throws ServletException
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
+ PortletApplicationRegistry registry = (PortletApplicationRegistry)getServletContext().getAttribute("PortletApplicationRegistry");
+
+
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ for (Iterator i = registry.getPortletApplications().iterator(); i.hasNext();)
+ {
+ Object o = i.next();
+ System.out.println("o = " + o);
+ }
}
}
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2007-08-21 13:05:42 UTC (rev 8011)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployer.java 2007-08-21 13:49:37 UTC (rev 8012)
@@ -31,6 +31,10 @@
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
import org.jboss.portal.portlet.deployment.PortletApplicationMetaDataFactory;
import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.PortletApplicationRegistrationContext;
import org.jboss.portal.common.io.IOTools;
import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
@@ -57,6 +61,9 @@
private Logger log = Logger.getLogger(PortletApplicationDeployer.class);
/** . */
+ private PortletApplicationRegistry registry;
+
+ /** . */
private ServletContainerContext containerContext;
/** . */
@@ -68,6 +75,9 @@
/** . */
private ClassLoader classLoader;
+ /** . */
+ private final Map registrationContextMap = new HashMap();
+
public void onEvent(WebAppEvent event)
{
if (event instanceof WebAppLifeCycleEvent)
@@ -197,4 +207,37 @@
}
return null;
}
+
+ public void installPortletApplication(PortletApplication application)
+ {
+ PortletApplicationRegistrationContext context = registry.registerPortletApplication(application);
+ registrationContextMap.put(application, context);
+ }
+
+ public void installPortletContainer(PortletContainer container)
+ {
+ PortletApplicationRegistrationContext context = (PortletApplicationRegistrationContext)registrationContextMap.get(container.getApplication());
+ context.registerPortlet(container);
+ }
+
+ public void uninstallPortletApplication(PortletApplication application)
+ {
+ registry.unregisterPortletApplication(application);
+ }
+
+ public void uninstallPortletContainer(PortletContainer container)
+ {
+ PortletApplicationRegistrationContext context = (PortletApplicationRegistrationContext)registrationContextMap.get(container.getApplication());
+ context.unregisterPortlet(container);
+ }
+
+ public PortletApplicationRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(PortletApplicationRegistry registry)
+ {
+ this.registry = registry;
+ }
}
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-08-21 13:05:42 UTC (rev 8011)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-08-21 13:49:37 UTC (rev 8012)
@@ -43,6 +43,8 @@
import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData;
import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractInstallMetaData;
+import org.jboss.beans.metadata.plugins.ThisValueMetaData;
import org.jboss.dependency.spi.ControllerState;
import org.apache.log4j.Logger;
@@ -109,6 +111,16 @@
bmd.setStart(new AbstractLifecycleMetaData("start"));
bmd.setStop(new AbstractLifecycleMetaData("stop"));
bmd.setProperties(Collections.singleton(new AbstractPropertyMetaData("application", new AbstractDependencyValueMetaData(id))));
+ AbstractInstallMetaData installmd = new AbstractInstallMetaData();
+ installmd.setBean("PortletApplicationDeployer");
+ installmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ installmd.setMethodName("installPortletContainer");
+ bmd.setInstalls(Collections.singletonList(installmd));
+ AbstractInstallMetaData uninstallmd = new AbstractInstallMetaData();
+ uninstallmd.setBean("PortletApplicationDeployer");
+ uninstallmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ uninstallmd.setMethodName("uninstallPortletContainer");
+ bmd.setUninstalls(Collections.singletonList(uninstallmd));
try
{
KernelControllerContext portletContainerControllerContext = kernel.getController().install(bmd);
@@ -133,6 +145,16 @@
bmd.setConstructor(ctormd);
bmd.setStart(new AbstractLifecycleMetaData("start"));
bmd.setStop(new AbstractLifecycleMetaData("stop"));
+ AbstractInstallMetaData installmd = new AbstractInstallMetaData();
+ installmd.setBean("PortletApplicationDeployer");
+ installmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ installmd.setMethodName("installPortletApplication");
+ bmd.setInstalls(Collections.singletonList(installmd));
+ AbstractInstallMetaData uninstallmd = new AbstractInstallMetaData();
+ uninstallmd.setBean("PortletApplicationDeployer");
+ uninstallmd.setParameters(Collections.singletonList(new AbstractParameterMetaData(new ThisValueMetaData())));
+ uninstallmd.setMethodName("uninstallPortletApplication");
+ bmd.setUninstalls(Collections.singletonList(uninstallmd));
//
try
Modified: modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2007-08-21 13:05:42 UTC (rev 8011)
+++ modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2007-08-21 13:49:37 UTC (rev 8012)
@@ -4,13 +4,14 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="PortletApplicationDeployer" class="org.jboss.portal.portlet.test.PortletApplicationDeployer">
- </bean>
-
<!-- An application registry mainly for listeners -->
<bean name="PortletApplicationRegistry" class="org.jboss.portal.portlet.impl.container.PortletApplicationRegistryImpl">
</bean>
+ <bean name="PortletApplicationDeployer" class="org.jboss.portal.portlet.test.PortletApplicationDeployer">
+ <property name="registry"><inject bean="PortletApplicationRegistry"/></property>
+ </bean>
+
<bean name="PortletAPIFactory" class="org.jboss.portal.portlet.impl.jsr168.PortletAPIFactoryImpl">
</bean>
Modified: modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/web.xml 2007-08-21 13:05:42 UTC (rev 8011)
+++ modules/portlet/trunk/test/src/resources/portlet-test-war/WEB-INF/web.xml 2007-08-21 13:49:37 UTC (rev 8012)
@@ -29,4 +29,12 @@
<listener>
<listener-class>org.jboss.portal.portlet.test.PortalKernelBootstrap</listener-class>
</listener>
+ <servlet>
+ <servlet-name>PortalServlet</servlet-name>
+ <servlet-class>org.jboss.portal.portlet.test.PortalServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>PortalServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
</web-app>
18 years, 8 months
JBoss Portal SVN: r8011 - modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-21 09:05:42 -0400 (Tue, 21 Aug 2007)
New Revision: 8011
Modified:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalKernelBootstrap.java
Log:
added a registration flag to know when we should unregister from the registry
Modified: modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalKernelBootstrap.java
===================================================================
--- modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalKernelBootstrap.java 2007-08-21 13:00:48 UTC (rev 8010)
+++ modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortalKernelBootstrap.java 2007-08-21 13:05:42 UTC (rev 8011)
@@ -28,6 +28,7 @@
import org.jboss.kernel.spi.event.KernelEventListener;
import org.jboss.kernel.spi.event.KernelEvent;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.kernel.spi.registry.KernelRegistry;
import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
@@ -49,17 +50,21 @@
private ServletContext servletContext;
/** . */
- protected BeanXMLDeployer deployer;
+ private BeanXMLDeployer deployer;
/** . */
- protected KernelDeployment deployment;
+ private KernelDeployment deployment;
+ /** . */
+ private boolean registered;
+
protected void bootstrap() throws Throwable
{
super.bootstrap();
//
getKernel().getRegistry().registerListener(this, null, "ABC");
+ registered = true;
//
deployer = new BeanXMLDeployer(getKernel());
@@ -89,14 +94,19 @@
}
//
- try
+ if (registered)
{
- getKernel().getRegistry().unregisterListener(this, null, "ABC");
+ registered = false;
+ try
+ {
+ KernelRegistry registry = getKernel().getRegistry();
+ registry.unregisterListener(this, null, "ABC");
+ }
+ catch (Throwable throwable)
+ {
+ log.error("Cannot unregister kernel registry listener", throwable);
+ }
}
- catch (Throwable throwable)
- {
- log.error("Cannot unregister kernel registry listener", throwable);
- }
//
servletContext = null;
18 years, 8 months