-
Notifications
You must be signed in to change notification settings - Fork 11
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
LGC-39 Udix remove print #836
base: develop
Are you sure you want to change the base?
Changes from 14 commits
c42266d
dbe0a78
678aabc
ad9228e
ce977b8
314ba46
c8f28f5
3db2b13
fd0f0fe
76d064a
29d42bd
a6d0b3d
98b6185
cff48ef
edc5689
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
37ftj0m8013f94l | ||
djrzr21k4kqfkk1 | ||
v06lbxc13vtklgf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
PrintWriter failedUpdating = getReportWriter("failed-updating") | ||
PrintWriter scheduledForUpdating = getReportWriter("scheduled-updates") | ||
|
||
File HoldIDs = new File(scriptDir, "Udix_ID2.txt") | ||
|
||
List propertiesToCheck = ["associatedMedia", "marc:hasTextualHoldingsBasicBibliographicUnit"] | ||
|
||
selectByIds( HoldIDs.readLines() ) { hold -> | ||
def holds = hold.graph[1] | ||
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: the use of hold (an individual hold) vs holds (here a part of that individual hold) is slightly confusing. Maybe "holds" => "item" would be better. (Doesn't matter for a one-off script, but for the future 😄). |
||
|
||
propertiesToCheck.each { prop -> | ||
holds[prop].removeIf { it["marc:publicNote"].contains("Externt magasin / Closed stacks") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! |
||
|
||
} | ||
|
||
scheduledForUpdating.println("${hold.doc.getURI()}") | ||
hold.scheduleSave(loud: true, onError: { e -> | ||
failedUpdating.println("Failed to update ${hold.doc.shortId} due to: $e") | ||
|
||
}) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK created/modified/deleted are now default reports, created automatically, so these shouldn't be necessary. (Which means
scheduledForUpdating
andfailedUpdating
below can also be removed.)