Package cn.com.elements

Examples of cn.com.elements.TagWriter


        return template;
    }

    @Override
    public String content() throws AppException {
        TagWriter writer = null;
        try {
            writer = new TagWriter(new CharArrayWriter());

            Form form = parser.getForm();
            ContainHTMLElementTag topElement = null;
            if ((form != null && !(parser.getGroup() instanceof Group.DEFAULT) && !form.id().equals(Form.__DEFAULT_FORM_NAME)) || parser.getGroup() instanceof Group.DEFAULT) {

                // 生成form标签
                FormElementTag formElement = new FormElementTag();
                formElement.setAction(form.action());
                formElement.setEnctype(form.enctype());
                formElement.setMethod(form.method().name());
                formElement.setId(form.id());
                formElement.setCssClass(form.cssClass());
                topElement = formElement;
            } else {

                DivElementTag divElement = new DivElementTag(_TOP_CONTAINER);
                topElement = divElement;
            }
            this.parserComponents(topElement);
            topElement.doTag(writer);
            return writer.getWritedString();
        } catch (JspException ex) {
            Logger.getLogger(ContentTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(ContentTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            if (writer != null) {
                writer.close();
            }
        }

        return null;
    }
View Full Code Here


    @Override
    public String content() throws AppException {

        List<Menu> menus = OperatFactory.getServiceObject(MenuService.class, DataProviderModel.FILE).getMenus();
        AbstractHtmlElementTag ulElement = createMenus(menus, 0);
        TagWriter writer = new TagWriter(new CharArrayWriter());
        try {
            ulElement.doTag(writer);
        } catch (JspException ex) {
            Logger.getLogger(DefaultMenuTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(DefaultMenuTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            if (writer != null) {
                writer.close();
            }
        }
        return writer.getWritedString();
    }
View Full Code Here

    @Override
    public String content()  throws AppException{

        List<Menu> menus = OperatFactory.getServiceObject(MenuService.class, DataProviderModel.FILE).getMenus();
        AbstractHtmlElementTag ulElement = createMenus(menus, 0);
        TagWriter writer = new TagWriter(new CharArrayWriter());
        try {
            ulElement.doTag(writer);
        } catch (JspException ex) {
            Logger.getLogger(WmsMenuTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(WmsMenuTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            if (writer != null) {
                writer.close();
            }
        }
        return writer.getWritedString();
    }
View Full Code Here

    public String content() throws AppException {

        List<Task> tasks = TasksController.userTask(CurrentUser.getUserID(), CurrentUser.getEffectNodes());

        AbstractHtmlElementTag ulElement = null;
        TagWriter writer = null;
        try {
            ulElement = this.mainElement(createTaskTag(tasks));

            writer = new TagWriter(new CharArrayWriter());

            ulElement.doTag(writer);
            return writer.getWritedString();
        } catch (JspException ex) {
            Logger.getLogger(WmsMenuTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(WmsMenuTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } catch (AppException ex) {
            Logger.getLogger(WmsTasksTemplate.class.getName()).log(Level.SEVERE, null, ex);

        } finally {
            if (writer != null) {
                writer.close();
            }
        }
        return null;
    }
View Full Code Here

    public String content() throws AppException {

        List<Task> tasks = TasksController.userTask(CurrentUser.getUserID(), CurrentUser.getEffectNodes());

        AbstractHtmlElementTag ulElement = null;
        TagWriter writer = null;
        try {
            ulElement = this.mainElement(createTaskTag(tasks));

            writer = new TagWriter(new CharArrayWriter());

            ulElement.doTag(writer);
            return writer.getWritedString();
        } catch (JspException ex) {
            Logger.getLogger(DefaultTasksTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(DefaultTasksTemplate.class.getName()).log(Level.SEVERE, null, ex);
        } catch (AppException ex) {
            Logger.getLogger(DefaultTasksTemplate.class.getName()).log(Level.SEVERE, null, ex);

        } finally {
            if (writer != null) {
                writer.close();
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of cn.com.elements.TagWriter

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.