JBoss Portal SVN: r11699 - in branches/JBoss_Portal_Branch_2_7/core/src: resources/portal-server-war and 1 other directory.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-18 22:20:27 -0400 (Mon, 18 Aug 2008)
New Revision: 11699
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/css/login.css
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp
Log:
https://jira.jboss.org/jira/browse/JBPORTAL-2121
Modified: branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/css/login.css
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/css/login.css 2008-08-19 02:20:04 UTC (rev 11698)
+++ branches/JBoss_Portal_Branch_2_7/core/src/bin/portal-core-war/css/login.css 2008-08-19 02:20:27 UTC (rev 11699)
@@ -18,17 +18,18 @@
font-size: 10px;
font-weight: bold;
position: absolute;
- width: 75px;
}
input.login-button {
- bottom: 20px;
- right: 90px
+ bottom: 25px;
+ right: 90px;
+ width: 75px;
}
input.cancel-button {
- bottom: 20px;
+ bottom: 25px;
right: 10px;
+ width: 75px;
}
div.login-container div.login-header {
@@ -55,13 +56,12 @@
background-repeat: repeat-x;
width: 255px;
font-weight: bold;
- padding: 10px 0 0 0;
text-align: right;
}
div.login-container div.login-content div.form-field {
height: 25px;
- padding-right: 7px;
+ padding: 5px 11px 0 0;
}
div.error-message {
@@ -74,6 +74,7 @@
text-align:left;
}
-div.bottom-field{
- padding-bottom: 68px;
+div.button-container{
+ height: 50px;
+ position: relative;
}
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp 2008-08-19 02:20:04 UTC (rev 11698)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp 2008-08-19 02:20:27 UTC (rev 11699)
@@ -25,7 +25,7 @@
<%@page import="java.util.ResourceBundle"%>
<%
- ResourceBundle rb = ResourceBundle.getBundle("Resource", request.getLocale());
+ ResourceBundle rb = ResourceBundle.getBundle("conf.bundles.Resource", request.getLocale());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -60,16 +60,16 @@
<div class="login-container">
-
+
<div class="login-header">
<h2><%= rb.getString("LOGIN_TITLE") %></h2>
</div>
<div class="login-content">
-
+
<div class="error-message"
style="<%=(request.getAttribute(!UserStatus.OK.equals("org.jboss.portal.userStatus") ? "" : "display:none"))%>;">
<%
-
+
if (UserStatus.DISABLE.equals(request.getAttribute("org.jboss.portal.userStatus")))
{
out.println(rb.getString("ACCOUNT_DISABLED"));
@@ -90,12 +90,15 @@
<label for="j_username"><%= rb.getString("LOGIN_USERNAME") %></label>
<input type="text" name="j_username" id="j_username" value=""/>
</div>
- <div class="form-field bottom-field">
+ <div class="form-field">
<label for="j_password"><%= rb.getString("LOGIN_PASSWORD") %></label>
<input type="password" name="j_password" id="j_password" value=""/>
</div>
- <input style="<%=(request.getParameter("loginheight") != null ? "" : "display:none")%>;" type="button" name="cancel" value="<%= rb.getString("LOGIN_CANCEL") %>" class="cancel-button" onclick="window.parent.hideContentModal('login-modal');"/>
- <input style="<%=(request.getParameter("loginheight") != null ? "" : "right:10px")%>;" type="submit" name="login" value="<%= rb.getString("LOGIN_SUBMIT") %>" class="login-button"/>
+ <div class="button-container">
+ <input style="<%=(request.getParameter("loginheight") != null ? "" : "display:none")%>;" type="button" name="cancel" value="<%= rb.getString("LOGIN_CANCEL") %>" class="cancel-button" onclick="window.parent.hideContentModal('login-modal');"/>
+ <input style="<%=(request.getParameter("loginheight") != null ? "" : "right:10px")%>;" type="submit" name="login" value="<%= rb.getString("LOGIN_SUBMIT") %>" class="login-button"/>
+ </div>
+ <br class="clear"/>
</form>
</div>
15 years, 9 months
JBoss Portal SVN: r11698 - in branches/JBoss_Portal_Branch_2_6/core/src: resources/portal-server-war and 1 other directory.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-18 22:20:04 -0400 (Mon, 18 Aug 2008)
New Revision: 11698
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/css/login.css
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/login.jsp
Log:
https://jira.jboss.org/jira/browse/JBPORTAL-2121
Modified: branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/css/login.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/css/login.css 2008-08-16 01:49:08 UTC (rev 11697)
+++ branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/css/login.css 2008-08-19 02:20:04 UTC (rev 11698)
@@ -21,13 +21,15 @@
}
input.login-button {
- bottom: 20px;
- right: 90px
+ bottom: 25px;
+ right: 90px;
+ width: 75px;
}
input.cancel-button {
- bottom: 20px;
+ bottom: 25px;
right: 10px;
+ width: 75px;
}
div.login-container div.login-header {
@@ -54,13 +56,12 @@
background-repeat: repeat-x;
width: 255px;
font-weight: bold;
- padding: 10px 0 0 0;
text-align: right;
}
div.login-container div.login-content div.form-field {
height: 25px;
- padding-right: 7px;
+ padding: 5px 11px 0 0;
}
div.error-message {
@@ -73,6 +74,7 @@
text-align:left;
}
-div.bottom-field{
- padding-bottom: 68px;
+div.button-container{
+ height: 50px;
+ position: relative;
}
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/login.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/login.jsp 2008-08-16 01:49:08 UTC (rev 11697)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/login.jsp 2008-08-19 02:20:04 UTC (rev 11698)
@@ -90,12 +90,15 @@
<label for="j_username"><%= rb.getString("LOGIN_USERNAME") %></label>
<input type="text" name="j_username" id="j_username" value=""/>
</div>
- <div class="form-field bottom-field">
+ <div class="form-field">
<label for="j_password"><%= rb.getString("LOGIN_PASSWORD") %></label>
<input type="password" name="j_password" id="j_password" value=""/>
</div>
- <input style="<%=(request.getParameter("loginheight") != null ? "" : "display:none")%>;" type="button" name="cancel" value="<%= rb.getString("LOGIN_CANCEL") %>" class="cancel-button" onclick="window.parent.hideContentModal('login-modal');"/>
- <input style="<%=(request.getParameter("loginheight") != null ? "" : "right:10px")%>;" type="submit" name="login" value="<%= rb.getString("LOGIN_SUBMIT") %>" class="login-button"/>
+ <div class="button-container">
+ <input style="<%=(request.getParameter("loginheight") != null ? "" : "display:none")%>;" type="button" name="cancel" value="<%= rb.getString("LOGIN_CANCEL") %>" class="cancel-button" onclick="window.parent.hideContentModal('login-modal');"/>
+ <input style="<%=(request.getParameter("loginheight") != null ? "" : "right:10px")%>;" type="submit" name="login" value="<%= rb.getString("LOGIN_SUBMIT") %>" class="login-button"/>
+ </div>
+ <br class="clear"/>
</form>
</div>
15 years, 9 months
JBoss Portal SVN: r11697 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-15 21:49:08 -0400 (Fri, 15 Aug 2008)
New Revision: 11697
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
Log:
coordination ui work on event wirings
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-14 18:24:15 UTC (rev 11696)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-16 01:49:08 UTC (rev 11697)
@@ -60,6 +60,7 @@
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.Iterator;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
@@ -234,27 +235,7 @@
try
{
- //eventwirings prep for ui
- Collection<EventWiringInfo> wiringInfos = pomb.getCoordinationService().getEventWirings(page);
- if (!wiringInfos.isEmpty())
- {
- if (eventWirings == null)
- {
- eventWirings = new HashMap<String, EventWiringInfo>(wiringInfos.size());
- }
-
- if (displayEventWirings == null)
- {
- displayEventWirings = new HashMap<String, DisplayEventWiring>();
- }
-
- for (EventWiringInfo ewInfo : wiringInfos)
- {
- eventWirings.put(ewInfo.getName(), ewInfo);
- displayEventWirings.put(ewInfo.getName(), new DisplayEventWiring(ewInfo));
- }
- }
-
+ loadEventWirings();
loadWindowBindings();
//aliasbindings prep for ui
@@ -359,8 +340,36 @@
FacesContext.getCurrentInstance().renderResponse();
}
+
// Event Wirings methods
+ private void loadEventWirings()
+ {
+ PortalObject portalObject = getSelectedObject();
+ if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ {
+ Page page = (Page)portalObject;
+ Collection<EventWiringInfo> wiringInfos = pomb.getCoordinationService().getEventWirings(page);
+ if (!wiringInfos.isEmpty())
+ {
+ if (eventWirings == null)
+ {
+ eventWirings = new HashMap<String, EventWiringInfo>(wiringInfos.size());
+ }
+ if (displayEventWirings == null)
+ {
+ displayEventWirings = new HashMap<String, DisplayEventWiring>();
+ }
+
+ for (EventWiringInfo ewInfo : wiringInfos)
+ {
+ eventWirings.put(ewInfo.getName(), ewInfo);
+ displayEventWirings.put(ewInfo.getName(), new DisplayEventWiring(ewInfo));
+ }
+ }
+ }
+ }
+
public boolean isExplicitEventsUsed()
{
PortalObject portalObject = getSelectedObject();
@@ -368,7 +377,8 @@
if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
Page page = (Page)portalObject;
- if(pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page) != null){
+ if (pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page) != null)
+ {
enabled = pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page);
}
@@ -381,15 +391,16 @@
*
* @param event
* @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
+ *
*/
- public void explicitEventsListener(ValueChangeEvent event)throws IllegalCoordinationException
+ public void explicitEventsListener(ValueChangeEvent event) throws IllegalCoordinationException
{
PortalObject portalObject = getSelectedObject();
String newValue = event.getNewValue().toString();
if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
Page page = (Page)portalObject;
- pomb.getCoordinationService().setEventWiringImplicitMode(page,Boolean.parseBoolean(newValue));
+ pomb.getCoordinationService().setEventWiringImplicitMode(page, Boolean.parseBoolean(newValue));
}
}
@@ -418,14 +429,30 @@
{
return Collections.emptyList();
}
-
List<QNameSelectItem> result = new LinkedList<QNameSelectItem>();
result.addAll(eventNameToWindowSources.keySet());
Collections.sort(result);
+ return result;
+ }
+ public List<WindowSelectItem> getSourceWindows()
+ {
+ if (eventNameToWindowSources == null)
+ {
+ return Collections.emptyList();
+ }
+ List<WindowSelectItem> result = new LinkedList<WindowSelectItem>();
+ for (Object o : eventNameToWindowSources.entrySet())
+ {
+ //todo - implement
+ }
+
+ Collections.sort(result);
return result;
}
+
+
public List<? extends SelectItem> getSelectedSourceEvents()
{
return selectedSourceEvents;
@@ -579,7 +606,8 @@
if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
Page page = (Page)portalObject;
- if(pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page) != null){
+ if (pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page) != null)
+ {
enabled = pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page);
}
@@ -592,6 +620,7 @@
*
* @param event
* @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
+ *
*/
public void implicitParameterListener(ValueChangeEvent event) throws IllegalCoordinationException
{
@@ -600,7 +629,7 @@
if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
Page page = (Page)portalObject;
- pomb.getCoordinationService().setParameterBindingImplicitMode(page,Boolean.parseBoolean(newValue));
+ pomb.getCoordinationService().setParameterBindingImplicitMode(page, Boolean.parseBoolean(newValue));
}
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-14 18:24:15 UTC (rev 11696)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-16 01:49:08 UTC (rev 11697)
@@ -117,9 +117,13 @@
<h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}">
<f:selectItems value="#{coordinationAction.sourceEvents}"/>
</h:selectManyListbox>
+
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}">
+ <f:selectItems value="#{coordinationAction.sourceWindows}"/>
+ </h:selectManyListbox>
</h:form>
- <ui:repeat var="eventWirings" value="#{coordinationAction.eventWirings}">
+ <ui:repeat var="eventWirings" value="#{coordinationAction.displayEventWirings}">
#{eventWirings}
</ui:repeat>
<hr/>
@@ -128,7 +132,7 @@
<h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_EVENT_MANAGE_EXISTING}</h3>
<h:form>
<h:dataTable var="wiring" value="#{coordinationAction.displayEventWirings}"
- rendered="#{coordinationAction.explicitEventsUsed}"
+ rendered="true"
styleClass="objectList datatable"
rowClasses="portlet-section-body,portlet-section-alternate-blue"
columnClasses="objectNameColumn, objectActionColumn"
15 years, 9 months
JBoss Portal SVN: r11696 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-14 14:24:15 -0400 (Thu, 14 Aug 2008)
New Revision: 11696
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
Log:
coordination ui checkboxes and begin completing work on event bindings
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-14 16:31:48 UTC (rev 11695)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-14 18:24:15 UTC (rev 11696)
@@ -48,6 +48,7 @@
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import javax.xml.namespace.QName;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -59,7 +60,6 @@
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
-import java.util.ArrayList;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
@@ -83,7 +83,7 @@
private Map<String, String> aliasBindings;
- private Map<String, Map<String,String>> windowBindings;
+ private Map<String, Map<String, String>> windowBindings;
private String selectedRenderParameter;
@@ -99,7 +99,7 @@
public PortalObjectId getSelectedObjectId()
{
- //since this bean is in session, always check for new object request
+ //since this backing bean is in session, always check for new object request
String id = getFacesParam("id");
if (id != null)
{
@@ -287,11 +287,6 @@
{
ParameterInfo pInfo = (ParameterInfo)o;
availableRenderParameters.put(pInfo.getName().toString(), pInfo.getName().toString());
-// System.out.println("key---------" + pInfo.getName());
-// System.out.println("key---------" + pInfo.getId());
-// System.out.println("key---------" + pInfo.getDescription());
-// System.out.println("key---------" + pInfo.getAliases());
-
}
// retrieve metadata on events
@@ -348,7 +343,7 @@
}
/**
- * Parse PortalObjectId for given portlet object.
+ * Util: Parse PortalObjectId for given portlet object.
*
* @param id
* @return
@@ -368,22 +363,37 @@
public boolean isExplicitEventsUsed()
{
- try
+ PortalObject portalObject = getSelectedObject();
+ boolean enabled = false;
+ if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
- Map<String, String> props = getSelectedObject().getProperties();
- if (props != null)
- {
- return !Boolean.valueOf(props.get("coordination.event.implicit_mode"));
+ Page page = (Page)portalObject;
+ if(pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page) != null){
+ enabled = pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page);
}
+
}
- catch (Exception e)
+ return enabled;
+ }
+
+ /**
+ * Listener for explicit event checkbox
+ *
+ * @param event
+ * @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
+ */
+ public void explicitEventsListener(ValueChangeEvent event)throws IllegalCoordinationException
+ {
+ PortalObject portalObject = getSelectedObject();
+ String newValue = event.getNewValue().toString();
+ if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
- e.printStackTrace();
+ Page page = (Page)portalObject;
+ pomb.getCoordinationService().setEventWiringImplicitMode(page,Boolean.parseBoolean(newValue));
}
-
- return false;
}
+
public Map<String, EventWiringInfo> getEventWirings()
{
return eventWirings;
@@ -452,15 +462,6 @@
throw new NotYetImplemented("renameWiring not yet implemented!");
}
- /**
- * Listener for explicit event checkbox
- *
- * @param event
- */
- public void explicitEventsListener(ValueChangeEvent event)
- {
- }
-
public static class DisplayEventWiring implements Comparable
{
private String name;
@@ -514,54 +515,6 @@
}
}
- public static class DisplayParameterBinding implements Comparable{
-
- private String id;
-
- private QName name;
-
- private List<Window> windows;
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- public QName getName()
- {
- return name;
- }
-
- public void setName(QName name)
- {
- this.name = name;
- }
-
- public List<Window> getWindows()
- {
- if(windows == null){
- windows = new ArrayList<Window>();
- }
- return windows;
- }
-
- public void setWindows(List<Window> windows)
- {
- this.windows = windows;
- }
-
- public int compareTo(Object o)
- {
- DisplayParameterBinding other = (DisplayParameterBinding)o;
- return id.compareTo(other.getId());
- }
- }
-
public static class WindowSelectItem extends SelectItem implements Comparable
{
public WindowSelectItem(Window window)
@@ -618,6 +571,90 @@
}
}
+ // Parameter Binding
+ public boolean isParameterImplicitEnabled()
+ {
+ PortalObject portalObject = getSelectedObject();
+ boolean enabled = false;
+ if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ {
+ Page page = (Page)portalObject;
+ if(pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page) != null){
+ enabled = pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page);
+ }
+
+ }
+ return enabled;
+ }
+
+ /**
+ * Listener for implicit parameter binding checkbox
+ *
+ * @param event
+ * @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
+ */
+ public void implicitParameterListener(ValueChangeEvent event) throws IllegalCoordinationException
+ {
+ PortalObject portalObject = getSelectedObject();
+ String newValue = event.getNewValue().toString();
+ if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ {
+ Page page = (Page)portalObject;
+ pomb.getCoordinationService().setParameterBindingImplicitMode(page,Boolean.parseBoolean(newValue));
+ }
+ }
+
+
+ public static class DisplayParameterBinding implements Comparable
+ {
+
+ private String id;
+
+ private QName name;
+
+ private List<Window> windows;
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public void setName(QName name)
+ {
+ this.name = name;
+ }
+
+ public List<Window> getWindows()
+ {
+ if (windows == null)
+ {
+ windows = new ArrayList<Window>();
+ }
+ return windows;
+ }
+
+ public void setWindows(List<Window> windows)
+ {
+ this.windows = windows;
+ }
+
+ public int compareTo(Object o)
+ {
+ DisplayParameterBinding other = (DisplayParameterBinding)o;
+ return id.compareTo(other.getId());
+ }
+ }
+
private List<DisplayParameterBinding> displayParameterBindings;
public List<DisplayParameterBinding> getDisplayParameterBindings()
@@ -635,39 +672,32 @@
PortalObject portalObject = getSelectedObject();
if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
- Page page = (Page)portalObject;
- //windowbindings prep for ui
- //windowBindings = new LinkedHashMap<String, Map<String, String>>();
- displayParameterBindings = new ArrayList<DisplayParameterBinding>();
- for (Object o : pomb.getCoordinationService().getWindowBindings(page))
- {
- WindowBindingInfo wbInfo = (WindowBindingInfo)o;
- DisplayParameterBinding dpb = new DisplayParameterBinding();
- for (Object o1 : wbInfo.getWindows().entrySet())
+ Page page = (Page)portalObject;
+ displayParameterBindings = new ArrayList<DisplayParameterBinding>();
+ for (Object o : pomb.getCoordinationService().getWindowBindings(page))
{
+ WindowBindingInfo wbInfo = (WindowBindingInfo)o;
+ DisplayParameterBinding dpb = new DisplayParameterBinding();
+ for (Object o1 : wbInfo.getWindows().entrySet())
+ {
- Map.Entry entry = (Map.Entry)o1;
- Map tempMap = new LinkedHashMap<String,String>();
- Window paramName = (Window)entry.getKey();
- QName paramValue = (QName)entry.getValue();
- //quick filter for duplicate binding ids
- dpb.getWindows().add(paramName);
- if(dpb.getWindows().size() < 2){
- dpb.setId(wbInfo.getId());
- dpb.setName(paramValue);
+ Map.Entry entry = (Map.Entry)o1;
+ Window paramName = (Window)entry.getKey();
+ QName paramValue = (QName)entry.getValue();
+ //quick filter for duplicate binding ids
+ dpb.getWindows().add(paramName);
+ if (dpb.getWindows().size() < 2)
+ {
+ dpb.setId(wbInfo.getId());
+ dpb.setName(paramValue);
+ }
}
-
-
-
-// tempMap.put(paramValue.toString(), paramName.getName());
-// windowBindings.put(wbInfo.getId(),tempMap);
+ displayParameterBindings.add(dpb);
}
- displayParameterBindings.add(dpb);
}
- }
}
- public void createWindowBinding(ActionEvent event)
+ public void createWindowBinding(ActionEvent event) throws IllegalCoordinationException
{
Map<Window, QName> windowBinding = null;
for (String window : selectedWindows)
@@ -678,16 +708,10 @@
if (portalObject.getType() == PortalObject.TYPE_WINDOW)
{
windowBinding.put((Window)portalObject, QName.valueOf(selectedRenderParameter));
- try
- {
- pomb.getCoordinationService().setWindowBinding(windowBindingName, windowBinding);
- }
- catch (IllegalCoordinationException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
+ pomb.getCoordinationService().setWindowBinding(windowBindingName, windowBinding);
}
}
- loadWindowBindings();
+ //refresh data
+ loadWindowBindings();
}
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-14 16:31:48 UTC (rev 11695)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-14 18:24:15 UTC (rev 11696)
@@ -6,214 +6,180 @@
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:pfc="http://www.jboss.com/portal/facelet/common"
xmlns:c="http://java.sun.com/jstl/core">
- <ui:param name="portalObjectScreen" value="#{bundle.COORDINATION_COORDINATION}"/>
- <ui:define name="content">
- <div class="tenpx-top-bottom">
- <h2 class="portlet-area-header">#{coordinationAction.selectedObject.name} #{bundle.COORDINATION_PARAMETER_BINDINGS}</h2>
+<ui:param name="portalObjectScreen" value="#{bundle.COORDINATION_COORDINATION}"/>
+<ui:define name="content">
- <!-- Create parameter binding -->
- <h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_CREATE_PARAMETER_BINDING}</h3>
- #{bundle.COORDINATION_PARAMETER_IMPLICIT_MODE} #{coordinationAction.selectedObject.properties['coordination.parameter.implicit_mode']}
- <hr/>
+ <div class="tenpx-top-bottom">
+ <h2
+ class="portlet-area-header">#{coordinationAction.selectedObject.name} #{bundle.COORDINATION_PARAMETER_BINDINGS}</h2>
- <h:form>
- <h:messages />
+ <!-- Create parameter binding -->
+ <h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_CREATE_PARAMETER_BINDING}</h3>
- <div class="float-left quarter-width">
- Available Render Parameter Names
- <h:selectOneListbox size="5" value="#{coordinationAction.selectedRenderParameter}">
- <f:selectItems value="#{coordinationAction.availableRenderParameters}"/>
- </h:selectOneListbox>
- </div>
+ <h:form>
+ <h:selectBooleanCheckbox id="useImplicitBinding" value="#{coordinationAction.parameterImplicitEnabled}"
+ onchange="this.form.submit()"
+ valueChangeListener="#{coordinationAction.implicitParameterListener}"/>
+ Enable #{bundle.COORDINATION_PARAMETER_IMPLICIT_MODE}
+ </h:form>
+ <hr/>
+ <h:form>
+ <h:messages/>
- <div class="float-left quarter-width">
- #{bundle.COORDINATION_WINDOWS}
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedWindows}">
- <f:selectItems value="#{coordinationAction.windows}"/>
- </h:selectManyListbox>
+ <div class="float-left quarter-width">
+ Available Render Parameter Names
+ <h:selectOneListbox size="5" value="#{coordinationAction.selectedRenderParameter}">
+ <f:selectItems value="#{coordinationAction.availableRenderParameters}"/>
+ </h:selectOneListbox>
+ </div>
- </div>
+ <div class="float-left quarter-width">
+ #{bundle.COORDINATION_WINDOWS}
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedWindows}">
+ <f:selectItems value="#{coordinationAction.windows}"/>
+ </h:selectManyListbox>
- <div class="float-left quarter-width">
- <h:inputText value="#{coordinationAction.windowBindingName}"/>
- </div>
- <h:commandButton actionListener="#{coordinationAction.createWindowBinding}" value="Create Binding" />
+ </div>
+
+ <div class="float-left quarter-width">
+ <h:inputText value="#{coordinationAction.windowBindingName}"/>
+ </div>
+
+ <h:commandButton actionListener="#{coordinationAction.createWindowBinding}" value="Create Binding"/>
<br class="clear"/>
- </h:form>
- <!-- Manage existing parameter bindings -->
- <h3 class="sectionTitle tenpx-top-bottom">Manage Existing Parameter Bindings</h3>
+ </h:form>
+ <!-- Manage existing parameter bindings -->
+ <h3 class="sectionTitle tenpx-top-bottom">Manage Existing Parameter Bindings</h3>
- <div class="float-left full-width">
- <h:form>
- <h:dataTable var="binding" value="#{coordinationAction.displayParameterBindings}"
- rendered="true"
- styleClass="objectList datatable"
- rowClasses="portlet-section-body,portlet-section-alternate-blue"
- columnClasses="objectNameColumn"
- headerClass="portlet-section-header">
- <h:column>
- <f:facet name="header">
- Binding Name
- </f:facet>
- #{binding.id}
- </h:column>
- <h:column>
- <f:facet name="header">
- Original QName
- </f:facet>
- #{binding.name}
- </h:column>
- <h:column>
- <f:facet name="header">
- Target Windows
- </f:facet>
- <ui:repeat var="window" value="#{binding.windows}">
- #{window.name},
- </ui:repeat>
+ <div class="float-left full-width">
+ <h:form>
+ <h:dataTable var="binding" value="#{coordinationAction.displayParameterBindings}"
+ rendered="true"
+ styleClass="objectList datatable"
+ rowClasses="portlet-section-body,portlet-section-alternate-blue"
+ columnClasses="objectNameColumn"
+ headerClass="portlet-section-header">
+ <h:column>
+ <f:facet name="header">
+ Binding Name
+ </f:facet>
+ #{binding.id}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Original QName
+ </f:facet>
+ #{binding.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Target Windows
+ </f:facet>
+ <ui:repeat var="window" value="#{binding.windows}">
+ #{window.name},
+ </ui:repeat>
- </h:column>
+ </h:column>
- <h:column>
- <f:facet name="header">
- Actions
- </f:facet>
- Delete | Rename
-
- </h:column>
- </h:dataTable>
- </h:form>
- </div>
+ <h:column>
+ <f:facet name="header">
+ Actions
+ </f:facet>
+ Delete | Rename
- <br class="clear"/>
+ </h:column>
+ </h:dataTable>
+ </h:form>
</div>
- <!-- Event wirings -->
- <h2 class="portlet-area-header">#{coordinationAction.selectedObject.name} #{bundle.COORDINATION_EVENT_WIRINGS}</h2>
+ <br class="clear"/>
+ </div>
- <h:form>
+ <!-- Event wirings -->
+ <h2 class="portlet-area-header">#{coordinationAction.selectedObject.name} #{bundle.COORDINATION_EVENT_WIRINGS}</h2>
- <h:selectBooleanCheckbox id="useExplicitEvents" value="#{coordinationAction.explicitEventsUsed}"
- onchange="this.form.submit()" valueChangeListener="#{consumer.explicitEventsListener}"
- immediate="true"/> #{bundle.COORDINATION_EVENT_EXPLICIT_MODE}
-
- </h:form>
+ <h:form>
- <!-- Manage existing wirings -->
- <h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_EVENT_MANAGE_EXISTING}</h3>
- <h:form>
- <h:dataTable var="wiring" value="#{coordinationAction.displayEventWirings}"
- rendered="#{coordinationAction.explicitEventsUsed}"
- styleClass="objectList datatable"
- rowClasses="portlet-section-body,portlet-section-alternate-blue"
- columnClasses="objectNameColumn, objectActionColumn"
- headerClass="portlet-section-header">
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_NAME}"/>
- </f:facet>
- #{wiring.name}
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_SOURCE_WINDOWS}"/>
- </f:facet>
- #{wiring.sourceWindows}
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_SOURCE_EVENTS}"/>
- </f:facet>
- #{wiring.sourceEvents}
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_DESTINATION_EVENTS}"/>
- </f:facet>
- #{wiring.destinationEvents}
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_DESTINATION_WINDOWS}"/>
- </f:facet>
- #{wiring.destinationWindows}
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_ACTIONS}"/>
- </f:facet>
+ <h:selectBooleanCheckbox id="useExplicitEvents" value="#{coordinationAction.explicitEventsUsed}"
+ onchange="this.form.submit()"
+ valueChangeListener="#{coordinationAction.explicitEventsListener}"
+ immediate="true"/> Enable Event Implicit Mode
- <h:commandLink action="#{coordinationAction.renameWiring}">
- <h:outputText styleClass="actionRename" value="#{bundle.RENAME}"/>
- <f:param name="wiring" value="#{wiring.name}"/>
- </h:commandLink> |
- <h:commandLink action="#{coordinationAction.deleteWiring}">
- <h:outputText styleClass="actionDelete" value="#{bundle.COMMON_DELETE}"/>
- <f:param name="wiring" value="#{wiring.name}"/>
- </h:commandLink>
- </h:column>
- </h:dataTable>
- </h:form>
+ </h:form>
- <!-- Create new event wiring -->
- <h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_EVENT_CREATE}</h3>
- <h:form>
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}">
- <f:selectItems value="#{coordinationAction.sourceEvents}"/>
- </h:selectManyListbox>
- </h:form>
-
- <ui:remove>
- <h:selectManyListbox size="5" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.eventWirings}"/>
+ <!-- Create new event wiring -->
+ <h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_EVENT_CREATE}</h3>
+ <h:form>
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}">
+ <f:selectItems value="#{coordinationAction.sourceEvents}"/>
</h:selectManyListbox>
- <br/>
- <ui:repeat var="eventWirings" value="#{coordinationAction.eventWirings}">
- #{eventWirings}
- </ui:repeat>
- <hr/>
+ </h:form>
- eventSources
- <h:selectManyListbox size="5" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.eventSources}"/>
- </h:selectManyListbox>
- <br/>
- <ui:repeat var="eventSources" value="#{coordinationAction.eventSources}">
- #{eventSources}
- </ui:repeat>
+ <ui:repeat var="eventWirings" value="#{coordinationAction.eventWirings}">
+ #{eventWirings}
+ </ui:repeat>
+ <hr/>
- <hr/>
- eventDestinations
- <h:selectManyListbox size="5" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.eventDestinations}"/>
- </h:selectManyListbox>
- <br/>
- <ui:repeat var="eventDestinations" value="#{coordinationAction.eventDestinations}">
- #{eventDestinations}
- </ui:repeat>
- <h:selectOneMenu id="locales" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.pomb.portalItems}"/>
- </h:selectOneMenu>
- <br/>
+ <!-- Manage existing wirings -->
+ <h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_EVENT_MANAGE_EXISTING}</h3>
+ <h:form>
+ <h:dataTable var="wiring" value="#{coordinationAction.displayEventWirings}"
+ rendered="#{coordinationAction.explicitEventsUsed}"
+ styleClass="objectList datatable"
+ rowClasses="portlet-section-body,portlet-section-alternate-blue"
+ columnClasses="objectNameColumn, objectActionColumn"
+ headerClass="portlet-section-header">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_NAME}"/>
+ </f:facet>
+ #{wiring.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_SOURCE_WINDOWS}"/>
+ </f:facet>
+ #{wiring.sourceWindows}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_SOURCE_EVENTS}"/>
+ </f:facet>
+ #{wiring.sourceEvents}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_DESTINATION_EVENTS}"/>
+ </f:facet>
+ #{wiring.destinationEvents}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_DESTINATION_WINDOWS}"/>
+ </f:facet>
+ #{wiring.destinationWindows}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_ACTIONS}"/>
+ </f:facet>
- <h:selectOneMenu id="locales" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.pomb.instanceItems}"/>
- </h:selectOneMenu>
- <br/>
+ <h:commandLink action="#{coordinationAction.renameWiring}">
+ <h:outputText styleClass="actionRename" value="#{bundle.RENAME}"/>
+ <f:param name="wiring" value="#{wiring.name}"/>
+ </h:commandLink> |
+ <h:commandLink action="#{coordinationAction.deleteWiring}">
+ <h:outputText styleClass="actionDelete" value="#{bundle.COMMON_DELETE}"/>
+ <f:param name="wiring" value="#{wiring.name}"/>
+ </h:commandLink>
+ </h:column>
+ </h:dataTable>
+ </h:form>
- <h:selectOneMenu id="locales" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.pomb.portalPageItems}"/>
- </h:selectOneMenu>
- <hr/>
- #{bundle.COORDINATION_ALIAS_BINDINGS}
- <h:selectManyListbox size="5" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.aliasBindings}"/>
- </h:selectManyListbox>
- <br/>
- </ui:remove>
- </ui:define>
+</ui:define>
</ui:composition>
15 years, 9 months
JBoss Portal SVN: r11695 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-14 12:31:48 -0400 (Thu, 14 Aug 2008)
New Revision: 11695
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
Log:
parameter/window binding ui cleanup and fixes
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-14 04:14:23 UTC (rev 11694)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-14 16:31:48 UTC (rev 11695)
@@ -59,6 +59,7 @@
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.ArrayList;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
@@ -84,7 +85,7 @@
private Map<String, Map<String,String>> windowBindings;
- private List<String> selectedRenderParameters;
+ private String selectedRenderParameter;
private Map<String, String> availableRenderParameters;
@@ -193,14 +194,14 @@
this.windowBindings = windowBindings;
}
- public List<String> getSelectedRenderParameters()
+ public String getSelectedRenderParameter()
{
- return selectedRenderParameters;
+ return selectedRenderParameter;
}
- public void setSelectedRenderParameters(List<String> selectedRenderParameters)
+ public void setSelectedRenderParameter(String selectedRenderParameter)
{
- this.selectedRenderParameters = selectedRenderParameters;
+ this.selectedRenderParameter = selectedRenderParameter;
}
public String getWindowBindingName()
@@ -513,6 +514,54 @@
}
}
+ public static class DisplayParameterBinding implements Comparable{
+
+ private String id;
+
+ private QName name;
+
+ private List<Window> windows;
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public void setName(QName name)
+ {
+ this.name = name;
+ }
+
+ public List<Window> getWindows()
+ {
+ if(windows == null){
+ windows = new ArrayList<Window>();
+ }
+ return windows;
+ }
+
+ public void setWindows(List<Window> windows)
+ {
+ this.windows = windows;
+ }
+
+ public int compareTo(Object o)
+ {
+ DisplayParameterBinding other = (DisplayParameterBinding)o;
+ return id.compareTo(other.getId());
+ }
+ }
+
public static class WindowSelectItem extends SelectItem implements Comparable
{
public WindowSelectItem(Window window)
@@ -569,6 +618,18 @@
}
}
+ private List<DisplayParameterBinding> displayParameterBindings;
+
+ public List<DisplayParameterBinding> getDisplayParameterBindings()
+ {
+ return displayParameterBindings;
+ }
+
+ public void setDisplayParameterBindings(List<DisplayParameterBinding> displayParameterBindings)
+ {
+ this.displayParameterBindings = displayParameterBindings;
+ }
+
private void loadWindowBindings()
{
PortalObject portalObject = getSelectedObject();
@@ -576,53 +637,57 @@
{
Page page = (Page)portalObject;
//windowbindings prep for ui
- windowBindings = new LinkedHashMap<String, Map<String, String>>();
+ //windowBindings = new LinkedHashMap<String, Map<String, String>>();
+ displayParameterBindings = new ArrayList<DisplayParameterBinding>();
for (Object o : pomb.getCoordinationService().getWindowBindings(page))
{
WindowBindingInfo wbInfo = (WindowBindingInfo)o;
+ DisplayParameterBinding dpb = new DisplayParameterBinding();
for (Object o1 : wbInfo.getWindows().entrySet())
{
+
Map.Entry entry = (Map.Entry)o1;
Map tempMap = new LinkedHashMap<String,String>();
Window paramName = (Window)entry.getKey();
QName paramValue = (QName)entry.getValue();
- tempMap.put(paramValue.toString(), paramName.getName());
- windowBindings.put(wbInfo.getId(),tempMap);
+ //quick filter for duplicate binding ids
+ dpb.getWindows().add(paramName);
+ if(dpb.getWindows().size() < 2){
+ dpb.setId(wbInfo.getId());
+ dpb.setName(paramValue);
+ }
+
+
+
+// tempMap.put(paramValue.toString(), paramName.getName());
+// windowBindings.put(wbInfo.getId(),tempMap);
}
+ displayParameterBindings.add(dpb);
}
}
}
public void createWindowBinding(ActionEvent event)
{
-
- System.out.println("-----------++++++++++ " + selectedRenderParameters.size());
Map<Window, QName> windowBinding = null;
-
for (String window : selectedWindows)
{
- windowBinding = new LinkedHashMap<Window, QName>();
+ windowBinding = new HashMap<Window, QName>();
PortalObject portalObject = pomb.getPortalObjectContainer().getObject(parsePortalObjectId(window));
if (portalObject.getType() == PortalObject.TYPE_WINDOW)
{
- for (String binding : selectedRenderParameters)
+ windowBinding.put((Window)portalObject, QName.valueOf(selectedRenderParameter));
+ try
{
- System.out.println("----------window name-" + portalObject.getName());
- System.out.println("----------namespace-" + binding);
- windowBinding.put((Window)portalObject, QName.valueOf(binding));
+ pomb.getCoordinationService().setWindowBinding(windowBindingName, windowBinding);
}
+ catch (IllegalCoordinationException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
}
}
- try
- {
- pomb.getCoordinationService().setWindowBinding(windowBindingName, windowBinding);
- }
- catch (IllegalCoordinationException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
loadWindowBindings();
-
}
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-14 04:14:23 UTC (rev 11694)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-14 16:31:48 UTC (rev 11695)
@@ -21,9 +21,9 @@
<div class="float-left quarter-width">
Available Render Parameter Names
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedRenderParameters}">
+ <h:selectOneListbox size="5" value="#{coordinationAction.selectedRenderParameter}">
<f:selectItems value="#{coordinationAction.availableRenderParameters}"/>
- </h:selectManyListbox>
+ </h:selectOneListbox>
</div>
@@ -42,27 +42,52 @@
<h:commandButton actionListener="#{coordinationAction.createWindowBinding}" value="Create Binding" />
<br class="clear"/>
- <hr/>
- #{coordinationAction.windowBindings}
- <hr/>
- <ui:repeat var="wb" value="#{coordinationAction.windowBindings}">
- #{wb}
- </ui:repeat>
</h:form>
<!-- Manage existing parameter bindings -->
<h3 class="sectionTitle tenpx-top-bottom">Manage Existing Parameter Bindings</h3>
- <div class="float-left quarter-width">
- <ui:remove>
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedRenderParameters}">
- <f:selectItems value="#{coordinationAction.windows}"/>
- </h:selectManyListbox>
- </ui:remove>
+ <div class="float-left full-width">
+ <h:form>
+ <h:dataTable var="binding" value="#{coordinationAction.displayParameterBindings}"
+ rendered="true"
+ styleClass="objectList datatable"
+ rowClasses="portlet-section-body,portlet-section-alternate-blue"
+ columnClasses="objectNameColumn"
+ headerClass="portlet-section-header">
+ <h:column>
+ <f:facet name="header">
+ Binding Name
+ </f:facet>
+ #{binding.id}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Original QName
+ </f:facet>
+ #{binding.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Target Windows
+ </f:facet>
+ <ui:repeat var="window" value="#{binding.windows}">
+ #{window.name},
+ </ui:repeat>
+
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ Actions
+ </f:facet>
+ Delete | Rename
+
+ </h:column>
+ </h:dataTable>
+ </h:form>
</div>
- <div class="float-left quarter-width">
- <h:inputText value="#{coordinationAction.stringStub}"/>
- </div>
+
<br class="clear"/>
</div>
15 years, 9 months
JBoss Portal SVN: r11694 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/WEB-INF and 1 other directories.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-08-14 00:14:23 -0400 (Thu, 14 Aug 2008)
New Revision: 11694
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
Log:
window binding updates, first working draft - wip
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-12 18:29:05 UTC (rev 11693)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-14 04:14:23 UTC (rev 11694)
@@ -35,6 +35,7 @@
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.portlet.info.EventInfo;
import org.jboss.portal.portlet.info.EventingInfo;
@@ -47,11 +48,11 @@
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import javax.xml.namespace.QName;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -67,8 +68,10 @@
{
private PortalObjectManagerBean pomb;
- private Map<String, PortalObjectId> windows;
+ private Map<String, String> windows;
+ private List<String> selectedWindows;
+
private Map<String, EventWiringInfo> eventWirings;
private Map<String, DisplayEventWiring> displayEventWirings;
@@ -79,39 +82,73 @@
private Map<String, String> aliasBindings;
- private ArrayList<SelectItem> windowBindings = new ArrayList<SelectItem>();
+ private Map<String, Map<String,String>> windowBindings;
- private List<ParameterInfo> availablePRPs;
+ private List<String> selectedRenderParameters;
- private List<SelectItem> selectedWindowBindings = new ArrayList<SelectItem>();
+ private Map<String, String> availableRenderParameters;
private String stringStub;
+ private PortalObject selectedObject;
+
+ private PortalObjectId selectedObjectId;
+
+ private String windowBindingName;
+
public PortalObjectId getSelectedObjectId()
{
- return pomb.getSelectedPortalObjectId();
+ //since this bean is in session, always check for new object request
+ String id = getFacesParam("id");
+ if (id != null)
+ {
+ selectedObjectId = parsePortalObjectId(id);
+ }
+ else
+ {
+ selectedObjectId = pomb.getSelectedObject().getId();
+ }
+ return selectedObjectId;
}
+ public void setSelectedObjectId(PortalObjectId selectedObjectId)
+ {
+ this.selectedObjectId = selectedObjectId;
+ }
+
public PortalObject getSelectedObject()
{
- System.out.println("------getSelectedObjectId()---" + getSelectedObjectId());
- return pomb.getPortalObjectContainer().getObject(getSelectedObjectId());
+ selectedObject = pomb.getPortalObjectContainer().getObject(getSelectedObjectId());
+ //perform surgery on portalobjectmanager
+ pomb.selectObject(pomb.getPortalObjectContainer().getObject(selectedObject.getId()));
+ return selectedObject;
}
- public Map<String, PortalObjectId> getWindows()
+ public void setSelectedObject(PortalObject selectedObject)
{
- if (windows == null)
- {
- windows = new HashMap<String, PortalObjectId>();
- }
+ this.selectedObject = selectedObject;
+ }
+
+ public Map<String, String> getWindows()
+ {
return windows;
}
- public void setWindows(Map<String, PortalObjectId> windows)
+ public void setWindows(Map<String, String> windows)
{
this.windows = windows;
}
+ public List<String> getSelectedWindows()
+ {
+ return selectedWindows;
+ }
+
+ public void setSelectedWindows(List<String> selectedWindows)
+ {
+ this.selectedWindows = selectedWindows;
+ }
+
public PortalObjectManagerBean getPomb()
{
return pomb;
@@ -136,38 +173,44 @@
this.aliasBindings = aliasBindings;
}
- public ArrayList<SelectItem> getWindowBindings()
+ public Map<String, String> getAvailableRenderParameters()
{
+ return availableRenderParameters;
+ }
+
+ public void setAvailableRenderParameters(Map<String, String> availableRenderParameters)
+ {
+ this.availableRenderParameters = availableRenderParameters;
+ }
+
+ public Map<String, Map<String, String>> getWindowBindings()
+ {
return windowBindings;
}
- public void setWindowBindings(ArrayList<SelectItem> windowBindings)
+ public void setWindowBindings(Map<String, Map<String, String>> windowBindings)
{
this.windowBindings = windowBindings;
}
- public List<ParameterInfo> getAvailablePRPs()
+ public List<String> getSelectedRenderParameters()
{
- if (availablePRPs == null)
- {
- availablePRPs = new ArrayList<ParameterInfo>();
- }
- return availablePRPs;
+ return selectedRenderParameters;
}
- public void setAvailablePRPs(List<ParameterInfo> availablePRPs)
+ public void setSelectedRenderParameters(List<String> selectedRenderParameters)
{
- this.availablePRPs = availablePRPs;
+ this.selectedRenderParameters = selectedRenderParameters;
}
- public List<SelectItem> getSelectedWindowBindings()
+ public String getWindowBindingName()
{
- return selectedWindowBindings;
+ return windowBindingName;
}
- public void setSelectedWindowBindings(List<SelectItem> selectedWindowBindings)
+ public void setWindowBindingName(String windowBindingName)
{
- this.selectedWindowBindings = selectedWindowBindings;
+ this.windowBindingName = windowBindingName;
}
public String getStringStub()
@@ -183,7 +226,6 @@
public String editCoordination() throws ConversionException
{
PortalObject portalObject = getSelectedObject();
-
if (portalObject.getType() == PortalObject.TYPE_PAGE)
{
@@ -212,6 +254,8 @@
}
}
+ loadWindowBindings();
+
//aliasbindings prep for ui
for (Object o : pomb.getCoordinationService().getAliasBindings(page))
{
@@ -222,25 +266,14 @@
}
}
- //windowbindings prep for ui
- for (Object o : pomb.getCoordinationService().getWindowBindings(page))
- {
- WindowBindingInfo wbInfo = (WindowBindingInfo)o;
- for (Object o1 : wbInfo.getWindows().entrySet())
- {
- Map.Entry entry = (Map.Entry)o1;
- Window paramName = (Window)entry.getKey();
- QName paramValue = (QName)entry.getValue();
- getWindowBindings().add(new SelectItem(paramName.getName(), paramValue.toString()));
- //System.out.println("-------paramName.getName()-" + paramName.getName());
- }
- }
-
// Extract metadata only on window children
+ availableRenderParameters = new LinkedHashMap<String, String>();
+ windows = new LinkedHashMap<String, String>();
for (PortalObject po : page.getChildren(PortalObject.WINDOW_MASK))
{
Window window = (Window)po;
- getWindows().put(window.getName(), window.getId());
+ String temp = window.getId() + "";
+ windows.put(window.getName(), window.getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT));
if (ContentType.PORTLET.equals(window.getContentType()))
{
PortletContent pc = (PortletContent)window.getContent();
@@ -252,7 +285,7 @@
for (Object o : navInfo.getPublicParameters())
{
ParameterInfo pInfo = (ParameterInfo)o;
- getAvailablePRPs().add(pInfo);
+ availableRenderParameters.put(pInfo.getName().toString(), pInfo.getName().toString());
// System.out.println("key---------" + pInfo.getName());
// System.out.println("key---------" + pInfo.getId());
// System.out.println("key---------" + pInfo.getDescription());
@@ -313,6 +346,17 @@
return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(name);
}
+ /**
+ * Parse PortalObjectId for given portlet object.
+ *
+ * @param id
+ * @return
+ */
+ private PortalObjectId parsePortalObjectId(String id)
+ {
+ return PortalObjectId.parse(id, PortalObjectPath.LEGACY_BASE64_FORMAT);
+ }
+
/** Bypass the rest of the life cycle and re-display page */
public void renderResponse()
{
@@ -323,11 +367,19 @@
public boolean isExplicitEventsUsed()
{
- Map<String, String> props = getSelectedObject().getProperties();
- if (props != null)
+ try
{
- return !Boolean.valueOf(props.get("coordination.event.implicit_mode"));
+ Map<String, String> props = getSelectedObject().getProperties();
+ if (props != null)
+ {
+ return !Boolean.valueOf(props.get("coordination.event.implicit_mode"));
+ }
}
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
return false;
}
@@ -394,18 +446,18 @@
{
String wiring = getFacesParam("wiring");
EventWiringInfo event = eventWirings.get(wiring);
- // todo: implement, rename operation should be on CoordinationConfigurator
+ //todo: implement, rename operation should be on CoordinationConfigurator
throw new NotYetImplemented("renameWiring not yet implemented!");
}
/**
* Listener for explicit event checkbox
+ *
* @param event
*/
public void explicitEventsListener(ValueChangeEvent event)
{
-
}
public static class DisplayEventWiring implements Comparable
@@ -476,7 +528,7 @@
public Window getWindow()
{
- return (Window) getValue();
+ return (Window)getValue();
}
}
@@ -490,12 +542,12 @@
public QName getQName()
{
- return (QName) getValue();
+ return (QName)getValue();
}
public int compareTo(Object o)
{
- QNameSelectItem other = (QNameSelectItem) o;
+ QNameSelectItem other = (QNameSelectItem)o;
return getQName().toString().compareTo(other.getQName().toString());
}
@@ -508,22 +560,69 @@
@Override
public boolean equals(Object obj)
{
- if(!(obj instanceof QNameSelectItem))
+ if (!(obj instanceof QNameSelectItem))
{
return false;
}
- QNameSelectItem item = (QNameSelectItem) obj;
+ QNameSelectItem item = (QNameSelectItem)obj;
return getQName().equals(item.getQName());
}
}
+ private void loadWindowBindings()
+ {
+ PortalObject portalObject = getSelectedObject();
+ if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ {
+ Page page = (Page)portalObject;
+ //windowbindings prep for ui
+ windowBindings = new LinkedHashMap<String, Map<String, String>>();
+ for (Object o : pomb.getCoordinationService().getWindowBindings(page))
+ {
+ WindowBindingInfo wbInfo = (WindowBindingInfo)o;
+ for (Object o1 : wbInfo.getWindows().entrySet())
+ {
+ Map.Entry entry = (Map.Entry)o1;
+ Map tempMap = new LinkedHashMap<String,String>();
+ Window paramName = (Window)entry.getKey();
+ QName paramValue = (QName)entry.getValue();
+ tempMap.put(paramValue.toString(), paramName.getName());
+ windowBindings.put(wbInfo.getId(),tempMap);
+ }
+ }
+ }
+ }
+
public void createWindowBinding(ActionEvent event)
{
- //String id = (String) event.getComponent().getAttributes().get("");
- for (SelectItem binding : getSelectedWindowBindings())
+
+ System.out.println("-----------++++++++++ " + selectedRenderParameters.size());
+ Map<Window, QName> windowBinding = null;
+
+ for (String window : selectedWindows)
{
- System.out.println("-----------" + binding);
+ windowBinding = new LinkedHashMap<Window, QName>();
+ PortalObject portalObject = pomb.getPortalObjectContainer().getObject(parsePortalObjectId(window));
+
+ if (portalObject.getType() == PortalObject.TYPE_WINDOW)
+ {
+ for (String binding : selectedRenderParameters)
+ {
+ System.out.println("----------window name-" + portalObject.getName());
+ System.out.println("----------namespace-" + binding);
+ windowBinding.put((Window)portalObject, QName.valueOf(binding));
+ }
+ }
}
+ try
+ {
+ pomb.getCoordinationService().setWindowBinding(windowBindingName, windowBinding);
+ }
+ catch (IllegalCoordinationException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+ loadWindowBindings();
}
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-08-12 18:29:05 UTC (rev 11693)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-08-14 04:14:23 UTC (rev 11694)
@@ -346,7 +346,7 @@
<managed-bean>
<managed-bean-name>coordinationAction</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.CoordinationAction</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>pomb</property-name>
<value>#{portalobjectmgr}</value>
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-12 18:29:05 UTC (rev 11693)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-14 04:14:23 UTC (rev 11694)
@@ -17,40 +17,48 @@
<hr/>
<h:form>
- <ui:remove>
- <div class="float-left quarter-width">
- #{bundle.COORDINATION_WINDOWS}
- <h:selectManyListbox size="5" value="#{coordinationAction.stringStub}">
- <f:selectItems value="#{coordinationAction.windows}"/>
- </h:selectManyListbox>
- </div>
- </ui:remove>
+ <h:messages />
- <div class="float-left quarter-width">
- #{bundle.COORDINATION_WINDOW_BINDINGS}
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedWindowBindings}">
- <f:selectItems value="#{coordinationAction.windowBindings}"/>
- </h:selectManyListbox>
- </div>
+ <div class="float-left quarter-width">
+ Available Render Parameter Names
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedRenderParameters}">
+ <f:selectItems value="#{coordinationAction.availableRenderParameters}"/>
+ </h:selectManyListbox>
+ </div>
- <ui:remove>
- <div class="float-left quarter-width">
- <h:inputText value="#{coordinationAction.stringStub}"/>
- </div>
- </ui:remove>
- <h:commandButton actionListener="#{coordinationAction.createWindowBinding}" value="Create Binding" >
- <f:param name="id" value="#{coordinationAction.selectedObjectId}"/>
- </h:commandButton>
+ <div class="float-left quarter-width">
+ #{bundle.COORDINATION_WINDOWS}
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedWindows}">
+ <f:selectItems value="#{coordinationAction.windows}"/>
+ </h:selectManyListbox>
+
+
+ </div>
+
+ <div class="float-left quarter-width">
+ <h:inputText value="#{coordinationAction.windowBindingName}"/>
+ </div>
+
+ <h:commandButton actionListener="#{coordinationAction.createWindowBinding}" value="Create Binding" />
<br class="clear"/>
+ <hr/>
+ #{coordinationAction.windowBindings}
+ <hr/>
+ <ui:repeat var="wb" value="#{coordinationAction.windowBindings}">
+ #{wb}
+ </ui:repeat>
+
</h:form>
<!-- Manage existing parameter bindings -->
<h3 class="sectionTitle tenpx-top-bottom">Manage Existing Parameter Bindings</h3>
<div class="float-left quarter-width">
- <h:selectManyListbox size="5" value="#{coordinationAction.stringStub}">
+ <ui:remove>
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedRenderParameters}">
<f:selectItems value="#{coordinationAction.windows}"/>
</h:selectManyListbox>
+ </ui:remove>
</div>
<div class="float-left quarter-width">
<h:inputText value="#{coordinationAction.stringStub}"/>
@@ -62,9 +70,11 @@
<h2 class="portlet-area-header">#{coordinationAction.selectedObject.name} #{bundle.COORDINATION_EVENT_WIRINGS}</h2>
<h:form>
+
<h:selectBooleanCheckbox id="useExplicitEvents" value="#{coordinationAction.explicitEventsUsed}"
onchange="this.form.submit()" valueChangeListener="#{consumer.explicitEventsListener}"
immediate="true"/> #{bundle.COORDINATION_EVENT_EXPLICIT_MODE}
+
</h:form>
<!-- Manage existing wirings -->
@@ -179,5 +189,6 @@
</h:selectManyListbox>
<br/>
</ui:remove>
+
</ui:define>
</ui:composition>
15 years, 9 months
JBoss Portal SVN: r11693 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-12 14:29:05 -0400 (Tue, 12 Aug 2008)
New Revision: 11693
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
Log:
- JBPORTAL-2123: requiresInitCookie should now be properly transmitted to SessionHandler thus, initCookie should be properly called.
- Requires more testing!
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-08-12 18:28:56 UTC (rev 11692)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-08-12 18:29:05 UTC (rev 11693)
@@ -441,7 +441,7 @@
{
// reset registration data and try again
producerInfo.resetRegistration();
- producerInfo.refresh(true);
+ refreshProducerInfo(true);
}
RegistrationContext getRegistrationContext() throws PortletInvokerException
@@ -518,7 +518,9 @@
throw new PortletInvokerException(e);
}
- return producerInfo.detailedRefresh(forceRefresh);
+ RefreshResult refreshResult = producerInfo.detailedRefresh(forceRefresh);
+ sessionHandler.setRequiresInitCookie(producerInfo.getRequiresInitCookie());
+ return refreshResult;
}
// Service implementation *******************************************************************************************
@@ -558,31 +560,36 @@
public WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getServiceDescriptionService();
}
public WSRP_v1_Markup_PortType getMarkupService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getMarkupService();
}
public WSRP_v1_PortletManagement_PortType getPortletManagementService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getPortletManagementService();
}
public WSRP_v1_Registration_PortType getRegistrationService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getRegistrationService();
}
public void refreshProducerInfo() throws PortletInvokerException
{
- producerInfo.refresh(true);
+ refreshProducerInfo(true);
+ }
+
+ public void refreshProducerInfo(boolean forceRefresh) throws PortletInvokerException
+ {
+ producerInfo.refresh(forceRefresh);
sessionHandler.setRequiresInitCookie(producerInfo.getRequiresInitCookie());
}
15 years, 9 months
JBoss Portal SVN: r11692 - branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-12 14:28:56 -0400 (Tue, 12 Aug 2008)
New Revision: 11692
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
Log:
- JBPORTAL-2123: requiresInitCookie should now be properly transmitted to SessionHandler thus, initCookie should be properly called.
- Requires more testing!
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-08-12 17:38:02 UTC (rev 11691)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2008-08-12 18:28:56 UTC (rev 11692)
@@ -442,7 +442,7 @@
{
// reset registration data and try again
producerInfo.resetRegistration();
- producerInfo.refresh(true);
+ refreshProducerInfo(true);
}
RegistrationContext getRegistrationContext() throws PortletInvokerException
@@ -519,7 +519,9 @@
throw new PortletInvokerException(e);
}
- return producerInfo.detailedRefresh(forceRefresh);
+ RefreshResult refreshResult = producerInfo.detailedRefresh(forceRefresh);
+ sessionHandler.setRequiresInitCookie(producerInfo.getRequiresInitCookie());
+ return refreshResult;
}
// Service implementation *******************************************************************************************
@@ -559,31 +561,36 @@
public WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getServiceDescriptionService();
}
public WSRP_v1_Markup_PortType getMarkupService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getMarkupService();
}
public WSRP_v1_PortletManagement_PortType getPortletManagementService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getPortletManagementService();
}
public WSRP_v1_Registration_PortType getRegistrationService() throws PortletInvokerException
{
- producerInfo.refresh(false);
+ refreshProducerInfo(false);
return getEndpointConfigurationInfo().getRegistrationService();
}
public void refreshProducerInfo() throws PortletInvokerException
{
- producerInfo.refresh(true);
+ refreshProducerInfo(true);
+ }
+
+ private void refreshProducerInfo(boolean forceRefresh) throws PortletInvokerException
+ {
+ producerInfo.refresh(forceRefresh);
sessionHandler.setRequiresInitCookie(producerInfo.getRequiresInitCookie());
}
15 years, 9 months
JBoss Portal SVN: r11691 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-12 13:38:02 -0400 (Tue, 12 Aug 2008)
New Revision: 11691
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
Log:
- Started event wiring creation form...
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-12 08:55:39 UTC (rev 11690)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-12 17:38:02 UTC (rev 11691)
@@ -36,7 +36,8 @@
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.info.EventInfo;
+import org.jboss.portal.portlet.info.EventingInfo;
import org.jboss.portal.portlet.info.NavigationInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -51,9 +52,12 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
@@ -68,9 +72,10 @@
private Map<String, EventWiringInfo> eventWirings;
private Map<String, DisplayEventWiring> displayEventWirings;
- private Map<String, String> eventSources;
+ private Map<QNameSelectItem, SortedSet<WindowSelectItem>> eventNameToWindowSources;
+ private Map<QNameSelectItem, SortedSet<WindowSelectItem>> eventNameToWindowDestinations;
- private Map<String, String> eventDestinations;
+ private List<? extends SelectItem> selectedSourceEvents;
private Map<String, String> aliasBindings;
@@ -117,34 +122,6 @@
this.pomb = pomb;
}
- public Map<String, String> getEventSources()
- {
- if (eventSources == null)
- {
- eventSources = new HashMap<String, String>();
- }
- return eventSources;
- }
-
- public void setEventSources(Map<String, String> eventSources)
- {
- this.eventSources = eventSources;
- }
-
- public Map<String, String> getEventDestinations()
- {
- if (eventDestinations == null)
- {
- eventDestinations = new HashMap<String, String>();
- }
- return eventDestinations;
- }
-
- public void setEventDestinations(Map<String, String> eventDestinations)
- {
- this.eventDestinations = eventDestinations;
- }
-
public Map<String, String> getAliasBindings()
{
if (aliasBindings == null)
@@ -214,22 +191,25 @@
try
{
-
//eventwirings prep for ui
Collection<EventWiringInfo> wiringInfos = pomb.getCoordinationService().getEventWirings(page);
- for (EventWiringInfo ewInfo : wiringInfos)
+ if (!wiringInfos.isEmpty())
{
if (eventWirings == null)
{
eventWirings = new HashMap<String, EventWiringInfo>(wiringInfos.size());
}
- eventWirings.put(ewInfo.getName(), ewInfo);
if (displayEventWirings == null)
{
displayEventWirings = new HashMap<String, DisplayEventWiring>();
}
- displayEventWirings.put(ewInfo.getName(), new DisplayEventWiring(ewInfo));
+
+ for (EventWiringInfo ewInfo : wiringInfos)
+ {
+ eventWirings.put(ewInfo.getName(), ewInfo);
+ displayEventWirings.put(ewInfo.getName(), new DisplayEventWiring(ewInfo));
+ }
}
//aliasbindings prep for ui
@@ -251,12 +231,12 @@
Map.Entry entry = (Map.Entry)o1;
Window paramName = (Window)entry.getKey();
QName paramValue = (QName)entry.getValue();
- getWindowBindings().add(new SelectItem(paramName.getName(),paramValue.toString()));
+ getWindowBindings().add(new SelectItem(paramName.getName(), paramValue.toString()));
//System.out.println("-------paramName.getName()-" + paramName.getName());
}
}
- // process only windows...
+ // Extract metadata only on window children
for (PortalObject po : page.getChildren(PortalObject.WINDOW_MASK))
{
Window window = (Window)po;
@@ -265,11 +245,10 @@
{
PortletContent pc = (PortletContent)window.getContent();
Instance instance = pomb.getInstanceContainer().getDefinition(pc.getInstanceRef());
- Portlet portlet = instance.getPortlet();
- PortletInfo info = portlet.getInfo();
+ PortletInfo info = instance.getPortlet().getInfo();
+
+ // retrieve metadata on public render parameters
NavigationInfo navInfo = info.getNavigation();
-
-
for (Object o : navInfo.getPublicParameters())
{
ParameterInfo pInfo = (ParameterInfo)o;
@@ -280,6 +259,11 @@
// System.out.println("key---------" + pInfo.getAliases());
}
+
+ // retrieve metadata on events
+ EventingInfo eventingInfo = info.getEventing();
+ eventNameToWindowSources = addEventInfoFor(window, eventingInfo.getProducedEvents(), eventNameToWindowSources);
+ eventNameToWindowDestinations = addEventInfoFor(window, eventingInfo.getConsumedEvents(), eventNameToWindowDestinations);
}
}
@@ -293,6 +277,29 @@
return "editCoordination";
}
+ private Map<QNameSelectItem, SortedSet<WindowSelectItem>> addEventInfoFor(Window window, Map<QName, ? extends EventInfo> windowEvents, Map<QNameSelectItem, SortedSet<WindowSelectItem>> existing)
+ {
+ if (windowEvents != null && !windowEvents.isEmpty())
+ {
+ if (existing == null)
+ {
+ existing = new HashMap<QNameSelectItem, SortedSet<WindowSelectItem>>();
+ }
+ for (QName qName : windowEvents.keySet())
+ {
+ SortedSet<WindowSelectItem> windows = existing.get(qName);
+ if (windows == null)
+ {
+ windows = new TreeSet<WindowSelectItem>();
+ existing.put(new QNameSelectItem(qName), windows);
+ }
+ windows.add(new WindowSelectItem(window));
+ }
+ }
+
+ return existing;
+ }
+
// JSF helper methods
/**
@@ -336,12 +343,36 @@
return Collections.emptyList();
}
- ArrayList<DisplayEventWiring> result = new ArrayList<DisplayEventWiring>(displayEventWirings.values());
+ List<DisplayEventWiring> result = new LinkedList<DisplayEventWiring>(displayEventWirings.values());
Collections.sort(result);
return result;
}
+ public List<QNameSelectItem> getSourceEvents()
+ {
+ if (eventNameToWindowSources == null)
+ {
+ return Collections.emptyList();
+ }
+
+ List<QNameSelectItem> result = new LinkedList<QNameSelectItem>();
+ result.addAll(eventNameToWindowSources.keySet());
+ Collections.sort(result);
+
+ return result;
+ }
+
+ public List<? extends SelectItem> getSelectedSourceEvents()
+ {
+ return selectedSourceEvents;
+ }
+
+ public void setSelectedSourceEvents(List<? extends SelectItem> selectedSourceEvents)
+ {
+ this.selectedSourceEvents = selectedSourceEvents;
+ }
+
public String deleteWiring()
{
String wiring = getFacesParam("wiring");
@@ -368,12 +399,15 @@
throw new NotYetImplemented("renameWiring not yet implemented!");
}
- public void useWSDLListener(ValueChangeEvent event)
+ /**
+ * Listener for explicit event checkbox
+ * @param event
+ */
+ public void explicitEventsListener(ValueChangeEvent event)
{
}
-
public static class DisplayEventWiring implements Comparable
{
private String name;
@@ -426,10 +460,68 @@
return name.compareTo(other.getName());
}
}
-
- public void createWindowBinding(ActionEvent event){
+
+ public static class WindowSelectItem extends SelectItem implements Comparable
+ {
+ public WindowSelectItem(Window window)
+ {
+ super(window, window.getName());
+ }
+
+ public int compareTo(Object o)
+ {
+ WindowSelectItem other = (WindowSelectItem)o;
+ return getWindow().getName().compareTo(other.getWindow().getName());
+ }
+
+ public Window getWindow()
+ {
+ return (Window) getValue();
+ }
+
+ }
+
+ public static class QNameSelectItem extends SelectItem implements Comparable
+ {
+ public QNameSelectItem(QName qName)
+ {
+ super(qName, qName.toString());
+ }
+
+ public QName getQName()
+ {
+ return (QName) getValue();
+ }
+
+ public int compareTo(Object o)
+ {
+ QNameSelectItem other = (QNameSelectItem) o;
+ return getQName().toString().compareTo(other.getQName().toString());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getQName().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if(!(obj instanceof QNameSelectItem))
+ {
+ return false;
+ }
+ QNameSelectItem item = (QNameSelectItem) obj;
+ return getQName().equals(item.getQName());
+ }
+ }
+
+ public void createWindowBinding(ActionEvent event)
+ {
//String id = (String) event.getComponent().getAttributes().get("");
- for (SelectItem binding : getSelectedWindowBindings()){
+ for (SelectItem binding : getSelectedWindowBindings())
+ {
System.out.println("-----------" + binding);
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-12 08:55:39 UTC (rev 11690)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-12 17:38:02 UTC (rev 11691)
@@ -111,14 +111,14 @@
<h:outputText value="#{bundle.COORDINATION_EVENT_EXISTING_ACTIONS}"/>
</f:facet>
+ <h:commandLink action="#{coordinationAction.renameWiring}">
+ <h:outputText styleClass="actionRename" value="#{bundle.RENAME}"/>
+ <f:param name="wiring" value="#{wiring.name}"/>
+ </h:commandLink> |
<h:commandLink action="#{coordinationAction.deleteWiring}">
<h:outputText styleClass="actionDelete" value="#{bundle.COMMON_DELETE}"/>
<f:param name="wiring" value="#{wiring.name}"/>
</h:commandLink>
- <h:commandLink action="#{coordinationAction.renameWiring}">
- <h:outputText styleClass="actionRename" value="#{bundle.RENAME}"/>
- <f:param name="wiring" value="#{wiring.name}"/>
- </h:commandLink>
</h:column>
</h:dataTable>
</h:form>
@@ -126,7 +126,9 @@
<!-- Create new event wiring -->
<h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_EVENT_CREATE}</h3>
<h:form>
-
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}">
+ <f:selectItems value="#{coordinationAction.sourceEvents}"/>
+ </h:selectManyListbox>
</h:form>
<ui:remove>
15 years, 9 months