Skip to content

Commit

Permalink
Signposting to DANS:signposting branch (#77)
Browse files Browse the repository at this point in the history
* set default when no config is set for signposting

* modification according to reviews

* move long json string from code to bunddle

* allow empty config on the level 2 profile

* revision based on Herbert feedback

* coding style cleanup SignpostingResources

* remove leading comma

* fix capitalize with header name

* add items to header when less than maxItems, default license to cc0

* add items to l1 profile and set default license to cc0

* use actual file type on l1 profile for items

* limit maxAuthors

* Add Dataset type to landing page, both profile and linkset

* use configed type instead of string

* fix missing author error, note: identity URL is empty sometimes

* create function to get author URL

* remove num author limit in json

* revision list 20210511

* merging conflicts

* solving null pointer on license
  • Loading branch information
vicding-mi authored Jun 3, 2021
1 parent 5ec179a commit 15e7f28
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 17 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/reviewdog_checkstyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Maven CheckStyle Task
on:
pull_request:
paths:
- "**.java"

jobs:
checkstyle_job:
runs-on: ubuntu-latest
name: Checkstyle job
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run check style
uses: nikitasavinov/checkstyle-action@master
with:
fail_on_error: true
reporter: github-pr-review
checkstyle_config: checkstyle.xml
github_token: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion doc/release-notes/5.0-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ The instructions below describe the upgrade procedure based on moving an existin

1. Update Astrophysics Metadata Block (if used)

`wget https://github.com/IQSS/dataverse/releases/download/5.0/astrophysics.tsv`
`wget https://github.com/IQSS/dataverse/releases/download/v5.0/astrophysics.tsv`
`curl http://localhost:8080/api/admin/datasetfield/load -X POST --data-binary @astrophysics.tsv -H "Content-type: text/tab-separated-values"`

2. (Recommended) Run ReExportall to update JSON Exports
Expand Down
8 changes: 8 additions & 0 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -825,14 +825,20 @@ through the Dataverse application.
For example, if you have a dataset version with 2 files, one with the folder named "subfolder":
|image1|
.. |image1| image:: ./img/dataset_page_files_view.png
or, as viewed as a tree on the dataset page:
|image2|
.. |image2| image:: ./img/dataset_page_tree_view.png
The output of the API for the top-level folder (``/api/datasets/{dataset}/dirindex/``) will be as follows:
|image3|
.. |image3| image:: ./img/index_view_top.png
with the underlying html source:
Expand All @@ -851,6 +857,8 @@ with the underlying html source:
The ``/dirindex/?folder=subfolder`` link above will produce the following view:
|image4|
.. |image4| image:: ./img/index_view_subfolder.png
with the html source as follows:
Expand Down
2 changes: 0 additions & 2 deletions doc/sphinx-guides/source/developers/dev-environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ To install Solr, execute the following commands:

``curl -O https://raw.githubusercontent.com/IQSS/dataverse/develop/conf/solr/8.8.1/schema_dv_mdb_fields.xml``

``curl -O https://raw.githubusercontent.com/IQSS/dataverse/develop/conf/solr/8.8.1/schema_dv_mdb_copies.xml``

``mv schema*.xml collection1/conf``

``curl -O https://raw.githubusercontent.com/IQSS/dataverse/develop/conf/solr/8.8.1/solrconfig.xml``
Expand Down
4 changes: 2 additions & 2 deletions scripts/installer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GLASSFISH_SETUP_SCRIPT=${INSTALLER_ZIP_DIR}/as-setup.sh
API_SCRIPTS=${INSTALLER_ZIP_DIR}/setup-datasetfields.sh ${INSTALLER_ZIP_DIR}/setup-users.sh ${INSTALLER_ZIP_DIR}/setup-builtin-roles.sh ${INSTALLER_ZIP_DIR}/setup-dvs.sh ${INSTALLER_ZIP_DIR}/data ${INSTALLER_ZIP_DIR}/setup-identity-providers.sh ${INSTALLER_ZIP_DIR}/setup-all.sh ${INSTALLER_ZIP_DIR}/post-install-api-block.sh
JHOVE_CONFIG=${INSTALLER_ZIP_DIR}/jhove.conf
JHOVE_SCHEMA=${INSTALLER_ZIP_DIR}/jhoveConfig.xsd
SOLR_SCHEMA=${INSTALLER_ZIP_DIR}/schema.xml ${INSTALLER_ZIP_DIR}/schema_dv_mdb_fields.xml ${INSTALLER_ZIP_DIR}/schema_dv_mdb_copies.xml ${INSTALLER_ZIP_DIR}/updateSchemaMDB.sh
SOLR_SCHEMA=${INSTALLER_ZIP_DIR}/schema.xml ${INSTALLER_ZIP_DIR}/schema_dv_mdb_fields.xml ${INSTALLER_ZIP_DIR}/updateSchemaMDB.sh
SOLR_CONFIG=${INSTALLER_ZIP_DIR}/solrconfig.xml
PYTHON_FILES=${INSTALLER_ZIP_DIR}/README_python.txt ${INSTALLER_ZIP_DIR}/installConfig.py ${INSTALLER_ZIP_DIR}/installUtils.py ${INSTALLER_ZIP_DIR}/install.py ${INSTALLER_ZIP_DIR}/installAppServer.py ${INSTALLER_ZIP_DIR}/requirements.txt ${INSTALLER_ZIP_DIR}/default.config ${INSTALLER_ZIP_DIR}/interactive.config
INSTALL_SCRIPT=${INSTALLER_ZIP_DIR}/install
Expand Down Expand Up @@ -56,7 +56,7 @@ ${JHOVE_SCHEMA}: ../../conf/jhove/jhoveConfig.xsd ${INSTALLER_ZIP_DIR}
@echo copying jhove schema file
/bin/cp ../../conf/jhove/jhoveConfig.xsd ${INSTALLER_ZIP_DIR}

${SOLR_SCHEMA}: ../../conf/solr/8.8.1/schema.xml ../../conf/solr/8.8.1/schema_dv_mdb_fields.xml ../../conf/solr/8.8.1/schema_dv_mdb_copies.xml ../../conf/solr/8.8.1/updateSchemaMDB.sh ${INSTALLER_ZIP_DIR}
${SOLR_SCHEMA}: ../../conf/solr/8.8.1/schema.xml ../../conf/solr/8.8.1/schema_dv_mdb_fields.xml ../../conf/solr/8.8.1/updateSchemaMDB.sh ${INSTALLER_ZIP_DIR}
@echo copying Solr schema file
/bin/cp ../../conf/solr/8.8.1/schema*.xml ../../conf/solr/8.8.1/updateSchemaMDB.sh ${INSTALLER_ZIP_DIR}

Expand Down
3 changes: 1 addition & 2 deletions scripts/installer/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@ jhove.conf
SOLR schema and config files, from conf/solr/8.8.1:

schema.xml
schema_dv_cmb_copies.xml
schema_dv_cmb_fields.xml
schema_dv_mdb_fields.xml
solrconfig.xml
4 changes: 2 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -5481,9 +5481,9 @@ public boolean isFileDeleted (DataFile dataFile) {

/**
* Add Signposting
* @return
* @return String
*/
public String getSignpostingLinkHeader(){
public String getSignpostingLinkHeader() {
if (!workingVersion.isReleased())
return "DRAFT";
SignpostingResources sr = new SignpostingResources(systemConfig, workingVersion, settingsService.getValueForKey(SettingsServiceBean.Key.SignpostingConf));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ public Response listBuiltinRoles() {
return error(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage());
}
}

@DELETE
@Path("roles/{id}")
public Response deleteRole(@PathParam("id") String id) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ public Response getFileAccessFolderView(@PathParam("id") String datasetId, @Quer

String indexFileName = folderName.equals("") ? ".index.html"
: ".index-" + folderName.replace('/', '_') + ".html";
response.setHeader("Content-disposition", "attachment; filename=\"" + indexFileName + "\"");
response.setHeader("Content-disposition", "filename=\"" + indexFileName + "\"");


return Response.ok()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ public String getLinks() {
}
valueList.add(type);

// TODO: support only CC0 now, should add flexible license support when flex-terms is ready
// TODO: support only CC0 now, should add flexible license support when flex-terms or multi-license is ready
TermsOfUseAndAccess.License license = workingDatasetVersion.getTermsOfUseAndAccess().getLicense();
String licenseString = "";
if (license == TermsOfUseAndAccess.License.CC0 || license == TermsOfUseAndAccess.License.NONE) {
if (license == null || license == TermsOfUseAndAccess.License.CC0 || license == TermsOfUseAndAccess.License.NONE) {
// On the current Dataverse, only None and CC0. In the signposting protocol: cardinality is 1
licenseString = "<https://creativecommons.org/publicdomain/zero/1.0/>;rel=\"license\"";
licenseString = licJsonObj.getString(TermsOfUseAndAccess.License.CC0.name()) + ";rel=\"license\"";
valueList.add(licenseString);
} else {
valueList.add(license.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,20 @@ public static JsonObjectBuilder jsonDataFileList(List<DataFile> dataFiles){

return bld;
}


private static String getRootDataverseNameforCitation(Dataset dataset) {
Dataverse root = dataset.getOwner();
while (root.getOwner() != null) {
root = root.getOwner();
}
String rootDataverseName = root.getName();
if (!StringUtil.isEmpty(rootDataverseName)) {
return rootDataverseName;
} else {
return "";
}
}

private static String getLicenseInfo(DatasetVersion dsv) {
if (dsv.getTermsOfUseAndAccess().getLicense() != null && dsv.getTermsOfUseAndAccess().getLicense().equals(TermsOfUseAndAccess.License.CC0)) {
return "CC0 Waiver";
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ public void testListAuthenticatedUsers() throws Exception {

Response deleteSuperuser = UtilIT.deleteUser(superuserUsername);
assertEquals(200, deleteSuperuser.getStatusCode());

}


@Test
public void testFilterAuthenticatedUsersForbidden() throws Exception {
Expand Down

0 comments on commit 15e7f28

Please sign in to comment.