Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating a container's metadata removes all references to existing contents #2

Open
mtrevor opened this issue Oct 15, 2015 · 0 comments

Comments

@mtrevor
Copy link

mtrevor commented Oct 15, 2015

I'm using the python sword2 client to first create an item from a zip file, then to provide the metadata. The zip file along with its extracted contents is visible in the Item view after the initial creation, but the contents disappear once an update is done.

This is what I'm trying:

from sword2 import Connection, Entry
conn = Connection(SD_URI, user_name='sword', user_pass='sword')
conn.get_service_document()
coll = conn.workspaces[0][1][0]
data = open('test.zip', 'rb').read()
meta = Entry(title='Some title')

receipt_c = conn.create(
    col_iri=coll.href,
    filename='test.zip',
    payload=data,
    mimetype='application/zip',
    packaging='http://purl.org/net/sword/package/SimpleZip',
    in_progress=True,
)
receipt_u = conn.update_metadata_for_resource(
    dr=receipt_c, metadata_entry=meta, in_progress=False,
)

I'm seeing no warning or error in the logs during the creation or update, but once the update is done, the files are no longer visible. They're still present in the backend but the statement.xml isn't being updated correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant