Permalink
Browse files

Merging in changes from the isubiker/master branch.

  • Loading branch information...
1 parent 0c9f30c commit 2f2ef80f0d08dd53919539d00fe86191dbdd3191 @ryangrimm committed Jun 21, 2011
Showing with 10,880 additions and 10,483 deletions.
  1. +13 −0 LICENSE.txt
  2. +17 −14 README.markdown
  3. +0 −1,062 data/android-market-2010-12-9/featured.json
  4. +0 −912 data/android-market-2010-12-9/free/arcade.json
  5. +0 −912 data/android-market-2010-12-9/free/brain.json
  6. +0 −932 data/android-market-2010-12-9/paid/arcade.json
  7. +0 −922 data/android-market-2010-12-9/paid/brain.json
  8. +0 −505 data/palm-mobile-applications/apps-3d-gamez.json
  9. +0 −192 data/palm-mobile-applications/apps-books-reference.json
  10. +0 −288 data/palm-mobile-applications/apps-business-finance.json
  11. +0 −204 data/palm-mobile-applications/apps-entertainment.json
  12. +0 −100 data/palm-mobile-applications/apps-evening.json
  13. +0 −540 data/palm-mobile-applications/apps-games.json
  14. +0 −540 data/palm-mobile-applications/apps-lifestyle.json
  15. +0 −193 data/palm-mobile-applications/apps-music.json
  16. +0 −300 data/palm-mobile-applications/apps-news-weather.json
  17. +0 −414 data/palm-mobile-applications/apps-productivity-utilities.json
  18. +0 −253 data/palm-mobile-applications/apps-social.json
  19. +0 −168 data/palm-mobile-applications/apps-sports.json
  20. +0 −324 data/palm-mobile-applications/apps-travel-naviation.json
  21. +0 −208 data/windowsphone-2010-12-09/games-classic-1.json
  22. +0 −208 data/windowsphone-2010-12-09/games-classic-2.json
  23. +0 −208 data/windowsphone-2010-12-09/games-classic-3.json
  24. +0 −208 data/windowsphone-2010-12-09/games-classic-4.json
  25. +0 −32 data/windowsphone-2010-12-09/games-classic-5.json
  26. +0 −208 data/windowsphone-2010-12-09/games-education-1.json
  27. +0 −50 docs/app-store.txt
  28. +16 −0 jsonquery.xqy
  29. +38 −60 jsonstore.xqy
  30. +91 −58 lib/json-query.xqy
  31. +257 −314 lib/json.xqy
  32. +276 −0 lib/reststore.xqy
  33. +227 −0 test/css/qunit.css
  34. +17 −0 test/index.html
  35. +8,316 −0 test/js/jquery.js
  36. +99 −0 test/js/parser-tests.js
  37. +1,412 −0 test/js/qunit.js
  38. +0 −78 test/json-to-xml.xqy
  39. +0 −71 test/parse-path.xqy
  40. +64 −0 test/sample-queries.txt
  41. +0 −5 test/xml-to-json.xqy
  42. +18 −0 test/xq/isomorphic.xqy
  43. +19 −0 test/xq/parse.xqy
View
@@ -0,0 +1,13 @@
+Copyright 2011 MarkLogic Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
View
@@ -47,24 +47,38 @@ ___
- lib/json.xqy - Has two public functions:
- jsonToXML - parses a JSON string into XML that can be stored in MarkLogic
- xmlToJSON - parses the generated XML into a JSON string
- - lib/json-path.xqy - Tinkering with ways to query the stored JSON
+ - lib/json-query.xqy - Tinkering with ways to query the stored JSON
- jsonquery.xqy - A REST endpoint for querying JSON documents
- jsonstore.xqy - A REST endpoint for storing, managing and retrieving JSON documents
## Capabilities of jsonstore.xqy
#### Insert a JSON document
- - Request type: PUT
+ - Request type: PUT or POST
- Request body should be the JSON document
- Example: jsonstore.xqy?uri=/foo/bar.json
- - Optional: When inserting a document you can set permissions, collections and a document quality.
+ - Optional: When inserting a document you can set permissions, properties, collections and a document quality.
- jsonstore.xqy?uri=/foo/bar.json&permission=public:read&permission=admin:write
+ - jsonstore.xqy?uri=/foo/bar.json&property=key:value&property=published:false
- jsonstore.xqy?uri=/foo/bar.json&collection=public&collection=published
- jsonstore.xqy?uri=/foo/bar.json&quality=10
- jsonstore.xqy?uri=/foo/bar.json&permission=public:read&collection=public&quality=10
+ - Notes:
+ - You can set multiple permissions, properties and collections by including multiple definitions in your request, as shown above
+ - Permissions must follow a <role>:<capability> pattern where capability is one of read, update or execute
+ - Properties must follow a <key>:<value> pattern where the key is alphanumeric and starts with a letter
+
#### Get a JSON document
- Request type: GET
- Example: jsonstore.xqy?uri=/foo/bar.json
+ - Optional: To fetch metadat associated about the document, specify what you'd like to include in the response.
+ - jsonstore.xqy?uri=/foo/bar.json?include=content - Simply returns the document as supplied via the PUT (default)
+ - jsonstore.xqy?uri=/foo/bar.json?include=permissions - Returns the permissions on the document
+ - jsonstore.xqy?uri=/foo/bar.json?include=collections - Returns the collections on the document
+ - jsonstore.xqy?uri=/foo/bar.json?include=properties - Returns the properties on the document
+ - jsonstore.xqy?uri=/foo/bar.json?include=quality - Returns the quality of the document
+ - jsonstore.xqy?uri=/foo/bar.json?include=content&include=permissions&include=quality - Returns the content, permissions and quality of the document
+ - jsonstore.xqy?uri=/foo/bar.json?include=all - Returns the content along with all of its metadata
#### Delete a JSON document
- Request type: DELETE
@@ -75,11 +89,6 @@ ___
- Properties are **not** held inside the JSON document, properties are stored outside of the document and don't effect the stored document at all. They are best thought of as metadata about the document but should be avoided if possible due to storage overhead.
- Example: jsonstore.xqy?uri=/foo/bar.json&property=publishState:final&property=needsEditorial:false
-#### Get a property of a document
- - Request type: GET
- - Returns the value of a property that has been set on a document.
- - Example: jsonstore.xqy?uri=/foo/bar.json&property=publishState
-
#### Set permissions on a document
- Request type: POST
- When setting permissions on a document, all of the existing permissions are overwritten.
@@ -95,15 +104,9 @@ ___
- Example: jsonstore.xqy?uri=/foo/bar.json&quality=10
## TODO
- - lib/json.xqy:
- - Convert wide encoded unicode chars: \uFFFF\uFFFF
- - Sanitize element names
- jsonstore.xqy:
- Move a document
- Copy a document
- - Get the document permissions
- - Get the document collections
- - Get the document quality
- Some real tests
[MarkLogic]: http://developer.marklogic.com

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 2f2ef80

Please sign in to comment.