forked from DSpace/DSpace
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The message templates are loaded from the Enum instead of json file.
- Loading branch information
1 parent
130d78f
commit 419aff3
Showing
7 changed files
with
131 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
dspace-api/src/main/java/org/dspace/core/ProvenanceMessageTemplates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* The contents of this file are subject to the license and copyright | ||
* detailed in the LICENSE and NOTICE files at the root of the source | ||
* tree and available online at | ||
* | ||
* http://www.dspace.org/license/ | ||
*/ | ||
package org.dspace.core; | ||
|
||
public enum ProvenanceMessageTemplates { | ||
ACCESS_CONDITION("Access condition (%s) was added to %s (%s)"), | ||
RESOURCE_POLICIES_REMOVED("Resource policies (%s) of %s (%s) were removed"), | ||
BUNDLE_ADDED("Item was added bitstream to bundle (%s)"), | ||
EDIT_LICENSE("License (%s) was %s"), | ||
MOVE_ITEM("Item was moved from collection (%s) to different collection"), | ||
MAPPED_ITEM("Item was mapped to collection (%s)"), | ||
DELETED_ITEM_FROM_MAPPED("Item was deleted from mapped collection (%s)"), | ||
EDIT_BITSTREAM("Item (%s) was deleted bitstream (%s)"), | ||
ITEM_METADATA("Item metadata (%s) was %s"), | ||
BITSTREAM_METADATA("Item metadata (%s) was %s bitstream (%s)"), | ||
ITEM_REPLACE_SINGLE_METADATA("Item bitstream (%s) metadata (%s) was updated"), | ||
DISCOVERABLE("Item was made %sdiscoverable"); | ||
|
||
private final String template; | ||
|
||
ProvenanceMessageTemplates(String template) { | ||
this.template = template; | ||
} | ||
|
||
public String getTemplate() { | ||
return template; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
dspace-api/src/main/resources/org/dspace/core/provenance_messages.json
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
dspace-server-webapp/src/test/java/org/dspace/app/rest/ProvenanceExpectedMessages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* The contents of this file are subject to the license and copyright | ||
* detailed in the LICENSE and NOTICE files at the root of the source | ||
* tree and available online at | ||
* | ||
* http://www.dspace.org/license/ | ||
*/ | ||
package org.dspace.app.rest; | ||
|
||
public enum ProvenanceExpectedMessages { | ||
DISCOVERABLE("Item was made discoverable by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 0\nItem was in collections:\n"), | ||
NON_DISCOVERABLE("Item was made non-discoverable by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 0\nItem was in collections:\n"), | ||
MAPPED_COL("was mapped to collection"), | ||
ADD_ITEM_MTD("Item metadata (dc.title) was added by first (admin) last (admin) ([email protected]) on"), | ||
REPLACE_ITEM_MTD("Item metadata (dc.title: Public item 1) was updated by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 0"), | ||
REMOVE_ITEM_MTD("Item metadata (dc.title: Public item 1) was deleted by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 0"), | ||
REMOVE_BITSTREAM_MTD("Item metadata (dc.description) was added by bitstream"), | ||
REPLACE_BITSTREAM_MTD("metadata (dc.title: test) was updated by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 1\n"), | ||
REMOVE_BITSTREAM("was deleted bitstream"), | ||
ADD_BITSTREAM("Item was added bitstream to bundle"), | ||
UPDATE_LICENSE("License (Test 1) was updated by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 1\n"), | ||
ADD_LICENSE("License (empty) was added by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 0"), | ||
REMOVE_LICENSE("License (Test) was removed by first (admin) last (admin) ([email protected]) on \nNo. of bitstreams: 1\n"), | ||
MOVED_ITEM_COL("Item was moved from collection "); | ||
|
||
private final String template; | ||
|
||
// Constructor to initialize enum with the template string | ||
ProvenanceExpectedMessages(String template) { | ||
this.template = template; | ||
} | ||
|
||
// Method to retrieve the template string | ||
public String getTemplate() { | ||
return template; | ||
} | ||
} |
Oops, something went wrong.