|
| 1 | +# Filtered Collections report |
| 2 | +[Back to the list of all defined endpoints](endpoints.md) |
| 3 | + |
| 4 | +This endpoint provides aggregated statistics about the number of items per collection according to selected filters. |
| 5 | + |
| 6 | +NOTE: This is currently a beta feature. |
| 7 | + |
| 8 | + |
| 9 | +**GET /api/contentreport/filteredcollections** |
| 10 | + |
| 11 | +The endpoint takes a `filters` query parameter whose value is a comma-separated list of filters |
| 12 | +like the following: |
| 13 | +``` |
| 14 | +?filters=is_discoverable,has_multiple_originals,has_pdf_original |
| 15 | +``` |
| 16 | + |
| 17 | +Alternatively, the comma-separated list can be replaced by a repetition of the `filters` parameter |
| 18 | +for each requested filter: |
| 19 | +``` |
| 20 | +?filters=is_discoverable&filter=has_multiple_originals&filter=has_pdf_original |
| 21 | +``` |
| 22 | + |
| 23 | + |
| 24 | +Please see [below](#available-filters) for the list of available filters. |
| 25 | + |
| 26 | +## Report contents |
| 27 | + |
| 28 | +For each collection, the basic report consists of: |
| 29 | +* name (label) and handle of the collection |
| 30 | +* name (label) and handle of the parent community |
| 31 | +* total number of items |
| 32 | +* number of items matching all selected filters |
| 33 | + |
| 34 | +In addition, a `summary` element provides the total number of items and the total number of items matching all filters |
| 35 | +for the whole repository. |
| 36 | + |
| 37 | +An example JSON response document to `/api/contentreport/filteredcollections`: |
| 38 | +```json |
| 39 | +{ |
| 40 | + "id": "filteredcollections", |
| 41 | + "collections": [ |
| 42 | + { |
| 43 | + "label": "Collection 1", |
| 44 | + "handle": "100/1", |
| 45 | + "values": { |
| 46 | + "is_discoverable": 23, |
| 47 | + "has_multiple_originals": 3, |
| 48 | + "has_pdf_original": 14 |
| 49 | + }, |
| 50 | + "community_label": "Community 1", |
| 51 | + "community_handle": "20.500.11794/1", |
| 52 | + "nb_total_items": 23, |
| 53 | + "all_filters_value": 3 |
| 54 | + }, |
| 55 | + { |
| 56 | + "label": "Collection 2", |
| 57 | + "handle": "100/2", |
| 58 | + "values": { |
| 59 | + "is_discoverable": 1, |
| 60 | + "has_multiple_originals": 0, |
| 61 | + "has_pdf_original": 0 |
| 62 | + }, |
| 63 | + "community_label": "Community 1", |
| 64 | + "community_handle": "20.500.11794/1", |
| 65 | + "nb_total_items": 1, |
| 66 | + "all_filters_value": 0 |
| 67 | + }, |
| 68 | + { |
| 69 | + "label": "Collection 3", |
| 70 | + "handle": "100/3", |
| 71 | + "values": { |
| 72 | + "is_discoverable": 1, |
| 73 | + "has_multiple_originals": 0, |
| 74 | + "has_pdf_original": 1 |
| 75 | + }, |
| 76 | + "community_label": "Community 1", |
| 77 | + "community_handle": "20.500.11794/1", |
| 78 | + "nb_total_items": 1, |
| 79 | + "all_filters_value": 0 |
| 80 | + } |
| 81 | + ], |
| 82 | + "summary": { |
| 83 | + "label": null, |
| 84 | + "handle": null, |
| 85 | + "values": { |
| 86 | + "is_discoverable": 25, |
| 87 | + "has_multiple_originals": 3, |
| 88 | + "has_pdf_original": 15 |
| 89 | + }, |
| 90 | + "community_label": null, |
| 91 | + "community_handle": null, |
| 92 | + "nb_total_items": 25, |
| 93 | + "all_filters_value": 3 |
| 94 | + }, |
| 95 | + "type": "filtered-collections", |
| 96 | + "_links": { |
| 97 | + "self": { |
| 98 | + "href": "http://localhost:8080/dspace-server/api/contentreport/filtered-collections" |
| 99 | + } |
| 100 | + } |
| 101 | +} |
| 102 | +``` |
| 103 | + |
| 104 | +## Available filters |
| 105 | + |
| 106 | +The available filters are as follows: |
| 107 | + |
| 108 | +* Item Property Filters |
| 109 | + * `is_item`: Is Item - always true |
| 110 | + * `is_withdrawn`: Withdrawn Items |
| 111 | + * `is_not_withdrawn`: Available Items - Not Withdrawn |
| 112 | + * `is_discoverable`: Discoverable Items - Not Private |
| 113 | + * `is_not_discoverable`: Not Discoverable - Private Item |
| 114 | +* Basic Bitstream Filters |
| 115 | + * `has_multiple_originals`: Item has Multiple Original Bitstreams |
| 116 | + * `has_no_originals`: Item has No Original Bitstreams |
| 117 | + * `has_one_original`: Item has One Original Bitstream |
| 118 | +* Bitstream Filters by MIME Type |
| 119 | + * `has_doc_original`: Item has a Doc Original Bitstream (PDF, Office, Text, HTML, XML, etc) |
| 120 | + * `has_image_original`: Item has an Image Original Bitstream |
| 121 | + * `has_unsupp_type`: Has Other Bitstream Types (not Doc or Image) |
| 122 | + * `has_mixed_original`: Item has multiple types of Original Bitstreams (Doc, Image, Other) |
| 123 | + * `has_pdf_original`: Item has a PDF Original Bitstream |
| 124 | + * `has_jpg_original`: Item has JPG Original Bitstream |
| 125 | + * `has_small_pdf`: Has unusually small PDF |
| 126 | + * `has_large_pdf`: Has unusually large PDF |
| 127 | + * `has_doc_without_text`: Has document bitstream without TEXT item |
| 128 | +* Supported MIME Type Filters |
| 129 | + * `has_only_supp_image_type`: Item Image Bitstreams are Supported |
| 130 | + * `has_unsupp_image_type`: Item has Image Bitstream that is Unsupported |
| 131 | + * `has_only_supp_doc_type`: Item Document Bitstreams are Supported |
| 132 | + * `has_unsupp_doc_type`: Item has Document Bitstream that is Unsupported |
| 133 | +* Bitstream Bundle Filters |
| 134 | + * `has_unsupported_bundle`: Has bitstream in an unsupported bundle |
| 135 | + * `has_small_thumbnail`: Has unusually small thumbnail |
| 136 | + * `has_original_without_thumbnail`: Has original bitstream without thumbnail |
| 137 | + * `has_invalid_thumbnail_name`: Has invalid thumbnail name (assumes one thumbnail for each original) |
| 138 | + * `has_non_generated_thumb`: Has non-generated thumbnail |
| 139 | + * `no_license`: Doesn't have a license |
| 140 | + * `has_license_documentation`: Has documentation in the license bundle |
| 141 | +* Permission Filters |
| 142 | + * `has_restricted_original`: Item has Restricted Original Bitstream |
| 143 | + * `has_restricted_thumbnail`: Item has Restricted Thumbnail |
| 144 | + * `has_restricted_metadata`: Item has Restricted Metadata |
| 145 | + |
| 146 | +Possible response status: |
| 147 | + |
| 148 | +* 200 OK - The specific report data was found, and the data has been properly returned. |
| 149 | +* 403 Forbidden - In case of unauthorized user session. |
0 commit comments