[Building Sakai] ResourcePropertiesEdit.addPropertyToList

Brian Jones bjones86 at uwo.ca
Fri Nov 30 13:46:48 PST 2012


Hi everyone,

Is anyone out there making use of the addPropertyToList() method of the
ResourcePropertiesEdit class? I've used addProperty() numerous times in the
past without difficulties. For some reason, when we go to save a site after
using the addPropertyToList() method it throws an NPE, but I'm not sure why.

Ex.:

ResourcePropertiesEdit props = site.getPropertiesEdit();
props.addPropertyToList( propName, propValue1 );
props.addPropertyToList( propName, propValue2 );
SiteService.save( site ); // throws NPE

If we comment out the props.addPropertyToList calls, everything works fine.
If we inspect the props object in the debugger, we can see that the property
(propName) does make it inside the object, and the value is as expected
([propValue1, propValue2]).

Are we missing something? Any input is appreciated.

Thanks,

Brian Jones
Applications Development
Information Technology Services
Support Services Building, Room 4326
Western University
(519) 661-2111 x86969
bjones86 at uwo.ca

From: sakai-dev-bounces at collab.sakaiproject.org
[mailto:sakai-dev-bounces at collab.sakaiproject.org] On Behalf Of Sam
Ottenhoff
Sent: Friday, November 30, 2012 9:17 AM
To: David Horwitz
Cc: Developers Sakai-Dev
Subject: Re: [Building Sakai] Profile2 1.5
org.apache.wicket.WicketRuntimeException in 2.9


On Fri, Nov 30, 2012 at 9:09 AM, David Horwitz <david.horwitz at uct.ac.za>
wrote:
On 5.1 at least you need the update for existing values, the default will
only affect new records


Are you testing any of these statements?!  I tested on 5.1 and again found
the alter table statement does set the default.

--Sam

 



More information about the sakai-dev mailing list