pulibrary / aspace_helpers

methods and reports to support common SC activities in ArchivesSpace
1 stars 0 forks source link

we need to inherit restrictions down in the ACLU report #186

Closed regineheberlein closed 2 years ago

regineheberlein commented 2 years ago

if the component has a container but no restriction, we need to look up to its ancestor to grab the restriction

regineheberlein commented 2 years ago

NB The standard ACLU report takes circa 24 hours to run. The deliverable of this sort of report is always a spreadsheet.

regineheberlein commented 2 years ago

Adding logic in the form of an Excel formula to allow for timely tweaking (including by stakeholders):

Run in column K, starting row 4 with rows 2, 3 - J2,3:

IF(OR(G4=0, NOT(ISBLANK(J4))),J4,IF(AND(J4="",G4>0,G4=G3+1),K3,INDEX(K$2:K3,MATCH(2,1/(G$2:G3=G4-1)))))

Starting at row 4:

If level (G4) is 0 (i.e., collection) or restriction note (J4) is present, grab what's in the original restriction note field (J4). Else, if restriction note is blank and it is component-level (G4 is greater than 0) and it is a child of preceding (G4 is one greater than preceding), grab preceding computed restriction note, else find parent (first value in all of preceding G that is one less than G4)and grab its computed restriction note (K).