Skip to content

Commit

Permalink
Remove spaces from the list of schema list of metadata import restric…
Browse files Browse the repository at this point in the history
…tions so that "iso19115-3.2018, dublin-core" will also work.

Also updated the admin documentation so that it is clear that it expect to get a comma separated list.
  • Loading branch information
ianwallen committed Oct 8, 2024
1 parent cfcd829 commit 1f803ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,11 @@ public AbstractMetadata insertMetadata(ServiceContext context, AbstractMetadata

// Check if the schema is allowed by settings
String mdImportSetting = settingManager.getValue(Settings.METADATA_IMPORT_RESTRICT);
if (mdImportSetting != null && !mdImportSetting.equals("")) {
if (mdImportSetting != null) {
// Remove spaces from the list so that "iso19115-3.2018, dublin-core" will also work
mdImportSetting = mdImportSetting.replace(" ", "");
}
if (!StringUtils.isBlank(mdImportSetting)) {
if (!newMetadata.getHarvestInfo().isHarvested() && !Arrays.asList(mdImportSetting.split(",")).contains(schema)) {
throw new IllegalArgumentException("The system setting '" + Settings.METADATA_IMPORT_RESTRICT
+ "' doesn't allow to import " + schema
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/main/resources/catalog/locales/en-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@
"metadata/workflow/forceValidationOnMdSave-help": "When the metadata is saved force validation check",
"metadata/import": "Metadata import",
"metadata/import/restrict": "Restrict import to schemas",
"metadata/import/restrict-help": "List of all allowed schemas for metadata to be imported. If the metadata schema is not allowed, then the import is not done. No value means all schemas allowed.",
"metadata/import/restrict-help": "Comma separated list of all allowed schemas for metadata to be imported. If the metadata schema is not allowed, then the import is not done. No value means all schemas allowed.",
"metadata/import/userprofile": "Minimum user profile allowed to import metadata",
"metadata/import/userprofile-help": "Minimum user profile allowed to import metadata (Editor, Reviewer or Administrator). The default value is Editor.",
"metadata/delete": "Metadata delete",
Expand Down

0 comments on commit 1f803ee

Please sign in to comment.