Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9e6ab61
Add fields for manuscript metadata
yacchin1205 Mar 5, 2025
c00ecbf
Add DOI autofill functionality for manuscript metadata
yacchin1205 Aug 13, 2025
f0a824d
Add display_template support for array fields in metadata schemas
yacchin1205 Aug 17, 2025
4d15a0b
Add configurable SWORD payload export helpers
yacchin1205 Sep 26, 2025
6d9d9c6
Upgrade RO-Crate logic and tests
yacchin1205 Sep 26, 2025
a359771
Make DEFAULT_APPLICATION_SCOPES configurable in WEKO provider
yacchin1205 Nov 11, 2025
9ed0f7c
Fix flake8 errors (trailing whitespace and unused imports)
yacchin1205 Nov 11, 2025
e629e9a
Add ROR ID mapping for Japanese funding organizations
yacchin1205 Nov 11, 2025
e885698
Fix default_scopes to use local variable and remove ro_crate.md
yacchin1205 Nov 11, 2025
27c7b36
Fix code style violations and WEKO provider scope tests
yacchin1205 Nov 11, 2025
c79f5f3
Merge upstream/develop into feature/manuscript-r4-rebased
yacchin1205 Dec 5, 2025
0cbbc2d
Fix file path in RO-Crate and CSV to match BagIt structure
yacchin1205 Dec 10, 2025
591c769
Fix migrations: restore upstream files and consolidate new migrations
yacchin1205 Dec 10, 2025
06da86d
Merge remote-tracking branch 'upstream/develop' into feature/manuscri…
yacchin1205 Dec 10, 2025
6cca3bc
Change parse error log level from debug to warning
yacchin1205 Dec 10, 2025
59c2583
Skip validation for disabled fields (enabled_if=false)
yacchin1205 Dec 10, 2025
31c2663
Fix flake8 E303: remove extra blank line
yacchin1205 Dec 10, 2025
a4f8c5d
Fix URL/DOI patterns to allow https:// prefix
yacchin1205 Dec 10, 2025
960ac79
Fix enabled_if evaluation in multiple edit mode and reset scroll posi…
yacchin1205 Dec 10, 2025
538494c
Add KAKEN suggestion for manuscript authors
yacchin1205 Dec 10, 2025
6865c81
Change RO-Crate file path to relative (RCOSDP/weko#1746 merged)
yacchin1205 Dec 11, 2025
409ff93
Show error message when DOI metadata not found
yacchin1205 Dec 12, 2025
958c354
Allow draft selection even with metadata validation errors
yacchin1205 Dec 16, 2025
4231321
Add funderIdentifier ROR ID for MOD using ATLA (防衛装備庁)
yacchin1205 Dec 16, 2025
fe2bed1
Fix files format and update schema ID in example config JSONs
yacchin1205 Dec 16, 2025
841a5ff
Add result dialog for SWORD deposite
yacchin1205 Dec 22, 2025
986b943
Add file access rights and embargo date mapping, fix DataManager iden…
yacchin1205 Dec 26, 2025
dc45ed6
Add support for file locking
yacchin1205 Jan 31, 2025
fbc08d9
Add workflow addon
yacchin1205 Sep 30, 2025
da8a113
Fix missing workflow addon static assets in Dockerfile
yacchin1205 Jan 8, 2026
eca4cd0
Add allow_empty_files option for MEBYO schema to generate RO-Crate wi…
yacchin1205 Jan 26, 2026
0b50d3d
Merge migrations
yacchin1205 Jan 30, 2026
9bd10fa
Fix TypeError in _flatten_json_ld_root for MEBYO schema with files
yacchin1205 Feb 4, 2026
b1da0fe
Fix duplicate hasPart entries for MEBYO schema extended metadata files
yacchin1205 Feb 5, 2026
44d478c
Add jpcoar:affiliation mapping for authors and data manager
yacchin1205 Feb 6, 2026
269df86
Add email and profile read scopes to workflow delegation tokens
yacchin1205 Feb 7, 2026
3b3f5cd
Add item:update scope to default WEKO OAuth2 scopes
yacchin1205 Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ COPY ./addons/iqbrims/static/ ./addons/iqbrims/static/
COPY ./addons/binderhub/static/ ./addons/binderhub/static/
COPY ./addons/metadata/static/ ./addons/metadata/static/
COPY ./addons/onlyoffice/static/ ./addons/onlyoffice/static/
COPY ./addons/workflow/static/ ./addons/workflow/static/
RUN \
# OSF
yarn install --frozen-lockfile \
Expand Down
9 changes: 6 additions & 3 deletions addons.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"binderhub",
"onedrivebusiness",
"metadata",
"onlyoffice"
"onlyoffice",
"workflow"
],
"addons_default": [
"osfstorage",
Expand Down Expand Up @@ -138,7 +139,8 @@
"binderhub": "GakuNin Federated Computing Services (Jupyter) is a web-based interactive computational environment. Files on a GakuNin RDM project can be imported to/exported from GakuNin Federated Computing Services (Jupyter)",
"onedrivebusiness": "OneDrive for Office365 is a file storage add-on. Connect your Microsoft OneDrive account to a GakuNin RDM project to interact with files hosted on Microsoft OneDrive via the GakuNin RDM.",
"metadata": "The Metadata addon provides the functionality to register metadata to files and generate reports.",
"onlyoffice": "ONLYOFFICE document server."
"onlyoffice": "ONLYOFFICE document server.",
"workflow": "Workflow gateway integration that serves engine key material to trusted services."
},
"addons_url": {
"box": "http://www.box.com",
Expand Down Expand Up @@ -166,7 +168,8 @@
"binderhub": "https://binder.cs.rcos.nii.ac.jp",
"onedrivebusiness": "https://onedrive.live.com",
"metadata": "https://rcos.nii.ac.jp/service/rdm/",
"onlyoffice": "https://onlyoffice.com/"
"onlyoffice": "https://onlyoffice.com/",
"workflow": "https://rcos.nii.ac.jp/service/rdm/"
},
"institutional_storage_add_on_method": [
"nextcloudinstitutions",
Expand Down
1 change: 1 addition & 0 deletions addons/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ def addon_view_file(auth, node, file_node, version):
'file_id': file_node._id,
'allow_comments': file_node.provider in settings.ADDONS_COMMENTABLE,
'checkout_user': file_node.checkout._id if file_node.checkout else None,
'locked_user': file_node.locked._id if file_node.locked else None,
'version_names': list(version_names),
'wopi_onlyoffice': onlyoffice_settings.WOPI_CLIENT_ONLYOFFICE,
})
Expand Down
25 changes: 25 additions & 0 deletions addons/metadata/SCHEMA-EXTENSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Metadata Schema Extensions

