[ 
https://issues.apache.org/jira/browse/RAVE-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13183661#comment-13183661
 ] 

marijan milicevic commented on RAVE-379:
----------------------------------------

wrapping try catch into a method removes duplicate code:

//Wrapped every element into individual try/catch as if any of the element is 
coming null getString throws JSONException.                            
widget.setTitle(parseProperty(jsonModulePrefsObject, "title"));
widget.setTitleUrl(parseProperty(jsonModulePrefsObject, "titleUrl"));
widget.setDescription(parseProperty(jsonModulePrefsObject, "description"));
widget.setAuthor(parseProperty(jsonModulePrefsObject, "author"));
widget.setAuthorEmail(parseProperty(jsonModulePrefsObject, "authorEmail"));
widget.setThumbnailUrl(parseProperty(jsonModulePrefsObject, "thumbnail"));
widget.setScreenshotUrl(parseProperty(jsonModulePrefsObject, "screenshot"));
widget.setUrl(url);
widget.setType(getSupportedContext());




private String parseProperty(JSONObject prefsObject, String name){
        try {
            return prefsObject.getString("title");

        } catch (JSONException e) {
            logger.info("Error while reading: " + e.getLocalizedMessage(), e);
        }
        return null;
}

                
> Navigation Tool Widget from Role widgetstore not working
> --------------------------------------------------------
>
>                 Key: RAVE-379
>                 URL: https://issues.apache.org/jira/browse/RAVE-379
>             Project: Rave
>          Issue Type: Bug
>          Components: rave-opensocial-provider
>    Affects Versions: 0.7-INCUBATING
>            Reporter: Raminderjeet Singh
>            Assignee: Raminderjeet Singh
>         Attachments: screenshot-1.jpg
>
>
> Following gadget from role widget store [1] not working 
> http://css.uni-graz.at/projects/role/recommender/navigationtool.xml 
> 1. http://www.role-widgetstore.eu/tool/navigation-tool-widget

--
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

        

Reply via email to