[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=21611#action_21611 ] Gregory Melahn commented on CMIS-662: ------------------------------------- Norrie is right that the main driver for this pattern was to allow cross site access. Here is an example of how the callback would work. Suppose "http://localhost:8080/cmis/getRepositories" answered a JSON response like this {"cmis:repositories" : { "repository123" : { "repositoryID" : "repository123", "repositoryName" : "Repository 123", "repositoryDescription" : "This is a CMIS repository" } } } Note that I abbreviated the contents of the response for brevity. Adding the "callback" parameter like this "http://localhost:8080/cmis/getRepositories?callback=showRepositoryInfo" would result in a response like this ... showRepositoryInfo ( {"cmis:repositories" : { "repository123" : { "repositoryID" : "repository123", "repositoryName" : "Repository 123", "repositoryDescription" : "This is a CMIS repository" } } } ) That would allow a JavaScript function to access the contents like this... <html> <title>Repository Information</title> <script type="text/javascript"> function showRepositoryInfo(repositoryInfo) { var repositories = repositoryInfo["cmis:repositories"]; var repository = repositories["repository123"]; document.write("<h1>Repository Information</h1>"); document.write("<ul>"); document.write("<li>ID..."+repository.repositoryID+"</li>"); document.write("<li>Name..."+repository.repositoryName+"</li>"); document.write("<li>Description..."+repository.repositoryDescription+"</li>"); document.write("</ul>"); } </script> <script type="text/javascript" src="http://localhost:8080/cmis/getRepositories?callback=showRepositoryInfo"></script> </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]