You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Gary Lawrence Murphy <ga...@canada.com> on 2003/01/13 05:47:43 UTC

Preserving values from doUpdate to buildNormalContext

If many eyes can make any bug shallow, then fewer eyes can make
even a dumb mistake totally opaque ;)

I have the following two methods in my form action:

    protected void buildNormalContext( VelocityPortlet portlet, 
                                       Context context,
                                       RunData rundata )
    {
        Map filter = (Map) context.get(DOCUMENT_FILTER_PROPERTY);
        ...
    }
    
    public void doUpdate(RunData data, Context context)
    {
        Map filter = new HashMap();
        String dt = params.getString("documentTitle");
        filter.put( "documentTitle", 
                    (( dt != null) ? dt : "*" ));
        String oUN = params.getString("organizationalUnitName");
        filter.put( "organizationalUnitName", 
                    (( oUN != null) ? oUN : "*" ));

        context.put(DOCUMENT_FILTER_PROPERTY, filter );
    }

Why is the filter value null in the buildNormalContext?  With Log
tracing, I see doUpdate is entered and sets up the filter Map and puts
it into the context, this is followed by JetspeedTemplatePage
calculations, user authorization and the following Velocity sequence:

 - VelocityPortlet::getVelocityContent
 - VelocityPortlet found action portlets.LocateDocumentAction context org.apache.velocity.VelocityContext@18f127c
 - Action detected with action + context
 - VelocityAction: retrieved context: org.apache.velocity.VelocityContext@18f127c
 - VelocityAction: retrieved portlet: org.apache.jetspeed.portal.portlets.CustomizerVelocityPortlet@6f4652
 - VelocityAction: building normal
 - LocateDocumentAction: buildNormalContext
 - LocateDocumentAction: No Filter

That last one is my trace line indicating that the context returned a
null value.  Isn't this the correct way to get form values back into
the displayed portlet?

-- 
Gary Lawrence Murphy - garym@teledyn.com - TeleDynamics Communications
   - blog: http://www.teledyn.com/mt/ - biz: http://teledyn.com/ -
  "Computers are useless. They can only give you answers." (Picasso)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Preserving values from doUpdate to buildNormalContext

Posted by Gary Lawrence Murphy <ga...@canada.com>.
ACK: Same answer as most answers ... "Read the Tutorial!" :)

I'll bet the _correct_ place to put this data is in rundata.getUser()

-- 
Gary Lawrence Murphy - garym@teledyn.com - TeleDynamics Communications
   - blog: http://www.teledyn.com/mt/ - biz: http://teledyn.com/ -
  "Computers are useless. They can only give you answers." (Picasso)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>