Thanks! That's exactly what I was looking for.
Quick question though: when rendering a gadget with the "rawxml" param, do
you still need the "url" param? As far as I can tell, the "url" param isn't
needed, but Processor.process(GadgetContext context) will error out if it's
missing due to the following code:
public Gadget process(GadgetContext context) throws ProcessingException {
Uri url = context.getUrl();
if (url == null) {
throw new ProcessingException("Missing or malformed url parameter",
HttpServletResponse.SC_BAD_REQUEST);
}
...
I can set the url to a dummy value like "http://asdf" to avoid the error,
but perhaps an if clause should be added to bypass url validation if the
rawxml parameter is present?
Thoughts?
Thanks,
Dennis
On Tue, Mar 8, 2011 at 11:26 AM, John Hjelmstad <[email protected]> wrote:
> This is actually possible - you just POST to the rendering URL with param
> &rawxml=<gadget spec>.
>
> Code location isn't intuitive. It works if you're using a GadgetSpecFactory
> that extends (or is) DefaultGadgetSpecFactory:
>
>
> http://codesearch.google.com/codesearch/p?hl=en#oS3Kom0H2nk/trunk/shindig/shindig_735392/java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultGadgetSpecFactory.java&q=RAW_GADGETSPEC%20file:shindig&l=66
>
> --j
>
>
>
> On Tue, Mar 8, 2011 at 11:04 AM, Dennis Ju <[email protected]> wrote:
>
>> Hello,
>>
>> I was wondering if there was a way to render a gadget by passing a
>> gadget's
>> XML content instead of passing a URL. Looking through the
>> GadgetRenderingServlet class, it looks like this isn't doable.
>>
>> Use case for rendering via the content would be to get a quick preview of
>> the gadget.
>>
>> Any thoughts on adding such a feature? Or is this already possible and am
>> I
>> just missing it?
>>
>> Thanks,
>> Dennis
>>
>
>
--
East Coast Symposium, May 10-11, 2011
Register today: www.liferay.com/ECS2011
*New! *Attend Portal Administrator Training Express on May 9 at the same
location as ECS! Reserve your
seat<https://www.regonline.com/builder/site/?eventid=918957>
today.