| Name | Weather Portlet |
|---|---|
| Version | 1.0.3 |
| Author(s) | Dustin Schultz |
| Homepage | You're lookin' at it! |
| Mailing Lists | portlet-dev@lists.ja-sig.org For discussion on the development of the Weather Portlet. portlet-user@lists.ja-sig.org For discussion implementing, configuring and deploying the Weather Portlet. |
| Issue Tracking | http://www.ja-sig.org/issues/browse/WPT |
| License | New BSD License |
| Release Docs | |
| Java API Docs | |
| Maven2 Artifact | T.B.D |
| Download Source | https://www.ja-sig.org/svn/sandbox/WeatherPortlet/tags/1.0.3-RC2/ |
About this JA-SIG Portlet Project
- The JA-SIG Weather Portlet is a fully functional JSR-168 portlet that provides international weather courtesy of AccuWeather.com. Users have the ability add and delete multiple locations and standards of measurement with ease! This portlet is well coded, tested, and production ready.

Adopters of this portlet
Are you using this portlet? List yourself below and help JA-SIG & the author of this portlet to gauge its usage.
Configuration
- The JA-SIG Weather Portlet only requires you to add the stylesheet (it'll work without it but its going to be ugly!). The styling information is located in webapp/css/weather.css. Note: that you must redeploy uPortal after adding the stylesheet.
- On a vanilla install of uPortal 2.6.x, you can simply add the weather.css to 'webpages/media/org/jasig/portal/layout/tab-column/xhtml-theme/common/' and add @import url("weather.css"); to webpages/media/org/jasig/portal/layout/tab-column/xhtml-theme/common/channels.css
- On a vanilla install of uPortal 3.0.x, you can simply add the weather.css to 'webapp/media/skins/universality/uportal3' and add @import url("weather.css"); to webapp/media/skins/universality/uportal3/uportal3.css
- On a vanilla install of uPortal 2.5.x, it gets a little more tricky than just adding the stylesheet. There is a bug with the way pre-uPortal 2.6.x deploys portlets documented at UP-1241. The problem lies in the way that deployPortletApp modifies the web.xml. It adds a 2.3 servlet DTD and the Weather Portlet requires a 2.4 servlet DTD.
- A simple fix is as follows:
- Open the deployed web.xml (tomcat-dir/webapps/WeatherPortlet/web.xml if you use tomcat) and change
- <!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>
- <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- to ...
- <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- Open the deployed web.xml (tomcat-dir/webapps/WeatherPortlet/web.xml if you use tomcat) and change
- A simple fix is as follows:
- I have not tested other portal environments, please feel free to add instructions or contact me if you run this on another portal environment.
- If you wish, advanced configuration is possible; see the Advanced Configuration section below.
Building
- Building is very easy. With Maven installed simply type 'mvn package' at the command line and a WeatherPortlet.war will be built for you.
Deploying
- Deploying to uPortal is equally as easy. Simply run 'ant deployPortletApp -DportletApp=/path/to/war/WeatherPortlet.war' from your uPortal installation directory.
Advanced Configuration
- Choosing an XML retrieving implementation
- The JA-SIG Weather Portlet comes with two implementations by default: DOM4J or Xstream(Default)
- To configure DOM4J or Xstream(Default) simply uncomment one line and comment out the other line in applicationContext.xml and testContext.xml
- Adding default locations
- To have a default location appear (such as the hometown of where the portal runs) simply add those locations to the portlet.xml
- The portlet.xml has instructions and two locations commented out by default to guide you in this process.
- Adjusting the caching configuration
- The JA-SIG Weather Portlet comes pre-configured with an optimal caching configuration using EHCache & the Spring Modules.
- To adjust the caching configuration, simply edit the ehcache.xml file. Most of the parameters in the file are self-explanatory or commented.
- If you would like to add additional caches, simply add the cache configuration to the ehcache.xml, add the cache name to the configuration options in the applicationContext.xml, and add @Cachable (look at IWeatherDAO for an example) to the method name you would like to be cached.
Screenshots
View Mode
Default View

Edit Mode
Default Edit View

With Search Results

Objectives and requirements
Functional
- Can retrieve international weather and display weather information in a user friendly format
Technical
- A standards-compliant JSR-168 portlet
- Modular design and APIs so additional weather service plugins may be implemented
- Uses Spring PortletMVC and appropriate Spring practices
- Builds with Maven 2
- Unit tested
Cultural
- A collaborative open source project under the auspices of JA-SIG
- Can be used commercially (with permission, see termsofuse.txt) and non-commercially (without permission)
- Produces actual production-ready releases, not just a code drop or a project that exclusively lives in SVN
Participants
- Dustin Schultz - Lead Developer
- Erin Garlock - Interested Participant
- Brad Johnson - Branch Committer
- Jen Bourey - Branch Committer
- ...
Committers
| Committership is a social contract Commitership in JA-SIG SVN is both a technical fact (having the right account set up in JA-SIG SVN configuration) and a social contract (the understanding and agreement among developers that this person will be committing to some particular portion of JA-SIG shared collaborated-upon source code.) Presently, technically, any member of the "everyone" group is able to commit changes to this portlet project in SVN. That doesn't mean everyone "is a committer" in the sense of committership on this project. Cf., technically, any member of the "everyone" group in JA-SIG SVN is able to commit changes to uPortal, but it would be a surprise and likely inappropriate for an "everyone" member who has never before committed to the uPortal project to make unexpected changes. |
Here are enumerated the people believed to be committers for this WeatherPortlet project:
Action Items
| Action Item | Assignee | Status |
|---|---|---|
| Give Dustin svn commit access | Andrew Petro | Done. Credentials bootstrapped via phone conversation and entered into SVN config. 7 Feb 08 |
| Create a sandbox SVN module http://www.ja-sig.org/svn/sandbox/WeatherPortlet | Dustin Schultz | Done. Created WeatherPortlet, WeatherPortlet/trunk, WeatherPortlet/tags, and WeatherPortlet/branches |
| Document intent to move to SVN portlets/ directory as of first RC | Andrew Petro | Not started. Dustin Schultz is very close to RC1 as of 03/01/2008. |
| Create child pages of Portlets wiki space for this weather portlet content | Andrew Petro | Hey, that's this page! |
| Build out this page with more info | Dustin Schultz | Andrew Petro will ping Dustin on this |
| Document this projectlet on the JA-SIG Clearinghouse Contributions page | Andrew Petro | Not started |
| Create a WeatherPortlet Jira project in the portlets group | Andrew Petro | Dustin Schultz will ping Andrew Petro about this. |
| Prevail upon Jim Helwig to create portlet-dev@lists.ja-sig.org and use that list for this | Andrew Petro will poke Jim Helwig about it. Either Jim or Eric are able to actually execute on this. | Done. Loosely started and on-list commitment from Jim. But hey, more poking of Jim is better! Andrew Petro pinged Jim Helwig about this on 12 Feb; CH-152@jira |
| Find an acceptable weather service. | Dustin Schultz | Done. AccuWeather has agreed to provide service for non-commercial without permission and commercial with explicit permission. |
| Design classes and structure. |
Dustin Schultz | Structure created. Classes architecture partially done. See Changeset 43092 |
| Create basic functionality of view and edit pages. |
Dustin Schultz | Done. See Changeset 43182 |
| Create generic unit testing class to test WeatherDaoImpl |
Dustin Schultz | Done. See Changeset 43182 |
| Create nice design with CSS. |
Parker Grimes |
Done. See Changeset 43294 Edit page still needs a few very minor changes. |
| Finish functionality, add simple validation. |
Dustin Schultz | Done. See Changeset 43294 |
| Determine best way for including CSS with portlet |
Dustin Schultz | Done. I was unable to find a clean and standard way for deploying the portlet with CSS without having multiple definitions of CSS files or CSS attributes (assuming a user adds it twice). Thefore, the solution is to include the CSS file with the portal framework. |
| Start documentation |
Dustin Schultz | Documentation has been expanded nicely. This is, however, a continually process and I will continue to add more as it becomes available. |
| Release RC1 |
Dustin Schultz | Done. RC1 was released 03/03/2008. |
| Begin RC2 |
Dustin Schultz | Bug Fixes |
| RC2 Complete | Dustin Schultz | Fixes connection issues by using HttpClient for connection to AccuWeather |
| Begin 1.1 |
Dustin Schultz | In process as of 08/08/08. 1.1 will upgrade 1.03 to include Spring 2.5.x Web MVC annotations and AJAX features. |
