Re: Portlet question

Khaled TLILI <[email protected]> Wed, 14 Feb 2007 16:32:54 +0100
Newsgroups gmane.comp.cms.jahia.devel
Message-ID <[email protected]>
Hi,

Yes it's possible

From:

http://www.jahia.org/jahia/webdav/site/jahia_org/shared/documentation/WebAppGuideDRAFT1.pdf

"
The contextid is a String that is useful to have an identifier to
separate different instances of the same application. Jahia
allows the same application to be instantiated multiple times on
the same page. *The contextID will be an identifier that will
change among these instances*, so that instance specific data
may be stored in the application. In the current implementations
of Jahia, the contextID is equivalent to the fieldID that
contains the application.
"
And 2 fields (even if in same page) have differents fielID...


In order to have contexID value:
String contextId = (String) 
request.getAttribute("org.portletapi.contextid");

You have to add in ALL your database tables a column (eg. CONTEXT_ID) in 
order to filter by context id.

Exemple:
select * from Project became select * from Project as p where 
p.context_ID = contextID.

Cheers,
Khaled.



Gustav a écrit :
> Hi ... no exactly ...
>
> My question focuses in the following:
>
> is posible to have a diferent configuration for each portlet instance in the
> site ??
>
> Suposse the following: I have a portlet that show contents of a DB table,
> and I need to show 10 tables in my site. I want to have only one
> portlet-webapp, and each time I add it to a jahia page i want to configure
> it with the table name to show. If this is not posible, there should be one
> webapp-portlet for each table I need to show. 
> I cant use the content id to filter, because there will be pages with two or
> more portlet instances (tables shown)
>
> Thanks again
> Regards
>
>
>
> Stéphane Croisier wrote:
>   
>> Something like p19 of the portlet documentation 
>> (http://www.jahia.org/jahia/webdav/site/jahia_org/shared/documentation/WebAppGuideDRAFT1.pdf)?
>>
>> Cheers,
>> Stéphane
>>
>> At 21:45 12.02.2007, you wrote:
>>
>>
>>     
>>> Hi thanks for the reply ...
>>>
>>> It works but dont solve my problem at all, because there are pages that
>>>       
> need
>   
>>> two portlet instances inside ... there is a way to pass parameters to
>>> portlet instances through Jahia ??
>>>
>>> thanks again
>>>
>>>
>>> Stéphane Croisier wrote:
>>>       
>>>> Hello,
>>>>
>>>> You can store within your porttlet the context id
>>>> of the container on the page you displayed an
>>>> instance of your porltet. This will alow you to
>>>> filter content according to such or such page.
>>>> Please take a look on how portlets examples such
>>>> as Infonews are dealing with such paramters.
>>>>
>>>> Cheers,
>>>> Stéphane
>>>>
>>>> At 18:51 09.02.2007, you wrote:
>>>>
>>>>         
>>>>> Hi ... I'm developing a portlet that shows contents of a database table
>>>>>           
>>> ...
>>>       
>>>>> I add the portlet into jahia through Administration Options, but I need
>>>>>           
>>> more
>>>       
>>>>> than one portlet instance in the site. My doubt: Is there any way to
>>>>> parametrize the table name to show ?? I want to have one
>>>>>           
>>> web-application
>>>       
>>>>> portlet and parametrize the table name instead of have one
>>>>>           
>>> web-application
>>>       
>>>>> portlet for each table i want to show ... How can I do this in Jahia ??
>>>>>
>>>>> thanks in advance
>>>>> regards
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Portlet-question-tf3201797.html#a8890344
>>>>> Sent from the Jahia - Dev mailing list archive at Nabble.com.
>>>>>
>>>>> --
>>>>> No virus found in this incoming message.
>>>>> Checked by AVG Free Edition.
>>>>> Version: 7.1.411 / Virus Database: 268.17.32/677 - Release Date:
>>>>>           
>>> 08.02.2007
>>>       
>>>> --
>>>> No virus found in this outgoing message.
>>>> Checked by AVG Free Edition.
>>>> Version: 7.1.411 / Virus Database: 268.17.36/681 - Release Date:
>>>> 11.02.2007
>>>>
>>>>
>>>>
>>>>
>>>>         
>>> --
>>> View this message in context: 
>>> http://www.nabble.com/Portlet-question-tf3201797.html#a8932428
>>> Sent from the Jahia - Dev mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>> --
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition.
>>> Version: 7.1.411 / Virus Database: 268.17.36/681 - Release Date:
>>>       
> 11.02.2007
>   
>> - -- --- -----=[ scroisier at jahia dot com ]=---- --- -- -
>> Head of Products - Jahia Ltd, Route des Jeunes 9, 1227 Carouge
>> (Switzerland)
>> Jahia : The Java Unified Web Platform
>> www.jahia.org - The Product Web Site
>> www.jahia.net - The Community Web Site
>> www.jahia.com - The Commercial Services Company 
>>
>>
>> --
>> No virus found in this outgoing message.
>> Checked by AVG Free Edition.
>> Version: 7.1.411 / Virus Database: 268.17.39/685 - Release Date:
>> 13.02.2007
>>
>>
>>
>>
>>     
>
>