Author: scottbw
Date: Fri Mar 12 12:01:33 2010
New Revision: 922226
URL: http://svn.apache.org/viewvc?rev=922226&view=rev
Log:
Made UI for adding a gadget consistent with other admin pages. See WOOKIE-52.
Modified:
incubator/wookie/trunk/WebContent/admin/registergadget.jsp
incubator/wookie/trunk/src/org/apache/wookie/WidgetAdminServlet.java
Modified: incubator/wookie/trunk/WebContent/admin/registergadget.jsp
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/WebContent/admin/registergadget.jsp?rev=922226&r1=922225&r2=922226&view=diff
==============================================================================
--- incubator/wookie/trunk/WebContent/admin/registergadget.jsp (original)
+++ incubator/wookie/trunk/WebContent/admin/registergadget.jsp Fri Mar 12
12:01:33 2010
@@ -13,24 +13,54 @@
* limitations under the License.
*/
--%>
-<%@ page import='org.apache.wookie.beans.WidgetService' %>
-<%String metadata = (String)session.getAttribute("metadata"); %>
<html>
<head>
-<title>Widget Service Types</title>
+<title>Add an OpenSocial gadget</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="../style.css" rel="stylesheet" type="text/css">
-</head>
-<body>
+<link type="text/css"
href="/wookie/shared/js/jquery/themes/redmond/jquery-ui-1.7.1.custom.css"
rel="stylesheet" />
+<link type="text/css" href="../layout.css" rel="stylesheet" />
+<div id="header">
+ <div id="banner">
+ <div style="float:left;">
+ <img style="margin: 8 8px;" border="0"
src="../shared/images/furry_white.png">
+ </div>
+ <div id="menu"><a class="menulink"
href="index.jsp">menu <img border="0"
src="../shared/images/book.gif"></a> </div>
+ </div>
+ <div id="pagetitle">
+ <h3>Add new widget</h3>
+ </div>
+ <!-- END HEADER -->
+</div>
+
+<div id="content">
+ <p>Enter the URL of an OpenSocial gadget, and then click the 'Publish'
button to add the gadget to Wookie.</p>
+ <br>
+
+<form method="post"
action="/wookie/admin/WidgetAdminServlet?operation=REGISTERGADGET">
+<table id="newwidget" class="ui-widget ui-widget-content" align="center">
+ <thead>
+ <tr class="ui-widget-header">
+ <th>Enter the URL of the gadget (.xml) to
register:</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><input type="text" size="100" id="url"
name="url" class="ui-widget input ui-state-default ui-corner-all"></td>
+ </tr>
+ <tr>
+ <td align="center"><input class="ui-button
ui-state-default ui-corner-all" type="submit" name="Submit" value="Publish">
+ </tr>
+ </tbody>
+ </table>
+</form>
+
+ </div>
-<%if(metadata!=null){%>
- <%=metadata%>
-<%} else {%>
- <form method="post"
action="/wookie/admin/WidgetAdminServlet?operation=REGISTERGADGET">Enter URL of
Gadget: <input type="text" size="255" id="url" name="url"></form>
-<%}%>
-
+<div id="footer">
+ <div style="text-align:right"><a class="menulink"
href="index.jsp">menu <img border="0"
src="../shared/images/book.gif"></a> </div>
+</div>
</body>
</html>
-<% session.setAttribute("metadata", null); %>
\ No newline at end of file
+
Modified: incubator/wookie/trunk/src/org/apache/wookie/WidgetAdminServlet.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/WidgetAdminServlet.java?rev=922226&r1=922225&r2=922226&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/WidgetAdminServlet.java
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/WidgetAdminServlet.java Fri
Mar 12 12:01:33 2010
@@ -276,7 +276,7 @@ public class WidgetAdminServlet extends
}
case REGISTERGADGET:{
registerOperation(request, properties, session);
- doForward(request,
response,fRegisterGadgetPage);
+ doForward(request, response,fMainPage);
break;
}
case LISTAPIKEYS:{
@@ -430,18 +430,17 @@ public class WidgetAdminServlet extends
private void registerOperation(HttpServletRequest request,
Configuration properties, HttpSession session){
Messages localizedMessages =
LocaleHandler.localizeMessages(request);
- session.setAttribute("metadata", null); //$NON-NLS-1$
try {
W3CWidget widgetModel =
GadgetUtils.createWidget(request);
if(!Widget.exists(widgetModel.getIdentifier())){
WidgetFactory.addNewWidget(widgetModel);
- session.setAttribute("metadata",
localizedMessages.getString("WidgetAdminServlet.16")); //$NON-NLS-1$
//$NON-NLS-2$
+ session.setAttribute("message_value",
widgetModel.getLocalName("en")+":
"+localizedMessages.getString("WidgetAdminServlet.16")); //$NON-NLS-1$
//$NON-NLS-2$
} else {
- session.setAttribute("metadata",
localizedMessages.getString("WidgetAdminServlet.17")); //$NON-NLS-1$
//$NON-NLS-2$
+ session.setAttribute("message_value",
widgetModel.getLocalName("en")+":
"+localizedMessages.getString("WidgetAdminServlet.17")); //$NON-NLS-1$
//$NON-NLS-2$
}
} catch (Exception e1) {
e1.printStackTrace();
- session.setAttribute("metadata",
localizedMessages.getString("WidgetAdminServlet.18")); //$NON-NLS-1$
//$NON-NLS-2$
+ session.setAttribute("error_value",
localizedMessages.getString("WidgetAdminServlet.18")); //$NON-NLS-1$
//$NON-NLS-2$
}
}