Author: johnh
Date: Thu Dec 3 20:28:14 2009
New Revision: 886909
URL: http://svn.apache.org/viewvc?rev=886909&view=rev
Log:
Tiny refactoring of HtmlRenderer code.
Full disclosure: I am committing this with the intent to, in our build of
Shindig, subclass HtmlRenderer to support a composite "test"-type view. The
general idea is, for a render with query param &testmode=1 (or similar), view
content (proxy-mode not supported initially) will come from the "host" view but
with content from "test:<host>" view, if any, appended to it. The test view may
in turn do whatever it wants. We'll render gadgets that support such views in
our test harness, with success criteria being:
A) no uncaught exceptions were thrown
B) a special gadgets.rpc ALL_OK callback handler is fired with an affirmative
value of success.
Because this will be purely experimental and the details will undoubtedly
change, I'm keeping the hook as minimal as possible in core shindig code.
Modified:
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/HtmlRenderer.java
Modified:
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/HtmlRenderer.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/HtmlRenderer.java?rev=886909&r1=886908&r2=886909&view=diff
==============================================================================
---
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/HtmlRenderer.java
(original)
+++
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/HtmlRenderer.java
Thu Dec 3 20:28:14 2009
@@ -78,7 +78,7 @@
String content;
if (view.getHref() == null) {
- content = view.getContent();
+ content = getViewContent(gadget, view);
} else {
content = proxyRenderer.render(gadget);
}
@@ -95,4 +95,8 @@
throw new RenderingException(e.getMessage(), e);
}
}
+
+ protected String getViewContent(Gadget gadget, View view) {
+ return view.getContent();
+ }
}