<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Richard<div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Have you looked at the way EPrints sword deposits into the Bazaar?</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span><a href="https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/DataObj/EPM.pm#L1109" class="">https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/DataObj/EPM.pm#L1109</a></div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>This makes use of the XML exporter, and does the documents as in-line files.</div><div class=""><br class=""></div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class="">Adam Field</div><div class="">Business Relationship Manager and Community Lead<br class="">EPrints Services</div></div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 8 Sep 2015, at 09:21, Richard Jones &lt;<a href="mailto:richard@cottagelabs.com" class="">richard@cottagelabs.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">Hi Andy,</div><div class=""><br class=""></div><div class="">Thanks for your email, very useful.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-style:normal;font-variant:normal;font-weight:normal;font-size:10pt;line-height:normal;font-family:'Segoe UI';margin:16px 16px 4px;font-stretch:normal" class=""><div class=""><div class="">My sympathies: I spent about a month trying figure something like this out, and just about got it working before I went on holiday for two weeks... Now I'm back I'm struggling to recall the details.&nbsp; I was trying to push eprints XML and attached files&nbsp;into eprints via SWORD, and kept running up against similar problems.&nbsp; What I found was that AtomPub only seemed to support minimal metadata - title, creator, summary - but nothing else e.g. Journal.&nbsp; </div></div></div></blockquote><div class=""><br class=""></div><div class="">So, did you manage to get the sword endpoint to take generic atom, even with just those basic fields?&nbsp; This is the bit that I'm currently stuck at, but if I could get it working, I'd be in a good position.</div><div class=""><br class=""></div><div class="">Right now I'm sending an atom entry document with both generic atom and embedded dc metadata, and I can see that there's an XSL file here that should deal with it:</div><div class=""><br class=""></div><div class="">perl_lib/EPrints/Plugin/Import/XSLT/Atom.xsl<br class=""></div><div class=""><br class=""></div><div class="">Problem seems to be, though, that this XSL file isn't being picked up as a viable import plugin for my deposit, and I can't tell why.&nbsp; If you were able to import some basic atom metadata, that means there's hope for me here :) &nbsp;Do you recall having to set any configuration to get this to work?</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-style:normal;font-variant:normal;font-weight:normal;font-size:10pt;line-height:normal;font-family:'Segoe UI';margin:16px 16px 4px;font-stretch:normal" class=""><div class=""><div class="">I can imagine that in your position as the Router, you don't want to have to be generating Eprints XML - presumably you want to be sending generic Atom, and not having to write native eprints XML? &nbsp; Most of the documentation I found around SWORD tended to be dSpace-centric, using DCTERMS for the extended metadata.&nbsp; I spent ages trying to adapt the EasyDeposit client , but could never get it to pass the XML to the right interpreter.&nbsp; In the end I started from scratch with PHP-CURL and solved it quite quickly.</div></div></div></blockquote><div class=""><br class=""></div><div class="">When you say the "right interpreter", do you mean the EPrints import plugin?&nbsp; I guess that's the same problem I'm having.&nbsp; If the Atom.xsl can be run over the incoming XML, then actually it would be easy in EPrints to customise that file for supporting arbitrary embedded metadata.</div><div class=""><br class=""></div><div class="">Perhaps there's an EPrints dev on the list who can tell us a bit more about how the XSLT import plugins work/get loaded?</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-style:normal;font-variant:normal;font-weight:normal;font-size:10pt;line-height:normal;font-family:'Segoe UI';margin:16px 16px 4px;font-stretch:normal" class=""><div class=""><div class="">Not sure if this will help with your problem, Richard, but it might give some help to somebody.&nbsp; Here's a basic test rig that works for me (unless I've broken it while tidying it up for public consumption )...</div></div></div></blockquote><div class=""><br class=""></div><div class="">Just snipping the key bits...</div><div class="">&nbsp;</div><div class="">&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-style:normal;font-variant:normal;font-weight:normal;font-size:10pt;line-height:normal;font-family:'Segoe UI';margin:16px 16px 4px;font-stretch:normal" class=""><div class=""><div class=""></div><div class="">$pkgheader=Array('X-Packaging: <a href="http://eprints.org/ep2/data/2.0'" target="_blank" class="">http://eprints.org/ep2/data/2.0'</a>,<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Content-Type: text/xml',<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Metadata-Relevant: true',<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'X-Verbose: true' ,<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'In-Progress: true');&nbsp;</div></div></div></blockquote><div class=""><br class=""></div><div class="">So you found you had to specify both the Packaging and the Content-Type to get the right importer to load?</div><div class="">&nbsp;&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-style:normal;font-variant:normal;font-weight:normal;font-size:10pt;line-height:normal;font-family:'Segoe UI';margin:16px 16px 4px;font-stretch:normal" class=""><div class=""><div class=""></div><div class="">As I say, this might not be quite the problem you're trying to solve, but it was the only way I could get it working for a similar situation.&nbsp; It suited me because I already had the code to generate the EPXML.&nbsp;</div></div></div></blockquote><div class=""><br class=""></div><div class="">Looks like you're battling with similar things, thanks for the input.&nbsp; I feel hopeful that if we can figure out how the default Atom importer can work, that would be a bonus for everyone wanting to use Sword/EasyDeposit against EPrints.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Richard</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="font-style:normal;font-variant:normal;font-weight:normal;font-size:10pt;line-height:normal;font-family:'Segoe UI';margin:16px 16px 4px;font-stretch:normal" class=""><div class=""><span style="padding-right:0px;padding-left:0px;margin-bottom:5px;display:block" class=""><span style="display:block" class=""><span style="font-size:10pt;display:inline-block" class=""></span></span></span><span style="margin-bottom:5px;display:block" class=""><br class=""></span><div class=""><span class="">&gt;&gt;&gt; Richard Jones &lt;<a href="mailto:richard@cottagelabs.com" target="_blank" class="">richard@cottagelabs.com</a>&gt; 29 August 2015 12:09 &gt;&gt;&gt;<br class=""></span><div class=""><div class="h5"><div class="">
<div dir="ltr" class="">Just a little more information ...<div class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr" class=""><span class=""><div class=""></div><div class="">I've found an Atom.xsl stylesheet in EPrints/Plugins/Import/XSLT which seems to imply that there /is/ a default atom import plugin.  My sword deposit contains atom metadata, so this stylesheet should work nicely to create a new eprint with the relevant metadata.  The only thing is, it doesn't appear to get called during deposit.  In Eprints/Apache/CRUD.pm, there's this code (Line 762 in sub import_plugins):</div><div class=""><br class=""></div></span><div class=""><span class=""><div class="">my @plugins = $self-&gt;repository-&gt;get_plugins(</div><div class="">                type =&gt; "Import",</div><div class="">                can_produce =&gt; $self-&gt;accept_type,</div><div class="">                %params,</div><div class="">        );</div></span></div></div></blockquote><div class=""><br class=""></div><div class="">In this code can_produce actuall gets dataobj/eprint, which I think is correct, but I can't work out what %params contains.  It ought to contain application/atom+xml; type=entry I'm finding it difficult to trace this through the code to find out where it is set and what it should contain.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Richard</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr" class=""><div class=""><span class=""><div class=""><br class=""></div><div class="">and it's being called with an accept_type of "application/atom+xml; type=entry".  My guess is that the Atom.xsl stylesheet is not being understood as the plugin which can handle this format.</div><div class=""><br class=""></div><div class="">I read through this documentation:</div><div class=""><br class=""></div><div class=""><a href="http://wiki.eprints.org/w/Import_and_Export_Plug-ins" target="_blank" class="">http://wiki.eprints.org/w/Import_and_Export_Plug-ins</a><br class=""></div><div class=""><br class=""></div><div class="">And it appears to suggest that the XSLT plugins need a wrapper around them for the specific mimetype that they need to work with - is this right?  Or is there some way to get the XSLT import plugin to run as is?</div><div class=""><br class=""></div><div class="">If there's some other documentation that I've overlooked so far, any links much appreciated!</div><div class=""><br class=""></div></span><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Richard</div><div class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On 28 August 2015 at 09:50, Richard Jones <span dir="ltr" class="">&lt;<a href="mailto:richard@cottagelabs.com" target="_blank" class="">richard@cottagelabs.com</a>&gt;</span> wrote:<br class=""></span><div class=""><div class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr" class=""><span class="">Actually, I see an AtomMultipart.pm in the EPrints/Plugin directory, and it in turn tries to load a plugin which supports application/atom+xml, but I can't find a plugin that supports that particular format.  I think this is probably the same issue, then, as my (1) below - there doesn't appear to be a default atom plugin - is that right?<div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Richard</div><div class=""><br class=""></div></span><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On 28 August 2015 at 09:32, Richard Jones <span dir="ltr" class="">&lt;<a href="mailto:richard@cottagelabs.com" target="_blank" class="">richard@cottagelabs.com</a>&gt;</span> wrote:<br class=""></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div class=""><div class=""><div class=""><div class=""><div dir="ltr" class="">Hi Folks,<div class=""><br class=""></div><div class="">We're currently working on a new version of the Jisc Publications Router, and am looking into how best to put the content into an EPrints via SWORDv2.  I'm encountering a few oddities, though, and I wonder if someone can clarify how that endpoint works for me?</div><div class=""><br class=""></div><div class="">1/ Posting an atom entry document to /id/content should result in the creation of a new eprint populated with the metadata from that document, but instead it creates an eprint with no metadata and the atom xml attached as a file called "main.bin".  Perhaps I'm missing some crosswalk configuration?</div><div class=""><br class=""></div><div class=""><a href="http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_creatingresource_entry" target="_blank" class="">http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_creatingresource_entry</a><br class=""></div><div class=""><br class=""></div><div class="">2/ My service document says:</div><div class=""><br class=""></div><div class="">&lt;acceptPackaging&gt;<a href="http://purl.org/net/sword/package/Binary" target="_blank" class="">http://purl.org/net/sword/package/Binary</a>&lt;/acceptPackaging&gt;<br class=""></div><div class=""><br class=""></div><div class="">But when I PUT a file of this format tot he media resource I get a "package format not supported" error.</div><div class=""><br class=""></div><div class="">Also, it does not say that it supports SimpleZip, but if I PUT a SimpleZip it works fine.  Is there a place that I can customise the accept/acceptPackaging entries in the service document?</div><div class=""><br class=""></div><div class="">3/ Completing deposit doesn't appear to work.  When I POST to the eprint's Edit-IRI, I get a 405 Method Not Allowed, but it should update the eprint</div><div class=""><br class=""></div><div class=""><a href="http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#continueddeposit_complete" target="_blank" class="">http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#continueddeposit_complete</a><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Looking at the code, with my limited Perl skills, it looks like the full SWORDv2 protocol is not supported - is there some documentation that will tell me what features are supported?  For example, does multipart deposit work? <a href="http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_creatingresource_multipart" target="_blank" class="">http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_creatingresource_multipart</a></div><div class=""><br class=""></div><div class="">Any tips/pointers much appreciated.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Richard<br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><div class=""><br class=""></div>Richard Jones, <div class=""><br class=""></div><div class="">Founder, Cottage Labs <div class="">t: @richard_d_jones, @cottagelabs</div><div class="">w: <a href="http://cottagelabs.com/" target="_blank" class="">http://cottagelabs.com</a><br class=""><div class=""><br class=""></div></div></div></div>
</div></div>
</div></div><br class=""></div></div><span class="">*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank" class="">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br class="">
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank" class="">http://www.eprints.org/tech.php/</a><br class="">
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank" class="">http://wiki.eprints.org/</a><br class="">
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank" class="">http://forum.eprints.org/</a><br class="">
<br class=""></span></blockquote></div><br class=""><br clear="all" class=""><span class=""><div class=""><br class=""></div>-- <br class=""><div class=""><div class=""><br class=""></div>Richard Jones, <div class=""><br class=""></div><div class="">Founder, Cottage Labs <div class="">t: @richard_d_jones, @cottagelabs</div><div class="">w: <a href="http://cottagelabs.com/" target="_blank" class="">http://cottagelabs.com</a><br class=""><div class=""><br class=""></div></div></div></div>
</span></div></div>
<br class="">*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank" class="">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br class="">
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank" class="">http://www.eprints.org/tech.php/</a><br class="">
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank" class="">http://wiki.eprints.org/</a><br class="">
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank" class="">http://forum.eprints.org/</a><br class="">
<br class=""></blockquote></div></div></div><div class=""><div class=""><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><div class=""><br class=""></div>Richard Jones, <div class=""><br class=""></div><div class="">Founder, Cottage Labs <div class="">t: @richard_d_jones, @cottagelabs</div><div class="">w: <a href="http://cottagelabs.com/" target="_blank" class="">http://cottagelabs.com</a><br class=""><div class=""><br class=""></div></div></div></div>
</div></div></div></div></div>
<br class="">*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank" class="">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br class="">
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank" class="">http://www.eprints.org/tech.php/</a><br class="">
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank" class="">http://wiki.eprints.org/</a><br class="">
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank" class="">http://forum.eprints.org/</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class=""><div class=""><br class=""></div>Richard Jones, <div class=""><br class=""></div><div class="">Founder, Cottage Labs <div class="">t: @richard_d_jones, @cottagelabs</div><div class="">w: <a href="http://cottagelabs.com/" target="_blank" class="">http://cottagelabs.com</a><br class=""><div class=""><br class=""></div></div></div></div>
</div></div></div>
</div></div></div></div></div></div>
<br class="">*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank" class="">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br class="">
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank" class="">http://www.eprints.org/tech.php/</a><br class="">
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank" class="">http://wiki.eprints.org/</a><br class="">
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank" class="">http://forum.eprints.org/</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><div class=""><br class=""></div>Richard Jones,&nbsp;<div class=""><br class=""></div><div class="">Founder, Cottage Labs&nbsp;<div class="">t: @richard_d_jones, @cottagelabs</div><div class="">w:&nbsp;<a href="http://cottagelabs.com/" target="_blank" class="">http://cottagelabs.com</a><br class=""><div class=""><br class=""></div></div></div></div>
</div></div>
*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" class="">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br class="">*** Archive: <a href="http://www.eprints.org/tech.php/" class="">http://www.eprints.org/tech.php/</a><br class="">*** EPrints community wiki: <a href="http://wiki.eprints.org/" class="">http://wiki.eprints.org/</a><br class="">*** EPrints developers Forum: <a href="http://forum.eprints.org/" class="">http://forum.eprints.org/</a><br class=""></div></blockquote></div><br class=""></div></body></html>