Package org.apache.ecs.html

Examples of org.apache.ecs.html.BR


        if( (errors == null || errors.size() == 0) && (notices == null || notices.size() == 0) ) {
            // Nothing to do...
            return content;
        }
        else {
            ElementContainer newContent = new ElementContainer().addElement(new BR());
           
            if(errors != null && errors.size() > 0) {
                UL errorList = new UL();
                for(Iterator it=errors.iterator(); it.hasNext();) {
                    errorList.addElement(new LI( (String) it.next() ));
View Full Code Here


        } catch(ComponentClassNotFoundException cnfe) {
            return "<br><b><font color=\"red\">"
                    + labels.getLabel("edited_component_class_not_found") + "</font></b><br>";
        }

        ElementContainer content = new ElementContainer().addElement(new BR()).addElement(
            new H1()
                .addElement(component.getName()));

        content.addElement(new HR());
       
View Full Code Here

        if (DEBUG && data.getUser() != null)
        {
            TD perm = new TD().setVAlign(AlignType.TOP);
            TD temp = new TD().setVAlign(AlignType.TOP);

            perm.addElement("Perm values:").addElement(new BR());
            for (Iterator it = data.getUser().getPermStorage().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                String value = data.getUser().getPerm(key).toString();
                perm.addElement(key + "=" + value).addElement(new BR());
            }

            temp.addElement("Temp values:").addElement(new BR());
            for (Iterator it = data.getUser().getTempStorage().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                String value = data.getUser().getTemp(key).toString();
                temp.addElement(key + "=" + value).addElement(new BR());
            }

            body.addElement(new BR()).addElement(new BR()).addElement(
                new Table().setBorder(2).setCellPadding(10).addElement(
                    new TR().addElement(perm).addElement(temp)));
        }
        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())
                .addElement(pre);
        }
        return body;
    }
View Full Code Here

       
        root.addElement( "The following " +
                         urls.size() +
                         " URL(s) are considered bad: " );

        root.addElement( new BR() );
       
        root.addElement( "Click on a url to take it out of the list" +
                         " and retry it in when requested. " );

        root.addElement( new BR() );
       
        UL ul = new UL();
        //FIXME: the getReason() call has to be escaped from HTML markup, CR&LF
        DynamicURI uri = new DynamicURI( rundata );
       
        ParameterParser params = rundata.getParameters();
        uri.addQueryData( params );
       
        Iterator i = urls.iterator();
       
        while ( i.hasNext() ) {
            URLInfo info = URLManager.getInfo( (String)i.next() );
            /* It can happen that url is no longer in list while
               we are processing */
            if( info != null ) {
                uri.removeQueryData( RETRY_URL );
                uri.addQueryData(RETRY_URL, info.getURL());
                ul.addElement( new LI()
                    .addElement( new A(uri.toString() )
                        .addElement( info.getURL() ) )
                    .addElement( new B( info.getMessage() ) ) );
            }
        }
       
        root.addElement( ul );

        java.util.Hashtable rt = URLFetcher.getRealtimeURLs();

        root.addElement( "The following " +
                         rt.size() +
                         " URL(s) are being loaded: " );

        root.addElement( new BR() );
        ul = new UL();
       
        java.util.Enumeration en = rt.keys();
        while (en.hasMoreElements()) {
            String key = (String)en.nextElement();
View Full Code Here

                                 String title ) {


        ec.addElement( new HR() );
        ec.addElement( new B().addElement( title + ":" ) );
        ec.addElement( new BR() );
                                    
    }
View Full Code Here

        ElementContainer ec = new ElementContainer();
       
        ec.addElement( title );
        ec.addElement( " -> " );
        ec.addElement( value );
        ec.addElement( new BR() );
       
        return ec;
    }
View Full Code Here

       
        root.addElement( "The following " +
                         urls.size() +
                         " URL(s) are considered bad: " );

        root.addElement( new BR() );
       
        root.addElement( "Click on a url to take it out of the list" +
                         " and retry it in when requested. " );

        root.addElement( new BR() );
       
        UL ul = new UL();
        //FIXME: the getReason() call has to be escaped from HTML markup, CR&LF
        DynamicURI uri = new DynamicURI( rundata );
       
        ParameterParser params = rundata.getParameters();
        uri.addQueryData( params );
       
        Iterator i = urls.iterator();
       
        while ( i.hasNext() ) {
            URLInfo info = URLManager.getInfo( (String)i.next() );
            /* It can happen that url is no longer in list while
               we are processing */
            if( info != null ) {
                uri.removeQueryData( RETRY_URL );
                uri.addQueryData(RETRY_URL, info.getURL());
                ul.addElement( new LI()
                    .addElement( new A(uri.toString() )
                        .addElement( info.getURL() ) )
                    .addElement( new B( info.getMessage() ) ) );
            }
        }
       
        root.addElement( ul );

        java.util.Hashtable rt = URLFetcher.getRealtimeURLs();

        root.addElement( "The following " +
                         rt.size() +
                         " URL(s) are being loaded: " );

        root.addElement( new BR() );
        ul = new UL();
       
        java.util.Enumeration en = rt.keys();
        while (en.hasMoreElements()) {
            String key = (String)en.nextElement();
View Full Code Here

                                 String title ) {


        ec.addElement( new HR() );
        ec.addElement( new B().addElement( title + ":" ) );
        ec.addElement( new BR() );
                                    
    }
View Full Code Here

        ElementContainer ec = new ElementContainer();
       
        ec.addElement( title );
        ec.addElement( " -> " );
        ec.addElement( value );
        ec.addElement( new BR() );
       
        return ec;
    }
View Full Code Here

        if (DEBUG && data.getUser() != null)
        {
            TD perm = new TD().setVAlign(AlignType.TOP);
            TD temp = new TD().setVAlign(AlignType.TOP);

            perm.addElement("Perm values:").addElement(new BR());
            for (Iterator it = data.getUser().getPermStorage().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                String value = data.getUser().getPerm(key).toString();
                perm.addElement(key + "=" + value).addElement(new BR());
            }

            temp.addElement("Temp values:").addElement(new BR());
            for (Iterator it = data.getUser().getTempStorage().keySet().iterator();
                 it.hasNext();)
            {
                String key = (String) it.next();
                String value = data.getUser().getTemp(key).toString();
                temp.addElement(key + "=" + value).addElement(new BR());
            }

            body.addElement(new BR()).addElement(new BR()).addElement(
                new Table().setBorder(2).setCellPadding(10).addElement(
                    new TR().addElement(perm).addElement(temp)));
        }
        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())
                .addElement(pre);
        }
        return body;
    }
View Full Code Here

TOP

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

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.