This document describes extensions to the standard metadata schema format.

## display_template

For `type: "array"` fields, you can specify a `display_template` to control how the data is displayed in collapsed view.

**Note**: `display_template` for `type: "object"` fields is not currently supported. The implementation focuses on array fields only.

### Behavior

#### For `type: "array"`
- **View mode**: Table display where `display_template` is split by `|` to define each column
- Example: `"{{prop1}}|{{prop2}}|{{prop3}}"` creates 3 columns
- **Edit mode**: Row expands to show all fields vertically

#### For `type: "object"`
- **Not supported**: `display_template` is ignored for object type fields
- Object fields always display all properties in a standard table format

### Template Variables
- Use `{{property_id}}` to reference properties
- For nested properties, use dot notation: `{{object_id.child_id}}`
- Empty values are rendered as empty strings
2 changes: 2 additions & 0 deletions addons/metadata/report_format/report_en.csv.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Funder,Funding stream code in Japan Grant Number,Program name,Japan Grant Number,Project name,Data No.,Title,Date (Issued / Updated),Description,Research field,Data type,File size,Data utilization and provision policy(Free/Consideration),Data utilization and provision policy(License),Data utilization and provision policy(citation information),Access rights,Publication date (for embargoed access),Repository information,Repository URL/ DOI link,Creator Name,Creator name identifier (e-Rad),Hosting institution,Hosting institution Identifier,Data manager,Data manager identifier (e-Rad),Contact organization of data manager,Contact address of data manager,Contact phone number of data manager,Contact mail address of data manager,Remarks
{% for grdm_file in grdm_files -%}
{%- if grdm_file.file_type != 'manuscript' -%}
{{funder_tooltip_1 | quotecsv}},{{funding_stream_code | quotecsv}},{{program_name_en | quotecsv}},{{japan_grant_number | quotecsv}},{{project_name_en | quotecsv}},{{grdm_file.data_number | quotecsv}},{{grdm_file.title_en | quotecsv}},{{grdm_file.date_issued_updated | quotecsv}},{{grdm_file.data_description_en | quotecsv}},
{%- if grdm_file.data_research_field == 'project' -%}
{{project_research_field_tooltip_1 | quotecsv}}
{%- else -%}
{{grdm_file.data_research_field_tooltip_1 | quotecsv}}
{%- endif -%}
,{{grdm_file.data_type_tooltip_1 | quotecsv}},{{grdm_file.file_size | quotecsv}},{{grdm_file.data_policy_free_tooltip_1 | quotecsv}},{{grdm_file.data_policy_license | quotecsv}},{{grdm_file.data_policy_cite_en | quotecsv}},{{grdm_file.access_rights_tooltip_1 | quotecsv}},{{grdm_file.available_date | quotecsv}},{{grdm_file.repo_information_en | quotecsv}},{{grdm_file.repo_url_doi_link | quotecsv}},{{grdm_file.creators | map(attribute="name_en") | join(";") | quotecsv}},{{grdm_file.creators | map(attribute="number") | join(";") | quotecsv}},{{grdm_file.hosting_inst_en | quotecsv}},{{grdm_file.hosting_inst_id | quotecsv}},{{grdm_file.data_man_name_en | quotecsv}},{{grdm_file.data_man_number | quotecsv}},{{grdm_file.data_man_org_en | quotecsv}},{{grdm_file.data_man_address_en | quotecsv}},{{grdm_file.data_man_tel | quotecsv}},{{grdm_file.data_man_email | quotecsv}},{{grdm_file.remarks_en | quotecsv}}
{%- endif -%}
{% endfor %}
2 changes: 2 additions & 0 deletions addons/metadata/report_format/report_ja.csv.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
資金配分機関情報,体系的番号におけるプログラム情報コード,プログラム名,体系的番号,プロジェクト名,データNo.,データの名称,掲載日・掲載更新日,データの説明,データの分野,データ種別,概略データ量,管理対象データの利活用・提供方針 (有償/無償),管理対象データの利活用・提供方針(ライセンス),管理対象データの利活用・提供方針(引用方法等),アクセス権,公開予定日 (公開期間猶予の場合),リポジトリ情報,リポジトリURL・DOIリンク,データ作成者,データ作成者の研究者番号,データ管理機関,データ管理機関コード,データ管理者,データ管理者の研究者番号,データ管理者の所属組織名,データ管理者の所属機関の連絡先住所,データ管理者の所属機関の連絡先電話番号,データ管理者の所属機関の連絡先メールアドレス,備考
{% for grdm_file in grdm_files -%}
{%- if grdm_file.file_type != 'manuscript' -%}
{{funder_tooltip_0 | quotecsv}},{{funding_stream_code | quotecsv}},{{program_name_ja | quotecsv}},{{japan_grant_number | quotecsv}},{{project_name_ja | quotecsv}},{{grdm_file.data_number | quotecsv}},{{grdm_file.title_ja | quotecsv}},{{grdm_file.date_issued_updated | quotecsv}},{{grdm_file.data_description_ja | quotecsv}},
{%- if grdm_file.data_research_field == 'project' -%}
{{project_research_field_tooltip_0 | quotecsv}}
{%- else -%}
{{grdm_file.data_research_field_tooltip_0 | quotecsv}}
{%- endif -%}
,{{grdm_file.data_type_tooltip_0 | quotecsv}},{{grdm_file.file_size | quotecsv}},{{grdm_file.data_policy_free_tooltip_0 | quotecsv}},{{grdm_file.data_policy_license | quotecsv}},{{grdm_file.data_policy_cite_ja | quotecsv}},{{grdm_file.access_rights_tooltip_0 | quotecsv}},{{grdm_file.available_date | quotecsv}},{{grdm_file.repo_information_ja | quotecsv}},{{grdm_file.repo_url_doi_link | quotecsv}},{{grdm_file.creators | map(attribute="name_ja") | join(";") | quotecsv}},{{grdm_file.creators | map(attribute="number") | join(";") | quotecsv}},{{grdm_file.hosting_inst_ja | quotecsv}},{{grdm_file.hosting_inst_id | quotecsv}},{{grdm_file.data_man_name_ja | quotecsv}},{{grdm_file.data_man_number | quotecsv}},{{grdm_file.data_man_org_ja | quotecsv}},{{grdm_file.data_man_address_ja | quotecsv}},{{grdm_file.data_man_tel | quotecsv}},{{grdm_file.data_man_email | quotecsv}},{{grdm_file.remarks_ja | quotecsv}}
{%- endif -%}
{% endfor %}
4 changes: 3 additions & 1 deletion addons/metadata/settings/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
EXCLUDED_ADDONS_FOR_EXPORT = ['mendeley', 'zotero', 'iqbrims']
EXCLUDED_ADDONS_FOR_EXPORT += ['dropboxbusiness', 'nextcloudinstitutions', 'ociinstitutions', 'onedrivebusiness', 's3compatinstitutions']


