Package org.apache.ecs.html

Examples of org.apache.ecs.html.Form


        // ----------
        Input newButton = new Input(Input.BUTTON, "nwbttn", labels.getLabel("create"));
        newButton.setOnClick("addNewUser()");


        Form form = getFormWithCustomButton("Users", listField.getEditor(),
                            newButton, labels, false, true);
        form.addElement(new Input(Input.HIDDEN, NEW_USER_ID, ""));

        // Add Javascript alert box to display error message if a new user was created with
        // already existing login name
       
        String scriptString = new String("");
        if(invalidNewUserLoginError == true) {
            scriptString = getErrorAlertCommand(labels.getLabel("invalid_new_user_login"));
        } else if(newUserLoginAlreadyExistsError == true) {
            scriptString = getErrorAlertCommand(labels.getLabel("new_user_login_exists"));
        }
       
        return form.toString() + scriptString;
    }
View Full Code Here


                    new TD().setAlign(AlignType.RIGHT).addElement(new B("Language"))).addElement(
                    new TD().addElement(languageSelect)))
            .addElement(
                new TR().addElement(new TD().setColSpan(2).setAlign(AlignType.CENTER).addElement(
                    new HR()).addElement(new Input(Input.SUBMIT, "login", "Login"))));
        Body body = new Body().addElement(getBox("pics/tab/", new Form(
            "Login",
            Form.POST,
            Form.ENC_DEFAULT).addElement(table), "Smilehouse OpenSyncro Login"));

        // --------------
