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 Enrique Perez <pe...@dit.upm.es> on 2007/02/26 19:20:10 UTC

Doubt about basic portlet concept

Hi all,

I've created a portlet application containing a portlet that extends 
IFramePortlet to navigate to an specific URL... and I've included the 
portlet in two different psml pages in order to refer two different URLs 
at the same time...

As far as I know, I would expect to have two different and independent 
instances of the portlet class (created by the portlet container), but I 
think they are totally messed up...
For example, the portlet gets the portal user who is accessing the 
portlet and saves it to a private attribute, so before any user has 
logged in i can see that is a guest user who is accessing the portlet... 
Then i register as a new user and try to view the portlet content. I can 
see that the previous user was "guest" and also the username of the new 
user... But then i go to see the content of the other portlet and it 
says that the previous user was "username" (where i would expect to see 
"guest") and actual user is also "username"...
I don't know if I've explained my problem properly...

Supposed:

    * Portlet A (in psml page A)
    * Portlet B (in psml page B)

Situation 1 (nobody has logged in yet, but we're viewing "Portlet A"):

    * Portlet A:
          o Previous user: null
          o Actual user: null
    * Portlet B (is supposed to display the same info)

Situation 2 ("user1" logs in and asks portlet A to render):

    * Portlet A:
          o Previous user: null
          o Actual user: user1
    * Portlet B ¿?

Situation 3 ("user1" asks portlet B to render clicking on page B tab):

    * Portlet A: ¿?
    * Portlet B:
          o Previous user: user1
          o Actual user: user1

But since "Portlet B" has not been asked to render yet, I would expect 
it to show "null" as previous user...
So I guess both portlets are modifying the same instance, and maybe 
that's the reason why I'm having problems displaying the URL content... 
=/ (Both are trying to display the same page...)

Does anybody know how many instances should be created? Can anyone give 
me some insight in the matter?

Thanks in advance and regards.

PS: sorry for my English

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


Re: Doubt about basic portlet concept

Posted by Enrique Perez <pe...@dit.upm.es>.
Hi Aaron,

The fragments I have are:

    <fragment id="prueba-p-5" type="portlet"
    name="Test_1::Alfresco_WebClient_Portlet">
            <property layout="TwoColumns" name="row" value="3" />
            <property layout="TwoColumns" name="column" value="0" />
            <!-- Portlet Preferences -->
            <preference name="ALFRESCO_SERVER_ADDRESS">
                <value>localhost</value>
            </preference>
            <preference name="NODE_UUID">
                <value>81ac88b1-c031-11db-8d91-6d811b5c1f39</value>
            </preference>
            <preference name="height">
                <value>600</value>
            </preference>
    </fragment>

    <fragment id="cms-p-2" type="portlet"
    name="Test_1::Alfresco_WebClient_Portlet">
          <property layout="OneColumn" name="row" value="0" />
          <property layout="TwoColumns" name="column" value="0" />
          <preference name="height">
            <value>800</value>
          </preference>
    </fragment>

So I guess they have different id's...
I don't know... maybe the problem is something related to the cache 
(browser cache, j2 cache, portlet cache or alfresco cache...)

Regards.


Aaron Evans escribió:
> Enrique,
> what are the fragment IDs that you are using in your PSML pages? Are
> they the same value? If so, that is your problem...
>
> On 2/26/07, Enrique Perez <pe...@dit.upm.es> wrote:
>> Hi all,
>>
>> I've created a portlet application containing a portlet that extends
>> IFramePortlet to navigate to an specific URL... and I've included the
>> portlet in two different psml pages in order to refer two different URLs
>> at the same time...
>>
>> As far as I know, I would expect to have two different and independent
>> instances of the portlet class (created by the portlet container), but I
>> think they are totally messed up...
>> For example, the portlet gets the portal user who is accessing the
>> portlet and saves it to a private attribute, so before any user has
>> logged in i can see that is a guest user who is accessing the portlet...
>> Then i register as a new user and try to view the portlet content. I can
>> see that the previous user was "guest" and also the username of the new
>> user... But then i go to see the content of the other portlet and it
>> says that the previous user was "username" (where i would expect to see
>> "guest") and actual user is also "username"...
>> I don't know if I've explained my problem properly...
>>
>> Supposed:
>>
>>     * Portlet A (in psml page A)
>>     * Portlet B (in psml page B)
>>
>> Situation 1 (nobody has logged in yet, but we're viewing "Portlet A"):
>>
>>     * Portlet A:
>>           o Previous user: null
>>           o Actual user: null
>>     * Portlet B (is supposed to display the same info)
>>
>> Situation 2 ("user1" logs in and asks portlet A to render):
>>
>>     * Portlet A:
>>           o Previous user: null
>>           o Actual user: user1
>>     * Portlet B ¿?
>>
>> Situation 3 ("user1" asks portlet B to render clicking on page B tab):
>>
>>     * Portlet A: ¿?
>>     * Portlet B:
>>           o Previous user: user1
>>           o Actual user: user1
>>
>> But since "Portlet B" has not been asked to render yet, I would expect
>> it to show "null" as previous user...
>> So I guess both portlets are modifying the same instance, and maybe
>> that's the reason why I'm having problems displaying the URL content...
>> =/ (Both are trying to display the same page...)
>>
>> Does anybody know how many instances should be created? Can anyone give
>> me some insight in the matter?
>>
>> Thanks in advance and regards.
>>
>> PS: sorry for my English
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>


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


Re: Doubt about basic portlet concept

Posted by Aaron Evans <aa...@gmail.com>.
Enrique,
what are the fragment IDs that you are using in your PSML pages? Are
they the same value? If so, that is your problem...

On 2/26/07, Enrique Perez <pe...@dit.upm.es> wrote:
> Hi all,
>
> I've created a portlet application containing a portlet that extends
> IFramePortlet to navigate to an specific URL... and I've included the
> portlet in two different psml pages in order to refer two different URLs
> at the same time...
>
> As far as I know, I would expect to have two different and independent
> instances of the portlet class (created by the portlet container), but I
> think they are totally messed up...
> For example, the portlet gets the portal user who is accessing the
> portlet and saves it to a private attribute, so before any user has
> logged in i can see that is a guest user who is accessing the portlet...
> Then i register as a new user and try to view the portlet content. I can
> see that the previous user was "guest" and also the username of the new
> user... But then i go to see the content of the other portlet and it
> says that the previous user was "username" (where i would expect to see
> "guest") and actual user is also "username"...
> I don't know if I've explained my problem properly...
>
> Supposed:
>
>     * Portlet A (in psml page A)
>     * Portlet B (in psml page B)
>
> Situation 1 (nobody has logged in yet, but we're viewing "Portlet A"):
>
>     * Portlet A:
>           o Previous user: null
>           o Actual user: null
>     * Portlet B (is supposed to display the same info)
>
> Situation 2 ("user1" logs in and asks portlet A to render):
>
>     * Portlet A:
>           o Previous user: null
>           o Actual user: user1
>     * Portlet B ¿?
>
> Situation 3 ("user1" asks portlet B to render clicking on page B tab):
>
>     * Portlet A: ¿?
>     * Portlet B:
>           o Previous user: user1
>           o Actual user: user1
>
> But since "Portlet B" has not been asked to render yet, I would expect
> it to show "null" as previous user...
> So I guess both portlets are modifying the same instance, and maybe
> that's the reason why I'm having problems displaying the URL content...
> =/ (Both are trying to display the same page...)
>
> Does anybody know how many instances should be created? Can anyone give
> me some insight in the matter?
>
> Thanks in advance and regards.
>
> PS: sorry for my English
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

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