# KAKEN Elasticsearch settings
# If None, KAKEN functionality is disabled
KAKEN_ELASTIC_URI = os.getenv('KAKEN_ELASTIC_URI')
Expand Down Expand Up @@ -52,3 +51,6 @@
}
}
}

# PubMed API key for accessing external metadata (Optional)
PUBMED_API_KEY = None
77 changes: 63 additions & 14 deletions addons/metadata/static/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,13 @@ function MetadataButtons() {
self.lastQuestionPage = self.createQuestionPage(
schema.attributes.schema,
lastMetadataItem,
{
Object.assign({}, options, {
readonly: !((context.projectMetadata || {}).editable) || lastMetadataItem.readonly,
multiple: options.multiple,
context: context,
filepath: filepath,
wbcache: context.wbcache,
fileitem: fileitem
}
})
);
self.lastFields = self.lastQuestionPage.fields;
container.empty();
Expand Down Expand Up @@ -570,6 +569,9 @@ function MetadataButtons() {
{}
);
dialog.container.append(fieldContainer);
dialog.dialog.one('shown.bs.modal', function() {
dialog.dialog.find('.metadata-scroll-area').scrollTop(0);
});
dialog.dialog.modal('show');
};

Expand Down Expand Up @@ -602,6 +604,47 @@ function MetadataButtons() {
const targetItem = targetItems.filter(Boolean)[0] || {};
const selector = self.createSchemaSelector(targetItem);
self.currentSchemaId = selector.currentSchemaId;

// Compute common values and default values for selected files
function computeValuesForMultipleEdit(schemaId) {
const schema = self.findSchemaById(schemaId);
const schemaObj = schema.attributes.schema;
const defaultValues = {};
const allQids = [];
(schemaObj.pages || []).forEach(function(page) {
(page.questions || []).forEach(function(question) {
allQids.push(question.qid);
(question.options || []).forEach(function(opt) {
if (opt.default) {
defaultValues[question.qid] = opt.text;
}
});
});
});
const commonValues = {};
allQids.forEach(function(qid) {
const values = filepaths.map(function(filepath) {
const metadata = self.findMetadataByPath(context.nodeId, filepath);
if (!metadata) {
return defaultValues[qid] || null;
}
const item = (metadata.items || []).find(function(item) {
return item.schema === schemaId;
});
if (!item) {
return defaultValues[qid] || null;
}
const field = item.data[qid];
return (field && field.value) || defaultValues[qid] || null;
});
const first = values[0];
if (first && values.every(function(v) { return v === first; })) {
commonValues[qid] = first;
}
});
return {commonValues: commonValues, defaultValues: defaultValues};
}

selector.schema.change(function(event) {
if (event.target.value === self.currentSchemaId) {
return;
Expand All @@ -613,7 +656,7 @@ function MetadataButtons() {
self.findSchemaById(self.currentSchemaId),
filepaths,
items,
{multiple: true}
Object.assign({multiple: true}, computeValuesForMultipleEdit(self.currentSchemaId))
);
});
dialog.toolbar.empty();
Expand All @@ -628,10 +671,12 @@ function MetadataButtons() {
self.findSchemaById(self.currentSchemaId),
filepaths,
items,
{multiple: true}
Object.assign({multiple: true}, computeValuesForMultipleEdit(self.currentSchemaId))
);
dialog.container.append(fieldContainer);

dialog.dialog.one('shown.bs.modal', function() {
dialog.dialog.find('.metadata-scroll-area').scrollTop(0);
});
dialog.dialog.modal('show');
};

Expand Down Expand Up @@ -1094,14 +1139,18 @@ function MetadataButtons() {
if (self.lastQuestionPage.hasValidationError) {
message.text(_('There are errors in some fields.')).css('color', 'red');
}
if (self.selectDraftDialog) {
self.selectDraftDialog.select.attr('disabled', self.lastQuestionPage.hasValidationError);
}
draftSelectionContainer.empty();
draftSelectionContainer.append(message);
draftSelectionContainer.append(
self.createDraftsSelect(schema, self.lastQuestionPage.hasValidationError).css('margin', '1em 0')
);
const draftsSelect = self.createDraftsSelect(schema, false).css('margin', '1em 0');
draftSelectionContainer.append(draftsSelect);
if (self.selectDraftDialog) {
const updateSelectButton = function() {
const hasChecked = draftsSelect.find('input[type="checkbox"]:checked').length > 0;
self.selectDraftDialog.select.attr('disabled', !hasChecked);
};
draftsSelect.find('input[type="checkbox"]').on('change', updateSelectButton);
updateSelectButton();
}
};

self.openDraftModal = function(currentMetadata) {
Expand Down Expand Up @@ -2180,7 +2229,7 @@ function MetadataButtons() {
.append($('<div class="row"></div>')
.append($('<div class="col-sm-12"></div>')
.append(toolbar))
.append($('<div class="col-sm-12"></div>')
.append($('<div class="col-sm-12 metadata-scroll-area"></div>')
.css('overflow-y', 'scroll')
.css('height', '66vh')
.append(container))))
Expand Down Expand Up @@ -2237,7 +2286,7 @@ function MetadataButtons() {
.append($('<div class="row"></div>')
.append($('<div class="col-sm-12"></div>')
.append(toolbar))
.append($('<div class="col-sm-12"></div>')
.append($('<div class="col-sm-12 metadata-scroll-area"></div>')
.css('overflow-y', 'scroll')
.css('height', '70vh')
.append(container))))
Expand Down
Loading