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

Revised SROWA translator #1701

Merged
merged 12 commits into from Oct 11, 2018

Conversation

Projects
None yet
3 participants
@ontomoc
Copy link
Contributor

ontomoc commented Jul 30, 2018

Recoded to eliminate the use of FW, as requested. Could you please check whether the revision meets Zotero requirements.

ontomoc and others added some commits Sep 13, 2017

Create State Records Office of Western Australia.js
This is a Zotero translator for State Records Office of Western Australia's archive catalogue at https://archive.sro.wa.gov.au/index.php/.  The catalogue is an AtoM-based system (http://accesstomemory.org).

The translator harvests metadata for (a) Series, (b) Items, (c) Pieces.  It also will harvest metadata for multiple items returned from a catalogue search.
Revised SROWA translator
Recoded to eliminate the use of FW, as requested.
"items": [
{
"itemType": "manuscript",
"title": "CANCELLED PUBLIC PLANS (DISTRICTS) - POST STANDARD SERIES",

This comment has been minimized.

Copy link
@adam3smith

adam3smith Aug 4, 2018

Collaborator

question: we can try to convert these all caps strings to something more sensible -- would that make sense or is it important that they stay in all caps for some reason?

This comment has been minimized.

Copy link
@ontomoc

ontomoc Aug 7, 2018

Author Contributor

Thank you for improving my javascript. I will:

  1. Review that it still works as expected.
  2. Add some code to convert the caps to Title case or similar (SROWA have OK'ed that).
  3. Add the tests.

Also, is ZU.Xpath still acceptable in translators? I went with DOM methods eg. querySelector(), querySelectorAll(), but this perhaps made the code a bit longer.

This comment has been minimized.

Copy link
@adam3smith

adam3smith Aug 7, 2018

Collaborator

We prefer using CSS selectors over xpaths for new translators if at all possible, yes, so that was the right call.

@adam3smith
Copy link
Collaborator

adam3smith left a comment

Thanks! Could you

  1. Test to make sure this still works with my changes
  2. Answer my question on all caps titles above
  3. add a test that includes an attachment

@adam3smith adam3smith added waiting and removed waiting labels Aug 12, 2018

ontomoc added some commits Oct 3, 2018

Update State Records Office of Western Australia.js
Responding to suggestions from 5 August '18:
Now translates at four levels of archival description: Series, Items, Pieces, and Elements.
Added findDate(dateStr) to simplify selection of preferred date from the 0-2 date strings, by precedence EndDate > StartDate > NULL.
Revised the "Date(s)" case to (i) chose Zotero item date by precedence Creation > Accumulation > NULL, (ii) add notes for Creation and Accumulation dates, if each exists. 
Added toTitleCase(titleStr) to convert Agency(Author) names and Series titles to Title case (excepting 'of' and 'and').
Added test case that downloads an attached digital copy.
Update State Records Office of Western Australia.js
Added missing metadata block to top of code.
Per travis-cl check, repaired code — added missing semicolons and changed quotes to double quotes.
Merge pull request #1 from ontomoc/srowa-zottrans-1
Create State Records Office of Western Australia.js
Update State Records Office of Western Australia.js
Revised detectWeb() to more correctly detect multiple items returned by some search modes. Also, to handle multiple items returned during informationobject browse (but not other kinds of browse).
@ontomoc

This comment has been minimized.

Copy link
Contributor Author

ontomoc commented Oct 7, 2018

Revised translator ready for review.

@ontomoc

This comment has been minimized.

Copy link
Contributor Author

ontomoc commented Oct 8, 2018

BTW, the Zotero icon doesn't show in the browser's address bar when Zotero makes available this translator.

adam3smith and others added some commits Oct 9, 2018

Some code cleaning
This still needs testing
Update State Records Office of Western Australia.js
Thanks for ZU.capitalizeTitle() — works well — and other code improvements. Tested, then added two missing brackets, changed === test on prefDate, and declared var dateCreationStr and dateAccumStr earlier (Scaffold shows 'declared out of scope').  In detectWeb() else{} now returns 'single'.  Passes tests.
@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Oct 9, 2018

(I'm still making changes to this, so please leave it for the time being)

@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Oct 9, 2018

OK, take a look at my changes -- this is ready to merge from my end now.

@ontomoc

This comment has been minimized.

Copy link
Contributor Author

ontomoc commented Oct 11, 2018

Thank you for the checks and improvements. Have worked through changes, and run some tests. Results as expected. Happy for it to be merged now.

@adam3smith adam3smith merged commit 8ce89b7 into zotero:master Oct 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Oct 11, 2018

Great, thanks for checking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.