JBoss Portal SVN: r11389 - in modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client: model and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-09 17:43:10 -0400 (Wed, 09 Jul 2008)
New Revision: 11389
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
Log:
javadoc does not hurt
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-09 21:30:21 UTC (rev 11388)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-09 21:43:10 UTC (rev 11389)
@@ -25,14 +25,30 @@
import java.util.Iterator;
/**
+ * A context for drag and drop operations.
+ *
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
public interface DnDContext
{
+ /**
+ * Returns an iterator of draggables found under the specifed coordinates.
+ *
+ * @param x the x position
+ * @param y the y position
+ * @return an iterator of draggables
+ */
Iterator getDraggables(int x, int y);
+ /**
+ * Returns an iterator of droppables found under the specifed coordinates.
+ *
+ * @param x the x position
+ * @param y the y position
+ * @return an iterator of droppables
+ */
Iterator findDroppable(int x, int y);
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java (from rev 11388, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java)
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDController.java 2008-07-09 21:43:10 UTC (rev 11389)
@@ -0,0 +1,275 @@
+/******************************************************************************
+ * 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.presentation.ajax.client.dnd;
+
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.EventPreview;
+import com.google.gwt.user.client.Window;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
+
+import java.util.Iterator;
+
+/**
+ * The drag and drop controller where all the magic happens. More generally this takes care of coordinating
+ * dnd operations provided by the dnd context.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class DnDController extends SimplePanel implements EventPreview
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(DnDController.class);
+
+ /** . */
+ private Drag drag;
+
+ /** . */
+ private Droppable droppable;
+
+ /** . */
+ private DnDContext context;
+
+ public DnDController(DnDContext context)
+ {
+ DOM.sinkEvents(getElement(), Event.MOUSEEVENTS);
+ DOM.addEventPreview(this);
+
+ //
+ this.context = context;
+ }
+
+ public boolean onEventPreview(Event event)
+ {
+ if (DOM.eventGetType(event) == Event.ONMOUSEDOWN)
+ {
+ int x = DOM.eventGetClientX(event);
+ int y = DOM.eventGetClientY(event);
+ Draggable draggable = findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
+
+ //
+ if (draggable != null)
+ {
+ DOM.eventPreventDefault(event);
+ }
+ }
+
+ //
+ return true;
+ }
+
+ private Draggable findDraggable(int x, int y)
+ {
+ Iterator draggables = context.getDraggables(x, y);
+ if (draggables.hasNext())
+ {
+ return (Draggable)draggables.next();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private Droppable findDroppable(int x, int y)
+ {
+ Iterator droppables = context.findDroppable(x, y);
+
+ //
+ while (droppables.hasNext())
+ {
+ Droppable droppable = (Droppable)droppables.next();
+
+ //
+ if (!droppable.getId().equals(drag.draggable.getId()))
+ {
+ return droppable;
+ }
+ }
+
+ //
+ return null;
+ }
+
+ public void onBrowserEvent(Event event)
+ {
+ if (context != null)
+ {
+ Element element = DOM.eventGetTarget(event);
+
+ //
+ switch (DOM.eventGetType(event))
+ {
+ case Event.ONMOUSEDOWN:
+ {
+ int x = DOM.eventGetClientX(event);
+ int y = DOM.eventGetClientY(event);
+ Draggable draggable = findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
+
+ //
+ if (draggable != null)
+ {
+ Element containerElement = draggable.getContainer();
+ int left = DOM.getAbsoluteLeft(draggable.getContainer()) - Window.getScrollLeft();
+ int top = DOM.getAbsoluteTop(draggable.getContainer()) - Window.getScrollTop();
+ int deltaX = x - left;
+ int deltaY = y - top;
+
+ //
+ log.debug("Starting drag element=(" + left + "," + top + "), mouse=(" + x +
+ "," + y + "), delta=(" + deltaX + "," + deltaY + ") with draggable " + draggable);
+
+ //
+ draggable.startDragging();
+ DOM.setStyleAttribute(containerElement, "position", "fixed");
+ DOM.setIntStyleAttribute(containerElement, "left", left);
+ DOM.setIntStyleAttribute(containerElement, "top", top);
+
+ //
+ drag = new Drag(
+ deltaX,
+ deltaY,
+ element,
+ draggable
+ );
+
+ //
+ updateDroppable(x + Window.getScrollLeft(), y + Window.getScrollTop());
+
+ //
+ // DOM.setCapture(element);
+ }
+
+ //
+ break;
+ }
+ case Event.ONMOUSEUP:
+ {
+ if (drag != null)
+ {
+ stopDrag();
+ }
+ break;
+ }
+ case Event.ONMOUSEMOVE:
+ {
+ if (drag != null)
+ {
+ int x = DOM.eventGetClientX(event);
+ int y = DOM.eventGetClientY(event);
+ int newX = x - drag.deltaX;
+ int newY = y - drag.deltaY;
+ DOM.setIntStyleAttribute(drag.draggable.getContainer(), "left", newX);
+ DOM.setIntStyleAttribute(drag.draggable.getContainer(), "top", newY);
+ log.debug("Dragging at position (" + newX + "," + newY + ") with draggable " + drag.draggable +
+ " on element " + element);
+
+ //
+ updateDroppable(x + Window.getScrollLeft(), y + Window.getScrollTop());
+ }
+
+ //
+ break;
+ }
+ case Event.ONMOUSEOVER:
+ case Event.ONMOUSEOUT:
+ {
+// if (drag != null && element == getElement())
+// {
+// stopDrag();
+// }
+ break;
+ }
+ }
+
+
+ }
+ }
+
+ private void updateDroppable(int x, int y)
+ {
+ Droppable newDroppable = findDroppable(x, y);
+
+ //
+ if (newDroppable != null)
+ {
+ log.debug("Found droppable " + newDroppable);
+ }
+ //
+ if (droppable != newDroppable)
+ {
+ if (droppable != null)
+ {
+ droppable.leave(drag.draggable);
+ }
+ if (newDroppable != null)
+ {
+ newDroppable.enter(drag.draggable);
+ }
+ }
+
+ //
+ droppable = newDroppable;
+ }
+
+ private void stopDrag()
+ {
+ log.debug("Stopping drag with draggable " + drag.draggable + " and droppable " + droppable);
+
+ //
+ if (droppable != null)
+ {
+ droppable.leave(drag.draggable);
+ drag.draggable.stopDragging();
+
+ //
+ if (droppable.accept(drag.draggable))
+ {
+ log.debug("Droppable " + droppable + " accepted the draggable " + drag.draggable);
+ drag.draggable.accepted(droppable);
+ }
+ else
+ {
+ log.debug("Droppable " + droppable + " rejected the draggable " + drag.draggable);
+ drag.draggable.rejected(droppable);
+ }
+
+ //
+ droppable = null;
+ }
+ else
+ {
+ drag.draggable.stopDragging();
+ }
+
+ // DOM.releaseCapture(drag.element);
+ Element containerElement = drag.draggable.getContainer();
+ DOM.setStyleAttribute(containerElement, "position", null);
+ drag = null;
+ }
+
+}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java 2008-07-09 21:30:21 UTC (rev 11388)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java 2008-07-09 21:43:10 UTC (rev 11389)
@@ -25,31 +25,65 @@
import com.google.gwt.user.client.Element;
/**
+ * Something that is draggable.
+ *
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
public interface Draggable
{
+ /**
+ * Identifies the draggable. Note that the id can be used to compare a draggable against
+ * a droppable.
+ *
+ * @return the id
+ */
String getId();
/**
- * Returns the element container that will be used for moving.
+ * Returns the element container that will be used for performing the visual move of the drag operation.
*
* @return the element container
*/
Element getContainer();
+ /**
+ * Signal the start of a drag operation.
+ */
void startDragging();
+ /**
+ * Signal the stop of an on going drag operation.
+ */
void stopDragging();
+ /**
+ * Signals that the draggable has entered a droppable during a drag.
+ *
+ * @param droppable the droppable
+ */
void enter(Droppable droppable);
+ /**
+ * Signals that the draggable has left a droppable during a drag.
+ *
+ * @param droppable the droppable
+ */
void leave(Droppable droppable);
+ /**
+ * Signals that a droppable has accepted this draggable.
+ *
+ * @param droppable the droppable
+ */
void accepted(Droppable droppable);
+ /**
+ * Signals that a droppable has rejected this draggable.
+ *
+ * @param droppable the droppable
+ */
void rejected(Droppable droppable);
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java 2008-07-09 21:30:21 UTC (rev 11388)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java 2008-07-09 21:43:10 UTC (rev 11389)
@@ -23,18 +23,42 @@
package org.jboss.portal.presentation.ajax.client.dnd;
/**
+ * Something that is droppable.
+ *
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
public interface Droppable
{
+ /**
+ * Identifies the droppable. Note that the id can be used to compare a droppable against
+ * a draggable.
+ *
+ * @return the id
+ */
String getId();
+ /**
+ * Signals that a draggable has entered this draggable.
+ *
+ * @param draggable the draggable
+ */
void enter(Draggable draggable);
+ /**
+ * Signals that a draggable has left this draggable.
+ *
+ * @param draggable the draggable
+ */
void leave(Draggable draggable);
+ /**
+ * Returns true if the droppable accepts the draggable.
+ *
+ * @param draggable the draggable
+ * @return true if the draggable is accepted
+ */
boolean accept(Draggable draggable);
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-09 21:30:21 UTC (rev 11388)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-09 21:43:10 UTC (rev 11389)
@@ -31,10 +31,9 @@
import java.util.List;
import java.util.ArrayList;
-import org.jboss.portal.presentation.ajax.client.dnd.DnDPanel;
+import org.jboss.portal.presentation.ajax.client.dnd.DnDController;
import org.jboss.portal.presentation.ajax.client.dnd.DnDContext;
import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
-import org.jboss.portal.presentation.ajax.client.dnd.Droppable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -47,7 +46,7 @@
private VerticalPanel widget;
/** . */
- private DnDPanel dndPanel;
+ private DnDController dndController;
public AjaxPage(String id, Map properties)
{
@@ -56,7 +55,7 @@
protected void doRefresh(boolean force)
{
- doRefresh(dndPanel);
+ doRefresh(dndController);
}
public Widget getWidget()
@@ -69,12 +68,12 @@
Label title = new Label("Page " + getId());
MetaWidget meta = new MetaWidget(this);
VerticalPanel widget = new VerticalPanel();
- DnDPanel dndPanel = new DnDPanel(dndContext);
+ DnDController dndController = new DnDController(dndContext);
//
meta.add(title);
widget.add(meta);
- widget.add(dndPanel);
+ widget.add(dndController);
//
title.setStyleName("pf-Title");
@@ -82,7 +81,7 @@
//
this.widget = widget;
- this.dndPanel = dndPanel;
+ this.dndController = dndController;
}
protected void doDestroyWidget()
16 years, 3 months
JBoss Portal SVN: r11388 - in modules/presentation/trunk: ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-09 17:30:21 -0400 (Wed, 09 Jul 2008)
New Revision: 11388
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
Log:
improved DnD
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -22,8 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client.dnd;
-import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.Element;
+import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -32,11 +31,9 @@
public interface DnDContext
{
-
+ Iterator getDraggables(int x, int y);
- Draggable findDraggable(int x, int y);
+ Iterator findDroppable(int x, int y);
- Droppable findDroppable(int x, int y);
-
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -30,6 +30,9 @@
import com.google.gwt.user.client.Window;
import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
+import java.util.List;
+import java.util.Iterator;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -63,7 +66,7 @@
{
int x = DOM.eventGetClientX(event);
int y = DOM.eventGetClientY(event);
- Draggable draggable = context.findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
+ Draggable draggable = findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
//
if (draggable != null)
@@ -76,6 +79,39 @@
return true;
}
+ private Draggable findDraggable(int x, int y)
+ {
+ Iterator draggables = context.getDraggables(x, y);
+ if (draggables.hasNext())
+ {
+ return (Draggable)draggables.next();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private Droppable findDroppable(int x, int y)
+ {
+ Iterator droppables = context.findDroppable(x, y);
+
+ //
+ while (droppables.hasNext())
+ {
+ Droppable droppable = (Droppable)droppables.next();
+
+ //
+ if (!droppable.getId().equals(drag.draggable.getId()))
+ {
+ return droppable;
+ }
+ }
+
+ //
+ return null;
+ }
+
public void onBrowserEvent(Event event)
{
if (context != null)
@@ -89,7 +125,7 @@
{
int x = DOM.eventGetClientX(event);
int y = DOM.eventGetClientY(event);
- Draggable draggable = context.findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
+ Draggable draggable = findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
//
if (draggable != null)
@@ -173,7 +209,7 @@
private void updateDroppable(int x, int y)
{
- Droppable newDroppable = context.findDroppable(x, y);
+ Droppable newDroppable = findDroppable(x, y);
//
if (newDroppable != null)
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -31,6 +31,8 @@
public interface Draggable
{
+ String getId();
+
/**
* Returns the element container that will be used for moving.
*
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Droppable.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -29,6 +29,8 @@
public interface Droppable
{
+ String getId();
+
void enter(Draggable draggable);
void leave(Draggable draggable);
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -26,8 +26,6 @@
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.DOM;
import java.util.Iterator;
import java.util.Map;
@@ -119,6 +117,11 @@
private final Droppable droppable = new Droppable()
{
+ public String getId()
+ {
+ return AjaxLayout.this.getId();
+ }
+
public void enter(Draggable draggable)
{
layout.addStyleName("dnd-selected");
@@ -131,39 +134,39 @@
public boolean accept(Draggable draggable)
{
- if (draggable instanceof AjaxWindow.DraggableWindow)
+ AjaxObject dragged = null;
+
+ //
+ if (draggable instanceof AjaxWindow.DraggableImpl)
{
- AjaxWindow.DraggableWindow draggableWindow = (AjaxWindow.DraggableWindow)draggable;
- AjaxWindow window = draggableWindow.getWindow();
+ dragged = ((AjaxWindow.DraggableImpl)draggable).getWindow();
+ }
+ else if (draggable instanceof AjaxPane.DraggableImpl)
+ {
+ dragged = ((AjaxPane.DraggableImpl)draggable).getPane();
+ }
+ //
+ if (dragged != null && !getChildren().contains(dragged))
+ {
+ AjaxObject parent = dragged.getParent();
+
//
- if (!getChildren().contains(window))
- {
- AjaxObject parent = window.getParent();
+ log.info("Moving window " + dragged.getId() + " from parent " + parent.getId() + " to layout " + getId());
- //
- log.info("Moving window " + window.getId() + " from parent " + parent.getId() + " to layout " + getId());
+ //
+ MoveObjectAction action = new MoveObjectAction(dragged.getId(), getId());
- //
- MoveObjectAction action = new MoveObjectAction(window.getId(), getId());
+ //
+ getContext().getAgentContext().process(action);
- //
- getContext().getAgentContext().process(action);
-
-// //
-// parent.removeChild(window);
-//
-// //
-// addChild(window);
-
- //
- return true;
- }
- else
- {
- log.info("Do not contain child " + window.getId());
- }
+ //
+ return true;
}
+ else
+ {
+ log.info("Do not contain child " + dragged.getId());
+ }
//
return false;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -28,6 +28,7 @@
import java.util.HashMap;
import java.util.Collection;
import java.util.Iterator;
+import java.util.List;
import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
import org.jboss.portal.presentation.ajax.client.model.update.AddObject;
@@ -133,41 +134,44 @@
}
}
- public final Draggable findDraggabble(int x, int y)
+ public final void findDraggabble(List draggables, int x, int y)
{
- Draggable draggable = doFindDraggable(x, y);
-
- //
- for (Iterator i = getChildren().iterator();i.hasNext() && draggable == null;)
+ for (Iterator i = getChildren().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
//
- draggable = child.findDraggabble(x, y);
+ child.findDraggabble(draggables, x, y);
}
-
+
//
- return draggable;
+ Draggable draggable = doFindDraggable(x, y);
+
+ //
+ if (draggable != null)
+ {
+ draggables.add(draggable);
+ }
}
- public final Droppable findDroppable(int x, int y)
+ public final void findDroppable(List droppables, int x, int y)
{
for (Iterator i = getChildren().iterator();i.hasNext();)
{
AjaxObject child = (AjaxObject)i.next();
//
- Droppable droppable = child.findDroppable(x, y);
-
- //
- if (droppable != null)
- {
- return droppable;
- }
+ child.findDroppable(droppables, x, y);
}
//
- return doFindDroppable(x, y);
+ Droppable droppable = doFindDroppable(x, y);
+
+ //
+ if (droppable != null)
+ {
+ droppables.add(droppable);
+ }
}
public final void refresh(boolean force)
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -27,6 +27,9 @@
import com.google.gwt.user.client.ui.Widget;
import java.util.Map;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
import org.jboss.portal.presentation.ajax.client.dnd.DnDPanel;
import org.jboss.portal.presentation.ajax.client.dnd.DnDContext;
@@ -95,14 +98,19 @@
/** . */
private final DnDContext dndContext = new DnDContext()
{
- public Draggable findDraggable(int x, int y)
+
+ public Iterator getDraggables(int x, int y)
{
- return findDraggabble(x, y);
+ List draggables = new ArrayList();
+ AjaxPage.this.findDraggabble(draggables, x, y);
+ return draggables.iterator();
}
- public Droppable findDroppable(int x, int y)
+ public Iterator findDroppable(int x, int y)
{
- return AjaxPage.this.findDroppable(x, y);
+ List droppables = new ArrayList();
+ AjaxPage.this.findDroppable(droppables, x, y);
+ return droppables.iterator();
}
};
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -38,12 +38,27 @@
public class AjaxPane extends AjaxLayout
{
- /** . */
- private VerticalPanel widget;
+ class DraggableImpl implements Draggable
+ {
- /** . */
- private Draggable draggable = new Draggable()
- {
+ /** . */
+ private final AjaxPane pane;
+
+ DraggableImpl(AjaxPane pane)
+ {
+ this.pane = pane;
+ }
+
+ public AjaxPane getPane()
+ {
+ return pane;
+ }
+
+ public String getId()
+ {
+ return AjaxPane.this.getId();
+ }
+
public Element getContainer()
{
return widget.getElement();
@@ -74,11 +89,20 @@
public void rejected(Droppable droppable)
{
}
- };
+ }
+ /** . */
+ private VerticalPanel widget;
+
+ /** . */
+ private Draggable draggable;
+
public AjaxPane(String id, Map properties)
{
super(id, properties);
+
+ //
+ this.draggable = new DraggableImpl(this);
}
protected void doCreateWidget()
@@ -92,19 +116,18 @@
protected Draggable doFindDraggable(int x, int y)
{
-// int left = widget.getAbsoluteLeft();
-// int right = left + widget.getOffsetWidth();
-// int top = widget.getAbsoluteTop();
-// int bottom = top + widget.getOffsetHeight();
-// if (x >= left && x <= right && y >= top && y <= bottom)
-// {
-// return draggable;
-// }
-// else
-// {
-// return null;
-// }
- return null;
+ int left = widget.getAbsoluteLeft();
+ int right = left + widget.getOffsetWidth();
+ int top = widget.getAbsoluteTop();
+ int bottom = top + widget.getOffsetHeight();
+ if (x >= left && x <= right && y >= top && y <= bottom)
+ {
+ return draggable;
+ }
+ else
+ {
+ return null;
+ }
}
protected void doRefresh(boolean force)
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -69,19 +69,24 @@
private HTML markup;
/** . */
- private DraggableWindow draggable;
+ private DraggableImpl draggable;
- static class DraggableWindow implements Draggable
+ static class DraggableImpl implements Draggable
{
/** . */
private final AjaxWindow window;
- DraggableWindow(AjaxWindow window)
+ DraggableImpl(AjaxWindow window)
{
this.window = window;
}
+ public String getId()
+ {
+ return window.getId();
+ }
+
public AjaxWindow getWindow()
{
return window;
@@ -124,7 +129,7 @@
super(id, properties);
//
- draggable = new DraggableWindow(this);
+ draggable = new DraggableImpl(this);
}
protected Draggable doFindDraggable(int x, int y)
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-07-09 20:39:40 UTC (rev 11387)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-07-09 21:30:21 UTC (rev 11388)
@@ -126,10 +126,10 @@
String targetId = objectAction.getTargetId();
//
- PortalNode targetNode = (PortalNode)structuralAdapter.getNode(targetId);
+ Object target = structuralAdapter.getNode(targetId);
//
- if (targetNode == null)
+ if (target == null)
{
return new PresentationResponse(new ErrorResponse(404));
}
@@ -141,19 +141,29 @@
}
else if (objectAction instanceof DestroyUIObjectAction)
{
- LayoutElement referent = layoutStore.findElementByRef(targetNode.getId());
+ if (target instanceof PortalNode)
+ {
+ PortalNode targetNode = (PortalNode)target;
- //
- if (referent != null)
+ //
+ LayoutElement referent = layoutStore.findElementByRef(targetNode.getId());
+
+ //
+ if (referent != null)
+ {
+ layoutStore.destroyElement(referent.getId());
+ }
+
+ //
+ portalNodeManager.destroy(targetNode.getId());
+
+ //
+ return new PresentationResponse(new ShowUIObjectResponse(targetId));
+ }
+ else
{
- layoutStore.destroyElement(referent.getId());
+ throw new NotYetImplemented();
}
-
- //
- portalNodeManager.destroy(targetNode.getId());
-
- //
- return new PresentationResponse(new ShowUIObjectResponse(targetId));
}
else if (objectAction instanceof LinkActivation)
{
@@ -164,7 +174,7 @@
ContentAction contentAction = (ContentAction)objectAction;
//
- WindowNode window = (WindowNode)targetNode;
+ WindowNode window = (WindowNode)target;
//
Content content = window.getContent();
@@ -218,7 +228,15 @@
}
//
- LayoutElement sourceElt = layoutStore.findElementByRef(targetNode.getId());
+ LayoutElement sourceElt;
+ if (target instanceof PortalNode)
+ {
+ sourceElt = layoutStore.findElementByRef(((PortalNode)target).getId());
+ }
+ else
+ {
+ sourceElt = (LayoutElement)target;
+ }
//
if (sourceElt == null)
@@ -230,7 +248,7 @@
destinationElt.add(sourceElt);
//
- System.out.println("Should move " + targetNode + " to " + destinationElt);
+ System.out.println("Should move " + sourceElt + " to " + destinationElt);
//
return new PresentationResponse(new ShowUIObjectResponse("blah"));
16 years, 3 months
JBoss Portal SVN: r11387 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/util.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-09 16:39:40 -0400 (Wed, 09 Jul 2008)
New Revision: 11387
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/Tools.java
Log:
- Javadoc + reformat.
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/Tools.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/Tools.java 2008-07-09 19:43:37 UTC (rev 11386)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/Tools.java 2008-07-09 20:39:40 UTC (rev 11387)
@@ -38,6 +38,7 @@
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
@@ -46,7 +47,6 @@
import java.util.NoSuchElementException;
import java.util.ResourceBundle;
import java.util.Set;
-import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -270,7 +270,7 @@
/**
* Transforms an iterator into a Set
*
- * @param iterator The iterator to transform
+ * @param iterator The iterator to transform
* @param preserveOrder true if the set must respect the ordering of the iterator
* @return a LinkedHashSet if ordered is true, a HashSet otherwise
*/
@@ -403,15 +403,16 @@
}
/**
- * Returns an iterator over the array elements within the specified range. The range is considered as valid
- * if the from argument is greater or equals than zero, the to argument is lesser or equals than array size
- * and the from argument is lesser or equals to the to argument.
+ * Returns an iterator over the array elements within the specified range. The range is considered as valid if the
+ * from argument is greater or equals than zero, the to argument is lesser or equals than array size and the from
+ * argument is lesser or equals to the to argument.
*
* @param objects the array containing the objects to iterate on
* @param from the inclusive start index
* @param to the exclusive stop index
* @return the iterator
- * @throws IllegalArgumentException if the object array is null or the specified range is not valid or if the range is not valid
+ * @throws IllegalArgumentException if the object array is null or the specified range is not valid or if the range
+ * is not valid
*/
public static <E> Iterator<E> iterator(final E[] objects, final int from, final int to) throws IllegalArgumentException
{
@@ -785,16 +786,15 @@
}
/**
- * Append an object to an array of objects. The original array is not modified. The returned array
- * will be of the same component type of the provided array and its first n elements where n is the size
- * of the provided array will be the elements of the provided array. The last element of the array will be
- * the provided object to append.
+ * Append an object to an array of objects. The original array is not modified. The returned array will be of the
+ * same component type of the provided array and its first n elements where n is the size of the provided array will
+ * be the elements of the provided array. The last element of the array will be the provided object to append.
*
* @param array the array to augment
- * @param o the object to append
+ * @param o the object to append
* @return a new array
* @throws IllegalArgumentException if the array is null
- * @throws ClassCastException if the appended object class prevents it from being added to the array
+ * @throws ClassCastException if the appended object class prevents it from being added to the array
*/
public static <E> E[] appendTo(E[] array, E o) throws IllegalArgumentException, ClassCastException
{
@@ -822,7 +822,7 @@
/**
* Return true if
* <ul>
- * <li>o1 is null and o2 is null</li<
+ * <li>o1 is null and o2 is null</li>
* <li>o1 is not null and the invocation of <code>equals(Object o)</code> on o1 wit o2 as argument returns true</li>
* </ul>
*
@@ -842,22 +842,39 @@
}
}
- public static String replaceAllInstancesOfBoundedString(String initial, String prefix, String suffix, String replacement)
- {
- return replaceBoundedString(initial, prefix, suffix, replacement, true, false);
- }
-
/**
- * Todo : define what "bounded" means.
+ * Same as replaceBoundedString(initial, prefix, suffix, replacement, true, false).
*
* @param initial
* @param prefix
* @param suffix
* @param replacement
- * @param replaceIfBoundedStringEmpty
- * @param keepBoundaries
* @return
*/
+ public static String replaceAllInstancesOfBoundedString(String initial, String prefix, String suffix, String replacement)
+ {
+ return replaceBoundedString(initial, prefix, suffix, replacement, true, false);
+ }
+
+ /**
+ * Replace instances of Strings delimited by the given prefix and suffix (hence, bounded) by the specified
+ * replacement String. It is possible to specify whether the substitution will happen only if the delimited String is
+ * non-empty by setting <code>replaceIfBoundedStringEmpty</code> to <code>false</code>. It is also possible to keep
+ * the boundaries (prefix and suffix) after the substitution by setting <code>keepBoundaries</code> to
+ * <code>true</code>.
+ * <p/>
+ * See org.jboss.portal.test.common.StringTestCase.testReplaceBoundedString() for usage details.
+ *
+ * @param initial the String in which we want to replace bounded Strings
+ * @param prefix the prefix used identify the beginning of the String targeted for replacement
+ * @param suffix the suffix used to identify the end of the String targeted for replacement
+ * @param replacement the String to replace the bounded String with
+ * @param replaceIfBoundedStringEmpty <code>true</code> to allow replacement of empty Strings (in essence, insertion
+ * of the replacement String between the prefix and suffix)
+ * @param keepBoundaries <code>true</code> to keep the prefix and suffix markers in the resulting
+ * String
+ * @return a String where the Strings marked by prefix and suffix have been replaced by replacement
+ */
public static String replaceBoundedString(String initial, String prefix, String suffix, String replacement,
boolean replaceIfBoundedStringEmpty, boolean keepBoundaries)
{
@@ -905,13 +922,16 @@
/**
* Determines if value is contained in array.
+ * <p/>
+ * todo: correct this method contract in order to make it more reusable, it looks like for now like a method which
+ * has a contract convenient only for some kind of callers.
+ * <p/>
+ * <ol>
+ * <li>null value should be accepted (or the method should be called isContainedInButNotForNullValue ?)</li>
+ * <li>null array should not be accepted (or the method should be called isContainedInExceptIfThePassedArrayIsNull
+ * ?)</li>
+ * </ol>
*
- * todo: correct this method contract in order to make it more reusable, it looks like for now like a method
- * which has a contract convenient only for some kind of callers.
- *
- * 1/ null value should be accepted (or the method should be called isContainedInButNotForNullValue ?)
- * 2/ null array should not be accepted (or the method should be called isContainedInExceptIfThePassedArrayIsNull ?)
- *
* @param value
* @param array
* @return
@@ -939,13 +959,13 @@
}
/**
- * Attempt to cast the value argument to the provided type argument. If the value argument type is assignable
- * to the provided type, the value is returned, otherwise if it is not or the value is null, null is returned.
- *
+ * Attempt to cast the value argument to the provided type argument. If the value argument type is assignable to the
+ * provided type, the value is returned, otherwise if it is not or the value is null, null is returned.
+ * <p/>
* todo: Move that to common package.
*
* @param value the value to cast
- * @param type the type to downcast
+ * @param type the type to downcast
* @return the casted value or null
*/
public static <T> T safeCast(Object value, Class<T> type)
16 years, 3 months
JBoss Portal SVN: r11386 - branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-09 15:43:37 -0400 (Wed, 09 Jul 2008)
New Revision: 11386
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
Log:
- Removed <br/> tags as they are not intepreted.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 19:43:20 UTC (rev 11385)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 19:43:37 UTC (rev 11386)
@@ -50,7 +50,7 @@
confirm_delete_registration_title = Delete local registration for ''{0}'' consumer?
confirm_delete_registration_message = You are about to delete the local registration information for the ''{0}'' consumer! \n\
This is only needed if this consumer had previously registered with the remote producer and this producer \n\
-has been modified to not require registration anymore.<br/><br/> \n\
+has been modified to not require registration anymore. \n\
Only erase local registration information if you experience errors with the producer due to this \n\
particular situation. Erasing local registration when not required might lead to inability to work with \n\
this producer anymore.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 19:43:20 UTC (rev 11385)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 19:43:37 UTC (rev 11386)
@@ -41,7 +41,7 @@
confirm_delete_registration_cancel=Annuler
confirm_delete_registration_message=Vous \u00eates sur le point d'effacer les informations locales d'enregistrement pour le consommateur ''{0}''! \n\
Ceci n'est uniquement requis dans le cas o\u00f9 ce consommateur se serait enregistr\u00e9 aupr\u00e8s d'un producteur distant \n\
-qui aurait ensuite \u00e9t\u00e9 modifi\u00e9 pour ne plus requerir d'enregistrement.<br/><br/> \n\
+qui aurait ensuite \u00e9t\u00e9 modifi\u00e9 pour ne plus requerir d'enregistrement. \n\
N'effacez les informations locales d'enregistrement que si vous rencontrez des probl\u00e8mes, sp\u00e9cifiques \u00e0 cette \n\
situation, avec le producteur distant. Effacer les donn\u00e9es d'enregistrement quand ce n'est pas requis peut entra\u00eener \n\
l'incapacit\u00e9 future d'acc\u00e9der \u00e0 ce producteur.
16 years, 3 months
JBoss Portal SVN: r11385 - branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-09 15:43:20 -0400 (Wed, 09 Jul 2008)
New Revision: 11385
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
Log:
- Removed <br/> tags as they are not intepreted.
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 19:16:21 UTC (rev 11384)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 19:43:20 UTC (rev 11385)
@@ -50,7 +50,7 @@
confirm_delete_registration_title = Delete local registration for ''{0}'' consumer?
confirm_delete_registration_message = You are about to delete the local registration information for the ''{0}'' consumer! \n\
This is only needed if this consumer had previously registered with the remote producer and this producer \n\
-has been modified to not require registration anymore.<br/><br/> \n\
+has been modified to not require registration anymore. \n\
Only erase local registration information if you experience errors with the producer due to this \n\
particular situation. Erasing local registration when not required might lead to inability to work with \n\
this producer anymore.
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 19:16:21 UTC (rev 11384)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 19:43:20 UTC (rev 11385)
@@ -41,7 +41,7 @@
confirm_delete_registration_cancel=Annuler
confirm_delete_registration_message=Vous \u00eates sur le point d'effacer les informations locales d'enregistrement pour le consommateur ''{0}''! \n\
Ceci n'est uniquement requis dans le cas o\u00f9 ce consommateur se serait enregistr\u00e9 aupr\u00e8s d'un producteur distant \n\
-qui aurait ensuite \u00e9t\u00e9 modifi\u00e9 pour ne plus requerir d'enregistrement.<br/><br/> \n\
+qui aurait ensuite \u00e9t\u00e9 modifi\u00e9 pour ne plus requerir d'enregistrement. \n\
N'effacez les informations locales d'enregistrement que si vous rencontrez des probl\u00e8mes, sp\u00e9cifiques \u00e0 cette \n\
situation, avec le producteur distant. Effacer les donn\u00e9es d'enregistrement quand ce n'est pas requis peut entra\u00eener \n\
l'incapacit\u00e9 future d'acc\u00e9der \u00e0 ce producteur.
@@ -132,4 +132,4 @@
bean_consumermanager_refresh_failure=Le rafra\u00eechissement a \u00e9chou\u00e9 (probablement \u00e0 cause d'informations d'enregistrement non valides)
bean_consumermanager_refresh_success=Le rafra\u00eechissement a r\u00e9ussi.
bean_producer_cancel_success=Toutes les modifications faites \u00e0 la configuration du producteur ont \u00e9t\u00e9 annull\u00e9es!
-bean_producer_save_success=La configuration du producteur a bien \u00e9t\u00e9 sauvegard\u00e9e!
\ No newline at end of file
+bean_producer_save_success=La configuration du producteur a bien \u00e9t\u00e9 sauvegard\u00e9e!
16 years, 3 months
JBoss Portal SVN: r11384 - in modules/presentation/trunk: ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-09 15:16:21 -0400 (Wed, 09 Jul 2008)
New Revision: 11384
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/MoveObjectAction.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
Log:
fix the droppable selection that was not taking in account the window scroll values
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDContext.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -32,8 +32,10 @@
public interface DnDContext
{
- Draggable findDraggableByHandle(Panel panel, Element element);
+
+ Draggable findDraggable(int x, int y);
+
Droppable findDroppable(int x, int y);
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -61,7 +61,9 @@
{
if (DOM.eventGetType(event) == Event.ONMOUSEDOWN)
{
- Object draggable = context.findDraggableByHandle(this, DOM.eventGetTarget(event));
+ int x = DOM.eventGetClientX(event);
+ int y = DOM.eventGetClientY(event);
+ Draggable draggable = context.findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
//
if (draggable != null)
@@ -85,7 +87,9 @@
{
case Event.ONMOUSEDOWN:
{
- Draggable draggable = context.findDraggableByHandle(this, element);
+ int x = DOM.eventGetClientX(event);
+ int y = DOM.eventGetClientY(event);
+ Draggable draggable = context.findDraggable(x + Window.getScrollLeft(), y + Window.getScrollTop());
//
if (draggable != null)
@@ -93,8 +97,6 @@
Element containerElement = draggable.getContainer();
int left = DOM.getAbsoluteLeft(draggable.getContainer()) - Window.getScrollLeft();
int top = DOM.getAbsoluteTop(draggable.getContainer()) - Window.getScrollTop();
- int x = DOM.eventGetClientX(event);
- int y = DOM.eventGetClientY(event);
int deltaX = x - left;
int deltaY = y - top;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -185,11 +185,6 @@
return null;
}
- protected Draggable doFindDraggable(Element element)
- {
- return null;
- }
-
protected void doAddChild(AjaxObject child)
{
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -23,7 +23,6 @@
package org.jboss.portal.presentation.ajax.client.model;
import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.Element;
import java.util.Map;
import java.util.HashMap;
@@ -134,9 +133,9 @@
}
}
- public final Draggable findDraggabble(Element element)
+ public final Draggable findDraggabble(int x, int y)
{
- Draggable draggable = doFindDraggable(element);
+ Draggable draggable = doFindDraggable(x, y);
//
for (Iterator i = getChildren().iterator();i.hasNext() && draggable == null;)
@@ -144,7 +143,7 @@
AjaxObject child = (AjaxObject)i.next();
//
- draggable = child.findDraggabble(element);
+ draggable = child.findDraggabble(x, y);
}
//
@@ -249,7 +248,7 @@
protected abstract void doRemoveChild(AjaxObject child);
- protected abstract Draggable doFindDraggable(Element element);
+ protected abstract Draggable doFindDraggable(int x, int y);
protected abstract Droppable doFindDroppable(int x, int y);
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -25,8 +25,6 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.Element;
import java.util.Map;
@@ -89,12 +87,17 @@
widget = null;
}
+ protected Draggable doFindDraggable(int x, int y)
+ {
+ return null;
+ }
+
/** . */
private final DnDContext dndContext = new DnDContext()
{
- public Draggable findDraggableByHandle(Panel panel, Element element)
+ public Draggable findDraggable(int x, int y)
{
- return findDraggabble(element);
+ return findDraggabble(x, y);
}
public Droppable findDroppable(int x, int y)
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -24,9 +24,13 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.Element;
import java.util.Map;
+import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
+import org.jboss.portal.presentation.ajax.client.dnd.Droppable;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -37,6 +41,41 @@
/** . */
private VerticalPanel widget;
+ /** . */
+ private Draggable draggable = new Draggable()
+ {
+ public Element getContainer()
+ {
+ return widget.getElement();
+ }
+
+ public void startDragging()
+ {
+ widget.addStyleName("dnd-dragged");
+ }
+
+ public void stopDragging()
+ {
+ widget.removeStyleName("dnd-dragged");
+ }
+
+ public void enter(Droppable droppable)
+ {
+ }
+
+ public void leave(Droppable droppable)
+ {
+ }
+
+ public void accepted(Droppable droppable)
+ {
+ }
+
+ public void rejected(Droppable droppable)
+ {
+ }
+ };
+
public AjaxPane(String id, Map properties)
{
super(id, properties);
@@ -51,6 +90,23 @@
this.widget = widget;
}
+ protected Draggable doFindDraggable(int x, int y)
+ {
+// int left = widget.getAbsoluteLeft();
+// int right = left + widget.getOffsetWidth();
+// int top = widget.getAbsoluteTop();
+// int bottom = top + widget.getOffsetHeight();
+// if (x >= left && x <= right && y >= top && y <= bottom)
+// {
+// return draggable;
+// }
+// else
+// {
+// return null;
+// }
+ return null;
+ }
+
protected void doRefresh(boolean force)
{
doRefresh(widget);
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -127,9 +127,13 @@
draggable = new DraggableWindow(this);
}
- protected Draggable doFindDraggable(Element element)
+ protected Draggable doFindDraggable(int x, int y)
{
- if (title.getElement() == element)
+ int left = title.getAbsoluteLeft();
+ int right = left + title.getOffsetWidth();
+ int top = title.getAbsoluteTop();
+ int bottom = top + title.getOffsetHeight();
+ if (x >= left && x <= right && y >= top && y <= bottom)
{
return draggable;
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/MoveObjectAction.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/MoveObjectAction.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/MoveObjectAction.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -64,4 +64,9 @@
{
this.destinationId = destinationId;
}
+
+ public String toString()
+ {
+ return "MoveObjectAction[sourceId=" + sourceId + ",destinationId=" + destinationId + "]";
+ }
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css 2008-07-09 19:16:21 UTC (rev 11384)
@@ -27,6 +27,10 @@
padding: 1px;
}
+.pf-Pane.dnd-dragged {
+background-color: green;
+}
+
.pf-Window {
border: 1px solid black;
padding: 1px;
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-07-09 19:06:06 UTC (rev 11383)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-07-09 19:16:21 UTC (rev 11384)
@@ -70,7 +70,7 @@
private LayoutStore layoutStore;
/** . */
- private StructuralAdapter structuralAdapter;
+ private StructuralAdapter<Object> structuralAdapter;
/** . */
private StructuralStateContext structuralStateContext;
@@ -80,7 +80,7 @@
public PresentationServerImpl(
PortalNodeManager portalNodeManager,
- StructuralAdapter structuralAdapter,
+ StructuralAdapter<Object> structuralAdapter,
StructuralStateContext structuralStateContext,
ContentHandlerRegistry contentHandlerRegistry,
LayoutStore layoutStore)
@@ -204,9 +204,20 @@
MoveUIObjectAction moveAction = (MoveUIObjectAction)objectAction;
//
- LayoutStructure destinationElt = (LayoutStructure)structuralAdapter.getNode(moveAction.getDestinationId());
+ Object destination = structuralAdapter.getNode(moveAction.getDestinationId());
//
+ LayoutStructure destinationElt;
+ if (destination instanceof PortalNode)
+ {
+ destinationElt = (LayoutStructure)layoutStore.findElementByRef(((PortalNode)destination).getId());
+ }
+ else
+ {
+ destinationElt = (LayoutStructure)destination;
+ }
+
+ //
LayoutElement sourceElt = layoutStore.findElementByRef(targetNode.getId());
//
16 years, 3 months
JBoss Portal SVN: r11383 - in branches/JBoss_Portal_Branch_2_6/core-wsrp/src: resources/portal-wsrp-admin-war/WEB-INF/classes and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-09 15:06:06 -0400 (Wed, 09 Jul 2008)
New Revision: 11383
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producerTemplate.xhtml
Log:
- JBPORTAL-2064: Added feedback for producer configuration operations.
- Fixed improperly closed EL expression.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2008-07-09 19:04:36 UTC (rev 11382)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2008-07-09 19:06:06 UTC (rev 11383)
@@ -167,6 +167,7 @@
getRegRequirements().reloadPolicyFrom(policyClassName, validatorClassName);
}
configurationService.saveConfiguration();
+ beanContext.createInfoMessage("bean_producer_save_success");
}
catch (Exception e)
{
@@ -181,6 +182,7 @@
try
{
configurationService.reloadConfiguration();
+ beanContext.createInfoMessage("bean_producer_cancel_success");
}
catch (Exception e)
{
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 19:04:36 UTC (rev 11382)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 19:06:06 UTC (rev 11383)
@@ -21,7 +21,7 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
################################################################################
-## WSRP GUI localization
+## WSRP GUI localization
# JBoss Portal display information
org.jboss.portal.object.name.WSRPConfigurationPortlet = WSRP Configuration
@@ -79,7 +79,7 @@
edit_consumer_producer = Producer id:
edit_consumer_cache = Cache expiration:
edit_consumer_cache_seconds = (seconds before expiration)
-edit_consumer_endpoint = Endpoint configuration:
+edit_consumer_endpoint = Endpoint configuration:
edit_consumer_endpoint_wsdl = Use WSDL?
edit_consumer_endpoint_sd = Service Description URL:
edit_consumer_endpoint_m = Markup URL:
@@ -135,7 +135,7 @@
## Localized messages in JSF beans
bean_support_unexpected_error = An unexpected error occured:
-bean_support_cause = Cause:
+bean_support_cause = Cause:
# ConsumerBean
bean_consumer_cannot_find_consumer = Couldn't find consumer ''{0}''!
@@ -153,9 +153,11 @@
bean_consumermanager_refresh_bypassed = Refresh was not necessary.
bean_consumermanager_refresh_success = Refresh was successful.
bean_consumermanager_refresh_failure = Refresh failed (probably because the registration information was not valid).
-bean_consumermanager_refresh_exception = An unexpected error occurred.
+bean_consumermanager_refresh_exception = An unexpected error occurred.
# ProducerBean
bean_producer_regpolicy_unset = RegistrationPolicy unset
bean_producer_cannot_save = Couldn't save producer configuration. Cause: {0}
bean_producer_cannot_reload = Couldn't reload producer configuration. Cause: {0}
+bean_producer_save_success = Producer configuration successfully saved!
+bean_producer_cancel_success = All modifications made to the producer configuration have been cancelled!
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 19:04:36 UTC (rev 11382)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 19:06:06 UTC (rev 11383)
@@ -130,4 +130,6 @@
bean_consumermanager_refresh_bypassed=Le rafra\u00eechissement n'\u00e9tait pas requis.
bean_consumermanager_refresh_exception=Une erreur inattendue s'est produite.
bean_consumermanager_refresh_failure=Le rafra\u00eechissement a \u00e9chou\u00e9 (probablement \u00e0 cause d'informations d'enregistrement non valides)
-bean_consumermanager_refresh_success=Le rafra\u00eechissement a r\u00e9ussi.
\ No newline at end of file
+bean_consumermanager_refresh_success=Le rafra\u00eechissement a r\u00e9ussi.
+bean_producer_cancel_success=Toutes les modifications faites \u00e0 la configuration du producteur ont \u00e9t\u00e9 annull\u00e9es!
+bean_producer_save_success=La configuration du producteur a bien \u00e9t\u00e9 sauvegard\u00e9e!
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml 2008-07-09 19:04:36 UTC (rev 11382)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml 2008-07-09 19:06:06 UTC (rev 11383)
@@ -12,13 +12,13 @@
<div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
<h3>
- <h:outputFormat value="#{i18n.confirm_delete_registration_title">
+ <h:outputFormat value="#{i18n.confirm_delete_registration_title}">
<f:param value="#{consumer.id}"/>
</h:outputFormat>
</h3>
<p class="portlet-msg-alert">
- <h:outputFormat value="#{i18n.confirm_delete_registration_message">
+ <h:outputFormat value="#{i18n.confirm_delete_registration_message}">
<f:param value="#{consumer.id}"/>
</h:outputFormat>
</p>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producerTemplate.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producerTemplate.xhtml 2008-07-09 19:04:36 UTC (rev 11382)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producerTemplate.xhtml 2008-07-09 19:06:06 UTC (rev 11383)
@@ -17,4 +17,4 @@
</ui:define>
<ui:define name="objectpath"/>
-</ui:decorate>
+</ui:decorate>
\ No newline at end of file
16 years, 3 months
JBoss Portal SVN: r11382 - in branches/JBoss_Portal_Branch_2_7/core-wsrp/src: resources/portal-wsrp-admin-war/WEB-INF/classes and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-07-09 15:04:36 -0400 (Wed, 09 Jul 2008)
New Revision: 11382
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/confirmEraseRegistration.xhtml
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producerTemplate.xhtml
Log:
- JBPORTAL-2064: Added feedback for producer configuration operations.
- Fixed improperly closed EL expression.
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2008-07-09 18:50:28 UTC (rev 11381)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2008-07-09 19:04:36 UTC (rev 11382)
@@ -177,6 +177,7 @@
getRegRequirements().reloadPolicyFrom(policyClassName, validatorClassName);
}
configurationService.saveConfiguration();
+ beanContext.createInfoMessage("bean_producer_save_success");
}
catch (Exception e)
{
@@ -191,6 +192,7 @@
try
{
configurationService.reloadConfiguration();
+ beanContext.createInfoMessage("bean_producer_cancel_success");
}
catch (Exception e)
{
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 18:50:28 UTC (rev 11381)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource.properties 2008-07-09 19:04:36 UTC (rev 11382)
@@ -135,7 +135,7 @@
## Localized messages in JSF beans
bean_support_unexpected_error = An unexpected error occured:
-bean_support_cause = Cause:
+bean_support_cause = Cause:
# ConsumerBean
bean_consumer_cannot_find_consumer = Couldn't find consumer ''{0}''!
@@ -153,9 +153,11 @@
bean_consumermanager_refresh_bypassed = Refresh was not necessary.
bean_consumermanager_refresh_success = Refresh was successful.
bean_consumermanager_refresh_failure = Refresh failed (probably because the registration information was not valid).
-bean_consumermanager_refresh_exception = An unexpected error occurred.
+bean_consumermanager_refresh_exception = An unexpected error occurred.
# ProducerBean
bean_producer_regpolicy_unset = RegistrationPolicy unset
bean_producer_cannot_save = Couldn't save producer configuration. Cause: {0}
-bean_producer_cannot_reload = Couldn't reload producer configuration. Cause: {0}
\ No newline at end of file
+bean_producer_cannot_reload = Couldn't reload producer configuration. Cause: {0}
+bean_producer_save_success = Producer configuration successfully saved!
+bean_producer_cancel_success = All modifications made to the producer configuration have been cancelled!
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 18:50:28 UTC (rev 11381)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/WSRPConfigurationResource_fr.properties 2008-07-09 19:04:36 UTC (rev 11382)
@@ -130,4 +130,6 @@
bean_consumermanager_refresh_bypassed=Le rafra\u00eechissement n'\u00e9tait pas requis.
bean_consumermanager_refresh_exception=Une erreur inattendue s'est produite.
bean_consumermanager_refresh_failure=Le rafra\u00eechissement a \u00e9chou\u00e9 (probablement \u00e0 cause d'informations d'enregistrement non valides)
-bean_consumermanager_refresh_success=Le rafra\u00eechissement a r\u00e9ussi.
\ No newline at end of file
+bean_consumermanager_refresh_success=Le rafra\u00eechissement a r\u00e9ussi.
+bean_producer_cancel_success=Toutes les modifications faites \u00e0 la configuration du producteur ont \u00e9t\u00e9 annull\u00e9es!
+bean_producer_save_success=La configuration du producteur a bien \u00e9t\u00e9 sauvegard\u00e9e!
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/confirmEraseRegistration.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/confirmEraseRegistration.xhtml 2008-07-09 18:50:28 UTC (rev 11381)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/confirmEraseRegistration.xhtml 2008-07-09 19:04:36 UTC (rev 11382)
@@ -12,13 +12,13 @@
<div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
<h3>
- <h:outputFormat value="#{i18n.confirm_delete_registration_title">
+ <h:outputFormat value="#{i18n.confirm_delete_registration_title}">
<f:param value="#{consumer.id}"/>
</h:outputFormat>
</h3>
<p class="portlet-msg-alert">
- <h:outputFormat value="#{i18n.confirm_delete_registration_message">
+ <h:outputFormat value="#{i18n.confirm_delete_registration_message}">
<f:param value="#{consumer.id}"/>
</h:outputFormat>
</p>
@@ -26,7 +26,8 @@
<p class="portlet-class">#{i18n.confirm_delete_registration_proceed}</p>
<h:form>
- <h:commandButton value="#{i18n.confirm_delete_registration_submit}" action="#{consumer.eraseLocalRegistration}"
+ <h:commandButton value="#{i18n.confirm_delete_registration_submit}"
+ action="#{consumer.eraseLocalRegistration}"
styleClass="portlet-form-button portlet-section-buttonrow"/>
<h:commandButton value="#{i18n.confirm_delete_registration_cancel}" action="configureConsumer"
styleClass="portlet-form-button portlet-section-buttonrow"/>
@@ -36,4 +37,4 @@
</ui:define>
-</ui:decorate>
\ No newline at end of file
+</ui:decorate>
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producerTemplate.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producerTemplate.xhtml 2008-07-09 18:50:28 UTC (rev 11381)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producerTemplate.xhtml 2008-07-09 19:04:36 UTC (rev 11382)
@@ -10,7 +10,7 @@
<li><h:commandLink action="consumers" value="#{i18n.nav_tabs_consumers}"/></li>
<li id="currentTab">#{i18n.nav_tabs_producer_config}</li>
<ui:remove>
- <li><h:commandLink value="#{i18n.nav_tabs_producer_management}" action="management"/></li>
+ <li><h:commandLink value="#{i18n.nav_tabs_producer_management}" action="management"/></li>
</ui:remove>
</ul>
</h:form>
16 years, 3 months
JBoss Portal SVN: r11381 - branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-07-09 14:50:28 -0400 (Wed, 09 Jul 2008)
New Revision: 11381
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml
Log:
a little dot notation magic
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml 2008-07-09 18:35:06 UTC (rev 11380)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml 2008-07-09 18:50:28 UTC (rev 11381)
@@ -142,6 +142,16 @@
rendered="#{prop.determinedInvalid}"/>
</td>
</tr>
+ <c:forEach var="prop" items="#{consumer.expectedRegistrationInfo.registrationProperties}">
+ <tr title="#{prop.value.description.label.value}">
+ <td>#{prop.value.name}</td>
+ <td>#{prop.value.description.label.value}</td>
+ <td>
+ <h:inputText value="#{prop.value.value}" size="50"/>
+ <h:outputText styleClass="portlet-msg-error" value="#{prop.value.status}"
+ rendered="#{prop.value.determinedInvalid}"/></td>
+ </tr>
+ </c:forEach>
</table>
</c:when>
<c:otherwise>
16 years, 3 months
JBoss Portal SVN: r11380 - in branches/JBoss_Portal_Branch_2_7: core-admin/src/resources/portal-admin-war/WEB-INF and 5 other directories.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-07-09 14:35:06 -0400 (Wed, 09 Jul 2008)
New Revision: 11380
Added:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/common/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/management/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/
Removed:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/common/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/management/
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/
Modified:
branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
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-identity/src/resources/portal-identity-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
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/common/template.xhtml
Log:
moved wsrp xhtml outside WEB-INF, upgrade portlet bridge to beta3
Modified: branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-07-09 18:31:39 UTC (rev 11379)
+++ branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-07-09 18:35:06 UTC (rev 11380)
@@ -71,7 +71,7 @@
<componentref name="el" version="1.0"/>
<componentref name="facelets" version="1.1.15-B1"/>
<componentref name="richfaces" version="3.2.1.GA"/>
- <componentref name="jboss/portlet-bridge" version="1.0.0.B2"/>
+ <componentref name="jboss/portlet-bridge" version="1.0.0.B3"/>
<componentref name="hibernate" version="3.2.0.CR2"/>
<componentref name="httpunit" version="1.6"/>
<componentref name="hsqldb" version="1.8.0.2"/>
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-07-09 18:31:39 UTC (rev 11379)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-07-09 18:35:06 UTC (rev 11380)
@@ -31,6 +31,7 @@
<view-handler>
org.jboss.portletbridge.application.PortletViewHandler
</view-handler>
+ <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
<message-bundle>Resource</message-bundle>
<property-resolver>org.jboss.portal.core.admin.ui.AdminPropertyResolver</property-resolver>
<locale-config>
@@ -38,13 +39,7 @@
<supported-locale>it</supported-locale>
<supported-locale>de</supported-locale>
</locale-config>
-
</application>
- <factory>
- <faces-context-factory>
- org.jboss.portletbridge.context.FacesContextFactoryImpl
- </faces-context-factory>
- </factory>
<converter>
<converter-for-class>org.jboss.portal.core.model.content.ContentType</converter-for-class>
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2008-07-09 18:31:39 UTC (rev 11379)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2008-07-09 18:35:06 UTC (rev 11380)
@@ -34,6 +34,7 @@
<view-handler>
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>it</supported-locale>
@@ -41,13 +42,7 @@
</locale-config>
<message-bundle>conf.bundles.Identity</message-bundle>
</application>
- <factory>
- <faces-context-factory>
- org.jboss.portletbridge.context.FacesContextFactoryImpl
- </faces-context-factory>
- </factory>
-
-
+
<managed-bean>
<managed-bean-name>configurationbean</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.identity.ui.common.ConfigurationBean</managed-bean-class>
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-07-09 18:31:39 UTC (rev 11379)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2008-07-09 18:35:06 UTC (rev 11380)
@@ -33,12 +33,8 @@
<view-handler>
org.jboss.portletbridge.application.PortletViewHandler
</view-handler>
+ <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
</application>
- <factory>
- <faces-context-factory>
- org.jboss.portletbridge.context.FacesContextFactoryImpl
- </faces-context-factory>
- </factory>
<converter>
<converter-for-class>org.jboss.portal.wsrp.registration.LocalizedString</converter-for-class>
@@ -111,31 +107,31 @@
<navigation-rule>
<navigation-case>
<from-outcome>consumers</from-outcome>
- <to-view-id>/WEB-INF/jsf/consumers/consumers.xhtml</to-view-id>
+ <to-view-id>/jsf/consumers/consumers.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>configureConsumer</from-outcome>
- <to-view-id>/WEB-INF/jsf/consumers/editConsumer.xhtml</to-view-id>
+ <to-view-id>/jsf/consumers/editConsumer.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>producer</from-outcome>
- <to-view-id>/WEB-INF/jsf/producer/producer.xhtml</to-view-id>
+ <to-view-id>/jsf/producer/producer.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>confirmPropDeletion</from-outcome>
- <to-view-id>/WEB-INF/jsf/producer/confirmPropDeletion.xhtml</to-view-id>
+ <to-view-id>/jsf/producer/confirmPropDeletion.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>confirmEraseRegistration</from-outcome>
- <to-view-id>/WEB-INF/jsf/consumers/confirmEraseRegistration.xhtml</to-view-id>
+ <to-view-id>/jsf/consumers/confirmEraseRegistration.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>confirmDeleteConsumer</from-outcome>
- <to-view-id>/WEB-INF/jsf/consumers/confirmDeleteConsumer.xhtml</to-view-id>
+ <to-view-id>/jsf/consumers/confirmDeleteConsumer.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>management</from-outcome>
- <to-view-id>/WEB-INF/jsf/management/management.xhtml</to-view-id>
+ <to-view-id>/jsf/management/management.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml 2008-07-09 18:31:39 UTC (rev 11379)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml 2008-07-09 18:35:06 UTC (rev 11380)
@@ -32,7 +32,7 @@
<portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
<init-param>
<name>javax.portlet.faces.defaultViewId.view</name>
- <value>/WEB-INF/jsf/consumers/consumers.xhtml</value>
+ <value>/jsf/consumers/consumers.xhtml</value>
</init-param>
<init-param>
<name>javax.portlet.faces.preserveActionParams</name>
Copied: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf (from rev 11353, branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf)
Copied: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/common (from rev 11373, branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/common)
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/common/template.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/common/template.xhtml 2008-07-09 16:35:12 UTC (rev 11373)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/common/template.xhtml 2008-07-09 18:35:06 UTC (rev 11380)
@@ -16,7 +16,7 @@
</c:if>
<!-- Status message -->
- <h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ <h:messages id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<!-- Content -->
Copied: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers (from rev 11373, branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers)
Copied: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/management (from rev 11373, branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/management)
Copied: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer (from rev 11373, branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer)
16 years, 3 months