Package org.apache.ecs.html

Examples of org.apache.ecs.html.PRE


    public Email setMsg(String msg)
            throws MessagingException
    {
        setTextMsg(msg);
        setHtmlMsg(new ElementContainer(new Html(new Body()
                .addElement(new PRE(msg)))).toString());
        return this;
    }
View Full Code Here


        if (DEBUG)
        {
            // If there are GET/POST/PATH_INFO variables put them into
            // a <PRE></PRE> tag so that they can be displayed on the
            // page. This is of course only for example purposes.
            PRE pre = new PRE();

            for (Iterator it = data.getParameters().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                String[] values = data.getParameters().getStrings(key);
                if (values.length == 1)
                {
                    pre.addElement(key + " = " + values[0] + "\n");
                }
                else
                {
                    pre.addElement(key + " = ");
                    for (int i = 0; i < values.length; i++)
                    {
                        pre.addElement(values[i] + " ");
                    }
                    pre.addElement("\n");
                }
            }
            body
                .addElement(new B("Query/PathInfo Parameters"))
                .addElement(new BR())
                .addElement(pre);

            Table table2 = new Table().setBorder(0);
            Map varDebug = data.getDebugVariables();

            boolean hasValues2 = false;

            for (Iterator i = varDebug.keySet().iterator(); i.hasNext();)
            {
                String key = (String) i.next();
                String value = varDebug.get(key).toString();
                TR tr =
                    new TR().addElement(
                        new TD().addElement(new B(key))).addElement(
                        new TD().addElement(" = " + value));
                table2.addElement(tr);
                hasValues2 = true;
            }
            if (hasValues2)
            {
                body.addElement(new H4().addElement("Debugging Data:"));
                body.addElement(table2);
            }
        }

        if (DEBUG && data.getACL() != null)
        {
            // Print out user's permissions.
            PRE pre = new PRE();
            for (Iterator rs = data.getACL().getRoles().iterator();
                rs.hasNext();
                )
            {
                String roleName = ((Role) rs.next()).getName();
                pre.addElement(roleName + "\n");
            }
            body
                .addElement(new BR())
                .addElement(new B("ROLES"))
                .addElement(new BR())
                .addElement(pre);

            pre = new PRE();
            for (Iterator ps = data.getACL().getPermissions().iterator();
                ps.hasNext();
                )
            {
                String permissionName = ((Permission) ps.next()).getName();
                pre.addElement(permissionName + "\n");
            }
            body
                .addElement(new BR())
                .addElement(new B("PERMISSIONS"))
                .addElement(new BR())
View Full Code Here

        {
            data
                .getPage()
                .getBody()
                .addElement(new H4().addElement("The exception is:"))
                .addElement(new PRE(trace))
                .addElement(new PRE(data.getStackTraceException().toString()));
        }
        return null;
    }
View Full Code Here

        String trace = data.getStackTrace();
        if ( trace != null )
        {
            data.getPage().getBody()
                .addElement(new H4().addElement("The exception is:"))
                .addElement(new PRE(trace))
                .addElement(new PRE(data.getStackTraceException().toString()));
        }
        return null;
    }
View Full Code Here

        if (DEBUG)
        {
            // If there are GET/POST/PATH_INFO variables put them into
            // a <PRE></PRE> tag so that they can be displayed on the
            // page. This is of course only for example purposes.
            PRE pre = new PRE();
            Enumeration keys = data.getParameters().keys();
            while ( keys.hasMoreElements() )
            {
                String key = (String) keys.nextElement();
                String[] values = data.getParameters().getStrings(key);
                if (values.length == 1)
                    pre.addElement(key + " = " + values[0] + "\n");
                else
                {
                    pre.addElement(key + " = ");
                    for (int i=0; i<values.length; i++)
                        pre.addElement(values[i] + " ");
                    pre.addElement("\n");
                }
            }
            body.addElement( new B("Query/PathInfo Parameters") )
                .addElement( new BR() )
                .addElement(pre);

            Table table2 = new Table().setBorder(0);
            Hashtable varDebug = data.getVarDebug();
            keys = varDebug.keys();
            boolean hasValues2 = false;
            while ( keys.hasMoreElements() )
            {
                String key = (String) keys.nextElement();
                String value = varDebug.get(key).toString();
                TR tr = new TR()
                    .addElement ( new TD().addElement(new B(key)) )
                    .addElement ( new TD().addElement(" = " + value ) );
                table2.addElement(tr);
                hasValues2 = true;
            }
            if ( hasValues2 )
            {
                body.addElement (new H4().addElement("Debugging Data:"));
                body.addElement (table2);
            }
        }

        if (DEBUG && data.getACL() != null)
        {
            // Print out user's permissions.
            PRE pre = new PRE();
            Iterator rs = data.getACL().getRoles().elements();
            while ( rs.hasNext() )
            {
                String roleName =  ((Role)rs.next()).getName();
                pre.addElement(roleName + "\n");
            }
            body
                .addElement( new BR() )
                .addElement( new B("ROLES") )
                .addElement( new BR() )
                .addElement(pre);

            pre = new PRE();
            Iterator ps = data.getACL().getPermissions().elements();
            while ( ps.hasNext() )
            {
                String permissionName =  ((Permission)ps.next()).getName();
                pre.addElement(permissionName + "\n");
            }
            body
                .addElement( new BR() )
                .addElement( new B("PERMISSIONS") )
                .addElement( new BR() )
View Full Code Here

        doc.output(out);
    }

    public void outputErrorPage(Throwable e, PrintWriter out) {
        Body body = getBody();
        body.addElement(new H1("ERROR!")).addElement(new PRE().addElement(Utils.getStackTrace(e))
//          .addElement(e.getCause().toString())
            );

        Document doc = new Document().setDoctype(new Doctype.Html40Transitional()).setHtml(
            new Html().addElement(new Head()).addElement(body));
View Full Code Here

        {
            data
                .getPage()
                .getBody()
                .addElement(new H4().addElement("The exception is:"))
                .addElement(new PRE(trace))
                .addElement(new PRE(data.getStackTraceException().toString()));
        }
        return null;
    }
View Full Code Here

    public Email setMsg(String msg)
            throws MessagingException
    {
        setTextMsg(msg);
        setHtmlMsg(new ElementContainer(new Html(new Body()
                .addElement(new PRE(msg)))).toString());
        return this;
    }
View Full Code Here

        if (DEBUG)
        {
            // If there are GET/POST/PATH_INFO variables put them into
            // a <PRE></PRE> tag so that they can be displayed on the
            // page. This is of course only for example purposes.
            PRE pre = new PRE();
           
            for (Iterator it = data.getParameters().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                String[] values = data.getParameters().getStrings(key);
                if (values.length == 1)
                {
                    pre.addElement(key + " = " + values[0] + "\n");
                }
                else
                {
                    pre.addElement(key + " = ");
                    for (int i = 0; i < values.length; i++)
                    {
                        pre.addElement(values[i] + " ");
                    }
                    pre.addElement("\n");
                }
            }
            body
                .addElement(new B("Query/PathInfo Parameters"))
                .addElement(new BR())
                .addElement(pre);

            Table table2 = new Table().setBorder(0);
            Map varDebug = data.getDebugVariables();

            boolean hasValues2 = false;

            for (Iterator i = varDebug.keySet().iterator(); i.hasNext();)
            {
                String key = (String) i.next();
                String value = varDebug.get(key).toString();
                TR tr =
                    new TR().addElement(
                        new TD().addElement(new B(key))).addElement(
                        new TD().addElement(" = " + value));
                table2.addElement(tr);
                hasValues2 = true;
            }
            if (hasValues2)
            {
                body.addElement(new H4().addElement("Debugging Data:"));
                body.addElement(table2);
            }
        }

        if (DEBUG && data.getACL() != null)
        {
            // Print out user's permissions.
            PRE pre = new PRE();
            for (Iterator rs = data.getACL().getRoles().iterator();
                rs.hasNext();
                )
            {
                String roleName = ((Role) rs.next()).getName();
                pre.addElement(roleName + "\n");
            }
            body
                .addElement(new BR())
                .addElement(new B("ROLES"))
                .addElement(new BR())
                .addElement(pre);

            pre = new PRE();
            for (Iterator ps = data.getACL().getPermissions().iterator();
                ps.hasNext();
                )
            {
                String permissionName = ((Permission) ps.next()).getName();
                pre.addElement(permissionName + "\n");
            }
            body
                .addElement(new BR())
                .addElement(new B("PERMISSIONS"))
                .addElement(new BR())
View Full Code Here

        if (DEBUG)
        {
            // If there are GET/POST/PATH_INFO variables put them into
            // a <PRE></PRE> tag so that they can be displayed on the
            // page. This is of course only for example purposes.
            PRE pre = new PRE();

            for (Iterator it = data.getParameters().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                String[] values = data.getParameters().getStrings(key);
                if (values.length == 1)
                {
                    pre.addElement(key + " = " + values[0] + "\n");
                }
                else
                {
                    pre.addElement(key + " = ");
                    for (int i = 0; i < values.length; i++)
                    {
                        pre.addElement(values[i] + " ");
                    }
                    pre.addElement("\n");
                }
            }
            body
                .addElement(new B("Query/PathInfo Parameters"))
                .addElement(new BR())
                .addElement(pre);

            Table table2 = new Table().setBorder(0);
            Map varDebug = data.getDebugVariables();

            boolean hasValues2 = false;

            for (Iterator i = varDebug.keySet().iterator(); i.hasNext();)
            {
                String key = (String) i.next();
                String value = varDebug.get(key).toString();
                TR tr =
                    new TR().addElement(
                        new TD().addElement(new B(key))).addElement(
                        new TD().addElement(" = " + value));
                table2.addElement(tr);
                hasValues2 = true;
            }
            if (hasValues2)
            {
                body.addElement(new H4().addElement("Debugging Data:"));
                body.addElement(table2);
            }
        }

        if (DEBUG && data.getACL() != null)
        {
            // Print out user's permissions.
            PRE pre = new PRE();
            for (Iterator rs = data.getACL().getRoles().iterator();
                rs.hasNext();
                )
            {
                String roleName = ((Role) rs.next()).getName();
                pre.addElement(roleName + "\n");
            }
            body
                .addElement(new BR())
                .addElement(new B("ROLES"))
                .addElement(new BR())
                .addElement(pre);

            pre = new PRE();
            for (Iterator ps = data.getACL().getPermissions().iterator();
                ps.hasNext();
                )
            {
                String permissionName = ((Permission) ps.next()).getName();
                pre.addElement(permissionName + "\n");
            }
            body
                .addElement(new BR())
                .addElement(new B("PERMISSIONS"))
                .addElement(new BR())
View Full Code Here

TOP

Related Classes of org.apache.ecs.html.PRE

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.