Forums de discussion

Default Preferences Search Portlet

Fmabo Mb, modifié il y a 8 années.

Default Preferences Search Portlet

Junior Member Publications: 26 Date d'inscription: 10/06/15 Publications récentes
Can i add something like this line of code <preferences-unique-per-layout>false</preferences-unique-per-layout> in search portlet?
thumbnail
Meera Prince, modifié il y a 8 années.

RE: Default Preferences Search Portlet

Liferay Legend Publications: 1111 Date d'inscription: 08/02/11 Publications récentes
Hi
Can you please describe your requirement so that you can get more information. you can add the tag but you need ext or you directly go to ROOT/WEB-INF/ folder and change in liferay-portlet.xml. Before that please describe it will help you more.


https://github.com/liferay/liferay-portal/blob/master/definitions/liferay-portlet-app_6_2_0.dtd

The following is about the tag you can find in liferay-portlet dtd

<!ELEMENT preferences-company-wide (#PCDATA)>

<!--
Set the preferences-unique-per-layout value to true if the preferences for the
portlet are unique across all pages. If set to false, the preferences for the
portlet are shared across all pages. The default value is true.

The preferences-unique-per-layout element is used in combination with the
preferences-owned-by-group element. See the comments for the
preferences-owned-by-group element for more information.
-->
<!ELEMENT preferences-unique-per-layout (#PCDATA)>

<!--
Set the preferences-owned-by-group value to true if the preferences for the
portlet are owned by the group when the portlet is shown in a group page. If
set to false, the preferences are owned by the user at all times. The default
value is true.

Suppose the Stocks portlet has preferences-unique-per-layout set to true and
preferences-owned-by-group set to false. Users can set a different list of
stocks for every personal page. Users can set a different list of stocks for
every community page.

Suppose the Stocks portlet has preferences-unique-per-layout set to false and
preferences-owned-by-group set to false. Users can set one list of stocks to be
shared across all personal pages. Users can set one list of stocks to be shared
across a community's set of pages.

Suppose the Stocks portlet has preferences-unique-per-layout set to true and
preferences-owned-by-group set to true. Users can set a different list of stocks
for every personal page. Administrators set the portlet preferences for users in
a community page. Administrators can set a different list of stocks for every
community page that are then shared by all users within a community.

Suppose the Stocks portlet has preferences-unique-per-layout set to false and
preferences-owned-by-group set to true. Users can set one list of stocks to be
shared across all personal pages. Administrators set the portlet preferences for
users in a community page. Administrators can set one list of stocks to be
shared by all users across a community's set of pages.


Regards,
Meera Prince
thumbnail
David H Nebinger, modifié il y a 8 années.

RE: Default Preferences Search Portlet

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Actually it does not make sense to set the value to false for the search. Each user visiting the page would have their own search preferences, probably have no ideal how to set them up, and would not end up serving you as you may think.
Fmabo Mb, modifié il y a 8 années.

RE: Default Preferences Search Portlet

Junior Member Publications: 26 Date d'inscription: 10/06/15 Publications récentes
The idea is, i want to configure the search portlet , so that, when i set the configuration in a search portlet, all search portlets on my web site also has that configuration.
thumbnail
David H Nebinger, modifié il y a 8 années.

RE: Default Preferences Search Portlet

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Gotcha, you don't want to do the configuration separately. Can't you work it into a page template?
Fmabo Mb, modifié il y a 8 années.

RE: Default Preferences Search Portlet

Junior Member Publications: 26 Date d'inscription: 10/06/15 Publications récentes
David, i can't get it.
Can you explain me that?

Note: I use the search portlet into my velocity theme with this code "$theme.search()", i did a hook to redirect to the user to "mySite/search" when he wants to search something, it's working fine, but when the portlet searches, it creates a URL, "mySite/search?p_p_id=3&p_p_lifecycle=0&p..." if the user changes "mySite/search?p_p_id=3&p_p_lifecycle=0&p..." to "mySite/otherPage?p_p_id=3&p_p_lifecycle=0&p..." the search portlet working fine, but the configuration(facets) is not the same emoticon
Do you understand?
thumbnail
David H Nebinger, modifié il y a 8 années.

RE: Default Preferences Search Portlet

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
you mean they're editing the URL in the address bar?
Fmabo Mb, modifié il y a 8 années.

RE: Default Preferences Search Portlet

Junior Member Publications: 26 Date d'inscription: 10/06/15 Publications récentes
Exactly.
If the user changes the URL, he will see the configuration that i don't want that he see.
For that, i want to find any way to set a unique configuration for the search portlet.
Emanuele Righetto, modifié il y a 8 années.

RE: Default Preferences Search Portlet

New Member Publications: 11 Date d'inscription: 05/10/10 Publications récentes
I have exactly the same requirement.

I've added the following inside the liferay-portlet.xml (tomcat/webapps/ROOT/WEB-INF) for portlet 3:

<preferences-company-wide>false</preferences-company-wide>
<preferences-unique-per-layout>false</preferences-unique-per-layout>
<preferences-owned-by-group>true</preferences-owned-by-group>