portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aurelien Pernoud" <apern...@sopragroup.com>
Subject RE: How to display a portlet that's not in a user's psml
Date Tue, 03 Jun 2003 08:30:07 GMT
You may try JetspeedTool.getPortletFromRegistry(String portletName, String
controlName), using $jetspeed in a velocity template (package
org.apache.jetspeed.util.template), it's hardcoded, so everyone will get it.
You can then check if the user has logged to display it or not...

Although I've been using it once in top.vm to show a portlet on top center
page for every users, and I met some surprise : the top.vm was like :

#top.vm
<div>
#if ($data.User.hasLoggedIn())
##
## This is the top naviation bar displayed for a logged in user
##
  <table cellspacing="0" border="0" width="100%">
    <tr valign="middle">
      ##
      ## Display the company logo with link back to the the portal home page
      ##
      <td align="left" width="30%">
        <a href="$jslink.HomePage">
          <img border="0" alt="$l10n.HOME" src="$LogoURI">
        </a>
      </td>
      ##
      ## Display the welcome message.  This is typicaly where a Banner AD is
displayed
      ##
      <td align="center">
$jetspeed.getPortletFromRegistry("myportlet","mycontrol")
      </td>

and the html generated was first the content of the portlet (let's say a
hello world portlet), and THEN, the content of top.vm :

<b>Hello World</b>
<div>
  <table cellspacing="0" border="0" width="100%">
    <tr valign="middle">
      <td align="left" width="30%">
        <a href="$jslink.HomePage">
          <img border="0" alt="$l10n.HOME" src="$LogoURI">
        </a>
      </td>
      <td align="center">
      </td>

and not what I expected :
<div>
  <table cellspacing="0" border="0" width="100%">
    <tr valign="middle">
      <td align="left" width="30%">
        <a href="$jslink.HomePage">
          <img border="0" alt="$l10n.HOME" src="$LogoURI">
        </a>
      </td>
      <td align="center">
<b>Hello World</b>
      </td>

Very very weird. It's the only side effect I noticed, and I don't understand
why, it only happens when using $tool in top.vm, not in any other templates.

HTH,
Aurelien

Jeremy Ford a écrit :

> I've been thinking that I would like to create some utility portlets
> that can be accessed by any user/role/group psml but not necessarily
> have that portlet defined as an entry in the psml.  Does anyone know
> of any way of doing this currently?  Here's one scenario as an
> example:
>
> A user would like to change their language settings in Jetspeed.  To
> do this currently, you need to add the ChangeLanguage portlet to a
> psml and then use it.  What I would like to do is have this portlet
> accessible from any user/role/group psml without it specifically
> defined in the psml.
>
> If there's not already a method of doing this, perhaps a new action
> could be added.  I would think that this might be similar to how the
> Customizer works currently.  Perhaps this action could be generic so
> that it loads portlets into a page, including the customizer, for use
> by any user,etc...
>
> Is this unreasonable?  Is is possible?  Any thoughts welcome.
>
> Jeremy Ford


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


Mime
View raw message