Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdcc/Signposting #8981

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
6a45404
Merge remote-tracking branch 'upstream/develop' into develop
Nov 4, 2020
770680e
Merge remote-tracking branch 'upstream/develop' into develop
Dec 10, 2020
a38f0df
cvm-sp
ekoi Dec 11, 2020
c48df18
cvm-sp temp
ekoi Dec 11, 2020
2868228
cvm-sp temp
ekoi Dec 11, 2020
a55a378
cvm-sp temp
ekoi Dec 11, 2020
db89d30
tmp
ekoi Dec 12, 2020
de12144
tmp
ekoi Dec 12, 2020
74dd56d
tmp
ekoi Dec 12, 2020
53f25b5
Merge remote-tracking branch 'upstream/develop' into develop
Dec 15, 2020
673eef0
uses external js
ekoi Dec 16, 2020
6bc0f17
adding signposting configuration setting
ekoi Jan 12, 2021
879f236
Merge remote-tracking branch 'upstream/develop' into develop
Jan 13, 2021
18ba37c
Merge remote-tracking branch 'upstream/develop' into develop
Jan 14, 2021
3950734
signposting poc from eko
Jan 15, 2021
5abe639
error fix
Jan 15, 2021
3d644d1
move the signposting location in code
Jan 15, 2021
65d69fe
Signposting with MicroSettings cleanup v1
Jan 18, 2021
7345f66
Signposting with MicroSettings cleanup v1 xhtml revert to vanilla
Jan 18, 2021
33fcb95
clean up
Jan 20, 2021
a2e5b64
bug fix and add default file type; TODO: Bug on the baseurl (empty st…
Jan 25, 2021
ddb8780
hide type when do not use default
Jan 25, 2021
f2fb557
set default when no config is set for signposting
Jan 27, 2021
9de4c35
Merge branch 'signposting' of github.com:DANS-KNAW/dataverse into sig…
janvanmansum Jan 28, 2021
1c6fde5
modification according to reviews
Jan 28, 2021
9752c6a
move long json string from code to bunddle
Jan 28, 2021
1c0cbbc
allow empty config on the level 2 profile
Jan 28, 2021
0c40649
Merge branch 'develop' into signposting
janvanmansum Feb 2, 2021
c6d3df2
DD-174 Signposting (#42)
vicding-mi Feb 2, 2021
b441c65
revision based on Herbert feedback
Feb 3, 2021
690c450
coding style cleanup SignpostingResources
Feb 3, 2021
200429a
remove leading comma
Feb 4, 2021
ae21398
fix capitalize with header name
Feb 4, 2021
1211ec2
solve conficts
Feb 12, 2021
2e6deae
DD-174 Signposting (#46)
vicding-mi Feb 18, 2021
65d1ac0
Merge remote-tracking branch 'upstream/develop' into signposting
Feb 19, 2021
545adb0
add items to header when less than maxItems, default license to cc0
Mar 17, 2021
5106574
add items to l1 profile and set default license to cc0
Mar 18, 2021
edf7cc8
use actual file type on l1 profile for items
Mar 18, 2021
d741c14
limit maxAuthors
Mar 19, 2021
17d6450
Merge remote-tracking branch 'upstream/develop' into signposting
Mar 19, 2021
1c25c23
Merge branch 'develop' into signposting
PaulBoon Mar 19, 2021
7e20eae
Merge pull request #58 from PaulBoon/signposting
PaulBoon Mar 19, 2021
891670b
solve conflicts
Mar 19, 2021
ffe7b61
Add Dataset type to landing page, both profile and linkset
Apr 8, 2021
27b2f4e
use configed type instead of string
Apr 12, 2021
0c11ff2
Merge back develop in signposting (#69)
janvanmansum Apr 14, 2021
314f7d1
fix missing author error, note: identity URL is empty sometimes
Apr 19, 2021
ce7f943
create function to get author URL
Apr 19, 2021
e06d9a9
remove num author limit in json
Apr 19, 2021
3f52adc
merged back develop
janvanmansum Apr 23, 2021
300c1e7
revision list 20210511
May 12, 2021
313dae9
Signposting (#59)
vicding-mi May 28, 2021
5ec179a
Resolved conflicts
janvanmansum May 28, 2021
8a53bb6
merging conflicts
May 31, 2021
8c92245
solving conflicts from dans dev
May 31, 2021
15e7f28
Signposting to DANS:signposting branch (#77)
vicding-mi Jun 3, 2021
bb82e32
merge develop from iqss
Jun 9, 2021
1411af0
Merge branch 'signposting' into signposting
janvanmansum Jun 9, 2021
190a0f9
Merge pull request #84 from vicding-mi/signposting
janvanmansum Jun 9, 2021
bd07cb7
Merge remote-tracking branch 'blessed/signposting' into signposting
janvanmansum Jun 9, 2021
5011558
Removed duplicate method
janvanmansum Jun 9, 2021
a656610
Trigger build, to see if Travis succeeds
janvanmansum Jun 9, 2021
ce893a4
Remove unused function
janvanmansum Jun 10, 2021
724e6e4
add release note and skip license link in case of None
Jul 1, 2021
0fab268
add signposting
vicding-mi Feb 15, 2022
3d40896
add release note
vicding-mi Feb 15, 2022
ce8de80
remove code style change from pom
vicding-mi Feb 15, 2022
c91f28f
remove code style change
vicding-mi Feb 15, 2022
5577f5d
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Feb 19, 2022
a42eba3
Update doc/release-notes/8424-signposting.md
vicding-mi Feb 21, 2022
2b7022a
Update doc/release-notes/8424-signposting.md
vicding-mi Feb 21, 2022
7d25b86
remove license from config and code
vicding-mi Feb 21, 2022
190cb73
do not show signposting in draft state
vicding-mi Feb 22, 2022
1f12893
better naming for function getAuthors to getAuthorsIdSchema
vicding-mi Feb 22, 2022
41abfab
better naming for function getAuthors
vicding-mi Feb 22, 2022
61d14ff
use license utility
vicding-mi Feb 22, 2022
5fe6a8a
remove redundant check
vicding-mi Feb 22, 2022
149e45a
remove pid type from config, use globalid instead; remove null author…
vicding-mi Mar 27, 2022
4a65b4a
remove describedby from release doc
vicding-mi Mar 27, 2022
a538289
use recommended call to get pid uri
vicding-mi Mar 27, 2022
11573db
Merge branch 'signposting-5.9' of https://github.com/vicding-mi/datav…
qqmyers Aug 15, 2022
675b9c1
Merge with develop
qqmyers Aug 15, 2022
2a07f8b
stub out Signposting docs #8424
pdurbin Mar 10, 2022
4b2e44f
emphasize that it's the metadata that gets harvested #8424
pdurbin Mar 11, 2022
02fc497
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Aug 18, 2022
ace4b4c
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Sep 16, 2022
4510eea
removed okLinkset
qqmyers Sep 16, 2022
369fb78
simplify getLinkset
qqmyers Sep 16, 2022
6e0d9e8
simplify config
qqmyers Sep 16, 2022
8cb00f3
fix error message, remove redundant check
qqmyers Sep 16, 2022
45c0625
cleanup
qqmyers Sep 16, 2022
6693d49
refactor, fix getAuthorUrl bug
qqmyers Sep 16, 2022
de3c116
remove Swift specific URL generation, use file PID if it exists
qqmyers Sep 16, 2022
cfe36b8
doc updates
qqmyers Sep 16, 2022
429343c
remove bundle change
qqmyers Sep 16, 2022
0146a3e
drop level signposting is one of the machine readable items
qqmyers Sep 16, 2022
b1752a4
change example
qqmyers Sep 16, 2022
86ab677
formatting fix
qqmyers Sep 16, 2022
c7b01d9
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Sep 28, 2022
1f07488
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Oct 5, 2022
0c3863c
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Nov 7, 2022
d180a27
Merge remote-tracking branch 'IQSS/develop' into DANS/system_metadata
qqmyers Jan 20, 2023
d571022
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Feb 14, 2023
5636f11
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Mar 3, 2023
0f1a180
merge fix
qqmyers Mar 3, 2023
95fb64b
Merge branch 'develop' into GDCC/Signposting #5962
pdurbin Mar 13, 2023
c3fd238
add a test for Signposting #5962
pdurbin Mar 13, 2023
5a24075
various doc fixes #5962
pdurbin Mar 13, 2023
d9c7a15
move db settings to MPCONFIG #5962
pdurbin Mar 13, 2023
f41cdc9
add guidance on MPCONFIG setting naming #7463
pdurbin Mar 13, 2023
81ae046
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Mar 14, 2023
9a01f5c
hand null license in linkset call
qqmyers Mar 15, 2023
c224300
Merge branch 'GDCC/Signposting' of https://github.com/GlobalDataverse…
qqmyers Mar 15, 2023
e57d4b6
Change setting names
qqmyers Mar 15, 2023
2025e39
correct off-by-one error
qqmyers Mar 15, 2023
16fd13d
update release note and docs
qqmyers Mar 15, 2023
46a4990
add tests
qqmyers Mar 15, 2023
2687d33
reverse blank line change
qqmyers Mar 15, 2023
4ae4e30
remove unused imports
qqmyers Mar 15, 2023
db4a26d
typo
qqmyers Mar 15, 2023
4d021c7
typo
qqmyers Mar 15, 2023
e8f2911
try anon references
qqmyers Mar 15, 2023
de520e0
change reference
qqmyers Mar 15, 2023
64cf395
fix broken links
qqmyers Mar 15, 2023
83c1229
Update javadocs
qqmyers Mar 20, 2023
bb87808
fix regex
qqmyers Mar 20, 2023
003c573
fix linset parsing
qqmyers Mar 20, 2023
71a7d6a
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Mar 20, 2023
ba358b1
fix globalId issues
qqmyers Mar 20, 2023
446144c
avoid jsonPath
qqmyers Mar 20, 2023
41234b7
missed getting data object
qqmyers Mar 20, 2023
8ae91c5
more debug
qqmyers Mar 20, 2023
b6bbaaf
fix cite-as test
qqmyers Mar 20, 2023
6184723
check anchor instead
qqmyers Mar 20, 2023
1d014ed
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Mar 20, 2023
e9a989d
tweak docs #5962
pdurbin Mar 22, 2023
e6b80d8
Merge remote-tracking branch 'IQSS/develop' into signposting-5.9
qqmyers Mar 24, 2023
690cec2
change logging to fine
qqmyers Mar 24, 2023
13dc1fa
Merge branch 'GDCC/Signposting' of https://github.com/GlobalDataverse…
qqmyers Mar 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/release-notes/8424-signposting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Signposting for Dataverse

This release adds [Signposting](https://signposting.org/) support to Dataverse to improve machine discoverability of datasets and files.

The following MicroProfile Config options are now available (these can be treated as JVM options):

- dataverse.signposting.level1-author-limit
- dataverse.signposting.level1-item-limit
76 changes: 76 additions & 0 deletions doc/sphinx-guides/source/admin/discoverability.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Discoverability
===============

Datasets are made discoverable by a variety of methods.

.. contents:: |toctitle|
:local:

DataCite Integration
--------------------

If you are using `DataCite <https://datacite.org>`_ as your DOI provider, when datasets are published, metadata is pushed to DataCite, where it can be searched. For more information, see :ref:`:DoiProvider` in the Installation Guide.

OAI-PMH (Harvesting)
--------------------

The Dataverse software supports a protocol called OAI-PMH that facilitates harvesting dataset metadata from one system into another. For details on harvesting, see the :doc:`harvestserver` section.

Machine-Readable Metadata on Dataset Landing Pages
--------------------------------------------------

As recommended in `A Data Citation Roadmap for Scholarly Data Repositories <https://doi.org/10.1101/097196>`_, the Dataverse software embeds metadata on dataset landing pages in a variety of machine-readable ways.

Dublin Core HTML Meta Tags
++++++++++++++++++++++++++

The HTML source of a dataset landing page includes "DC" (Dublin Core) ``<meta>`` tags such as the following::

<meta name="DC.identifier" content="..."
<meta name="DC.type" content="Dataset"
<meta name="DC.title" content="..."

Schema.org JSON-LD Metadata
+++++++++++++++++++++++++++

The HTML source of a dataset landing page includes Schema.org JSON-LD metadata like this::


<script type="application/ld+json">{"@context":"http://schema.org","@type":"Dataset","@id":"https://doi.org/...


.. _discovery-sign-posting:

Signposting
+++++++++++

The Dataverse software supports `Signposting <https://signposting.org>`_. This allows machines to request more information about a dataset through the `Link <https://tools.ietf.org/html/rfc5988>`_ HTTP header.

There are 2 Signposting profile levels, level 1 and level 2. In this implementation,
* Level 1 links are shown `as recommended <https://signposting.org/FAIR/>`_ in the "Link"
HTTP header, which can be fetched by sending an HTTP HEAD request, e.g. ``curl -I https://demo.dataverse.org/dataset.xhtml?persistentId=doi:10.5072/FK2/KPY4ZC``.
The number of author and file links in the level 1 header can be configured as described below.
* The level 2 linkset can be fetched by visiting the dedicated linkset page for
that artifact. The link can be seen in level 1 links with key name ``rel="linkset"``.

Note: Authors without author link will not be counted nor shown in any profile/linkset.
The following configuration options are available:

- :ref:`dataverse.signposting.level1-author-limit`

Sets the max number of authors to be shown in `level 1` profile.
If the number of authors (with identifier URLs) exceeds this value, no author links will be shown in `level 1` profile.
The default is 5.

- :ref:`dataverse.signposting.level1-item-limit`

Sets the max number of items/files which will be shown in `level 1` profile. Datasets with
too many files will not show any file links in `level 1` profile. They will be shown in `level 2` linkset only.
The default is 5.

See also :ref:`signposting-api` in the API Guide.

Additional Discoverability Through Integrations
-----------------------------------------------

See :ref:`integrations-discovery` in the Integrations section for additional discovery methods you can enable.
1 change: 1 addition & 0 deletions doc/sphinx-guides/source/admin/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This guide documents the functionality only available to superusers (such as "da

dashboard
external-tools
discoverability
harvestclients
harvestserver
metadatacustomization
Expand Down
9 changes: 3 additions & 6 deletions doc/sphinx-guides/source/admin/integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,12 @@ Avgidea Data Search

Researchers can use a Google Sheets add-on to search for Dataverse installation's CSV data and then import that data into a sheet. See `Avgidea Data Search <https://www.avgidea.io/avgidea-data-platform.html>`_ for details.

.. _integrations-discovery:

Discoverability
---------------

Integration with `DataCite <https://datacite.org>`_ is built in to the Dataverse Software. When datasets are published, metadata is sent to DataCite. You can further increase the discoverability of your datasets by setting up additional integrations.

OAI-PMH (Harvesting)
++++++++++++++++++++

The Dataverse Software supports a protocol called OAI-PMH that facilitates harvesting datasets from one system into another. For details on harvesting, see the :doc:`harvestserver` section.
A number of builtin features related to data discovery are listed under :doc:`discoverability` but you can further increase the discoverability of your data by setting up integrations.

SHARE
+++++
Expand Down
26 changes: 25 additions & 1 deletion doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2084,10 +2084,34 @@ The response is a JSON object described in the :doc:`/api/external-tools` sectio
export PERSISTENT_IDENTIFIER=doi:10.5072/FK2/7U7YBV
export VERSION=1.0
export TOOL_ID=1


curl -H "X-Dataverse-key: $API_TOKEN" -H "Accept:application/json" "$SERVER_URL/api/datasets/:persistentId/versions/$VERSION/toolparams/$TOOL_ID?persistentId=$PERSISTENT_IDENTIFIER"

.. _signposting-api:

Retrieve Signposting Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dataverse supports :ref:`discovery-sign-posting` as a discovery mechanism.
Signposting involves the addition of a `Link <https://tools.ietf.org/html/rfc5988>`__ HTTP header providing summary information on GET and HEAD requests to retrieve the dataset page and a separate /linkset API call to retrieve additional information.

Here is an example of a "Link" header:

``Link: <https://doi.org/10.5072/FK2/YD5QDG>;rel="cite-as", <https://doi.org/10.5072/FK2/YD5QDG>;rel="describedby";type="application/vnd.citationstyles.csl+json",<https://demo.dataverse.org/api/datasets/export?exporter=schema.org&persistentId=doi:10.5072/FK2/YD5QDG>;rel="describedby";type="application/json+ld", <https://schema.org/AboutPage>;rel="type",<https://schema.org/Dataset>;rel="type", https://demo.dataverse.org/api/datasets/:persistentId/versions/1.0/customlicense?persistentId=doi:10.5072/FK2/YD5QDG;rel="license", <https://demo.dataverse.org/api/datasets/:persistentId/versions/1.0/linkset?persistentId=doi:10.5072/FK2/YD5QDG> ; rel="linkset";type="application/linkset+json"``

The URL for linkset information is discoverable under the ``rel="linkset";type="application/linkset+json`` entry in the "Link" header, such as in the example above.

The reponse includes a JSON object conforming to the `Signposting <https://signposting.org>`__ specification.
Signposting is not supported for draft dataset versions.

.. code-block:: bash

export SERVER_URL=https://demo.dataverse.org
export PERSISTENT_IDENTIFIER=doi:10.5072/FK2/YD5QDG
export VERSION=1.0

curl -H "Accept:application/json" "$SERVER_URL/api/datasets/:persistentId/versions/$VERSION/linkset?persistentId=$PERSISTENT_IDENTIFIER"

Files
-----

Expand Down
1 change: 1 addition & 0 deletions doc/sphinx-guides/source/developers/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ sub-scopes first.
- All sub-scopes are below that.
- Scopes are separated by dots (periods).
- A scope may be a placeholder, filled with a variable during lookup. (Named object mapping.)
- The setting should be in kebab case (``signing-secret``) rather than camel case (``signingSecret``).

Any consumer of the setting can choose to use one of the fluent ``lookup()`` methods, which hides away alias handling,
conversion etc from consuming code. See also the detailed Javadoc for these methods.
Expand Down
20 changes: 20 additions & 0 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,26 @@ See also these related database settings:
- :ref:`:Authority`
- :ref:`:Shoulder`


.. _dataverse.signposting.level1-author-limit:

dataverse.signposting.level1-author-limit
+++++++++++++++++++++++++++++++++++++++++

See :ref:`discovery-sign-posting` for details.

Can also be set via any `supported MicroProfile Config API source`_, e.g. the environment variable ``DATAVERSE_SIGNPOSTING_LEVEL1_AUTHOR_LIMIT``.

.. _dataverse.signposting.level1-item-limit:

dataverse.signposting.level1-item-limit
+++++++++++++++++++++++++++++++++++++++

See :ref:`discovery-sign-posting` for details.

Can also be set via any `supported MicroProfile Config API source`_, e.g. the environment variable ``DATAVERSE_SIGNPOSTING_LEVEL1_ITEM_LIMIT``.


.. _feature-flags:

Feature Flags
Expand Down
19 changes: 17 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@
import edu.harvard.iq.dataverse.search.SearchServiceBean;
import edu.harvard.iq.dataverse.search.SearchUtil;
import edu.harvard.iq.dataverse.search.SolrClientService;
import edu.harvard.iq.dataverse.settings.JvmSettings;
import edu.harvard.iq.dataverse.util.SignpostingResources;
import edu.harvard.iq.dataverse.util.FileMetadataUtil;
import java.util.Comparator;
import org.apache.solr.client.solrj.SolrQuery;
Expand Down Expand Up @@ -6046,8 +6048,7 @@ public boolean downloadingRestrictedFiles() {
}
return false;
}



//Determines whether this Dataset uses a public store and therefore doesn't support embargoed or restricted files
public boolean isHasPublicStore() {
return settingsWrapper.isTrueForKey(SettingsServiceBean.Key.PublicInstall, StorageIO.isPublicStore(dataset.getEffectiveStorageDriverId()));
Expand Down Expand Up @@ -6080,5 +6081,19 @@ public String getWebloaderUrlForDataset(Dataset d) {
return null;
}
}

/**
* Add Signposting
* @return String
*/
public String getSignpostingLinkHeader() {
if (!workingVersion.isReleased()) {
return null;
}
SignpostingResources sr = new SignpostingResources(systemConfig, workingVersion,
JvmSettings.SIGNPOSTING_LEVEL1_AUTHOR_LIMIT.lookupOptional().orElse(""),
JvmSettings.SIGNPOSTING_LEVEL1_ITEM_LIMIT.lookupOptional().orElse(""));
return sr.getLinks();
}

}
37 changes: 36 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import edu.harvard.iq.dataverse.metrics.MetricsUtil;
import edu.harvard.iq.dataverse.makedatacount.MakeDataCountUtil;
import edu.harvard.iq.dataverse.settings.SettingsServiceBean;
import edu.harvard.iq.dataverse.settings.SettingsServiceBean.Key;
import edu.harvard.iq.dataverse.util.ArchiverUtil;
import edu.harvard.iq.dataverse.util.BundleUtil;
import edu.harvard.iq.dataverse.util.EjbUtil;
Expand All @@ -93,6 +94,8 @@
import edu.harvard.iq.dataverse.util.json.JSONLDUtil;
import edu.harvard.iq.dataverse.util.json.JsonLDTerm;
import edu.harvard.iq.dataverse.util.json.JsonParseException;
import edu.harvard.iq.dataverse.util.json.JsonPrinter;
import edu.harvard.iq.dataverse.util.SignpostingResources;
import edu.harvard.iq.dataverse.util.json.JsonUtil;
import edu.harvard.iq.dataverse.search.IndexServiceBean;

Expand Down Expand Up @@ -156,6 +159,7 @@
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
import com.amazonaws.services.s3.model.PartETag;
import edu.harvard.iq.dataverse.settings.JvmSettings;

@Path("datasets")
public class Datasets extends AbstractApiBean {
Expand Down Expand Up @@ -558,7 +562,38 @@ public Response getVersionMetadataBlock(@Context ContainerRequestContext crc,
return notFound("metadata block named " + blockName + " not found");
}, getRequestUser(crc));
}


/**
* Add Signposting
* @param datasetId
* @param versionId
* @param uriInfo
* @param headers
* @return
*/
@GET
@AuthRequired
@Path("{id}/versions/{versionId}/linkset")
public Response getLinkset(@Context ContainerRequestContext crc, @PathParam("id") String datasetId, @PathParam("versionId") String versionId, @Context UriInfo uriInfo, @Context HttpHeaders headers) {
if ( ":draft".equals(versionId) ) {
return badRequest("Signposting is not supported on the :draft version");
}
User user = getRequestUser(crc);
return response(req -> {
DatasetVersion dsv = getDatasetVersionOrDie(req, versionId, findDatasetOrDie(datasetId), uriInfo, headers);
return ok(Json.createObjectBuilder().add(
"linkset",
new SignpostingResources(
systemConfig,
dsv,
JvmSettings.SIGNPOSTING_LEVEL1_AUTHOR_LIMIT.lookupOptional().orElse(""),
JvmSettings.SIGNPOSTING_LEVEL1_ITEM_LIMIT.lookupOptional().orElse("")
).getJsonLinkset()
)
);
}, user);
}

@GET
@AuthRequired
@Path("{id}/modifyRegistration")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public enum JvmSettings {
// API SETTINGS
SCOPE_API(PREFIX, "api"),
API_SIGNING_SECRET(SCOPE_API, "signing-secret"),

// SIGNPOSTING SETTINGS
SCOPE_SIGNPOSTING(PREFIX, "signposting"),
SIGNPOSTING_LEVEL1_AUTHOR_LIMIT(SCOPE_SIGNPOSTING, "level1-author-limit"),
SIGNPOSTING_LEVEL1_ITEM_LIMIT(SCOPE_SIGNPOSTING, "level1-item-limit"),

// FEATURE FLAGS SETTINGS
SCOPE_FLAGS(PREFIX, "feature"),
Expand Down