active_fedora icon indicating copy to clipboard operation
active_fedora copied to clipboard

File attributes not being tracked for changes

Open dchandekstark opened this issue 9 years ago • 5 comments

At least original_name and mime_type.

c.content.original_name => "dscsi010010020.tif" 2.1.5 :028 > c.content.original_name = "foo.tif" => "foo.tif" 2.1.5 :029 > c.content.changed? => false 2.1.5 :032 > c.content.changed_attributes => {}

dchandekstark avatar Dec 09 '15 18:12 dchandekstark

I believe the root problem is that original_name and mime_type are not properties (RDF property accessors). IIRC this may go back to early days of FCR4 when this data was not being persisted as it is now (at least in v4.4+). We should be able to use the properties now, right?

> c.content.metadata.get_values(RDF::Vocab::EBUCore.hasMimeType)
 => ["image/jpeg"] 
> c.content.metadata.get_values(RDF::Vocab::EBUCore.filename)
 => ["dcs.jpg"] 

/cc @jcoyne @tpendragon @barmintor

dchandekstark avatar Dec 09 '15 19:12 dchandekstark

I think the problem here is that these are headers when we first create the object, but then they become RDF properties on an existing object.

jcoyne avatar Dec 09 '15 19:12 jcoyne

@jcoyne OK, so what's the fix? As now, we can't updated the properties AFAICT through the AF API (except I guess by changing the file content too).

dchandekstark avatar Dec 09 '15 19:12 dchandekstark

I don't know how to fix it. I haven't had the time to think on it. I'm sure it will require some custom handling of those two attributes.

jcoyne avatar Dec 09 '15 19:12 jcoyne

Reviving this issue, mime_type is updatable now but original_name is not.

cjcolvar avatar May 01 '17 19:05 cjcolvar