Tuesday, 13 December 2011
Friday, 9 December 2011
Wednesday, 2 November 2011
Following on from my post yesterday, here's a further example usage for the hadoop connector
Listed below is an example showing how you can use the connector to update an existing document in MarkLogic. As before, we're only focusing on the Map phase of Map/Reduce in order to keep things simple.
- You'll need the hadoop connector on your buildpath, which is here
- In addition to having installed MarkLogic 5, you'll need to create an XDBC server (for this example, I'm using port 9999 and targeting the Documents database).
When you're ready, create one XML doc in the database:
Then try the following:
This is the content for the XML config file src/main/resources/marklogic-mlnode-update.xml (referred to in the code above):
And the xcc/j connector for MarkLogic 5.0-1 is now in maven, so all other dependencies can be resolved by this pom:
Enjoy your elephant...
Tuesday, 1 November 2011
If you've just installed MarkLogic 5 and you're interested in spending some time checking out the hadoop connector, this may be a useful accompaniment to all the documentation available from the newly [re]launched MarkLogic Developer Community site.
There's quite a lot to get to grips with regarding the hadoop connector and this will probably be a topic warranting a number of posts over time. But as an additional resource for getting started (in addition to all the sample code and resources available here, this may be of some use.
Briefly, it shows a simplistic use of the connector - which in itself is not so useful as all it currently does is completely overwrite a document within the database with a new node, but it should give an idea as to how the connector could be configured to perform updates to existing data - which I hope to comment on within the next few days.
Sunday, 23 October 2011
Wednesday, 12 October 2011
In this context, bear in mind that sorted will return values sorted alphabetically - but you probably get the idea...
Thursday, 6 October 2011
Friday, 30 September 2011
To get a list of unique GET requests made to a given http application server:
Tuesday, 27 September 2011
You'll need the following dependencies in your POM file:
Monday, 19 September 2011
Friday, 16 September 2011
In this example, I'm taking a very simple spreadsheet structure to illustrate the procedure:
|HEADER 1||HEADER 2|
|Val 1a||Val 1b|
|Val 2a||Val 2b|
Below is an example of how to parse the XML, pull out the information from the relevant cells and strip white space for good measure:
You should end up with something like this:
Monday, 8 August 2011
Tuesday, 2 August 2011
Wednesday, 27 July 2011
And some example usage:
Wednesday, 6 July 2011
Thursday, 30 June 2011
And you can test by running this against the Modules database in CQ:
And you should see something like this
Wednesday, 22 June 2011
Tuesday, 21 June 2011
Monday, 13 June 2011
Saturday, 4 June 2011
Start by installing the Eclipse IDE for Java Developers from http://www.eclipse.org/downloads/index-developer.php (N.B. this is the link for the Release Candidate version of Eclipse 3.7 - for the current release, the link is http://www.eclipse.org/downloads/).
For everything else, you can use the Eclipse Install manager (Help > Install New Software...)
At outset, there are a couple of dependencies. First, the WST Server Adaptors from the Web, XML, Java EE and OSGi Enterprise Development section within http://download.eclipse.org/releases/indigo:
Then you need to install the DLTK 2.0 Core framework. To do this, add the update site repository http://download.eclipse.org/technology/dltk/updates/ to the "Work with" field and select Dynamic Languages Toolkit (DLTK) 2.0 and choose the package Dynamic Languages Toolkit - Core Frameworks
Finally, add the XQDT update site repository (also paste into the "Work with" input field) http://download.eclipse.org/webtools/incubator/repository/xquery/milestones/ and select all the necessary components:
Tuesday, 31 May 2011
Tuesday, 17 May 2011
Wednesday, 27 April 2011
Tuesday, 19 April 2011
Monday, 11 April 2011
This can be achieved using xdmp:eval.
In this example, if you have several documents in a database called "DatabaseA" (and in CQ this is selected as your Content Source). An xdmp:eval statement could be used to write those documents into DatabaseB like so:
Thursday, 7 April 2011
1. Wrap up content in an XML element and send it to a web service
2. On receipt, extract it from the request-body for further processing (insert, validate, transform etc)
To encode the XML element for transmission, you can use a combination of the right content-type options for xdmp:http-post (or xdmp:http-put) and xdmp:quote the element data:
For the service receiving the data, you use a combination of xdmp:unquote and xdmp:quote to extract the element from the request-body, but bear in mind that unquote will return a document-element. This can be easily resolved by switching the the first node() in the document like so:
Thursday, 31 March 2011
If you explore the contents of your modules database after executing this, you should see /simple-example.xqy in the list.
Friday, 25 March 2011
Java: Connecting to a MarkLogic WebDAV server using Apache Jackrabbit and Digest HTTP Authentication
The code below uses Apache Jackrabbit and HttpClient 3.x to connect to a MarkLogic WebDAV application server and logs out a list of all the files in a specific location:
I'm using maven to manage my dependencies for this. If you are too, here's the required dependencies:
Tuesday, 8 March 2011
Tuesday, 18 January 2011
Here's an example for extracting information regarding specific forests:
Another example - a report for all forests (with a given name prefix) and their host node:
And another example: To give a total in-memory usage for all range indexes on a per-forest basis for the entire cluster (organised by host-id):
- ▼ December (2)
- ► November (2)
- ► October (3)
- ► September (4)
- ► August (2)
- ► July (5)
- MarkLogic/XCC: Copying a Module with User Content ...
- MarkLogic: clearing a forest in a database program...
- MarkLogic: Enabling debug options when using the S...
- Linux: SCP syntax and structure note
- MarkLogic/XCC: Installing Modules Programatically
- Eclipse: Installing XQDT (and DLTK) on Eclipse Ind...
- ► May (2)
- ► April (5)
- ► March (3)
- ► 2010 (43)
- ► 2009 (37)
- ► 2008 (24)