[
https://issues.apache.org/jira/browse/SHINDIG-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13162808#comment-13162808
]
[email protected] commented on SHINDIG-1666:
--------------------------------------------------------
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3005/#review3618
-----------------------------------------------------------
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_container.js
<https://reviews.apache.org/r/3005/#comment8078>
This looks a bit cluttered to me.
What about:
context.preloadGadget(gadgetUrl, function(result) {
if (!result[gadgetUrl] || result[gadgetUrl].error)) {
// There was an error preloading the gadget URL lets try and
render the
// URL EE if there is one
if (dataModel.url != null) {
navigateUrl_(element, dataModel, renderParams, opt_callback);
}
else if (opt_callback != null) {
// Sometimes the metadata request will return an error code and
message without
// specifying the gadgets the request is for, in this case
format the object the
// way we would expect it
opt_callback(site, result[gadgetUrl] || {error: result});
}
}
else {
context.navigateGadget(site, gadgetUrl, viewParams,
localRenderParams,
function(metadata) {
if (opt_callback != null) {
opt_callback(site, metadata);
}
});
}
});
- Dan
On 2011-12-04 19:53:37, Ryan Baxter wrote:
bq.
bq. -----------------------------------------------------------
bq. This is an automatically generated e-mail. To reply, visit:
bq. https://reviews.apache.org/r/3005/
bq. -----------------------------------------------------------
bq.
bq. (Updated 2011-12-04 19:53:37)
bq.
bq.
bq. Review request for shindig and Stanton Sievers.
bq.
bq.
bq. Summary
bq. -------
bq.
bq. When preloading a gadget the response usually is an array of gadget URLs
with data about the gadget. However sometimes the response may actually just be
an error code and message. We need to account for that case in the handler in
the EE code.
bq.
bq.
bq. This addresses bug SHINDIG-1666.
bq. https://issues.apache.org/jira/browse/SHINDIG-1666
bq.
bq.
bq. Diffs
bq. -----
bq.
bq.
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_container.js
1210178
bq.
bq. Diff: https://reviews.apache.org/r/3005/diff
bq.
bq.
bq. Testing
bq. -------
bq.
bq. Ran unit tests and common container
bq.
bq.
bq. Thanks,
bq.
bq. Ryan
bq.
bq.
> Metadata request may not return an array of gadget URLs when there is an
> error it may just return an error code and message need to account for that
> in EE code
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-1666
> URL: https://issues.apache.org/jira/browse/SHINDIG-1666
> Project: Shindig
> Issue Type: Bug
> Affects Versions: 3.0.0
> Reporter: Ryan Baxter
> Priority: Minor
> Fix For: 3.0.0
>
> Attachments: fix-1666.patch
>
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> When preloading a gadget the response usually is an array of gadget URLs with
> data about the gadget. However sometimes the response may actually just be
> an error code and message. We need to account for that case in the handler
> in the EE code.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira