Package org.apache.ecs

Examples of org.apache.ecs.ElementContainer


     */
    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 (onChangeSet)
        {
            monthSelect.setOnChange(onChange);
            yearSelect.setOnChange(onChange);
        }
        ElementContainer ec = new ElementContainer();
        // ec.addElement(new Comment("== BEGIN org.apache.turbine.util.DateSelector.ecsOutput() =="));
        ec.addElement(monthSelect);
        ec.addElement(daySelect);
        ec.addElement(yearSelect);
        // ec.addElement(new Comment("== END org.apache.turbine.util.DateSelector.ecsOutput() =="));
        return (ec);
    }
View Full Code Here

                           TurbineConstants.SCREEN_DEFAULT_DEFAULT,
                           TurbineConstants.ACTION_LOGOUT_DEFAULT,
                           true).getRelativeLink(),
            Form.POST).addElement(new Input("SUBMIT", "Logout", "Logout"));

        ElementContainer body = new ElementContainer()
                .addElement(new HR().setSize(1).setNoShade(true))
                .addElement(
                    new B().addElement(
                        new Font().setColor(HtmlColor.green).setSize(
                            2).addElement(
                            txt)))
                .addElement(form);

        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);
        }
View Full Code Here

            hourSelect.setOnChange(onChange);
            minuteSelect.setOnChange(onChange);
            ampmSelect.setOnChange(onChange);
        }

        ElementContainer ec = new ElementContainer();
        ec.addElement(new Comment(
                "== BEGIN org.apache.turbine.util.TimeSelector.ecsOutput() =="));
        ec.addElement(hourSelect);
        ec.addElement(":");
        ec.addElement(minuteSelect);
        if (this.showSeconds == true)
            ec.addElement(":");
        ec.addElement(secondSelect);
        if (this.timeFormat == TimeSelector.TWELVE_HOUR)
        {
            ec.addElement(ampmSelect);
        }
        ec.addElement(new Comment(
                "== END org.apache.turbine.util.TimeSelector.ecsOutput() =="));
        return (ec);
    }
View Full Code Here

     * @exception Exception, a generic exception.
     */
    public ConcreteElement doBuild(RunData data)
            throws Exception
    {
        ElementContainer body = new ElementContainer();
        ElementContainer message = new ElementContainer();

        StringBuffer sb = new StringBuffer();
        sb.append("<b>There has been an error.</b>")
                .append("<p>")
                .append("- If you used the browser \"Back\" or \"Reload\"")
                .append(" buttons please use the navigation buttons we provide")
                .append(" within the screen.")
                .append("<p>")
                .append("Please click ");

        message.addElement(sb.toString());
        ParameterParser pp;
        pp = (ParameterParser) data.getUser().getTemp("prev_parameters");
        pp.remove("_session_access_counter");

        TurbineURI back = new TurbineURI(data,(String) data.getUser().getTemp("prev_screen"));
        back.addPathInfo(pp);
        message.addElement(new A().setHref(back.getRelativeLink()).addElement("here"));

        message.addElement(" to return the the screen you were working on.");

        body.addElement(message);
        return body;
    }
View Full Code Here

        Form form;
        form = new Form(
            new DynamicURI(data,"DefaultScreen","LogoutUser",true).toString(),
            Form.POST)
                .addElement(new Input("SUBMIT", "Logout", "Logout"));
        ElementContainer body = new ElementContainer()
            .addElement(new HR().setSize(1).setNoShade(true))
            .addElement(new B().addElement(
               new Font().setColor(HtmlColor.green).setSize(2).addElement(txt)))
            .addElement(form);

        if (DEBUG  &&  data.getUser() != null)
        {
            TD perm = new TD().setVAlign(AlignType.TOP);
            TD temp = new TD().setVAlign(AlignType.TOP);
            java.util.Enumeration ePerm =
                data.getUser().getPermStorage().keys();
            java.util.Enumeration eTemp =
                data.getUser().getTempStorage().keys();

            perm.addElement("Perm values:").addElement( new BR() );
            temp.addElement("Temp values:").addElement( new BR() );
            while ( ePerm.hasMoreElements() )
            {
                String key = (String) ePerm.nextElement();
                String value = data.getUser().getPerm(key).toString();
                perm.addElement( key + "=" + value )
                    .addElement( new BR() );
            }
            while ( eTemp.hasMoreElements() )
            {
                String key = (String) eTemp.nextElement();
                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();
            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() )
                .addElement(pre);
View Full Code Here

     * @exception Exception, a generic exception.
     */
    public ConcreteElement doBuild( RunData data )
        throws Exception
    {
        ElementContainer body = new ElementContainer();
        ElementContainer message = new ElementContainer();

        StringBuffer sb = new StringBuffer();
        sb.append( "<b>There has been an error.</b>" )
            .append( "<p>" )
            .append( "- If you used the browser \"Back\" or \"Reload\"" )
            .append( " buttons please use the navigation buttons we provide" )
            .append( " within the screen." )
            .append( "<p>" )
            .append( "Please click " );

        message.addElement( sb.toString() );
        ParameterParser pp;
        pp = (ParameterParser)data.getUser().getTemp("prev_parameters");
        pp.remove("_session_access_counter");
        message.addElement( new A().setHref(
            new DynamicURI(data,(String)data.getUser().getTemp("prev_screen"))
                .addPathInfo( pp ).toString()).addElement("here") );
        message.addElement( " to return the the screen you were working on." );

        body.addElement( message );
        return body;
    }
View Full Code Here

              writeRow(logEntryOld, dFormat, colorIndex, tt, logTable, messageCell, labels);
        }
         
        }
       
        ElementContainer content = new ElementContainer()
            .addElement(new BR())
            .addElement(pager)
            .addElement(tt.getOuterTable(logTable))
            .addElement(pager)
            .addElement(new HR().addElement(form));

        return content.toString();
    }
View Full Code Here

        Input reloadComponentsButton = new Input(Input.BUTTON, "reload_components", labels
            .getLabel("reload_components"));
        reloadComponentsButton.setOnClick("document.forms[0]." + ACTION + ".value=1;document.forms[0].submit();");

      
        ElementContainer content = new ElementContainer().addElement(
            tt.getOuterTable(componentTable).setWidth("100%")).addElement(new HR()).
            addElement(reloadComponentsButton);

       
        Form form = getForm("Components", content.toString(), labels, false, false).addElement(
            new Input(Input.HIDDEN, ACTION, "0"));

        String result = form.toString();

        return result;
View Full Code Here

        generalFieldsContext.writeEditors(generalFields, generalFieldsTemplate);

        generalFieldsTemplate.write();

        ElementContainer content = new ElementContainer().addElement(new H1(pipe.getName())).addElement(
            generalFieldsTemplate.toString()).addElement(new BR()).addElement(new BR()).addElement(
            componentTable).addElement(new BR()).addElement(infoTable);

       
        Form form = getForm("EditPipe", content.toString(), labels, false, true).addElement(
            parameters.getInput(Input.HIDDEN, PIPE_ID)).addElement(
            new Input(Input.HIDDEN, CREATE_COMPONENT_OF_TYPE, "-1")).addElement(
            new Input(Input.HIDDEN, DELETE_COMPONENT_OF_TYPE, "-1"));

        return form.toString();
View Full Code Here

TOP

Related Classes of org.apache.ecs.ElementContainer

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.