[jboss-svn-commits] JBoss PortletSwap SVN: r87 - in portlets/2_4/src: . JBoss_WeatherPortlet JBoss_WeatherPortlet/lib JBoss_WeatherPortlet/src JBoss_WeatherPortlet/src/etc JBoss_WeatherPortlet/src/main JBoss_WeatherPortlet/src/main/org JBoss_WeatherPortlet/src/main/org/jboss JBoss_WeatherPortlet/src/main/org/jboss/portlet JBoss_WeatherPortlet/src/main/org/jboss/portlet/weather JBoss_WeatherPortlet/src/resources JBoss_WeatherPortlet/src/resources/weatherportlet-war JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/portlet JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/portlet/weather JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-IN! F/jsp

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 24 14:39:17 EDT 2006


Author: roy.russo at jboss.com
Date: 2006-07-24 14:38:52 -0400 (Mon, 24 Jul 2006)
New Revision: 87

Added:
   portlets/2_4/src/JBoss_WeatherPortlet/
   portlets/2_4/src/JBoss_WeatherPortlet/LICENSES.txt
   portlets/2_4/src/JBoss_WeatherPortlet/README.txt
   portlets/2_4/src/JBoss_WeatherPortlet/build.xml
   portlets/2_4/src/JBoss_WeatherPortlet/lib/
   portlets/2_4/src/JBoss_WeatherPortlet/lib/explode.jar
   portlets/2_4/src/JBoss_WeatherPortlet/lib/log4j.jar
   portlets/2_4/src/JBoss_WeatherPortlet/lib/portal-common-lib.jar
   portlets/2_4/src/JBoss_WeatherPortlet/lib/portlet-api-lib.jar
   portlets/2_4/src/JBoss_WeatherPortlet/src/
   portlets/2_4/src/JBoss_WeatherPortlet/src/bin/
   portlets/2_4/src/JBoss_WeatherPortlet/src/etc/
   portlets/2_4/src/JBoss_WeatherPortlet/src/etc/weatherportlet-war.mf
   portlets/2_4/src/JBoss_WeatherPortlet/src/main/
   portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/
   portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/jboss/
   portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/jboss/portlet/
   portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/jboss/portlet/weather/
   portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/jboss/portlet/weather/WeatherPortlet.java
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/Rss.xsl
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/portlet/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/portlet/weather/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/portlet/weather/WeatherPortlet.class
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-app.xml
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-web.xml
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jsp/
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jsp/edit.jsp
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet-instances.xml
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet.xml
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/weather-object.xml
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/web.xml
   portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/images/
   portlets/2_4/src/JBoss_WeatherPortlet/weatherportlet.war
Log:



Property changes on: portlets/2_4/src/JBoss_WeatherPortlet
___________________________________________________________________
Name: svn:ignore
   + output


Added: portlets/2_4/src/JBoss_WeatherPortlet/LICENSES.txt
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/LICENSES.txt	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/LICENSES.txt	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,2 @@
+LGPL: explode.jar, portal-common.jar, portal-core-lib.jar, portlet-api.jar
+ASL: log4j.jar
\ No newline at end of file

Added: portlets/2_4/src/JBoss_WeatherPortlet/README.txt
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/README.txt	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/README.txt	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,7 @@
+This portlet works with JBoss Portal 2.2+. It retrieves an RSS Feed from Yahoo! Weather and displays a forecast of the
+weather for a given postal code. This software is distributed under the LGPL, unless otherwise noted in the LICENSES.txt.
+
+- To build the ear file, use ant to execute the build.xml at the root of this bundle, ie.  "ant deploy"
+- To deploy this portlet, simply copy the weatherportlet.ear file to your /deploy directory where JBoss Portal resides.
+
+

