scientist-softserv / west-virginia-university

West Virginia University
0 stars 0 forks source link

I94 catalog results xml exporter #132

Closed kirkkwang closed 10 months ago

kirkkwang commented 10 months ago

Story

🎁 Add xml exporter

37b90890b2c4f1daedc5c57d22ebb3755b0a86b4

This commit will add an xml exporter in addition to the csv exporter. A bit of refactoring was needed to get the exporter to work. We have to use a different approach than using the CatalogController#index because there's already a default feature when doing /catalog.xml. Instead we use an #export action for both exporters. To DRY up the code we introduce the ExportResultsPresenter to handle the shared logic. Also we add a little bit of CSS to make the button look like the others as well as change the button to a dropdown menu.

Ref:

✅ Add xml exporter test and refactor

a2079be022c74deb6cbb8c5e51661dc25539b42a

This commit will add the test for ExportXmlPresenter. It will also refactor the ExportCsvPresenter to use the same shared context as the ExportXmlPresenter.

♻️ Refactor to use ExportResultsPresenter

8bc430866e92bc57fb9919d6279ab6671f3b6508

This commit will combine the exporters into a single one and adjust specs accordingly.

Expected Behavior After Changes

Catalog results has an Export dropdown button where the user can choose to export the search results to CSV or XML.

Screenshots / Video

