You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by zh...@apache.org on 2008/03/18 21:40:45 UTC
svn commit: r638558 - in
/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets:
http/JsonRpcRequest.java spec/ModulePrefs.java
Author: zhen
Date: Tue Mar 18 13:40:36 2008
New Revision: 638558
URL: http://svn.apache.org/viewvc?rev=638558&view=rev
Log:
SHINDIG-135
Support extended ModulePrefs attributes in the metadata servlet.
Modified:
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsonRpcRequest.java
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/ModulePrefs.java
Modified: incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsonRpcRequest.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsonRpcRequest.java?rev=638558&r1=638557&r2=638558&view=diff
==============================================================================
--- incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsonRpcRequest.java (original)
+++ incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsonRpcRequest.java Tue Mar 18 13:40:36 2008
@@ -112,8 +112,21 @@
.put("screenshot", prefs.getScreenshot().toString())
.put("author", prefs.getAuthor())
.put("authorEmail", prefs.getAuthorEmail())
+ .put("authorAffiliation", prefs.getAuthorAffiliation())
+ .put("authorLocation", prefs.getAuthorLocation())
+ .put("authorPhoto", prefs.getAuthorPhoto())
+ .put("authorAboutme", prefs.getAuthorAboutme())
+ .put("authorQuote", prefs.getAuthorQuote())
+ .put("authorLink", prefs.getAuthorLink())
.put("categories", prefs.getCategories())
- .put("screenshot", prefs.getScreenshot().toString());
+ .put("screenshot", prefs.getScreenshot().toString())
+ .put("height", prefs.getHeight())
+ .put("width", prefs.getWidth())
+ .put("showStats", prefs.getShowStats())
+ .put("showInDirectory", prefs.getShowInDirectory())
+ .put("singleton", prefs.getSingleton())
+ .put("scaling", prefs.getScaling())
+ .put("scrolling", prefs.getScrolling());
out.append("gadgets", gadgetJson);
} catch (InterruptedException e) {
throw new RpcException("Incomplete processing", e);
Modified: incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/ModulePrefs.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/ModulePrefs.java?rev=638558&r1=638557&r2=638558&view=diff
==============================================================================
--- incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/ModulePrefs.java (original)
+++ incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/spec/ModulePrefs.java Tue Mar 18 13:40:36 2008
@@ -124,18 +124,105 @@
return directoryTitle;
}
- /*
- * The following ModulePrefs attributes are skipped:
+ /**
+ * ModulePrefs@author_affiliation
+ *
+ * Message Bundles
+ */
+ private String authorAffiliation;
+ public String getAuthorAffiliation() {
+ return authorAffiliation;
+ }
+
+ /**
+ * ModulePrefs@author_location
+ *
+ * Message Bundles
+ */
+ private String authorLocation;
+ public String getAuthorLocation() {
+ return authorLocation;
+ }
+
+ /**
+ * ModulePrefs@author_photo
+ *
+ * Message Bundles
+ */
+ private String authorPhoto;
+ public String getAuthorPhoto() {
+ return authorPhoto;
+ }
+
+ /**
+ * ModulePrefs@author_aboutme
*
- * author_affiliation
- * author_location
- * author_photo
- * author_aboutme
- * author_quote
- * author_link
- * show_stats
- * show_in_directory
+ * Message Bundles
*/
+ private String authorAboutme;
+ public String getAuthorAboutme() {
+ return authorAboutme;
+ }
+
+ /**
+ * ModulePrefs@author_quote
+ *
+ * Message Bundles
+ */
+ private String authorQuote;
+ public String getAuthorQuote() {
+ return authorQuote;
+ }
+
+ /**
+ * ModulePrefs@author_link
+ *
+ * Message Bundles
+ */
+ private String authorLink;
+ public String getAuthorLink() {
+ return authorLink;
+ }
+
+ /**
+ * ModulePrefs@show_stats
+ */
+ private boolean showStats;
+ public boolean getShowStats() {
+ return showStats;
+ }
+
+ /**
+ * ModulePrefs@show_in_directory
+ */
+ private boolean showInDirectory;
+ public boolean getShowInDirectory() {
+ return showInDirectory;
+ }
+
+ /**
+ * ModulePrefs@singleton
+ */
+ private boolean singleton;
+ public boolean getSingleton() {
+ return singleton;
+ }
+
+ /**
+ * ModulePrefs@scaling
+ */
+ private boolean scaling;
+ public boolean getScaling() {
+ return scaling;
+ }
+
+ /**
+ * ModulePrefs@scrolling
+ */
+ private boolean scrolling;
+ public boolean getScrolling() {
+ return scrolling;
+ }
/**
* ModuleSpec@width
@@ -164,15 +251,6 @@
}
/**
- * Skipped:
- *
- * singleton
- * render_inline
- * scaling
- * scrolling
- */
-
- /**
* ModuleSpec.Require
* ModuleSpec.Optional
*/
@@ -291,6 +369,12 @@
.append(" title=\"").append(title).append("\"")
.append(" author=\"").append(author).append("\"")
.append(" author_email=\"").append(authorEmail).append("\"")
+ .append(" author_affiliation=\"").append(authorAffiliation).append("\"")
+ .append(" author_location=\"").append(authorLocation).append("\"")
+ .append(" author_photo=\"").append(authorPhoto).append("\"")
+ .append(" author_aboutme=\"").append(authorAboutme).append("\"")
+ .append(" author_quote=\"").append(authorQuote).append("\"")
+ .append(" author_link=\"").append(authorLink).append("\"")
.append(" description=\"").append(description).append("\"")
.append(" directory_title=\"").append(directoryTitle).append("\"")
.append(" screenshot=\"").append(screenshot).append("\"")
@@ -299,6 +383,11 @@
.append(" width=\"").append(width).append("\"")
.append(" category1=\"").append(categories.get(0)).append("\"")
.append(" category2=\"").append(categories.get(1)).append("\"")
+ .append(" show_stats=\"").append(showStats).append("\"")
+ .append(" show_in_directory=\"").append(showInDirectory).append("\"")
+ .append(" singleton=\"").append(singleton).append("\"")
+ .append(" scaling=\"").append(scaling).append("\"")
+ .append(" scrolling=\"").append(scrolling).append("\"")
.append(">\n");
for (URI preload : preloads) {
buf.append("<Preload href=\"").append(preload).append("\"/>\n");
@@ -329,10 +418,21 @@
titleUrl = XmlUtil.getUriAttribute(element, "title_url", emptyUri);
author = XmlUtil.getAttribute(element, "author", "");
authorEmail = XmlUtil.getAttribute(element, "author_email", "");
+ authorAffiliation = XmlUtil.getAttribute(element, "author_affiliation", "");
+ authorLocation = XmlUtil.getAttribute(element, "author_location", "");
+ authorPhoto = XmlUtil.getAttribute(element, "author_photo", "");
+ authorAboutme = XmlUtil.getAttribute(element, "author_aboutme", "");
+ authorQuote = XmlUtil.getAttribute(element, "author_quote", "");
+ authorLink = XmlUtil.getAttribute(element, "author_link", "");
description = XmlUtil.getAttribute(element, "description", "");
directoryTitle = XmlUtil.getAttribute(element, "directory_title", "");
screenshot = XmlUtil.getUriAttribute(element, "screenshot", emptyUri);
thumbnail = XmlUtil.getUriAttribute(element, "thumbnail", emptyUri);
+ showStats = XmlUtil.getAttribute(element, "show_stats", "") == "true";
+ showInDirectory = XmlUtil.getAttribute(element, "show_in_directory", "") == "true";
+ singleton = XmlUtil.getAttribute(element, "singleton", "") == "true";
+ scaling = XmlUtil.getAttribute(element, "scaling", "") == "true";
+ scrolling = XmlUtil.getAttribute(element, "scrolling", "") == "true";
String height = XmlUtil.getAttribute(element, "height");
if (height == null) {