Added: portlets/2_4/src/JBoss_WeatherPortlet/build.xml
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/build.xml	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/build.xml	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,84 @@
+<project name="JBoss Weather Portlet"
+   default="deploy"
+   basedir=".">
+
+   <property name="app.name" value="weatherportlet"/>
+
+   <property name="src.dir" value="${basedir}/src"/>
+
+   <property name="lib.dir" value="${basedir}/lib"/>
+
+   <property name="build.dir" value="${basedir}/output"/>
+
+   <property name="build.lib" value="${build.dir}/lib"/>
+
+   <property name="build.resources" value="${src.dir}/resources"/>
+
+   <property name="build.etc" value="${src.dir}/etc"/>
+
+   <property name="classes.dir" value="${build.dir}/classes"/>
+
+   <property name="dist.dir" value="${src.dir}/resources"/>
+
+   <property name="libs.api" value="${lib.dir}/portlet-api-lib.jar"/>
+
+   <property name="libs.ant" value="${lib.dir}/log4j.jar;${lib.dir}/explode.jar;${lib.dir}/portal-common-lib.jar;${lib.dir}"/>
+
+   <property name="libs" value="${libs.api};${libs.ant}"/>
+
+   <available property="clover.available" classname="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
+
+   <target name="clover-yes" depends="prepare" if="clover.available">
+      <property name="compiler" value="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
+   </target>
+
+   <target name="clover-no" depends="prepare" unless="clover.available">
+      <property name="compiler" value="modern"/>
+   </target>
+
+   <target name="prepare">
+      <mkdir dir="${classes.dir}"/>
+      <mkdir dir="${build.lib}"/>
+      <mkdir dir="${build.lib}/exploded"/>
+   </target>
+
+   <target name="clean">
+      <delete dir="${build.dir}"/>
+   </target>
+
+   <target name="deploy" depends="clover-yes, clover-no">
+      <javac srcdir="${src.dir}"
+             destdir="${classes.dir}"
+             classpath="${libs}"
+             debug="off"
+             optimize="on"
+             deprecation="on"
+             compiler="${compiler}">
+         <include name="main/org/jboss/portlet/**/*.java"/>
+      </javac>
+
+      <copydir src="${classes.dir}" dest="${build.resources}/weatherportlet-war/WEB-INF/classes">
+      </copydir>
+
+      <!-- weatherportlet.war -->
+      <jar jarfile="weatherportlet.war">
+         <manifest>
+            <attribute name="Manifest-Version" value="1.0"/>
+         </manifest>
+         <fileset dir="${build.resources}/weatherportlet-war"/>
+      </jar>
+   </target>
+
+
+   <target name="explode" depends="deploy">
+      <taskdef classname="org.jboss.portal.common.ant.Explode"
+               name="explode"
+               classpath="${libs}"/>
+      <explode
+            file="weatherportlet.war"
+            todir="${build.lib}/exploded"
+            name="weatherportlet.war"/>
+   </target>
+   <target name="all" depends="deploy"/>
+</project>
+

