I've been digging through this list, the jakarta portlet catalog
and several other places but haven't been able to find an example
doing something similar to what I would like.  

What I want to do is write a Java class that extends AbstractPortlet
or ApplicationPortlet. However, this class will call itself within a 
form element. A simple pared down code without all the method calls 
and imports follows. Is this possible or am I way off?
I've done similar things will servlets but can't seem to make it
work with portlets.

Thanks in advance for any help.

public class JobSubmit extends AbstractPortlet
{

    public ConcreteElement getContent(RunData data)
    {
        String text = null;
        String action = null;
        Boolean success;
 
        ParameterParser params = data.getParameters();
        action = params.getString("action");
        if (action == null)
        {
            text = "<form
method=\"POST\"action=\"/jetspeed/servlet/JobSubmit\">\n" +
                   "<input type=\"hidden\" name=\"action\"
value=\"submitjob\">\n" +
                     ..... //additional form elements here
                   "</form>
        }
        else if(action.equals("submitjob"))
        {   
            //get job parameters here
            //submit job based on parameters
            success = jobsubmit( ... );
            if(success)
            {
                text = "Job submitted succesfully!";
            } else {
                text = "Job failed!";
            }
        }
        
        return (new StringElement(text));
        
    }

-- 
_______________________________________________________________________

Aaron Andersen                                  Phone:  (303) 497-1837  
Section Manager                                 Fax:    (303) 497-1804
Operations and Information Support              e-mail: [EMAIL PROTECTED]

National Center for Atmospheric Research, PO Box 3000, Boulder CO 80307
_______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to