|
Sorry Silvert, I’ve found out that the problem was
related to the way Liferay handles PortletPreferences. It seems that the first time a portlet is deployed,
Liferay saves the preferences (from portlet.xml) in a database. From that
point, Liferay will retrieve preferences from the database. This means that any
additional preference entered in the portlet.xml will be ignored (I still have
to figure out if this behavior is per portlet instance or per portlet+user,
though). During my tests, the first portlets I’ve
built used MyFaces, and I haven’t configured any preference. They worked fine.
Later, I added some preferences (in portlet.xml) and got confused because I could
get no preferences (because they were registered as having no preferences in the
database). Then, I’ve created the simplest portlet (with preferences),
and I could get the preferences. That’s when I got suspicious of MyFaces.
But in the end MyFaces has nothing to do with it. Thanks anyway. Marcio. From: Stan Silvert
[mailto:[EMAIL PROTECTED] Hi Miranda, I’ve been thinking about what you
are saying and I can’t figure out what could be wrong. In all of MyFaces impl, there is no
reference to the PortalPreferences class. We don’t do anything with
it. I think the problem must either be in
LifeRay or in your application. Are you doing anything with
PortalPreferences during the processAction/lifecycle.execute() phase? Also, when you say “reference implementation”,
what are you referring to? Do you mean the JSF reference implementation
or the Portal reference implementation? From: Marcio E Miranda
[mailto:[EMAIL PROTECTED] Hi, If I run the following code in the doView method of a portlet
extending GenericPortlet (reference implementation), I can get (in Liferay) the
preferences configured in the portlet.xml descriptor for the portlet without
problems. --- protected void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException{ PortletPreferences prefs =
request.getPreferences(); Enumeration names =
prefs.getNames(); --- But if I run this same code in the doView method of a
portlet extending MyFacesGenericPortlet, the enumeration shows the
initialization parameters instead of portlet preferences! In others cases it
shows no preferences at all, even though there are preferences defined in the
portlet.xml descriptor. It seems to me that MyFacesGenericPortlet is messing
with the portlet preferences. - Marcio. |

