Package org.apache.turbine.util

Examples of org.apache.turbine.util.ParameterParser


     */
    public void doPerform(RunData data) throws Exception
    {
        try
        {
            ParameterParser parser = data.getParameters();
            //String username = parser.getString(USER, "admin");
            //String password = parser.getString(PASSWORD);
      boolean checkImport = parser.getBoolean(CHECK_IMPORT, false);

            //JetspeedUser admin = JetspeedSecurity.login(username, password);
            String username = data.getUser().getUserName();
            if (!JetspeedSecurity.hasRole(username, "admin"))
            {
View Full Code Here


    /**
    Get the content for this JCP Admin
    */
    public ConcreteElement getContent( RunData rundata ) {

        ParameterParser params = rundata.getParameters();
       
        String provider = params.getString( PROVIDER_NAME_KEY );
       
        if ( provider == null ) {
            return this.getProviders( rundata );
        } else if ( params.getString( POST_ARTICLE ) != null ) {
            //post the article if the user has hit the submit button.
            params.remove( PROVIDER_NAME_KEY );
            params.remove( POST_ARTICLE );
            return this.postArticle( provider, rundata );
        } else {
            //get the form if a provider is specified.
            params.remove( PROVIDER_NAME_KEY );
            return this.getForm( provider, rundata );
        }
    
    }
View Full Code Here

    /**
    */
    public synchronized ConcreteElement postArticle( String provider, RunData rundata ) {
        ElementContainer ec = new ElementContainer();

        ParameterParser params = rundata.getParameters();       
       
        String topic = params.getString( "topic", "" );
        String title = params.getString( "title", "" );
        String link  = params.getString( "link", "" );
        String description  = params.getString( "description", "" );
       
        //create the JCM item
        Item item = new Item();
        item.setTopic( topic );
        item.setTitle( title );
View Full Code Here

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

    /**
    Get the content of a bookmarklet for the given provider.
    */
    private String getBookmarklet( String provider, RunData rundata ) {
       
        ParameterParser params = rundata.getParameters();
       
        StringBuffer buff = new StringBuffer();
       
        //create the JavaScript entry
       
View Full Code Here

       
        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() ) {
View Full Code Here

       
        // Portlet whom this action is a target of
        Portlet portlet = (Portlet) context.get(GenericMVCPortlet.PORTLET);

        // ParameterParser.
        ParameterParser pp = data.getParameters();
        String button = pp.convert(BUTTON);

        // Loop through and find the button.
        for (Enumeration e = pp.keys(); e.hasMoreElements();)
          {

            String key = (String) e.nextElement();

            if (key.startsWith(button))
View Full Code Here

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

    /**
    Get the content for this JCP Admin
    */
    public ConcreteElement getContent( RunData rundata ) {

        ParameterParser params = rundata.getParameters();
       
        String provider = params.getString( PROVIDER_NAME_KEY );
       
        if ( provider == null ) {
            return this.getProviders( rundata );
        } else if ( params.getString( POST_ARTICLE ) != null ) {
            //post the article if the user has hit the submit button.
            params.remove( PROVIDER_NAME_KEY );
            params.remove( POST_ARTICLE );
            return this.postArticle( provider, rundata );
        } else {
            //get the form if a provider is specified.
            params.remove( PROVIDER_NAME_KEY );
            return this.getForm( provider, rundata );
        }
    
    }
View Full Code Here

    /**
    */
    public synchronized ConcreteElement postArticle( String provider, RunData rundata ) {
        ElementContainer ec = new ElementContainer();

        ParameterParser params = rundata.getParameters();       
       
        String topic = params.getString( "topic", "" );
        String title = params.getString( "title", "" );
        String link  = params.getString( "link", "" );
        String description  = params.getString( "description", "" );
       
        //create the JCM item
        Item item = new Item();
        item.setTopic( topic );
        item.setTitle( title );
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.ParameterParser

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.