<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Andy,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font:10pt/normal Segoe UI;margin:16px 16px 4px;font-size-adjust:none;font-stretch:normal"><div><div>I definitely did have the EasyDeposit client working at a basic level at one point - I can see the ePrint items where I was getting Title, Creators, Abstract to insert correctly.  Unfortunately I can&#39;t reconstruct the state of the system at that point.  I can see the atom manifest that was sent, but not what the headers were. </div><div><br></div><div>As far as I understand it the atom was being handled initially by AtomMultipart.pm, and at the time I couldn&#39;t work out were it went from there, because I never spotted Atom.xsl lurking in XSLT/ - now it makes slightly more sense.  Do you perhaps need to be invoking AtomMultipart first? </div></div></div></blockquote><div><br></div><div>I tried going the Multipart route, but that didn&#39;t work (Server Errors), but I did hunt through the code in AtomMultipart.pm, and it - in turn - asks the Import Plugin manager a plugin for &quot;application/atom+xml; type=entry&quot;, in the same way that just depositing an atom entry should do, so I&#39;d expect both approaches to work the same.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font:10pt/normal Segoe UI;margin:16px 16px 4px;font-size-adjust:none;font-stretch:normal"><div><div><br></div><div>Sorry to be a bit vague, but this was my first attempt at Eprints internals, and it&#39;s a comfort to know that it wasn&#39;t just me being a newb - it&#39;s dark in there!</div></div></div></blockquote><div><br></div><div>No problem, thanks for the input - will let you know when we have the answer!</div><div><br></div><div>Cheers,</div><div><br></div><div>Richard</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font:10pt/normal Segoe UI;margin:16px 16px 4px;font-size-adjust:none;font-stretch:normal"><div><div><br></div><div>Andy</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><span>&gt;&gt;&gt; Richard Jones &lt;<a href="mailto:richard@cottagelabs.com" target="_blank">richard@cottagelabs.com</a>&gt; 08 September 2015 09:21 &gt;&gt;&gt;<br></span><div><div class="h5"><div>
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Andy,</div><div><br></div><div>Thanks for your email, very useful.</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 style="font:10pt/normal &quot;Segoe UI&quot;;margin:16px 16px 4px;font-stretch:normal"><div><div>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&#39;m back I&#39;m struggling to recall the details.  I was trying to push eprints XML and attached files into eprints via SWORD, and kept running up against similar problems.  What I found was that AtomPub only seemed to support minimal metadata - title, creator, summary - but nothing else e.g. Journal.  </div></div></div></blockquote><div><br></div><div>So, did you manage to get the sword endpoint to take generic atom, even with just those basic fields?  This is the bit that I&#39;m currently stuck at, but if I could get it working, I&#39;d be in a good position.</div><div><br></div><div>Right now I&#39;m sending an atom entry document with both generic atom and embedded dc metadata, and I can see that there&#39;s an XSL file here that should deal with it:</div><div><br></div><div>perl_lib/EPrints/Plugin/Import/XSLT/Atom.xsl<br></div><div><br></div><div>Problem seems to be, though, that this XSL file isn&#39;t being picked up as a viable import plugin for my deposit, and I can&#39;t tell why.  If you were able to import some basic atom metadata, that means there&#39;s hope for me here :)  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;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div style="font:10pt/normal &quot;Segoe UI&quot;;margin:16px 16px 4px;font-stretch:normal"><div><div>I can imagine that in your position as the Router, you don&#39;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?   Most of the documentation I found around SWORD tended to be dSpace-centric, using DCTERMS for the extended metadata.  I spent ages trying to adapt the EasyDeposit client , but could never get it to pass the XML to the right interpreter.  In the end I started from scratch with PHP-CURL and solved it quite quickly.</div></div></div></blockquote><div><br></div><div>When you say the &quot;right interpreter&quot;, do you mean the EPrints import plugin?  I guess that&#39;s the same problem I&#39;m having.  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><br></div><div>Perhaps there&#39;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><br></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 style="font:10pt/normal &quot;Segoe UI&quot;;margin:16px 16px 4px;font-stretch:normal"><div><div>Not sure if this will help with your problem, Richard, but it might give some help to somebody.  Here&#39;s a basic test rig that works for me (unless I&#39;ve broken it while tidying it up for public consumption )...</div></div></div></blockquote><div><br></div><div>Just snipping the key bits...</div><div> </div><div> </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 style="font:10pt/normal &quot;Segoe UI&quot;;margin:16px 16px 4px;font-stretch:normal"><div><div></div><div>$pkgheader=Array(&#39;X-Packaging: <a href="http://eprints.org/ep2/data/2.0&#39;" target="_blank">http://eprints.org/ep2/data/2.0&#39;</a>,<br>                 &#39;Content-Type: text/xml&#39;,<br>                 &#39;Metadata-Relevant: true&#39;,<br>                 &#39;X-Verbose: true&#39; ,<br>                 &#39;In-Progress: true&#39;); </div></div></div></blockquote><div><br></div><div>So you found you had to specify both the Packaging and the Content-Type to get the right importer to load?</div><div>  </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 style="font:10pt/normal &quot;Segoe UI&quot;;margin:16px 16px 4px;font-stretch:normal"><div><div></div><div>As I say, this might not be quite the problem you&#39;re trying to solve, but it was the only way I could get it working for a similar situation.  It suited me because I already had the code to generate the EPXML. </div></div></div></blockquote><div><br></div><div>Looks like you&#39;re battling with similar things, thanks for the input.  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><br></div><div>Cheers,</div><div><br></div><div>Richard</div><div><br></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 style="font:10pt/normal &quot;Segoe UI&quot;;margin:16px 16px 4px;font-stretch:normal"><div><span style="padding-right:0px;padding-left:0px;margin-bottom:5px;display:block"><span style="display:block"><span style="font-size:10pt;display:inline-block"></span></span></span><span style="margin-bottom:5px;display:block"><br></span><div><span>&gt;&gt;&gt; Richard Jones &lt;<a href="mailto:richard@cottagelabs.com" target="_blank">richard@cottagelabs.com</a>&gt; 29 August 2015 12:09 &gt;&gt;&gt;<br></span><div><div><div>
<div dir="ltr">Just a little more information ...<div><div class="gmail_extra"><div class="gmail_quote"><div> </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"><span><div></div><div>I&#39;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&#39;t appear to get called during deposit.  In Eprints/Apache/CRUD.pm, there&#39;s this code (Line 762 in sub import_plugins):</div><div><br></div></span><div><span><div>my @plugins = $self-&gt;repository-&gt;get_plugins(</div><div>                type =&gt; &quot;Import&quot;,</div><div>                can_produce =&gt; $self-&gt;accept_type,</div><div>                %params,</div><div>        );</div></span></div></div></blockquote><div><br></div><div>In this code can_produce actuall gets dataobj/eprint, which I think is correct, but I can&#39;t work out what %params contains.  It ought to contain application/atom+xml; type=entry I&#39;m finding it difficult to trace this through the code to find out where it is set and what it should contain.</div><div><br></div><div>Cheers,</div><div><br></div><div>Richard</div><div><br></div><div> </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"><div><span><div><br></div><div>and it&#39;s being called with an accept_type of &quot;application/atom+xml; type=entry&quot;.  My guess is that the Atom.xsl stylesheet is not being understood as the plugin which can handle this format.</div><div><br></div><div>I read through this documentation:</div><div><br></div><div><a href="http://wiki.eprints.org/w/Import_and_Export_Plug-ins" target="_blank">http://wiki.eprints.org/w/Import_and_Export_Plug-ins</a><br></div><div><br></div><div>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><br></div><div>If there&#39;s some other documentation that I&#39;ve overlooked so far, any links much appreciated!</div><div><br></div></span><div>Cheers,</div><div><br></div><div>Richard</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On 28 August 2015 at 09:50, Richard Jones <span dir="ltr">&lt;<a href="mailto:richard@cottagelabs.com" target="_blank">richard@cottagelabs.com</a>&gt;</span> wrote:<br></span><div><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"><span>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&#39;t find a plugin that supports that particular format.  I think this is probably the same issue, then, as my (1) below - there doesn&#39;t appear to be a default atom plugin - is that right?<div><br></div><div>Cheers,</div><div><br></div><div>Richard</div><div><br></div></span><div class="gmail_extra"><br><div class="gmail_quote"><span>On 28 August 2015 at 09:32, Richard Jones <span dir="ltr">&lt;<a href="mailto:richard@cottagelabs.com" target="_blank">richard@cottagelabs.com</a>&gt;</span> wrote:<br></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><div><div><div><div dir="ltr">Hi Folks,<div><br></div><div>We&#39;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&#39;m encountering a few oddities, though, and I wonder if someone can clarify how that endpoint works for me?</div><div><br></div><div>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 &quot;main.bin&quot;.  Perhaps I&#39;m missing some crosswalk configuration?</div><div><br></div><div><a href="http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_creatingresource_entry" target="_blank">http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_creatingresource_entry</a><br></div><div><br></div><div>2/ My service document says:</div><div><br></div><div>&lt;acceptPackaging&gt;<a href="http://purl.org/net/sword/package/Binary" target="_blank">http://purl.org/net/sword/package/Binary</a>&lt;/acceptPackaging&gt;<br></div><div><br></div><div>But when I PUT a file of this format tot he media resource I get a &quot;package format not supported&quot; error.</div><div><br></div><div>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><br></div><div>3/ Completing deposit doesn&#39;t appear to work.  When I POST to the eprint&#39;s Edit-IRI, I get a 405 Method Not Allowed, but it should update the eprint</div><div><br></div><div><a href="http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#continueddeposit_complete" target="_blank">http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#continueddeposit_complete</a><br></div><div><br></div><div><br></div><div>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">http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_creatingresource_multipart</a></div><div><br></div><div>Any tips/pointers much appreciated.</div><div><br></div><div>Cheers,</div><div><br></div><div>Richard<br clear="all"><div><br></div>-- <br><div><div><br></div>Richard Jones, <div><br></div><div>Founder, Cottage Labs <div>t: @richard_d_jones, @cottagelabs</div><div>w: <a href="http://cottagelabs.com" target="_blank">http://cottagelabs.com</a><br><div><br></div></div></div></div>
</div></div>
</div></div><br></div></div><span>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
<br></span></blockquote></div><br><br clear="all"><span><div><br></div>-- <br><div><div><br></div>Richard Jones, <div><br></div><div>Founder, Cottage Labs <div>t: @richard_d_jones, @cottagelabs</div><div>w: <a href="http://cottagelabs.com" target="_blank">http://cottagelabs.com</a><br><div><br></div></div></div></div>
</span></div></div>
<br>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
<br></blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br><div><div><br></div>Richard Jones, <div><br></div><div>Founder, Cottage Labs <div>t: @richard_d_jones, @cottagelabs</div><div>w: <a href="http://cottagelabs.com" target="_blank">http://cottagelabs.com</a><br><div><br></div></div></div></div>
</div></div></div></div></div>
<br>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><br></div>Richard Jones, <div><br></div><div>Founder, Cottage Labs <div>t: @richard_d_jones, @cottagelabs</div><div>w: <a href="http://cottagelabs.com" target="_blank">http://cottagelabs.com</a><br><div><br></div></div></div></div>
</div></div></div>
</div></div></div></div></div></div>
<br>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><br></div>Richard Jones, <div><br></div><div>Founder, Cottage Labs <div>t: @richard_d_jones, @cottagelabs</div><div>w: <a href="http://cottagelabs.com" target="_blank">http://cottagelabs.com</a><br><div><br></div></div></div></div>
</div></div>
</div></div></div></div></div></div>
<br>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div><br></div>Richard Jones, <div><br></div><div>Founder, Cottage Labs <div>t: @richard_d_jones, @cottagelabs</div><div>w: <a href="http://cottagelabs.com" target="_blank">http://cottagelabs.com</a><br><div><br></div></div></div></div>
</div></div>