Skip to content

Instantly share code, notes, and snippets.

@tingletech
Last active June 29, 2016 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tingletech/07a6df1af6ecc44d45663eacbf7d038f to your computer and use it in GitHub Desktop.
Save tingletech/07a6df1af6ecc44d45663eacbf7d038f to your computer and use it in GitHub Desktop.
[registry@dsc-registry-stg record_cleanup]$ export PYTHONPATH=.
[registry@dsc-registry-stg record_cleanup]$ cat needs-id-fix.txt | xargs -I {} nxls --recursive-objects "{}" --show-custom-function fix_file
[registry@dsc-registry-stg record_cleanup]$ pwd
/apps/registry/from-nuxeo/code/nuxeo-load/record_cleanup
def nuxeo_mapper(docs, nx):
for doc in docs:
if not doc['properties'].get('file:content'):
return
if not doc['properties'].get('file:filename'):
new = {}
new['file:filename'] = doc['properties']['file:content']['name']
doc['properties'] = new
print(doc['uid'])
nx.update_nuxeo_properties(doc, uid=doc['uid'])
/asset-library/UCSF/MSS 2003-12 Eric Berne papers
/asset-library/UCSF/MSS 2005-08 Eric Berne papers
/asset-library/UCSF/MSS 82-0 Eric Berne papers
/asset-library/UCSF/MSS 89-12 Eric Berne papers
/asset-library/UCSF/MSS 2013-18 Eric Berne papers
/asset-library/UCSF/MSS 2013-19 Eric Berne papers
/asset-library/UCSF/MSS 2016-03 Guedel
/asset-library/UCSF/MSS 0085-38 Black Caucus Bishop
/asset-library/UCSF/J. Michael Bishop papers MSS 2007-21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment