Foren

add/remove fields and portlet preferences

Akram MONCER, geändert vor 11 Jahren.

add/remove fields and portlet preferences

Regular Member Beiträge: 106 Beitrittsdatum: 25.09.12 Neueste Beiträge
hello i'm new in liferay developpement.
my question is how can i remove an attribute from an entity with a hook (ex: SKU attribute from the ShoppingItem entity) and how can i add a custom preferences to the shopping portlet.
thank you
Akram MONCER, geändert vor 11 Jahren.

RE: add/remove fields and portlet preferences

Regular Member Beiträge: 106 Beitrittsdatum: 25.09.12 Neueste Beiträge
there is no one can help me
thumbnail
Andew Jardine, geändert vor 9 Jahren.

RE: add/remove fields and portlet preferences

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Old thread but in case anyone else comes across it.

It is possible to use the PortletPreferences section of the API to store preferences for the portlet. In particular, if you are already creating custom jsp hooks/code for the portlet then all you need to do is also include the logic to retrieve them and use them as required. Check out the PortletPreferences table in the database and the PortletPreferenceLocalServiceImpl (and related classes) for the API stuff.
Nicolas Mugnier, geändert vor 11 Jahren.

RE: add/remove fields and portlet preferences

New Member Beiträge: 15 Beitrittsdatum: 18.12.09 Neueste Beiträge
Akram MONCER:
hello i'm new in liferay developpement.
my question is how can i remove an attribute from an entity with a hook (ex: SKU attribute from the ShoppingItem entity) and how can i add a custom preferences to the shopping portlet.
thank you



Hello,

You should try to have a look at the ExpandoValueLocalServiceUtil class. I think you will be able to manage your custom field...

About your portlet preferences, you have to add the following to your portlet.xml:

<portlet-mode>edit</portlet-mode>


Then, the main class of your portlet has to implement PortletListener. You will have to switch portlet modes (view - preferences) in the overrided method handleResourceRequest...

Hope I helped you...

Best,
Nicolas.