Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Ron Bense
Limiting Portlet availibility by Virtual Host
7 maggio 2008 22.06
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Hi,

Anyone happen to know how to limit portlet availability by virtual host? I would like to have portlet 'A' available to host '1', but not host '2'. I would like to have portlet 'B' available to '2', but not '1'. Both portlet's 'A' and 'B' each exist in separate WARs. Any help would be appreciated.

Right now I'm considering extending the code that displays portlets in the Add Applications portlet to be companyId aware, thus allowing limiting by virtual host.

Thanks,
Ron
Ray Augé
RE: Limiting Portlet availibility by Virtual Host
8 maggio 2008 7.10
Risposta

Ray Augé

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1195

Data di Iscrizione: 7 febbraio 2005

Messaggi recenti

Ron Bense:

Anyone happen to know how to limit portlet availability by virtual host? I would like to have portlet 'A' available to host '1', but not host '2'. I would like to have portlet 'B' available to '2', but not '1'. Both portlet's 'A' and 'B' each exist in separate WARs. Any help would be appreciated.

Right now I'm considering extending the code that displays portlets in the Add Applications portlet to be companyId aware, thus allowing limiting by virtual host.


We don't have this mechanism currently.

But, have a look at the model used for themes in <portal_src>/definitions/liferay-look-and-feel_5_0_0.dtd and that would probably make the most sense as far as the configuration goes.

With themes you can do just what you want, by companyId and further by groupId.
Ron Bense
RE: Limiting Portlet availibility by Virtual Host
8 maggio 2008 20.09
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Thanks for the pointer, I'll take a look at it.
Stuart .
RE: Limiting Portlet availibility by Virtual Host
9 maggio 2008 7.53
Risposta

Stuart .

Punteggio: New Member

Messaggi: 21

Data di Iscrizione: 19 gennaio 2007

Messaggi recenti

Ron Bense:
Hi,

Anyone happen to know how to limit portlet availability by virtual host? I would like to have portlet 'A' available to host '1', but not host '2'. I would like to have portlet 'B' available to '2', but not '1'. Both portlet's 'A' and 'B' each exist in separate WARs.



Assuming you have two portal instances instead of using virtual host with communities.
As an Admin user, you can go to Enterprise Admin Portlet, then Plugins tab, then you can click the desired portlet and edit it. Just disable "Active" check box so the portlet does not appear int the portal anymore in that instance. Repeat the steps for the other instance and different portlet.

Hope works for you.
Ron Bense
RE: Limiting Portlet availibility by Virtual Host
12 maggio 2008 14.48
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Unfortunately, we're using virtual hosts.
Ray Augé
Re: [Liferay Forums][3. Development] Limiting Portlet availibility by Virtu
27 maggio 2008 11.58
Risposta

Ray Augé

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1195

Data di Iscrizione: 7 febbraio 2005

Messaggi recenti

On Thu, 2008-05-08 at 05:06 +0000, Ron Bense at Liferay's Community
Forums wrote:

> Anyone happen to know how to limit portlet availability by virtual
> host? I would like to have portlet 'A' available to host '1', but not
> host '2'. I would like to have portlet 'B' available to '2', but not
> '1'. Both portlet's 'A' and 'B' each exist in separate WARs. Any help
> would be appreciated.
>
> Right now I'm considering extending the code that displays portlets in
> the Add Applications portlet to be companyId aware, thus allowing
> limiting by virtual host.


We don't have this mechanism currently.

But, have a look at the model used for themes in
definitions/liferay-look-and-feel_5_0_0.dtd and that would
probably be make the most sense.

With themes you can do just what you want, by companyId and further by
groupId.
Ron Bense
RE: Re: [Liferay Forums][3. Development] Limiting Portlet availibility by V
18 giugno 2008 7.03
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Ray Augé:
On Thu, 2008-05-08 at 05:06 +0000, Ron Bense at Liferay's Community
Forums wrote:

> Anyone happen to know how to limit portlet availability by virtual
> host? I would like to have portlet 'A' available to host '1', but not
> host '2'. I would like to have portlet 'B' available to '2', but not
> '1'. Both portlet's 'A' and 'B' each exist in separate WARs. Any help
> would be appreciated.

We don't have this mechanism currently.

But, have a look at the model used for themes in
definitions/liferay-look-and-feel_5_0_0.dtd and that would
probably be make the most sense.

With themes you can do just what you want, by companyId and further by
groupId.


Hi Ray,

I have investigated this mechanism, and might I suggest that the pattern attribute and name work off of the virtual host name, while a new attribute, "id", be the actual companyID? After all, what use is pattern matching on a long when you have no control over setting those longs?

It just seems natural that these functions work off of the virtual host name.

Might I add that the portlets showing plugins show all themes (plugins for the general case) for the root instance? After all, as the "Enterprise Admin" (or default/Omni Admin) I should be able to see and manage everything that's installed on my system, whether my particular instance can use them or not. Obviously, some indication would need to be made whether it's active or not, and for whom it's active.

I'd be happy to explore this further with you.
Ron Bense
RE: Re: [Liferay Forums][3. Development] Limiting Portlet availibility by V
19 giugno 2008 9.17
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Hi Ray,

if you would, please email me @ rbense <at@symbol-nospam.com> sensorlogic.com.

Thanks.
Ron Bense
RE: Limiting Portlet availibility by Virtual Host
25 giugno 2008 6.07
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Hi Ray,

I've abstracted out the classes so they now work for both portlets and themes. I'm willing to donate this back if you'd like it. I've got code for both 5.0.1 and 4.4.1.

I'm also going to fix the "pattern" class as discussed earlier, as it's not much use as is. This is now a simple fix across the board. I'm also going to add in the ability to use the WebID so that the portlet deployer does not need to know anything about the specifics of how Liferay stores the hosts.
Ray Augé
Re: [Liferay Forums][3. Development] RE: Limiting Portlet availibility by V
25 giugno 2008 8.48
Risposta

Ray Augé

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1195

Data di Iscrizione: 7 febbraio 2005

Messaggi recenti

Great stuff...

Sorry I haven't responded earlier... I'm having a hard time keeping
track with the forums. emoticon

We'd be very happy to accept your contribution. Please do LEP it.

(A patch against trunk, or in the case of 4.4, against 4.4.x, would be
the best way to handle it.)

Though I can't promise it'll be in before 5.1 hits to presses (this week
or next).
Allegato

Allegati: stock_smiley-1.png (0,9k)
Ron Bense
RE: Re: [Liferay Forums][3. Development] RE: Limiting Portlet availibilitye
8 settembre 2008 11.30
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Hi Ray,

Life's been a little hectic. I'll get right back on this asap, but it probably will be a couple of weeks.

On the plus side, we're running this approach in production so it's relatively well vetted.

Ron
Liviu Cismaru
RE: Re: [Liferay Forums][3. Development] RE: Limiting Portlet availibilitye
12 dicembre 2009 6.35
Risposta

Liviu Cismaru

Punteggio: New Member

Messaggi: 14

Data di Iscrizione: 10 settembre 2008

Messaggi recenti

Hi Ron,

We're working on a project based on LR 5.2.2, using virtual servers, I was wondering if your code is already in.
If they didn't include it yet, would you mind sharing it ?

Many thanks in advance.
Liviu

Liviu Cismaru
Accentway Inc.
Geneva, Switzerland
Ron Bense
RE: Re: [Liferay Forums][3. Development] RE: Limiting Portlet availibilitye
22 ottobre 2010 8.57
Risposta

Ron Bense

Punteggio: Regular Member

Messaggi: 117

Data di Iscrizione: 23 agosto 2007

Messaggi recenti

Hi Livlu,

I'm sorry for the late reply. It was not included, and I cannot share that code as I no longer have access to it. Besides, it was running in a 4.4.2 environment, which most likely needed modifications for 5.2.2+.

However, I'm now working with 6, and I may wind up recreating this functionality for 6 in the near future which I will share if possible.