portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Golden <ggol...@umich.edu>
Subject RE: Jetspeed Proposal: iframe portlet control
Date Thu, 14 Mar 2002 05:20:14 GMT
David (and company) -

Just got back to this part of the project!  Thanks to you and Paul and the
others for all the work on the peid stuff!

I'm having some troubles...

This email is long, but look close, and you may find useful stuff within (as
well as my plea for help!)

* * *

The iframe (in which I want the just-the-portlet-no-control) src= has a url:
/jetspeed/portal?action=Content&js_peid=29

My Content action sets the rundata's js_peid, and selects the "Content"
screen/layout.

The Content screen .vm has:

$jetspeed.getPortalElement($data.Js_peid)

My psml has an entry like this to place my iframe control:

        <entry id="29" parent="chef.chat">
             <control name="iFramePortletControl" />
        </entry>

If I *do not* add an "id=" to my psml <entry> for this portlet, it gets the
automatic id of "29".  If I look at the url for the maximize button (et al),
they all have "js_peid=29" for this portlet.  In the VelocityPortletControl
extension class I wrote for the iframe portlet control, the
getPortlet().getID() gives me "29" (which is how it gets into the iframe's
src=).  All sound good?

Well, it doesn't work!  The getPortalElement() call ends up returning the
string: "not implemented - PortletElement"

THEN... If I add to my psml file <entry id="987" ...> for the entry that has
my iframe control, the above all is the same, substitute a "987" for "29"...
and it DOES work! The getPortalElement() returns the
just-the-portlet-content-no-control, as expected.

The only difference is that I did the numbering (and used a different number
???)  Does this make any sense to you?

Note: intead of me using "987" I used "29", and it still worked, so it's not
the number I choose, but that I set the number).

* * *

I tried one other thing.  I had originally extended JetspeedTool with
getPortletContent(), based on getPortlet(), but where getPortlet() finds a
control-and-portlet and renders the control, getPortletContent() found the
control-and-portlet and renders the portlet.  So, I re-extended the new
JetspeedTool, adding getPortletContentById() in the same way, i.e. from
getPortletById(), but using the portlet not the control.  The changed part
of the function looks like this:

                    // unstack the controls to find the real PortletSets
                    Portlet real = p;
                    while (real instanceof PortletControl)
                    {
                        real = ((PortletControl)p).getPortlet();
                    }
                    if (real instanceof PortletSet)
                    {
                        // we'll explore this set afterwards
                        sets.push(real);
                    }
                    else
                    {
                        if (p.getID().equals(peid))
                        {                        
                            found = real;     // CHANGED FROM found = p;
                        }
                    }


When I use this JetspeedTool, and I don't number the psml file entry (I let
it auto number and get "29" again for this portlet), and use the following
in the Content screen .vm:

$jetspeed.getPortletContentById($data.Js_peid)

It works!  The getPortalElement() is different from getPortletById() and my
getPortletContentById().  Can you see what's keeping getPortalElement() from
finding the auto-numbered portlet?

* * *

Is it correct that a VelocityPortletControl's getPortlet().getID() gives the
portlet-itself rather than the portlet's control's id?  Maybe I have the
wrong ID?  If so, what's the correct way from that point (where the iframe's
src= url is generated and placed into the context) to get the right ID, i.e.
that for the portlet, not the control?  I checked the getPortlet() object in
there, and it's NOT an instanceof PortletControl, so I think I've got this
right, but just want to check! 

* * *

One minor point - I noticed that these routines in the JetspeedTool have
this code:

                   Portlet real = p;
                    while (real instanceof PortletControl)
                    {
                        real = ((PortletControl)p).getPortlet();
                    }

The "while" bothered me... If we need a while, that implies that we might
have a nest more than a single level deep and we are hunting down down down
until we find a non-control portlet... If that's ever the case, this code
will HANG, as the test (real) never changes... Since p never changes!

It probably should read:

                   Portlet real = p;
                    while (real instanceof PortletControl)
                    {
                        real = ((PortletControl) /**/ real
/**/).getPortlet();
                    }

Or, if we don't expect a nesting, a simple "if", not a "while", would be
enough, and safe.

* * *

One other problem I noticed.  When we maximize now, Maximize action sets
"js_peid" into the user's setTemp().  I think this gets added to all
incoming requests in the session, even if not on the URL, right?

The new templates (like Maximize.vm) use $data.Js_peid.  The Maximize action
sets the rundata's setJs_peid() also, making it available to the template as
$data.Js_peid.

Unless you come back to the screen with a "/jetspeed/portal" sort of URL,
without the action encoded.  Now, if I understand the user setTemp() right,
the request parameter will include the "js_peid" as stashed away by the
Maximize action that got us maximized, BUT there's no action to set the
rundata's setJs_peid(), and the templates don't see the peid and complain
so.  Do you see this problem?

Either we need something that sets the rundata's special access functions
(like setJs_peid()) for all incoming requests (based on the URL and
setTemp() stuff), or the template needs to use something like:

$data.getParameters().getString("js_peid")

Instead of

$data.Js_peid

Does this make sense?

* * *

Thanks for your help.

- Glenn
 
--------------------------------------------
Glenn R. Golden, Systems Research Programmer
University of Michigan School of Information
ggolden@umich.edu               734-615-1419
http://www-personal.si.umich.edu/~ggolden/
--------------------------------------------


> -----Original Message-----
> From: David Sean Taylor [mailto:david@bluesunrise.com]
> Sent: Thursday, March 07, 2002 8:29 PM
> To: 'Jetspeed Developers List'
> Subject: RE: Jetspeed Proposal: iframe portlet control
> 
> 
> Glenn,
> 
> I checked in a new tool :
> 
> jetspeed.getPortalElement(id)
> 
> Give it a try in your Iframe.
> It will not work for PortletSets right now. Only portlets (without the
> control). You will also need to write your own screen and layout. In 
> the screen do this:
> 
> $jetspeed.getPortalElement("5")
> 
> Where 5 is the number of a portlet. You will need to number your
> portlets in your psml file.

... snip ...

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message