JBoss Portal SVN: r11339 - in modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client: model and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-07 19:03:03 -0400 (Mon, 07 Jul 2008)
New Revision: 11339
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/ElementListener.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/
Removed:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Appender.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/ElementListener.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Level.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Logger.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.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/AjaxWindow.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Appender.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/AppenderWidget.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Level.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Logger.java
Log:
rename o.j.p.presentation.ajax.client.utils to ....util
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -26,7 +26,7 @@
import org.jboss.portal.presentation.ajax.client.protocol.AjaxAction;
import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
-import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -25,31 +25,18 @@
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.i18n.client.DateTimeFormat;
import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
-import org.jboss.portal.presentation.ajax.client.utils.Bootstrap;
-import org.jboss.portal.presentation.ajax.client.utils.logging.Appender;
-import org.jboss.portal.presentation.ajax.client.utils.logging.Level;
-import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
-import org.jboss.portal.presentation.ajax.client.utils.logging.AppenderWidget;
+import org.jboss.portal.presentation.ajax.client.util.Bootstrap;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
+import org.jboss.portal.presentation.ajax.client.util.logging.AppenderWidget;
import java.util.Map;
import java.util.HashMap;
-import java.util.Date;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
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-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -37,7 +37,7 @@
import org.jboss.portal.presentation.ajax.client.model.update.UpdateObject;
import org.jboss.portal.presentation.ajax.client.model.update.RemoveChild;
import org.jboss.portal.presentation.ajax.client.model.update.RemoveObject;
-import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
import org.jboss.portal.presentation.ajax.client.AgentContext;
/**
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-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -38,8 +38,8 @@
import org.jboss.portal.presentation.ajax.client.PresentationClientRemote;
import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
import org.jboss.portal.presentation.ajax.client.protocol.DestroyObjectAction;
-import org.jboss.portal.presentation.ajax.client.utils.Tools;
-import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
+import org.jboss.portal.presentation.ajax.client.util.Tools;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
import java.util.Map;
import java.util.HashMap;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -31,7 +31,7 @@
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Element;
-import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util (from rev 11273, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils)
Deleted: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Appender.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Appender.java 2008-07-02 22:14:58 UTC (rev 11273)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Appender.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -1,36 +0,0 @@
-/******************************************************************************
- * 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.utils;
-
-import java.util.Date;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface Appender
-{
-
- void append(Level level, Date time, String category, String msg);
-
-}
Deleted: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java 2008-07-02 22:14:58 UTC (rev 11273)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -1,147 +0,0 @@
-/******************************************************************************
- * 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.utils;
-
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
-
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class Bootstrap
-{
-
- /** . */
- private static final Logger log = Logger.getLogger(Bootstrap.class);
-
- /** . */
- private static Bootstrap instance;
-
- public static void init()
- {
- if (instance == null)
- {
- instance = new Bootstrap();
- instance.perform();
- }
- }
-
- /** . */
- private ArrayList listeners;
-
- private Bootstrap()
- {
- listeners = new ArrayList();
- }
-
- private void perform()
- {
- JavaScriptObject overridenSubmit = getOverridenSubmitFunction();
-
- //
- patch(overridenSubmit);
- }
-
- public void addListener(ElementListener listener)
- {
- ArrayList copy = new ArrayList(listeners);
- copy.add(listener);
- listeners = copy;
- }
-
- private static void handle(Event event, Element element)
- {
- DOM.eventPreventDefault(event);
-
- //
- log.info("Element " + element + " clicked");
-
-// for (Iterator i = listeners.iterator();i.hasNext();)
-// {
-// ElementListener listener = (ElementListener)i.next();
-// listener.clicked(element);
-// }
- }
-
- private static void handle(Element element)
- {
- log.info("Element " + element + " clicked");
-// for (Iterator i = listeners.iterator();i.hasNext();)
-// {
-// ElementListener listener = (ElementListener)i.next();
-// listener.clicked(element);
-// }
- }
-
- /**
- * Returns the submit function of the HTMLFormElement javascript object.
- *
- * @return the submit function
- */
- public native JavaScriptObject getNativeSubmitFunction()
- /*-{
- return $wnd.HTMLFormElement.prototype.submit;
- }-*/;
-
- /**
- *
- * @return
- */
- public native JavaScriptObject getOverridenSubmitFunction()
- /*-{
- function overrideSubmit(event)
- {
- if(event != null)
- {
- // It is a browser submit event
- var target = event.target;
- @org.jboss.portal.presentation.ajax.client.utils.Bootstrap::handle(Lcom/google/gwt/user/client/Event;Lcom/google/gwt/user/client/Element;)(event,target);
- }
- else
- {
- // It is a programmatic submit
- @org.jboss.portal.presentation.ajax.client.utils.Bootstrap::handle(Lcom/google/gwt/user/client/Element;)(this);
- }
-
- //
- }
-
- //
- return overrideSubmit;
- }-*/;
-
- /**
- * @param overridenSubmit the patched submit
- */
- public native void patch(JavaScriptObject overridenSubmit)
- /*-{
- $wnd.HTMLFormElement.prototype.submit2 = $wnd.HTMLFormElement.prototype.submit;
- $wnd.HTMLFormElement.prototype.submit = overridenSubmit;
- }-*/;
-}
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java (from rev 11338, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java)
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Bootstrap.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -0,0 +1,148 @@
+/******************************************************************************
+ * 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.util;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+
+import java.util.ArrayList;
+
+import org.jboss.portal.presentation.ajax.client.util.logging.Logger;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class Bootstrap
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(Bootstrap.class);
+
+ /** . */
+ private static Bootstrap instance;
+
+ public static void init()
+ {
+ if (instance == null)
+ {
+ instance = new Bootstrap();
+ instance.perform();
+ }
+ }
+
+ /** . */
+ private ArrayList listeners;
+
+ private Bootstrap()
+ {
+ listeners = new ArrayList();
+ }
+
+ private void perform()
+ {
+ JavaScriptObject overridenSubmit = getOverridenSubmitFunction();
+
+ //
+ patch(overridenSubmit);
+ }
+
+ public void addListener(ElementListener listener)
+ {
+ ArrayList copy = new ArrayList(listeners);
+ copy.add(listener);
+ listeners = copy;
+ }
+
+ private static void handle(Event event, Element element)
+ {
+ DOM.eventPreventDefault(event);
+
+ //
+ log.info("Element " + element + " clicked");
+
+// for (Iterator i = listeners.iterator();i.hasNext();)
+// {
+// ElementListener listener = (ElementListener)i.next();
+// listener.clicked(element);
+// }
+ }
+
+ private static void handle(Element element)
+ {
+ log.info("Element " + element + " clicked");
+// for (Iterator i = listeners.iterator();i.hasNext();)
+// {
+// ElementListener listener = (ElementListener)i.next();
+// listener.clicked(element);
+// }
+ }
+
+ /**
+ * Returns the submit function of the HTMLFormElement javascript object.
+ *
+ * @return the submit function
+ */
+ public native JavaScriptObject getNativeSubmitFunction()
+ /*-{
+ return $wnd.HTMLFormElement.prototype.submit;
+ }-*/;
+
+ /**
+ *
+ * @return
+ */
+ public native JavaScriptObject getOverridenSubmitFunction()
+ /*-{
+ function overrideSubmit(event)
+ {
+ if(event != null)
+ {
+ // It is a browser submit event
+ var target = event.target;
+ @org.jboss.portal.presentation.ajax.client.util.Bootstrap::handle(Lcom/google/gwt/user/client/Event;Lcom/google/gwt/user/client/Element;)(event,target);
+ }
+ else
+ {
+ // It is a programmatic submit
+ @org.jboss.portal.presentation.ajax.client.util.Bootstrap::handle(Lcom/google/gwt/user/client/Element;)(this);
+ }
+
+ //
+ }
+
+ //
+ return overrideSubmit;
+ }-*/;
+
+ /**
+ * @param overridenSubmit the patched submit
+ */
+ public native void patch(JavaScriptObject overridenSubmit)
+ /*-{
+ $wnd.HTMLFormElement.prototype.submit2 = $wnd.HTMLFormElement.prototype.submit;
+ $wnd.HTMLFormElement.prototype.submit = overridenSubmit;
+ }-*/;
+}
Deleted: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/ElementListener.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/ElementListener.java 2008-07-02 22:14:58 UTC (rev 11273)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/ElementListener.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -1,34 +0,0 @@
-/******************************************************************************
- * 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.utils;
-
-import com.google.gwt.user.client.Element;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface ElementListener
-{
- void clicked(Element element);
-}
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/ElementListener.java (from rev 11338, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/ElementListener.java)
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/ElementListener.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/ElementListener.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.util;
+
+import com.google.gwt.user.client.Element;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ElementListener
+{
+ void clicked(Element element);
+}
Deleted: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Level.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Level.java 2008-07-02 22:14:58 UTC (rev 11273)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Level.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -1,65 +0,0 @@
-/******************************************************************************
- * 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.utils;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class Level
-{
-
- /** . */
- public static final Level TRACE = new Level("TRACE");
-
- /** . */
- public static final Level DEBUG = new Level("DEBUG");
-
- /** . */
- public static final Level INFO = new Level("INFO");
-
- /** . */
- public static final Level ERROR = new Level("ERROR");
-
- /** . */
- private final String name;
-
- /** . */
- private final String toString;
-
- private Level(String name)
- {
- this.name = name;
- this.toString = "[" + name + "]";
- }
-
- public String getName()
- {
- return name;
- }
-
- public String toString()
- {
- return toString;
- }
-}
Deleted: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Logger.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Logger.java 2008-07-02 22:14:58 UTC (rev 11273)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Logger.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -1,168 +0,0 @@
-/******************************************************************************
- * 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.utils;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Date;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public final class Logger
-{
-
- /** . */
- private static final String PREFIX = "org.jboss.portal.presentation.ajax.client.";
-
- /** . */
- private static final Map loggers = new HashMap();
-
- /** . */
- private static final Set appenders = new HashSet();
-
- /**
- * Returns a logger.
- *
- * @param category the logger category
- * @return the logger
- * @throws IllegalArgumentException if the clazz argument is null
- */
- public static Logger getLogger(String category) throws IllegalArgumentException
- {
- if (category == null)
- {
- throw new IllegalArgumentException("No null category accepted");
- }
-
- //
- Logger logger = (Logger)loggers.get(category);
-
- //
- if (logger == null)
- {
- loggers.put(category, logger = new Logger(category));
- }
-
- //
- return logger;
- }
-
- /**
- * Returns a logger.
- *
- * @param clazz the logger key
- * @return the logger
- * @throws IllegalArgumentException if the clazz argument is null
- */
- public static Logger getLogger(Class clazz) throws IllegalArgumentException
- {
- if (clazz == null)
- {
- throw new IllegalArgumentException("No null clazz accepted");
- }
-
- //
- String name = clazz.toString();
- name = name.substring("class ".length());
- if (name.startsWith(PREFIX))
- {
- name = name.substring(PREFIX.length());
- }
-
- //
- return getLogger(name);
- }
-
- public static void registerAppender(Appender appender)
- {
- if (appender == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- appenders.add(appender);
- }
-
- /** . */
- private final String category;
-
- private Logger(String category)
- {
- this.category = category;
- }
-
- public String getCategory()
- {
- return category;
- }
-
- public void log(Level level, String msg)
- {
- if (level == null)
- {
- throw new IllegalArgumentException("No null level");
- }
- if (msg == null)
- {
- throw new IllegalArgumentException("No null msg");
- }
-
- //
- Date now = new Date();
-
- //
- for (Iterator i = appenders.iterator();i.hasNext();)
- {
- Appender appender = (Appender)i.next();
-
- //
- appender.append(level, now, category, msg);
- }
- }
-
- public void info(String msg)
- {
- log(Level.INFO, msg);
- }
-
- public void error(String msg)
- {
- log(Level.ERROR, msg);
- }
-
- public void debug(String msg)
- {
- log(Level.DEBUG, msg);
- }
-
- public void trace(String msg)
- {
- log(Level.TRACE, msg);
- }
-}
Deleted: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Tools.java 2008-07-02 22:14:58 UTC (rev 11273)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -1,120 +0,0 @@
-/******************************************************************************
- * 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.utils;
-
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Window;
-
-import java.util.Map;
-
-/**
- * A collection of various utility methods.
- *
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class Tools
-{
-
- /**
- * Returns an element tag name.
- *
- * @param element the element to obtain the tag name from
- * @return the tag name value
- */
- public static native String getTagName(Element element)
- /*-{
- return element.nodeName;
- }-*/;
-
- /**
- * Serialize a form.
- */
- public static void serialize(Element element, Map map)
- {
- String tag = getTagName(element);
-
- //
- String value = null;
- if ("INPUT".equals(tag))
- {
- String type = DOM.getElementAttribute(element, "type").toLowerCase();
-
- //
- if ("checkbox".equals(type))
- {
- throw new UnsupportedOperationException("todo");
- }
- else if ("radio".equals(type))
- {
- throw new UnsupportedOperationException("todo");
- }
- else
- {
- value = DOM.getElementProperty(element, "value");
- }
- }
- else
- {
- for (int i = DOM.getChildCount(element) - 1;i >= 0;i--)
- {
- serialize(DOM.getChild(element, i), map);
- }
- }
-
- //
- if (value != null)
- {
- String name = DOM.getElementAttribute(element, "name");
-
- //
- if (name != null)
- {
- String disabled = DOM.getElementProperty(element, "disabled");
-
- //
- if (disabled == null || !disabled.trim().toCharArray().equals("true"))
- {
- String[] values = (String[])map.get(name);
-
- //
- if (values == null)
- {
- map.put(name, new String[]{value});
- }
- else
- {
- String[] tmp = new String[values.length + 1];
- for (int i = 0;i < values.length;i++)
- {
- tmp[i] = values[i];
- }
- tmp[values.length] = value;
- values = tmp;
- }
- }
- }
- }
- }
-}
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java (from rev 11338, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Tools.java)
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/Tools.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -0,0 +1,119 @@
+/******************************************************************************
+ * 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.util;
+
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.DOM;
+
+import java.util.Map;
+
+/**
+ * A collection of various utility methods.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class Tools
+{
+
+ /**
+ * Returns an element tag name.
+ *
+ * @param element the element to obtain the tag name from
+ * @return the tag name value
+ */
+ public static native String getTagName(Element element)
+ /*-{
+ return element.nodeName;
+ }-*/;
+
+ /**
+ * Serialize a form.
+ */
+ public static void serialize(Element element, Map map)
+ {
+ String tag = getTagName(element);
+
+ //
+ String value = null;
+ if ("INPUT".equals(tag))
+ {
+ String type = DOM.getElementAttribute(element, "type").toLowerCase();
+
+ //
+ if ("checkbox".equals(type))
+ {
+ throw new UnsupportedOperationException("todo");
+ }
+ else if ("radio".equals(type))
+ {
+ throw new UnsupportedOperationException("todo");
+ }
+ else
+ {
+ value = DOM.getElementProperty(element, "value");
+ }
+ }
+ else
+ {
+ for (int i = DOM.getChildCount(element) - 1;i >= 0;i--)
+ {
+ serialize(DOM.getChild(element, i), map);
+ }
+ }
+
+ //
+ if (value != null)
+ {
+ String name = DOM.getElementAttribute(element, "name");
+
+ //
+ if (name != null)
+ {
+ String disabled = DOM.getElementProperty(element, "disabled");
+
+ //
+ if (disabled == null || !disabled.trim().toCharArray().equals("true"))
+ {
+ String[] values = (String[])map.get(name);
+
+ //
+ if (values == null)
+ {
+ map.put(name, new String[]{value});
+ }
+ else
+ {
+ String[] tmp = new String[values.length + 1];
+ for (int i = 0;i < values.length;i++)
+ {
+ tmp[i] = values[i];
+ }
+ tmp[values.length] = value;
+ values = tmp;
+ }
+ }
+ }
+ }
+ }
+}
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging (from rev 11338, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging)
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Appender.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Appender.java 2008-07-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Appender.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -20,7 +20,7 @@
* 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.utils.logging;
+package org.jboss.portal.presentation.ajax.client.util.logging;
import java.util.Date;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/AppenderWidget.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/AppenderWidget.java 2008-07-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/AppenderWidget.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -20,7 +20,7 @@
* 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.utils.logging;
+package org.jboss.portal.presentation.ajax.client.util.logging;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.ChangeListener;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Level.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Level.java 2008-07-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Level.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -20,7 +20,7 @@
* 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.utils.logging;
+package org.jboss.portal.presentation.ajax.client.util.logging;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Logger.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Logger.java 2008-07-07 23:01:21 UTC (rev 11338)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/util/logging/Logger.java 2008-07-07 23:03:03 UTC (rev 11339)
@@ -20,7 +20,7 @@
* 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.utils.logging;
+package org.jboss.portal.presentation.ajax.client.util.logging;
import java.util.Map;
import java.util.HashMap;
16 years
JBoss Portal SVN: r11338 - in modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client: model and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-07 19:01:21 -0400 (Mon, 07 Jul 2008)
New Revision: 11338
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Appender.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/AppenderWidget.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Level.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Logger.java
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.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/AjaxWindow.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java
Log:
move the appender widget inner class as an AppenderWidget class
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07 22:56:19 UTC (rev 11337)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -26,9 +26,7 @@
import org.jboss.portal.presentation.ajax.client.protocol.AjaxAction;
import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
-import org.jboss.portal.presentation.ajax.client.utils.Logger;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 22:56:19 UTC (rev 11337)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -42,9 +42,10 @@
import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
import org.jboss.portal.presentation.ajax.client.utils.Bootstrap;
-import org.jboss.portal.presentation.ajax.client.utils.Appender;
-import org.jboss.portal.presentation.ajax.client.utils.Level;
-import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Appender;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Level;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
+import org.jboss.portal.presentation.ajax.client.utils.logging.AppenderWidget;
import java.util.Map;
import java.util.HashMap;
@@ -79,7 +80,7 @@
RootPanel.get().add(main);
//
- SimpleAppender appender = new SimpleAppender();
+ AppenderWidget appender = new AppenderWidget();
main.add(appender);
Logger.registerAppender(appender);
log.info("Added logger");
@@ -133,130 +134,4 @@
//
proxy.ping(callback);
}
-
- private static class SimpleAppender extends VerticalPanel implements Appender, ChangeListener, ClickListener
- {
-
- // width:auto; height:100px; overflow:hidden;
-
- /** . */
- private static final Level[] levels = {Level.ERROR, Level.INFO, Level.DEBUG, Level.TRACE};
-
- /** . */
- private FlowPanel content;
-
- /** . */
- private HorizontalPanel controls;
-
- /** . */
- private ListBox levelBox;
-
- /** . */
- private Button clearButton;
-
- /** . */
- private Element topContainer;
-
- /** . */
- private Element childrenContainer;
-
- /** . */
- private DateTimeFormat format;
-
- /** . */
- private Level currentLevel = Level.INFO;
-
- private SimpleAppender()
- {
- controls = new HorizontalPanel();
- clearButton = new Button("Clear");
- levelBox = new ListBox();
- content = new FlowPanel();
- topContainer = content.getElement();
- childrenContainer = DOM.createDiv();
- format = DateTimeFormat.getFormat("HH:mm:ss:SSSS");
-
- //
- for (int i = 0;i < levels.length;i++)
- {
- levelBox.addItem(levels[i].getName());
- }
- levelBox.addChangeListener(this);
- levelBox.setSelectedIndex(1); // INFO
-
- //
- clearButton.addClickListener(this);
-
- //
- controls.add(levelBox);
- controls.add(clearButton);
-
- //
- DOM.appendChild(topContainer, childrenContainer);
-
- //
- add(controls);
- add(content);
-
- //
- // DOM.setStyleAttribute(container, "width", "auto");
- DOM.setStyleAttribute(topContainer, "height", "128px");
- DOM.setStyleAttribute(topContainer, "overflow", "scroll");
-
- //
- setStylePrimaryName("log");
- }
-
- public void onChange(Widget widget)
- {
- if (widget == levelBox)
- {
- currentLevel = levels[levelBox.getSelectedIndex()];
- }
- }
-
- public void onClick(Widget widget)
- {
- if (widget == clearButton)
- {
- clear();
- }
- }
-
- public void append(Level level, Date time, String category, String msg)
- {
- if (currentLevel.implies(level))
- {
- Element div = DOM.createDiv();
-
- //
- DOM.setInnerHTML(div, level + " " + format.format(time) + " " + category + " " + msg);
-
- //
- DOM.appendChild(childrenContainer, div);
- DOM.setElementProperty(div, "className", "log-" + currentLevel.getName());
-
- //
- autoscroll();
- }
- }
-
- public void clear()
- {
- DOM.removeChild(topContainer, childrenContainer);
- childrenContainer = DOM.createDiv();
- DOM.appendChild(topContainer, childrenContainer);
- autoscroll();
- }
-
- /**
- * Autoscroll to bottom
- */
- private void autoscroll()
- {
- String height = DOM.getElementProperty(topContainer, "scrollHeight");
- DOM.setElementProperty(topContainer, "scrollTop", height);
- }
-
- }
}
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-07 22:56:19 UTC (rev 11337)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -37,7 +37,7 @@
import org.jboss.portal.presentation.ajax.client.model.update.UpdateObject;
import org.jboss.portal.presentation.ajax.client.model.update.RemoveChild;
import org.jboss.portal.presentation.ajax.client.model.update.RemoveObject;
-import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
import org.jboss.portal.presentation.ajax.client.AgentContext;
/**
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-07 22:56:19 UTC (rev 11337)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -39,7 +39,7 @@
import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
import org.jboss.portal.presentation.ajax.client.protocol.DestroyObjectAction;
import org.jboss.portal.presentation.ajax.client.utils.Tools;
-import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
import java.util.Map;
import java.util.HashMap;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 22:56:19 UTC (rev 11337)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -22,9 +22,6 @@
******************************************************************************/
package org.jboss.portal.presentation.ajax.client.model;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
@@ -34,7 +31,7 @@
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Element;
-import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java 2008-07-07 22:56:19 UTC (rev 11337)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -26,10 +26,11 @@
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
import java.util.ArrayList;
+import org.jboss.portal.presentation.ajax.client.utils.logging.Logger;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Appender.java (from rev 11273, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Appender.java)
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Appender.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Appender.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * 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.utils.logging;
+
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface Appender
+{
+
+ void append(Level level, Date time, String category, String msg);
+
+}
Added: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/AppenderWidget.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/AppenderWidget.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/AppenderWidget.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -0,0 +1,165 @@
+/******************************************************************************
+ * 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.utils.logging;
+
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.ListBox;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.i18n.client.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AppenderWidget extends VerticalPanel implements Appender, ChangeListener, ClickListener
+{
+ // width:auto; height:100px; overflow:hidden;
+
+ /** . */
+ private static final Level[] levels = {Level.ERROR, Level.INFO, Level.DEBUG, Level.TRACE};
+
+ /** . */
+ private FlowPanel content;
+
+ /** . */
+ private HorizontalPanel controls;
+
+ /** . */
+ private ListBox levelBox;
+
+ /** . */
+ private Button clearButton;
+
+ /** . */
+ private Element topContainer;
+
+ /** . */
+ private Element childrenContainer;
+
+ /** . */
+ private DateTimeFormat format;
+
+ /** . */
+ private Level currentLevel = Level.INFO;
+
+ public AppenderWidget()
+ {
+ controls = new HorizontalPanel();
+ clearButton = new Button("Clear");
+ levelBox = new ListBox();
+ content = new FlowPanel();
+ topContainer = content.getElement();
+ childrenContainer = DOM.createDiv();
+ format = DateTimeFormat.getFormat("HH:mm:ss:SSSS");
+
+ //
+ for (int i = 0;i < levels.length;i++)
+ {
+ levelBox.addItem(levels[i].getName());
+ }
+ levelBox.addChangeListener(this);
+ levelBox.setSelectedIndex(1); // INFO
+
+ //
+ clearButton.addClickListener(this);
+
+ //
+ controls.add(levelBox);
+ controls.add(clearButton);
+
+ //
+ DOM.appendChild(topContainer, childrenContainer);
+
+ //
+ add(controls);
+ add(content);
+
+ //
+ // DOM.setStyleAttribute(container, "width", "auto");
+ DOM.setStyleAttribute(topContainer, "height", "128px");
+ DOM.setStyleAttribute(topContainer, "overflow", "scroll");
+
+ //
+ setStylePrimaryName("log");
+ }
+
+ public void onChange(Widget widget)
+ {
+ if (widget == levelBox)
+ {
+ currentLevel = levels[levelBox.getSelectedIndex()];
+ }
+ }
+
+ public void onClick(Widget widget)
+ {
+ if (widget == clearButton)
+ {
+ clear();
+ }
+ }
+
+ public void append(Level level, Date time, String category, String msg)
+ {
+ if (currentLevel.implies(level))
+ {
+ Element div = DOM.createDiv();
+
+ //
+ DOM.setInnerHTML(div, level + " " + format.format(time) + " " + category + " " + msg);
+
+ //
+ DOM.appendChild(childrenContainer, div);
+ DOM.setElementProperty(div, "className", "log-" + currentLevel.getName());
+
+ //
+ autoscroll();
+ }
+ }
+
+ public void clear()
+ {
+ DOM.removeChild(topContainer, childrenContainer);
+ childrenContainer = DOM.createDiv();
+ DOM.appendChild(topContainer, childrenContainer);
+ autoscroll();
+ }
+
+ /**
+ * Autoscroll to bottom
+ */
+ private void autoscroll()
+ {
+ String height = DOM.getElementProperty(topContainer, "scrollHeight");
+ DOM.setElementProperty(topContainer, "scrollTop", height);
+ }
+}
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Level.java (from rev 11337, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Level.java)
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Level.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Level.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.utils.logging;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class Level
+{
+
+ /** . */
+ public static final Level TRACE = new Level(3, "TRACE");
+
+ /** . */
+ public static final Level DEBUG = new Level(2, "DEBUG");
+
+ /** . */
+ public static final Level INFO = new Level(1, "INFO");
+
+ /** . */
+ public static final Level ERROR = new Level(0, "ERROR");
+
+ /** . */
+ private final int index;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final String toString;
+
+ private Level(int index, String name)
+ {
+ this.index = index;
+ this.name = name;
+ this.toString = "[" + name + "]";
+ }
+
+ public boolean implies(Level other)
+ {
+ if (other == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ return index >= other.index;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String toString()
+ {
+ return toString;
+ }
+}
Copied: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Logger.java (from rev 11273, modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Logger.java)
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Logger.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/logging/Logger.java 2008-07-07 23:01:21 UTC (rev 11338)
@@ -0,0 +1,168 @@
+/******************************************************************************
+ * 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.utils.logging;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public final class Logger
+{
+
+ /** . */
+ private static final String PREFIX = "org.jboss.portal.presentation.ajax.client.";
+
+ /** . */
+ private static final Map loggers = new HashMap();
+
+ /** . */
+ private static final Set appenders = new HashSet();
+
+ /**
+ * Returns a logger.
+ *
+ * @param category the logger category
+ * @return the logger
+ * @throws IllegalArgumentException if the clazz argument is null
+ */
+ public static Logger getLogger(String category) throws IllegalArgumentException
+ {
+ if (category == null)
+ {
+ throw new IllegalArgumentException("No null category accepted");
+ }
+
+ //
+ Logger logger = (Logger)loggers.get(category);
+
+ //
+ if (logger == null)
+ {
+ loggers.put(category, logger = new Logger(category));
+ }
+
+ //
+ return logger;
+ }
+
+ /**
+ * Returns a logger.
+ *
+ * @param clazz the logger key
+ * @return the logger
+ * @throws IllegalArgumentException if the clazz argument is null
+ */
+ public static Logger getLogger(Class clazz) throws IllegalArgumentException
+ {
+ if (clazz == null)
+ {
+ throw new IllegalArgumentException("No null clazz accepted");
+ }
+
+ //
+ String name = clazz.toString();
+ name = name.substring("class ".length());
+ if (name.startsWith(PREFIX))
+ {
+ name = name.substring(PREFIX.length());
+ }
+
+ //
+ return getLogger(name);
+ }
+
+ public static void registerAppender(Appender appender)
+ {
+ if (appender == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ appenders.add(appender);
+ }
+
+ /** . */
+ private final String category;
+
+ private Logger(String category)
+ {
+ this.category = category;
+ }
+
+ public String getCategory()
+ {
+ return category;
+ }
+
+ public void log(Level level, String msg)
+ {
+ if (level == null)
+ {
+ throw new IllegalArgumentException("No null level");
+ }
+ if (msg == null)
+ {
+ throw new IllegalArgumentException("No null msg");
+ }
+
+ //
+ Date now = new Date();
+
+ //
+ for (Iterator i = appenders.iterator();i.hasNext();)
+ {
+ Appender appender = (Appender)i.next();
+
+ //
+ appender.append(level, now, category, msg);
+ }
+ }
+
+ public void info(String msg)
+ {
+ log(Level.INFO, msg);
+ }
+
+ public void error(String msg)
+ {
+ log(Level.ERROR, msg);
+ }
+
+ public void debug(String msg)
+ {
+ log(Level.DEBUG, msg);
+ }
+
+ public void trace(String msg)
+ {
+ log(Level.TRACE, msg);
+ }
+}
16 years
JBoss Portal SVN: r11337 - 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-07 18:56:19 -0400 (Mon, 07 Jul 2008)
New Revision: 11337
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.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/MetaWidget.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/DestroyObjectAction.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Level.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css
Log:
improve logging it was starting to become a mess to follow
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07 22:56:19 UTC (rev 11337)
@@ -53,6 +53,9 @@
request.setAction(action);
//
+ log.info("About to perform action " + action);
+
+ //
agent.getProxy().process(request, new AsyncCallback()
{
public void onFailure(Throwable throwable)
@@ -74,12 +77,12 @@
//
if (stale != null)
{
- log.info("Going to refresh object " + staleObject);
+ log.debug("Going to refresh object " + staleObject);
stale.refresh(true);
}
else
{
- log.info("No stale object for " + staleObject);
+ log.debug("No stale object for " + staleObject);
}
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 22:56:19 UTC (rev 11337)
@@ -28,6 +28,12 @@
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.ListBox;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
@@ -128,44 +134,129 @@
proxy.ping(callback);
}
- private static class SimpleAppender extends FlowPanel implements Appender
+ private static class SimpleAppender extends VerticalPanel implements Appender, ChangeListener, ClickListener
{
// width:auto; height:100px; overflow:hidden;
/** . */
- private Element container;
+ private static final Level[] levels = {Level.ERROR, Level.INFO, Level.DEBUG, Level.TRACE};
+ /** . */
+ private FlowPanel content;
+
+ /** . */
+ private HorizontalPanel controls;
+
+ /** . */
+ private ListBox levelBox;
+
+ /** . */
+ private Button clearButton;
+
+ /** . */
+ private Element topContainer;
+
+ /** . */
+ private Element childrenContainer;
+
+ /** . */
private DateTimeFormat format;
+ /** . */
+ private Level currentLevel = Level.INFO;
+
private SimpleAppender()
{
- container = getElement();
+ controls = new HorizontalPanel();
+ clearButton = new Button("Clear");
+ levelBox = new ListBox();
+ content = new FlowPanel();
+ topContainer = content.getElement();
+ childrenContainer = DOM.createDiv();
format = DateTimeFormat.getFormat("HH:mm:ss:SSSS");
//
+ for (int i = 0;i < levels.length;i++)
+ {
+ levelBox.addItem(levels[i].getName());
+ }
+ levelBox.addChangeListener(this);
+ levelBox.setSelectedIndex(1); // INFO
+
+ //
+ clearButton.addClickListener(this);
+
+ //
+ controls.add(levelBox);
+ controls.add(clearButton);
+
+ //
+ DOM.appendChild(topContainer, childrenContainer);
+
+ //
+ add(controls);
+ add(content);
+
+ //
// DOM.setStyleAttribute(container, "width", "auto");
- DOM.setStyleAttribute(container, "height", "128px");
- DOM.setStyleAttribute(container, "overflow", "scroll");
+ DOM.setStyleAttribute(topContainer, "height", "128px");
+ DOM.setStyleAttribute(topContainer, "overflow", "scroll");
//
setStylePrimaryName("log");
}
+ public void onChange(Widget widget)
+ {
+ if (widget == levelBox)
+ {
+ currentLevel = levels[levelBox.getSelectedIndex()];
+ }
+ }
+
+ public void onClick(Widget widget)
+ {
+ if (widget == clearButton)
+ {
+ clear();
+ }
+ }
+
public void append(Level level, Date time, String category, String msg)
{
- Element div = DOM.createDiv();
+ if (currentLevel.implies(level))
+ {
+ Element div = DOM.createDiv();
- //
- DOM.setInnerHTML(div, level + " " + format.format(time) + " " + category + " " + msg);
+ //
+ DOM.setInnerHTML(div, level + " " + format.format(time) + " " + category + " " + msg);
- //
- DOM.appendChild(container, div);
+ //
+ DOM.appendChild(childrenContainer, div);
+ DOM.setElementProperty(div, "className", "log-" + currentLevel.getName());
- // Autoscroll to bottom
- String height = DOM.getElementProperty(container, "scrollHeight");
- DOM.setElementProperty(container, "scrollTop", height);
+ //
+ autoscroll();
+ }
}
+
+ public void clear()
+ {
+ DOM.removeChild(topContainer, childrenContainer);
+ childrenContainer = DOM.createDiv();
+ DOM.appendChild(topContainer, childrenContainer);
+ autoscroll();
+ }
+
+ /**
+ * Autoscroll to bottom
+ */
+ private void autoscroll()
+ {
+ String height = DOM.getElementProperty(topContainer, "scrollHeight");
+ DOM.setElementProperty(topContainer, "scrollTop", height);
+ }
+
}
-
}
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-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-07 22:56:19 UTC (rev 11337)
@@ -114,13 +114,13 @@
//
if (stale || force)
{
- context.log.info("Starting refresh of object " + id);
+ context.log.debug("Starting refresh of object " + id);
//
doRefresh(force);
//
- context.log.info("Finished refresh of object " + id);
+ context.log.debug("Finished refresh of object " + id);
//
stale = false;
@@ -129,7 +129,7 @@
public final void refresh(boolean force)
{
- context.log.info("Requesting for" + (force ? " forced " : " ") + "refresh of object " + id);
+ context.log.debug("Requesting for" + (force ? " forced " : " ") + "refresh of object " + id);
//
refreshRecursive(force);
@@ -245,7 +245,7 @@
ModelUpdate update = updates[i];
//
- log.trace("Executing model update " + update);
+ log.debug("Executing model update " + update);
//
if (update instanceof AddObject)
@@ -324,7 +324,7 @@
parent.removeChild(child);
//
- log.info("Child " + removeChild.getChildId() + " removed from parent " + removeChild.getParentId());
+ log.debug("Child " + removeChild.getChildId() + " removed from parent " + removeChild.getParentId());
}
else if (update instanceof RemoveObject)
{
@@ -346,7 +346,7 @@
object.destroyWidget();
//
- log.info("Destroyed object " + removeObject.getObjectId());
+ log.debug("Destroyed object " + removeObject.getObjectId());
}
}
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 22:56:19 UTC (rev 11337)
@@ -87,7 +87,7 @@
{
public void run()
{
- log.info("Creating popup widget");
+ log.trace("Creating popup widget");
VerticalPanel popup = new VerticalPanel();
@@ -114,16 +114,16 @@
}
};
timer.schedule(4000);
- log.info("Scheduling");
+ log.trace("Scheduling");
}
else
{
- log.info("Will not schedule because it is already scheduled");
+ log.trace("Will not schedule because it is already scheduled");
}
}
else
{
- log.info("Will not schedule because the from element is descendant");
+ log.trace("Will not schedule because the from element is descendant");
}
break;
case Event.ONMOUSEOUT:
@@ -132,17 +132,17 @@
{
if (timer != null)
{
- log.info("Unscheduling");
+ log.trace("Unscheduling");
timer.cancel();
- log.info("Timer cancelled");
+ log.trace("Timer cancelled");
if (popup != null)
{
remove(popup);
- log.info("Removed popup");
+ log.trace("Removed popup");
}
timer = null;
popup = null;
- log.info("Unscheduled");
+ log.trace("Unscheduled");
}
}
break;
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/DestroyObjectAction.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/DestroyObjectAction.java 2008-07-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/DestroyObjectAction.java 2008-07-07 22:56:19 UTC (rev 11337)
@@ -50,4 +50,9 @@
{
this.objectId = objectId;
}
+
+ public String toString()
+ {
+ return "DestroyObjectAction[objectId=" + objectId + "]";
+ }
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java 2008-07-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java 2008-07-07 22:56:19 UTC (rev 11337)
@@ -28,4 +28,8 @@
*/
public class RefreshAction extends AjaxAction
{
+ public String toString()
+ {
+ return "RefreshAction[]";
+ }
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Level.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Level.java 2008-07-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Level.java 2008-07-07 22:56:19 UTC (rev 11337)
@@ -30,29 +30,44 @@
{
/** . */
- public static final Level TRACE = new Level("TRACE");
+ public static final Level TRACE = new Level(3, "TRACE");
/** . */
- public static final Level DEBUG = new Level("DEBUG");
+ public static final Level DEBUG = new Level(2, "DEBUG");
/** . */
- public static final Level INFO = new Level("INFO");
+ public static final Level INFO = new Level(1, "INFO");
/** . */
- public static final Level ERROR = new Level("ERROR");
+ public static final Level ERROR = new Level(0, "ERROR");
/** . */
+ private final int index;
+
+ /** . */
private final String name;
/** . */
private final String toString;
- private Level(String name)
+ private Level(int index, String name)
{
+ this.index = index;
this.name = name;
this.toString = "[" + name + "]";
}
+ public boolean implies(Level other)
+ {
+ if (other == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ return index >= other.index;
+ }
+
public String getName()
{
return name;
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-07 22:14:53 UTC (rev 11336)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css 2008-07-07 22:56:19 UTC (rev 11337)
@@ -5,6 +5,22 @@
font-weight:bold;
}
+.log-ERROR {
+ color:red;
+}
+
+.log-INFO {
+ color:black;
+}
+
+.log-DEBUG {
+ color:gray;
+}
+
+.log-TRACE {
+ color:lightgray;
+}
+
.pf-Pane {
border: 1px solid black;
padding: 1px;
@@ -35,4 +51,4 @@
.pf-Pane {
border: 1px solid black;
padding: 1px;
-}
\ No newline at end of file
+}
16 years
JBoss Portal SVN: r11336 - in modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax: client/model and 4 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-07-07 18:14:53 -0400 (Mon, 07 Jul 2008)
New Revision: 11336
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.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/model/MetaWidget.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
Log:
have window close work in the ajax
Added: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java (rev 0)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/AgentContext.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxAction;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
+import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
+import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AgentContext
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(AgentContext.class);
+
+ /** . */
+ AjaxObject.Context objectContext;
+
+ /** . */
+ PresentationClientAgent agent;
+
+ public void process(AjaxAction action)
+ {
+ AjaxRequest request = new AjaxRequest();
+ request.setAction(action);
+
+ //
+ agent.getProxy().process(request, new AsyncCallback()
+ {
+ public void onFailure(Throwable throwable)
+ {
+ }
+
+ public void onSuccess(Object o)
+ {
+ AjaxResponse response = (AjaxResponse)o;
+
+ //
+ for (int i = 0; i < response.getStaleObjects().length; i++)
+ {
+ String staleObject = response.getStaleObjects()[i];
+
+ //
+ AjaxObject stale = objectContext.getObject(staleObject);
+
+ //
+ if (stale != null)
+ {
+ log.info("Going to refresh object " + staleObject);
+ stale.refresh(true);
+ }
+ else
+ {
+ log.info("No stale object for " + staleObject);
+ }
+ }
+
+ //
+ objectContext.update(response.getModelUpdates());
+
+ //
+ objectContext.getRoot().refresh(false);
+ }
+ });
+ }
+
+}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -58,8 +58,13 @@
private Map pages = new HashMap();
/** . */
- private PresentationClientRemoteAsync remote;
+ private PresentationClientRemoteAsync proxy;
+ PresentationClientRemoteAsync getProxy()
+ {
+ return proxy;
+ }
+
public void onModuleLoad()
{
VerticalPanel main = new VerticalPanel();
@@ -80,9 +85,9 @@
//
Bootstrap.init();
- // Initialize the remote service
- remote = (PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
- ServiceDefTarget endpoint = (ServiceDefTarget)remote;
+ // Initialize the proxy service
+ proxy = (PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
+ ServiceDefTarget endpoint = (ServiceDefTarget)proxy;
String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
endpoint.setServiceEntryPoint(moduleRelativeURL);
@@ -99,9 +104,16 @@
ModelUpdate[] updates = (ModelUpdate[])o;
//
- AjaxObject.Context context = new AjaxObject.Context();
+ AgentContext agentContext = new AgentContext();
+ agentContext.agent = PresentationClientAgent.this;
//
+ AjaxObject.Context context = new AjaxObject.Context(agentContext);
+
+ //
+ agentContext.objectContext = context;
+
+ //
context.update(updates);
//
@@ -113,7 +125,7 @@
};
//
- remote.ping(callback);
+ proxy.ping(callback);
}
private static class SimpleAppender extends FlowPanel implements Appender
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-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxLayout.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -115,4 +115,8 @@
protected void doAddChild(AjaxObject child)
{
}
+
+ protected void doRemoveChild(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-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -34,7 +34,11 @@
import org.jboss.portal.presentation.ajax.client.model.update.ObjectType;
import org.jboss.portal.presentation.ajax.client.model.update.CreateChildren;
import org.jboss.portal.presentation.ajax.client.model.update.AddChild;
+import org.jboss.portal.presentation.ajax.client.model.update.UpdateObject;
+import org.jboss.portal.presentation.ajax.client.model.update.RemoveChild;
+import org.jboss.portal.presentation.ajax.client.model.update.RemoveObject;
import org.jboss.portal.presentation.ajax.client.utils.Logger;
+import org.jboss.portal.presentation.ajax.client.AgentContext;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -97,17 +101,40 @@
}
}
- public final void refresh(boolean force)
+ private void refreshRecursive(boolean force)
{
+ for (Iterator i = getChildren().iterator();i.hasNext();)
+ {
+ AjaxObject child = (AjaxObject)i.next();
+
+ //
+ child.refreshRecursive(force);
+ }
+
+ //
if (stale || force)
{
+ context.log.info("Starting refresh of object " + id);
+
+ //
doRefresh(force);
//
+ context.log.info("Finished refresh of object " + id);
+
+ //
stale = false;
}
}
+ public final void refresh(boolean force)
+ {
+ context.log.info("Requesting for" + (force ? " forced " : " ") + "refresh of object " + id);
+
+ //
+ refreshRecursive(force);
+ }
+
private void addChild(AjaxObject child)
{
// Create relationship
@@ -121,6 +148,18 @@
stale = true;
}
+ public void removeChild(AjaxObject child)
+ {
+ doRemoveChild(child);
+
+ //
+ children.remove(child.getId());
+ child.parent = null;
+
+ //
+ stale = true;
+ }
+
public final boolean isStale()
{
return stale;
@@ -175,11 +214,20 @@
/** . */
private AjaxPage root;
- public Context()
+ /** . */
+ private final AgentContext agentContext;
+
+ public Context(AgentContext agentContext)
{
+ this.agentContext = agentContext;
this.objects = new HashMap();
}
+ public AgentContext getAgentContext()
+ {
+ return agentContext;
+ }
+
public AjaxObject getObject(String objectId)
{
return (AjaxObject)objects.get(objectId);
@@ -235,6 +283,21 @@
// We create the widget
object.createWidget();
}
+ else if (update instanceof UpdateObject)
+ {
+ UpdateObject updateObject = (UpdateObject)update;
+
+ //
+ AjaxObject object = (AjaxObject)objects.get(updateObject.getObjectId());
+
+ //
+ object.properties.keySet().removeAll(updateObject.getRemovedProperties());
+ object.properties.putAll(updateObject.getUpdatedProperties());
+ object.properties.putAll(updateObject.getAddedProperties());
+
+ //
+ object.stale = true;
+ }
else if (update instanceof CreateChildren)
{
}
@@ -249,10 +312,43 @@
//
parent.addChild(child);
}
+ else if (update instanceof RemoveChild)
+ {
+ RemoveChild removeChild = (RemoveChild)update;
+
+ //
+ AjaxObject parent = (AjaxObject)objects.get(removeChild.getParentId());
+ AjaxObject child = (AjaxObject)objects.get(removeChild.getChildId());
+
+ //
+ parent.removeChild(child);
+
+ //
+ log.info("Child " + removeChild.getChildId() + " removed from parent " + removeChild.getParentId());
+ }
+ else if (update instanceof RemoveObject)
+ {
+ RemoveObject removeObject = (RemoveObject)update;
+
+ //
+ AjaxObject object = (AjaxObject)objects.remove(removeObject.getObjectId());
+
+ //
+ if (object == null)
+ {
+ log.error("Cannot remove object " + removeObject.getObjectId() + " because it cannot be located");
+
+ //
+ throw new IllegalStateException();
+ }
+
+ //
+ object.destroyWidget();
+
+ //
+ log.info("Destroyed object " + removeObject.getObjectId());
+ }
}
-
- // We refresh the root
- root.refresh(false);
}
}
}
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-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -27,7 +27,6 @@
import com.google.gwt.user.client.ui.Widget;
import java.util.Map;
-import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -46,15 +45,6 @@
protected void doRefresh(boolean force)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
- {
- AjaxObject child = (AjaxObject)i.next();
-
- //
- child.refresh(force);
- }
-
- //
doRefresh(widget);
}
@@ -65,16 +55,17 @@
protected void doCreateWidget()
{
- Label title = new Label();
- title.setText("Page " + getId());
- title.setStyleName("pf-Title");
+ Label title = new Label("Page " + getId());
+ MetaWidget meta = new MetaWidget(this);
+ VerticalPanel widget = new VerticalPanel();
//
- VerticalPanel widget = new VerticalPanel();
- widget.setStyleName("pf-Page");
+ meta.add(title);
+ widget.add(meta);
//
- widget.add(title);
+ title.setStyleName("pf-Title");
+ widget.setStyleName("pf-Page");
//
this.widget = widget;
@@ -82,11 +73,6 @@
protected void doDestroyWidget()
{
- throw new UnsupportedOperationException();
+ widget = null;
}
-
- protected void doRemoveChild(AjaxObject child)
- {
- throw new UnsupportedOperationException();
- }
}
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-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -24,10 +24,8 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.Hyperlink;
import java.util.Map;
-import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -55,28 +53,14 @@
protected void doRefresh(boolean force)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
- {
- AjaxObject child = (AjaxObject)i.next();
-
- //
- child.refresh(force);
- }
-
- //
doRefresh(widget);
}
protected void doDestroyWidget()
{
- throw new UnsupportedOperationException();
+ widget = null;
}
- protected void doRemoveChild(AjaxObject child)
- {
- throw new UnsupportedOperationException();
- }
-
public Widget getWidget()
{
return 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-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -37,8 +37,6 @@
import org.jboss.portal.presentation.ajax.client.PresentationClientRemoteAsync;
import org.jboss.portal.presentation.ajax.client.PresentationClientRemote;
import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
-import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
-import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
import org.jboss.portal.presentation.ajax.client.protocol.DestroyObjectAction;
import org.jboss.portal.presentation.ajax.client.utils.Tools;
import org.jboss.portal.presentation.ajax.client.utils.Logger;
@@ -83,48 +81,12 @@
{
public void onClick(Widget widget)
{
- DestroyObjectAction action = new DestroyObjectAction(getId());
- AjaxRequest request = new AjaxRequest();
- request.setAction(action);
-
- //
- final PresentationClientRemoteAsync remote = (PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
- ServiceDefTarget endpoint = (ServiceDefTarget)remote;
- String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
- endpoint.setServiceEntryPoint(moduleRelativeURL);
-
- //
- remote.process(request, new AsyncCallback()
- {
- public void onFailure(Throwable throwable)
- {
- }
-
- public void onSuccess(Object o)
- {
- AjaxResponse response = (AjaxResponse)o;
-// for (int i = 0; i < response.getStaleObjects().length; i++)
-// {
-// String staleObject = response.getStaleObjects()[i];
-//
-// AjaxObject stale = getContext().getObject(staleObject);
-//
-// if (stale != null)
-// {
-// log.info("Going to refresh portlet window " + staleObject);
-// stale.refresh(true);
-// }
-// else
-// {
-// log.info("No stale window found for " + staleObject);
-// }
-//
-// }
- }
- });
+ getContext().getAgentContext().process(new DestroyObjectAction(getId()));
}
});
MetaWidget meta = new MetaWidget(this);
+
+ //
meta.add(title);
widget.add(meta);
widget.add(close);
@@ -239,48 +201,7 @@
if (windowAction != null)
{
log.info("About to execute window action " + windowAction);
-
- //
- final PresentationClientRemoteAsync remote = (PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
- ServiceDefTarget endpoint = (ServiceDefTarget)remote;
- String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
- endpoint.setServiceEntryPoint(moduleRelativeURL);
-
- //
- AjaxRequest request = new AjaxRequest();
- request.setAction(windowAction);
-
- //
- remote.process(request, new AsyncCallback()
- {
- public void onFailure(Throwable throwable)
- {
- }
-
- public void onSuccess(Object o)
- {
- AjaxResponse response = (AjaxResponse)o;
-
- for (int i = 0; i < response.getStaleObjects().length; i++)
- {
- String staleObject = response.getStaleObjects()[i];
-
- AjaxObject stale = getContext().getObject(staleObject);
-
- if (stale != null)
- {
- log.info("Going to refresh portlet window " + staleObject);
- stale.refresh(true);
- }
- else
- {
- log.info("No stale window found for " + staleObject);
- }
-
- }
-
- }
- });
+ getContext().getAgentContext().process(windowAction);
}
}
});
@@ -288,7 +209,6 @@
protected void doDestroyWidget()
{
- throw new UnsupportedOperationException();
}
protected void doRemoveChild(AjaxObject child)
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/MetaWidget.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -96,11 +96,19 @@
{
public void onClick(Widget widget)
{
+ object.refresh(false);
+ }
+ }));
+
+
+ popup.add(new Button("Force refresh", new ClickListener()
+ {
+ public void onClick(Widget widget)
+ {
object.refresh(true);
}
}));
-
MetaWidget.this.popup = popup;
add(popup);
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java 2008-07-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -53,6 +53,6 @@
public String toString()
{
- return "CreaterChildren[objectId=" + objectId + "]";
+ return "CreateChildren[objectId=" + objectId + "]";
}
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java 2008-07-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -23,6 +23,7 @@
package org.jboss.portal.presentation.ajax.client.protocol;
import com.google.gwt.user.client.rpc.IsSerializable;
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -35,14 +36,19 @@
private static final String[] EMPTY_STRINGS = new String[0];
/** . */
+ private static final ModelUpdate[] EMPTY_UPDATES = new ModelUpdate[0];
+
+ /** . */
private String[] staleObjects;
+ private ModelUpdate[] modelUpdates;
+
public AjaxResponse()
{
- this(EMPTY_STRINGS);
+ this(EMPTY_STRINGS, EMPTY_UPDATES);
}
- public AjaxResponse(String[] staleObjects)
+ public AjaxResponse(String[] staleObjects, ModelUpdate[] modelUpdates)
{
if (staleObjects == null)
{
@@ -51,6 +57,7 @@
//
this.staleObjects = staleObjects;
+ this.modelUpdates = modelUpdates;
}
public String[] getStaleObjects()
@@ -62,4 +69,14 @@
{
this.staleObjects = staleObjects;
}
+
+ public ModelUpdate[] getModelUpdates()
+ {
+ return modelUpdates;
+ }
+
+ public void setModelUpdates(ModelUpdate[] modelUpdates)
+ {
+ this.modelUpdates = modelUpdates;
+ }
}
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java 2008-07-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -229,15 +229,7 @@
ModelUpdate[] updates = ((AjaxViewPortContext)viewPort.getContext()).getDelta();
//
- for (int i = 0; i < updates.length; i++)
- {
- ModelUpdate update = updates[i];
- System.out.println("update = " + update);
- }
-
-
- //
- return new AjaxResponse(tmp.toArray(new String[tmp.size()]));
+ return new AjaxResponse(tmp.toArray(new String[tmp.size()]), updates);
}
catch (PresentationServerException e)
{
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java 2008-07-07 20:53:32 UTC (rev 11335)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java 2008-07-07 22:14:53 UTC (rev 11336)
@@ -37,12 +37,14 @@
import org.jboss.portal.presentation.ajax.client.model.update.AddChild;
import org.jboss.portal.presentation.ajax.client.model.update.RemoveChild;
import org.jboss.portal.presentation.ajax.client.model.update.ObjectType;
+import org.jboss.portal.presentation.ajax.client.model.update.UpdateObject;
import org.jboss.portal.common.NotYetImplemented;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
+import java.util.HashSet;
import java.io.Serializable;
/**
@@ -116,7 +118,12 @@
public void updateObject(String objectId, Set<String> removedProperties, Map<String, Serializable> updatedProperties, Map<String, Serializable> addedProperties)
{
- throw new NotYetImplemented("todo");
+ updates.add(new UpdateObject(
+ objectId,
+ new HashSet(removedProperties),
+ new HashMap(updatedProperties),
+ new HashMap(addedProperties)
+ ));
}
public void removeObject(String objectId)
16 years
JBoss Portal SVN: r11335 - in docs/branches/JBoss_Portal_Branch_2_7: common/en/modules and 6 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-07 16:53:32 -0400 (Mon, 07 Jul 2008)
New Revision: 11335
Added:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/common/
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/common/frontpage.png
Removed:
docs/branches/JBoss_Portal_Branch_2_7/common/en/images/
Modified:
docs/branches/JBoss_Portal_Branch_2_7/common/en/modules/overview.xml
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/ajax/partial-refresh-admin.png
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/ajax/partial-refresh.png
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/master.xml
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/ajax.xml
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/pom.xml
Log:
Migrating to new docbook features (syntax coloration and image resizing)
Modified: docs/branches/JBoss_Portal_Branch_2_7/common/en/modules/overview.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/common/en/modules/overview.xml 2008-07-07 20:47:30 UTC (rev 11334)
+++ docs/branches/JBoss_Portal_Branch_2_7/common/en/modules/overview.xml 2008-07-07 20:53:32 UTC (rev 11335)
@@ -2,7 +2,7 @@
<title>JBoss Portal - Overview</title>
<para>
<imageobject>
- <imagedata fileref="images/frontpage.png" format="png" align="center"
+ <imagedata fileref="images/common/frontpage.png" format="png" align="center"
valign="middle"/>
</imageobject>
</para>
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/ajax/partial-refresh-admin.png
===================================================================
(Binary files differ)
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/ajax/partial-refresh.png
===================================================================
(Binary files differ)
Added: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/common/frontpage.png
===================================================================
(Binary files differ)
Property changes on: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/common/frontpage.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/master.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/master.xml 2008-07-07 20:47:30 UTC (rev 11334)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/master.xml 2008-07-07 20:53:32 UTC (rev 11335)
@@ -1,42 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
- "../../docbook-support/support/docbook-dtd/docbookx.dtd" [
- <!ENTITY trademarks SYSTEM "modules/trademarks.xml">
- <!ENTITY overview SYSTEM "../../common/en/modules/overview.xml">
- <!ENTITY featurelist SYSTEM "../../common/en/modules/featurelist.xml">
- <!ENTITY target SYSTEM "modules/target.xml">
- <!ENTITY acknowledgements SYSTEM "../../common/en/modules/acknowledgements.xml">
- <!ENTITY supported SYSTEM "modules/supported.xml">
- <!ENTITY installation SYSTEM "modules/installation.xml">
- <!ENTITY configuration SYSTEM "modules/configuration.xml">
- <!ENTITY migration SYSTEM "modules/migration.xml">
- <!ENTITY tutorials SYSTEM "modules/tutorials.xml">
- <!ENTITY xmldescriptors SYSTEM "modules/xmldescriptors.xml">
- <!ENTITY urls SYSTEM "modules/urls.xml">
- <!ENTITY CMS SYSTEM "modules/cmsPortlet.xml">
- <!ENTITY workflow SYSTEM "modules/workflow.xml">
- <!ENTITY navtabs SYSTEM "modules/navtabs.xml">
- <!ENTITY themeandlayouts SYSTEM "modules/themeandlayouts.xml">
- <!ENTITY ajax SYSTEM "modules/ajax.xml">
- <!ENTITY identity SYSTEM "modules/identity.xml">
- <!ENTITY identityportlets SYSTEM "modules/identityportlets.xml">
- <!ENTITY authentication SYSTEM "modules/authentication.xml">
- <!ENTITY ldap SYSTEM "modules/ldap.xml">
- <!ENTITY sso SYSTEM "modules/sso.xml">
- <!ENTITY clustering SYSTEM "modules/clustering.xml">
- <!ENTITY wsrp SYSTEM "modules/wsrp.xml">
- <!ENTITY security SYSTEM "modules/security.xml">
- <!ENTITY troubleshooting SYSTEM "modules/troubleshooting.xml">
- <!ENTITY contentintegration SYSTEM "modules/contentintegration.xml">
- <!ENTITY widgetintegration SYSTEM "modules/widgetintegration.xml">
- <!ENTITY portalapi SYSTEM "modules/portalapi.xml">
- <!ENTITY errorhandling SYSTEM "modules/errorhandling.xml">
- <!ENTITY portletmodes SYSTEM "modules/portletmodes.xml">
- <!ENTITY portalObjectsDTD SYSTEM "modules/portalObjectsDTD.xml">
- <!ENTITY portletInstancesDTD SYSTEM "modules/portletInstancesDTD.xml">
- <!ENTITY jbossPortletDTD SYSTEM "modules/jbossPortletDTD.xml">
- ]>
-<book lang="en">
+ "../../docbook-support/support/docbook-dtd/docbookx.dtd"
+ >
+<book lang="en" xmlns:xi="http://www.w3.org/2001/XInclude">
<bookinfo>
<title><trademark class="registered">JBoss</trademark> Portal 2.7.0</title>
<subtitle>Reference Guide</subtitle>
@@ -73,39 +39,40 @@
</author>
</bookinfo>
<toc/>
- <!-- Trademark - Trying to make all vendor legal teams happy --> &trademarks;
- <!-- Portal overview - marketing stuff --> &overview;
- <!-- Comprehensive list of included features --> &featurelist;
- <!-- Target audience of this document --> ⌖
- <!-- Thanks for all the fish --> &acknowledgements;
- <!-- Support AS, OS, DB listings --> &supported;
- <!-- Installation guide --> &installation;
- <!-- Configuration --> &configuration;
- <!-- Upgrading and migration issues --> &migration;
- <!-- Portlet tutorials --> &tutorials;
- <!-- Deployment desc --> &xmldescriptors;
- <!-- Understanding urls --> &urls;
- <!-- Error handling --> &errorhandling;
- <!-- Content integration --> &contentintegration;
- <!-- Widget integration --> &widgetintegration;
- <!-- Portlet modes --> &portletmodes;
- <!-- Portal API --> &portalapi;
- <!-- Clustering configuration --> &clustering;
- <!-- WSRP --> &wsrp;
- <!-- Security administration --> &security;
- <!-- Identity --> &identity;
- <!-- Identity Portlets --> &identityportlets;
- <!-- Authentication --> &authentication;
- <!-- LDAP --> &ldap;
- <!-- SSO --> &sso;
- <!-- CMS --> &CMS;
- <!-- Workflow --> &workflow;
- <!-- NavTabs --> &navtabs;
- <!-- Theme/layout api --> &themeandlayouts;
- <!-- Ajax --> &ajax;
- <!-- Troubleshooting FAQ--> &troubleshooting;
- &portalObjectsDTD;
- &portletInstancesDTD;
- &jbossPortletDTD;
+ <xi:include href="modules/trademarks.xml" />
+ <xi:include href="../../common/en/modules/overview.xml" />
+ <xi:include href="../../common/en/modules/featurelist.xml" />
+ <xi:include href="modules/target.xml" />
+ <xi:include href="../../common/en/modules/acknowledgements.xml" />
+ <xi:include href="modules/supported.xml" />
+ <xi:include href="modules/installation.xml" />
+ <xi:include href="modules/configuration.xml" />
+ <xi:include href="modules/migration.xml" />
+ <xi:include href="modules/tutorials.xml" />
+ <xi:include href="modules/xmldescriptors.xml" />
+ <xi:include href="modules/urls.xml" />
+ <xi:include href="modules/errorhandling.xml" />
+ <xi:include href="modules/contentintegration.xml" />
+ <xi:include href="modules/widgetintegration.xml" />
+ <xi:include href="modules/portletmodes.xml" />
+ <xi:include href="modules/portalapi.xml" />
+ <xi:include href="modules/clustering.xml" />
+ <xi:include href="modules/wsrp.xml" />
+ <xi:include href="modules/security.xml" />
+ <xi:include href="modules/identity.xml" />
+ <xi:include href="modules/identityportlets.xml" />
+ <xi:include href="modules/authentication.xml" />
+ <xi:include href="modules/ldap.xml" />
+ <xi:include href="modules/sso.xml" />
+ <xi:include href="modules/cmsPortlet.xml" />
+ <xi:include href="modules/workflow.xml" />
+ <xi:include href="modules/navtabs.xml" />
+ <xi:include href="modules/themeandlayouts.xml" />
+ <xi:include href="modules/ajax.xml" />
+ <xi:include href="modules/troubleshooting.xml" />
+ <xi:include href="modules/portalObjectsDTD.xml" />
+ <xi:include href="modules/portletInstancesDTD.xml" />
+ <xi:include href="modules/jbossPortletDTD.xml" />
+
</book>
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/ajax.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/ajax.xml 2008-07-07 20:47:30 UTC (rev 11334)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/ajax.xml 2008-07-07 20:53:32 UTC (rev 11335)
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.docbook.org/xml/4.5/docbookx.dtd">
<chapter id="ajax">
<chapterinfo>
<author>
@@ -73,12 +75,12 @@
</html>
]]></programlisting>
<itemizedlist>
- <listitem><![CDATA[<p:theme themeName="renaissance"/>]]> should be already present as it exists since 2.4 but is even more
- necessary as it will inject in the page the reference to the ajax stylesheet.</listitem>
- <listitem><![CDATA[<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>]]> should be added before any other region
- in the markup of the layout.</listitem>
- <listitem><![CDATA[<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>]]> should be added after any other region
- in the markup of the layout.</listitem>
+ <listitem><para><![CDATA[<p:theme themeName="renaissance"/>]]> should be already present as it exists since 2.4 but is even more
+ necessary as it will inject in the page the reference to the ajax stylesheet.</para></listitem>
+ <listitem><para><![CDATA[<p:region regionName='AJAXScripts' regionID='AJAXScripts'/>]]> should be added before any other region
+ in the markup of the layout.</para></listitem>
+ <listitem><para><![CDATA[<p:region regionName='AJAXFooter' regionID='AJAXFooter'/>]]> should be added after any other region
+ in the markup of the layout.</para></listitem>
</itemizedlist>
</para>
</sect2>
@@ -87,7 +89,7 @@
<para>At runtime the portal combines the layout and the renderers in order create the markup returned to the
web browser. The most used render set is the divRenderer. Renderers only need a modification in the deployment
descriptor to indicate that they support ajax. Here is the declaration of the default divRenderer now in 2.6:</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<renderSet name="divRenderer">
<set content-type="text/html">
<ajax-enabled>true</ajax-enabled>
@@ -119,7 +121,7 @@
to its user.</para>
<para>In the file <emphasis>jboss-portal.sar/conf/data/default-object.xml</emphasis> is declared and configured the
creation of the dashboard portal:</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<deployment>
<parent-ref/>
<if-exists>keep</if-exists>
@@ -148,7 +150,7 @@
to detect which portlets needs to be refreshed and will update only these portlets.</para>
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/ajax/partial-refresh.png" format="png"/>
+ <imagedata fileref="images/ajax/partial-refresh.png" format="PNG" scalefit="1"/>
</imageobject>
<caption>
<para>The portal providing partial refresh</para>
@@ -162,7 +164,7 @@
it is automatically inherited by the sub hierarchy located under that object. By default the drag
and drop feature is positioned on the dashboard object and not on the rest of the portal objects.
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<deployment>
<parent-ref/>
<if-exists>keep</if-exists>
@@ -181,17 +183,17 @@
</deployment>
]]></programlisting>
<note>
- The partial page refresh feature is compatible with the Portal API. The Portal API allows programmatic
+ <para>The partial page refresh feature is compatible with the Portal API. The Portal API allows programmatic
update of the state of portlets at runtime. For instance it is possible to modify the window state or
the mode of several portlets on a given page. When such event occurs, the portal detects the changes
- which occurred and will update the portlet fragments in the page.
+ which occurred and will update the portlet fragments in the page.</para>
</note>
<para>It is possible to change that behavior at runtime using the property editor of the management portlet.
If you want to enable partial refreshing on the default portal you should set the property to true
directly on the portal and all the pages in that portal will automatically inherit those properties.</para>
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/ajax/partial-refresh-admin.png" format="png"/>
+ <imagedata fileref="images/ajax/partial-refresh-admin.png" format="PNG" scalefit="1"/>
</imageobject>
<caption>
<para>The default portal configured for partial page refresh</para>
@@ -218,15 +220,15 @@
<listitem>
<para>Form uploads are not handled.</para>
</listitem>
- <listitem>Having an interaction that deals with the <emphasis>MAXIMIZED</emphasis> window state.
+ <listitem><para>Having an interaction that deals with the <emphasis>MAXIMIZED</emphasis> window state.
When a window is entering a maximized state or leaving a maximized window state, the portal will
- perform a full page refresh.</listitem>
+ perform a full page refresh.</para></listitem>
</itemizedlist>
</para>
<para>It can happen that a portlet does not want to support partial refreshing, in those situations
the <emphasis>jboss-portlet.xml</emphasis> can be used to control that behavior. Since 2.6 an ajax
section has been added in order to configure ajax features related to the portlet.</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<portlet>
<portlet-name>MyPortletNoAjax</portlet-name>
<ajax>
@@ -256,7 +258,7 @@
emission of an event then JBoss Portal will not be able to transform it into a partial refresh and
it will result instead of a full refresh. This can happen with programmatic submission of forms.
</para>
- <programlisting><![CDATA[
+ <programlisting role="XHTML"><![CDATA[
<form id="<%= formId %>" action="<%= renderResponse.createActionURL() %>" method="post">
...
<select onclick="document.getElementById('<%= formId %>').submit()">
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml 2008-07-07 20:47:30 UTC (rev 11334)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/modules/installation.xml 2008-07-07 20:53:32 UTC (rev 11335)
@@ -221,7 +221,7 @@
<para>
<mediaobject>
<imageobject>
- <imagedata align="center" valign="middle" fileref="images/frontpage.png"/>
+ <imagedata align="center" valign="middle" fileref="images/common/frontpage.png"/>
</imageobject>
</mediaobject>
</para>
@@ -369,7 +369,7 @@
repository, so you must be connected to the Internet, and if you are behind a proxy server, you need to define your proxy server address and proxy server port number. To define a proxy server, add the following line to the <filename>$JBOSS_HOME/bin/run.conf</filename> file:
</para>
<para>
-<screen><xi:include href="modules/extras/runconf_javaops.xmlt" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></screen>
+<screen><xi:include href="extras/runconf_javaops.xmlt" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></screen>
<!--JAVA_OPTS=-Dhttp.proxyHost=<<replaceable>proxy-hostname </replaceable>>-Dhttp.proxyPort=<<replaceable>proxy-port</replaceable>> -->
</para>
<para>
@@ -514,7 +514,7 @@
<para>
<mediaobject>
<imageobject>
- <imagedata align="center" valign="middle" fileref="images/frontpage.png"/>
+ <imagedata align="center" valign="middle" fileref="images/common/frontpage.png"/>
</imageobject>
</mediaobject>
</para>
Modified: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/pom.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/pom.xml 2008-07-07 20:47:30 UTC (rev 11334)
+++ docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/pom.xml 2008-07-07 20:53:32 UTC (rev 11335)
@@ -5,9 +5,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.jboss</groupId>
- <artifactId>documentation</artifactId>
- <version>1.0</version>
+ <groupId>org.jboss.portal</groupId>
+ <artifactId>jboss-portal-docs-parent</artifactId>
+ <version>1-SNAPSHOT</version>
</parent>
<repositories>
16 years
JBoss Portal SVN: r11334 - maven/jboss-portal-docs-parent/trunk.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-07 16:47:30 -0400 (Mon, 07 Jul 2008)
New Revision: 11334
Modified:
maven/jboss-portal-docs-parent/trunk/pom.xml
Log:
Use styles 1.1.0
Modified: maven/jboss-portal-docs-parent/trunk/pom.xml
===================================================================
--- maven/jboss-portal-docs-parent/trunk/pom.xml 2008-07-07 20:43:09 UTC (rev 11333)
+++ maven/jboss-portal-docs-parent/trunk/pom.xml 2008-07-07 20:47:30 UTC (rev 11334)
@@ -88,7 +88,7 @@
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.0.0</version>
+ <version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
</dependencies>
16 years
JBoss Portal SVN: r11333 - docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-07-07 16:43:09 -0400 (Mon, 07 Jul 2008)
New Revision: 11333
Modified:
docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images/
Log:
Removing svn:externals, they are bad
Property changes on: docs/branches/JBoss_Portal_Branch_2_7/referenceGuide/en/images
___________________________________________________________________
Name: svn:externals
- common ../../../common/en/images
16 years