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 David Sean Taylor <da...@bluesunrise.com> on 2003/01/06 07:09:42 UTC

Re: How to get the correct URL/URI for a Portlet ?

On Sunday, December 29, 2002, at 07:34  AM, Christian Heine wrote:

> Hi all,
>
> i try to develop a porltet which is using iframes to represent Datas 
> only on one screen, when the width of the datas are bigger than the 
> screen (Like a calendar over 3 years whith 52 weeks per year). All 
> works fine and looks good, but
> how can i set the correct URI to my portlet which should shown in the 
> iFrame?
>
> I've tried to use the $jlink variable with the method setPage or 
> getURI to select my own calendar.vm portlet, but it will not work, and 
> when it works, it shows me the whole jetspeed page with headers, 
> menues and so on what it not should be, because i will have to see 
> only the calendar ...
>
> At the moment i call my Portlet by hard coding : 
> http://127.0.0.1:8080/jetspeed/calendar.vm, but this forces me to put 
> the template in the main directory, what is not the way i will have. 
> Knows anybody a solution to call a portlet directly which is
> placed in the following portlet directory ? :
>
>               %jetspeed%/WEB-INF/templates/vm/portlets/html/clendar.vm
>
> Thanks for any help, by
> Christian

If I understand correctly, you want to get the content for just one 
portlet:

$jslink.getPortletById("P_56789_1234")
$jslink.getPortletByName("portlet_2")

--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646




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


Re: How to get the correct URL/URI for a Portlet ?

Posted by Gary Lawrence Murphy <ga...@canada.com>.
>>>>> "D" == David Sean Taylor <da...@bluesunrise.com> writes:

    D> $jslink.getPortletById("P_56789_1234")
    D> $jslink.getPortletByName("portlet_2")

I have a slightly different need: I want to /pop-up/ a portlet into a
simple window; the portlet configures the parameters to a java jabber
applet displayed in a bare window, so my naive approach was to use
Javascript in the navigation templates to launch it and wrap it in the
control.Print action to strip out the navigation panes, and I thought
commands like the above two would work, but ...

    <script language="JavaScript">
    <!-- Launch floating Jabber window
    var miniwin = "$jslink.getAction("controls.Print","JabberPortlet-1")";
    var remote = null;
    function jabber() {
      var ua = navigator.userAgent.toLowerCase();
      if (ua.indexOf("x11") > -1) wd = 'width=200,height=320';
      else if (ua.indexOf("mac") > -1) wd = 'width=200,height=320';
      else wd = 'width=200,height=320';
      remote = window.open(miniwin, 'miniwin', wd+',resizable=yes');
    }//  -->

    document.writeln("<a class='menu' title='launch jabber window' href='javascript:jabber()'>Launch IM</a>");
    </script>

This renders my link as

    var miniwin = "http://maya:8080/sentry/portal/media-type/html/user/staff/page/default.psml/js_peid/JabberPortlet?action=controls.Print";


which is _really_ close /except/ ... the JabberPortlet-1 portlet is
defined under the _role_ template, and is not defined on that specific
user page.  What I want to generate is .../html/ROLE/member/...

If I use getPortalById(), my pop-up page contains a blank
version of the user's page, no JabblerPortlet-1

and that's my theory why Jetspeed simply responds with the "not
implemented - PortletElement" (pseid not found??) error

How /should/ I craft the link and portal definition to create a
floating-box portlet?  Does anyone have an example they can share of a
working pop-up 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>