image
Example XML export: ```xml Robert J. Dole Institute of Politics Dole and Goldwater shake hands (Kirk was here) 1964 1964 Unknown http://rightsstatements.org/vocab/NKC/1.0/ zxx 88th (1963-1964) Dole Photograph Collection, 1900-2011 Collection 012, Box 6, Folder 15 https://dolearchivecollections.ku.edu/index.php?p=collections/controlcard&id=47&q= http://congressarchivesdev.lib.wvu.edu/record/ph_006_015_002 https://dolearchives.omeka.net/exhibits/show/voices-from-the-big-first/item/323 https://dolearchives.omeka.net/exhibits/show/voices-from-the-big-first/item/323 black-and-white photograph; Government Operations and Politics Goldwater, Barry M. (Barry Morris), 1909-1998; Dole, Robert J., 1923-2021 Congressman Bob Dole and Senator Barry Goldwater shaking hands with an American flag in the background. StillImage b-1-3 Robert J. Dole Institute of Politics Congressman Dole's Introduction Of Senator Barry Goldwater (Kirk was here) 1964-05-12 1964-05-12 Dole, Robert J., 1923-2021 http://rightsstatements.org/vocab/NoC-US/1.0/ eng 88th (1963-1964) Robert J. Dole Speeches Collection, 1958-1996 Collection 019, Box 1, Folder 40 https://dolearchivecollections.ku.edu/index.php?p=collections/controlcard&id=52&q= http://congressarchivesdev.lib.wvu.edu/record/c019_001_040_all https://dolearchives.omeka.net/exhibits/show/voices-from-the-big-first/item/279 https://dolearchives.omeka.net/exhibits/show/voices-from-the-big-first/item/279 speech (document); Government Operations and Politics Goldwater, Barry M. (Barry Morris), 1909-1998; Dole, Robert J., 1923-2021 Speech given by Congressman Robert J. Dole to introduce Senator Barry Goldwater at a rally in Madison Square Garden in New York City. Text b-1-4 Robert J. Dole Institute of Politics Buffalo NY: Rockefeller and Dole Speeches (Kirk was here) 1976-09-16 1976-09-16 Unknown http://rightsstatements.org/vocab/CNE/1.0/ eng 94th (1975-1976) Robert J. Dole Audio Cassette Collection, 1966-1997 Collection 016, Cassette k001, Side A https://dolearchivecollections.ku.edu/index.php?p=collections/controlcard&id=50&q= http://congressarchivesdev.lib.wvu.edu/record/c016_k001_a.mp3 https://dolearchivecollections.ku.edu/collections/1976/assets/c016_k001_a.mp3 https://dolearchivecollections.ku.edu/collections/1976/resources/ speech (communication function); audio recording Government Operations and Politics Dole, Robert J., 1923-2021; Rockefeller, Nelson A. (Nelson Aldrich), 1908-1979 Large crowd, Rally for Republican ticket, Stump Speech on Ford & Rockefeller, NY State GOP leaders Text b-1-5 Robert J. Dole Institute of Politics Folder 6: D.C. Republican Women - Washington, D.C., 7 February 1977 (Kirk was here) 1977-02-07 1977-02-07 Dole, Robert J., 1923-2021 http://rightsstatements.org/vocab/NoC-US/1.0/ eng 95th (1977-1978) Robert J. Dole Speeches Collection, 1958-1996 Collection 019, Box 17, Folder 6 https://dolearchivecollections.ku.edu/index.php?p=collections/controlcard&id=52&q= http://congressarchivesdev.lib.wvu.edu/record/c019_017_006_all https://dolearchivecollections.ku.edu/collections/speeches/017/c019_017_006_all.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=52&q= speech (document); Economics and Public Finance Dole, Robert J., 1923-2021; Folder 6: D.C. Republican Women - Washington, D.C., 7 February 1977 Text b-1-2 Robert J. Dole Institute of Politics Senator Bob Dole addressing farmers at Senate Agriculture Committee Hearings, 1979 (Kirk was here) 1979 1979 Unknown https://creativecommons.org/publicdomain/mark/1.0/ zxx 96th (1979–1981) Dole Photograph Collection (Old Arrangement - For Reference Only), 1880-1996 Collection 36719, Box 45: A [1], Folder 704 https://dolearchivecollections.ku.edu/index.php?p=collections/controlcard&id=9 http://congressarchivesdev.lib.wvu.edu/record/pla_1_102 https://dolearchivecollections.ku.edu/index.php?p=digitallibrary/digitalcontent&id=1607 black-and-white photograph; StillImage b-1-10 Robert J. Dole Institute of Politics Ronald Reagan to Bob Dole, 1981-12-23 (Kirk was here) 1981-12-23 1981-12-23 Reagan, Ronald http://rightsstatements.org/vocab/CNE/1.0/ eng 97th (1981–1983) VIP Letters, 1960-2008 Collection 020, Box 12, Item 22 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=55&q= http://congressarchivesdev.lib.wvu.edu/record/c020_012_000_022 https://dolearchivecollections.ku.edu/collections/vip_letters/c020_012_000_022.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=55&q=&rootcontentid=162379#id162379 correspondence; Reagan, Ronald; Dole, Robert J., 1923-2021 Letter from President of the United States Ronald Reagan to Senator Bob Dole thanking him for agreeing to serve on the new National Commission on Social Security Reform. Text b-1-14 Robert J. Dole Institute of Politics Social Security Rescued, 1983 (Kirk was here) 1983 1983 Dole, Robert J., 1923-2021 http://rightsstatements.org/vocab/CNE/1.0/ eng 97th (1981–1983) Digitized Press Releases, 1961-1996 Collection 015, Box 25, Folder 15 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=40&q= http://congressarchivesdev.lib.wvu.edu/record/s-press_025_015_002 https://dolearchivecollections.ku.edu/collections/press_releases/s-press_025_015_002.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=40&rootcontentid=191544&q=social+security#id191549 press release; newsletter Text b-1-12 Robert J. Dole Institute of Politics Ronald Reagan Signing Social Security Act Outside (Kirk was here) 1983-04-18 1983-04-18 Unknown http://rightsstatements.org/vocab/CNE/1.0/ zxx 98th (1983–1985) Dole Photograph Collection, 1900-2011 Collection 012, Box 54, Folder 2 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=47&q= http://congressarchivesdev.lib.wvu.edu/record/ph_054_012_002 https://dolearchivecollections.ku.edu/index.php?p=digitallibrary/digitalcontent&id=286 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=47&q= color photograph; Kansas Senator Bob Dole, Representative Claude Pepper, Senator Daniel P. Moynihan, Representative Barber Conable, and House Speaker "Tip" O'Neill watch as President Reagan signs the "Social Security Amendments of 1983" into law. StillImage b-1-9 Robert J. Dole Institute of Politics Dole at White House Social Security Signing Session Hails Bipartisan Package, 4/20/1983 (Kirk was here) 1983-04-20 1983-04-20 Dole, Robert J., 1923-2021 http://rightsstatements.org/vocab/CNE/1.0/ eng 97th (1981–1983) Digitized Press Releases, 1961-1996 Collection 015, Box 25, Folder 16 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=40&q= http://congressarchivesdev.lib.wvu.edu/record/s-press_025_016_020 https://dolearchivecollections.ku.edu/collections/press_releases/s-press_025_016_020.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=40&rootcontentid=191544&q=social+security#id191639 press release; Text b-1-13 Robert J. Dole Institute of Politics Ronald Reagan to Bob Dole, 1983-04-26 (Kirk was here) 1983-04-26 1983-04-26 Reagan, Ronald http://rightsstatements.org/vocab/CNE/1.0/ eng 97th (1981–1983) VIP Letters, 1960-2008 Collection 020, Box 12, Item 43 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=55&q= http://congressarchivesdev.lib.wvu.edu/record/c020_012_000_043 https://dolearchivecollections.ku.edu/collections/vip_letters/c020_012_000_043.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=55&q=&rootcontentid=162379#id162379 correspondence; Reagan, Ronald; Dole, Robert J., 1923-2021 Letter from President of the United States Ronald Reagan to Senator Bob Dole thanking him for support of the Senate Concurrent Resolution 26, to deploy 100 peacekeepers missiles and develop a new single-warhead ICBM. Text b-1-16 Robert J. Dole Institute of Politics Statement of Senator Dole on S. 1 "the Social Security Amendments of 1983" (Kirk was here) 1983-01-26 1983-01-26 Dole, Robert J., 1923-2021 http://rightsstatements.org/vocab/CNE/1.0/ eng 97th (1981–1983) Digitized Press Releases, 1961-1996 Collection 015, Box 25, Folder 13 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=40&q= http://congressarchivesdev.lib.wvu.edu/record/s-press_025_013_018 https://dolearchivecollections.ku.edu/collections/press_releases/s-press_025_013_018.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=40&rootcontentid=191544&q=social+security#id191567 press release; Text b-1-11 Robert J. Dole Institute of Politics "Social Security Rescued" Press Release and Newsletter (Kirk was here) 1983-06 1983-06 Dole, Robert J., 1923-2021 https://creativecommons.org/publicdomain/mark/1.0/ eng 98th (1983-1985) Digitized Press Releases, 1961-1996 Collection 015, Box 26, Folder 2 https://dolearchivecollections.ku.edu/index.php?p=collections/controlcard&id=40&q= http://congressarchivesdev.lib.wvu.edu/record/s-press_026_002_001 https://dolearchivecollections.ku.edu/collections/press_releases/s-press_026_002_001.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=40&q= press release; newsletter Social Welfare Dole, Robert J., 1923-2021; Text b-1-1 Robert J. Dole Institute of Politics Ronald Reagan to Bob Dole, 1983-03-05 (Kirk was here) 1983-03-05 1983-03-05 Reagan, Ronald http://rightsstatements.org/vocab/CNE/1.0/ eng 97th (1981–1983) VIP Letters, 1960-2008 Collection 020, Box 12, Item 42 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=55&q= http://congressarchivesdev.lib.wvu.edu/record/c020_012_000_042 https://dolearchivecollections.ku.edu/collections/vip_letters/c020_012_000_042.pdf https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=55&q=&rootcontentid=162379#id162379 correspondence; Reagan, Ronald; Dole, Robert J., 1923-2021 Letter from President of the United States Ronald Reagan to Senator Bob Dole giving Dole the signing pen from H.R. 1900, the Social Security Amendments of 1983. Text b-1-15 Robert J. Dole Institute of Politics Senator Bob Dole welcoming Queen Elizabeth II to the Capitol (Kirk was here) 1991 1991 United States. Congress. Senate. https://creativecommons.org/publicdomain/mark/1.0/ zxx 102nd (1991-1993) Dole Photograph Collection, 1900-2011 Collection 012, Box 35, Folder 31 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=47&q= http://congressarchivesdev.lib.wvu.edu/record/ph_035_041_001 https://dolearchivecollections.ku.edu/index.php?p=digitallibrary/digitalcontent&id=1648 https://dolearchivecollections.ku.edu/index.php?p=digitallibrary/digitalcontent&id=1648 color photograph; International Affairs Dole, Robert J., 1923-2021; Elizabeth II, Queen of Great Britain, 1926-2022 Senator Bob Dole shakes hands with Queen Elizabeth II as she arrives at the U.S. Capitol. StillImage b-1-0 Robert J. Dole Institute of Politics Senator Bob Dole Oral History, 2007-10-16 (Kirk was here) 2007-10-16 2007-10-16 Richard Norton Smith http://rightsstatements.org/vocab/CNE/1.0/ eng 110th (2007–2009) Dole Institute Oral History Project, 2002-2009 Collection 018, Bob Dole Oral History from 2007-10-16 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=51&q= http://congressarchivesdev.lib.wvu.edu/record/dole_bob_2007-10-16 https://dolearchivecollections.ku.edu/collections/oral_history/mp3/dole_bob_2007-10-16.mp3 https://dolearchives.omeka.net/items/show/335 oral history (discipline); In this 2007 oral history interview with Richard Norton Smith, Dole talks about Reagan-era issues, including supply-side economics, Social Security reform, the White House staff, Dole's role as Majority Leader in the Senate, and other topics. Sound b-1-17 Robert J. Dole Institute of Politics Kassebaum-Baker, Sen. Nancy, 4/16/2009 (Kirk was here) 2009-04-16 2009-04-16 Williams, Brien R. http://rightsstatements.org/vocab/CNE/1.0/ eng 111th (2009-2010) Dole Institute Oral History Project, 2002-2009 Collection 018, Nancy Kassebaum-Baker Oral History from 2009-04-16 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=51&q= http://congressarchivesdev.lib.wvu.edu/record/kassebaum-baker_nancy_2009-04-16 https://dolearchivecollections.ku.edu/collections/oral_history/mp3/kassebaum-baker_nancy_2009-04-16.mp3 https://dolearchives.omeka.net/items/show/234 sound; Agriculture and Food, Health, International Affairs Dole, Robert J., 1923-2021; Baker, Nancy Kassebaum, 1932- In this 2009 oral history interview with Brien R. Williams, Kassebaum-Baker talks about Senator Dole's work ethic and the issues of abortion, the Panama Canal, and wheat subsidies on the campaign trail. Baker represented Kansas in the U.S. Senate (1978-1997). She was the first female senator not elected to a seat held by her husband nor appointed to fill out a deceased husband’s term. Sound b-1-6 Robert J. Dole Institute of Politics Kassebaum-Baker, Sen. Nancy, 4/16/2009 (Kirk was here) 2009-04-16 2009-04-16 Williams, Brien R. http://rightsstatements.org/vocab/CNE/1.0/ eng 111th (2009-2010) Dole Institute Oral History Project, 2002-2009 Collection 018, Nancy Kassebaum-Baker Oral History from 2009-04-16 https://dolearchivecollections.ku.edu/index.php?p=collections/findingaid&id=51&q= http://congressarchivesdev.lib.wvu.edu/record/LSqyFpjhe3g https://www.youtube.com/watch?v=LSqyFpjhe3g https://dolearchives.omeka.net/items/show/234 moving image; Agriculture and Food, Health, International Affairs Dole, Robert J., 1923-2021; Baker, Nancy Kassebaum, 1932- In this 2009 oral history interview with Brien R. Williams, Kassebaum-Baker talks about Senator Dole's work ethic and the issues of abortion, the Panama Canal, and wheat subsidies on the campaign trail. Baker represented Kansas in the U.S. Senate (1978-1997). She was the first female senator not elected to a seat held by her husband nor appointed to fill out a deceased husband’s term. MovingImage b-1-7 ```
kirkkwang commented 10 months ago

@laritakr Client is fine with the ; as the delimeter for multiple values. There was an ask to have the xml reference the schema (dc or edm terms). I've asked for more details on how they want it but I think we can handle that in another ticket. The ask for this ticket is complete.