The good new is that Pluto container works swell with readonly
preferences - throwing the right exception - very nice.
I would like a way to indicate to the container that the user is not
allowed to set *any* preferences - throw the Readonly Exception on
all setValue keys.
I guess that I could throw something in the store().
Another thing that haunted me was the fact that a lot of portals will
just do stuff silently and not throw these exceptions - so when a
portlet comes to Sakai and sloppily lets a user try to set
preferences who does not have the right permissions and Sakai
(totally compliantly) throws the ReadOnly exception - it means their
portlet breaks in Sakai but not in more liberal containers. And if
someone does not have source to the war file - they can't even ad the
catch block :(
One is tempted to silently fail rather than throwing exceptions.
Anyone with some comforting words about how "it is better to comply"
even if a few portlet writers get scorched :) ??
/Chuck
On Mar 5, 2007, at 12:15 PM, Stefan Hepper wrote:
Note that you normally should throw the read-only Exc when calling
the set methods and not and the end in the store in order to be
compliant with the JSR 168 spec. It is in the spirit of the spec
that you can get this exc if the current user does not have
sufficient rights to do this (i.e. that the preference is read-only
for this request).
Stefan