11MarkLogic Java API Examples
2- 2012-4-2
2+ August 2012
33
44== Cookbook =============
55
66The com/marklogic/client/example/cookbook directory provides recipes
77for common tasks using the MarkLogic Java API.
88
9- Before using the examples, please perform the following actions:
9+ Before using the examples, perform the following actions:
1010
11- 1. Install 5.1 MarkLogic Server for your chosen platform.
11+ 1. Install MarkLogic 6 for your chosen platform.
1212
13- We recommend that you uninstall any pevious MarkLogic version before installing
14- MarkLogic 5.1 and use a fresh data directory for your forests.
15-
16- 2. Set up a new REST API instance for your database. You can use the AppServices web UI at
13+ 2. Set up a new REST API instance for your database. You can use Information
14+ Studio at:
1715
1816 http://YOUR_HOST:8000/appservices/
1917
20- to create a new RESTful Server for a database. Alternatively, you can use the bash shell
21- script provided with the REST API examples.
18+ to create a new RESTful Server for a database.
2219
23- 3. Edit Example.properties to specify the connection parameters for the REST API instance.
20+ 3. Edit Example.properties to specify the connection parameters for the
21+ REST API instance.
2422
25- You must identify users for the rest-writer and rest-admin roles. To add a user for
26- each of those roles, you can use the Admin UI at
23+ You must identify users for the rest-writer and rest-admin roles. To
24+ add a user for each of those roles, you can use the Admin Interface at:
2725
2826 http://YOUR_HOST:8001/user-summary.xqy?section=security
2927
30- If you make the user name the same as the role name and set the password to "x" you won't
31- have to modify those values in the properties file. Change the example.port property to
32- the port number of the REST Server you created in step 2 of these instructions.
28+ If you make the user name the same as the role name and set the
29+ password to "x" you will not need to modify those values in the
30+ properties file. Change the example.port property to
31+ the port number of the REST Server you created in step 2 of these
32+ instructions.
3333
3434The examples illustrate the following common tasks:
3535
@@ -41,15 +41,17 @@ The examples illustrate the following common tasks:
4141* DocumentDelete delete a document from the database
4242* DocumentFormats work with binary, JSON, text, and XML documents
4343* DocumentOutputStream supply content while writing to the database
44- * JAXBDocument write and read a POJO using JAXB
44+ * JAXBDocument write and read a POJO using JAXB
4545* KeyValueSearch search for documents based on values
4646* QueryOptions configure search with saved options
4747* StringSearch search with string criteria and saved options
48- * StructuredSearch search with a criteria structure and saved options
49- * MultiStatementTransaction complete a transaction with several requests
48+ * StructuredSearch search with a criteria structure and saved
49+ options
50+ * MultiStatementTransaction complete a transaction with several requests
5051* DocumentReadTransform transform content on the server while reading
5152* DocumentWriteTransform transform content on the server while writing
52- * OptimisticLocking write or delete a document only if it hasn't changed
53+ * OptimisticLocking write or delete a document only if it has not
54+ changed
5355* SSLClientCreator create a database client using SSL
5456
5557Each example is a Java application that you can compile and run using the jar
@@ -63,26 +65,26 @@ an SSL certificate template. The other examples do not use SSL.
6365
6466You can extend the Java API to support new kinds of content representations.
6567
66- The examples add support for the JDOM, XOM, Jackson, and Apache HTTPClient
67- libraries.
68+ The examples add support for the JDOM, XOM, Jackson, and other libraries.
6869
69- To compile the JDOM example, first download the library at version 1.1.3 or
70- higher from
70+ To compile the JDOM example, first download the library at version 2.0.2 or
71+ higher from:
7172
7273 http://www.jdom.org/
7374
7475To compile the XOM example, first download the library at version 1.2.5 or
75- higher from
76+ higher from:
7677
7778 http://www.xom.nu/
7879
7980To compile the Jackson example (which uses the tree model), first download
80- the core and databinding libraries at 2.0.1 or higher as linked from:
81+ the core and databinding libraries at 2.0.4 or higher as linked from:
8182
8283 http://wiki.fasterxml.com/JacksonHome
8384
8485To compile the Apache HTTPClient example, you use the Apache HTTPClient
8586bundled with the MarkLogic Java API in the lib subdirectory.
8687
8788The Java classes named *Example are applications that you can compile and run
88- using the jar files for the library as well as the Java API and its dependencies.
89+ using the jar files for the library as well as the Java API and its
90+ dependencies.
0 commit comments