Purpose
The Individual Workload widget presents the workload of each user for all products or the product to which the portal is restricted. The widget presents both the total number of open issues being worked and the percentage of the total each person is working on. The widget also presents the workload in three views, available from a select list; bar chart, pie chart and HTML table.
This portlet is an excellent example of how to create a portlet which returns the visualization of the data in any one of a number of different options. It uses JFreeChart for the bar and pie charts and a URL connection to return the HTML table from the same helper Servlet.
Screenshots



Installation
Note: This version will only work with Bugs Dashboard v3.2.2 and up due to the use of the “params” parameter.
To use the Individual Workload widget do the following:
- Copy the IndividualWorkload.class, IndividualWorkloadResults$CustomBarRenderer3D.class, and IndividualWorkloadResults.class files at com/wmpnj/bugz/portlets into the deployed web application directory; i.e. /webapps/bugs/WEB-INF/classes/com/wmpnj/bugz/portlets. This may require that you also copy the directory “portlets” if this is the first portlet you are deploying.
- Update the individualWorkload_en_US.properties file to point to your installation of the Bugs Dashboard. This is necessary because the class that performs the work of creating the HTML table for workload has no reference to the server it must fetch the results from. You must specify the full path to the bugs dashboard; e.g. http://www.myserver.com/bugs When you have completed the update, copy the individualWorkload_en_US.properties file to the deployed web application classes directory; i.e. /webapps/bugs/WEB-INF/classes.
- Update the dwr.xml file in the deployed web application WEB-INF directory; i.e. /webapps/bugs/WEB-INF. Edit the file with a text editor and add the following after the last </create> statement:
<create creator="new" javascript="IndividualWorkload"> <param name="class" value="com.wmpnj.bugz.portlets.IndividualWorkload" /> </create>
- Update the web.xml file in the deployed web application directory, i.e. /webapps/bugs/WEB-INF. There are two sections in this file of interest. You may note that there are many entries that start with the tag <Servlet> and many others that begin with the tag <servlet-mapping>. The following changes must be made:
- Find the last <servlet> entry in the file. After the closing tag (i.e. </servlet>), add the following:
<servlet> <servlet-name>IndividualWorkloadResults</servlet-name> <servlet-class>com.wmpnj.bugz.portlets.IndividualWorkloadResults</servlet-class> <load-on-startup>24</load-on-startup> </servlet>
- Find the last <servlet-mapping> entry in the file. After the closing tag (i.e. </servlet-mapping>, add the following:
<servlet-mapping> <servlet-name>IndividualWorkloadResults</servlet-name> <url-pattern>/individualworkload</url-pattern> </servlet-mapping>
- Find the last <servlet> entry in the file. After the closing tag (i.e. </servlet>), add the following:
- Update the portlets.properties file in the deployed web application classes directory; i.e. /webapps/bugs/WEB-INF/classes:
- Update the first line by incrementing the count of portlets by 1
- Add the following in the position that you want the portlet to appear within your desired column. For example, if you want the IndivdualWorkload to appear at the top of the right-most column, you must insert this ahead of any other portlet whose column is “2″ on a 3-column portal. After adding the following block, you MUST then renumber the portlets appropriately, beginning with 0, i.e. “portlet0″, “portlet1″.
portlet24.title=Individual Workload portlet24.column=1 portlet24.package=com.wmpnj.bugz.portlets.IndividualWorkload portlet24.className=IndividualWorkload portlet24.method=getText portlet24.stylesheet= portlet24.javascript= portlet24.desc= portlet24.call= portlet24.restrictTo= portlet24.params=DWRUtil.getValue("individualWorkload")
You may change the title and column, but do NOT change the package, className, or method!