View Full Code Here

     * @return A ConcreteElement.
     * @throws Exception a generic exception.
     */
    public ConcreteElement doBuild(RunData data) throws Exception
    {
        Form form;
        form = new Form(
            new TurbineURI(data,
                           TurbineConstants.SCREEN_DEFAULT_DEFAULT,
                           TurbineConstants.ACTION_LOGOUT_DEFAULT,
                           true).getRelativeLink(),
            Form.POST).addElement(new Input("SUBMIT", "Logout", "Logout"));
View Full Code Here

    @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
    */
    private Form getForm( String daemon, RunData rundata ) {


        Form form = new Form();

        ParameterParser params = rundata.getParameters();
        Enumeration keys = params.keys();
        while( keys.hasMoreElements() ) {
            String key = (String)keys.nextElement();
            String value = (String)params.getString(key, "");
            form.addElement( new Input( ).setName( key )
                .setType( "hidden" )
                .setValue( value ) );
        }



        form.addElement( new Input().setType( "submit" )
                                    .setName( REFRESH )
                                    .setValue( REFRESH ) );

        form.addElement( new Input().setType( "hidden" )
                                    .setName( DAEMON )
                                    .setValue( daemon ) );

        return form;
    }
View Full Code Here

    */
    private ConcreteElement getForm( String provider, RunData rundata ) {
       
        DynamicURI duri = new DynamicURI( rundata );
       
        Form form = new Form().setActionduri.toString() );

        Table table = new Table().setBorder(0);
        form.addElement( table );
       

        ParameterParser params = rundata.getParameters();
       
        //get the default values if they were specified as params
        String topic = params.getString( "topic", "" );
        String title = params.getString( "title", "" );
        String link  = params.getString( "link", "" );
        String description  = params.getString( "description", "" );
       

        //build a select box for adding topics to.
       
        Content content = null;
        try {
            content = this.getContentMarkup( this.getURL( provider ) ).getContent();
        } catch ( Exception e ) {
            logger.error("Exception",  e);
            return new StringElement( "Can't use this provider: " + e.getMessage() );
        }
       
        Select select = new Select();
        select.setName( "topic" );

        //entry topics
        Entry[] topics = content.getChannel().getTopics().getEntry();
       
        //populate the select box
        for ( int i = 0; i < topics.length; ++i ) {
            String name = topics[i].getName();
            select.addElement( new Option( name ).addElement( name ) );
        }

       
        //fix me... this needs to be a SELECT box
        table.addElement( getRow( "Topic: ", select ) );
                                                      
        table.addElement( getRow( "Title: ", new Input().setType("text")
                                                       .setName("title")
                                                       .setValue( title ) ) );

        table.addElement( getRow( "Link: ", new Input().setType("text")
                                                      .setName("link")
                                                      .setValue( link ) ) );

        table.addElement( new TR().addElement( new TD().setColSpan(2)
            .addElement( new TextArea().setName("description")
                                       .setCols( 65 )
                                       .setRows( 15 )
                                       .addElement( description ) ) ) );
       
        form.addElement( new Input().setType( "hidden" )
                                    .setName( PROVIDER_NAME_KEY )
                                    .setValue( provider ) );
                                   
        form.addElement( new Input().setType( "submit" )
                                    .setName( POST_ARTICLE )
                                    .setValue( POST_ARTICLE ) );

        return new Center( form );

View Full Code Here

    */
    private ConcreteElement getForm( String provider, RunData rundata ) {
       
        DynamicURI duri = new DynamicURI( rundata );
       
        Form form = new Form().setActionduri.toString() );

        Table table = new Table().setBorder(0);
        form.addElement( table );
       

        ParameterParser params = rundata.getParameters();
       
        //get the default values if they were specified as params
        String topic = params.getString( "topic", "" );
        String title = params.getString( "title", "" );
        String link  = params.getString( "link", "" );
        String description  = params.getString( "description", "" );
       

        //build a select box for adding topics to.
       
        Content content = null;
        try {
            content = this.getContentMarkup( this.getURL( provider ) ).getContent();
        } catch ( Exception e ) {
            logger.error("Exception",  e);
            return new StringElement( "Can't use this provider: " + e.getMessage() );
        }
       
        Select select = new Select();
        select.setName( "topic" );

        //entry topics
        Entry[] topics = content.getChannel().getTopics().getEntry();
       
        //populate the select box
        for ( int i = 0; i < topics.length; ++i ) {
            String name = topics[i].getName();
            select.addElement( new Option( name ).addElement( name ) );
        }

       
        //fix me... this needs to be a SELECT box
        table.addElement( getRow( "Topic: ", select ) );
                                                      
        table.addElement( getRow( "Title: ", new Input().setType("text")
                                                       .setName("title")
                                                       .setValue( title ) ) );

        table.addElement( getRow( "Link: ", new Input().setType("text")
                                                      .setName("link")
                                                      .setValue( link ) ) );

        table.addElement( new TR().addElement( new TD().setColSpan(2)
            .addElement( new TextArea().setName("description")
                                       .setCols( 65 )
                                       .setRows( 15 )
                                       .addElement( description ) ) ) );
       
        form.addElement( new Input().setType( "hidden" )
                                    .setName( PROVIDER_NAME_KEY )
                                    .setValue( provider ) );
                                   
        form.addElement( new Input().setType( "submit" )
                                    .setName( POST_ARTICLE )
                                    .setValue( POST_ARTICLE ) );

        return new Center( form );

View Full Code Here

    @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
    */
    private Form getForm( String daemon, RunData rundata ) {


        Form form = new Form();

        ParameterParser params = rundata.getParameters();
        Enumeration keys = params.keys();
        while( keys.hasMoreElements() ) {
            String key = (String)keys.nextElement();
            String value = (String)params.getString(key, "");
            form.addElement( new Input( ).setName( key )
                .setType( "hidden" )
                .setValue( value ) );
        }



        form.addElement( new Input().setType( "submit" )
                                    .setName( REFRESH )
                                    .setValue( REFRESH ) );

        form.addElement( new Input().setType( "hidden" )
                                    .setName( DAEMON )
                                    .setValue( daemon ) );

        return form;
    }
View Full Code Here

    */
    private ConcreteElement getForm( String provider, RunData rundata ) {
       
        DynamicURI duri = new DynamicURI( rundata );
       
        Form form = new Form().setActionduri.toString() );

        Table table = new Table().setBorder(0);
        form.addElement( table );
       

        ParameterParser params = rundata.getParameters();
       
        //get the default values if they were specified as params
        String topic = params.getString( "topic", "" );
        String title = params.getString( "title", "" );
        String link  = params.getString( "link", "" );
        String description  = params.getString( "description", "" );
       

        //build a select box for adding topics to.
       
        Content content = null;
        try {
            content = this.getContentMarkup( this.getURL( provider ) ).getContent();
        } catch ( Exception e ) {
            Log.error( e );
            return new StringElement( "Can't use this provider: " + e.getMessage() );
        }
       
        Select select = new Select();
        select.setName( "topic" );

        //entry topics
        Entry[] topics = content.getChannel().getTopics().getEntry();
       
        //populate the select box
        for ( int i = 0; i < topics.length; ++i ) {
            String name = topics[i].getName();
            select.addElement( new Option( name ).addElement( name ) );
        }

       
        //fix me... this needs to be a SELECT box
        table.addElement( getRow( "Topic: ", select ) );
                                                      
        table.addElement( getRow( "Title: ", new Input().setType("text")
                                                       .setName("title")
                                                       .setValue( title ) ) );

        table.addElement( getRow( "Link: ", new Input().setType("text")
                                                      .setName("link")
                                                      .setValue( link ) ) );

        table.addElement( new TR().addElement( new TD().setColSpan(2)
            .addElement( new TextArea().setName("description")
                                       .setCols( 65 )
                                       .setRows( 15 )
                                       .addElement( description ) ) ) );
       
        form.addElement( new Input().setType( "hidden" )
                                    .setName( PROVIDER_NAME_KEY )
                                    .setValue( provider ) );
                                   
        form.addElement( new Input().setType( "submit" )
                                    .setName( POST_ARTICLE )
                                    .setValue( POST_ARTICLE ) );

        return new Center( form );

View Full Code Here

     * @return A ConcreteElement.
     * @throws Exception a generic exception.
     */
    public ConcreteElement doBuild(RunData data) throws Exception
    {
        Form form;
        form = new Form(
            new TurbineURI(data,
                           TurbineConstants.SCREEN_DEFAULT_DEFAULT,
                           TurbineConstants.ACTION_LOGOUT_DEFAULT,
                           true).getRelativeLink(),
            Form.POST).addElement(new Input("SUBMIT", "Logout", "Logout"));
View Full Code Here

        ElementContainer body = new ElementContainer()
            .addElement(new HR().setSize(1).setNoShade(true))
            .addElement(new B().addElement(
               new Font().setColor(HtmlColor.green).setSize(2)
                   .addElement("Turbine - A Servlet Framework for building Secure Dynamic Websites.")))
            .addElement( new Form( new DynamicURI ( data, "DefaultScreen", "LogoutUser", true ).toString(),
                         Form.POST ).addElement(new Input("SUBMIT", "Logout", "Logout") ) );

        if (DEBUG  &&  data.getUser() != null)
        {
            TD perm = new TD().setVAlign(AlignType.TOP);
View Full Code Here

TOP

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

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.