Skip to content

Commit

Permalink
add ReCAP CGD result type
Browse files Browse the repository at this point in the history
  • Loading branch information
tventimi committed Nov 19, 2024
1 parent 37dfc5e commit 8b7d2c6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 6 deletions.
Binary file modified CatalogLookup.xlam
Binary file not shown.
2 changes: 1 addition & 1 deletion src.vba/AdditionalFieldsDialog.frm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Attribute VB_Name = "AdditionalFieldsDialog"
Attribute VB_Base = "0{9219A4A2-A2E6-4A81-8855-D71D4A6FF4FB}{4D359D4C-DCF2-49C7-B394-A3FE4EF3EA29}"
Attribute VB_Base = "0{FBA7A149-0638-4BF1-BC85-38DFB1B3AA8D}{40D36CA5-041D-41F2-866A-06F24A52E347}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Expand Down
25 changes: 24 additions & 1 deletion src.vba/Catalog.vba
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Global sSheetName As String

Public Const HKEY_CURRENT_USER = &H80000001
Public Const sRegString = "Software\Excel Local Catalog Lookup"
Public Const sVersion = "v1.3.3"
Public Const sVersion = "v1.3.4"
Public Const sRepoURL = "https://github.com/pulibrary/ExcelAlmaLookup"
Public Const sBlacklightURL = "https://catalog.princeton.edu/catalog.json?q="
Public Const sLCCatURL = "http://lx2.loc.gov:210/LCDB"
Expand Down Expand Up @@ -390,6 +390,7 @@ Sub PopulateSourceDependentOptions()
If LookupDialog.CatalogURLBox = "source:recap" Then
LookupDialog.ResultTypeCombo.Style = 2 'fmStyleDropDownList
LookupDialog.ResultTypeCombo.AddItem "ReCAP Holdings"
LookupDialog.ResultTypeCombo.AddItem "ReCAP CGD"
Else
LookupDialog.ResultTypeCombo.Style = 0 'fmStyleDropDownCombo
End If
Expand Down Expand Up @@ -1106,6 +1107,28 @@ Function ExtractField(sResultTypeAll As String, sResultXML As String, bHoldings
Else
ExtractField = Left(ExtractField, Len(ExtractField) - 1)
End If
Case "recap_cgd"
oRegEx.Pattern = "(?:""location_code"":""([^""]*)""[^}]*)?(?:""description"":""([^""]*)""[^}]*)?(?:""use_statement"":""([^""]*)""[^}]*)?""cgd"":""([^""]*)""[^}]*""collection_code"":""([^""]*)"""
sCGD = ""
Set oCGD = oRegEx.Execute(sCurrentRecord)
sRecapLoc = ""
For i = 0 To oCGD.Count - 1
If oCGD(i).Submatches(0) <> "" Then
sRecapLoc = oCGD(i).Submatches(0)
sRecapLoc = Replace(sRecapLoc, "scsb", "")
End If
If sCGD <> "" Then
sCGD = sCGD & Chr(166)
End If
sCGD = sCGD & sRecapLoc & "-" & oCGD(i).Submatches(4) & "-" & oCGD(i).Submatches(3)
If oCGD(i).Submatches(2) <> "" Then
sCGD = sCGD & "-" & oCGD(i).Submatches(2)
End If
If oCGD(i).Submatches(1) <> "" Then
sCGD = sCGD & "-" & oCGD(i).Submatches(1)
End If
Next i
ExtractField = ExtractField & sCGD
Case Else
ExtractField = "ERROR:InvalidRecap"
Exit Function
Expand Down
4 changes: 3 additions & 1 deletion src.vba/LookupDialog.frm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Attribute VB_Name = "LookupDialog"
Attribute VB_Base = "0{A767D8F5-30D6-4F19-AA71-373A0453F864}{7C19AE13-CF6D-49F5-ACC8-4F38A38D8DC7}"
Attribute VB_Base = "0{0BFE1CEB-0FFE-4823-B392-74E809AA0188}{A9BDEA98-0A93-40A4-B2A6-36BA232D7F9A}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Expand Down Expand Up @@ -295,6 +295,8 @@ Private Sub OKButton_Click()
stype = "exists"
ElseIf stype = "ReCAP Holdings" Then
stype = "recap"
ElseIf stype = "ReCAP CGD" Then
stype = "recap_cgd"
ElseIf stype = "BorrowDirect Holdings" Then
stype = "999$sp"
ElseIf stype = "WorldCat Holdings" Then
Expand Down
2 changes: 1 addition & 1 deletion src.vba/OtherSourcesDialog.frm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Attribute VB_Name = "OtherSourcesDialog"
Attribute VB_Base = "0{20FE6734-4F81-40CA-B84B-F67348CBA4C8}{EE5E5994-0125-4818-8B30-EACE2799C8DD}"
Attribute VB_Base = "0{242E5854-D1E5-410C-BC90-9CAEEDAB54C2}{5FFC3E6C-E22D-44A5-B9F5-244D67D8C8DF}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Expand Down
2 changes: 1 addition & 1 deletion src.vba/SearchingDialog.frm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Attribute VB_Name = "SearchingDialog"
Attribute VB_Base = "0{000AB31D-B2C9-4D1C-ADDA-45C810528F37}{6BE559E1-68FA-4FA9-8099-EC1729C29653}"
Attribute VB_Base = "0{DAC5A3CD-7657-4EA2-B1E6-63A715977798}{02B38624-78C3-44E1-A717-3F98F4623EDD}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Expand Down
2 changes: 1 addition & 1 deletion src.vba/UserPassForm.frm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Attribute VB_Name = "UserPassForm"
Attribute VB_Base = "0{26C754C2-76CE-4185-BE99-D45C3933527B}{629BE6BF-24FC-4AA8-819D-E4D504F74981}"
Attribute VB_Base = "0{4DA4C497-92F3-4BDA-A4F8-AE8048E02F88}{5204F4E3-9731-4B0A-892C-3D7CEC048CD8}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Expand Down

0 comments on commit 8b7d2c6

Please sign in to comment.