Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,53 +60,3 @@ jobs:
env:
TEST_FLAGS: ${{ matrix.mvnflags }}
run: mvn --no-transfer-progress -V install -P-assembly -Pcoverage-report $TEST_FLAGS

# If previous step failed, save results of tests to downloadable artifact for this job
# (This artifact is downloadable at the bottom of any job's summary page)
- name: Upload Results of ${{ matrix.type }} to Artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.type }} results
path: ${{ matrix.resultsdir }}

# Upload code coverage report to artifact, so that it can be shared with the 'codecov' job (see below)
- name: Upload code coverage report to Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.type }} coverage report
path: 'dspace/target/site/jacoco-aggregate/jacoco.xml'
retention-days: 14

# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
codecov:
# Must run after 'tests' job above
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

# Download artifacts from previous 'tests' job
- name: Download coverage artifacts
uses: actions/download-artifact@v4

# Now attempt upload to Codecov using its action.
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
#
# Retry action: https://github.com/marketplace/actions/retry-action
# Codecov action: https://github.com/codecov/codecov-action
- name: Upload coverage to Codecov.io
uses: Wandalen/[email protected]
with:
action: codecov/codecov-action@v4
# Ensure codecov-action throws an error when it fails to upload
with: |
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
# Try re-running action 5 times max
attempt_limit: 5
# Run again in 30 seconds
attempt_delay: 30000
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ public void serviceDocumentTest() throws Exception {
.andExpect(content().contentType("application/opensearchdescription+xml;charset=UTF-8"))
// and there need to be some values taken from the test configuration
.andExpect(xpath("OpenSearchDescription/ShortName").string("DSpace"))
.andExpect(xpath("OpenSearchDescription/LongName").string("DSpace at My University"))
.andExpect(xpath("OpenSearchDescription/LongName").string("Faculty Digital Archive"))
.andExpect(xpath("OpenSearchDescription/Description")
.string("DSpace at My University DSpace repository"))
.string("Faculty Digital Archive DSpace repository"))
.andExpect(xpath("OpenSearchDescription/Url[@type='text/html']/@template")
.string("http://localhost:4000/search?query={searchTerms}"))
.andExpect(xpath("OpenSearchDescription/Url[@type='application/atom+xml; charset=UTF-8']/@template")
Expand All @@ -255,7 +255,7 @@ public void serviceDocumentTest() throws Exception {
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>DSpace</ShortName>
<LongName>DSpace at My University</LongName>
<Description>DSpace at My University DSpace repository</Description>
<Description>Faculty Digital Archive DSpace repository</Description>
<InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding>
<Query role="example" searchTerms="photosyntesis" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import static org.dspace.app.rest.matcher.MetadataMatcher.matchMetadata;
import static org.dspace.app.rest.model.BrowseIndexRest.BROWSE_TYPE_VALUE_LIST;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
Expand Down Expand Up @@ -66,23 +66,22 @@ public void findAll() throws Exception {
//We expect the content type to be "application/hal+json;charset=UTF-8"
.andExpect(content().contentType(contentType))

//Our default Discovery config has 5 browse indexes, so we expect this to be reflected in the page
//Our default Discovery config has 6 browse indexes, so we expect this to be reflected in the page
// object
.andExpect(jsonPath("$.page.size", is(20)))
.andExpect(jsonPath("$.page.totalElements", is(5)))
.andExpect(jsonPath("$.page.totalElements", is(6)))
.andExpect(jsonPath("$.page.totalPages", is(1)))
.andExpect(jsonPath("$.page.number", is(0)))

//The array of browse index should have a size 5
.andExpect(jsonPath("$._embedded.browses", hasSize(5)))
//The array of browse index should have a size 6
.andExpect(jsonPath("$._embedded.browses", hasSize(6)))

//Check that all (and only) the default browse indexes are present
.andExpect(jsonPath("$._embedded.browses", containsInAnyOrder(
BrowseIndexMatcher.dateIssuedBrowseIndex("asc"),
BrowseIndexMatcher.contributorBrowseIndex("asc"),
BrowseIndexMatcher.titleBrowseIndex("asc"),
BrowseIndexMatcher.subjectBrowseIndex("asc"),
BrowseIndexMatcher.hierarchicalBrowseIndex("srsc")
//Check that at least these default browse indexes are present (can have more)
.andExpect(jsonPath("$._embedded.browses", hasItems(
BrowseIndexMatcher.dateIssuedBrowseIndex("asc"),
BrowseIndexMatcher.contributorBrowseIndex("asc"),
BrowseIndexMatcher.titleBrowseIndex("asc"),
BrowseIndexMatcher.subjectBrowseIndex("asc")
)))
;
}
Expand Down Expand Up @@ -129,21 +128,6 @@ public void findBrowseByContributor() throws Exception {
;
}

@Test
public void findBrowseByVocabulary() throws Exception {
//Use srsc as this vocabulary is included by default
//When we call the root endpoint
getClient().perform(get("/api/discover/browses/srsc"))
//The status has to be 200 OK
.andExpect(status().isOk())
//We expect the content type to be "application/hal+json;charset=UTF-8"
.andExpect(content().contentType(contentType))

//Check that the JSON root matches the expected browse index
.andExpect(jsonPath("$", BrowseIndexMatcher.hierarchicalBrowseIndex("srsc")))
;
}

@Test
public void findBrowseBySubject() throws Exception {
//When we call the root endpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void serverPropertiesTest() throws Exception {
//We expect the content type to be "application/hal+json;charset=UTF-8"
.andExpect(content().contentType(contentType))
.andExpect(jsonPath("$.dspaceUI", Matchers.is("http://localhost:4000")))
.andExpect(jsonPath("$.dspaceName", Matchers.is("DSpace at My University")))
.andExpect(jsonPath("$.dspaceName", Matchers.is("Faculty Digital Archive")))
.andExpect(jsonPath("$.dspaceServer", Matchers.is(BASE_REST_SERVER_URL)))
.andExpect(jsonPath("$.type", Matchers.is("root")));
}
Expand Down
12 changes: 7 additions & 5 deletions dspace/config/dspace.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ dspace.server.ssr.url = ${dspace.server.url}
dspace.ui.url = http://localhost:4000

# Name of the site
dspace.name = DSpace at My University
dspace.shortname = DSpace
dspace.name = Faculty Digital Archive
dspace.shortname = FDA

# Assetstore configurations have moved to config/modules/assetstore.cfg
# and config/spring/api/bitstore.xml.
Expand Down Expand Up @@ -1177,7 +1177,9 @@ webui.browse.index.1 = dateissued:item:dateissued
webui.browse.index.2 = author:metadata:dc.contributor.*\,dc.creator:text
webui.browse.index.3 = title:item:title
webui.browse.index.4 = subject:metadata:dc.subject.*:text
#webui.browse.index.5 = dateaccessioned:item:dateaccessioned
webui.browse.index.5 = topic:metadata:dc.topic.*:text
webui.browse.index.6 = semester:metadata:dc.description.semester:text
#webui.browse.index.7 = dategrouped:metadata:dc.date.issued:date:desc

## example of authority-controlled browse category - see authority control config
#webui.browse.index.5 = lcAuthor:metadataAuthority:dc.contributor.author:authority
Expand All @@ -1186,7 +1188,7 @@ webui.browse.index.4 = subject:metadata:dc.subject.*:text
# vocabularies in the submission forms. These could be disabled adding the name of
# the vocabularies to exclude in this comma-separated property.
# (Requires reboot of servlet container, e.g. Tomcat, to reload)
# webui.browse.vocabularies.disabled = srsc
webui.browse.vocabularies.disabled = srsc

# Enable/Disable tag cloud in browsing.
# webui.browse.index.tagcloud.<n> = true | false
Expand Down Expand Up @@ -1377,7 +1379,7 @@ websvc.opensearch.longname = ${dspace.name}
# brief service description
websvc.opensearch.description = ${dspace.name} DSpace repository
# location of favicon for service, if any must be 16X16 pixels
websvc.opensearch.faviconurl = http://www.dspace.org/images/favicon.ico
websvc.opensearch.faviconurl = https://cdn.library.nyu.edu/images/favicon.ico
# sample query - should return results
websvc.opensearch.samplequery = photosynthesis
# tags used to describe search service
Expand Down
13 changes: 13 additions & 0 deletions dspace/config/entities/relationship-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
</rightCardinality>
<copyToLeft>true</copyToLeft>
</type>
<type>
<leftType>Syllabus</leftType>
<rightType>Person</rightType>
<leftwardType>isAuthorOfSyllabus</leftwardType>
<rightwardType>isSyllabusOfAuthor</rightwardType>
<leftCardinality>
<min>0</min>
</leftCardinality>
<rightCardinality>
<min>0</min>
</rightCardinality>
<copyToLeft>true</copyToLeft>
</type>
<type>
<leftType>Publication</leftType>
<rightType>Project</rightType>
Expand Down