In this article I will describe a way of exporting documents out of GX webmanager. There is no one-size-fits-all method for doing this, so instead I will describe the steps to get you off the ground.

Logging in using Xill IDE

Below function can be used for loggin in to GX webmanager, after doing so successfully, Xill IDE will have a session that allows you to export everything you need.

function login(baseurl, username, password){
    var url = baseurl :: "/web/webmanager/id%3d26101/mode%3dedit/fromlogin%3dtrue"; // the url of the login page may vary, depending on the GX installation
    var page = Web.loadPage(url);
    // select the fields used for your username, password, and the login button. 
    var fieldUsername = Web.xPath(page,".//input[@name='user']");
    var fieldPassword = Web.xPath(page,".//input[@name='password']");
    var buttonLogin = Web.xPath(page,".//input[@value='Login']");

    // next input your username, password, and click login
    Web.input(fieldUsername, username);
    Web.input(fieldPassword, password);

If above fields give you a NULL value, check the frontend and use 'inspect element' to figure out the exact fields being used in your case.

Getting the document overview XML

In the next step we will be using a webservice to extract a complete list of all the documents nicely formatted in XML. To achieve this you have to intercept your browser network traffic.

While on the search screen in chrome, rightclick anywhere, choose 'inspect (element)' or press CTRL+SHIFT+I. Next, go to the 'Network' tab, check the option to 'Preserve log', and click the search button in GX (see below picture). 

GX Webmanager document overview

Now look back at the network tab. One of the requests will look similar to this:


Notice the 'alt=xml' in the url, which specifies that the answer will be in XML format, this is what you want. Also notice the 'noresults=10' (10 can be any number), copy this url and change the value of noresults to a very high number, so that all the documents will be grabbed. Next, in Xill IDE, do:, path);

The XML will look like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <entry xsi:type="DocumentSearchResult" xmlns:xsi="">
    <entry xsi:type="DocumentSearchResult" xmlns:xsi="">
        <title>title 2</title>

Getting individual document metadata

Follow the exact same steps as you did before to get the document overview XML, only this time click on one of the search results. In the Network tab, one or more url GET requests are used to grab all the metadata, the total amount depending on the GX installation.

Next, create a list of those URLS, and notice the returning ID in all of them, this is the ID of the document, and this value can be manipulated to get the metadata of all the other documents! Use the previously obtained document overview XML as input for this: 

function getDocumentMetadata(overview){
    var documents = Web.xPath(overview, ".//entry/stringId/text()"); // this will store all document id's in documents
    foreach(id in documents){
        // here, do a download as we did before on all the urls, but use the variable id on the id spot in the url, like in this example:"http://localhost/web/wcbservlet/com.gxwebmanager.gxpublic.servlet/documentuse?alt=xml&documentid=":: id ::"&_=1431345559713", exportPath :: id);

 The result will be a local bunch of XML files containing your document metadata!

Downloading binaries

Now that you have all the metadata, it is possible to download all the binaries. For that, you have to look for a field in the metadata XML named fileid. When you found the id, you can loop through all of them, and construct the following URL:

var binaryUrl = "http://localhost/web/wcbservlet/com.gxwebmanager.gxpublic.fileservlet?fileid= " :: fileid

Note that this URL may vary per GX installation, but it's relatively easy to figure out by downloading a binary through the frontend of the application. Mouse over the link and it will show.