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

Capture Google Sheet ID in the metadata as 'import_source' #42

Open
McFateM opened this issue Nov 2, 2017 · 3 comments
Open

Capture Google Sheet ID in the metadata as 'import_source' #42

McFateM opened this issue Nov 2, 2017 · 3 comments

Comments

@McFateM
Copy link
Contributor

McFateM commented Nov 2, 2017

Taking steps to implement this in a PR today. In the case of import directly from a Google Sheet my code may append one or two columns to the headers and every ingested row. This can effectively address issue #20 provided the Google Sheet is NEVER sorted and the row numbers remain unchanged throughout the sheet's life! The two columns are:

  • import_source - Contains the ID of the Google Sheeet
  • import_index - Contains the row number of the object from the Google Sheet IF no 'import_index' row is otherwise defined.
@DiegoPino
Copy link
Contributor

@McFateM hey. Happens that i also have #20 use case now (well, happens if you need to add a page to a book in a 16000 pages ingest!). So once you have that pull, i can integrate that functionality for CSV/excel also to keep it in sync. Any ideas on how you want to deal with the UI aspect/validation of that? Best!

@McFateM
Copy link
Contributor Author

McFateM commented Nov 2, 2017 via email

@McFateM
Copy link
Contributor Author

McFateM commented Nov 9, 2017

@DiegoPino Per yesterday's conversation I'm completely re-thinking and re-working this. The goal in our workflow is to capture in our metadata a field that can be used to lead us back to the Google Sheet and row that an object was imported from.

To that end I'm introducing an $imi_import_source_tracking UI element and variable. The UI element will be a text field and enabling check box. The text field will be populated, by default, with a string representing the specified Google Sheet ID (or full URL) with the specified 'range' appended to it. Since this is a text field the user will have the ability to replace the default with whatever they wish. If this text field is enabled (using the corresponding check box), upon ingest the row number of an imported object is appended to the string (the value of $imi_import_source_tracking) and that result is subsequently appended to end of the row's data in a column specifically named 'imi_import_source_tracking'.

My own workflow around this feature provides an element in my Twig template like this...

{# The following MODS extension elements may be specific to Digital Grinnell! #} 
<extension> 
  {% if attribute(data, 'imi_import_source_tracking') %}  
    <dg_importSource>{{ data.imi_import_source_tracking }}</dg_importSource>  
  {% endif %}
</extension> 
``` 
So when engaged, this feature leaves a MODS/extension/imi_import_source_tracking element in each object's record that can be used to determine where the record was imported from.


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

2 participants