Author: scottbw
Date: Tue Feb 2 11:51:25 2010
New Revision: 905591
URL: http://svn.apache.org/viewvc?rev=905591&view=rev
Log:
Changed the demoWidget function to also include the proxy information in the
URL, so that the Weather widget (and others using remote services) can be
tested from the gallery view. This required making CheckProxy() public and
return the String form of the proxy URL for the request, and adding the proxy
URL to the response attributes.
Modified:
incubator/wookie/trunk/WebContent/webmenu/demoWidget.jsp
incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
Modified: incubator/wookie/trunk/WebContent/webmenu/demoWidget.jsp
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/WebContent/webmenu/demoWidget.jsp?rev=905591&r1=905590&r2=905591&view=diff
==============================================================================
--- incubator/wookie/trunk/WebContent/webmenu/demoWidget.jsp (original)
+++ incubator/wookie/trunk/WebContent/webmenu/demoWidget.jsp Tue Feb 2
11:51:25 2010
@@ -50,7 +50,7 @@
<div id="content">
- <iframe width="<%= request.getAttribute("widgetWidth") %>" height="<%=
request.getAttribute("widgetHeight") %>" src="<%=
request.getAttribute("widgetURL") %>?idkey=<%= request.getParameter("idkey")
%>">
+ <iframe width="<%= request.getAttribute("widgetWidth") %>" height="<%=
request.getAttribute("widgetHeight") %>" src="<%=
request.getAttribute("widgetURL") %>?idkey=<%= request.getParameter("idkey")
%>&proxy=<%=request.getAttribute("proxy")%>">
</iframe>
</div>
Modified: incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java?rev=905591&r1=905590&r2=905591&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/WidgetWebMenuServlet.java Tue
Feb 2 11:51:25 2010
@@ -29,6 +29,7 @@
import org.apache.log4j.Logger;
import org.apache.wookie.beans.Widget;
import org.apache.wookie.beans.WidgetInstance;
+import org.apache.wookie.controller.WidgetInstancesController;
import org.apache.wookie.helpers.WidgetFactory;
import org.apache.wookie.helpers.WidgetKeyManager;
import org.apache.wookie.manager.IWidgetAdminManager;
@@ -103,6 +104,7 @@
request.setAttribute("widgetURL",
widget.getWidget().getUrl());
request.setAttribute("widgetHeight",
widget.getWidget().getHeight());
request.setAttribute("widgetWidth",
widget.getWidget().getWidth());
+ request.setAttribute("proxy",
WidgetInstancesController.checkProxy(request));
doForward(request, response,
fDemoWidgetPage);
break;
}
Modified:
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java?rev=905591&r1=905590&r2=905591&view=diff
==============================================================================
---
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
(original)
+++
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetInstancesController.java
Tue Feb 2 11:51:25 2010
@@ -53,7 +53,7 @@
protected static final String CONTENT_TYPE =
"text/xml;charset=\"UTF-8\""; //$NON-NLS-1$
protected static URL urlWidgetProxyServer = null;
- protected static void checkProxy(HttpServletRequest request){
+ public static String checkProxy(HttpServletRequest request){
// set the proxy url.
if(urlWidgetProxyServer==null){
Configuration properties = (Configuration)
request.getSession().getServletContext().getAttribute("properties");
//$NON-NLS-1$
@@ -69,6 +69,7 @@
// ignore errors
}
}
+ return urlWidgetProxyServer.toExternalForm();
}
/* (non-Javadoc)