<%@ page import='org.apache.wookie.beans.Widget,org.apache.wookie.beans.WidgetType,java.util.Set,java.util.Hashtable;' %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <% String errors = (String)session.getAttribute("error_value");%> <% String messages = (String)session.getAttribute("message_value");%> Current Widgets
<%if(errors!=null){%>

<%=errors%>

<%}%> <%if(messages!=null){%>

<%=messages%>

<%}%>

This page lists the widgets that have been imported into the Widget Server. You can also change set the type of a widget here to be the the default one. The current default widget types are in Red. If you wish to set a widget to be the default for another type, then click its title to set it. If you wish to remove one of the service types for a particular widget, then click the delete () icon next to it. If you wish to add another service type to an existing widget, then click the (Add new) icon for that particular widget.

<% Widget[] widgets = (Widget[])session.getAttribute("widgets"); Hashtable widgetHashDefaults = (Hashtable)session.getAttribute("widget_defaults"); if(widgets!=null){ for (int i = 1; i < widgets.length; i++) { Widget widget = (Widget) widgets[i]; %>

 <%=widget.getWidgetTitle()%>

Description 
<%=widget.getWidgetDescription()%>
Url
<%=widget.getUrl()%>
Guid
<%=widget.getGuid()%>
Author
<%=widget.getWidgetAuthor()%>
Height
<%=widget.getHeight()%>
Width
<%=widget.getWidth()%>
Types
<% Set types = widget.getWidgetTypes(); WidgetType[] widgetTypes = types.toArray(new WidgetType[types.size()]); for(int j=0;j <% } // first need to check the hash contains a key for this service if(widgetHashDefaults.containsKey(widgetTypes[j].getWidgetContext())){ // if it does contain this service then is it this widget that is default? if(widgetHashDefaults.get(widgetTypes[j].getWidgetContext()).equals(widget.getId())){ //### %>(<%=widgetTypes[j].getWidgetContext()%>)<% } else{ %>(<%=widgetTypes[j].getWidgetContext()%> )<% } } else{ %>(<%=widgetTypes[j].getWidgetContext()%>)<% } } %> (Add new)
<%}%> <%}%>
<% session.setAttribute("error_value", null); %> <% session.setAttribute("message_value", null);%> <% session.setAttribute("widget_defaults", null);%> <% session.setAttribute("widgets", null);%>