ukwa / w3act

w3act is an annotation and curation tool for building web archive collections
Apache License 2.0
19 stars 6 forks source link

Please add a full JSON Collections endpoint #253

Closed anjackson closed 9 years ago

anjackson commented 9 years ago

To access all the collections metadata, I need an export of them as JSON. I think this is just a matter of hooking a suitable route to CollectionsController.getCollectionsData(). e.g.

GET /collections/filterbyjson controllers.Collections.getCollectionsData()

and

GET /api/collections controllers.Collections.getCollectionsData()
kinmanli commented 9 years ago

@anjackson

This should get you collection's filter by name i.e. 'com' in this case.

http://www.webarchive.org.uk/actdev/collections/filterbyjson/com

http://localhost:9000/actdev/collections/byjson (or http://webarchive.org.uk/actdev/collections/byjson once deployed) should yield the following collection

[{"title":"100 Best Sites (95)","url":"/actdev/collections/1","key":"\"1\""},{"title":"19th Century English Literature (0)","url":"/actdev/collections/2","key":"\"2\""},{"title":"Commonwealth Games Glasgow 2014 (626)","url":"/actdev/collections/22","key":"\"22\"","children":[{"title":"Competitors (349)","url":"/actdev/collections/76","key":"\"76\""},{"title":"Cultural Programme (44)","url":"/actdev/collections/85","key":"\"85\""},{"title":"Organisational bodies/venues (58)","url":"/actdev/collections/203","key":"\"203\""},{"title":"Press & Media Comment (41)","url":"/actdev/collections/220","key":"\"220\""},{"title":"Sponsors (14)","url":"/actdev/collections/262","key":"\"262\""},{"title":"Sports (404)","url":"/actdev/collections/21","key":"\"21\"","children":[{"title":"Aquatics (74)","url":"/actdev/collections/20","key":"\"20\""},{"title":"Athletics (107)","url":"/actdev/collections/31","key":"\"31\""},{"title":"Badminton (17)","url":"/actdev/collections/32","key":"\"32\""},{"title":"Boxing (26)","url":"/actdev/collections/47","key":"\"47\""},{"title":"Cycling (34)","url":"/actdev/collections/88","key":"\"88\""},{"title":"Gymnastics (29)","url":"/actdev/collections/123","key":"\"123\""},{"title":"Hockey (17)","url":"/actdev/collections/134","key":"\"134\""},{"title":"Judo (9)","url":"/actdev/collections/144","key":"\"144\""},{"title":"Lawn bowls (11)","url":"/actdev/collections/151","key":"\"151\""},{"title":"Netball (6)","url":"/actdev/collections/186","key":"\"186\""},{"title":"Rugby Sevens (16)","url":"/actdev/collections/241","key":"\"241\""},{"title":"Shooting (14)","url":"/actdev/collections/243","key":"\"243\""},{"title":"Squash (16)","url":"/actdev/collections/265","key":"\"265\""},{"title":"Table tennis (6)","url":"/actdev/collections/270","key":"\"270\""},{"title":"Triathlon (7)","url":"/actdev/collections/280","key":"\"280\""},{"title":"Weightlifting (7)","url":"/actdev/collections/288","key":"\"288\""},{"title":"Wrestling (7)","url":"/actdev/collections/292","key":"\"292\""}]}]},{"title":"Conservative Party Website deletions - Press articles November 2013 (11)","url":"/actdev/collections/81","key":"\"81\""},{"title":"Ebola (447)","url":"/actdev/collections/100","key":"\"100\""},{"title":"European Parliament Elections 2014 (1743)","url":"/actdev/collections/4","key":"\"4\"","children":[{"title":"Academia & think tanks (15)","url":"/actdev/collections/3","key":"\"3\""},{"title":"Blogs (215)","url":"/actdev/collections/44","key":"\"44\""},{"title":"Candidates (520)","url":"/actdev/collections/58","key":"\"58\""},{"title":"EU Institutions (1)","url":"/actdev/collections/110","key":"\"110\""},{"title":"Interest groups (63)","url":"/actdev/collections/141","key":"\"141\""},{"title":"Opinion Polls (7)","url":"/actdev/collections/200","key":"\"200\""},{"title":"Political Parties: National (98)","url":"/actdev/collections/213","key":"\"213\""},{"title":"Political Parties: Regional & Local (65)","url":"/actdev/collections/214","key":"\"214\""},{"title":"Press & Media Comment (744)","url":"/actdev/collections/219","key":"\"219\""},{"title":"Regulation and Guidance (13)","url":"/actdev/collections/235","key":"\"235\""},{"title":"Social Media (1)","url":"/actdev/collections/246","key":"\"246\""}]},{"title":"Evolving role of libraries in the UK (21)","url":"/actdev/collections/111","key":"\"111\""},{"title":"First World War Centenary, 2014-18 (223)","url":"/actdev/collections/114","key":"\"114\"","children":[{"title":"Heritage Lottery Fund (73)","url":"/actdev/collections/127","key":"\"127\""}]},{"title":"Health and Social Care Act 2012 - NHS Reforms (752)","url":"/actdev/collections/9","key":"\"9\"","children":[{"title":"NHS (720)","url":"/actdev/collections/8","key":"\"8\"","children":[{"title":"Acute Trusts (161)","url":"/actdev/collections/7","key":"\"7\""},{"title":"Ambulance Trusts (12)","url":"/actdev/collections/16","key":"\"16\""},{"title":"Campaigning and Advocacy Groups (18)","url":"/actdev/collections/56","key":"\"56\""},{"title":"Cancer Networks (28)","url":"/actdev/collections/57","key":"\"57\""},{"title":"Care Trust (29)","url":"/actdev/collections/61","key":"\"61\""},{"title":"Clinical Commissioning Groups (191)","url":"/actdev/collections/70","key":"\"70\""},{"title":"Gateways (11)","url":"/actdev/collections/117","key":"\"117\""},{"title":"Health and Wellbeing Boards (108)","url":"/actdev/collections/124","key":"\"124\""},{"title":"Healthwatch (127)","url":"/actdev/collections/126","key":"\"126\""},{"title":"Legislation (17)","url":"/actdev/collections/154","key":"\"154\""},{"title":"Local Authorities (142)","url":"/actdev/collections/162","key":"\"162\""},{"title":"Local Involvement Networks (LINks) (159)","url":"/actdev/collections/165","key":"\"165\""},{"title":"Mental Health Trusts (50)","url":"/actdev/collections/178","key":"\"178\""},{"title":"NHS programmes (3)","url":"/actdev/collections/189","key":"\"189\""},{"title":"Press Comment (248)","url":"/actdev/collections/221","key":"\"221\""},{"title":"Primary Care Trusts (15)","url":"/actdev/collections/223","key":"\"223\""},{"title":"Private and voluntary sector providers (8)","url":"/actdev/collections/224","key":"\"224\""},{"title":"Professional Bodies Trade Union (49)","url":"/actdev/collections/225","key":"\"225\""},{"title":"Public Health Agencies (1)","url":"/actdev/collections/228","key":"\"228\""},{"title":"Public Health England (138)","url":"/actdev/collections/230","key":"\"230\""},{"title":"Regulators & Central Government (1)","url":"/actdev/collections/236","key":"\"236\""},{"title":"Social Media (Facebook, Twitter etc) (42)","url":"/actdev/collections/247","key":"\"247\""},{"title":"Special Health Authorities (13)","url":"/actdev/collections/259","key":"\"259\""},{"title":"Specialised Commissioning Group (12)","url":"/actdev/collections/261","key":"\"261\""},{"title":"Strategic Health Authorities (20)","url":"/actdev/collections/28","key":"\"28\"","children":[{"title":"London SHA Cluster (1)","url":"/actdev/collections/168","key":"\"168\"","children":[{"title":"London SHA (1)","url":"/actdev/collections/167","key":"\"167\"","children":[{"title":"London (1)","url":"/actdev/collections/166","key":"\"166\""},{"title":"North Central London (6)","url":"/actdev/collections/192","key":"\"192\""},{"title":"North East London and City (9)","url":"/actdev/collections/193","key":"\"193\""},{"title":"North West London (8)","url":"/actdev/collections/195","key":"\"195\""},{"title":"South East London (6)","url":"/actdev/collections/253","key":"\"253\""},{"title":"South West London (6)","url":"/actdev/collections/256","key":"\"256\""}]}]},{"title":"Midlands and East SHA Cluster (4)","url":"/actdev/collections/27","key":"\"27\"","children":[{"title":"East Midlands (1)","url":"/actdev/collections/91","key":"\"91\"","children":[{"title":"Derby City and Derbyshire (2)","url":"/actdev/collections/90","key":"\"90\""},{"title":"East Midlands (2)","url":"/actdev/collections/99","key":"\"99\""},{"title":"Leicestershire County & Rutland and Leicestershire City (2)","url":"/actdev/collections/155","key":"\"155\""},{"title":"Lincolnshire (1)","url":"/actdev/collections/160","key":"\"160\""},{"title":"Milton Keynes and Northamptonshire (2)","url":"/actdev/collections/180","key":"\"180\""},{"title":"Nottinghamshhire County and Nottingham City (2)","url":"/actdev/collections/198","key":"\"198\""}]},{"title":"East of England (1)","url":"/actdev/collections/38","key":"\"38\"","children":[{"title":"Bedfordshire and Luton (1)","url":"/actdev/collections/37","key":"\"37\""},{"title":"Cambridgeshire and Peterborough (3)","url":"/actdev/collections/55","key":"\"55\""},{"title":"Hertfordshire (1)","url":"/actdev/collections/128","key":"\"128\""},{"title":"Norfolk and Waveney (2)","url":"/actdev/collections/191","key":"\"191\""},{"title":"North, Mid and East Essex (1)","url":"/actdev/collections/197","key":"\"197\""},{"title":"South Essex (2)","url":"/actdev/collections/254","key":"\"254\""},{"title":"Suffolk (1)","url":"/actdev/collections/267","key":"\"267\""}]},{"title":"West Midlands (1)","url":"/actdev/collections/26","key":"\"26\"","children":[{"title":"Arden (2)","url":"/actdev/collections/25","key":"\"25\""},{"title":"Birmingham and Solihull (5)","url":"/actdev/collections/42","key":"\"42\""},{"title":"Black Country (4)","url":"/actdev/collections/43","key":"\"43\""},{"title":"Staffordshire (3)","url":"/actdev/collections/266","key":"\"266\""},{"title":"West Mercia (5)","url":"/actdev/collections/289","key":"\"289\""},{"title":"West Midlands (1)","url":"/actdev/collections/290","key":"\"290\""}]}]},{"title":"North of England SHA Cluster (7)","url":"/actdev/collections/50","key":"\"50\"","children":[{"title":"North East (3)","url":"/actdev/collections/83","key":"\"83\"","children":[{"title":"County Durham and Darlington (3)","url":"/actdev/collections/82","key":"\"82\""},{"title":"North of Tyne (5)","url":"/actdev/collections/194","key":"\"194\""},{"title":"South of Tyne (4)","url":"/actdev/collections/255","key":"\"255\""},{"title":"Tees (5)","url":"/actdev/collections/272","key":"\"272\""}]},{"title":"North West (1)","url":"/actdev/collections/68","key":"\"68\"","children":[{"title":"Cheshire, Warrington, Wirral (4)","url":"/actdev/collections/67","key":"\"67\""},{"title":"Cumbria (1)","url":"/actdev/collections/87","key":"\"87\""},{"title":"Greater Manchester (9)","url":"/actdev/collections/122","key":"\"122\""},{"title":"Lancashire (5)","url":"/actdev/collections/147","key":"\"147\""},{"title":"Merseyside (3)","url":"/actdev/collections/179","key":"\"179\""}]},{"title":"Yorkshire and the Humber (3)","url":"/actdev/collections/49","key":"\"49\"","children":[{"title":"Bradford (2)","url":"/actdev/collections/48","key":"\"48\""},{"title":"Calderdale, Kirklees and Wakefield (3)","url":"/actdev/collections/54","key":"\"54\""},{"title":"Humber (5)","url":"/actdev/collections/136","key":"\"136\""},{"title":"Leeds (1)","url":"/actdev/collections/152","key":"\"152\""},{"title":"North Yorkshire and York (1)","url":"/actdev/collections/196","key":"\"196\""},{"title":"South Yorkshire and Bassetlaw (5)","url":"/actdev/collections/257","key":"\"257\""}]}]},{"title":"South of England SHA Cluster (1)","url":"/actdev/collections/36","key":"\"36\"","children":[{"title":"South Central (0)","url":"/actdev/collections/40","key":"\"40\"","children":[{"title":"Berkshire (6)","url":"/actdev/collections/39","key":"\"39\""},{"title":"Buckinghamshire and Oxfordshire (2)","url":"/actdev/collections/52","key":"\"52\""},{"title":"Southampton, Hampshire, Isle of Wight & Portsmouth (5)","url":"/actdev/collections/258","key":"\"258\""}]},{"title":"South East Coast (1)","url":"/actdev/collections/146","key":"\"146\"","children":[{"title":"Kent and Medway (4)","url":"/actdev/collections/145","key":"\"145\""},{"title":"Surrey (1)","url":"/actdev/collections/268","key":"\"268\""},{"title":"Sussex (5)","url":"/actdev/collections/269","key":"\"269\""}]},{"title":"South West (0)","url":"/actdev/collections/35","key":"\"35\"","children":[{"title":"Bath, North East Somerset and Wiltshire (2)","url":"/actdev/collections/34","key":"\"34\""},{"title":"Bournemouth, Poole and Dorset (2)","url":"/actdev/collections/46","key":"\"46\""},{"title":"Bristol, North Somerset and South Gloucestershire (4)","url":"/actdev/collections/51","key":"\"51\""},{"title":"Devon, Plymouth and Torbay (3)","url":"/actdev/collections/94","key":"\"94\""},{"title":"Gloucestershire and Swindon (3)","url":"/actdev/collections/120","key":"\"120\""}]}]}]},{"title":"Think Tanks (30)","url":"/actdev/collections/274","key":"\"274\""}]}]},{"title":"History of Libraries Collection (20)","url":"/actdev/collections/131","key":"\"131\""},{"title":"History of the Book (0)","url":"/actdev/collections/132","key":"\"132\""},{"title":"Legal Aid Reform (0)","url":"/actdev/collections/153","key":"\"153\""},{"title":"Magna Carta 2015 (12)","url":"/actdev/collections/169","key":"\"169\""},{"title":"Margaret Thatcher (77)","url":"/actdev/collections/172","key":"\"172\""},{"title":"Muslim Trust and Cultural Dialogue (31)","url":"/actdev/collections/182","key":"\"182\""},{"title":"Nelson Mandela (174)","url":"/actdev/collections/185","key":"\"185\""},{"title":"News Sites (587)","url":"/actdev/collections/138","key":"\"138\"","children":[{"title":"Hyperlocal (515)","url":"/actdev/collections/137","key":"\"137\""}]},{"title":"Oral History in the UK (3)","url":"/actdev/collections/202","key":"\"202\""},{"title":"Political Action and Communication (15)","url":"/actdev/collections/208","key":"\"208\""},{"title":"Religion, politics and law since 2005 (41)","url":"/actdev/collections/238","key":"\"238\""},{"title":"Religion/Theology (249)","url":"/actdev/collections/239","key":"\"239\""},{"title":"Scottish Independence Referendum (1148)","url":"/actdev/collections/65","key":"\"65\"","children":[{"title":"Charities, Churches and Third Sector (16)","url":"/actdev/collections/64","key":"\"64\""},{"title":"Commercial Publishers (1)","url":"/actdev/collections/72","key":"\"72\""},{"title":"Government (UK and Scottish) (84)","url":"/actdev/collections/121","key":"\"121\""},{"title":"National Campaigning Groups (82)","url":"/actdev/collections/183","key":"\"183\""},{"title":"Political Parties and Trade Unions (248)","url":"/actdev/collections/212","key":"\"212\""},{"title":"Press, Media & Comment (266)","url":"/actdev/collections/222","key":"\"222\""},{"title":"Think Tanks and Research Institutes (47)","url":"/actdev/collections/275","key":"\"275\""}]},{"title":"Slavery and Abolition in the Caribbean (0)","url":"/actdev/collections/244","key":"\"244\""},{"title":"SmashFest UK (1)","url":"/actdev/collections/245","key":"\"245\""},{"title":"Tour de France (Yorkshire) 2014 (60)","url":"/actdev/collections/276","key":"\"276\""},{"title":"UK General Election 2015 (371)","url":"/actdev/collections/60","key":"\"60\"","children":[{"title":"Candidates (5)","url":"/actdev/collections/59","key":"\"59\""},{"title":"Election Blogs (4)","url":"/actdev/collections/105","key":"\"105\""},{"title":"Interest Groups (31)","url":"/actdev/collections/142","key":"\"142\""},{"title":"News and Commentary (212)","url":"/actdev/collections/187","key":"\"187\""},{"title":"Opinion Polls (3)","url":"/actdev/collections/201","key":"\"201\""},{"title":"Other (1)","url":"/actdev/collections/204","key":"\"204\""},{"title":"Political Parties - Local (10)","url":"/actdev/collections/210","key":"\"210\""},{"title":"Political Parties - National (73)","url":"/actdev/collections/211","key":"\"211\""},{"title":"Public & Community Engagement (1)","url":"/actdev/collections/227","key":"\"227\""},{"title":"Regulation & Guidance (4)","url":"/actdev/collections/234","key":"\"234\""},{"title":"Research Centers & Think Tanks (28)","url":"/actdev/collections/240","key":"\"240\""}]},{"title":"UK relations with the Low Countries (0)","url":"/actdev/collections/282","key":"\"282\""},{"title":"UK response to Philippines disaster 2013 (501)","url":"/actdev/collections/283","key":"\"283\""},{"title":"Video Games (11)","url":"/actdev/collections/286","key":"\"286\""},{"title":"Winter Olympics Sochi 2014 (128)","url":"/actdev/collections/291","key":"\"291\""}]
anjackson commented 9 years ago

Done.