JBoss Portal SVN: r11740 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/WEB-INF and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-26 12:14:49 -0400 (Tue, 26 Aug 2008)
New Revision: 11740
Added:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml
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/classes/Resource.properties
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:
- Properly reset structures each time editCoordination is called.
- Ask for confirmation before deleting wiring. Basis for generic handling of deletion confirmation of Coordination objects.
- Select only one event.
- Clean-ups.
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-26 16:08:32 UTC (rev 11739)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CoordinationAction.java 2008-08-26 16:14:49 UTC (rev 11740)
@@ -48,6 +48,7 @@
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import javax.xml.namespace.QName;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -57,7 +58,9 @@
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
+import java.util.ResourceBundle;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -85,24 +88,29 @@
private String stringStub;
- private PortalObject selectedObject;
+ private Page selectedPage;
private PortalObjectId selectedObjectId;
private String windowBindingName;
- private Map<String, EventWiringInfo> eventWirings;
private Map<String, DisplayEventWiring> displayEventWirings;
-
private Map<QNameSelectItem, SortedSet<WindowSelectItem>> eventNameToWindowSources;
private Map<QNameSelectItem, SortedSet<WindowSelectItem>> eventNameToWindowDestinations;
- private List<String> selectedSourceEvents;
+ private String selectedSourceEvent;
private List<String> selectedSourceWindows;
- private List<String> selectedDestinationEvents;
+ private String selectedDestinationEvent;
private List<String> selectedDestinationWindows;
private EventWiringInfoCreator currentWiring;
+ private String selectedForDeletionName;
+ private String selectedForDeletionType;
+ private static final String RESOURCE_NAME = "Resource";
+ private static final String COORDINATION_UNKNOWN = "COORDINATION_UNKNOWN";
+ private static final String COORDINATION_WIRING = "COORDINATION_WIRING";
+ private static final String COORDINATION_PARAMETER = "COORDINATION_PARAMETER";
+
public PortalObjectId getSelectedObjectId()
{
//since this backing bean is in session, always check for new object request
@@ -123,19 +131,21 @@
this.selectedObjectId = selectedObjectId;
}
- public PortalObject getSelectedObject()
+ public Page getSelectedPage()
{
- selectedObject = pomb.getPortalObjectContainer().getObject(getSelectedObjectId());
+ PortalObject portalObject = pomb.getPortalObjectContainer().getObject(getSelectedObjectId());
+ if (portalObject.getType() != PortalObject.TYPE_PAGE)
+ {
+ throw new IllegalArgumentException("Coordination can only be dealt with at the page level!");
+ }
+
+ selectedPage = (Page) portalObject;
+
//perform surgery on portalobjectmanager
- pomb.selectObject(pomb.getPortalObjectContainer().getObject(selectedObject.getId()));
- return selectedObject;
+ pomb.selectObject(pomb.getPortalObjectContainer().getObject(selectedPage.getId()));
+ return selectedPage;
}
- public void setSelectedObject(PortalObject selectedObject)
- {
- this.selectedObject = selectedObject;
- }
-
public Map<String, String> getWindows()
{
return windows;
@@ -232,33 +242,32 @@
public String editCoordination() throws ConversionException
{
- PortalObject portalObject = getSelectedObject();
- if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ Page page = getSelectedPage();
+ try
{
+ loadEventWirings(page);
+ loadWindowBindings(page);
- Page page = (Page)portalObject;
-
- try
+ //aliasbindings prep for ui
+ for (AliasBindingInfo abInfo : pomb.getCoordinationService().getAliasBindings(page))
{
- loadEventWirings();
- loadWindowBindings();
-
- //aliasbindings prep for ui
- for (AliasBindingInfo abInfo : pomb.getCoordinationService().getAliasBindings(page))
+ for (QName name : abInfo.getNames())
{
- for (QName name : abInfo.getNames())
- {
- getAliasBindings().put(name.getNamespaceURI(), name.getNamespaceURI());
- }
+ getAliasBindings().put(name.getNamespaceURI(), name.getNamespaceURI());
}
+ }
- // Extract metadata only on window children
+ // Extract metadata only on window children
+ Collection<PortalObject> children = page.getChildren(PortalObject.WINDOW_MASK);
+ if (!children.isEmpty())
+ {
availableRenderParameters = new LinkedHashMap<String, String>();
- windows = new LinkedHashMap<String, String>();
- for (PortalObject po : page.getChildren(PortalObject.WINDOW_MASK))
+ this.windows = new LinkedHashMap<String, String>(children.size());
+
+ for (PortalObject po : children)
{
Window window = (Window)po;
- windows.put(window.getName(), window.getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT));
+ this.windows.put(window.getName(), window.getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT));
if (ContentType.PORTLET.equals(window.getContentType()))
{
PortletContent pc = (PortletContent)window.getContent();
@@ -278,14 +287,14 @@
eventNameToWindowDestinations = addEventInfoFor(window, eventingInfo.getConsumedEvents(), eventNameToWindowDestinations);
}
}
+ }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
}
-
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
return "editCoordination";
}
@@ -345,78 +354,63 @@
// Event Wirings methods
- private void loadEventWirings()
+ private void loadEventWirings(Page page)
{
- PortalObject portalObject = getSelectedObject();
- if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ Collection<EventWiringInfo> wiringInfos = pomb.getCoordinationService().getEventWirings(page);
+ if (!wiringInfos.isEmpty())
{
- Page page = (Page)portalObject;
- Collection<EventWiringInfo> wiringInfos = pomb.getCoordinationService().getEventWirings(page);
- if (!wiringInfos.isEmpty())
+ displayEventWirings = new HashMap<String, DisplayEventWiring>(wiringInfos.size());
+ for (EventWiringInfo ewInfo : wiringInfos)
{
- 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));
- }
+ displayEventWirings.put(ewInfo.getName(), new DisplayEventWiring(ewInfo));
}
}
+ else
+ {
+ displayEventWirings = Collections.emptyMap();
+ }
}
public boolean isExplicitEventsUsed()
{
- PortalObject portalObject = getSelectedObject();
boolean enabled = false;
- if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ Page page = getSelectedPage();
+ if (pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page) != null)
{
- Page page = (Page)portalObject;
- if (pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page) != null)
- {
- enabled = pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page);
- }
-
+ enabled = !pomb.getCoordinationService().isEventWiringImplicitModeEnabled(page);
}
return enabled;
}
- /**
- * Listener for explicit event checkbox
- *
- * @param event
- * @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
- *
- */
- public void explicitEventsListener(ValueChangeEvent event) throws IllegalCoordinationException
+ public void setExplicitEventsUsed(boolean usingExplicitEvents)
{
- PortalObject portalObject = getSelectedObject();
- String newValue = event.getNewValue().toString();
- if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ try
{
- Page page = (Page)portalObject;
- pomb.getCoordinationService().setEventWiringImplicitMode(page, Boolean.parseBoolean(newValue));
+ pomb.getCoordinationService().setEventWiringImplicitMode(getSelectedPage(), usingExplicitEvents);
}
+ catch (IllegalCoordinationException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
}
+ public void selectSourceEvent(ValueChangeEvent event)
+ {
+ System.out.println("selectSourceEvent");
+ System.out.println("old value = " + event.getOldValue());
+ System.out.println("new value = " + event.getNewValue());
+ }
+
public void selectSourceWindows(ValueChangeEvent event)
{
- System.out.println("selectWindows");
+ System.out.println("selectSourceWindows");
System.out.println("old value = " + event.getOldValue());
System.out.println("new value = " + event.getNewValue());
}
- public void selectDestinationEvents(ValueChangeEvent event)
+ public void selectDestinationEvent(ValueChangeEvent event)
{
- System.out.println("selectDestinationEvents");
+ System.out.println("selectDestinationEvent");
System.out.println("old value = " + event.getOldValue());
System.out.println("new value = " + event.getNewValue());
}
@@ -453,7 +447,7 @@
public List<QNameSelectItem> getDestinationEvents()
{
// at this point, we have the sources selected, populate new wiring
- Map<Window, QName> sources = getMappingForWiring(selectedSourceWindows, selectedSourceEvents);
+ Map<Window, QName> sources = getMappingForWiring(selectedSourceWindows, selectedSourceEvent);
currentWiring.setSources(sources);
return getPossibleEvents(eventNameToWindowDestinations);
@@ -476,14 +470,14 @@
* Format selected information into something that can be used to construct a new event wiring.
*
* @param selectedWindows
- * @param selectedEvents
+ * @param selectedEvent
* @return
*/
- private Map<Window, QName> getMappingForWiring(List<String> selectedWindows, List<String> selectedEvents)
+ private Map<Window, QName> getMappingForWiring(List<String> selectedWindows, String selectedEvent)
{
if (selectedWindows != null)
{
- if (selectedObject == null)
+ if (selectedPage == null)
{
throw new IllegalStateException("A page should have been selected!");
}
@@ -491,8 +485,8 @@
Map<Window, QName> windowQNameMap = new HashMap<Window, QName>(selectedWindows.size());
for (String windowName : selectedWindows)
{
- Window window = (Window)selectedObject.getChild(windowName);
- windowQNameMap.put(window, QName.valueOf(selectedEvents.get(0)));
+ Window window = (Window)selectedPage.getChild(windowName);
+ windowQNameMap.put(window, QName.valueOf(selectedEvent));
}
return windowQNameMap;
@@ -503,29 +497,25 @@
public List<WindowSelectItem> getSourceWindows()
{
- return getPossibleWindows(eventNameToWindowSources, selectedSourceEvents);
+ return getPossibleWindows(eventNameToWindowSources, selectedSourceEvent);
}
public List<WindowSelectItem> getDestinationWindows()
{
- return getPossibleWindows(eventNameToWindowDestinations, selectedDestinationEvents);
+ return getPossibleWindows(eventNameToWindowDestinations, selectedDestinationEvent);
}
- private List<WindowSelectItem> getPossibleWindows(Map<QNameSelectItem, SortedSet<WindowSelectItem>> eventNameToWindows, List<String> selectedEventNames)
+ private List<WindowSelectItem> getPossibleWindows(Map<QNameSelectItem, SortedSet<WindowSelectItem>> eventNameToWindows, String selectedEventName)
{
if (eventNameToWindows == null)
{
return Collections.emptyList();
}
- if (selectedEventNames != null)
+ if (selectedEventName != null)
{
List<WindowSelectItem> result = new LinkedList<WindowSelectItem>();
- for (String qNameAsString : selectedEventNames)
- {
- result.addAll(eventNameToWindows.get(new QNameSelectItem(QName.valueOf(qNameAsString))));
- }
-
+ result.addAll(eventNameToWindows.get(new QNameSelectItem(QName.valueOf(selectedEventName))));
Collections.sort(result);
return result;
}
@@ -533,14 +523,14 @@
return Collections.emptyList();
}
- public List<String> getSelectedSourceEvents()
+ public String getSelectedSourceEvent()
{
- return selectedSourceEvents;
+ return selectedSourceEvent;
}
- public void setSelectedSourceEvents(List<String> selectedSourceEvents)
+ public void setSelectedSourceEvent(String selectedSourceEvent)
{
- this.selectedSourceEvents = selectedSourceEvents;
+ this.selectedSourceEvent = selectedSourceEvent;
}
public List<String> getSelectedSourceWindows()
@@ -553,14 +543,14 @@
this.selectedSourceWindows = selectedSourceWindows;
}
- public List<String> getSelectedDestinationEvents()
+ public String getSelectedDestinationEvent()
{
- return selectedDestinationEvents;
+ return selectedDestinationEvent;
}
- public void setSelectedDestinationEvents(List<String> selectedDestinationEvents)
+ public void setSelectedDestinationEvent(String selectedDestinationEvent)
{
- this.selectedDestinationEvents = selectedDestinationEvents;
+ this.selectedDestinationEvent = selectedDestinationEvent;
}
public List<String> getSelectedDestinationWindows()
@@ -590,7 +580,7 @@
currentWiring.setName(eventWiringName);
// we also now have the information to build the destinations
- Map<Window, QName> destinations = getMappingForWiring(selectedDestinationWindows, selectedDestinationEvents);
+ Map<Window, QName> destinations = getMappingForWiring(selectedDestinationWindows, selectedDestinationEvent);
currentWiring.setDestinations(destinations);
}
}
@@ -614,51 +604,89 @@
public String cancelWiring()
{
currentWiring = null;
- selectedSourceEvents = null;
+ selectedSourceEvent = null;
selectedSourceWindows = null;
- selectedDestinationEvents = null;
+ selectedDestinationEvent = null;
selectedDestinationWindows = null;
return null;
}
- public String deleteWiring()
+ public String getSelectedForDeletionName()
{
- String wiring = getFacesParam("wiring");
- EventWiringInfo event = eventWirings.get(wiring);
- try
+ return selectedForDeletionName;
+ }
+
+ public String getSelectedForDeletionType()
+ {
+ Locale locale = FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();
+ ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_NAME, locale);
+ String localizationKey = COORDINATION_UNKNOWN;
+ if ("wiring".equals(selectedForDeletionType))
{
- pomb.getCoordinationService().removeEventWiring(event);
- displayEventWirings.remove(wiring);
+ localizationKey = COORDINATION_WIRING;
}
- catch (IllegalCoordinationException e)
+ else if ("parameter".equals(selectedForDeletionType))
{
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ localizationKey = COORDINATION_PARAMETER;
}
+ return MessageFormat.format(rb.getString(localizationKey), null);
+ }
+
+ public void selectWiringForDeletion(ActionEvent event)
+ {
+ selectedForDeletionName = getFacesParam("wiring");
+ selectedForDeletionType = getFacesParam("type");
+ }
+
+ public String deleteWiring(ActionEvent actionEvent)
+ {
+ DisplayEventWiring displayEvent = displayEventWirings.get(selectedForDeletionName);
+
+ if (displayEvent != null)
+ {
+ EventWiringInfo event = displayEvent.getEventInfo();
+ try
+ {
+ pomb.getCoordinationService().removeEventWiring(event);
+ displayEventWirings.remove(selectedForDeletionName);
+ }
+ catch (IllegalCoordinationException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ // reset selected values
+ selectedForDeletionName = null;
+ selectedForDeletionType = null;
+ }
return null;
}
public String renameWiring()
{
String wiring = getFacesParam("wiring");
- EventWiringInfo event = eventWirings.get(wiring);
- //todo: implement, rename operation should be on CoordinationConfigurator
+ DisplayEventWiring displayEvent = displayEventWirings.get(wiring);
+ if (displayEvent != null)
+ {
+ //todo: implement, rename operation should be on CoordinationConfigurator
+ }
throw new NotYetImplemented("renameWiring not yet implemented!");
}
public static class DisplayEventWiring implements Comparable
{
- private String name;
private Set<Window> sourceWindows;
private Set<QName> sourceEvents;
private Set<Window> destinationWindows;
private Set<QName> destinationEvents;
+ private EventWiringInfo eventInfo;
DisplayEventWiring(EventWiringInfo eventInfo)
{
- name = eventInfo.getName();
+ this.eventInfo = eventInfo;
Map<Window, QName> sources = eventInfo.getSources();
sourceWindows = new HashSet<Window>(sources.keySet());
@@ -669,9 +697,14 @@
destinationEvents = new HashSet<QName>(destinations.values());
}
+ public EventWiringInfo getEventInfo()
+ {
+ return eventInfo;
+ }
+
public String getName()
{
- return name;
+ return eventInfo.getName();
}
public Set<Window> getSourceWindows()
@@ -697,7 +730,7 @@
public int compareTo(Object o)
{
DisplayEventWiring other = (DisplayEventWiring)o;
- return name.compareTo(other.getName());
+ return getName().compareTo(other.getName());
}
}
@@ -816,16 +849,11 @@
// Parameter Binding
public boolean isParameterImplicitEnabled()
{
- PortalObject portalObject = getSelectedObject();
boolean enabled = false;
- if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ Page page = getSelectedPage();
+ if (pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page) != null)
{
- Page page = (Page)portalObject;
- if (pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page) != null)
- {
- enabled = pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page);
- }
-
+ enabled = pomb.getCoordinationService().isParameterBindingImplicitModeEnabled(page);
}
return enabled;
}
@@ -839,13 +867,8 @@
*/
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));
- }
+ pomb.getCoordinationService().setParameterBindingImplicitMode(getSelectedPage(), Boolean.parseBoolean(newValue));
}
@@ -911,23 +934,19 @@
this.displayParameterBindings = displayParameterBindings;
}
- private void loadWindowBindings()
+ private void loadWindowBindings(Page page)
{
- PortalObject portalObject = getSelectedObject();
- if (portalObject.getType() == PortalObject.TYPE_PAGE)
+ Collection<? extends WindowBindingInfo> windowBindingInfos = pomb.getCoordinationService().getWindowBindings(page);
+ if (windowBindingInfos != null && !windowBindingInfos.isEmpty())
{
- Page page = (Page)portalObject;
- displayParameterBindings = new ArrayList<DisplayParameterBinding>();
- for (Object o : pomb.getCoordinationService().getWindowBindings(page))
+ displayParameterBindings = new ArrayList<DisplayParameterBinding>(windowBindingInfos.size());
+ for (WindowBindingInfo wbInfo : windowBindingInfos)
{
- WindowBindingInfo wbInfo = (WindowBindingInfo)o;
DisplayParameterBinding dpb = new DisplayParameterBinding();
- for (Object o1 : wbInfo.getWindows().entrySet())
+ for (Map.Entry<Window,QName> entry : wbInfo.getWindows().entrySet())
{
-
- Map.Entry entry = (Map.Entry)o1;
- Window paramName = (Window)entry.getKey();
- QName paramValue = (QName)entry.getValue();
+ Window paramName = entry.getKey();
+ QName paramValue = entry.getValue();
//quick filter for duplicate binding ids
dpb.getWindows().add(paramName);
if (dpb.getWindows().size() < 2)
@@ -939,11 +958,15 @@
displayParameterBindings.add(dpb);
}
}
+ else
+ {
+ displayParameterBindings = Collections.emptyList();
+ }
}
public void createWindowBinding(ActionEvent event) throws IllegalCoordinationException
{
- Map<Window, QName> windowBinding = null;
+ Map<Window, QName> windowBinding;
for (String window : selectedWindows)
{
windowBinding = new HashMap<Window, QName>();
@@ -956,6 +979,6 @@
}
}
//refresh data
- loadWindowBindings();
+ loadWindowBindings(getSelectedPage());
}
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-08-26 16:08:32 UTC (rev 11739)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-08-26 16:14:49 UTC (rev 11740)
@@ -293,3 +293,6 @@
COORDINATION_EVENT_CREATE_STEP4=4. Select destination windows consuming event ''{0}'':
COORDINATION_EVENT_CREATE_STEP5=5. Name wiring:
COORDINATION_EVENT_CREATE_CREATE=Create wiring
+
+COORDINATION_WIRING=event wiring
+COORDINATION_PARAMETER=parameter binding
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-26 16:08:32 UTC (rev 11739)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-08-26 16:14:49 UTC (rev 11740)
@@ -517,6 +517,11 @@
<from-outcome>confirmDeleteInstance</from-outcome>
<to-view-id>/jsf/confirmDeleteInstance.xhtml</to-view-id>
</navigation-case>
+
+ <navigation-case>
+ <from-outcome>confirmCoordinationDeletion</from-outcome>
+ <to-view-id>/jsf/confirmDeleteCoordination.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
<lifecycle>
Added: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/confirmDeleteCoordination.xhtml 2008-08-26 16:14:49 UTC (rev 11740)
@@ -0,0 +1,53 @@
+<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:jbp="http://www.jboss.org/portal"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="admin-ui">
+
+ <ui:composition template="objectTemplate.xhtml">
+
+ <ui:param name="portalObjectScreen" value="#{bundle.COMMON_DELETE}"/>
+ <ui:define name="content">
+
+ <f:subview rendered="#{empty coordinationAction.selectedForDeletionName}">
+ <p class="portlet-msg-error">#{bundle.COMMON_INCONSISTENT_STATE}</p>
+ </f:subview>
+
+ <f:subview rendered="#{not empty coordinationAction.selectedForDeletionName}">
+ <div class="portlet-msg">
+ <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
+ <div class="portlet-msg-body">
+ <h3>#{bundle.COMMON_DELETE}  <h:outputText value="#{coordinationAction.selectedForDeletionType}"/></h3>
+
+ <p class="portlet-msg-alert">
+ #{bundle.COMMON_DELETING}
+ <span class="objectName">#{coordinationAction.selectedForDeletionName}</span>
+ #{coordinationAction.selectedForDeletionType} #{bundle.COMMON_FROM}
+ <c:if test="#{not empty portalobjectmgr.selectedObjectParent.name}">
+ <span class="objectName">#{portalobjectmgr.selectedObject.name}</span>
+ </c:if>
+ #{portalobjectmgr.selectedObject.typeName}!
+ </p>
+
+ <p class="portlet-class">#{bundle.COMMON_SURE_DELETE} #{coordinationAction.selectedForDeletionType}?</p>
+
+ <h:form>
+ <h:commandButton value="#{bundle.COMMON_DELETE}" action="editCoordination"
+ actionListener="#{coordinationAction.deleteWiring}"
+ styleClass="portlet-form-button portlet-section-buttonrow">
+ </h:commandButton>
+ <h:commandButton value="#{bundle.COMMON_CANCEL}" action="editCoordination"
+ styleClass="portlet-form-button portlet-section-buttonrow"/>
+ </h:form>
+ </div>
+ </div>
+ </f:subview>
+
+ </ui:define>
+
+ </ui:composition>
+
+</div>
\ No newline at end of file
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-26 16:08:32 UTC (rev 11739)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-26 16:14:49 UTC (rev 11740)
@@ -10,7 +10,7 @@
<ui:define name="content">
<div class="tenpx-top-bottom">
- <h2 class="portlet-area-header">#{coordinationAction.selectedObject.name} #{bundle.COORDINATION_PARAMETER_BINDINGS}</h2>
+ <h2 class="portlet-area-header">#{coordinationAction.selectedPage.name} #{bundle.COORDINATION_PARAMETER_BINDINGS}</h2>
<!-- Create parameter binding -->
<h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_CREATE_PARAMETER_BINDING}</h3>
@@ -99,14 +99,12 @@
</div>
<!-- Event wirings -->
- <h2 class="portlet-area-header">#{coordinationAction.selectedObject.name} #{bundle.COORDINATION_EVENT_WIRINGS}</h2>
+ <h2 class="portlet-area-header">#{coordinationAction.selectedPage.name} #{bundle.COORDINATION_EVENT_WIRINGS}</h2>
<h:form>
<h:selectBooleanCheckbox id="useExplicitEvents" value="#{coordinationAction.explicitEventsUsed}"
- onchange="this.form.submit()"
- valueChangeListener="#{coordinationAction.explicitEventsListener}"
- immediate="true"/> Enable Event Implicit Mode
+ onchange="this.form.submit()" immediate="true"/>#{bundle.COORDINATION_EVENT_EXPLICIT_MODE}
</h:form>
@@ -115,35 +113,39 @@
<h:form>
<h:panelGroup>
#{bundle.COORDINATION_EVENT_CREATE_STEP1}
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}" immediate="true"
- valueChangeListener="#{coordinationAction.selectSourceWindows}" onchange="this.form.submit()">
+ <h:selectOneListbox id="sourceEvent" size="5" value="#{coordinationAction.selectedSourceEvent}" immediate="true"
+ valueChangeListener="#{coordinationAction.selectSourceEvent}" onchange="this.form.submit()">
<f:selectItems value="#{coordinationAction.sourceEvents}"/>
- </h:selectManyListbox>
+ </h:selectOneListbox>
</h:panelGroup>
- <h:panelGroup rendered="#{!empty coordinationAction.selectedSourceEvents}" >
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceWindows}" immediate="true"
- valueChangeListener="#{coordinationAction.selectDestinationEvents}" onchange="this.form.submit()">
+ <h:panelGroup rendered="#{!empty coordinationAction.selectedSourceEvent}">
+ #{bundle.COORDINATION_EVENT_CREATE_STEP2}
+ <h:selectManyListbox id="sourceWindows" size="5" value="#{coordinationAction.selectedSourceWindows}" immediate="true"
+ valueChangeListener="#{coordinationAction.selectSourceWindows}" onchange="this.form.submit()">
<f:selectItems value="#{coordinationAction.sourceWindows}"/>
</h:selectManyListbox>
</h:panelGroup>
<h:panelGroup rendered="#{!empty coordinationAction.selectedSourceWindows}">
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedDestinationEvents}" immediate="true"
- valueChangeListener="#{coordinationAction.selectDestinationEvents}" onchange="this.form.submit()">
+ #{bundle.COORDINATION_EVENT_CREATE_STEP3}
+ <h:selectOneListbox id="destEvent" size="5" value="#{coordinationAction.selectedDestinationEvent}" immediate="true"
+ valueChangeListener="#{coordinationAction.selectDestinationEvent}" onchange="this.form.submit()">
<f:selectItems value="#{coordinationAction.destinationEvents}"/>
- </h:selectManyListbox>
+ </h:selectOneListbox>
</h:panelGroup>
- <h:panelGroup rendered="#{!empty coordinationAction.selectedDestinationEvents}">
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedDestinationWindows}" immediate="true"
+ <h:panelGroup rendered="#{!empty coordinationAction.selectedDestinationEvent}">
+ #{bundle.COORDINATION_EVENT_CREATE_STEP4}
+ <h:selectManyListbox id="destWindows" size="5" value="#{coordinationAction.selectedDestinationWindows}" immediate="true"
valueChangeListener="#{coordinationAction.selectDestinationWindows}" onchange="this.form.submit()">
<f:selectItems value="#{coordinationAction.destinationWindows}"/>
</h:selectManyListbox>
</h:panelGroup>
<h:panelGroup rendered="#{!empty coordinationAction.selectedDestinationWindows}">
- <h:inputText value="#{coordinationAction.wiringName}"/>
+ #{bundle.COORDINATION_EVENT_CREATE_STEP5}
+ <h:inputText id="wiringName" value="#{coordinationAction.wiringName}"/>
<h:commandButton value="#{bundle.COORDINATION_EVENT_CREATE_CREATE}" action="#{coordinationAction.createWiring}"
styleClass="portlet-form-button"/>
<h:commandButton value="#{bundle.COMMON_CANCEL}" action="#{coordinationAction.cancelWiring}"
@@ -200,9 +202,10 @@
<h:outputText styleClass="actionRename" value="#{bundle.RENAME}"/>
<f:param name="wiring" value="#{wiring.name}"/>
</h:commandLink> |
- <h:commandLink action="#{coordinationAction.deleteWiring}">
+ <h:commandLink action="confirmCoordinationDeletion" actionListener="#{coordinationAction.selectWiringForDeletion}">
<h:outputText styleClass="actionDelete" value="#{bundle.COMMON_DELETE}"/>
<f:param name="wiring" value="#{wiring.name}"/>
+ <f:param name="type" value="wiring"/>
</h:commandLink>
</h:column>
</h:dataTable>
15 years, 9 months
JBoss Portal SVN: r11739 - branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-26 12:08:32 -0400 (Tue, 26 Aug 2008)
New Revision: 11739
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java
Log:
- Minor.
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java 2008-08-26 16:07:31 UTC (rev 11738)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/test/core/model/portal/coordination/CoordinationServiceTestCase.java 2008-08-26 16:08:32 UTC (rev 11739)
@@ -22,30 +22,31 @@
package org.jboss.portal.test.core.model.portal.coordination;
-import static java.lang.Boolean.*;
-import org.jboss.portal.test.core.model.portal.AbstractPortalObjectContainerTestCase;
+import junit.framework.TestSuite;
+import org.apache.log4j.Appender;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.SimpleLayout;
import org.jboss.portal.common.junit.TransactionAssert;
+import org.jboss.portal.core.controller.coordination.AliasBindingInfo;
+import org.jboss.portal.core.controller.coordination.EventWiringInfo;
+import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
+import org.jboss.portal.core.impl.coordination.CoordinationService;
+import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.portal.Context;
+import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.controller.coordination.EventWiringInfo;
-import org.jboss.portal.core.controller.coordination.WindowBindingInfo;
-import org.jboss.portal.core.controller.coordination.AliasBindingInfo;
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.impl.coordination.CoordinationService;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.SimpleLayout;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-import junit.framework.TestSuite;
+import org.jboss.portal.test.core.model.portal.AbstractPortalObjectContainerTestCase;
import javax.xml.namespace.QName;
-import java.util.Map;
+import static java.lang.Boolean.FALSE;
+import static java.lang.Boolean.TRUE;
+import java.util.Collection;
import java.util.HashMap;
-import java.util.Collection;
import java.util.HashSet;
+import java.util.Map;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
@@ -228,15 +229,15 @@
assertEquals(1, events.size());
- EventWiringInfo info = events.iterator().next();
- assertEquals("event1", info.getName());
+ EventWiringInfo originalInfo = events.iterator().next();
+ assertEquals("event1", originalInfo.getName());
events = cos.getEventSourceWirings(w1);
assertNotNull(events);
assertEquals(1, events.size());
- info = events.iterator().next();
+ EventWiringInfo info = events.iterator().next();
assertTrue(info.getSources().keySet().size() == 3);
assertTrue(info.getSources().keySet().contains(w1));
@@ -246,23 +247,23 @@
events = cos.getEventDestinationWirings(w4);
assertNotNull(events);
- assertTrue(events.size() == 1);
+ assertEquals(1, events.size());
info = events.iterator().next();
- assertTrue(info.getDestinations().keySet().size() == 1);
+ assertEquals(1, info.getDestinations().keySet().size());
assertTrue(info.getDestinations().keySet().contains(w4));
// remove
- cos.removeEventWiring(info);
+ cos.removeEventWiring(originalInfo);
+ events = cos.getEventWirings(page1);
+ assertNotNull(events);
+ assertTrue(events.isEmpty());
+
events = cos.getEventDestinationWirings(w4);
-
assertNotNull(events);
- assertTrue(events.size() == 0);
-
-
-
+ assertTrue(events.isEmpty());
TransactionAssert.commitTransaction();
}
15 years, 9 months
JBoss Portal SVN: r11738 - branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-26 12:07:31 -0400 (Tue, 26 Aug 2008)
New Revision: 11738
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/confirm.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageErrorHandling.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPortalErrorHandling.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPreferences.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editProperties.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editSecurity.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editTheme.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editWindowTheme.xhtml
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
Log:
- No need to load bundle when not needed.
- Added space to deletion confirmation screen.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/confirm.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/confirm.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/confirm.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -7,7 +7,6 @@
xmlns:c="http://java.sun.com/jstl/core"
class="admin-ui">
- <f:loadBundle basename="Resource" var="bundle" />
<ui:composition template="../objectTemplate.xhtml">
<ui:param name="portalObjectScreen" value="#{bundle.COMMON_DELETE}"/>
@@ -23,7 +22,7 @@
<div class="portlet-msg">
<div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
- <h3>#{bundle.COMMON_DELETE} <h:outputText value="#{portalobjectmgr.selectedObjectType}"/></h3>
+ <h3>#{bundle.COMMON_DELETE}  <h:outputText value="#{portalobjectmgr.selectedObjectType}"/></h3>
<p class="portlet-msg-alert">
#{bundle.COMMON_DELETING}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageErrorHandling.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageErrorHandling.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageErrorHandling.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -4,7 +4,6 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
-<f:loadBundle basename="Resource" var="bundle" />
<p class="portlet-area-header">#{bundle.COMMON_ERROR_HANDLING}</p>
<div class="portlet-area-body">
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:jbp="http://www.jboss.org/portal"
xmlns:c="http://java.sun.com/jstl/core">
-<f:loadBundle basename="Resource" var="bundle" />
+
<br/>
<table width="100%">
<tr>
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPortalErrorHandling.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPortalErrorHandling.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPortalErrorHandling.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -4,8 +4,6 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
-
-<f:loadBundle basename="Resource" var="bundle" />
<p class="portlet-area-header">#{bundle.COMMON_PORTAL_ERROR_HANDLING}</p>
<div class="portlet-area-body">
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPreferences.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPreferences.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editPreferences.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -5,7 +5,6 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
-<f:loadBundle basename="Resource" var="bundle" />
<c:choose>
<c:when test="#{not empty prefs.entries}">
<h:form>
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editProperties.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editProperties.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editProperties.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -4,8 +4,6 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
-<f:loadBundle basename="Resource" var="bundle"/>
-
<div class="portlet-area-header">#{bundle.COMMON_PROPERTIES}</div>
<div class="portlet-area-body">
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editSecurity.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editSecurity.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editSecurity.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -5,7 +5,6 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
- <f:loadBundle basename="Resource" var="bundle" />
<h:form>
<table class="datatable full-width">
<thead class="portlet-section-header">
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editTheme.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editTheme.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editTheme.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -1,7 +1,6 @@
<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">
- <f:loadBundle basename="Resource" var="bundle" />
<h:form>
<table class="full-width datatable">
<thead class="portlet-section-header">
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editWindowTheme.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editWindowTheme.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/editWindowTheme.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -4,7 +4,6 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
- <f:loadBundle basename="Resource" var="bundle" />
<h:form>
<table class="full-width datatable">
<thead class="portlet-section-header">
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2008-08-26 11:18:46 UTC (rev 11737)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2008-08-26 16:07:31 UTC (rev 11738)
@@ -13,8 +13,6 @@
<br/>
<img src="#{portlet.smallIconLocation}" alt="" style="margin: 0 5px 0 5px;" class="float-left"/>
- <f:loadBundle basename="Resource" var="bundle" />
-
<h:commandLink
action="#{portletmgr.selectPortlet}">
<f:param name="id" value="#{portlet.context.id}"/>
15 years, 9 months
JBoss Portal SVN: r11737 - in branches/JBoss_Portal_Branch_2_7/core/src: main/org/jboss/portal/core/aspects/portlet and 3 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-08-26 07:18:46 -0400 (Tue, 26 Aug 2008)
New Revision: 11737
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/BackwardCompatibilityInterceptor.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/BackwardCompatibilityInterceptor.java
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossActionRequest.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossRenderRequest.java
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1944: Move ThreadLocals for JBossPortlet support to interceptors
Added: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/BackwardCompatibilityInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/BackwardCompatibilityInterceptor.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/BackwardCompatibilityInterceptor.java 2008-08-26 11:18:46 UTC (rev 11737)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.aspects.controller;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.ControllerInterceptor;
+import org.jboss.portal.core.controller.ControllerResponse;
+
+/**
+ * Only for backward compatibility with JBossActionRequest in 2.6
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class BackwardCompatibilityInterceptor extends ControllerInterceptor
+{
+ public static ThreadLocal<ControllerContext> controllerContextTL = new ThreadLocal<ControllerContext>();
+
+ @Override
+ public ControllerResponse invoke(ControllerCommand cmd) throws Exception, InvocationException
+ {
+
+ controllerContextTL.set(cmd.getControllerContext());
+ ControllerResponse response = null;
+ try
+ {
+ response = (ControllerResponse)cmd.invokeNext();
+ }
+ finally
+ {
+ controllerContextTL.remove();
+ }
+
+ //
+ return response;
+ }
+
+}
+
Added: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/BackwardCompatibilityInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/BackwardCompatibilityInterceptor.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/portlet/BackwardCompatibilityInterceptor.java 2008-08-26 11:18:46 UTC (rev 11737)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.aspects.portlet;
+
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.spi.UserContext;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class BackwardCompatibilityInterceptor extends CorePortletInterceptor
+{
+
+ public static ThreadLocal<UserContext> userContextTL = new ThreadLocal<UserContext>();
+
+ @Override
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
+ {
+ userContextTL.set(invocation.getUserContext());
+ PortletInvocationResponse response = null;
+ try
+ {
+ response = super.invoke(invocation);
+ }
+ finally
+ {
+ userContextTL.remove();
+ }
+
+ //
+ return response;
+
+ }
+
+}
+
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2008-08-26 10:22:56 UTC (rev 11736)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2008-08-26 11:18:46 UTC (rev 11737)
@@ -61,12 +61,6 @@
public class PortletInvocationFactory
{
- /** Remove me / flawed. */
- public static ThreadLocal<ControllerContext> controllerContextTL = new ThreadLocal<ControllerContext>();
-
- /** Remove me / flawed. */
- public static ThreadLocal<UserContext> userContextTL = new ThreadLocal<UserContext>();
-
public static InvokePortletCommandFactory createInvokePortletCommandFactory(
ControllerContext controllerContext,
Window window,
@@ -183,13 +177,6 @@
{
invocation.setAttribute("controller_context", controllerContext);
- //
- UserContext userContext = cf.createUserContext();
-
- //
- controllerContextTL.set(controllerContext);
- userContextTL.set(userContext);
-
// Contextualize
invocation.setSecurityContext(cf.createSecurityContext());
invocation.setPortalContext(cf.createPortalContext());
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossActionRequest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossActionRequest.java 2008-08-26 10:22:56 UTC (rev 11736)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossActionRequest.java 2008-08-26 11:18:46 UTC (rev 11737)
@@ -31,10 +31,10 @@
import javax.portlet.filter.PortletRequestWrapper;
import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.core.aspects.controller.BackwardCompatibilityInterceptor;
import org.jboss.portal.core.aspects.controller.node.Navigation;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.portlet.ControllerUserContext;
-import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portlet.util.Parameters;
@@ -61,9 +61,9 @@
{
super(portletRequest);
this.portletRequest = portletRequest;
- this.controllerContext = PortletInvocationFactory.controllerContextTL.get();
+ this.controllerContext = BackwardCompatibilityInterceptor.controllerContextTL.get();
this.blah = null;
- this.userContext = PortletInvocationFactory.userContextTL.get();
+ this.userContext = org.jboss.portal.core.aspects.portlet.BackwardCompatibilityInterceptor.userContextTL.get();
}
public ControllerContext getControllerContext()
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossRenderRequest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossRenderRequest.java 2008-08-26 10:22:56 UTC (rev 11736)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portlet/JBossRenderRequest.java 2008-08-26 11:18:46 UTC (rev 11737)
@@ -28,6 +28,7 @@
import javax.portlet.filter.PortletRequestWrapper;
import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.core.aspects.controller.BackwardCompatibilityInterceptor;
import org.jboss.portal.core.aspects.controller.node.Navigation;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.portlet.ControllerUserContext;
@@ -58,8 +59,8 @@
{
super(portletRequest);
this.portletRequest = portletRequest;
- this.controllerContext = PortletInvocationFactory.controllerContextTL.get();
- this.userContext = PortletInvocationFactory.userContextTL.get();
+ this.controllerContext = BackwardCompatibilityInterceptor.controllerContextTL.get();
+ this.userContext = org.jboss.portal.core.aspects.portlet.BackwardCompatibilityInterceptor.userContextTL.get();
}
public ControllerContext getControllerContext()
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-08-26 10:22:56 UTC (rev 11736)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-08-26 11:18:46 UTC (rev 11737)
@@ -156,6 +156,11 @@
portal:service=ControlPolicy,type=Portal
</depends>
</mbean>
+ <mbean code="org.jboss.portal.core.aspects.controller.BackwardCompatibilityInterceptor"
+ name="portal:service=Interceptor,type=Command,name=BackwardCompatibility" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
<mbean code="org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor"
name="portal:service=Interceptor,type=Command,name=ResourceAcquisition" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -234,6 +239,7 @@
<!-- depends-list-element>portal:service=Interceptor,type=Command,name=CleanNS</depends-list-element -->
<depends-list-element>portal:service=Interceptor,type=Command,name=NavigationalState</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=Control</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Command,name=BackwardCompatibility</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PortalNode</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PolicyEnforcement</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PageCustomizer</depends-list-element>
@@ -327,6 +333,11 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
</mbean>
+ <mbean code="org.jboss.portal.core.aspects.portlet.BackwardCompatibilityInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=BackwardCompatibility" xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
<mbean code="org.jboss.portal.core.aspects.portlet.SignOutInterceptor"
name="portal:service=Interceptor,type=Portlet,name=SignOut" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -351,6 +362,7 @@
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextTracker</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortletSessionSynchronization</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Bridge</depends-list-element>
+ <depends-list-element>portal:service=Interceptor,type=Portlet,name=BackwardCompatibility</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Ajax</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SignOut</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ProducerCache</depends-list-element>
15 years, 9 months
JBoss Portal SVN: r11736 - 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-26 06:22:56 -0400 (Tue, 26 Aug 2008)
New Revision: 11736
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml
Log:
- Added messages and localized values.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-08-26 01:29:43 UTC (rev 11735)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-08-26 10:22:56 UTC (rev 11736)
@@ -286,4 +286,10 @@
COORDINATION_EVENT_EXISTING_DESTINATION_EVENTS=Destination events
COORDINATION_EVENT_EXISTING_DESTINATION_WINDOWS=Destination windows
COORDINATION_EVENT_EXISTING_ACTIONS=Actions
-COORDINATION_EVENT_CREATE=Create new event wiring:
\ No newline at end of file
+COORDINATION_EVENT_CREATE=Create new event wiring:
+COORDINATION_EVENT_CREATE_STEP1=1. Select source event:
+COORDINATION_EVENT_CREATE_STEP2=2. Select source windows producing event ''{0}'':
+COORDINATION_EVENT_CREATE_STEP3=3. Select destination event:
+COORDINATION_EVENT_CREATE_STEP4=4. Select destination windows consuming event ''{0}'':
+COORDINATION_EVENT_CREATE_STEP5=5. Name wiring:
+COORDINATION_EVENT_CREATE_CREATE=Create wiring
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-26 01:29:43 UTC (rev 11735)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/editCoordination.xhtml 2008-08-26 10:22:56 UTC (rev 11736)
@@ -113,28 +113,34 @@
<!-- Create new event wiring -->
<h3 class="sectionTitle tenpx-top-bottom">#{bundle.COORDINATION_EVENT_CREATE}</h3>
<h:form>
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}" immediate="true"
- valueChangeListener="#{coordinationAction.selectSourceWindows}" onchange="this.form.submit()">
- <f:selectItems value="#{coordinationAction.sourceEvents}"/>
- </h:selectManyListbox>
+ <h:panelGroup>
+ #{bundle.COORDINATION_EVENT_CREATE_STEP1}
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceEvents}" immediate="true"
+ valueChangeListener="#{coordinationAction.selectSourceWindows}" onchange="this.form.submit()">
+ <f:selectItems value="#{coordinationAction.sourceEvents}"/>
+ </h:selectManyListbox>
+ </h:panelGroup>
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceWindows}"
- rendered="#{!empty coordinationAction.selectedSourceEvents}" immediate="true"
- valueChangeListener="#{coordinationAction.selectDestinationEvents}" onchange="this.form.submit()">
- <f:selectItems value="#{coordinationAction.sourceWindows}"/>
- </h:selectManyListbox>
+ <h:panelGroup rendered="#{!empty coordinationAction.selectedSourceEvents}" >
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedSourceWindows}" immediate="true"
+ valueChangeListener="#{coordinationAction.selectDestinationEvents}" onchange="this.form.submit()">
+ <f:selectItems value="#{coordinationAction.sourceWindows}"/>
+ </h:selectManyListbox>
+ </h:panelGroup>
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedDestinationEvents}"
- rendered="#{!empty coordinationAction.selectedSourceWindows}" immediate="true"
- valueChangeListener="#{coordinationAction.selectDestinationEvents}" onchange="this.form.submit()">
- <f:selectItems value="#{coordinationAction.destinationEvents}"/>
- </h:selectManyListbox>
+ <h:panelGroup rendered="#{!empty coordinationAction.selectedSourceWindows}">
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedDestinationEvents}" immediate="true"
+ valueChangeListener="#{coordinationAction.selectDestinationEvents}" onchange="this.form.submit()">
+ <f:selectItems value="#{coordinationAction.destinationEvents}"/>
+ </h:selectManyListbox>
+ </h:panelGroup>
- <h:selectManyListbox size="5" value="#{coordinationAction.selectedDestinationWindows}"
- rendered="#{!empty coordinationAction.selectedDestinationEvents}" immediate="true"
- valueChangeListener="#{coordinationAction.selectDestinationWindows}" onchange="this.form.submit()">
- <f:selectItems value="#{coordinationAction.destinationWindows}"/>
- </h:selectManyListbox>
+ <h:panelGroup rendered="#{!empty coordinationAction.selectedDestinationEvents}">
+ <h:selectManyListbox size="5" value="#{coordinationAction.selectedDestinationWindows}" immediate="true"
+ valueChangeListener="#{coordinationAction.selectDestinationWindows}" onchange="this.form.submit()">
+ <f:selectItems value="#{coordinationAction.destinationWindows}"/>
+ </h:selectManyListbox>
+ </h:panelGroup>
<h:panelGroup rendered="#{!empty coordinationAction.selectedDestinationWindows}">
<h:inputText value="#{coordinationAction.wiringName}"/>
15 years, 9 months
JBoss Portal SVN: r11735 - branches/JBoss_Portal_2_6_1_JBPORTAL-2128/core/src/main/org/jboss/portal/core/aspects/server.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-08-25 21:29:43 -0400 (Mon, 25 Aug 2008)
New Revision: 11735
Modified:
branches/JBoss_Portal_2_6_1_JBPORTAL-2128/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java
Log:
applying the fix
Modified: branches/JBoss_Portal_2_6_1_JBPORTAL-2128/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java
===================================================================
--- branches/JBoss_Portal_2_6_1_JBPORTAL-2128/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java 2008-08-25 15:48:15 UTC (rev 11734)
+++ branches/JBoss_Portal_2_6_1_JBPORTAL-2128/core/src/main/org/jboss/portal/core/aspects/server/UserInterceptor.java 2008-08-26 01:29:43 UTC (rev 11735)
@@ -22,10 +22,18 @@
******************************************************************************/
package org.jboss.portal.core.aspects.server;
+import java.security.Principal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.http.HttpServletRequest;
+
import org.jboss.logging.Logger;
import org.jboss.portal.common.invocation.AttributeResolver;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.core.CoreConstants;
import org.jboss.portal.identity.CachedUserImpl;
import org.jboss.portal.identity.NoSuchUserException;
import org.jboss.portal.identity.User;
@@ -34,20 +42,6 @@
import org.jboss.portal.server.ServerInterceptor;
import org.jboss.portal.server.ServerInvocation;
-import javax.naming.InitialContext;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-import javax.transaction.UserTransaction;
-import javax.transaction.Transaction;
-import java.io.Serializable;
-import java.security.Principal;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
/**
* The interceptor is responsible for managing the user identity lifecycle based on the principal name returned by the
@@ -122,7 +116,6 @@
{
boolean trace = log.isTraceEnabled();
HttpServletRequest req = invocation.getServerContext().getClientRequest();
- HttpSession httpSession = req.getSession();
// Get scope
AttributeResolver principalScopeResolver = invocation.getContext().getAttributeResolver(ServerInvocation.PRINCIPAL_SCOPE);
@@ -155,6 +148,9 @@
{
// Fetch user info
user = getUserModule().findUserByUserName(userName);
+
+ //Set Last login date
+ getUserProfileModule().setProperty(user, User.INFO_USER_LAST_LOGIN_DATE, "" + new Date());
// Get profile
profile = getUserProfileModule().getProperties(user);
@@ -192,54 +188,6 @@
}
}
- //
- if (user == null)
- {
- // Erase any previous user finalizer, the side effect of unbinding the session attribute will finalize the previous user
- UserFinalizer finalizer = (UserFinalizer)httpSession.getAttribute(CoreConstants.Servlet.Session.USER_FINALIZER);
- if (finalizer != null)
- {
- if (trace)
- {
- log.trace("Removing finalizer for user=" + finalizer.userId);
- }
- httpSession.setAttribute(CoreConstants.Servlet.Session.USER_FINALIZER, null);
- }
- }
- else
- {
- // Get the current finalizer if any
- UserFinalizer finalizer = (UserFinalizer)httpSession.getAttribute(CoreConstants.Servlet.Session.USER_FINALIZER);
-
- // Get the user id from the request user
- if (finalizer == null)
- {
- if (trace)
- {
- log.trace("Adding finalizer for user=" + user.getUserName());
- }
-
- // Set the user finalizer
- finalizer = new UserFinalizer(user.getId());
-
- // Bind the new one, the side effect finalizes the previous user
- httpSession.setAttribute(CoreConstants.Servlet.Session.USER_FINALIZER, finalizer);
- }
- else if (!finalizer.userId.equals(user.getId()))
- {
- if (trace)
- {
- log.trace("Replacing the finalizer for user=" + finalizer.userId + " with user=" + user.getId());
- }
-
- // Set the user finalizer
- finalizer = new UserFinalizer(user.getId());
-
- // Bind the new one, the side effect finalizes the previous user
- httpSession.setAttribute(CoreConstants.Servlet.Session.USER_FINALIZER, finalizer);
- }
- }
-
try
{
// Continue the invocation
@@ -264,119 +212,5 @@
public void setCacheUser(boolean cacheUser)
{
this.cacheUser = cacheUser;
- }
-
- /** Implement the last login date feature. */
- private static class UserFinalizer implements Serializable, HttpSessionBindingListener
- {
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -8534276945533635226L;
-
- private static final Logger log = Logger.getLogger(UserFinalizer.class);
-
- private final Object userId;
-
- public UserFinalizer(Object userId)
- {
- if (userId == null)
- {
- throw new IllegalArgumentException("No user id present");
- }
- this.userId = userId;
- }
-
- public void valueBound(HttpSessionBindingEvent event)
- {
- }
-
- public void valueUnbound(HttpSessionBindingEvent event)
- {
- try
- {
- finalizeUser();
- }
- catch (Exception e)
- {
- log.warn("Cannot set last login date for user with id '" + userId + "' : " + e.getMessage());
- log.debug("Failed to set user last login date (may happen during server shutdown): ", e);
- }
- }
-
- protected void finalizeUser() throws Exception
- {
- /**
- * Note: Due to a possible bug in JBoss Cache Transaction propagation within a cluster,
- * We need to spawn a separate thread with its own new transaction to perform the finalizeUser
- * logic.
- *
- * Without that, it results in data deadlocks in the cluster.
- */
- Thread thread = new Thread(new FinalizeRunner());
- thread.start();
- thread.join();
- }
-
- /**
- *
- * @author soshah
- *
- */
- private class FinalizeRunner implements Runnable
- {
- public void run()
- {
- UserTransaction tx = null;
- try
- {
- //
- if (log.isTraceEnabled())
- {
- log.trace("Finalizing user " + userId);
- }
-
- //
- // Here we use JNDI to locate the module as this finalizer could have been
- // migrated in the session of another node of the cluster
- UserModule userModule = null;
- UserProfileModule userProfileModule = null;
- InitialContext ctx = new InitialContext();
- tx = (UserTransaction)ctx.lookup("UserTransaction");
- tx.begin();
- try
- {
- userModule = (UserModule)new InitialContext().lookup("java:portal/UserModule");
- userProfileModule = (UserProfileModule)new InitialContext().lookup("java:portal/UserProfileModule");
- }
- catch (NameNotFoundException ignore)
- {
- // Name is not bound anymore, it could happen during a shutdown, we don't do anything
- }
-
- // Get user and set last visit date to now if we can
- if (userModule != null && userProfileModule != null)
- {
- try
- {
- User user = userModule.findUserById(userId);
- //user.setLastVisitDate(new Date());
- userProfileModule.setProperty(user, User.INFO_USER_LAST_LOGIN_DATE, new Date().toString());
-
- }
- catch (NoSuchUserException e)
- {
- // User is not found
- log.warn("Trying to finalize non existing user " + userId);
- }
- }
- tx.commit();
- }
- catch(Exception e)
- {
- try{tx.rollback();}catch(Exception rbe){}
- log.debug(this, e);
- }
- }
- }
- }
+ }
}
15 years, 9 months
JBoss Portal SVN: r11734 - modules/portlet/trunk/test/src/test.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2008-08-25 11:48:15 -0400 (Mon, 25 Aug 2008)
New Revision: 11734
Modified:
modules/portlet/trunk/test/src/test/build.xml
Log:
Fix issue in which ant wasn't copying files properly for the tests causing test failures.
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-08-25 10:02:30 UTC (rev 11733)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-08-25 15:48:15 UTC (rev 11734)
@@ -496,6 +496,10 @@
<!-- JBoss 5.0 portlet-test.war -->
<copy todir="${test.temp.dir}/jboss-5.0/portlet-test-war">
<fileset dir="${target}/test-classes/portlet-test-war"/>
+ </copy>
+ <!-- Note: must have this separate copy statement and have overwrite=true
+ in order for the files to get properly overwritten every time -->
+ <copy todir="${test.temp.dir}/jboss-5.0/portlet-test-war" overwrite="true">
<fileset dir="${target}/test-classes/jboss-5.0/portlet-test-war"/>
</copy>
<copy todir="${test.temp.dir}/jboss-5.0/portlet-test-war/WEB-INF/lib" flatten="true">
15 years, 9 months
JBoss Portal SVN: r11733 - in branches/JBoss_Portal_Branch_2_7/core-cms/src: resources/portal-cms-war/WEB-INF/classes and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-08-25 06:02:30 -0400 (Mon, 25 Aug 2008)
New Revision: 11733
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
Log:
JBPORTAL-2097: CMS access restricted files and missing files error message should be i18n
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2008-08-23 15:48:06 UTC (rev 11732)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2008-08-25 10:02:30 UTC (rev 11733)
@@ -55,6 +55,7 @@
import java.io.PrintWriter;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.Locale;
+import java.util.ResourceBundle;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -289,7 +290,8 @@
}
else
{
- sHTML = "<h2>404 - Page Not Found</h2>Oops! We can't really find the resource you're looking for.";
+ ResourceBundle rb = getPortletConfig().getResourceBundle(req.getLocale());
+ sHTML = "<h2>" + rb.getString("CMS_MISSING_DOCUMENT") + "</h2>" + rb.getString("CMS_MISSING_DOCUMENT_DESCRIPTION");
}
PrintWriter writer = resp.getWriter();
@@ -303,13 +305,14 @@
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
String sHTML = "";
+ ResourceBundle rb = getPortletConfig().getResourceBundle(req.getLocale());
if (path == null || path.trim().length() == 0)
{
- sHTML = "<h2>Access Denied</h2>You are not allowed to access the following resource";
+ sHTML = "<h2>" + rb.getString("CMS_ACCESS_DENIED")+ "</h2>" + rb.getString("CMS_ACCESS_DENIED_DESCRIPTION");
}
else
{
- sHTML = "<h2>Access Denied</h2>You are not allowed to access the following resource - " + path;
+ sHTML = "<h2>" + rb.getString("CMS_ACCESS_DENIED")+ "</h2>" + rb.getString("CMS_ACCESS_DENIED_DESCRIPTION_PATH") + " - " + path;
}
writer.write(sHTML);
writer.close();
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-08-23 15:48:06 UTC (rev 11732)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-08-25 10:02:30 UTC (rev 11733)
@@ -132,3 +132,12 @@
CMS_ADMIN_SELECT_USERS=Select Users that have access to this node.
CMS_ADMIN_YOU_CAN_SELECT_CTRL_ROLES=You may select multiple roles by using CTRL+click on the role names.
CMS_ADMIN_YOU_CAN_SELECT_CTRL_USERS=You may select multiple users by using CTRL+click on the user names.
+
+CMS_ACCESS_DENIED=Access Denied
+CMS_ACCESS_DENIED_DESCRIPTION=You are not allowed to access this resource
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=You are not allowed to access the resource
+
+CMS_MISSING_DOCUMENT=404 - Page Not Found
+CMS_MISSING_DOCUMENT_DESCRIPTION=The document you tried to access is not available
+
+
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties 2008-08-23 15:48:06 UTC (rev 11732)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_de.properties 2008-08-25 10:02:30 UTC (rev 11733)
@@ -122,3 +122,11 @@
CMS_TO_MODIFY=Um das Verhalten dieses Portlets zu modifizieren,
CMS_CLICK_HERE=bitte hier klicken
+
+CMS_ACCESS_DENIED=Zugriff verweigert
+CMS_ACCESS_DENIED_DESCRIPTION=Sie sind nicht berechtigt, auf dieses Element zuzugreifen
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=Sie sind nicht berechtigt, auf folgendes Element zuzugreifen
+
+CMS_MISSING_DOCUMENT=404 - Seite nicht gefunden
+CMS_MISSING_DOCUMENT_DESCRIPTION=Das von ihnen angeforderte Dokument ist nicht verf�gbar
+
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2008-08-23 15:48:06 UTC (rev 11732)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2008-08-25 10:02:30 UTC (rev 11733)
@@ -152,3 +152,10 @@
TITLE_UPLOAD = T\u00E9l\u00E9d\u00E9verser un fichier
TITLE_VIEWFILE = Propri\u00E9t\u00E9s du fichier
+
+CMS_ACCESS_DENIED=Acc\u00E9s interdit
+CMS_ACCESS_DENIED_DESCRIPTION=Vous n'\u00eates pas autoris\u00E9 \u00e0 acc\u00e9der a ce document
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=Vous n'\u00eates pas autoris\u00E9 \u00e0 acc\u00e9der au document
+
+CMS_MISSING_DOCUMENT=404 - Page non trouv\u00E9e
+CMS_MISSING_DOCUMENT_DESCRIPTION=Le document auquel vous avez tent\u00E9 d'acc\u00E9der est introuvable
15 years, 9 months
JBoss Portal SVN: r11732 - branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-08-23 11:48:06 -0400 (Sat, 23 Aug 2008)
New Revision: 11732
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
Log:
- Added locales.
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2008-08-23 15:47:32 UTC (rev 11731)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2008-08-23 15:48:06 UTC (rev 11732)
@@ -34,6 +34,10 @@
org.jboss.portletbridge.application.PortletViewHandler
</view-handler>
<state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>fr</supported-locale>
+ </locale-config>
</application>
<converter>
15 years, 9 months