Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
hura hura
(Solved)Many instances of an portlet
5 maggio 2010 0.03
Risposta

hura hura

Punteggio: New Member

Messaggi: 19

Data di Iscrizione: 15 luglio 2009

Messaggi recenti

Hello,

Let's say I have 3 web-proxy portlets on a page, I call them portlet A, portlet B and portlet C. Now I wanna to call & pass parameters to portlet A from browser's url, for example: I'll type this:http://localhost:8080/web/guest;portlet A-params=abc. Can I do that?
Eric Devlin
RE: Many instances of an portlet
29 aprile 2010 14.02
Risposta

Eric Devlin

Punteggio: Regular Member

Messaggi: 154

Data di Iscrizione: 19 febbraio 2008

Messaggi recenti

Hey,
Not in a get. All the requests on a web proxy portlet go to /pbhs/{id}/not-used not /web/guest/. /pbhs/ receives the request and retrieves the request parameters based on the id in the url. /pbhs/ sends the retrieved request to the configured host. /pbhs/ saves the returned content. /pbhs/ then sends a redirect to the user for the portlet i.e. /web/guest/. On a post you might be able to use firebug to modify the form before it is posted. The bottom line is that if /pbhs/ doesn't find that id you won't be doing much.
I modified /pbhs/ to look for p_p_state in order to by-pass the situation in order to get an exclusive window state. I didn't want the page reloaded just a frame in the content.
Eric
hura hura
RE: Many instances of an portlet
1 maggio 2010 11.06
Risposta

hura hura

Punteggio: New Member

Messaggi: 19

Data di Iscrizione: 15 luglio 2009

Messaggi recenti

Thank you for your clear explanation. I'll try.
hura hura
RE: Many instances of an portlet
1 maggio 2010 19.39
Risposta

hura hura

Punteggio: New Member

Messaggi: 19

Data di Iscrizione: 15 luglio 2009

Messaggi recenti

Hello,

I'm stuck, plz help me.

Do you know how the id of each web proxy portlet is generated, can we assign a static id to each?
Eric Devlin
RE: Many instances of an portlet
3 maggio 2010 8.53
Risposta

Eric Devlin

Punteggio: Regular Member

Messaggi: 154

Data di Iscrizione: 19 febbraio 2008

Messaggi recenti

Hey,

If you want to get at the {id} in the url, you'd probably want to check out org.portletbridge.portlet.GUIDGenerator.

If you're wanting to pass in some parameters on the initial screen consider implementing org.portletbridge.portlet.InitUrlFactory and setting that in the portlet config for the init-param with a name of initUrlFactoryClassName and a value of your fully qualified class name.

Eric
hura hura
RE: Many instances of an portlet
3 maggio 2010 19.36
Risposta

hura hura

Punteggio: New Member

Messaggi: 19

Data di Iscrizione: 15 luglio 2009

Messaggi recenti

I get what I want with this method:
1
2ThemeDisplay themeDisplay = (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
3themeDisplay.getPortletDisplay().getInstanceId();       

But I still have a problem:user can add or remove many proxy portlet, and each portlet has its own task. I dont know how to control portlet instance id now. Any suggestion?
Eric Devlin
RE: Many instances of an portlet
4 maggio 2010 5.38
Risposta

Eric Devlin

Punteggio: Regular Member

Messaggi: 154

Data di Iscrizione: 19 febbraio 2008

Messaggi recenti

My setup has web proxy with a portlet-name of 66. All the instances have an id of something like 66_INSTANCE_%. Maybe you can do something like

ThemeDisplay themeDisplay = (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
if ( themeDisplay.getPortletDisplay().getInstanceId().startsWith( "66_INSTANCE" ) ) {
...