Hi Jasper Thanks for reporting this.
I've verified this on Trunk - looks like this is a bug - modify should only update a property if it is specified, otherwise the property should remain unchanged. I've raised http://www.fedora-commons.org/jira/browse/FCREPO-699 for this. FYI There is a similar issue with object "state" defaulting to Active which is now fixed (for release 3.4, not yet released) (http://www.fedora-commons.org/jira/browse/FCREPO-608) Regards Steve > -----Original Message----- > From: Jasper Op de Coul [mailto:[email protected]] > Sent: 17 May 2010 18:29 > To: [email protected] > Subject: [Fedora-commons-developers] versionable attribute > onmodifyDatastream > > > > I am using the REST API to add/modify datastreams, and I found the > versionable attribute to work different then I expected. I > thought this > might be interesting for other developers to know. > > When you add a datastream, versionable is set to true and > state is set > to 'A', those seem reasonable defaults. > Then when you modify the datastream, state has no default, so > when you > omit it in the request, it will use the state that's already > defined in > the foxml file, same goes for most other attributes like mimeType, > label, etc. However, the versionable attribute will always default to > true when omitted, even when it is set to false in the foxml file. So: > > - Create a new datastream, versionable = False, content = 'foo' > (foxml has 1 version, versionable = False, content = 'foo') > > - Change content to bar > (foxml has 1 version, versionable = True, content= 'bar') > > - Change content to baz > (foxml has 2 versions, versionable = True, content = 'baz' > > - Change content back to 'bar', set versionable = False > (foxml has 3 versions, versionable = False, content= 'bar' > > Notice that when you change the versionable attribute, this > change only > becomes active with the next modification, not the `current` > modification. > > I found this a bit unexpected, I would have thought versionable would > work the same as state, or mimeType; it has a sensible default when > adding, and if you don't change it using modifyDatastream, it > will not > be changed. > The way it works now, my client should first get the value of the > versionable attribute before doing a modifyDatastream call, > otherwise it > might risk changing the versionable setting. > > > > Jasper Op de Coul -- Infrae > t +31 10 243 7051 -- http://infrae.com > Hoevestraat 10 3033GC Rotterdam -- The Netherlands > > -------------------------------------------------------------- > ---------------- > > _______________________________________________ > Fedora-commons-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers > ------------------------------------------------------------------------------ _______________________________________________ Fedora-commons-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers
