Package org.dom4j

Examples of org.dom4j.DocumentFactory


    private Document createFullMenu(String dsName, String dbType, String userId, ArrayList list) throws DAOException
    {
        //holds temporary Elements to which child Elements can be added
        HashMap map = new HashMap();
       
        DocumentFactory df = DocumentFactory.getInstance();
        Document doc = df.createDocument();
        int count = 1;
        for(int i=0; i < list.size(); i++)
        {
            MenuVO menu = (MenuVO) list.get(i);
           
View Full Code Here


        return doc; 
    }
   
    private Document createQuickMenu(String dsName, String dbType, String userId, ArrayList list) throws DAOException
    {
        DocumentFactory df = DocumentFactory.getInstance();
        Document doc = df.createDocument();

        int count = 1;
        //create the root element
        Element elem1 = doc.addElement(TAG_ROOT);
        elem1 = elem1.addAttribute(ATTR_ID, ATTR_VAL_ID + count++);
        elem1 = elem1.addAttribute(ATTR_HREF, WELCOME_PAGE);


        for(int i=0; i < list.size(); i++)
        {
            MenuVO menu = (MenuVO) list.get(i);
            if(menu.getMenuName().equalsIgnoreCase(QUICK_MENU))
            {
              continue;
            }

            if (menu.getLeaf().equalsIgnoreCase(VALUE_YES))
            {
                Element elem = df.createElement(menu.getTagName());
                elem = elem.addAttribute(ATTR_ID, ATTR_VAL_ID + count);
                elem = elem.addAttribute(ATTR_NAME, menu.getQuickMenuName());
                elem = elem.addAttribute(ATTR_HREF, menu.getHyperlink());
                if(menu.getLeaf().equalsIgnoreCase(VALUE_YES))
                {
View Full Code Here

    /**
     * @since 1.4
     */
    public Dom4JWriter(final Branch root, final NameCoder nameCoder) {
        this(root, new DocumentFactory(), nameCoder);
    }
View Full Code Here

    /**
     * @since 1.2.1
     * @deprecated As of 1.4 use {@link Dom4JWriter#Dom4JWriter(Branch, NameCoder)} instead
     */
    public Dom4JWriter(final Branch root, final XmlFriendlyReplacer replacer) {
        this(root, new DocumentFactory(), (NameCoder)replacer);
    }
View Full Code Here

    public Dom4JWriter(final Branch root, final XmlFriendlyReplacer replacer) {
        this(root, new DocumentFactory(), (NameCoder)replacer);
    }

    public Dom4JWriter(final Branch root) {
        this(root, new DocumentFactory(), new XmlFriendlyNameCoder());
    }
View Full Code Here

    /**
     * @since 1.2.1
     */
    public Dom4JWriter() {
        this(new DocumentFactory(), new XmlFriendlyNameCoder());
    }
View Full Code Here

    /**
     * @since 1.4
     */
    public Dom4JDriver(NameCoder nameCoder) {
        this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
        outputFormat.setTrimText(false);
    }
View Full Code Here

    private DocumentFactory documentFactory;
    private OutputFormat outputFormat;

    public Dom4JDriver() {
        this(new DocumentFactory(), OutputFormat.createPrettyPrint());
        outputFormat.setTrimText(false);
    }
View Full Code Here

     * @param parent
     * @param implClass
     * @return the created contentdb-element
     */
    public static Element addContentDB(Element parent, String implClass) {
        DocumentFactory factory = DocumentFactory.getInstance();
       
        Element database = factory.createElement("contentdb");
        database.addAttribute("enabled", "true");
        database.addAttribute("lazyconnect", "false");
       
        Element elem = factory.createElement("type");
        database.add(elem);
        elem.add(factory.createText(implClass));

        elem = factory.createElement("dbkey");
        database.add(elem);
        elem.add(factory.createText("(Enter database key here)"));
       
        elem = factory.createElement("dbpath");
        database.add(elem);
        elem.add(factory.createText("(Enter database path here)"));
       
        elem = factory.createElement("title");
        database.add(elem);

        elem = factory.createElement("domain");
        database.add(elem);
        elem.add(factory.createText("default"));
       
        elem = factory.createElement("design");
        database.add(elem);
        elem.addAttribute("provider", "none");
        elem.addAttribute("mode", "");
        elem.addAttribute("key", "");
       
        elem = factory.createElement("dboptions");
        database.add(elem);
        createDefaultDbOptions(elem);
       
        elem = factory.createElement("publisheroptions");
        database.add(elem);
        createDefaultPublisherOptions(elem);
               
        database.add(factory.createElement("storedqueries"));
        database.add(factory.createElement("fieldmappings"));
        Element cache = database.addElement("cache");
        cache.addAttribute("path", "");
        cache.addAttribute("type", "de.innovationgate.wgpublisher.cache.WGACacheHSQLDB");
        cache.addAttribute("maxpages", "3000");
       
        //lucene config per db
        Element luceneDBConfig = factory.createElement("lucene");
        luceneDBConfig.addAttribute("enabled", "false");
        luceneDBConfig.addElement("itemrules");
        LuceneIndexItemRule.addDefaultRule(luceneDBConfig);
        luceneDBConfig.addElement("filerules");
        LuceneIndexFileRule.addDefaultRule(luceneDBConfig);
View Full Code Here

     * @param parent
     * @param implClass
     * @return the created persDbElement
     */
    public static Element addPersDB(Element parent, String implClass) {
        DocumentFactory factory = DocumentFactory.getInstance();
       
        Element database = factory.createElement("personalisationdb");
        database.addAttribute("enabled", "true");
        database.addAttribute("lazyconnect", "false");
       
        Element elem = factory.createElement("type");
        database.add(elem);
        elem.add(factory.createText(implClass));
       
        elem = factory.createElement("dbpath");
        database.add(elem);
        elem.add(factory.createText("(Enter database path here)"));

        elem = factory.createElement("domain");
        database.add(elem);
        elem.add(factory.createText("default"));
       
        elem = factory.createElement("persconfig");
        database.add(elem);
        elem.addAttribute("mode", "auto");
       
        elem = factory.createElement("dboptions");
        database.add(elem);
        createDefaultDbOptions(elem);
       
        elem = factory.createElement("publisheroptions");
        database.add(elem);
        createDefaultPublisherOptions(elem);
               
        database.add(factory.createElement("userclasses"));
       
        parent.add(database);
        return database;
    }   
View Full Code Here

TOP

Related Classes of org.dom4j.DocumentFactory

Copyright © 2018 www.massapicom. 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.