Added: portlets/2_4/src/JBoss_WeatherPortlet/lib/explode.jar
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/JBoss_WeatherPortlet/lib/explode.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/JBoss_WeatherPortlet/lib/log4j.jar
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/JBoss_WeatherPortlet/lib/log4j.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/JBoss_WeatherPortlet/lib/portal-common-lib.jar
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/JBoss_WeatherPortlet/lib/portal-common-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/JBoss_WeatherPortlet/lib/portlet-api-lib.jar
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/JBoss_WeatherPortlet/lib/portlet-api-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/etc/weatherportlet-war.mf
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/etc/weatherportlet-war.mf	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/etc/weatherportlet-war.mf	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Created-By: @java.vm.version@ (@java.vm.vendor@)
+Specification-Title: @specification.title@
+Specification-Version: @specification.version@
+Specification-Vendor: @specification.vendor@
+Implementation-Title: @implementation.title@
+Implementation-URL: @implementation.url@
+Implementation-Version: @implementation.version@
+Implementation-Vendor: @implementation.vendor@
+Implementation-Vendor-Id: @implementation.vendor.id@
+Class-Path: ./weatherportlet-lib.jar
\ No newline at end of file

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/jboss/portlet/weather/WeatherPortlet.java
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/jboss/portlet/weather/WeatherPortlet.java	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/main/org/jboss/portlet/weather/WeatherPortlet.java	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,227 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.portlet.weather;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URL;
+
+public class WeatherPortlet extends GenericPortlet
+{
+   /**
+    * Logger
+    */
+   public static Logger log = Logger.getLogger(WeatherPortlet.class);
+
+   /**
+    * Edit page
+    */
+   private static final String JSP_EDIT = "/WEB-INF/jsp/edit.jsp";
+
+   /**
+    * Default zip set in init param.
+    */
+   private String DEFAULT_ZIP;
+
+   /**
+    * RSS 2.0 XSL page for output
+    */
+   private static final String RSS_XSL = "/WEB-INF/Rss.xsl";
+
+   /**
+    * Compiled Template for output
+    */
+   private Templates template_2_0;
+
+   /**
+    * Base URL of Weather RSS
+    */
+   private String RSS_URL_PREFIX;
+
+   private static final String E_XSL_UNREADABLE = "Unable to prepare XSL files.";
+   private static final String E_UNREADABLE = "Unable to read XML Source.";
+   private static final String E_UNPARSEABLE = "Unable to parse XML Source.";
+
+   /**
+    * Compile the XSL File.
+    */
+   public void init()
+   {
+      try
+      {
+         InputStream inputstream = getPortletContext().getResourceAsStream(WeatherPortlet.RSS_XSL);
+         StreamSource xslSource = new StreamSource(inputstream);
+         TransformerFactory tFactory = TransformerFactory.newInstance();
+         this.template_2_0 = tFactory.newTemplates(xslSource);
+
+         this.DEFAULT_ZIP = getInitParameter("default_zipcode");
+         this.RSS_URL_PREFIX = getInitParameter("base_url");
+      }
+      catch(TransformerConfigurationException tce)
+      {
+         log.error(E_XSL_UNREADABLE, tce);
+      }
+   }
+
+   protected void doView(RenderRequest request, RenderResponse response) throws IOException, PortletException
+   {
+      response.setProperty("expiration-cache", request.getPreferences().getValue("expires", "180"));
+
+      InputStream xmlInputStream = null;
+      InputStream xslInputStream = null;
+
+      String newZip = null;
+      try
+      {
+         newZip = request.getParameter("newzip");
+         response.setContentType("text/html");
+
+         if(null == newZip)
+         {
+            newZip = request.getPreferences().getValue("RssXml", RSS_URL_PREFIX + DEFAULT_ZIP);
+         }
+
+         xmlInputStream = new URL(newZip).openStream();
+         if(xmlInputStream == null)
+         {
+            log.error(E_UNREADABLE);
+            throw new PortletException(E_UNREADABLE);
+         }
+
+         // Ready the parsers
+         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
+         DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
+         Transformer transformer = this.template_2_0.newTransformer();
+
+         Source xmlSource = null;
+         try
+         {
+            Document document = docBuilder.parse(xmlInputStream);
+            transformer = this.template_2_0.newTransformer();
+            xmlSource = new DOMSource(document);
+         }
+         catch(TransformerConfigurationException tce)
+         {
+            log.error(E_UNPARSEABLE, tce);
+            throw new PortletException(E_UNPARSEABLE, tce);
+         }
+
+         // Transform document
+         PrintWriter writer = response.getWriter();
+         StreamResult outStream = new StreamResult(writer);
+         transformer.transform(xmlSource, outStream);
+      }
+      catch(Exception e)
+      {
+         log.error("Fatal Error reading/parsing XML Source.", e);
+         PrintWriter writer = response.getWriter();
+         writer.write("Failed to retrieve Weather Feed!");
+         writer.close();
+      }
+      finally // close all streams
+      {
+         if(xmlInputStream != null)
+         {
+            xmlInputStream.close();
+         }
+
+         if(xslInputStream != null)
+         {
+            xslInputStream.close();
+         }
+      }
+   }
+
+   /**
+    * Allow edit of weather location.
+    *
+    * @param request
+    * @param response
+    * @throws IOException
+    * @throws PortletException
+    */
+   protected void doEdit(RenderRequest request, RenderResponse response) throws IOException, PortletException
+   {
+      response.setContentType("text/html");
+      PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(JSP_EDIT);
+      dispatcher.include(request, response);
+   }
+
+   /**
+    * Process weather location edit and store in user preferences.
+    *
+    * @param request
+    * @param response
+    * @throws PortletException
+    */
+   public void processAction(ActionRequest request, ActionResponse response) throws PortletException
+   {
+      String newZip = request.getParameter("newzip");
+
+      if(null != newZip)
+      {
+         PortletPreferences prefs = request.getPreferences();
+         try
+         {
+            prefs.setValue("RssXml", RSS_URL_PREFIX + newZip);
+            prefs.store();
+         }
+         catch(Exception e)
+         {
+            e.printStackTrace();
+         }
+      }
+
+      // TODO: error checking for URL + NewZIP
+
+      //store as the selected xml so that it shows up selected as displays
+      response.setRenderParameter("newzip", RSS_URL_PREFIX + newZip);
+
+      //set the portlet mode back to view
+      response.setPortletMode(PortletMode.VIEW);
+   }
+}
\ No newline at end of file

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/Rss.xsl
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/Rss.xsl	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/Rss.xsl	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,77 @@
+<?xml version="1.0" ?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+   <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
+   <xsl:variable name="image-path">http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:variable>
+   <xsl:variable name="link-path">
+      <xsl:value-of select="rss/channel/link"/>
+   </xsl:variable>
+   <xsl:template match="/">
+      <br/>
+      <div align="center">
+         <font>
+            <b>
+               <xsl:for-each select="rss/channel/location">
+                  <xsl:value-of select="@city"/>, <xsl:value-of select="@region"/>, <xsl:value-of
+                     select="@country"/>
+               </xsl:for-each>
+            </b>
+         </font>
+         <br/>
+         <br/>
+         <table width="130" border="0">
+            <tr>
+               <xsl:for-each select="rss/channel/item/condition">
+                  <td>
+                     <table border="0" height="130">
+                        <tr>
+                           <td class="portlet-section-header" align="center">Currently</td>
+                        </tr>
+                        <tr>
+                           <td class="portlet-section-alternate" align="center" valign="top">
+                              <img src="{$image-path}/{@code}.gif"/>
+                           </td>
+                        </tr>
+                        <tr>
+                           <td class="portlet-section-alternate" align="center" valign="top">
+                              <xsl:value-of select="@text"/>
+                           </td>
+                        </tr>
+                        <tr>
+                           <td class="portlet-section-alternate" align="center" valign="top">
+                              <xsl:value-of select="@temp"/>F</td>
+                        </tr>
+                     </table>
+                  </td>
+               </xsl:for-each>
+               <xsl:for-each select="rss/channel/item/forecast">
+                  <td>
+                     <table border="0" height="130">
+                        <tr>
+                           <td class="portlet-section-header" align="center" valign="top">
+                              <xsl:value-of select="@day"/>
+                           </td>
+                        </tr>
+                        <tr>
+                           <td class="portlet-section-alternate" align="center" valign="top">
+                              <img src="{$image-path}/{@code}.gif"/>
+                           </td>
+                        </tr>
+                        <tr>
+                           <td class="portlet-section-alternate" align="center" valign="top">
+                              <xsl:value-of select="@text"/>
+                           </td>
+                        </tr>
+                        <tr>
+                           <td class="portlet-section-alternate" align="center" valign="top">
+                              <xsl:value-of select="@low"/>F/<xsl:value-of select="@high"/>F</td>
+                        </tr>
+                     </table>
+                  </td>
+               </xsl:for-each>
+            </tr>
+         </table>
+         <br/>
+         <a href="{$link-path}" target="_blank">Complete Forecast</a>
+      </div>
+   </xsl:template>
+</xsl:stylesheet>

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/portlet/weather/WeatherPortlet.class
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/classes/org/jboss/portlet/weather/WeatherPortlet.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-app.xml
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-app.xml	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-app.xml	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,3 @@
+<jboss-app>
+   <app-name>weather</app-name>
+</jboss-app>
\ No newline at end of file

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-web.xml
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-web.xml	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jboss-web.xml	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<jboss-web>
+</jboss-web>

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jsp/edit.jsp
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jsp/edit.jsp	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/jsp/edit.jsp	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,17 @@
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<div align="center">
+   <br/>
+   <font class="portlet-font">Change Weather Location:</font>
+
+   <form method="post" action="
+<portlet:actionURL></portlet:actionURL>">
+      <font class="portlet-font">Zip Code:</font><br/>
+      <input class="portlet-form-input-field" type="text" value="" size="12" name="newzip">
+      <br/>
+      <input class="portlet-form-input-field" type="submit" name="submit" value="submit">
+   </form>
+</div>
\ No newline at end of file

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet-instances.xml
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet-instances.xml	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet-instances.xml	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="yes"?>
+<deployments>
+   <deployment>
+      <if-exists>overwrite</if-exists>
+      <instance>
+         <instance-id>RSSWeatherInstance</instance-id>
+         <portlet-ref>RSSWeatherPortlet</portlet-ref>
+      </instance>
+   </deployment>
+</deployments>
\ No newline at end of file

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet.xml
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet.xml	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/portlet.xml	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd"
+             version="1.0">
+   <portlet>
+      <portlet-name>RSSWeatherPortlet</portlet-name>
+      <portlet-class>org.jboss.portlet.weather.WeatherPortlet</portlet-class>
+      <init-param>
+         <name>default_zipcode</name>
+         <value>33145</value>
+      </init-param>
+      <init-param>
+         <name>RSS_XSL</name>
+         <value>/WEB-INF/Rss.xsl</value>
+      </init-param>
+      <init-param>
+         <name>base_url</name>
+         <value>http://xml.weather.yahoo.com/forecastrss?p=</value>
+      </init-param>
+      <expiration-cache>0</expiration-cache>
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+         <portlet-mode>EDIT</portlet-mode>
+      </supports>
+      <portlet-info>
+         <title>Weather Portlet</title>
+      </portlet-info>
+      <portlet-preferences>
+         <preference>
+            <name>expires</name>
+            <value>180</value>
+         </preference>
+         <preference>
+            <name>RssXml</name>
+            <value>http://xml.weather.yahoo.com/forecastrss?p=33145</value>
+            <read-only>false</read-only>
+         </preference>
+      </portlet-preferences>
+   </portlet>
+</portlet-app>

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/weather-object.xml
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/weather-object.xml	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/weather-object.xml	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+   <deployment>
+      <if-exists>overwrite</if-exists>
+      <parent-ref>default</parent-ref>
+      <page>
+         <page-name>RSSWeather</page-name>
+         <window>
+            <window-name>RSSWeatherWindow</window-name>
+            <instance-ref>RSSWeatherInstance</instance-ref>
+            <region>center</region>
+            <height>0</height>
+         </window>
+      </page>
+   </deployment>
+</deployments>

Added: portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/web.xml
===================================================================
--- portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/web.xml	2006-07-24 18:19:00 UTC (rev 86)
+++ portlets/2_4/src/JBoss_WeatherPortlet/src/resources/weatherportlet-war/WEB-INF/web.xml	2006-07-24 18:38:52 UTC (rev 87)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>

Added: portlets/2_4/src/JBoss_WeatherPortlet/weatherportlet.war
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/JBoss_WeatherPortlet/weatherportlet.war
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jboss-svn-commits mailing list