From cd4325ae6976dc5ab0f6e451b2d829a12ba6d0b3 Mon Sep 17 00:00:00 2001 From: AdamF42 Date: Thu, 16 Jul 2026 17:11:16 +0200 Subject: [PATCH 1/2] DURACOM-504 add cris endpoint --- boxes-types.md | 119 ++++++++++++ endpoints.md | 2 + search-components.md | 22 +++ sections.md | 427 +++++++++++++++++++++++++++++++++++++++++++ tabs.md | 396 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 966 insertions(+) create mode 100644 boxes-types.md create mode 100644 search-components.md create mode 100644 sections.md create mode 100644 tabs.md diff --git a/boxes-types.md b/boxes-types.md new file mode 100644 index 00000000..f70b4e72 --- /dev/null +++ b/boxes-types.md @@ -0,0 +1,119 @@ +# Layout Box Types +[Layout Tab Endpoints](tabs.md) + +The following table list the boxTypes available out-of-box in DSpace-CRIS 7 + +boxType | description +------------ | ------------- +METADATA | the box is used to visualize metadata and files of the item +RELATION | the box is used to visualize linked items retrieved via a discovery query +METRICS | the box is used to visualize one or more metrics about the object + +## Metadata Configuration + +```json +{ + "id": 1, + "rows": [ + { + "style": "row-style", + "cells": [ + { + "style": "cell-style", + "fields": [ + { + bitstream: { + bundle: "ORIGINAL", + metadataField: "dc.type", + metadataValue: "picture" + }, + rendering: "thumbnail", + fieldType: "bitstream", + styleLabel: null, + styleValue: null + } + ] + }, + { + "fields": [ + { + metadata: "dc.title", + label: "Title", + fieldType: "metadata", + styleLabel: null, + styleValue: null + }, + { + metadata: "crisrp.name", + label: "Name", + fieldType: "metadata", + styleLabel: null, + styleValue: null + } + ] + } + ] + }, + { + "cells": [ + { + "style": "cell-style", + "fields": [ + { + metadata: "dc.contibutor.author", + label: "Authors", + rendering: "browselink", + fieldType: "metadata", + styleLabel: null, + styleValue: null + } + ] + } + ] + } + ] +} +``` + +It provides the configuration for a component that visualize a list of metadata according to specific rules + +Attributes +* the *id* attribute has the same value that the id of the related box +* the *label* attribute is the i18n key for the field label to visualize +* the *rendering* attribute defines the component to use to visualize the field. Examples are browselink, longtext, identifier, date, etc. for metadata field and preview, thubmnail, etc. for bitstream field +* the *styleLabel* attribute allows to set arbitrary css styles to the label +* the *styleValue* attribute allows to set arbitrary css styles to the metadata value +* the *fieldType" is one of metadata or bitstream a corresponding attribute will be present +* the *labelAsHeading* attribute indicates if the label must be showed as header of the value instead of inline +* the *valuesInline* attribute indicates if multiple values of the same metadata should be shown inline +* the *metadata* attribute is the canonical name of the metadata to use (eg dc.contributor.author, dc.title, etc.) +* the *bitstream* attribute is an object containing details to filter the bitstreams to use. It can be the name of the bundle to use and/or the value of specfic bitstream metadata + +## Metrics Configuration + +Provides detailed information about the metrics associated to the box + +```json +{ + "id": 1, + "numColumns": 2, + "metrics": ["views", "downloads"] +} +``` + +It provides the configuration for a component that visualize a list of metrics. + +## Relation Configuration + + +Provides detailed information about the relation included in the box + +```json +{ + "id": 1, + "discovery-configuration": "the-name-of-the-discovery-configuration" +} +``` + +the-name-of-the-discovery-configuration will match a discovery configuration where a facet named "cluster" +will be eventually defined to group the result by arbitrary defined criteria (facet query) \ No newline at end of file diff --git a/endpoints.md b/endpoints.md index ba57c17e..8d8e4a24 100644 --- a/endpoints.md +++ b/endpoints.md @@ -46,6 +46,8 @@ * [/api/workflow/workflowitems](workflowitems.md) * [/api/workflow/pooltasks](pooltasks.md) * [/api/workflow/claimedtasks](claimedtasks.md) +* [/api/layout/sections](sections.md) +* [/api/layout/sections/search/visibleTopBarSections](sections.md) * [/api/tools/feedbacks](feedbacks.md) * [/api/integration/qualityassurancesources](qualityassurancesources.md) * [/api/integration/qualityassurancetopics](qualityassurancetopics.md) diff --git a/search-components.md b/search-components.md new file mode 100644 index 00000000..40535c1b --- /dev/null +++ b/search-components.md @@ -0,0 +1,22 @@ +# Search Components Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +## Main Endpoint +**/api/layout/searchcomponents** + +Not implemented + +## Single Collection +**/api/layout/searchcomponents/<:string>** + +Provide detailed information about a specific community. The JSON response document is as follow +```json +{ + "id": "box-shortname", + "configuration": "discovery-configuration", + "type": "searchcomponent" +} +``` + +Attributes +* the *configuration* attribute will match a discovery configuration where a facet named "cluster" will be eventually defined to group the result by arbitrary defined criteria (facet query) \ No newline at end of file diff --git a/sections.md b/sections.md new file mode 100644 index 00000000..fed7bde6 --- /dev/null +++ b/sections.md @@ -0,0 +1,427 @@ +# Sections Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +## Main Endpoint + +**/api/layout/sections** + +Provide access to all the configured CRIS layout sections. The full JSON response document is as follow +```json +{ + "_embedded" : { + "sections" : [ { + "id" : "researchoutputs", + "componentRows" : [ [ { + "browseNames" : [ "rodept", "author", "title", "type", "dateissued", "subject" ], + "style" : "col-md-4", + "componentType" : "browse" + }, { + "discoveryConfigurationName" : "researchoutputs", + "style" : "col-md-8", + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ], [ { + "discoveryConfigurationName" : "researchoutputs", + "sortField" : "dc.date.accessioned", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + }, { + "discoveryConfigurationName" : "researchoutputs", + "sortField" : "metric.view", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + } ], [ { + "discoveryConfigurationName" : "researchoutputs", + "style" : "col-md-12", + "facetsPerRow" : 4, + "componentType" : "facet" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section", + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/researchoutputs" + } + } + }, { + "id" : "fundings_and_projects", + "componentRows" : [ ], + "nestedSections" : [ { + "id" : "fundings", + "componentRows" : [ [ { + "browseNames" : [ "pjtitle" ], + "style" : "col-md-4", + "componentType" : "browse" + }, { + "discoveryConfigurationName" : "project_funding", + "style" : "col-md-8", + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ], [ { + "discoveryConfigurationName" : "project_funding", + "style" : "col-md-12", + "facetsPerRow" : 4, + "componentType" : "facet" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section" + }, { + "id" : "projects", + "componentRows" : [ [ { + "browseNames" : [ "pjtitle" ], + "style" : "col-md-4", + "componentType" : "browse" + }, { + "discoveryConfigurationName" : "project_funding", + "style" : "col-md-8", + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ], [ { + "discoveryConfigurationName" : "project_funding", + "style" : "col-md-12", + "facetsPerRow" : 4, + "componentType" : "facet" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section" + }, { + "id" : "researcherprofiles", + "componentRows" : [ [ { + "browseNames" : [ "rpname", "rpdept" ], + "style" : "col-md-4", + "componentType" : "browse" + }, { + "discoveryConfigurationName" : "person", + "style" : "col-md-8", + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ], [ { + "discoveryConfigurationName" : "person", + "style" : "col-md-12", + "facetsPerRow" : 4, + "componentType" : "facet" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section" + }, { + "id" : "site", + "componentRows" : [ [ { + "style" : "style", + "content" : "cms.homepage.header", + "contentType" : "text-metadata", + "componentType" : "text-row" + } ], [ { + "discoveryConfigurationName" : "site", + "style" : "col-md-12", + "searchType" : "basic", + "initialStatements" : 3, + "displayTitle" : false, + "componentType" : "search" + } ], [ { + "style" : "col-md-12 py-4", + "counterSettingsList" : [ { + "discoveryConfigurationName" : "researchoutputs", + "icon" : "fas fa-file-alt fa-3x", + "entityName" : "publications", + "link" : "/explore/researchoutputs" + }, { + "discoveryConfigurationName" : "project_funding", + "icon" : "fas fa-cogs fa-3x", + "entityName" : "project_funding", + "link" : "/explore/fundings_and_projects" + }, { + "discoveryConfigurationName" : "person", + "icon" : "fas fa-users fa-3x", + "entityName" : "rprofiles", + "link" : "/explore/researcherprofiles" + } ], + "componentType" : "counters" + } ], [ { + "discoveryConfigurationName" : "homePageTopItems", + "sortField" : "dc.date.accessioned", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + }, { + "discoveryConfigurationName" : "homePageTopItems", + "sortField" : "metric.view", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section" + } ], + "type" : "section", + "uniqueType": "layout.section", + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/fundings_and_projects" + } + } + }, { + "id" : "researcherprofiles", + "componentRows" : [ [ { + "browseNames" : [ "rpname", "rpdept" ], + "style" : "col-md-4", + "componentType" : "browse" + }, { + "discoveryConfigurationName" : "person", + "style" : "col-md-8", + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ], [ { + "discoveryConfigurationName" : "person", + "style" : "col-md-12", + "facetsPerRow" : 4, + "componentType" : "facet" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section", + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/researcherprofiles" + } + } + }, { + "id" : "site", + "componentRows" : [ [ { + "style" : "style", + "content" : "cms.homepage.header", + "contentType" : "text-metadata", + "componentType" : "text-row" + } ], [ { + "discoveryConfigurationName" : "site", + "style" : "col-md-12", + "searchType" : "basic", + "initialStatements" : 3, + "displayTitle" : false, + "componentType" : "search" + } ], [ { + "style" : "col-md-12 py-4", + "counterSettingsList" : [ { + "discoveryConfigurationName" : "researchoutputs", + "icon" : "fas fa-file-alt fa-3x", + "entityName" : "publications", + "link" : "/explore/researchoutputs" + }, { + "discoveryConfigurationName" : "project_funding", + "icon" : "fas fa-cogs fa-3x", + "entityName" : "project_funding", + "link" : "/explore/fundings_and_projects" + }, { + "discoveryConfigurationName" : "person", + "icon" : "fas fa-users fa-3x", + "entityName" : "rprofiles", + "link" : "/explore/researcherprofiles" + } ], + "componentType" : "counters" + } ], [ { + "discoveryConfigurationName" : "homePageTopItems", + "sortField" : "dc.date.accessioned", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + }, { + "discoveryConfigurationName" : "homePageTopItems", + "sortField" : "metric.view", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section", + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/site" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections" + }, + "search" : { + "href" : "http://localhost/api/layout/sections/search" + } + }, + "page" : { + "size" : 20, + "totalElements" : 4, + "totalPages" : 1, + "number" : 0 + } +} +``` + + +## Search Endpoint + +**/api/layout/sections/search/visibleTopBarSections** + +Lists all the CRIS layout sections for the top bar marked as visible. +The full JSON response document is as follow +```json +{ + "_embedded" : { + "sections" : [ { + "id" : "sectionresearchoutputs", + "componentRows" : [ [ { + "discoveryConfigurationName" : null, + "style" : null, + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section", + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/sectionresearchoutputs" + } + } + }, { + "id" : "sectionfundings_and_projects", + "componentRows" : [ [ { + "discoveryConfigurationName" : null, + "style" : null, + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section", + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/sectionfundings_and_projects" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/search/visibleTopBarSections" + } + }, + "page" : { + "size" : 20, + "totalElements" : 2, + "totalPages" : 1, + "number" : 0 + } +} +``` +Return codes: +* 200 OK - The operation succeed + +* `sections`: is an array, it contains the sections to be shown in the nav bar +* `size` - the dimension of the result set window returned (can be different from the requested value due to imposed limit, see the request parameters section) +* `totalElements` - the total size of the result set +* `totalPages` - the number of available page of result using the current window size +* `number` - the index (zero-based) of the returned page + +## Single Section +**/api/layout/sections/<:id>** + +Provide detailed information about a specific CRIS layout section. The JSON response document is as follow +```json +{ + "id" : "publications", + "componentRows" : [ [ { + "browseNames" : [ "rodept", "author", "title", "type", "dateissued", "subject" ], + "style" : "col-md-4", + "componentType" : "browse" + }, { + "discoveryConfigurationName" : "publication", + "style" : "col-md-8", + "searchType" : null, + "initialStatements" : 3, + "displayTitle" : true, + "componentType" : "search" + } ], [ { + "discoveryConfigurationName" : "publication", + "sortField" : "dc.date.accessioned", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + }, { + "discoveryConfigurationName" : "publication", + "sortField" : "metric.view", + "order" : "desc", + "style" : "col-md-6", + "titleKey" : null, + "numberOfItems" : 5, + "showThumbnails" : false, + "componentType" : "top" + } ], [ { + "discoveryConfigurationName" : "publication", + "style" : "col-md-12", + "facetsPerRow" : 4, + "componentType" : "facet" + } ] ], + "nestedSections" : [ ], + "type" : "section", + "uniqueType": "layout.section", + "_links" : { + "self" : { + "href" : "http://localhost/api/layout/sections/publications" + } + } +} +``` +Return codes: +* 200 OK - if the operation succeed +* 404 Not found - if a section with the given id doesn't exist + +The `componentRows` attribute represent the list of components that compose the section, splitted by rows. There are 4 different types of components, distinguishable by their `componentType` attribute which can have one of the following values: [ `browse`,`top`,`facet`,`search`,`text-row`, ,`counters` ]. The attributes of each component may vary according to the type of the component itself. In addition to the `componentType` attribute used to indicate the type of the component, each component type has the following attributes: +* `browse`: has only one attribute named `browseNames` representing a list of names +* `top`: has the `discoveryConfigurationName` indicating the discovery configuration name and two attributes named `sortField` and `order` indicating by which field and in what order to sort the search results, `numberOfItems` indicating how many items will have to be displayed in the section , `style` the style to set, `titleKey` and `showThumbnails` (this last not yet used by angular component) +* `facet`: has the `discoveryConfigurationName` indicating the discovery configuration name, and the optional `facetsPerRow` defining how many facet box UI will display. +* `search`: has the `discoveryConfigurationName` indicating the discovery configuration name. searchType with value `basic` or `advanced` (default) defining whether displayed box should consist in a single input box or many containing multiple statements that can be combined with AND, OR, NOT keywords. +* `text-row`: has the `order` property, defining the order on which the content should appear among other text row elements in the same list of cris layout elements, `content` property, defining the static content to be displayed, while `contentType` defines the type of content, its value can be `image`, meaning that content is an image url, `text-raw` meaning that content is a static text to be displayed and `text-key` meaning actual text to be displayed should be rendered using UI’s I18n logic +* `counters` : has `counterSettingsList` property, each element representing a counter to be displayed by this infographic and having following properties: `discoveryConfigurationName`, the discovery configuration to be used to count by query elements; `icon`, a font awesome reference to icon to be displayed (i.e. `fas fa-book fa-3x`), label text key to be displayed together with the icon, `link`(optional) link to be followed when icon is clicked. diff --git a/tabs.md b/tabs.md new file mode 100644 index 00000000..5da2ef9a --- /dev/null +++ b/tabs.md @@ -0,0 +1,396 @@ +# Tabs Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +## Main Endpoint +**GET /api/layout/tabs** + +Not implemented + +## New Tab +**POST /api/layout/tabs** +To create a new Tab perform as POST with the follow JSON: + +```json +{ + "shortname": "info", + "header": "Profile", + "entityType": "Person", + "priority": 1, + "security": 0, + "type": "tab", + "uniqueType": "layout.tab", + "leading": "true", + "rows": [ + { + "cells": [ + { + "style": "col-md-6", + "boxes": [ + { + "shortname": "primary", + "header": "Primary Information", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": "col-md-6", + "security": 0, + "boxType": "METADATA", + "metadataSecurityFields": [], + "configuration": { + "type": "boxmetadataconfiguration", + "rows": [ + { + "fields": [ + { + "metadata": "dc.title", + "label": "Name", + "fieldType": "metadata" + }, + { + "metadata": "person.email", + "label": "Email", + "fieldType": "metadata" + } + ] + } + ] + } + }, + { + "shortname": "other", + "header": "Other Informations", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": "col-md-6", + "container": false, + "security": 0, + "boxType": "METADATA", + "metadataSecurityFields": [ + "cris.policy.eperson" + ], + "configuration": { + "type": "boxmetadataconfiguration", + "rows": [ + { + "fields": [ + { + "metadata": "person.birthDate", + "label": "Birth date", + "fieldType": "metadata" + } + ] + } + ] + } + } + ] + }, + { + "style": "col-md-6", + "boxes": [ + { + "shortname": "researchoutputs", + "header": "Research outputs", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": "col-md-6", + "container": true, + "security": 0, + "boxType": "RELATION", + "metadataSecurityFields": [] + } + ] + } + ] + }, + { + "style": "bg-light", + "cells": [ + { + "style": "col-md-12", + "boxes": [ + { + "shortname": "metrics", + "header": "Metrics", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": null, + "security": 0, + "boxType": "METRICS", + "metadataSecurityFields": [], + "configuration": { + "type": "boxmetricsconfiguration", + "maxColumns": 2, + "metrics": ["views", "downloads"] + } + } + ] + } + ] + } + ] +} +``` + +This endpoint is reserved to system administrators, its returns the created tab. + +Return codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions +* 422 UNPROCESSABLE ENTITY - if the json body is unprocessable for CrisLayoutTabRest entity + +## Delete tab +**DELETE /api/layout/tabs/<:id>** + +Delete a Tab. This endpoint is reserved to system administrators. + +Return codes: +* 204 No content - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions +* 404 Not found - if the tab doesn't exist (or was already deleted) + +## Single Tab +**GET /api/layout/tabs/<:id>** + +Provide detailed information about a specific tab. The JSON response document is as follow + +```json +{ + "id": 1, + "shortname": "info", + "header": "Profile", + "entityType": "Person", + "priority": 1, + "security": 0, + "type": "tab", + "uniqueType": "layout.tab", + "leading": "true", + "rows": [ + { + "cells": [ + { + "style": "col-md-6", + "boxes": [ + { + "shortname": "primary", + "header": "Primary Information", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": "col-md-6", + "container": true, + "maxColumns": 2, + "security": 0, + "boxType": "METADATA", + "metadataSecurityFields": [], + "configuration": { + "id": 1, + "rows": [ + { + "fields": [ + { + "metadata": "dc.title", + "label": "Name", + "fieldType": "metadata" + }, + { + "metadata": "person.email", + "label": "Email", + "fieldType": "metadata", + "valuesInline": "true" + } + ] + } + ] + } + }, + { + "shortname": "other", + "header": "Other Informations", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": "col-md-6", + "maxColumns": 2, + "security": 0, + "boxType": "METADATA", + "metadataSecurityFields": [ + "cris.policy.eperson" + ], + "configuration": { + "id": 2, + "rows": [ + { + "fields": [ + { + "metadata": "person.birthDate", + "label": "Birth date", + "fieldType": "metadata", + "labelAsHeading": "true" + } + ] + } + ] + } + } + ] + }, + { + "style": "col-md-6", + "boxes": [ + { + "shortname": "researchoutputs", + "header": "Research outputs", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": "col-md-6", + "maxColumns": 2, + "security": 0, + "boxType": "RELATION", + "metadataSecurityFields": [], + "configuration": { + "id": 3, + "discovery-configuration": "RELATION.Person.researchoutputs" + } + } + ] + } + ] + }, + { + "style": "bg-light", + "cells": [ + { + "style": "col-md-12", + "boxes": [ + { + "shortname": "metrics", + "header": "Metrics", + "entityType": "Person", + "collapsed": false, + "minor": false, + "style": null, + "maxColumns": 2, + "security": 0, + "boxType": "METRICS", + "metadataSecurityFields": [], + "configuration": { + "id": 4, + "numColumns": 2, + "metrics": ["views", "downloads"] + } + } + ] + } + ] + } + ] +} +``` + +Attributes +* the *header* attribute is the label or the i18n key to use to present the section to the user +* the *leading* attribute is a boolean that indicates if the given tab should always be visible on the top of the page +* the *security* attribute is a constant where 0 mean public, 1 mean administrators, 2 mean owner only, 3 owner & administrators, 4 custom metadata +* the *rows* attribute is an array with the ordered list of rows that compose the tab. Each row has the following attributes + * the *style* attribute is the css style related to the row + * the *cells* attribute is an array with the ordered list of cells that compose the row. Each cell has the following attributes + * the *style* attribute is the css style related to the cell + * the *boxes* attribute is an array with the ordered list of boxes that compose the cell. Each box has the following attributes + * the *header* attribute is the label or the i18n key to use to present the section to the user + * the *security* attribute is a constant where 0 mean public, 1 mean administrators, 2 mean owner only, 3 owner & administrators, 4 custom metadata + * the *collapsed* attribute indicates whether the box should be shown initially collapsed or not + * the *container* attribute indicates if the box container should be shown or not + * the *minor* attribute is used to flag box that should be ignored in the determination of the tab visualization + * the *style* attribute is the css style related to the box + * the *boxType* attribute is used to choice the appropriate component. It could be metadata, search, bibliometrics + * the *maxColumn* attribute is used to indicates how many column should be used to visualize content (currently only metrics boxes supports this parameter). + * the *configuration* attribute contains more information specific for the box type. Configuration details depend on the specific [box type](boxes-types.md) + * the *metadataSecurityFields* attribute is an array of the metadatafields that defined the security + +Exposed links: +* securityMetadata: link to the metadatafields that defined the security + +Return codes: +* 201 Created - if the operation succeed +* 401 Unauthorized - if you are not authenticated. Please note that this also apply to resource policy related to the Anonymous group +* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators, users with ADMIN right on the target resource, users mentioned in the policy (eperson or member of the group) can access the tab +* 404 Not found - if the tab doesn't exist (or was already deleted) + +### SecurityMetadata +**GET /api/layout/tabs/<:id>/securitymetadata** + +It returns all the metadatafields that defined the security. + +Return codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated. +* 403 Forbidden - if you are not logged in as an administrator +* 404 Not found - if the tab doesn't exist (or was already deleted) + +**GET /api/layout/tabs/<:id>/securitymetadata/<:id>** + +_Unsupported._ If you want detailed information about a single metadatafield in the tab, use the `/api/core/metadatafields/<:metadatafield.id>` endpoint. + +**POST /api/layout/tabs/<:id>/securitymetadata** + +A POST request will result in adding the metadatafield to the list of metadata used to evaluate access permission to the tab. + +The metadata (also more than one) MUST be included in the body using the `text/uri-list` content type + +Return codes: + * 204 No Content - if the update succeeded (including the case of no-op if the mapping was already as requested) + * 401 Unauthorized - if you are not authenticated + * 403 Forbidden - if you are not logged in as administrator + * 404 Not found - if the tab doesn't exist (or was already deleted) + * 422 Unprocessable Entity - if the specified metadata is not found + +**PUT /api/layout/tabs/<:id>/securitymetadata** + +_Unsupported._ You may replace or update the security metadata using DELETE requests and/or POST requests. + +**DELETE /api/layout/tabs/<:id>/securitymetadata** + +_Unsupported._ At this time, we do not support removing all security metadata in a single request. Please use `DELETE /api/layout/tabs/<:id>/securitymetadata/<:metadatafield.id>` to remove metadatafield one by one. + +**DELETE /api/layout/tabs/<:id>/securitymetadata/<:metadatafield.id>** + +A DELETE request will result in removing the metadatafield from the current list. + +Return codes: + * 204 No Content if the delete succeeded (including the case of no-op if the metadata was not mapped) + * 401 Unauthorized - if you are not authenticated + * 403 Forbidden - if you are not logged in as administrator + * 404 Not found - if the tab doesn't exist (or was already deleted) + * 422 Unprocessable Entity - if the specified uri cannot resolve to a metadatafield (if the uri is valid but the metadatafield is not found, 204 is expected) + + +## Search methods +### findByItem +**GET /api/layout/tabs/search/findByItem?uuid=<:item-uuid>** + +It returns the tabs that are available for the specified item. The tabs are sorted by priority ascending. This are filtered based on the permission of the current user and available data. Empty tabs are filter out. + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the uuid param is missing or is not an uuid +* 401 Unauthorized - if you are not authenticated and the item is not accessible to anonymous users +* 403 Forbidden - if you are not logged in with sufficient permissions to READ the item + + +### findByEntityType +**GET /api/layout/tabs/search/findByEntityType?type=<:string>** + +It returns the tabs that are available for the items of the specified type. This endpoint is reserved to system administrators + +Return codes: +* 200 OK - if the operation succeed +* 400 Bad Request - if the type param is missing +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions From 3baaca473a9406e0033a5a93875938fa07cc5cec Mon Sep 17 00:00:00 2001 From: AdamF42 Date: Thu, 16 Jul 2026 17:18:07 +0200 Subject: [PATCH 2/2] DURACOM-504 updated names --- boxes-types.md | 2 +- sections.md | 8 ++++---- tabs.md | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/boxes-types.md b/boxes-types.md index f70b4e72..b8ef4c53 100644 --- a/boxes-types.md +++ b/boxes-types.md @@ -1,7 +1,7 @@ # Layout Box Types [Layout Tab Endpoints](tabs.md) -The following table list the boxTypes available out-of-box in DSpace-CRIS 7 +The following table list the boxTypes available out-of-box in DSpace 11 boxType | description ------------ | ------------- diff --git a/sections.md b/sections.md index fed7bde6..962ea577 100644 --- a/sections.md +++ b/sections.md @@ -5,7 +5,7 @@ **/api/layout/sections** -Provide access to all the configured CRIS layout sections. The full JSON response document is as follow +Provide access to all the configured dynamic layout sections. The full JSON response document is as follow ```json { "_embedded" : { @@ -297,7 +297,7 @@ Provide access to all the configured CRIS layout sections. The full JSON respons **/api/layout/sections/search/visibleTopBarSections** -Lists all the CRIS layout sections for the top bar marked as visible. +Lists all the dynamic layout sections for the top bar marked as visible. The full JSON response document is as follow ```json { @@ -365,7 +365,7 @@ Return codes: ## Single Section **/api/layout/sections/<:id>** -Provide detailed information about a specific CRIS layout section. The JSON response document is as follow +Provide detailed information about a specific dynamic layout section. The JSON response document is as follow ```json { "id" : "publications", @@ -423,5 +423,5 @@ The `componentRows` attribute represent the list of components that compose the * `top`: has the `discoveryConfigurationName` indicating the discovery configuration name and two attributes named `sortField` and `order` indicating by which field and in what order to sort the search results, `numberOfItems` indicating how many items will have to be displayed in the section , `style` the style to set, `titleKey` and `showThumbnails` (this last not yet used by angular component) * `facet`: has the `discoveryConfigurationName` indicating the discovery configuration name, and the optional `facetsPerRow` defining how many facet box UI will display. * `search`: has the `discoveryConfigurationName` indicating the discovery configuration name. searchType with value `basic` or `advanced` (default) defining whether displayed box should consist in a single input box or many containing multiple statements that can be combined with AND, OR, NOT keywords. -* `text-row`: has the `order` property, defining the order on which the content should appear among other text row elements in the same list of cris layout elements, `content` property, defining the static content to be displayed, while `contentType` defines the type of content, its value can be `image`, meaning that content is an image url, `text-raw` meaning that content is a static text to be displayed and `text-key` meaning actual text to be displayed should be rendered using UI’s I18n logic +* `text-row`: has the `order` property, defining the order on which the content should appear among other text row elements in the same list of dynamic layout elements, `content` property, defining the static content to be displayed, while `contentType` defines the type of content, its value can be `image`, meaning that content is an image url, `text-raw` meaning that content is a static text to be displayed and `text-key` meaning actual text to be displayed should be rendered using UI’s I18n logic * `counters` : has `counterSettingsList` property, each element representing a counter to be displayed by this infographic and having following properties: `discoveryConfigurationName`, the discovery configuration to be used to count by query elements; `icon`, a font awesome reference to icon to be displayed (i.e. `fas fa-book fa-3x`), label text key to be displayed together with the icon, `link`(optional) link to be followed when icon is clicked. diff --git a/tabs.md b/tabs.md index 5da2ef9a..a504346a 100644 --- a/tabs.md +++ b/tabs.md @@ -67,7 +67,7 @@ To create a new Tab perform as POST with the follow JSON: "security": 0, "boxType": "METADATA", "metadataSecurityFields": [ - "cris.policy.eperson" + "dspace.policy.eperson" ], "configuration": { "type": "boxmetadataconfiguration", @@ -141,7 +141,7 @@ Return codes: * 200 OK - if the operation succeed * 401 Unauthorized - if you are not authenticated * 403 Forbidden - if you are not logged in with sufficient permissions -* 422 UNPROCESSABLE ENTITY - if the json body is unprocessable for CrisLayoutTabRest entity +* 422 UNPROCESSABLE ENTITY - if the json body is unprocessable for DynamicLayoutTabRest entity ## Delete tab **DELETE /api/layout/tabs/<:id>** @@ -220,7 +220,7 @@ Provide detailed information about a specific tab. The JSON response document is "security": 0, "boxType": "METADATA", "metadataSecurityFields": [ - "cris.policy.eperson" + "dspace.policy.eperson" ], "configuration": { "id": 2,