2

I am trying to create my custom plugin which can help me extract out the Confluence contents in XML format. I did analyse the XML Export option under Advanced, however the XML it generates is quite cluttered with data i do not need. My aim is to create an XML something like

 <Title>Page Title :Test Title</Title>
 <Body>[CDATA]Page Body...[CDATA]</Body>
 <Version>1.0</Version>

So i have added my custom link in the advanced tab named Freeway Export like http://img844.imageshack.us/img844/4519/pagektg.jpg . I have my custom Java class configured which is called on the Submit event seen in the UI .

public String doDefaultXmlFreeway() throws Exception
    {
        System.out.println("The call to doDefaultXmlFreeway has been made ");
        exportType = ImportExportManagerExtended.TYPE_FREEWAY;
        System.out.println("The contents to be exported >> " + getContentToBeExported().size());
        System.out.println("The contents available >> " + getContentTree().size());
        return doDefault();
   }

The console gave out the ouput like this:

[INFO] [talledLocalContainer] The call to doDefaultXmlFreeway has been made
[INFO] [talledLocalContainer] The contents to be exported >> 2
[INFO] [talledLocalContainer] The contents available >> 3

There were 3 contents listed in my space as seen in the UI image.If i checked 2 of the contents checkbox; the getContentToBeExported() showed the appropriate number.

Now my next step is to somehow acquire the title and body of the pages so that i can use it for the xml conversion. Can i get the title and body details from the contenTree in any way ?

1 Answer 1

0

Angela,

You seem to be extending class ExportSpaceAction.

getContentTree().getPages()

is the api you are looking to get a hold of the pages. From there getting the tile and body should be easy from the javadocs.

Adil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.