From: Philip D. <phi...@ha...> - 2014-07-09 13:01:46
|
Ah, thanks, I understand the problem space better now. It sounds like you'd be open to a pull request. I'd probably start by creating an issue though. Perhaps an issue with a title such as: SWORD Statement could expose information more per file under "content" than "type" and "src" For example, that line for me might say: <content type="text/tab-separated-values" src=" https://pdurbin.pagekite.me:8181/dvn/api/data-deposit/v1/swordv2/edit-media/file/23/50by1000.tab "/> But it could say: <content type="text/tab-separated-values" src=" https://pdurbin.pagekite.me:8181/dvn/api/data-deposit/v1/swordv2/edit-media/file/23/50by1000.tab" filename="50by1000.tab"/> I'd love to be able to expose a filename *not* within a URL/IRI because URLs have certain limits on characters. For example I replace a space with an underscore here to avoid an IRISyntaxException: https://github.com/IQSS/dataverse/blob/77b981d85014a622f8ce0de8e7a23c22e2b73ae1/src/main/java/edu/harvard/iq/dataverse/api/datadeposit/StatementManagerImpl.java#L116 Phil On Wed, Jul 9, 2014 at 7:08 AM, Richard Jones <ri...@co...> wrote: > Hi Phil, > > I think this is probably the problem: > > > https://github.com/swordapp/JavaServer2.0/blob/master/src/main/java/org/swordapp/server/AtomStatement.java#L58 > > (and similarly in the ORE format) > > There's no way to actually serialise the properties on the resource part. > You'd probably want to either patch the AtomStatement, or extend it with > our own implementation which is returned by the StatementManagerImpl. > > Cheers, > > Richard > > > > On 19 June 2014 14:58, Philip Durbin <phi...@ha...> wrote: > >> Question about https://github.com/swordapp/JavaServer2.0 >> >> I was originally hoping to expose more metadata about files (besides >> MediaType) and took a couple runs at using properties on a >> ResourcePart but it doesn't seem show in the Atom statement. >> >> This is what I have commented out (with a todo) at >> >> https://github.com/IQSS/dataverse/blob/77b981d85014a622f8ce0de8e7a23c22e2b73ae1/src/main/java/edu/harvard/iq/dataverse/api/datadeposit/StatementManagerImpl.java#L133 >> >> /** >> * @todo: Why are properties set on a ResourcePart not >> * exposed when you GET a Statement? >> */ >> Map<String, String> properties = new HashMap<String, String>(); >> properties.put("filename", studyFile.getFileName()); >> properties.put("category", studyFile.getLatestCategory()); >> properties.put("originalFileType", studyFile.getOriginalFileType()); >> properties.put("id", studyFile.getId().toString()); >> properties.put("UNF", studyFile.getUnf()); >> resourcePart.setProperties(properties); >> statement.addResource(resourcePart); >> >> I was hoping this would show up in each <entry> for a file. >> >> Any advice here? Is this just a dumb Java coding error on my part? >> What are properties for? Thanks! >> >> Phil >> >> -- >> Philip Durbin >> Software Developer for http://thedata.org >> http://www.iq.harvard.edu/people/philip-durbin >> >> >> ------------------------------------------------------------------------------ >> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions >> Find What Matters Most in Your Big Data with HPCC Systems >> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >> http://p.sf.net/sfu/hpccsystems >> _______________________________________________ >> sword-app-tech mailing list >> swo...@li... >> https://lists.sourceforge.net/lists/listinfo/sword-app-tech >> > > > > -- > > Richard Jones, > > Founder, Cottage Labs > t: @richard_d_jones, @cottagelabs > w: http://cottagelabs.com > > -- Philip Durbin Software Developer for http://dataverse.org <http://thedata.org> http://www.iq.harvard.edu/people/philip-durbin |