[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] Commented: (CMIS-662) Specify a callbackparameter
[ http://tools.oasis-open.org/issues/browse/CMIS-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21636#action_21636 ] Florent Guillaume commented on CMIS-662: ---------------------------------------- I must say I really don't like it as-is, for two reasons: 1. it is Javascript-specific (or at least it assumes a specific function call pattern), 2. it gives control of Javascript generation to complex code on a remote site, which is usually quite unsafe. I'd rather have something that can be used by any language, like the following: {"callback" : "showRepositoryInfo", "cmis:repositories" : { "repository123" : { "repositoryID" : "repository123", "repositoryName" : "Repository 123", "repositoryDescription" : "This is a CMIS repository" } } } Then use it like (untested): <html> <title>Repository Information</title> <script type="text/javascript"> function showRepositoryInfo(repositoryInfo) { var repositories = repositoryInfo["cmis:repositories"]; var repository = repositories["repository123"]; var html = "<ul>"; html += "<li>ID..."+repository.repositoryID+"</li>"; // ... html += "</ul>"; jQuery('#repoinfo').html(html); } function genericCallback(json) { if (json.callback == "showRepositoryInfo") {showRepositoryInfo(json)} } jQuery.getJSON("http://localhost:8080/cmis/getRepositories?callback=showRepositoryInfo", genericCallback) </script> <body> <h1>Repository Information</h1> <div id="repoinfo">(please wait...)</div> </body> </html> > Specify a callback parameter > ---------------------------- > > Key: CMIS-662 > URL: http://tools.oasis-open.org/issues/browse/CMIS-662 > Project: OASIS Content Management Interoperability Services (CMIS) TC > Issue Type: New Feature > Components: Browser Binding > Affects Versions: Browser Binding Proposal > Environment: All > Reporter: Gregory Melahn > Priority: Minor > > Recognizing that the Browser Binding proposal is not a proposal for a JavsScript API (as decided in our first meeting of the Browser Binding subcommittee), still it would be convenient if browser clients could handle the returned JSON data directly using a JavaScript function. For example, if I had a JavaScript function that understood how to parse and render the JSON representation of the contents of a CMIS folder answered by getChildren, then I could specify this function directly in the GET request for getChildren. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]