diff --git a/modules/weko-search-ui/tests/data/jsonld/ro-crate-metadata.json b/modules/weko-search-ui/tests/data/jsonld/ro-crate-metadata.json index 6783aa33ac..aefd1fcccd 100644 --- a/modules/weko-search-ui/tests/data/jsonld/ro-crate-metadata.json +++ b/modules/weko-search-ui/tests/data/jsonld/ro-crate-metadata.json @@ -103,7 +103,8 @@ } ], "wk:itemLinks": [], - "wk:metadataAutoFill": true + "wk:metadataAutoFill": true, + "wk:researchmapLinkage": true }, { "@id": "ro-crate-metadata.json", diff --git a/modules/weko-search-ui/tests/test_mapper.py b/modules/weko-search-ui/tests/test_mapper.py index c3fe1173d0..abe4e00a29 100644 --- a/modules/weko-search-ui/tests/test_mapper.py +++ b/modules/weko-search-ui/tests/test_mapper.py @@ -3,11 +3,14 @@ import xmltodict import uuid import json +import copy from datetime import date from unittest.mock import patch, MagicMock from collections import OrderedDict from pypdfium2 import PdfiumError +from invenio_i18n.babel import set_locale + from weko_records.api import Mapping from weko_records.serializers.utils import get_full_mapping from weko_search_ui.mapper import ( @@ -4832,6 +4835,7 @@ def test__deconstruct_json_ld(self, app, item_type2): assert system_info["file_path"] == ["sample.txt", "data.csv", "0606/data.csv", "https://example.com/test/sample/1"] assert system_info["non_extract"] == ["data.csv"] assert system_info["save_as_is"] == False + assert system_info["researchmap_linkage"] == True assert metadata["@id"] == "./" assert metadata["name"] == "The Sample Dataset for WEKO" assert metadata["description"] == "Item metadata for Item ID: 2000001. Title: The Sample Dataset for WEKO." @@ -4928,6 +4932,7 @@ def test_to_rocrate_metadata(self, app, db, item_type2, item_type_mapping2, mock assert graph["wk:editMode"] == "Keep" assert graph["wk:feedbackMail"] == ["wekosoftware@nii.ac.jp"] assert graph["wk:metadataAutoFill"] == False + assert graph["wk:researchmapLinkage"] == False if metadata.get("publish_status") == "0": assert graph["wk:publishStatus"] == "public" elif metadata.get("publish_status") == "1": @@ -5007,6 +5012,7 @@ def test_to_rocrate_metadata(self, app, db, item_type2, item_type_mapping2, mock assert "wk:feedbackMail" in graph assert "wk:itemLinks" in graph assert "wk:metadataAutoFill" in graph + assert "wk:researchmapLinkage" in graph assert graph["wk:index"] == metadata["path"] if metadata.get("publish_status") == "0": assert graph["wk:publishStatus"] == "public" @@ -5052,6 +5058,7 @@ def test_to_rocrate_metadata(self, app, db, item_type2, item_type_mapping2, mock assert "wk:feedbackMail" in graph assert "wk:itemLinks" in graph assert "wk:metadataAutoFill" in graph + assert "wk:researchmapLinkage" in graph assert graph["wk:index"] == metadata["path"] if metadata.get("publish_status") == "0": assert graph["wk:publishStatus"] == "public" @@ -5121,6 +5128,7 @@ def test_to_rocrate_metadata(self, app, db, item_type2, item_type_mapping2, mock assert "wk:feedbackMail" in graph assert "wk:itemLinks" in graph assert "wk:metadataAutoFill" in graph + assert "wk:researchmapLinkage" in graph assert graph["wk:index"] == metadata["path"] if metadata.get("publish_status") == "0": assert graph["wk:publishStatus"] == "public" @@ -5183,6 +5191,7 @@ def test_to_rocrate_metadata(self, app, db, item_type2, item_type_mapping2, mock assert "wk:feedbackMail" in graph assert "wk:itemLinks" in graph assert "wk:metadataAutoFill" in graph + assert "wk:researchmapLinkage" in graph assert graph["wk:index"] == metadata["path"] if metadata.get("publish_status") == "0": assert graph["wk:publishStatus"] == "public" @@ -5381,6 +5390,276 @@ def test_extract_text_from_files(self, app, db, item_type2, mocker, tmp_path): extract_text = mapper.extract_text_from_files("sample.other") assert extract_text == "" + + # def apply_import_replace_rules(self, metadata, info): + # .tox/c1/bin/pytest --cov=weko_search_ui tests/test_mapper.py::TestJsonLdMapper::test_apply_import_replace_rules -v -vv -s --cov-branch --cov-report=html --basetemp=/code/modules/weko-search-ui/.tox/c1/tmp + def test_apply_import_replace_rules(self, item_type2, app): + with app.test_request_context(): + mapper = JsonLdMapper(item_type2.model.id, None) + mapper.mapping_id = 123 + metadata = {"key1": "ab|cd", "key2": "efg|hij"} + info = {"warnings": []} + + # invalid rules + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULES"] = "invalid_val" + with set_locale("en"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("Replacement failed.: The type of the jsonld mapping " + "replacement rule is invalid."\ + in w for w in result_info["warnings"]) + with set_locale("ja"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("置換処理に失敗しました。: jsonldマッピングの置換ルール" + "の型が不正です。"\ + in w for w in result_info["warnings"]) + assert result_metadata == metadata + + # invalid rule_map + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULES"] = { + "pipe_full_width_normal": { + "from": "|", + "to": "|", + "is_regex": False, + "target_path": ["key1"] + }, + } + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP"] = ["invalid_val"] + with set_locale("en"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("Replacement failed.: The type of the jsonld mapping " + "replacement rule is invalid."\ + in w for w in result_info["warnings"]) + with set_locale("ja"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("置換処理に失敗しました。: jsonldマッピングの置換ルールの" + "型が不正です。"\ + in w for w in result_info["warnings"]) + assert result_metadata == metadata + + # invalid rule_keys + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP"] = { + "123": {"abc": "notalist"} + } + with set_locale("en"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("Replacement failed.: The type of the jsonld mapping " + "replacement rule is invalid."\ + in w for w in result_info["warnings"]) + with set_locale("ja"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("置換処理に失敗しました。: jsonldマッピングの置換ルール" + "の型が不正です。"\ + in w for w in result_info["warnings"]) + assert result_metadata == metadata + + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP"] = { + "123": [ + "pipe_full_width_normal", + "pipe_full_width_regex" + ] + } + with set_locale("en"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("Replacement failed.: Required replacement rule: " + "'pipe_full_width_regex' is missing."\ + in w for w in result_info["warnings"]) + assert result_metadata["key1"] == "ab|cd" + assert result_metadata["key2"] == "efg|hij" + + with set_locale("ja"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("置換処理に失敗しました。: 必要な置換ルール:" + "'pipe_full_width_regex'が見つかりません。"\ + in w for w in result_info["warnings"]) + + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULES"] = { + "rule_not_dict": "notadict", + "from_type_invalid": { + "from": [], + "to": "def", + "is_regex": False, + "target_path": ["key1"] + }, + "from_str_empty": { + "from": "", + "to": "abc", + "is_regex": False, + "target_path": ["key1"] + }, + "to_type_invalid": { + "from": "abc", + "to": {}, + "is_regex": False, + "target_path": ["key1"] + }, + "target_path_type_invalid": { + "from": "ghi", + "to": "klm", + "is_regex": False, + "target_path": "notalist" + }, + "pipe_full_width_regex": { + "from": r"\|", + "to": "|", + "is_regex": True, + "target_path": ["key2"] + } + } + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP"] = { + "123": [ + "rule_not_dict", + "from_type_invalid", + "from_str_empty", + "to_type_invalid", + "target_path_type_invalid", + "pipe_full_width_regex" + ] + } + + with set_locale("en"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("Replacement failed.: Replacement rule: " + "'rule_not_dict' is invalid."\ + in w for w in result_info["warnings"]) + assert any("Replacement failed.: Replacement rule: " + "'from_type_invalid' is invalid."\ + in w for w in result_info["warnings"]) + assert any("Replacement failed.: Replacement rule: " + "'from_str_empty' is invalid."\ + in w for w in result_info["warnings"]) + assert any("Replacement failed.: Replacement rule: " + "'to_type_invalid' is invalid."\ + in w for w in result_info["warnings"]) + assert any("Replacement failed.: Replacement rule: " + "'target_path_type_invalid' is invalid."\ + in w for w in result_info["warnings"]) + with set_locale("ja"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("置換処理に失敗しました。: 置換ルール: " + "'rule_not_dict'の設定が不正です。"\ + in w for w in result_info["warnings"]) + assert any("置換処理に失敗しました。: 置換ルール: " + "'from_type_invalid'の設定が不正です。"\ + in w for w in result_info["warnings"]) + assert any("置換処理に失敗しました。: 置換ルール: " + "'from_str_empty'の設定が不正です。"\ + in w for w in result_info["warnings"]) + assert any("置換処理に失敗しました。: 置換ルール: " + "'to_type_invalid'の設定が不正です。"\ + in w for w in result_info["warnings"]) + assert any("置換処理に失敗しました。: 置換ルール: " + "'target_path_type_invalid'の設定が不正です。"\ + in w for w in result_info["warnings"]) + assert result_metadata["key1"] == "ab|cd" + assert result_metadata["key2"] == "efg|hij" + + metadata["key3"] = "[abc" + + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULES"] = { + "is_regex_not_bool_false": { + "from": "|", + "to": "|", + "is_regex": "false", + "target_path": ["key1"] + }, + "is_regex_not_bool_true": { + "from": r"(\|)|(\\\|)", + "to": "\uFF5C", + "is_regex": "true", + "target_path": ["key2"] + }, + "invalid_regex": { + "from": "[", + "to": "「", + "is_regex": True, + "target_path": ["key3"] + } + } + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP"] = { + "123": [ + "is_regex_not_bool_false", + "is_regex_not_bool_true", + "invalid_regex" + ] + } + with set_locale("en"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("Replacement rule: 'is_regex_not_bool_false' - " + "'is_regex' is not boolean. Treated as False."\ + in w for w in result_info["warnings"]) + assert any("Replacement rule: 'is_regex_not_bool_true' - " + "'is_regex' is not boolean. Treated as False."\ + in w for w in result_info["warnings"]) + assert any("Replacement failed.: Replacement rule: " + "'invalid_regex' - regex error:"\ + in w for w in result_info["warnings"]) + with set_locale("ja"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("置換ルール: 'is_regex_not_bool_false' - 'is_regex' " + "が真偽値ではありません。Falseとして処理します。"\ + in w for w in result_info["warnings"]) + assert any("置換ルール: 'is_regex_not_bool_true' - 'is_regex' " + "が真偽値ではありません。Falseとして処理します。"\ + in w for w in result_info["warnings"]) + assert any("置換処理に失敗しました。: 置換ルール: 'invalid_regex' " + "- 正規表現エラー:"\ + in w for w in result_info["warnings"]) + assert result_metadata["key1"] == "ab|cd" + assert result_metadata["key2"] == "efg|hij" + assert result_metadata["key3"] == "[abc" + + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULES"] = { + "pipe_full_width_normal": { + "from": "|", + "to": "|", + "is_regex": False, + "target_path": ["key1"] + }, + "pipe_full_width_regex": { + "from": r"(\|)|(\\\|)", + "to": "|", + "is_regex": True, + "target_path": ["key2"] + } + } + app.config["WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP"] = { + "123": [ + "pipe_full_width_normal", + "pipe_full_width_regex" + ] + } + + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert result_metadata != metadata + assert result_metadata["key1"] == "ab|cd" + assert result_metadata["key2"] == "efg|hij" + assert result_info["warnings"] == [] + + metadata = None + with set_locale("en"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("Replacement failed.:"\ + in w for w in result_info["warnings"]) + with set_locale("ja"): + result_metadata, result_info = mapper.apply_import_replace_rules( + copy.deepcopy(metadata), copy.deepcopy(info)) + assert any("置換処理に失敗しました。:"\ + in w for w in result_info["warnings"]) + def test_set_by_jsonpath(): data = {} diff --git a/modules/weko-search-ui/tests/test_utils.py b/modules/weko-search-ui/tests/test_utils.py index d8209889c5..6c56d85d47 100644 --- a/modules/weko-search-ui/tests/test_utils.py +++ b/modules/weko-search-ui/tests/test_utils.py @@ -1064,14 +1064,17 @@ def test_handle_validate_item_import(app, mocker_itemtype, mocker): } list_record = [ - { + { "metadata": { 'item_xxx': { - 'subitem_yyy':[ + 'subitem_yyy':[ {"subitem_zzz": 123} ] } - } + }, + "warnings": [ + "existing_warning" + ] } ] with app.test_request_context(): @@ -1081,6 +1084,7 @@ def test_handle_validate_item_import(app, mocker_itemtype, mocker): target = list_record[0]["metadata"]['item_xxx']['subitem_yyy'][0]["subitem_zzz"] assert any("Replace value of" in w for w in warnings) assert any("is different from existing" in w for w in warnings) + assert any("existing_warning" in w for w in warnings) assert type(target) == str list_record[0]["metadata"]['item_xxx']['subitem_yyy'][0]["subitem_zzz"] = 456 @@ -1091,6 +1095,7 @@ def test_handle_validate_item_import(app, mocker_itemtype, mocker): warnings = result[0].get("warnings", []) assert any("へ置き換えました。" in w for w in warnings) assert any("と異なっています。" in w for w in warnings) + assert any("existing_warning" in w for w in warnings) schema = { "type": "object", @@ -1112,7 +1117,7 @@ def test_handle_validate_item_import(app, mocker_itemtype, mocker): } list_record = [ - { + { "metadata": { 'item_aaa': { 'subitem_bbb': { @@ -1126,7 +1131,7 @@ def test_handle_validate_item_import(app, mocker_itemtype, mocker): with set_locale("en"): result = handle_validate_item_import(list_record, schema) assert "errors" in result[0] - + with app.test_request_context(): with set_locale("ja"): result = handle_validate_item_import(list_record, schema) diff --git a/modules/weko-search-ui/weko_search_ui/config.py b/modules/weko-search-ui/weko_search_ui/config.py index 6869fca640..e5ba261208 100644 --- a/modules/weko-search-ui/weko_search_ui/config.py +++ b/modules/weko-search-ui/weko_search_ui/config.py @@ -757,6 +757,12 @@ WEKO_SEARCH_UI_BULK_EXPORT_RETRY_INTERVAL = 1 """ retry interval(sec) """ +WEKO_SEARCH_UI_IMPORT_REPLACE_RULES = {} +"""Strings to be replaced during item import.""" + +WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP = {} +"""Mapping of jsonld_mappings table 'id' to replacement rule keys.""" + CELERY_RESULT_PERSISTENT = True """ If set to True, result messages will be persistent. This means the messages will not be lost after a broker restart. The default is for the results to be transient.""" CELERY_TASK_TRACK_STARTED=True diff --git a/modules/weko-search-ui/weko_search_ui/mapper.py b/modules/weko-search-ui/weko_search_ui/mapper.py index bfa57ac489..ae7b50e4fd 100644 --- a/modules/weko-search-ui/weko_search_ui/mapper.py +++ b/modules/weko-search-ui/weko_search_ui/mapper.py @@ -25,6 +25,7 @@ from urllib.parse import urlparse from flask import current_app, url_for +from flask_babelex import lazy_gettext as _ from invenio_pidstore.models import PersistentIdentifier from weko_records.api import ( @@ -1380,6 +1381,114 @@ def find_similar_key(target_key, threshold=0.8): return errors if errors else None + def apply_import_replace_rules(self, metadata, info): + """ + Apply import replacement rules to metadata. + Args: + metadata (dict): Metadata to apply replacement rules to. + info (dict): System information dictionary to log warnings. + Returns: + metadata (dict): Metadata after applying replacement rules. + info (dict): Updated system information with warnings. + """ + warning_list = [] + try: + mapping_id = self.mapping_id + + rules = current_app.config.get( + "WEKO_SEARCH_UI_IMPORT_REPLACE_RULES", {}) + rule_map = current_app.config.get( + "WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP", {}) + if not ( + isinstance(rules, dict) and + isinstance(rule_map, dict) + ): + raise ValueError( + _("The type of the jsonld mapping replacement rule is invalid.")) + + rule_keys = rule_map.get(str(mapping_id), []) + if not isinstance(rule_keys, list): + raise ValueError( + _("The type of the jsonld mapping replacement rule is invalid.")) + + for rule_id in rule_keys: + if rule_id not in rules: + warning_list.append( + _("Required replacement rule: '%(rule_id)s' is missing.",\ + rule_id=rule_id)) + continue + + rule = rules.get(rule_id, None) + if not isinstance(rule, dict): + warning_list.append( + _("Replacement rule: '%(rule_id)s' is invalid.", + rule_id=rule_id)) + continue + + from_str = rule.get("from", None) + to_str = rule.get("to", None) + target_path_list = rule.get("target_path", []) + + if not( + isinstance(from_str, str) and + from_str != "" and + isinstance(to_str, str) and + isinstance(target_path_list, list) + ): + warning_list.append( + _("Replacement rule: '%(rule_id)s' is invalid.", + rule_id=rule_id)) + continue + + is_regex = rule.get("is_regex", False) + if not isinstance(is_regex, bool): + warning_list.append( + _("Replacement rule: '%(rule_id)s' - 'is_regex' is " + "not boolean. Treated as False.", + rule_id=rule_id)) + is_regex = False + + try: + for path_key in target_path_list: + for meta_key in list(metadata.keys()): + meta_key_no_index = re.sub(r'\[\d+\]', '', meta_key) + if meta_key_no_index == path_key: + metadata_value = metadata[meta_key] + if is_regex: + metadata[path_key] = \ + re.sub(from_str, lambda m: to_str, + metadata_value) + else: + metadata[path_key] = \ + metadata_value.replace(from_str, to_str) + except re.error as e: + warning_list.append(_("Replacement rule: '%(rule_id)s' - " + "regex error: %(error)s",\ + rule_id=rule_id, error=str(e))) + + if warning_list: + raise ValueError(warning_list) + return metadata, info + + except Exception as e: + info_warnings = info.get("warnings", []) + if isinstance(e, ValueError) and isinstance(e.args[0], list): + for warn in e.args[0]: + if 'is_regex' in warn: + warning_message = str(warn) + else: + warning_message = str(_( + "Replacement failed.: %(warn)s", warn=warn)) + current_app.logger.warning(warning_message) + info_warnings.append(warning_message) + else: + warning_message = str(_( + "Replacement failed.: %(warning)s", warning=e)) + current_app.logger.warning(warning_message) + info_warnings.append(warning_message) + info["warnings"] = info_warnings + return metadata, info + def to_item_metadata(self, json_ld): """Map to item type metadata. @@ -1458,6 +1567,10 @@ def is_url(s: str) -> bool: "warnings": [], } + # Execute replacement process for metadata + metadata, system_info = \ + self.apply_import_replace_rules(metadata, system_info) + missing_metadata = {} from flask_babelex import gettext as _ @@ -1733,6 +1846,8 @@ def _resolve_link(value): ] system_info["save_as_is"] = extracted.get("wk:saveAsIs", False) system_info["metadata_replace"] = extracted.get("wk:metadataReplace", False) + system_info["researchmap_linkage"] = extracted.get( + "wk:researchmapLinkage", False) for relation in extracted.get("jpcoar:relation", []): relation_id = relation.get("jpcoar:relatedIdentifier") or {} @@ -2426,6 +2541,9 @@ def dereference(keys, initial_entity=None): # wk:metadaAutoFill rocrate.root_dataset["wk:metadataAutoFill"] = False + # wk:researchmapLinkage + rocrate.root_dataset["wk:researchmapLinkage"] = False + return rocrate diff --git a/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.mo b/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.mo index cb7fc7ab93..ff1d43ed50 100644 Binary files a/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.mo and b/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.mo differ diff --git a/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.po b/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.po index 5a50d17255..2bbefe282a 100644 --- a/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.po +++ b/modules/weko-search-ui/weko_search_ui/translations/en/LC_MESSAGES/messages.po @@ -1,15 +1,15 @@ # English translations for weko-search-ui. -# Copyright (C) 2025 National Institute of Informatics +# Copyright (C) 2026 National Institute of Informatics # This file is distributed under the same license as the weko-search-ui # project. -# FIRST AUTHOR , 2025. +# FIRST AUTHOR , 2026. # msgid "" msgstr "" "Project-Id-Version: weko-search-ui 0.1.0.dev20170000\n" "Report-Msgid-Bugs-To: wekosoftware@nii.ac.jp\n" -"POT-Creation-Date: 2025-12-17 13:33+0900\n" -"PO-Revision-Date: 2025-04-09 23:22+0900\n" +"POT-Creation-Date: 2026-02-16 09:37+0900\n" +"PO-Revision-Date: 2026-02-10 17:21+0900\n" "Last-Translator: FULL NAME \n" "Language: en\n" "Language-Team: en \n" @@ -215,44 +215,78 @@ msgstr "" msgid "Import Result" msgstr "" -#: weko_search_ui/mapper.py:1351 +#: weko_search_ui/mapper.py:1352 msgid "\"{key}\" is required." msgstr "" -#: weko_search_ui/mapper.py:1372 -#, python-brace-format +#: weko_search_ui/mapper.py:1373 msgid "\"{key}\" is not in itemtype." msgstr "" -#: weko_search_ui/mapper.py:1374 -#, python-brace-format +#: weko_search_ui/mapper.py:1375 msgid "\"{key}\" is not in itemtype, did you mean \"{similar_key}\"?" msgstr "" -#: weko_search_ui/mapper.py:1495 +#: weko_search_ui/mapper.py:1404 weko_search_ui/mapper.py:1408 +msgid "The type of the jsonld mapping replacement rule is invalid." +msgstr "" + +#: weko_search_ui/mapper.py:1412 +#, python-format +msgid "Required replacement rule: '%(rule_id)s' is missing." +msgstr "" + +#: weko_search_ui/mapper.py:1418 weko_search_ui/mapper.py:1431 +#, python-format +msgid "Replacement rule: '%(rule_id)s' is invalid." +msgstr "" + +#: weko_search_ui/mapper.py:1437 +#, python-format +msgid "" +"Replacement rule: '%(rule_id)s' - 'is_regex' is not boolean. Treated as " +"False." +msgstr "" + +#: weko_search_ui/mapper.py:1451 +#, python-format +msgid "Replacement rule: '%(rule_id)s' - regex error: %(error)s" +msgstr "" + +#: weko_search_ui/mapper.py:1466 +#, python-format +msgid "Replacement failed.: %(warn)s" +msgstr "" + +#: weko_search_ui/mapper.py:1470 +#, python-format +msgid "Replacement failed.: %(warning)s" +msgstr "" + +#: weko_search_ui/mapper.py:1591 #, python-format msgid "" "Cannot map to item type from json-ld; Mapping is not defined for the " "metadata, \"%(key)s\": \"%(value)s\"" msgstr "" -#: weko_search_ui/mapper.py:1521 +#: weko_search_ui/mapper.py:1617 #, python-format msgid "" "Cannot map to item type from json-ld; Not found mapping destination for " "the metadata, \"%(key)s\": \"%(value)s\"" msgstr "" -#: weko_search_ui/mapper.py:1531 +#: weko_search_ui/mapper.py:1627 #, python-format msgid "Failed to set metadata for json-ld, \"%(key)s\": \"%(value)s\"" msgstr "" -#: weko_search_ui/mapper.py:1553 +#: weko_search_ui/mapper.py:1649 msgid "Metadata which could not be mapped to item type will be set in 'Extra'." msgstr "" -#: weko_search_ui/mapper.py:1557 +#: weko_search_ui/mapper.py:1653 msgid "Metadata which could not be mapped to item type will be discarded." msgstr "" @@ -271,7 +305,6 @@ msgid "" msgstr "" #: weko_search_ui/utils.py:615 -#, python-brace-format msgid "" "The csv/tsv file was not found in the specified file {}. Check if the " "directory structure is correct." @@ -284,7 +317,6 @@ msgid "" msgstr "" #: weko_search_ui/utils.py:731 -#, python-brace-format msgid "" "The xml file was not found in the specified file {}. Check if the " "directory structure is correct." @@ -294,333 +326,327 @@ msgstr "" msgid "The item type ID specified in the XML file does not exist." msgstr "" -#: weko_search_ui/utils.py:991 +#: weko_search_ui/utils.py:992 msgid "" "The format of the specified file {} dose not support import. Please " "specify a zip file." msgstr "" -#: weko_search_ui/utils.py:1012 +#: weko_search_ui/utils.py:1013 msgid "Failred to decode JSON-LD file: " msgstr "" -#: weko_search_ui/utils.py:1015 +#: weko_search_ui/utils.py:1016 msgid "Unexpected error occurred: " msgstr "" -#: weko_search_ui/utils.py:1225 +#: weko_search_ui/utils.py:1226 msgid "" "There is an error in the format of the first line of the header of the {}" " file." msgstr "" -#: weko_search_ui/utils.py:1244 -#, python-brace-format +#: weko_search_ui/utils.py:1245 msgid "The item type ID specified in the {} file does not exist." msgstr "" -#: weko_search_ui/utils.py:1253 +#: weko_search_ui/utils.py:1254 msgid "Cannot register because the specified item type is not the latest version." msgstr "" -#: weko_search_ui/utils.py:1268 -#, python-brace-format +#: weko_search_ui/utils.py:1269 msgid "The following metadata keys are duplicated.
{}" msgstr "" -#: weko_search_ui/utils.py:1289 -#, python-brace-format +#: weko_search_ui/utils.py:1290 msgid "The item does not consistent with the specified item type.
{}" msgstr "" -#: weko_search_ui/utils.py:1317 -#, python-brace-format +#: weko_search_ui/utils.py:1318 msgid "Cannot read {} file correctly." msgstr "" -#: weko_search_ui/utils.py:1341 -#, python-brace-format +#: weko_search_ui/utils.py:1342 msgid "" "The following items are not registered because they do not exist in the " "specified item type. {}" msgstr "" -#: weko_search_ui/utils.py:1351 -#, python-brace-format +#: weko_search_ui/utils.py:1352 msgid "" "The {} file could not be read. Make sure the file format is {} and that " "the file is UTF-8 encoded." msgstr "" -#: weko_search_ui/utils.py:1382 +#: weko_search_ui/utils.py:1383 msgid "" "The XML file could not be read. Make sure the file format is XML and that" " the file is UTF-8 encoded." msgstr "" -#: weko_search_ui/utils.py:1455 +#: weko_search_ui/utils.py:1456 msgid "Please specify item ID by half-width number." msgstr "" -#: weko_search_ui/utils.py:1477 +#: weko_search_ui/utils.py:1478 #, python-format msgid "Replace value of %(target_path)s from %(old_value)s to '%(new_value)s'." msgstr "" -#: weko_search_ui/utils.py:1489 +#: weko_search_ui/utils.py:1490 msgid "Specified item type does not exist." msgstr "" -#: weko_search_ui/utils.py:1495 +#: weko_search_ui/utils.py:1496 #, python-format msgid "Specified %(type)s is different from existing %(existing_type)s." msgstr "" -#: weko_search_ui/utils.py:1567 +#: weko_search_ui/utils.py:1568 msgid "The same item may have been registered." msgstr "" -#: weko_search_ui/utils.py:1597 +#: weko_search_ui/utils.py:1598 msgid "Specified URI and system URI do not match." msgstr "" -#: weko_search_ui/utils.py:1609 +#: weko_search_ui/utils.py:1610 msgid "Item does not exist in the system." msgstr "" -#: weko_search_ui/utils.py:1616 +#: weko_search_ui/utils.py:1617 msgid "Item already DELETED in the system." msgstr "" -#: weko_search_ui/utils.py:1633 +#: weko_search_ui/utils.py:1634 msgid "Please specify either \"Keep\" or \"Upgrade\"." msgstr "" -#: weko_search_ui/utils.py:2592 +#: weko_search_ui/utils.py:2593 msgid "Title is required item." msgstr "" -#: weko_search_ui/utils.py:2609 +#: weko_search_ui/utils.py:2610 msgid "{} is required item." msgstr "" -#: weko_search_ui/utils.py:2612 +#: weko_search_ui/utils.py:2613 msgid "Please set \"public\" or \"private\" for {}." msgstr "" -#: weko_search_ui/utils.py:2653 +#: weko_search_ui/utils.py:2654 msgid "The specified {} does not exist in system." msgstr "" -#: weko_search_ui/utils.py:2663 +#: weko_search_ui/utils.py:2664 msgid "Specified {} does not match with existing index." msgstr "" -#: weko_search_ui/utils.py:2707 +#: weko_search_ui/utils.py:2708 msgid "Your role cannot register items in this index." msgstr "" -#: weko_search_ui/utils.py:2728 +#: weko_search_ui/utils.py:2729 msgid "Both of IndexID and POS_INDEX are not being set." msgstr "" -#: weko_search_ui/utils.py:2774 weko_search_ui/utils.py:2799 +#: weko_search_ui/utils.py:2775 weko_search_ui/utils.py:2800 msgid "Specified {} is invalid." msgstr "" -#: weko_search_ui/utils.py:2833 +#: weko_search_ui/utils.py:2834 msgid "If there is a info of content file, terms of use cannot be set." msgstr "If there is a info of content file, terms of use cannot be set." -#: weko_search_ui/utils.py:2840 weko_search_ui/utils.py:6090 +#: weko_search_ui/utils.py:2841 weko_search_ui/utils.py:6091 msgid "The specified provinding method does not exist in the system" msgstr "" -#: weko_search_ui/utils.py:2845 weko_search_ui/utils.py:6085 +#: weko_search_ui/utils.py:2846 weko_search_ui/utils.py:6086 msgid "The specified terms does not exist in the system" msgstr "" -#: weko_search_ui/utils.py:2937 weko_search_ui/utils.py:2970 -#: weko_search_ui/utils.py:3062 weko_search_ui/utils.py:3174 -#: weko_search_ui/utils.py:3196 weko_search_ui/utils.py:3231 +#: weko_search_ui/utils.py:2938 weko_search_ui/utils.py:2971 +#: weko_search_ui/utils.py:3063 weko_search_ui/utils.py:3175 +#: weko_search_ui/utils.py:3197 weko_search_ui/utils.py:3232 msgid "Please specify {}." msgstr "" -#: weko_search_ui/utils.py:2940 weko_search_ui/utils.py:3177 +#: weko_search_ui/utils.py:2941 weko_search_ui/utils.py:3178 msgid "The specified {} exceeds the maximum length." msgstr "" -#: weko_search_ui/utils.py:2955 weko_search_ui/utils.py:3112 -#: weko_search_ui/utils.py:3123 weko_search_ui/utils.py:3192 +#: weko_search_ui/utils.py:2956 weko_search_ui/utils.py:3113 +#: weko_search_ui/utils.py:3124 weko_search_ui/utils.py:3193 msgid "Specified Prefix of {} is incorrect." msgstr "" -#: weko_search_ui/utils.py:2963 weko_search_ui/utils.py:3106 -#: weko_search_ui/utils.py:3116 +#: weko_search_ui/utils.py:2964 weko_search_ui/utils.py:3107 +#: weko_search_ui/utils.py:3117 msgid "{} cannot be set." msgstr "" -#: weko_search_ui/utils.py:2972 weko_search_ui/utils.py:2976 -#: weko_search_ui/utils.py:3045 weko_search_ui/utils.py:3233 +#: weko_search_ui/utils.py:2973 weko_search_ui/utils.py:2977 +#: weko_search_ui/utils.py:3046 weko_search_ui/utils.py:3234 msgid "Specified {} is different from existing {}." msgstr "" -#: weko_search_ui/utils.py:2996 +#: weko_search_ui/utils.py:2997 msgid "" "When assigning a DOI to an item, it must be associated with an index " "whose index status is \"Public\" and Harvest Publishing is \"Public\"." msgstr "" -#: weko_search_ui/utils.py:3001 +#: weko_search_ui/utils.py:3002 msgid "" "Since the item has a DOI, it must be associated with an index whose index" " status is \"Public\" and whose Harvest Publishing is \"Public\"." msgstr "" -#: weko_search_ui/utils.py:3012 +#: weko_search_ui/utils.py:3013 msgid "You cannot keep an item private because it has a DOI." msgstr "" -#: weko_search_ui/utils.py:3066 weko_search_ui/utils.py:4362 +#: weko_search_ui/utils.py:3067 weko_search_ui/utils.py:4363 msgid "DOI_RA should be set by one of JaLC, Crossref, DataCite, NDL JaLC." msgstr "" -#: weko_search_ui/utils.py:3149 +#: weko_search_ui/utils.py:3150 msgid "Specified DOI was withdrawn. Please specify another DOI." msgstr "" -#: weko_search_ui/utils.py:3157 +#: weko_search_ui/utils.py:3158 msgid "" "Specified DOI has been used already for another item. Please specify " "another DOI." msgstr "" -#: weko_search_ui/utils.py:3253 +#: weko_search_ui/utils.py:3254 msgid "" "Specified DOI is duplicated with another import item. Please specify " "another DOI." msgstr "" -#: weko_search_ui/utils.py:3286 +#: weko_search_ui/utils.py:3287 msgid "Item Link type: '{}' is not one of {}." msgstr "" -#: weko_search_ui/utils.py:3290 +#: weko_search_ui/utils.py:3291 msgid "Please specify Item URL for item link." msgstr "" -#: weko_search_ui/utils.py:3304 +#: weko_search_ui/utils.py:3305 msgid "Specified Item Link URI and system URI do not match." msgstr "" -#: weko_search_ui/utils.py:3310 +#: weko_search_ui/utils.py:3311 msgid "Linking item does not exist in the system." msgstr "" -#: weko_search_ui/utils.py:3313 +#: weko_search_ui/utils.py:3314 msgid "Linking item already deleted in the system." msgstr "" -#: weko_search_ui/utils.py:3352 +#: weko_search_ui/utils.py:3353 msgid "It is not allowed to create links to the item itself." msgstr "" -#: weko_search_ui/utils.py:3357 +#: weko_search_ui/utils.py:3358 msgid "It is not allowed to create links other than {} between split items." msgstr "" -#: weko_search_ui/utils.py:3393 +#: weko_search_ui/utils.py:3394 msgid "Duplicate Item Link." msgstr "" -#: weko_search_ui/utils.py:3430 +#: weko_search_ui/utils.py:3431 msgid "'wk:metadataReplace' flag cannot be used when registering an item." msgstr "" -#: weko_search_ui/utils.py:3747 +#: weko_search_ui/utils.py:3748 msgid "" "One of the following required values ​​has not been " "registered.
{}
" msgstr "" -#: weko_search_ui/utils.py:3752 +#: weko_search_ui/utils.py:3753 msgid "" "The mapping of required items for DOI validation is not set. Please " "recheck the following mapping settings.
{}" msgstr "" -#: weko_search_ui/utils.py:3762 +#: weko_search_ui/utils.py:3763 msgid "The following metadata are required.
{}" msgstr "" -#: weko_search_ui/utils.py:3767 +#: weko_search_ui/utils.py:3768 msgid "One of the following metadata is required.
{}
" msgstr "" -#: weko_search_ui/utils.py:3830 weko_search_ui/utils.py:3842 +#: weko_search_ui/utils.py:3831 weko_search_ui/utils.py:3843 msgid "Please specify the date with any format of YYYY-MM-DD, YYYY-MM, YYYY." msgstr "" -#: weko_search_ui/utils.py:3836 +#: weko_search_ui/utils.py:3837 msgid "Replace value of {} from {} to {}." msgstr "" -#: weko_search_ui/utils.py:3859 +#: weko_search_ui/utils.py:3860 msgid "Please specify PubDate with YYYY-MM-DD." msgstr "" -#: weko_search_ui/utils.py:3889 +#: weko_search_ui/utils.py:3890 msgid "ID is specified for the newly registered item. Ignore the ID and register." msgstr "" -#: weko_search_ui/utils.py:3972 +#: weko_search_ui/utils.py:3973 msgid "Please specify Open Access Date with YYYY-MM-DD." msgstr "" -#: weko_search_ui/utils.py:4199 weko_search_ui/utils.py:4347 -#: weko_search_ui/utils.py:4353 +#: weko_search_ui/utils.py:4200 weko_search_ui/utils.py:4348 +#: weko_search_ui/utils.py:4354 msgid "Please specify DOI prefix/suffix." msgstr "" -#: weko_search_ui/utils.py:4339 +#: weko_search_ui/utils.py:4340 msgid "The specified DOI is wrong and fixed with the registered DOI." msgstr "" -#: weko_search_ui/utils.py:4342 +#: weko_search_ui/utils.py:4343 msgid "" "The specified DOI RA is wrong and fixed with the correct DOI RA of the " "registered DOI." msgstr "" -#: weko_search_ui/utils.py:4349 weko_search_ui/utils.py:4355 +#: weko_search_ui/utils.py:4350 weko_search_ui/utils.py:4356 msgid "Please specify DOI suffix." msgstr "" -#: weko_search_ui/utils.py:4358 +#: weko_search_ui/utils.py:4359 msgid "Do not specify DOI suffix." msgstr "" -#: weko_search_ui/utils.py:4364 +#: weko_search_ui/utils.py:4365 msgid "Specified Prefix of DOI is incorrect." msgstr "" -#: weko_search_ui/utils.py:4396 +#: weko_search_ui/utils.py:4397 msgid "" "Please specify the image file(gif, jpg, jpe, jpeg, png, bmp, tiff, tif) " "for the thumbnail." msgstr "" -#: weko_search_ui/utils.py:5517 +#: weko_search_ui/utils.py:5518 msgid "The file specified in ({}) does not exist." msgstr "" -#: weko_search_ui/utils.py:5521 +#: weko_search_ui/utils.py:5522 msgid "" "The file specified in ({}) does not exist.
The file will not be " "updated. Update only the metadata with csv/tsv contents." msgstr "" -#: weko_search_ui/utils.py:5808 +#: weko_search_ui/utils.py:5809 msgid "The file name specified in {} and {} do not match." msgstr "" @@ -820,31 +846,31 @@ msgstr "Set the correct value." msgid "facet slider correlation validation" msgstr "The range from should be less than or equal to the range to." -#: weko_search_ui/templates/weko_search_ui/search.html:99 +#: weko_search_ui/templates/weko_search_ui/search.html:101 msgid "Chinese" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:100 +#: weko_search_ui/templates/weko_search_ui/search.html:102 msgid "English" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:101 +#: weko_search_ui/templates/weko_search_ui/search.html:103 msgid "French" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:102 +#: weko_search_ui/templates/weko_search_ui/search.html:104 msgid "German" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:103 +#: weko_search_ui/templates/weko_search_ui/search.html:105 msgid "Japanese" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:104 +#: weko_search_ui/templates/weko_search_ui/search.html:106 msgid "Korean" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:105 +#: weko_search_ui/templates/weko_search_ui/search.html:107 msgid "Russian" msgstr "" @@ -1201,51 +1227,3 @@ msgstr "" msgid "Failed to get mapping list." msgstr "" -#~ msgid "Bagging a parent of the current directory is not supported" -#~ msgstr "" - -#~ msgid "Creating tag for directory %s" -#~ msgstr "" - -#~ msgid "Bag directory %s does not exist" -#~ msgstr "" - -#~ msgid "Bag directory %s does not contain a data directory" -#~ msgstr "" - -#~ msgid "" -#~ "Unable to write to the following directories and files:\n" -#~ "%s" -#~ msgstr "" - -#~ msgid "Missing permissions to move all files and directories" -#~ msgstr "" - -#~ msgid "" -#~ "The following directories do not have read permissions:\n" -#~ "%s" -#~ msgstr "" - -#~ msgid "" -#~ "The following files do not have read permissions:\n" -#~ "%s" -#~ msgstr "" - -#~ msgid "Read permissions are required to calculate file fixities" -#~ msgstr "" - -#~ msgid "Creating data directory" -#~ msgstr "" - -#~ msgid "Creating bagit.txt" -#~ msgstr "" - -#~ msgid "Creating bag-info.txt" -#~ msgstr "" - -#~ msgid "An error occurred creating a bag in %s" -#~ msgstr "" - -#~ msgid "`wk:metadata_replace` flag cannot be used in RO-Crate Import." -#~ msgstr "" - diff --git a/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.mo b/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.mo index 1c69f06441..f844bad163 100644 Binary files a/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.mo and b/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.mo differ diff --git a/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.po b/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.po index 4a7b646a60..ac349106ea 100644 --- a/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.po +++ b/modules/weko-search-ui/weko_search_ui/translations/ja/LC_MESSAGES/messages.po @@ -1,15 +1,15 @@ # Japanese translations for weko-search-ui. -# Copyright (C) 2025 National Institute of Informatics +# Copyright (C) 2026 National Institute of Informatics # This file is distributed under the same license as the weko-search-ui # project. -# FIRST AUTHOR , 2025. +# FIRST AUTHOR , 2026. # msgid "" msgstr "" "Project-Id-Version: weko-search-ui 0.1.0.dev20170000\n" "Report-Msgid-Bugs-To: wekosoftware@nii.ac.jp\n" -"POT-Creation-Date: 2025-12-17 13:33+0900\n" -"PO-Revision-Date: 2025-04-09 22:35+0900\n" +"POT-Creation-Date: 2026-02-16 09:37+0900\n" +"PO-Revision-Date: 2026-02-10 17:21+0900\n" "Last-Translator: FULL NAME \n" "Language: ja\n" "Language-Team: ja \n" @@ -215,42 +215,78 @@ msgstr "ステータス" msgid "Import Result" msgstr "インポート結果" -#: weko_search_ui/mapper.py:1351 +#: weko_search_ui/mapper.py:1352 msgid "\"{key}\" is required." msgstr "「{key}」 に対応するマッピングが必要です。" -#: weko_search_ui/mapper.py:1372 +#: weko_search_ui/mapper.py:1373 msgid "\"{key}\" is not in itemtype." msgstr "「{key}」 はアイテムタイプに存在しません。" -#: weko_search_ui/mapper.py:1374 +#: weko_search_ui/mapper.py:1375 msgid "\"{key}\" is not in itemtype, did you mean \"{similar_key}\"?" msgstr "「{key}」 はアイテムタイプに存在しません。「{similar_key}」であれば存在します。" -#: weko_search_ui/mapper.py:1495 +#: weko_search_ui/mapper.py:1404 weko_search_ui/mapper.py:1408 +msgid "The type of the jsonld mapping replacement rule is invalid." +msgstr "jsonldマッピングの置換ルールの型が不正です。" + +#: weko_search_ui/mapper.py:1412 +#, python-format +msgid "Required replacement rule: '%(rule_id)s' is missing." +msgstr "必要な置換ルール:'%(rule_id)s'が見つかりません。" + +#: weko_search_ui/mapper.py:1418 weko_search_ui/mapper.py:1431 +#, python-format +msgid "Replacement rule: '%(rule_id)s' is invalid." +msgstr "置換ルール: '%(rule_id)s'の設定が不正です。" + +#: weko_search_ui/mapper.py:1437 +#, python-format +msgid "" +"Replacement rule: '%(rule_id)s' - 'is_regex' is not boolean. Treated as " +"False." +msgstr "置換ルール: '%(rule_id)s' - 'is_regex' が真偽値ではありません。Falseとして処理します。" + +#: weko_search_ui/mapper.py:1451 +#, python-format +msgid "Replacement rule: '%(rule_id)s' - regex error: %(error)s" +msgstr "置換ルール: '%(rule_id)s' - 正規表現エラー: %(error)s" + +#: weko_search_ui/mapper.py:1466 +#, python-format +msgid "Replacement failed.: %(warn)s" +msgstr "置換処理に失敗しました。: %(warn)s" + +#: weko_search_ui/mapper.py:1470 +#, python-format +msgid "Replacement failed.: %(warning)s" +msgstr "置換処理に失敗しました。: %(warning)s" + +#: weko_search_ui/mapper.py:1591 #, python-format msgid "" "Cannot map to item type from json-ld; Mapping is not defined for the " "metadata, \"%(key)s\": \"%(value)s\"" msgstr "対応するマッピングが定義されてないため、このメタデータはアイテムタイプに変換できません。\"%(key)s\": \"%(value)s\"" -#: weko_search_ui/mapper.py:1521 +#: weko_search_ui/mapper.py:1617 #, python-format msgid "" "Cannot map to item type from json-ld; Not found mapping destination for " "the metadata, \"%(key)s\": \"%(value)s\"" msgstr "マッピング先が見つからないため、このメタデータはアイテムタイプに変換できません。\"%(key)s\": \"%(value)s\"" -#: weko_search_ui/mapper.py:1531 +#: weko_search_ui/mapper.py:1627 #, python-format msgid "Failed to set metadata for json-ld, \"%(key)s\": \"%(value)s\"" msgstr "アイテムタイプへのマッピングに失敗しました。\"%(key)s\": \"%(value)s\"" -#: weko_search_ui/mapper.py:1553 +#: weko_search_ui/mapper.py:1649 msgid "Metadata which could not be mapped to item type will be set in 'Extra'." msgstr "アイテムタイプにマッピングできなかったメタデータは、「Extra」プロパティに登録されます。" -#: weko_search_ui/mapper.py:1557 +#: weko_search_ui/mapper.py:1653 msgid "Metadata which could not be mapped to item type will be discarded." msgstr "アイテムタイプにマッピングできなかったメタデータは破棄されます。" @@ -290,327 +326,327 @@ msgstr "" msgid "The item type ID specified in the XML file does not exist." msgstr "" -#: weko_search_ui/utils.py:991 +#: weko_search_ui/utils.py:992 msgid "" "The format of the specified file {} dose not support import. Please " "specify a zip file." msgstr "指定されたファイル{}の形式はインポートに対応していません。zip形式のファイルを指定してください。" -#: weko_search_ui/utils.py:1012 +#: weko_search_ui/utils.py:1013 msgid "Failred to decode JSON-LD file: " msgstr "JSONファイルのデコードに失敗しました。 " -#: weko_search_ui/utils.py:1015 +#: weko_search_ui/utils.py:1016 msgid "Unexpected error occurred: " msgstr "予期しないエラーが発生しました。 " -#: weko_search_ui/utils.py:1225 +#: weko_search_ui/utils.py:1226 msgid "" "There is an error in the format of the first line of the header of the {}" " file." msgstr "{}ファイルのヘッダ1行目の形式に誤りがあります。" -#: weko_search_ui/utils.py:1244 +#: weko_search_ui/utils.py:1245 msgid "The item type ID specified in the {} file does not exist." msgstr "{}ファイルで指定されたアイテムタイプIDは存在しません。" -#: weko_search_ui/utils.py:1253 +#: weko_search_ui/utils.py:1254 msgid "Cannot register because the specified item type is not the latest version." msgstr "指定されたアイテムタイプが最新のバージョンでないため登録できません。" -#: weko_search_ui/utils.py:1268 +#: weko_search_ui/utils.py:1269 msgid "The following metadata keys are duplicated.
{}" msgstr "以下のメタデータキーが重複しています。
{}" -#: weko_search_ui/utils.py:1289 +#: weko_search_ui/utils.py:1290 msgid "The item does not consistent with the specified item type.
{}" msgstr "指定されたアイテムタイプと項目が一致しません。
{}" -#: weko_search_ui/utils.py:1317 +#: weko_search_ui/utils.py:1318 msgid "Cannot read {} file correctly." msgstr "{}ファイルが正しく読み込めません。" -#: weko_search_ui/utils.py:1341 +#: weko_search_ui/utils.py:1342 msgid "" "The following items are not registered because they do not exist in the " "specified item type. {}" msgstr "次の項目指定されたアイテムタイプに存在しないため登録されません。{}" -#: weko_search_ui/utils.py:1351 +#: weko_search_ui/utils.py:1352 msgid "" "The {} file could not be read. Make sure the file format is {} and that " "the file is UTF-8 encoded." msgstr "{}ファイルを読み込めませんでした。ファイル形式が{}であること、またそのファイルがUTF-8でエンコードされているかを確認してください。" -#: weko_search_ui/utils.py:1382 +#: weko_search_ui/utils.py:1383 msgid "" "The XML file could not be read. Make sure the file format is XML and that" " the file is UTF-8 encoded." msgstr "" -#: weko_search_ui/utils.py:1455 +#: weko_search_ui/utils.py:1456 msgid "Please specify item ID by half-width number." msgstr "アイテムIDは半角数字で指定してください。" -#: weko_search_ui/utils.py:1477 +#: weko_search_ui/utils.py:1478 #, python-format msgid "Replace value of %(target_path)s from %(old_value)s to '%(new_value)s'." msgstr "%(target_path)sの値を%(old_value)sから'%(new_value)s'へ置き換えました。" -#: weko_search_ui/utils.py:1489 +#: weko_search_ui/utils.py:1490 msgid "Specified item type does not exist." msgstr "指定されたアイテムタイプが存在していません。" -#: weko_search_ui/utils.py:1495 -#, python-brace-format, python-format +#: weko_search_ui/utils.py:1496 +#, python-format msgid "Specified %(type)s is different from existing %(existing_type)s." msgstr "指定された%(type)sは登録している%(existing_type)sと異なっています。" -#: weko_search_ui/utils.py:1567 +#: weko_search_ui/utils.py:1568 msgid "The same item may have been registered." msgstr "同じアイテムが登録されている可能性があります。" -#: weko_search_ui/utils.py:1597 +#: weko_search_ui/utils.py:1598 msgid "Specified URI and system URI do not match." msgstr "指定されたURIとシステムURIが一致しません。" -#: weko_search_ui/utils.py:1609 +#: weko_search_ui/utils.py:1610 msgid "Item does not exist in the system." msgstr "アイテムがシステムに存在しません。" -#: weko_search_ui/utils.py:1616 +#: weko_search_ui/utils.py:1617 msgid "Item already DELETED in the system." msgstr "アイテムは削除済です。" -#: weko_search_ui/utils.py:1633 +#: weko_search_ui/utils.py:1634 msgid "Please specify either \"Keep\" or \"Upgrade\"." msgstr "Keep、Upgradeのいずれかを指定してください。" -#: weko_search_ui/utils.py:2592 +#: weko_search_ui/utils.py:2593 msgid "Title is required item." msgstr "タイトルは必須項目です。" -#: weko_search_ui/utils.py:2609 +#: weko_search_ui/utils.py:2610 msgid "{} is required item." msgstr "{}は必須項目です。" -#: weko_search_ui/utils.py:2612 +#: weko_search_ui/utils.py:2613 msgid "Please set \"public\" or \"private\" for {}." msgstr "{}はpublic、privateのいずれかを設定してください。" -#: weko_search_ui/utils.py:2653 +#: weko_search_ui/utils.py:2654 msgid "The specified {} does not exist in system." msgstr "指定された{}はシステムに存在しません。" -#: weko_search_ui/utils.py:2663 +#: weko_search_ui/utils.py:2664 msgid "Specified {} does not match with existing index." msgstr "指定された{}はシステムのものと一致していません。" -#: weko_search_ui/utils.py:2707 +#: weko_search_ui/utils.py:2708 msgid "Your role cannot register items in this index." msgstr "ロールの権限が足りずこのインデックスにアイテム登録ができません。" -#: weko_search_ui/utils.py:2728 +#: weko_search_ui/utils.py:2729 msgid "Both of IndexID and POS_INDEX are not being set." msgstr "IndexID, POS_INDEXがどちらも設定されていません。" -#: weko_search_ui/utils.py:2774 weko_search_ui/utils.py:2799 +#: weko_search_ui/utils.py:2775 weko_search_ui/utils.py:2800 msgid "Specified {} is invalid." msgstr "指定された{}は不正です。" -#: weko_search_ui/utils.py:2833 +#: weko_search_ui/utils.py:2834 msgid "If there is a info of content file, terms of use cannot be set." msgstr "コンテンツファイル情報がある場合、利用規約は設定できません。" -#: weko_search_ui/utils.py:2840 weko_search_ui/utils.py:6090 +#: weko_search_ui/utils.py:2841 weko_search_ui/utils.py:6091 msgid "The specified provinding method does not exist in the system" msgstr "指定する提供方法はシステムに存在しません。" -#: weko_search_ui/utils.py:2845 weko_search_ui/utils.py:6085 +#: weko_search_ui/utils.py:2846 weko_search_ui/utils.py:6086 msgid "The specified terms does not exist in the system" msgstr "指定する利用規約はシステムに存在しません。" -#: weko_search_ui/utils.py:2937 weko_search_ui/utils.py:2970 -#: weko_search_ui/utils.py:3062 weko_search_ui/utils.py:3174 -#: weko_search_ui/utils.py:3196 weko_search_ui/utils.py:3231 +#: weko_search_ui/utils.py:2938 weko_search_ui/utils.py:2971 +#: weko_search_ui/utils.py:3063 weko_search_ui/utils.py:3175 +#: weko_search_ui/utils.py:3197 weko_search_ui/utils.py:3232 msgid "Please specify {}." msgstr "{}を設定してください。" -#: weko_search_ui/utils.py:2940 weko_search_ui/utils.py:3177 +#: weko_search_ui/utils.py:2941 weko_search_ui/utils.py:3178 msgid "The specified {} exceeds the maximum length." msgstr "指定された{}が最大長を超えています。" -#: weko_search_ui/utils.py:2955 weko_search_ui/utils.py:3112 -#: weko_search_ui/utils.py:3123 weko_search_ui/utils.py:3192 +#: weko_search_ui/utils.py:2956 weko_search_ui/utils.py:3113 +#: weko_search_ui/utils.py:3124 weko_search_ui/utils.py:3193 msgid "Specified Prefix of {} is incorrect." msgstr "指定された{}のPrefixが誤っています。" -#: weko_search_ui/utils.py:2963 weko_search_ui/utils.py:3106 -#: weko_search_ui/utils.py:3116 +#: weko_search_ui/utils.py:2964 weko_search_ui/utils.py:3107 +#: weko_search_ui/utils.py:3117 msgid "{} cannot be set." msgstr "{}は設定できません。" -#: weko_search_ui/utils.py:2972 weko_search_ui/utils.py:2976 -#: weko_search_ui/utils.py:3045 weko_search_ui/utils.py:3233 +#: weko_search_ui/utils.py:2973 weko_search_ui/utils.py:2977 +#: weko_search_ui/utils.py:3046 weko_search_ui/utils.py:3234 msgid "Specified {} is different from existing {}." msgstr "指定された{}は登録している{}と異なっています。" -#: weko_search_ui/utils.py:2996 +#: weko_search_ui/utils.py:2997 msgid "" "When assigning a DOI to an item, it must be associated with an index " "whose index status is \"Public\" and Harvest Publishing is \"Public\"." msgstr "" -#: weko_search_ui/utils.py:3001 +#: weko_search_ui/utils.py:3002 msgid "" "Since the item has a DOI, it must be associated with an index whose index" " status is \"Public\" and whose Harvest Publishing is \"Public\"." msgstr "アイテムにDOIが付与されているため、インデックス状態が「公開」かつハーベスト公開が「公開」のインデックスに関連付けが必要です。" -#: weko_search_ui/utils.py:3012 +#: weko_search_ui/utils.py:3013 msgid "You cannot keep an item private because it has a DOI." msgstr "アイテムにDOIが付与されているため、アイテムを非公開にすることはできません。" -#: weko_search_ui/utils.py:3066 weko_search_ui/utils.py:4362 +#: weko_search_ui/utils.py:3067 weko_search_ui/utils.py:4363 msgid "DOI_RA should be set by one of JaLC, Crossref, DataCite, NDL JaLC." msgstr "DOI_RAはJaLC,Crossref,DataCite,NDL JaLCのいずれかを設定してください。" -#: weko_search_ui/utils.py:3149 +#: weko_search_ui/utils.py:3150 msgid "Specified DOI was withdrawn. Please specify another DOI." msgstr "指定されたDOIは取り下げられました。別のDOIを指定してください。" -#: weko_search_ui/utils.py:3157 +#: weko_search_ui/utils.py:3158 msgid "" "Specified DOI has been used already for another item. Please specify " "another DOI." msgstr "指定されたDOIは既に別のアイテムに付与されています。別のDOIを指定してください。" -#: weko_search_ui/utils.py:3253 +#: weko_search_ui/utils.py:3254 msgid "" "Specified DOI is duplicated with another import item. Please specify " "another DOI." msgstr "指定されたDOIはインポートファイル内で重複しています。別のDOIを指定してください。" -#: weko_search_ui/utils.py:3286 +#: weko_search_ui/utils.py:3287 msgid "Item Link type: '{}' is not one of {}." msgstr "リンクタイプ'{}'は次の決められた選択肢に含まれていません。{}" -#: weko_search_ui/utils.py:3290 +#: weko_search_ui/utils.py:3291 msgid "Please specify Item URL for item link." msgstr "アイテムリンク先のURLを指定してください。" -#: weko_search_ui/utils.py:3304 +#: weko_search_ui/utils.py:3305 msgid "Specified Item Link URI and system URI do not match." msgstr "指定されたアイテムリンク先URIとシステムURIが一致しません。" -#: weko_search_ui/utils.py:3310 +#: weko_search_ui/utils.py:3311 msgid "Linking item does not exist in the system." msgstr "リンク先アイテムがシステムに存在しません。" -#: weko_search_ui/utils.py:3313 +#: weko_search_ui/utils.py:3314 msgid "Linking item already deleted in the system." msgstr "リンク先アイテムは削除済です。" -#: weko_search_ui/utils.py:3352 +#: weko_search_ui/utils.py:3353 msgid "It is not allowed to create links to the item itself." msgstr "自身へのアイテムリンクを作成することはできません。" -#: weko_search_ui/utils.py:3357 +#: weko_search_ui/utils.py:3358 msgid "It is not allowed to create links other than {} between split items." msgstr "分割したアイテム間で{}以外のリンクを作成することはできません。" -#: weko_search_ui/utils.py:3393 +#: weko_search_ui/utils.py:3394 msgid "Duplicate Item Link." msgstr "重複するアイテムリンクを作成することはできません。" -#: weko_search_ui/utils.py:3430 +#: weko_search_ui/utils.py:3431 msgid "'wk:metadataReplace' flag cannot be used when registering an item." msgstr "RO-Crate インポートでは、`wk:metadataReplace`フラグを有効にできません。" -#: weko_search_ui/utils.py:3747 +#: weko_search_ui/utils.py:3748 msgid "" "One of the following required values ​​has not been " "registered.
{}
" msgstr "次のいずれかの必要値が登録していません。
{}
" -#: weko_search_ui/utils.py:3752 +#: weko_search_ui/utils.py:3753 msgid "" "The mapping of required items for DOI validation is not set. Please " "recheck the following mapping settings.
{}" msgstr "" -#: weko_search_ui/utils.py:3762 +#: weko_search_ui/utils.py:3763 msgid "The following metadata are required.
{}" msgstr "{}は必須項目です。" -#: weko_search_ui/utils.py:3767 +#: weko_search_ui/utils.py:3768 msgid "One of the following metadata is required.
{}
" msgstr "{}のいずれかを設定してください。" -#: weko_search_ui/utils.py:3830 weko_search_ui/utils.py:3842 +#: weko_search_ui/utils.py:3831 weko_search_ui/utils.py:3843 msgid "Please specify the date with any format of YYYY-MM-DD, YYYY-MM, YYYY." msgstr "日付はYYYY-MM-DD、YYYY-MM、YYYYのいずれかで指定してください。" -#: weko_search_ui/utils.py:3836 +#: weko_search_ui/utils.py:3837 msgid "Replace value of {} from {} to {}." msgstr "{}の値を{}から{}へ置き換えました。" -#: weko_search_ui/utils.py:3859 +#: weko_search_ui/utils.py:3860 msgid "Please specify PubDate with YYYY-MM-DD." msgstr "公開日はYYYY-MM-DDで指定してください。" -#: weko_search_ui/utils.py:3889 +#: weko_search_ui/utils.py:3890 msgid "ID is specified for the newly registered item. Ignore the ID and register." msgstr "新規登録アイテムにIDが指定されています。IDを無視して登録を行います。" -#: weko_search_ui/utils.py:3972 +#: weko_search_ui/utils.py:3973 msgid "Please specify Open Access Date with YYYY-MM-DD." msgstr "オープンアクセスの日付はYYYY-MM-DDで指定してください。" -#: weko_search_ui/utils.py:4199 weko_search_ui/utils.py:4347 -#: weko_search_ui/utils.py:4353 +#: weko_search_ui/utils.py:4200 weko_search_ui/utils.py:4348 +#: weko_search_ui/utils.py:4354 msgid "Please specify DOI prefix/suffix." msgstr "DOIは prefix/suffix の形式で指定して下さい。" -#: weko_search_ui/utils.py:4339 +#: weko_search_ui/utils.py:4340 msgid "The specified DOI is wrong and fixed with the registered DOI." msgstr "" -#: weko_search_ui/utils.py:4342 +#: weko_search_ui/utils.py:4343 msgid "" "The specified DOI RA is wrong and fixed with the correct DOI RA of the " "registered DOI." msgstr "" -#: weko_search_ui/utils.py:4349 weko_search_ui/utils.py:4355 +#: weko_search_ui/utils.py:4350 weko_search_ui/utils.py:4356 msgid "Please specify DOI suffix." msgstr "" -#: weko_search_ui/utils.py:4358 +#: weko_search_ui/utils.py:4359 msgid "Do not specify DOI suffix." msgstr "" -#: weko_search_ui/utils.py:4364 +#: weko_search_ui/utils.py:4365 msgid "Specified Prefix of DOI is incorrect." msgstr "" -#: weko_search_ui/utils.py:4396 +#: weko_search_ui/utils.py:4397 msgid "" "Please specify the image file(gif, jpg, jpe, jpeg, png, bmp, tiff, tif) " "for the thumbnail." msgstr "サムネイルは画像ファイル(gif, jpg, jpe, jpeg, png, bmp, tiff, tif)を指定してください。" -#: weko_search_ui/utils.py:5517 +#: weko_search_ui/utils.py:5518 msgid "The file specified in ({}) does not exist." msgstr "({})に指定したファイルが存在しません。" -#: weko_search_ui/utils.py:5521 +#: weko_search_ui/utils.py:5522 msgid "" "The file specified in ({}) does not exist.
The file will not be " "updated. Update only the metadata with csv/tsv contents." msgstr "({})に指定したファイルが存在しません。
ファイルの更新はしません。csv/tsv内容でメタデータのみ更新します。" -#: weko_search_ui/utils.py:5808 +#: weko_search_ui/utils.py:5809 msgid "The file name specified in {} and {} do not match." msgstr "{}に指定されたファイル名と{}が一致しません。" @@ -810,31 +846,31 @@ msgstr "正しい値を設定してください。" msgid "facet slider correlation validation" msgstr "範囲fromは範囲to以下にしてください。" -#: weko_search_ui/templates/weko_search_ui/search.html:99 +#: weko_search_ui/templates/weko_search_ui/search.html:101 msgid "Chinese" msgstr "中国語" -#: weko_search_ui/templates/weko_search_ui/search.html:100 +#: weko_search_ui/templates/weko_search_ui/search.html:102 msgid "English" msgstr "英語" -#: weko_search_ui/templates/weko_search_ui/search.html:101 +#: weko_search_ui/templates/weko_search_ui/search.html:103 msgid "French" msgstr "フランス語" -#: weko_search_ui/templates/weko_search_ui/search.html:102 +#: weko_search_ui/templates/weko_search_ui/search.html:104 msgid "German" msgstr "ドイツ語" -#: weko_search_ui/templates/weko_search_ui/search.html:103 +#: weko_search_ui/templates/weko_search_ui/search.html:105 msgid "Japanese" msgstr "日本語" -#: weko_search_ui/templates/weko_search_ui/search.html:104 +#: weko_search_ui/templates/weko_search_ui/search.html:106 msgid "Korean" msgstr "韓国語" -#: weko_search_ui/templates/weko_search_ui/search.html:105 +#: weko_search_ui/templates/weko_search_ui/search.html:107 msgid "Russian" msgstr "ロシア語" @@ -1191,48 +1227,3 @@ msgstr "マッピング" msgid "Failed to get mapping list." msgstr "マッピング定義リストの取得に失敗しました。" -#~ msgid "Bagging a parent of the current directory is not supported" -#~ msgstr "" - -#~ msgid "Creating tag for directory %s" -#~ msgstr "" - -#~ msgid "Bag directory %s does not exist" -#~ msgstr "" - -#~ msgid "Bag directory %s does not contain a data directory" -#~ msgstr "" - -#~ msgid "" -#~ "Unable to write to the following directories and files:\n" -#~ "%s" -#~ msgstr "" - -#~ msgid "Missing permissions to move all files and directories" -#~ msgstr "" - -#~ msgid "" -#~ "The following directories do not have read permissions:\n" -#~ "%s" -#~ msgstr "" - -#~ msgid "" -#~ "The following files do not have read permissions:\n" -#~ "%s" -#~ msgstr "" - -#~ msgid "Read permissions are required to calculate file fixities" -#~ msgstr "" - -#~ msgid "Creating data directory" -#~ msgstr "" - -#~ msgid "Creating bagit.txt" -#~ msgstr "" - -#~ msgid "Creating bag-info.txt" -#~ msgstr "" - -#~ msgid "An error occurred creating a bag in %s" -#~ msgstr "" - diff --git a/modules/weko-search-ui/weko_search_ui/translations/messages.pot b/modules/weko-search-ui/weko_search_ui/translations/messages.pot index 66522c42fb..aef533fcf8 100644 --- a/modules/weko-search-ui/weko_search_ui/translations/messages.pot +++ b/modules/weko-search-ui/weko_search_ui/translations/messages.pot @@ -1,15 +1,15 @@ # Translations template for weko-search-ui. -# Copyright (C) 2025 National Institute of Informatics +# Copyright (C) 2026 National Institute of Informatics # This file is distributed under the same license as the weko-search-ui # project. -# FIRST AUTHOR , 2025. +# FIRST AUTHOR , 2026. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: weko-search-ui 0.1.0.dev20170000\n" "Report-Msgid-Bugs-To: wekosoftware@nii.ac.jp\n" -"POT-Creation-Date: 2025-12-17 13:33+0900\n" +"POT-Creation-Date: 2026-02-16 09:37+0900\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -214,42 +214,78 @@ msgstr "" msgid "Import Result" msgstr "" -#: weko_search_ui/mapper.py:1351 +#: weko_search_ui/mapper.py:1352 msgid "\"{key}\" is required." msgstr "" -#: weko_search_ui/mapper.py:1372 +#: weko_search_ui/mapper.py:1373 msgid "\"{key}\" is not in itemtype." msgstr "" -#: weko_search_ui/mapper.py:1374 +#: weko_search_ui/mapper.py:1375 msgid "\"{key}\" is not in itemtype, did you mean \"{similar_key}\"?" msgstr "" -#: weko_search_ui/mapper.py:1495 +#: weko_search_ui/mapper.py:1404 weko_search_ui/mapper.py:1408 +msgid "The type of the jsonld mapping replacement rule is invalid." +msgstr "" + +#: weko_search_ui/mapper.py:1412 +#, python-format +msgid "Required replacement rule: '%(rule_id)s' is missing." +msgstr "" + +#: weko_search_ui/mapper.py:1418 weko_search_ui/mapper.py:1431 +#, python-format +msgid "Replacement rule: '%(rule_id)s' is invalid." +msgstr "" + +#: weko_search_ui/mapper.py:1437 +#, python-format +msgid "" +"Replacement rule: '%(rule_id)s' - 'is_regex' is not boolean. Treated as " +"False." +msgstr "" + +#: weko_search_ui/mapper.py:1451 +#, python-format +msgid "Replacement rule: '%(rule_id)s' - regex error: %(error)s" +msgstr "" + +#: weko_search_ui/mapper.py:1466 +#, python-format +msgid "Replacement failed.: %(warn)s" +msgstr "" + +#: weko_search_ui/mapper.py:1470 +#, python-format +msgid "Replacement failed.: %(warning)s" +msgstr "" + +#: weko_search_ui/mapper.py:1591 #, python-format msgid "" "Cannot map to item type from json-ld; Mapping is not defined for the " "metadata, \"%(key)s\": \"%(value)s\"" msgstr "" -#: weko_search_ui/mapper.py:1521 +#: weko_search_ui/mapper.py:1617 #, python-format msgid "" "Cannot map to item type from json-ld; Not found mapping destination for " "the metadata, \"%(key)s\": \"%(value)s\"" msgstr "" -#: weko_search_ui/mapper.py:1531 +#: weko_search_ui/mapper.py:1627 #, python-format msgid "Failed to set metadata for json-ld, \"%(key)s\": \"%(value)s\"" msgstr "" -#: weko_search_ui/mapper.py:1553 +#: weko_search_ui/mapper.py:1649 msgid "Metadata which could not be mapped to item type will be set in 'Extra'." msgstr "" -#: weko_search_ui/mapper.py:1557 +#: weko_search_ui/mapper.py:1653 msgid "Metadata which could not be mapped to item type will be discarded." msgstr "" @@ -289,327 +325,327 @@ msgstr "" msgid "The item type ID specified in the XML file does not exist." msgstr "" -#: weko_search_ui/utils.py:991 +#: weko_search_ui/utils.py:992 msgid "" "The format of the specified file {} dose not support import. Please " "specify a zip file." msgstr "" -#: weko_search_ui/utils.py:1012 +#: weko_search_ui/utils.py:1013 msgid "Failred to decode JSON-LD file: " msgstr "" -#: weko_search_ui/utils.py:1015 +#: weko_search_ui/utils.py:1016 msgid "Unexpected error occurred: " msgstr "" -#: weko_search_ui/utils.py:1225 +#: weko_search_ui/utils.py:1226 msgid "" "There is an error in the format of the first line of the header of the {}" " file." msgstr "" -#: weko_search_ui/utils.py:1244 +#: weko_search_ui/utils.py:1245 msgid "The item type ID specified in the {} file does not exist." msgstr "" -#: weko_search_ui/utils.py:1253 +#: weko_search_ui/utils.py:1254 msgid "Cannot register because the specified item type is not the latest version." msgstr "" -#: weko_search_ui/utils.py:1268 +#: weko_search_ui/utils.py:1269 msgid "The following metadata keys are duplicated.
{}" msgstr "" -#: weko_search_ui/utils.py:1289 +#: weko_search_ui/utils.py:1290 msgid "The item does not consistent with the specified item type.
{}" msgstr "" -#: weko_search_ui/utils.py:1317 +#: weko_search_ui/utils.py:1318 msgid "Cannot read {} file correctly." msgstr "" -#: weko_search_ui/utils.py:1341 +#: weko_search_ui/utils.py:1342 msgid "" "The following items are not registered because they do not exist in the " "specified item type. {}" msgstr "" -#: weko_search_ui/utils.py:1351 +#: weko_search_ui/utils.py:1352 msgid "" "The {} file could not be read. Make sure the file format is {} and that " "the file is UTF-8 encoded." msgstr "" -#: weko_search_ui/utils.py:1382 +#: weko_search_ui/utils.py:1383 msgid "" "The XML file could not be read. Make sure the file format is XML and that" " the file is UTF-8 encoded." msgstr "" -#: weko_search_ui/utils.py:1455 +#: weko_search_ui/utils.py:1456 msgid "Please specify item ID by half-width number." msgstr "" -#: weko_search_ui/utils.py:1477 +#: weko_search_ui/utils.py:1478 #, python-format msgid "Replace value of %(target_path)s from %(old_value)s to '%(new_value)s'." msgstr "" -#: weko_search_ui/utils.py:1489 +#: weko_search_ui/utils.py:1490 msgid "Specified item type does not exist." msgstr "" -#: weko_search_ui/utils.py:1495 +#: weko_search_ui/utils.py:1496 #, python-format msgid "Specified %(type)s is different from existing %(existing_type)s." msgstr "" -#: weko_search_ui/utils.py:1567 +#: weko_search_ui/utils.py:1568 msgid "The same item may have been registered." msgstr "" -#: weko_search_ui/utils.py:1597 +#: weko_search_ui/utils.py:1598 msgid "Specified URI and system URI do not match." msgstr "" -#: weko_search_ui/utils.py:1609 +#: weko_search_ui/utils.py:1610 msgid "Item does not exist in the system." msgstr "" -#: weko_search_ui/utils.py:1616 +#: weko_search_ui/utils.py:1617 msgid "Item already DELETED in the system." msgstr "" -#: weko_search_ui/utils.py:1633 +#: weko_search_ui/utils.py:1634 msgid "Please specify either \"Keep\" or \"Upgrade\"." msgstr "" -#: weko_search_ui/utils.py:2592 +#: weko_search_ui/utils.py:2593 msgid "Title is required item." msgstr "" -#: weko_search_ui/utils.py:2609 +#: weko_search_ui/utils.py:2610 msgid "{} is required item." msgstr "" -#: weko_search_ui/utils.py:2612 +#: weko_search_ui/utils.py:2613 msgid "Please set \"public\" or \"private\" for {}." msgstr "" -#: weko_search_ui/utils.py:2653 +#: weko_search_ui/utils.py:2654 msgid "The specified {} does not exist in system." msgstr "" -#: weko_search_ui/utils.py:2663 +#: weko_search_ui/utils.py:2664 msgid "Specified {} does not match with existing index." msgstr "" -#: weko_search_ui/utils.py:2707 +#: weko_search_ui/utils.py:2708 msgid "Your role cannot register items in this index." msgstr "" -#: weko_search_ui/utils.py:2728 +#: weko_search_ui/utils.py:2729 msgid "Both of IndexID and POS_INDEX are not being set." msgstr "" -#: weko_search_ui/utils.py:2774 weko_search_ui/utils.py:2799 +#: weko_search_ui/utils.py:2775 weko_search_ui/utils.py:2800 msgid "Specified {} is invalid." msgstr "" -#: weko_search_ui/utils.py:2833 +#: weko_search_ui/utils.py:2834 msgid "If there is a info of content file, terms of use cannot be set." msgstr "" -#: weko_search_ui/utils.py:2840 weko_search_ui/utils.py:6090 +#: weko_search_ui/utils.py:2841 weko_search_ui/utils.py:6091 msgid "The specified provinding method does not exist in the system" msgstr "" -#: weko_search_ui/utils.py:2845 weko_search_ui/utils.py:6085 +#: weko_search_ui/utils.py:2846 weko_search_ui/utils.py:6086 msgid "The specified terms does not exist in the system" msgstr "" -#: weko_search_ui/utils.py:2937 weko_search_ui/utils.py:2970 -#: weko_search_ui/utils.py:3062 weko_search_ui/utils.py:3174 -#: weko_search_ui/utils.py:3196 weko_search_ui/utils.py:3231 +#: weko_search_ui/utils.py:2938 weko_search_ui/utils.py:2971 +#: weko_search_ui/utils.py:3063 weko_search_ui/utils.py:3175 +#: weko_search_ui/utils.py:3197 weko_search_ui/utils.py:3232 msgid "Please specify {}." msgstr "" -#: weko_search_ui/utils.py:2940 weko_search_ui/utils.py:3177 +#: weko_search_ui/utils.py:2941 weko_search_ui/utils.py:3178 msgid "The specified {} exceeds the maximum length." msgstr "" -#: weko_search_ui/utils.py:2955 weko_search_ui/utils.py:3112 -#: weko_search_ui/utils.py:3123 weko_search_ui/utils.py:3192 +#: weko_search_ui/utils.py:2956 weko_search_ui/utils.py:3113 +#: weko_search_ui/utils.py:3124 weko_search_ui/utils.py:3193 msgid "Specified Prefix of {} is incorrect." msgstr "" -#: weko_search_ui/utils.py:2963 weko_search_ui/utils.py:3106 -#: weko_search_ui/utils.py:3116 +#: weko_search_ui/utils.py:2964 weko_search_ui/utils.py:3107 +#: weko_search_ui/utils.py:3117 msgid "{} cannot be set." msgstr "" -#: weko_search_ui/utils.py:2972 weko_search_ui/utils.py:2976 -#: weko_search_ui/utils.py:3045 weko_search_ui/utils.py:3233 +#: weko_search_ui/utils.py:2973 weko_search_ui/utils.py:2977 +#: weko_search_ui/utils.py:3046 weko_search_ui/utils.py:3234 msgid "Specified {} is different from existing {}." msgstr "" -#: weko_search_ui/utils.py:2996 +#: weko_search_ui/utils.py:2997 msgid "" "When assigning a DOI to an item, it must be associated with an index " "whose index status is \"Public\" and Harvest Publishing is \"Public\"." msgstr "" -#: weko_search_ui/utils.py:3001 +#: weko_search_ui/utils.py:3002 msgid "" "Since the item has a DOI, it must be associated with an index whose index" " status is \"Public\" and whose Harvest Publishing is \"Public\"." msgstr "" -#: weko_search_ui/utils.py:3012 +#: weko_search_ui/utils.py:3013 msgid "You cannot keep an item private because it has a DOI." msgstr "" -#: weko_search_ui/utils.py:3066 weko_search_ui/utils.py:4362 +#: weko_search_ui/utils.py:3067 weko_search_ui/utils.py:4363 msgid "DOI_RA should be set by one of JaLC, Crossref, DataCite, NDL JaLC." msgstr "" -#: weko_search_ui/utils.py:3149 +#: weko_search_ui/utils.py:3150 msgid "Specified DOI was withdrawn. Please specify another DOI." msgstr "" -#: weko_search_ui/utils.py:3157 +#: weko_search_ui/utils.py:3158 msgid "" "Specified DOI has been used already for another item. Please specify " "another DOI." msgstr "" -#: weko_search_ui/utils.py:3253 +#: weko_search_ui/utils.py:3254 msgid "" "Specified DOI is duplicated with another import item. Please specify " "another DOI." msgstr "" -#: weko_search_ui/utils.py:3286 +#: weko_search_ui/utils.py:3287 msgid "Item Link type: '{}' is not one of {}." msgstr "" -#: weko_search_ui/utils.py:3290 +#: weko_search_ui/utils.py:3291 msgid "Please specify Item URL for item link." msgstr "" -#: weko_search_ui/utils.py:3304 +#: weko_search_ui/utils.py:3305 msgid "Specified Item Link URI and system URI do not match." msgstr "" -#: weko_search_ui/utils.py:3310 +#: weko_search_ui/utils.py:3311 msgid "Linking item does not exist in the system." msgstr "" -#: weko_search_ui/utils.py:3313 +#: weko_search_ui/utils.py:3314 msgid "Linking item already deleted in the system." msgstr "" -#: weko_search_ui/utils.py:3352 +#: weko_search_ui/utils.py:3353 msgid "It is not allowed to create links to the item itself." msgstr "" -#: weko_search_ui/utils.py:3357 +#: weko_search_ui/utils.py:3358 msgid "It is not allowed to create links other than {} between split items." msgstr "" -#: weko_search_ui/utils.py:3393 +#: weko_search_ui/utils.py:3394 msgid "Duplicate Item Link." msgstr "" -#: weko_search_ui/utils.py:3430 +#: weko_search_ui/utils.py:3431 msgid "'wk:metadataReplace' flag cannot be used when registering an item." msgstr "" -#: weko_search_ui/utils.py:3747 +#: weko_search_ui/utils.py:3748 msgid "" "One of the following required values ​​has not been " "registered.
{}
" msgstr "" -#: weko_search_ui/utils.py:3752 +#: weko_search_ui/utils.py:3753 msgid "" "The mapping of required items for DOI validation is not set. Please " "recheck the following mapping settings.
{}" msgstr "" -#: weko_search_ui/utils.py:3762 +#: weko_search_ui/utils.py:3763 msgid "The following metadata are required.
{}" msgstr "" -#: weko_search_ui/utils.py:3767 +#: weko_search_ui/utils.py:3768 msgid "One of the following metadata is required.
{}
" msgstr "" -#: weko_search_ui/utils.py:3830 weko_search_ui/utils.py:3842 +#: weko_search_ui/utils.py:3831 weko_search_ui/utils.py:3843 msgid "Please specify the date with any format of YYYY-MM-DD, YYYY-MM, YYYY." msgstr "" -#: weko_search_ui/utils.py:3836 +#: weko_search_ui/utils.py:3837 msgid "Replace value of {} from {} to {}." msgstr "" -#: weko_search_ui/utils.py:3859 +#: weko_search_ui/utils.py:3860 msgid "Please specify PubDate with YYYY-MM-DD." msgstr "" -#: weko_search_ui/utils.py:3889 +#: weko_search_ui/utils.py:3890 msgid "ID is specified for the newly registered item. Ignore the ID and register." msgstr "" -#: weko_search_ui/utils.py:3972 +#: weko_search_ui/utils.py:3973 msgid "Please specify Open Access Date with YYYY-MM-DD." msgstr "" -#: weko_search_ui/utils.py:4199 weko_search_ui/utils.py:4347 -#: weko_search_ui/utils.py:4353 +#: weko_search_ui/utils.py:4200 weko_search_ui/utils.py:4348 +#: weko_search_ui/utils.py:4354 msgid "Please specify DOI prefix/suffix." msgstr "" -#: weko_search_ui/utils.py:4339 +#: weko_search_ui/utils.py:4340 msgid "The specified DOI is wrong and fixed with the registered DOI." msgstr "" -#: weko_search_ui/utils.py:4342 +#: weko_search_ui/utils.py:4343 msgid "" "The specified DOI RA is wrong and fixed with the correct DOI RA of the " "registered DOI." msgstr "" -#: weko_search_ui/utils.py:4349 weko_search_ui/utils.py:4355 +#: weko_search_ui/utils.py:4350 weko_search_ui/utils.py:4356 msgid "Please specify DOI suffix." msgstr "" -#: weko_search_ui/utils.py:4358 +#: weko_search_ui/utils.py:4359 msgid "Do not specify DOI suffix." msgstr "" -#: weko_search_ui/utils.py:4364 +#: weko_search_ui/utils.py:4365 msgid "Specified Prefix of DOI is incorrect." msgstr "" -#: weko_search_ui/utils.py:4396 +#: weko_search_ui/utils.py:4397 msgid "" "Please specify the image file(gif, jpg, jpe, jpeg, png, bmp, tiff, tif) " "for the thumbnail." msgstr "" -#: weko_search_ui/utils.py:5517 +#: weko_search_ui/utils.py:5518 msgid "The file specified in ({}) does not exist." msgstr "" -#: weko_search_ui/utils.py:5521 +#: weko_search_ui/utils.py:5522 msgid "" "The file specified in ({}) does not exist.
The file will not be " "updated. Update only the metadata with csv/tsv contents." msgstr "" -#: weko_search_ui/utils.py:5808 +#: weko_search_ui/utils.py:5809 msgid "The file name specified in {} and {} do not match." msgstr "" @@ -809,31 +845,31 @@ msgstr "" msgid "facet slider correlation validation" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:99 +#: weko_search_ui/templates/weko_search_ui/search.html:101 msgid "Chinese" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:100 +#: weko_search_ui/templates/weko_search_ui/search.html:102 msgid "English" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:101 +#: weko_search_ui/templates/weko_search_ui/search.html:103 msgid "French" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:102 +#: weko_search_ui/templates/weko_search_ui/search.html:104 msgid "German" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:103 +#: weko_search_ui/templates/weko_search_ui/search.html:105 msgid "Japanese" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:104 +#: weko_search_ui/templates/weko_search_ui/search.html:106 msgid "Korean" msgstr "" -#: weko_search_ui/templates/weko_search_ui/search.html:105 +#: weko_search_ui/templates/weko_search_ui/search.html:107 msgid "Russian" msgstr "" diff --git a/modules/weko-search-ui/weko_search_ui/utils.py b/modules/weko-search-ui/weko_search_ui/utils.py index 3c02cde998..c65d961da9 100644 --- a/modules/weko-search-ui/weko_search_ui/utils.py +++ b/modules/weko-search-ui/weko_search_ui/utils.py @@ -931,7 +931,8 @@ def check_jsonld_import_items( with open(f"{data_path}/{json_name}", "r") as f: json_ld = json.load(f) mapper.data_path = data_path - item_metadatas, _ = mapper.to_item_metadata(json_ld) + mapper.mapping_id = mapping_id + item_metadatas, x = mapper.to_item_metadata(json_ld) list_record = [ { "$schema": f"/items/jsonschema/{item_type.id}", @@ -1447,7 +1448,8 @@ def handle_validate_item_import(list_record, schema) -> list: v2 = Draft4Validator(schema) if schema else None for record in list_record: errors = record.get("errors") or [] - warnings = [] + new_warnings = [] + warnings = record.get("warnings") or [] record_id = record.get("id") if record_id and ( not represents_int(record_id) or re.search(r"([0-9])", record_id) @@ -1472,7 +1474,7 @@ def handle_validate_item_import(list_record, schema) -> list: last_key = path_list[-1] target[last_key] = str(target[last_key]) target_path = ".".join([str(p) for p in path_list[:-2]]) - warnings.append( + new_warnings.append( _("Replace value of %(target_path)s from %(old_value)s to '%(new_value)s'.", target_path=target_path, old_value=target[last_key], new_value=str(target[last_key]) ) @@ -1490,13 +1492,14 @@ def handle_validate_item_import(list_record, schema) -> list: records = dict(**record) records["errors"] = errors if len(errors) else None - if len(warnings) > 0: + if len(new_warnings) > 0: warnings.append( _("Specified %(type)s is different from existing %(existing_type)s.", type="type:integer", existing_type="type:string" ) ) - records["warnings"] = warnings if len(warnings) else None + warnings.extend(new_warnings) + records["warnings"] = warnings result.append(records) return result diff --git a/modules/weko-swordserver/tests/test_views.py b/modules/weko-swordserver/tests/test_views.py index cd1333289e..8cf29c79c8 100644 --- a/modules/weko-swordserver/tests/test_views.py +++ b/modules/weko-swordserver/tests/test_views.py @@ -207,12 +207,15 @@ def update_location_size(): mocker_check_item.return_value = { "data_path": "/var/tmp/test", "register_type": "Direct", - "list_record": [{"status": "new", "errors": ["Item check error."]}], + "list_record": [{"status": "new", "errors": ["Item check error."], + "warnings": ["Test warning message"]}], } - result = client.post(url, data={"file": storage}, content_type="multipart/form-data", headers=headers) + result = client.post(url, data={"file": storage}, content_type= + "multipart/form-data", headers=headers) assert result.status_code == 400 - assert result.json.get("error") == "Item check error: Item check error." + assert "Item check error: Item check error." in result.json.get("error") + assert "Test warning message" in result.json.get("error") # not new item login_user_via_session(client=client, email=users[0]["email"]) @@ -526,12 +529,15 @@ def update_location_size(): mocker_check_item.return_value = { "data_path": "/var/tmp/test", "register_type": "Direct", - "list_record": [{"status": "keep", "errors": ["Item check error."]}], + "list_record": [{"status": "keep", "errors": ["Item check error."], + "warnings": ["Test warning message"]}], } - result = client.put(url, data={"file": storage}, content_type="multipart/form-data", headers=headers) + result = client.put(url, data={"file": storage}, content_type= + "multipart/form-data", headers=headers) assert result.status_code == 400 - assert result.json.get("error") == "Item check error: Item check error." + assert "Item check error: Item check error." in result.json.get("error") + assert "Test warning message" in result.json.get("error") # new item login_user_via_session(client=client, email=users[0]["email"]) diff --git a/modules/weko-swordserver/weko_swordserver/views.py b/modules/weko-swordserver/weko_swordserver/views.py index e4bce0bbe4..88494aa7f4 100644 --- a/modules/weko-swordserver/weko_swordserver/views.py +++ b/modules/weko-swordserver/weko_swordserver/views.py @@ -313,10 +313,12 @@ def post_service_document(): # Validate items in the check result for item in check_result.get("list_record") or [{}]: if not item or item.get("errors"): + warning = item.get("warnings", []) if item else [] error_msg = ( ", ".join(item.get("errors")) if item and item.get("errors") else "item_missing" ) + error_msg += f", 'warnings': [{', '.join(warning)}]" if warning else "" current_app.logger.error(f"Error in check_import_items: {error_msg}") raise WekoSwordserverException( f"Item check error: {error_msg}", @@ -388,6 +390,8 @@ def process_item(item, request_info): ) elif register_type == "Workflow": + item["metadata"]["researchmap"] = item.get( + "researchmap_linkage", False) url, recid, action , error = import_items_to_activity( item, request_info=request_info ) @@ -624,10 +628,12 @@ def put_object(recid): # only first item item = (check_result.get("list_record") or [{}])[0] if not item or item.get("errors"): + warning = item.get("warnings", []) if item else [] error_msg = ( ", ".join(item.get("errors")) if item and item.get("errors") else "item_missing" ) + error_msg += f", 'warnings': [{', '.join(warning)}]" if warning else "" current_app.logger.error(f"Error in check_import_items: {error_msg}") raise WekoSwordserverException( f"Item check error: {error_msg}", @@ -705,6 +711,8 @@ def put_object(recid): response = jsonify(_get_status_document(recid)), 200 elif register_type == "Workflow": + item["metadata"]["researchmap"] = item.get( + "researchmap_linkage", False) url, _, action, error = import_items_to_activity( item, request_info=request_info ) diff --git a/modules/weko-workflow/tests/test_activity.py b/modules/weko-workflow/tests/test_activity.py index d22baf773a..f8d1e14bb5 100644 --- a/modules/weko-workflow/tests/test_activity.py +++ b/modules/weko-workflow/tests/test_activity.py @@ -506,7 +506,8 @@ def test__input_metadata_new(self, app, db, item_type, workflow, users, client, "pubdate": "2024-01-01", "shared_user_ids": [users[1]["id"]], "item_title":[{"subitem_title":"Test Title"}], - "item_files": [{"filename": "test.txt"}, {"filename": "ignore.txt"}] + "item_files": [{"filename": "test.txt"}, {"filename": "ignore.txt"}], + "researchmap": True } files = ["test.txt", "ignore.txt"] @@ -543,6 +544,7 @@ def test__input_metadata_new(self, app, db, item_type, workflow, users, client, assert updated_data["files"][0]["non_extract"] is False assert updated_data["files"][1]["filename"] == "ignore.txt" assert updated_data["files"][1]["non_extract"] is True + assert updated_data["cris_linkage"]["researchmap"] is True activity = HeadlessActivity(_lock_skip=True) mock_activity = MagicMock(spec=Activity) @@ -559,7 +561,8 @@ def test__input_metadata_new(self, app, db, item_type, workflow, users, client, "weko_shared_ids": [users[1]["id"]], "item_title":[{"subitem_title":"Test Title"}], "item_files": [{"filename": "test.txt"}, {"filename": "ignore.txt"}], - "item_1617186783814": [] + "item_1617186783814": [], + "researchmap": False } with patch("weko_workflow.headless.activity.validate_form_input_data") as mock_validate, \ @@ -586,6 +589,7 @@ def test__input_metadata_new(self, app, db, item_type, workflow, users, client, assert updated_data["files"][0]["non_extract"] is False assert updated_data["files"][1]["filename"] == "ignore.txt" assert updated_data["files"][1]["non_extract"] is False + assert updated_data["cris_linkage"]["researchmap"] is False activity = HeadlessActivity(_lock_skip=True) mock_activity = MagicMock(spec=Activity) @@ -753,7 +757,8 @@ def test__input_metadata_update(self, app, db, item_type, workflow, users, clien "edit_mode": "Keep", "item_title":[{"subitem_title":"Test Title"}], "item_files": [{"filename": "test.txt"}, {"filename": "ignore.txt"}], - "item_1617186981471": "New Data" + "item_1617186981471": "New Data", + "researchmap": True } _uuid0 = uuid.uuid4() old_files_info = [ @@ -812,6 +817,7 @@ def test__input_metadata_update(self, app, db, item_type, workflow, users, clien assert updated_data["files"][0]["filename"] == "test.txt" assert updated_data["files"][1]["filename"] == "ignore.txt" assert len(updated_data["files"]) == 2 # Only new files are added + assert updated_data["cris_linkage"]["researchmap"] is True activity = HeadlessActivity(_lock_skip=True, _files_inheritance=True) mock_activity = MagicMock(spec=Activity) @@ -836,7 +842,8 @@ def test__input_metadata_update(self, app, db, item_type, workflow, users, clien "edit_mode": "Keep", "item_title":[{"subitem_title":"Test Title"}], "item_files": [{"filename": "old.txt"}, {"filename": "test.txt"}, {"filename": "ignore.txt"}], - "item_1617186981471": "New Data" + "item_1617186981471": "New Data", + "researchmap": False } old_files_info = [ {"filename": "old.txt", "key": "old.txt", "version_id": str(uuid.uuid4())}, @@ -892,6 +899,7 @@ def test__input_metadata_update(self, app, db, item_type, workflow, users, clien assert updated_data["files"][0]["filename"] == "old.txt" # Old file is kept assert updated_data["files"][1]["filename"] == "ignore.txt" assert updated_data["files"][2]["filename"] == "test.txt" + assert updated_data["cris_linkage"]["researchmap"] is False # success to input metadata; inherit old files but ole file metadata is not kept activity = HeadlessActivity(_lock_skip=True, _files_inheritance=True) @@ -970,6 +978,7 @@ def test__input_metadata_update(self, app, db, item_type, workflow, users, clien assert updated_data["files"][0]["filename"] == "ignore.txt" # Old file is kept assert updated_data["files"][1]["filename"] == "test.txt" # New file is added assert len(updated_data["files"]) == 2 # No file with deleted metadata + assert updated_data["cris_linkage"]["researchmap"] is False # def _input_metadata(self, metadata, files=None, non_extract=None): @@ -1009,7 +1018,8 @@ def test__input_metadata_upgrade(self, app, db, item_type, workflow, users, clie "edit_mode": "Upgrade", "item_title":[{"subitem_title":"Test Title"}], "item_files": [{"filename": "test.txt"}, {"filename": "ignore.txt"}], - "item_1617186981471": "New Data" + "item_1617186981471": "New Data", + "researchmap": True } _uuid0 = uuid.uuid4() old_files_info = [ @@ -1078,6 +1088,7 @@ def test__input_metadata_upgrade(self, app, db, item_type, workflow, users, clie assert updated_data["files"][0]["filename"] == "test.txt" assert updated_data["files"][1]["filename"] == "ignore.txt" assert len(updated_data["files"]) == 2 # Only new files are added + assert updated_data["cris_linkage"]["researchmap"] is True # success to input metadata; inherit old files activity = HeadlessActivity(_lock_skip=True, _files_inheritance=True) @@ -1103,7 +1114,8 @@ def test__input_metadata_upgrade(self, app, db, item_type, workflow, users, clie "edit_mode": "Upgrade", "item_title":[{"subitem_title":"Test Title"}], "item_files": [{"filename": "old.txt"}, {"filename": "test.txt"}, {"filename": "ignore.txt"}], - "item_1617186981471": "New Data" + "item_1617186981471": "New Data", + "researchmap": False } old_files_info = [ {"filename": "old.txt", "key": "old.txt", "version_id": str(uuid.uuid4())}, @@ -1170,6 +1182,7 @@ def test__input_metadata_upgrade(self, app, db, item_type, workflow, users, clie assert updated_data["files"][0]["filename"] == "old.txt" # Old file is kept assert updated_data["files"][1]["filename"] == "ignore.txt" assert updated_data["files"][2]["filename"] == "test.txt" + assert updated_data["cris_linkage"]["researchmap"] is False # success to input metadata; activity item_id is not draft already activity = HeadlessActivity(_lock_skip=True, _files_inheritance=True) @@ -1255,6 +1268,7 @@ def test__input_metadata_upgrade(self, app, db, item_type, workflow, users, clie assert updated_data["files"][0]["filename"] == "old.txt" # Old file is kept assert updated_data["files"][1]["filename"] == "ignore.txt" assert updated_data["files"][2]["filename"] == "test.txt" + assert updated_data["cris_linkage"]["researchmap"] is False mock_get.assert_not_called() mock_get_weko_record.assert_not_called() diff --git a/modules/weko-workflow/weko_workflow/headless/activity.py b/modules/weko-workflow/weko_workflow/headless/activity.py index e382207e76..9497dc09a2 100644 --- a/modules/weko-workflow/weko_workflow/headless/activity.py +++ b/modules/weko-workflow/weko_workflow/headless/activity.py @@ -464,6 +464,7 @@ def _input_metadata(self, metadata, files=None, non_extract=None): request_maillist=request_maillist, is_display_request_button=False ) + researchmap_linkage = metadata.pop("researchmap", False) from weko_search_ui.utils import get_data_by_property # get value of "Title" from metadata by jpcoar_mapping @@ -638,6 +639,9 @@ def _input_metadata(self, metadata, files=None, non_extract=None): data = { "metainfo": metadata, "files": self.files_info, + "cris_linkage": { + "researchmap": researchmap_linkage + }, "endpoint": { "initialization": f"/api/deposits/redirect/{pid.pid_value}", } diff --git a/scripts/instance.cfg b/scripts/instance.cfg index 90024af4a1..9f908bee2a 100644 --- a/scripts/instance.cfg +++ b/scripts/instance.cfg @@ -55,7 +55,7 @@ CRAWLER_REDIS_DB = 3 CRAWLER_REDIS_PORT = 6379 CRAWLER_REDIS_TTL = 86400 -GROUP_INFO_REDIS_DB = 4 +GROUP_INFO_REDIS_DB = 4 # Celery CELERY_GET_STATUS_TIMEOUT = 3.0 @@ -96,7 +96,7 @@ WEKO_ITEMS_UI_CRIS_LINKAGE_RESEARCHMAP_MAPPINGS = [ ,{ 'type' : 'lang' , "rm_name" : 'presentation_title', "jpcoar_name" : 'dc:title' , "weko_name" :"title"} ,{ 'type' : 'lang' , "rm_name" : 'work_title', "jpcoar_name" : 'dc:title' , "weko_name" :"title"} ,{ 'type' : 'lang' , "rm_name" : 'other_title', "jpcoar_name" : 'dc:title' , "weko_name" :"title"} - + ,{'type' : 'lang' , "rm_name" : 'description', "jpcoar_name" : 'datacite:description' , "weko_name" :"description"} ,{'type' : 'lang' , "rm_name" : 'publisher', "jpcoar_name" : 'dc:publisher' , "weko_name" :"publisher"} ,{'type' : 'lang' , "rm_name" : 'publication_name', "jpcoar_name" : 'jpcoar:sourceTitle' , "weko_name" :"sourceTitle"} @@ -770,6 +770,22 @@ WEKO_RECORDS_UI_OA_UPDATE_STATUS_URL = "" # The API URL to get OA policies. example: "/api/archive_policies" WEKO_RECORDS_UI_OA_GET_OA_POLICIES_URL = "" +# For Import Replace Rules +WEKO_SEARCH_UI_IMPORT_REPLACE_RULES = { + "pipe_full_width": { + "from": "|", + "to": "|", + "is_regex": False, + "target_path": [] + } +} +# Import Replace Rule Map +WEKO_SEARCH_UI_IMPORT_REPLACE_RULE_MAP = { + "32001": [ + "pipe_full_width" + ] +} + # For JGSS # 1. User-Profile