Message Boards

« Back to 2.- Usage ( From Xml file to CRUD Portlet)

company and community context of portlet's data

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi all,

I'm testing the aderence of data created by XMLPF with the concepts of context in Liferay Portlet.

Very probably I'm doing something of wrong, but I'm not able to create data in the Company context and viewable from all the Groups/Communities of the portal instance - I used:
1<restrictBy>
2                     <companyId>true</companyId>
3                     <groupId>false</groupId>
4                     <userId>false</userId>
5                </restrictBy>

But I see the data only from the Groups/Communities from where I created the company's data.

I tried also to generate the portlets to manage the "company-wide" data using
1<showInControlPanel>true</showInControlPanel>
but the portlets appears in the context of the Site/Community not in the Portal section of the Control Panel.
Also if I set the "Global" context of the Control Panel, the data I create are not visible in all Sites/Communities

Please could anyone help me ?

Thank you in advance !

Ivano C.

RE: company and community context of portlet's data
Answer
10/4/13 8:35 AM as a reply to Ivano Carrara.
Hi Ivano,

for having the company -wide scope, simply use the builtin scope configuration for the portlet (click in the icon and then "Configuration" -> Scope tab -> Select "Global").

For those portlets to appear in Global section, take a look at the liferay-portlet.xml DTD, <control-panel-entry-category/> element:

http://www.liferay.com/dtd/liferay-portlet-app_6_1_0.dtd



RE: company and community context of portlet's data
Answer
10/5/13 10:37 AM as a reply to Juan G..
Thank you Juan,

Ok I setup to Global scope in the configuration of the portlet that manage the master table, but from another portlet that manage the detail table (the scope is Default, records are in the context of the Site) that use the <validation>  element, in the generated list I can't see the records from the master table (Global scope)

What is wrong in my configuration ?

Thank you in advance!
Ivano C.

RE: company and community context of portlet's data
Answer
11/14/13 8:06 AM as a reply to Ivano Carrara.
Hi Ivano,

there is nothing wrong with your configuration. XMLPortletFactory isn't the solution for the 100% of use cases, and your case is a "special one".

You can change the source code, so when querying for the master table, only query by global scope groupId instead of the current portlet one. These are Liferay basic development points.