Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String doDefaultXmlFreeway() throws Exception
- {
- ArrayList pageList = new ArrayList();
- String currTimeStamp ="";
- int version = 0;
- String srcLang = "TBDS";
- String tarLang = "TBDT";
- String title = "";
- String content = "";
- File tempFolder = new File("C://ConfluenceTemp");
- if(!tempFolder.exists()){
- System.out.println("Folder does not exist >> ");
- tempFolder.mkdir();
- }
- else{
- System.out.println("The folder exists must clean first");
- deleteDir(tempFolder);
- tempFolder.mkdir();
- }
- exportType = ImportExportManagerExtended.TYPE_FREEWAY;
- System.out.println("The contents to be exported >> " + getContentToBeExported().size());
- System.out.println("The contents available >> " + getContentTree().size());
- for(int i = 0; i < getContentToBeExported().size(); i ++)
- {
- System.out.println("Content To Be Exported " + (String)getContentToBeExported().get(i));
- innerlist.add((String)getContentToBeExported().get(i));
- }
- ArrayList test = (ArrayList)contentTree.getPages();
- for(int j =0;j<innerlist.size(); j++){
- String stemp = innerlist.get(j).toString();
- long idvalue = Long.parseLong(stemp);
- System.out.println("This is id value :"+idvalue);
- System.out.println("CONTENT " + pageManager.getPage(idvalue));
- Page testPage = pageManager.getPage(idvalue);
- System.out.println("Content:: " + testPage.getContent());
- System.out.println("Title:: " + testPage.getTitle());
- System.out.println("ID here:: " + testPage.getId());
- System.out.println("Version:: " + testPage.getVersion());
- version = testPage.getVersion();
- title = testPage.getTitle();
- content = testPage.getContent();
- //1. Write the contents whilst they are in the loop.That means creating XML's at a temporary location in a folder: For now we create a folder in C:
- //Parameters pageid,version,Time, Title, content file,
- currTimeStamp = getCurrentTimestamp();
- WriteXMLFile xmlWrite = new WriteXMLFile();
- xmlWrite.createXmlFile(idvalue,version,currTimeStamp,srcLang,tarLang,title,content);
- //2. Zip that folder
- ZipXmlFolder zipfldr = new ZipXmlFolder();
- zipfldr.zipXmlFolderAction("C://ConfluenceTemp");
- //3. Navigate onto the next page
- }
- return doDefault();
- //return SUCCESS;
- // return Action.SUCCESS;
- }
Add Comment
Please, Sign In to add comment