Friday, 15 October 2010

MarkLogic/RHES - Gathering information about a MarkLogic instance for a support request

Useful in the case where you're experiencing problems with a live MarkLogic instance but are able to gain ssh access into the host server:

Tuesday, 12 October 2010

MarkLogic: Using xcc/j to execute a locally stored module on a remote server

Here's a brief example demonstrating how xcc/j can be used to execute a module from the local filesystem on a remote server, binding a couple of external variables in the process:

The example module to be loaded looks like this:

MarkLogic: Running RecordLoader with Powershell on Windows

Quick reference - here's an example of how you can use powershell to launch recordLoader to ingest some documents into MarkLogic. The script works on the premise that you have the relevant jars copied to c:\jars

1. Run Powershell as administrator
2. Allow script access by running Set-ExecutionPolicy RemoteSigned
3. Execute .\recordloader.ps1

You can test it with this wikibooks config file using the dump available here

Monday, 4 October 2010

Java: Cutting up a text file containing multiple XML Documents

This was put together in response to a request to handle a .txt file containing multiple XML documents (complete with XML Processing instructions). It runs through a text file (of any size really) and seeks out the start of each PI (Looking for the combination of '<' and '?' together). Each time it finds a PI it writes the content to an XML file. Not sure how useful this will be to anybody but I'm placing it here for reference anyway. It's been designed to handle text documents that look like this:

Or this:

Here's the class:

Sunday, 3 October 2010

MarkLogic: Creating Test XML For a Project...

Here's a quick way to generate a load of individual test docs in a given database: