Package gword.generateur

Source Code of gword.generateur.Generator

/*
* Copyright (c) 2012, Fromentin Xavier, Schnell Michaël, Dervin Cyrielle, Brabant Quentin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*      * Redistributions of source code must retain the above copyright
*       notice, this list of conditions and the following disclaimer.
*      * Redistributions in binary form must reproduce the above copyright
*       notice, this list of conditions and the following disclaimer in the
*       documentation and/or other materials provided with the distribution.
*      * The names of its contributors may not be used to endorse or promote products
*       derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Fromentin Xavier, Schnell Michaël, Dervin Cyrielle OR Brabant Quentin
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package gword.generateur;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.util.ArrayList;

import kameleon.document.Array;
import kameleon.document.BulletListElement;
import kameleon.document.Cell;
import kameleon.document.Document;
import kameleon.document.ElementPropertiesDefaultNames;
import kameleon.document.HorizontalSeparator;
import kameleon.document.HyperTextLink;
import kameleon.document.Image;
import kameleon.document.LineBreak;
import kameleon.document.MailLink;
import kameleon.document.NumberedListElement;
import kameleon.document.Paragraph;
import kameleon.document.Row;
import kameleon.document.TableOfContents;
import kameleon.document.Text;
import kameleon.document.TextParagraph;
import kameleon.document.TextParagraphElement;
import kameleon.document.Title;
import kameleon.exception.InvalidPropertyException;
import kameleon.exception.KameleonException;
import kameleon.plugin.SupportedOptions;

/**
*
* @author    Brabant Quentin, Fromentin Xavier, Schnell Michaël
* @version    1.1
*/
public class Generator implements WordConstants {
 
  private static final String propLists="<w:lists>"
      +"<w:listDef w:listDefId=\"0\">"
      +"<w:lsid w:val=\"29BD6E80\"/>"
      +"<w:plt w:val=\"HybridMultilevel\"/>"
      +"<w:tmpl w:val=\"A5FC4690\"/>"
      +"<w:lvl w:ilvl=\"0\" w:tplc=\"040C0001\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"1080\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"1080\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"1\" w:tplc=\"040C0011\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:lvlText w:val=\"%2)\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"1800\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"1800\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"2\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2520\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2520\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"3\" w:tplc=\"040C0001\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"3240\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"3240\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"4\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"3960\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"3960\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"5\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"4680\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"4680\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"6\" w:tplc=\"040C0001\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5400\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5400\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"7\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"6120\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"6120\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"8\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"6840\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"6840\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"</w:listDef>"
      +"<w:listDef w:listDefId=\"1\">"
      +"<w:lsid w:val=\"43CD558B\"/>"
      +"<w:plt w:val=\"HybridMultilevel\"/>"
      +"<w:tmpl w:val=\"D9C4D010\"/>"
      +"<w:lvl w:ilvl=\"0\" w:tplc=\"040C0011\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:lvlText w:val=\"%1)\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"720\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"720\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"1\" w:tplc=\"040C0019\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"4\"/>"
      +"<w:lvlText w:val=\"%2.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"1440\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"1440\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"2\" w:tplc=\"040C001B\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"2\"/>"
      +"<w:lvlText w:val=\"%3.\"/>"
      +"<w:lvlJc w:val=\"right\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2160\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2160\" w:hanging=\"180\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"3\" w:tplc=\"040C000F\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:lvlText w:val=\"%4.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2880\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2880\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"4\" w:tplc=\"040C0019\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"4\"/>"
      +"<w:lvlText w:val=\"%5.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"3600\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"3600\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"5\" w:tplc=\"040C001B\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"2\"/>"
      +"<w:lvlText w:val=\"%6.\"/>"
      +"<w:lvlJc w:val=\"right\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"4320\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"4320\" w:hanging=\"180\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"6\" w:tplc=\"040C000F\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:lvlText w:val=\"%7.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5040\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5040\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"7\" w:tplc=\"040C0019\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"4\"/>"
      +"<w:lvlText w:val=\"%8.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5760\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5760\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"8\" w:tplc=\"040C001B\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"2\"/>"
      +"<w:lvlText w:val=\"%9.\"/>"
      +"<w:lvlJc w:val=\"right\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"6480\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"6480\" w:hanging=\"180\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"</w:listDef>"
      +"<w:listDef w:listDefId=\"2\">"
      +"<w:lsid w:val=\"4DB72C4A\"/>"
      +"<w:plt w:val=\"HybridMultilevel\"/>"
      +"<w:tmpl w:val=\"983CCE1C\"/>"
      +"<w:lvl w:ilvl=\"0\" w:tplc=\"040C0001\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"720\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"720\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"1\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"1440\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"1440\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"2\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2160\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2160\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"3\" w:tplc=\"040C0001\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2880\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2880\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"4\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"3600\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"3600\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"5\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"4320\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"4320\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"6\" w:tplc=\"040C0001\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5040\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5040\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"7\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5760\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5760\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"8\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"6480\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"6480\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"</w:listDef>"
      +"<w:listDef w:listDefId=\"3\">"
      +"<w:lsid w:val=\"545D3942\"/>"
      +"<w:plt w:val=\"HybridMultilevel\"/>"
      +"<w:tmpl w:val=\"A4D04720\"/>"
      +"<w:lvl w:ilvl=\"0\" w:tplc=\"040C0011\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:lvlText w:val=\"%1)\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"720\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"720\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"1\" w:tplc=\"040C0019\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"4\"/>"
      +"<w:lvlText w:val=\"%2.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"1440\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"1440\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"2\" w:tplc=\"040C001B\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"2\"/>"
      +"<w:lvlText w:val=\"%3.\"/>"
      +"<w:lvlJc w:val=\"right\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2160\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2160\" w:hanging=\"180\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"3\" w:tplc=\"040C000F\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:lvlText w:val=\"%4.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2880\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2880\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"4\" w:tplc=\"040C0019\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"4\"/>"
      +"<w:lvlText w:val=\"%5.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"3600\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"3600\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"5\" w:tplc=\"040C001B\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"2\"/>"
      +"<w:lvlText w:val=\"%6.\"/>"
      +"<w:lvlJc w:val=\"right\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"4320\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"4320\" w:hanging=\"180\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"6\" w:tplc=\"040C000F\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:lvlText w:val=\"%7.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5040\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5040\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"7\" w:tplc=\"040C0019\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"4\"/>"
      +"<w:lvlText w:val=\"%8.\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5760\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5760\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"8\" w:tplc=\"040C001B\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"2\"/>"
      +"<w:lvlText w:val=\"%9.\"/>"
      +"<w:lvlJc w:val=\"right\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"6480\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"6480\" w:hanging=\"180\"/>"
      +"</w:pPr>"
      +"</w:lvl>"
      +"</w:listDef>"
      +"<w:listDef w:listDefId=\"4\">"
      +"<w:lsid w:val=\"7E46093F\"/>"
      +"<w:plt w:val=\"HybridMultilevel\"/>"
      +"<w:tmpl w:val=\"B928B7B8\"/>"
      +"<w:lvl w:ilvl=\"0\" w:tplc=\"040C0001\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"720\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"720\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"1\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"1440\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"1440\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"2\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2160\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2160\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"3\" w:tplc=\"040C0001\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"2880\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"2880\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"4\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"3600\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"3600\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"5\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"4320\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"4320\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"6\" w:tplc=\"040C0001\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5040\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5040\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Symbol\" w:h-ansi=\"Symbol\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"7\" w:tplc=\"040C0003\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"o\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"5760\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"5760\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"<w:lvl w:ilvl=\"8\" w:tplc=\"040C0005\" w:tentative=\"on\">"
      +"<w:start w:val=\"1\"/>"
      +"<w:nfc w:val=\"23\"/>"
      +"<w:lvlText w:val=\"?\"/>"
      +"<w:lvlJc w:val=\"left\"/>"
      +"<w:pPr>"
      +"<w:tabs>"
      +"<w:tab w:val=\"list\" w:pos=\"6480\"/>"
      +"</w:tabs>"
      +"<w:ind w:left=\"6480\" w:hanging=\"360\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Wingdings\" w:h-ansi=\"Wingdings\" w:hint=\"default\"/>"
      +"</w:rPr>"
      +"</w:lvl>"
      +"</w:listDef>"
      +"<w:list w:ilfo=\"1\">"
      +"<w:ilst w:val=\"4\"/>"
      +"</w:list>"
      +"<w:list w:ilfo=\"2\">"
      +"<w:ilst w:val=\"0\"/>"
      +"</w:list>"
      +"<w:list w:ilfo=\"3\">"
      +"<w:ilst w:val=\"1\"/>"
      +"</w:list>"
      +"<w:list w:ilfo=\"4\">"
      +"<w:ilst w:val=\"2\"/>"
      +"</w:list>"
      +"<w:list w:ilfo=\"5\">"
      +"<w:ilst w:val=\"3\"/>"
      +"</w:list>"
      +"</w:lists><w:styles>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading1\">"
      +"<w:name w:val=\"heading 1\"/>"
      +"<wx:uiName wx:val=\"Heading 1\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading1Char\"/>"
      +"<w:rsid w:val=\"00184431\"/>"
      +"<w:pPr>"
      +"<w:keepNext/>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"0\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:kern w:val=\"32\"/>"
      +"<w:sz w:val=\"32\"/>"
      +"<w:sz-cs w:val=\"32\"/>"
      +"</w:rPr>"
      +"</w:style>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading2\">"
      +"<w:name w:val=\"heading 2\"/>"
      +"<wx:uiName wx:val=\"Heading 2\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading2Char\"/>"
      +"<w:rsid w:val=\"00184431\"/>"
      +"<w:pPr>"
      +"<w:keepNext/>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"1\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:i/>"
      +"<w:i-cs/>"
      +"<w:sz w:val=\"28\"/>"
      +"<w:sz-cs w:val=\"28\"/>"
      +"</w:rPr>"
      +"</w:style>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading3\">"
      +"<w:name w:val=\"heading 3\"/>"
      +"<wx:uiName wx:val=\"Heading 3\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading3Char\"/>"
      +"<w:rsid w:val=\"00184431\"/>"
      +"<w:pPr>"
      +"<w:keepNext/>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"2\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:sz w:val=\"26\"/>"
      +"<w:sz-cs w:val=\"26\"/>"
      +"</w:rPr>"
      +"</w:style>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading1\">"
      +"<w:name w:val=\"heading 1\"/>"
      +"<wx:uiName wx:val=\"Heading 1\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading1Char\"/>"
      +"<w:rsid w:val=\"00184431\"/>"
      +"<w:pPr>"
      +"<w:keepNext/>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"0\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:kern w:val=\"32\"/>"
      +"<w:sz w:val=\"32\"/>"
      +"<w:sz-cs w:val=\"32\"/>"
      +"</w:rPr>"
      +"</w:style>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading2\">"
      +"<w:name w:val=\"heading 2\"/>"
      +"<wx:uiName wx:val=\"Heading 2\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading2Char\"/>"
      +"<w:rsid w:val=\"00184431\"/>"
      +"<w:pPr>"
      +"<w:keepNext/>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"1\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:i/>"
      +"<w:i-cs/>"
      +"<w:sz w:val=\"28\"/>"
      +"<w:sz-cs w:val=\"28\"/>"
      +"</w:rPr>"
      +"</w:style>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading3\">"
      +"<w:name w:val=\"heading 3\"/>"
      +"<wx:uiName wx:val=\"Heading 3\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading3Char\"/>"
      +"<w:rsid w:val=\"00184431\"/>"
      +"<w:pPr>"
      +"<w:keepNext/>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"2\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:sz w:val=\"26\"/>"
      +"<w:sz-cs w:val=\"26\"/>"
      +"</w:rPr>"
      +"</w:style>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading4\">"
      +"<w:name w:val=\"heading 4\"/>"
      +"<wx:uiName wx:val=\"Heading 4\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading4Char\"/>"
      +"<w:rsid w:val=\"00E23400\"/>"
      +"<w:pPr>"
      +"<w:keepNext/>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"3\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:sz w:val=\"28\"/>"
      +"<w:sz-cs w:val=\"28\"/>"
      +"</w:rPr>"
      +"</w:style>"
      +"<w:style w:type=\"paragraph\" w:styleId=\"Heading5\">"
      +"<w:name w:val=\"heading 5\"/>"
      +"<wx:uiName wx:val=\"Heading 5\"/>"
      +"<w:basedOn w:val=\"Normal\"/>"
      +"<w:next w:val=\"Normal\"/>"
      +"<w:link w:val=\"Heading5Char\"/>"
      +"<w:rsid w:val=\"00CB3AD9\"/>"
      +"<w:pPr>"
      +"<w:spacing w:before=\"240\" w:after=\"60\"/>"
      +"<w:outlineLvl w:val=\"4\"/>"
      +"</w:pPr>"
      +"<w:rPr>"
      +"<w:rFonts w:ascii=\"Times New Roman\" w:h-ansi=\"Times New Roman\"/>"
      +"<wx:font wx:val=\"Times New Roman\"/>"
      +"<w:b/>"
      +"<w:b-cs/>"
      +"<w:i/>"
      +"<w:i-cs/>"
      +"<w:sz w:val=\"26\"/>"
      +"<w:sz-cs w:val=\"26\"/>"
      +"</w:rPr>"
      +"</w:style>";


  private static final String propTable="<w:tblPr>"
      +"<w:tblW w:w=\"0\" w:type=\"auto\"/>"
      +"</w:tblPr>"
      +"<w:tblGrid>"
      +"<w:gridCol w:w=\"4606\"/>"
      +"<w:gridCol w:w=\"4606\"/>"
      +"</w:tblGrid>";

  PrintWriter writer ;
  private static final String openDocument = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
      +""
      +"<?mso-application progid=\"Word.Document\"?>"
      +""
      +"<w:wordDocument xmlns:w=\"http://schemas.microsoft.com/office/word/2003/wordml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:sl=\"http://schemas.microsoft.com/schemaLibrary/2003/core\" xmlns:aml=\"http://schemas.microsoft.com/aml/2001/core\" xmlns:wx=\"http://schemas.microsoft.com/office/word/2003/auxHint\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:dt=\"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882\" w:macrosPresent=\"no\" w:embeddedObjPresent=\"no\" w:ocxPresent=\"no\" xml:space=\"preserve\" xmlns:wsp=\"http://schemas.microsoft.com/office/word/2003/wordml/sp2\">"
      +"<o:DocumentProperties>"
      +"<o:Author>"
      +"braba0061</o:Author>"
      +"<o:LastAuthor>"
      +"braba0061</o:LastAuthor>"
      +"<o:Revision>1</o:Revision>"
      +"<o:TotalTime>6</o:TotalTime>"
      +"<o:Created>2012-04-23T11:13:00Z</o:Created>"
      +"<o:LastSaved>2012-04-23T11:19:00Z</o:LastSaved>"
      +"<o:Pages>1</o:Pages>"
      +"<o:Words>0</o:Words>"
      +"<o:Characters>0</o:Characters>"
      +"<o:Company>"
      +"UHP-NANCY-1</o:Company>"
      +"<o:Lines>1</o:Lines>"
      +"<o:Paragraphs>1</o:Paragraphs>"
      +"<o:CharactersWithSpaces>0</o:CharactersWithSpaces>"
      +"<o:Version>11.5604</o:Version>"
      +"</o:DocumentProperties>"
      +"<w:fonts>"
      +"<w:defaultFonts w:ascii=\"Times New Roman\" w:fareast=\"Times New Roman\" w:h-ansi=\"Times New Roman\" w:cs=\"Times New Roman\"/>"
      +"</w:fonts>";
  private static final String closeDocument = "</w:wordDocument>" ;
  private static final String openBody = "<w:body>" ;
  private static final String closeBody = "</w:body>" ;
  private static final String openP = "<w:p>" ;
  private static final String closeP = "</w:p>" ;
  private static final String openPr = "<w:pPr>" ;
  private static final String closePr = "</w:pPr>" ;
  private static final String openR = "<w:r>" ;
  private static final String closeR = "</w:r>" ;
  private static final String openT = "<w:t>" ;
  private static final String closeT = "</w:t>" ;
  private static final String pStyle = "<w:pStyle w:val=\"%s\"/>" ;
  private static final String br = "<w:br/>" ;
  private static final String htlink = "<w:hlink w:dest=\"%s\">" ;
  private static final String mlink = "<w:hlink w:dest=\"mailto:%s\">" ;
  private static final String closeLink = "</w:hlink>" ;
  private static final String openArray = "<w:tbl>"
      +"<w:tblPr>"
      +"<w:tblW w:w=\"0\" w:type=\"auto\"/>"
      +"<w:tblBorders>"
      +"<w:top w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>"
      +"<w:left w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>"
      +"<w:bottom w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>"
      +"<w:right w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>"
      +"<w:insideH w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>"
      +"<w:insideV w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>"
      +"</w:tblBorders>"
      +"</w:tblPr>"
      +"<w:tblGrid>"
      +"<w:gridCol w:w=\"4606\"/>"
      +"<w:gridCol w:w=\"4606\"/>"
      +"</w:tblGrid>";
  private static final String closeArray ="</w:tbl>";
  private static final String openRow="<w:tr>";
  private static final String closeRow="</w:tr>";
  private static final String openCell="<w:tc>"
      +"<w:tcPr>"
      +"<w:tcW w:w=\"4606\" w:type=\"dxa\"/>"
      +"</w:tcPr>";
  private static final String closeCell="</w:tc>";
  private static final String openList="<w:p>"
      +"<w:pPr>"
      +"<w:listPr>";
  private static final String closeList="</w:r></w:p>";
  private static final String horizontalSeparator="<wx:pBdrGroup>"
      +"<wx:borders>"
      +"<wx:bottom wx:val=\"solid\" wx:bdrwidth=\"30\" wx:space=\"1\" wx:color=\"auto\"/>"
      +"</wx:borders>"
      +"<w:p wsp:rsidR=\"00000000\" wsp:rsidRDefault=\"0039092C\">"
      +"<w:pPr>"
      +"<w:pBdr>"
      +"<w:bottom w:val=\"single\" w:sz=\"12\" wx:bdrwidth=\"30\" w:space=\"1\" w:color=\"auto\"/>"
      +"</w:pBdr>"
      +"</w:pPr>"
      +"</w:p>"
      +"</wx:pBdrGroup>";
  private static final String hyperlinkStyle="<w:style w:type=\"character\" w:styleId=\"Hyperlink\">"
      +"<w:name w:val=\"Hyperlink\"/>"
      +"<w:rsid w:val=\"00642211\"/>"
      +"<w:rPr>"
      +"<w:color w:val=\"0000FF\"/>"
      +"<w:u w:val=\"single\"/>"
      +"</w:rPr>"
      +"</w:style></w:styles>"
      +"<w:docPr>"
      +"<w:view w:val=\"print\"/>"
      +"<w:zoom w:percent=\"100\"/>"
      +"<w:doNotEmbedSystemFonts/>"
      +"<w:defaultTabStop w:val=\"708\"/>"
      +"<w:hyphenationZone w:val=\"425\"/>"
      +"<w:punctuationKerning/>"
      +"<w:characterSpacingControl w:val=\"DontCompress\"/>"
      +"<w:optimizeForBrowser/>"
      +"<w:validateAgainstSchema/>"
      +"<w:saveInvalidXML w:val=\"off\"/>"
      +"<w:ignoreMixedContent w:val=\"off\"/>"
      +"<w:alwaysShowPlaceholderText w:val=\"off\"/>"
      +"<w:compat>"
      +"<w:breakWrappedTables/>"
      +"<w:snapToGridInCell/>"
      +"<w:wrapTextWithPunct/>"
      +"<w:useAsianBreakRules/>"
      +"<w:dontGrowAutofit/>"
      +"</w:compat>"
      +"</w:docPr>";

  public Generator(File f) throws KameleonException {
    try {
      //System.out.println("File : "+f.getAbsolutePath());
      writer = new PrintWriter(f, "UTF-8");
    } catch (IOException ex) {
      //TODO Add our exception
      throw new KameleonException(ex.getMessage()) ;
    }
  }

  public void generateDocument(Document d, SupportedOptions options) {
    try {
      writer.printf(openDocument) ;
      writer.print(propLists);
      writer.print(hyperlinkStyle);
      writer.printf(openBody);
      for (Paragraph p : d) {
        try {
          //System.out.println(p.getClass());
          Method methode = this.getClass().getDeclaredMethod("generateParagraph", new Class<?>[]{p.getClass()}) ;
          methode.invoke(this, p) ;
        } catch (Exception ex) {
          ex.printStackTrace();
          //System.out.printf("%s -- %s : %s\n", p.getClass(), ex.getClass(), ex.getMessage());
          //                    //ex.printStackTrace(System.out);
        }
      }// for
      writer.printf(closeBody);
      writer.printf(closeDocument);
    } finally {
      //Close the PrintWriter
      if (writer != null) {
        writer.flush();
        writer.close();
      }
    }
  }

  private void generateParagraph(TextParagraph p){
    writer.printf(openP);
    //    writer.printf(openR);
    for(TextParagraphElement pe : p) {
      try {
        Method methode = this.getClass().getDeclaredMethod("generateTextParagraphElement", pe.getClass()) ;
        ////System.out.printf("%s -- %s\n", pe.getClass(), Arrays.toString(methode.getParameterTypes()));
        methode.invoke(this, pe) ;
      } catch (Exception ex) {
        ////System.out.printf("%s -- %s : %s\n", pe.getClass(), ex.getClass(), ex.getMessage());
        ////System.out.printf("Classe : %s\n",pe.getClass());
        ////System.out.println(""+pe.getProperty(ElementPropertiesDefaultNames.TEXT_BODY));
        ////ex.printStackTrace(System.out);
      }
    }
    //    writer.printf(closeR);
    writer.printf(closeP);
  }

  private void generateParagraph(BulletListElement bl) {

    writer.printf(openList);
    try {
      writer.printf("<w:ilvl w:val=\""+bl.getProperty(ElementPropertiesDefaultNames.LIST_LEVEL)+"\"/>"
          +"<w:ilfo w:val=\"4\"/>"
          +"</w:listPr>"
          +"</w:pPr><w:r>");
    } catch (InvalidPropertyException e) {
      /* This should not happen. */
    }// try
    for(TextParagraphElement pe : bl) {
      try {
        Method methode = this.getClass().getDeclaredMethod("generateTextParagraphElement", pe.getClass()) ;
        methode.invoke(this, pe) ;
      } catch (Exception ex) {
        //                    //System.out.printf("%s -- %s : %s\n", pe.getClass(), ex.getClass(), ex.getMessage());
        //                    //ex.printStackTrace(System.out);
      }
    }
    writer.printf(closeList);
    //System.out.println("zut "+bl.getProperty(ElementPropertiesDefaultNames.TEXT_BODY));
  }

  private void generateParagraph(NumberedListElement nl) {
    writer.printf(openList);
    try {
      writer.printf("<w:ilvl w:val=\""+nl.getProperty(ElementPropertiesDefaultNames.LIST_LEVEL)+"\"/>"
          +"<w:ilfo w:val=\"5\"/>"
          +"<wx:t wx:val=\"1)\" wx:wTabBefore=\"360\" wx:wTabAfter=\"165\"/>"
          +"<wx:font wx:val=\"Times New Roman\"/>"
          +"</w:listPr>"
          +"</w:pPr><w:r>");
    } catch (InvalidPropertyException e) {
      /* This should not happen. */
    }// try
    for(TextParagraphElement pe : nl) {
      try {
        Method methode = this.getClass().getDeclaredMethod("generateTextParagraphElement", pe.getClass()) ;
        methode.invoke(this, pe) ;
      } catch (Exception ex) {
      }
    }
    writer.printf(closeList);
  }

  private void generateParagraph(Title t) {
    try {
      //System.out.println("TITLE");
      writer.printf(openP);
      writer.printf(openPr);
      writer.printf(pStyle,"Heading"+t.getProperty(ElementPropertiesDefaultNames.TITLE_LEVEL));
      writer.printf(closePr);
      writer.printf(openR);
      writer.printf(openT);
      writer.print(escape((String) t.getProperty(ElementPropertiesDefaultNames.TEXT_BODY))) ;
      writer.printf(closeT);
      writer.printf(closeR);
      writer.printf(closeP);
    } catch(InvalidPropertyException ipe) {
      /* This should not happen. */
    }// try
  }

  private void generateParagraph(Array a) {

    int i=0;
    int j=0;
    int k=0;
    int m=0;
    Integer inte;

    writer.printf(openArray);
    writer.printf(propTable);

    ArrayList<ArrayList<Integer>> ohwow= new ArrayList<ArrayList<Integer>>();

    for(Row r : a) {
      ohwow.add(new ArrayList<Integer>());
      for(Cell c : r) {
        inte=new Integer(0);
        try {
          Boolean row_span = (Boolean) c.getProperty(ElementPropertiesDefaultNames.ROW_SPAN) ;
          Boolean col_span = (Boolean) c.getProperty(ElementPropertiesDefaultNames.COL_SPAN) ;
          if(Boolean.TRUE.equals(row_span)) {
            inte=2;
          }
          if(Boolean.TRUE.equals(col_span)) {
            inte=1;
          }
        } catch(InvalidPropertyException ipe) {
          /* This should not happen. */
        }// try
        ohwow.get(i).add(inte);
      }
      i++;
    }

    i=0;

    for(Row r : a) {    
      k=0;
      try {
        writer.printf(openRow);
        for(Cell c : r) {
          if(ohwow.get(j).get(k)!=1){
            writer.printf(openCell);
          }
          m=0;
          if(ohwow.get(j).get(k)!=0){
            if(ohwow.get(j).get(k)==2){
              writer.printf("<w:vmerge/>");
            }
          }else{
            while(k+m+1<ohwow.get(j).size()){
              if(ohwow.get(j).get(k+m+1)==1){
                m++;
              }else{
                break;
              }
            }
            try{
              if(ohwow.get(j+1).get(k)==2){
                writer.printf("<w:vmerge w:val=\"restart\"/>");
              }
            }catch(Exception e){

            }
          }

          if(m!=0){
            writer.printf("<w:gridSpan w:val=\""+(m+1)+"\"/>");
          }

          i=0;
          //System.out.println(c.getProperty(ElementPropertiesDefaultNames.ROW_SPAN)+" , "+c.getProperty(ElementPropertiesDefaultNames.COL_SPAN));
          if(ohwow.get(j).get(k)!=1){
            for (Paragraph p : c) {
              try {
                Method methode = this.getClass().getDeclaredMethod("generateParagraph", new Class<?>[]{p.getClass()}) ;
                methode.invoke(this, p) ;
              } catch (Exception ex) {
                //System.out.printf("%s -- %s : %s\n", p.getClass(), ex.getClass(), ex.getMessage());
                //ex.printStackTrace(System.out);
              }
              i++;
            }
            if(i==0){
              writer.printf("<w:p/>");
            }
            writer.printf(closeCell);
          }
          k++;
        }
        writer.printf(closeRow);
      } catch (Exception ex) {
      }
      j++;
    }
    writer.printf(closeArray);
    writer.printf("<w:p/>");
  }

  private void generateParagraph(TableOfContents t) {

  }

  private void generateParagraph(HorizontalSeparator hs) {
    writer.printf(horizontalSeparator);
  }

  private void generateTextParagraphElement(Text t) {
    try {
      Boolean b=(Boolean)t.getProperty(ElementPropertiesDefaultNames.FORMAT_BOLD);
      Boolean i=(Boolean)t.getProperty(ElementPropertiesDefaultNames.FORMAT_ITALIC);
      Boolean u=(Boolean)t.getProperty(ElementPropertiesDefaultNames.FORMAT_UNDERLINED);
      Boolean s=(Boolean)t.getProperty(ElementPropertiesDefaultNames.FORMAT_STRUCK);
      Boolean sub=(Boolean)t.getProperty(ElementPropertiesDefaultNames.FORMAT_SUBSCRIPT);
      Boolean sup=(Boolean)t.getProperty(ElementPropertiesDefaultNames.FORMAT_SUPERSCRIPT);
      if(b==null) b=false;
      if(i==null) i=false;
      if(u==null) u=false;
      if(s==null) s=false;
      if(sup==null) sup=false;
      if(sub==null) sub=false;

      writer.printf(openR);
      writer.printf("<w:rPr>");

      try{
        if(b==true) writer.printf("<w:b/>");
        if(i==true) writer.printf("<w:i/>");
        if(s==true) writer.printf("<w:strike/>");
        if(u==true) writer.printf("<w:u w:val=\"single\"/>");
        if(sup==true) writer.printf("<w:vertAlign w:val=\"superscript\"/>");
        if(sub==true) writer.printf("<w:vertAlign w:val=\"subscript\"/>");
      }catch(NullPointerException e){

      }
      writer.printf("</w:rPr>");
      writer.printf(openT);
      writer.print(escape((String) t.getProperty(ElementPropertiesDefaultNames.TEXT_BODY)));
      //System.out.println("-- "+t.getProperty(ElementPropertiesDefaultNames.TEXT_BODY));
      writer.printf(closeT);
      writer.printf(closeR);
    } catch(InvalidPropertyException ipe) {
      /* This should not happen. */
    }// try
  }

  private void generateTextParagraphElement(Image img) {

  }

  private void generateTextParagraphElement(LineBreak lb) {
    writer.printf(br);
  }

  private void generateTextParagraphElement(MailLink ml) {
    String text = "" ;
    try {
      text = (String)ml.getProperty(ElementPropertiesDefaultNames.MAIL_DESTINATION);
    } catch(InvalidPropertyException ipe) {
      /* This should not happen. */
    }// try
    writer.printf(mlink,text);
    writer.printf(openR);
    writer.printf("<w:rPr>");
    writer.printf("<w:rStyle w:val=\"Hyperlink\"/>");
    writer.printf("</w:rPr>");
    for(TextParagraphElement pe : ml){
      try {
        Method methode = this.getClass().getDeclaredMethod("generateTextParagraphElement", pe.getClass()) ;
        methode.invoke(this, pe) ;
      } catch (Exception ex) {
        //                    //System.out.printf("%s -- %s : %s\n", pe.getClass(), ex.getClass(), ex.getMessage());
        //                    //ex.printStackTrace(System.out);
      }
    }

    writer.printf(closeR);
    writer.printf(closeLink);
  }

  private void generateTextParagraphElement(HyperTextLink htl) {
    String text = "" ;
    try {
      text = (String)htl.getProperty(ElementPropertiesDefaultNames.LINK_DESTINATION);
    } catch(InvalidPropertyException ipe) {
      /* This should not happen. */
    }// try
    writer.printf(htlink,text);
    writer.printf(openR);
    writer.printf("<w:rPr>");
    writer.printf("<w:rStyle w:val=\"Hyperlink\"/>");
    writer.printf("</w:rPr>");
    for(TextParagraphElement pe : htl.getText()){
      try {
        Method methode = this.getClass().getDeclaredMethod("generateTextParagraphElement", pe.getClass()) ;
        methode.invoke(this, pe) ;
      } catch (Exception ex) {
        //                    //System.out.printf("%s -- %s : %s\n", pe.getClass(), ex.getClass(), ex.getMessage());
        //                    //ex.printStackTrace(System.out);
      }
    }

    writer.printf(closeR);
    writer.printf(closeLink);
  }

  public static String escape(String s) {
    return s.replaceAll("&", "&amp;") ;
  }

}
TOP

Related Classes of gword.generateur.Generator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.