Package org.opencustomer.framework.webapp.util.html

Examples of org.opencustomer.framework.webapp.util.html.Table


    public void preOperation(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        PanelStack stack = Panel.getPanelStack(request);
        if(!stack.isEmpty()) {
            Panel lastPanel = Panel.getPanelStack(request).peek();
            if(lastPanel.getAttribute(ListAction.TABLE_KEY) != null) {
                Table table = (Table)lastPanel.getAttribute(ListAction.TABLE_KEY);
                ListConfigurationVO.Type type = null;
                for(ListConfigurationVO.Type existingType : ListConfigurationVO.Type.values()) {
                    if(existingType.getName().equals(table.getName())) {
                        type = existingType;
                        break;
                    }
                }
               
View Full Code Here


    private String scope;

    private String style;
   
    public int doEndTag() throws JspException {
        Table table                = (Table)TagUtils.getInstance().lookup(pageContext, name, property, scope);

        Properties settings        = (Properties) pageContext.getSession().getServletContext().getAttribute(org.opencustomer.webapp.Globals.TAG_SETTINGS_KEY);
        MessageResources resources = (MessageResources) pageContext.getSession().getServletContext().getAttribute(Globals.MESSAGES_KEY);
        Locale locale              = (Locale) pageContext.getSession().getAttribute(Globals.LOCALE_KEY);

        StringBuilder builder = new StringBuilder();
       
        builder.append("<table");
        if(settings.getProperty(TABLE_CLASS) != null) {
            builder.append(" class=\"").append(settings.getProperty(TABLE_CLASS)).append("\"");
        }
        builder.append(">");
        builder.append("<colgroup>");
        for(Column column : table.getColumns()) {
            builder.append("<col width=\"1*\"/>");
        }
        builder.append("</colgroup>");
        builder.append("<tr>\n");
        for(Column column : table.getColumns()) {
            if(column.getSearch() != null) {
                builder.append("<td>");
                builder.append("<table");
                if(settings.getProperty(INNER_TABLE_CLASS) != null) {
                    builder.append(" class=\"").append(settings.getProperty(INNER_TABLE_CLASS)).append("\"");
View Full Code Here

   
    public int doEndTag() throws JspException
    {
        StringBuilder results = new StringBuilder();

        Table table          = (Table)TagUtils.getInstance().lookup(pageContext, name, property, scope);

        Properties settings  = (Properties) pageContext.getSession().getServletContext().getAttribute(org.opencustomer.webapp.Globals.TAG_SETTINGS_KEY);
        MessageResources res = (MessageResources) pageContext.getSession().getServletContext().getAttribute(Globals.MESSAGES_KEY);
        Locale locale        = (Locale) pageContext.getSession().getAttribute(Globals.LOCALE_KEY);
View Full Code Here

        CvsStreamInfo streamInfo = new CvsStreamInfo();
       
        if(stack.isEmpty() || stack.peek().getAttribute(DynamicListAction.TABLE_KEY) == null) {
            throw new IllegalArgumentException("no panel or table found");
        } else {
            Table table = (Table)stack.peek().getAttribute(DynamicListAction.TABLE_KEY);
            table.query(true);
           
            ArrayList<String> header = new ArrayList<String>();
            for(Column column : table.getColumns()) {
                header.add(removeHTML(MessageUtil.message(request, column.getMessageKey())));
            }
            streamInfo.addLine(header);
      
            for(Row row : table.getRows()) {
                ArrayList<String> values = new ArrayList<String>();
                for(int i=0; i<row.getColumns().length; i++) {
                    Object cell = row.getColumns()[i];
                    if(cell == null) {
                        values.add("");
                    } else {
                        String value = table.getColumns()[i].getFormatter().format(
                                (MessageResources)request.getSession().getServletContext().getAttribute(Globals.MESSAGES_KEY),
                                (Locale)request.getSession().getAttribute(Globals.LOCALE_KEY),
                                cell);
                        values.add(removeHTML(value));
                    }
                }
               
                streamInfo.addLine(values);
            }
           
            String fileName = sdf.format(new Date())+" ";
            if(ListConfigurationVO.Type.PERSON.getName().equals(table.getName())) {
                fileName += MessageUtil.message(request, "entity.system.listConfiguration.type.persons");
            } else if(ListConfigurationVO.Type.COMPANY.getName().equals(table.getName())) {
                fileName += MessageUtil.message(request, "entity.system.listConfiguration.type.companies");
            } else {
                fileName += "download";
            }
            fileName += ".csv";
View Full Code Here

        doChooseList = FormUtility.adjustParameter(doChooseList);
    }
   
    @Override
    protected void reset() {
        Table table = (Table)this.getPanel().getAttribute(DynamicListAction.TABLE_KEY);
        if(table != null) {
            table.resetSearch();
        }
    }
View Full Code Here

       
        if(choosenList != null)
            panel.setAttribute("choosenList", choosenList);
       
        // query database
        Table table = (Table)panel.getAttribute(TABLE_KEY);
        if(table == null) {
            Integer[] columns = null;
            if(choosenList != null)
                columns = choosenList.getColumns();
            table = TableFactory.getInstance().createTable(type.getName(), user, columns);
            table.getPage().setStep(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS));
            panel.setAttribute(TABLE_KEY, table);
        }
       
        if(!formCached && !form.getDoResetSearch().isSelected()) {
            table.loadSearch(errors, request);
        }
        table.getPage().setPage(form.getPage());
        table.getOrder().add(form.getOrder());

        table.query();  
    }
View Full Code Here

TOP

Related Classes of org.opencustomer.framework.webapp.util.html.Table

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.