Dynamic Relation Lookup customization 7.3

45 views
Skip to first unread message

Vicente Zapatero Martin

unread,
Oct 18, 2022, 6:47:26 AM10/18/22
to DSpace Developers
In submission-forms.xml in row element in entities submission forms there is a field called relation-field like this.

            <row>
                <relation-field>
                    <relationship-type>isProjectOfPublication</relationship-type>
                    <search-configuration>project</search-configuration>
                    <repeatable>true</repeatable>
                    <name-variants>false</name-variants>
                    <label>Funding</label>
                    <hint>Add a related Funding</hint>
                    <linked-metadata-field>
                        <dc-schema>dc</dc-schema>
                        <dc-element>relation</dc-element>
                        <input-type>onebox</input-type>
                    </linked-metadata-field>
                    <externalsources>openAIREFunding</externalsources>
                    <required></required>
                </relation-field>
            </row>

I'm trying to reuse this modal windows with its button for fill another metadata field. I'd like to select a project and complete dc.relation.projectID metadata field for example. I can't do it. It allways completes the same metadata dc.relation even if I change linked-metadata-field.

Exists some help wiki page with elements of this relation-field? Exists some control with functionality similar? Like popup, selector, authority control in older dspace versions? Any example or case of use?

Thanks!

DSpace Developers

unread,
Oct 30, 2022, 6:40:42 PM10/30/22
to DSpace Developers
Hi, the full Entity documentation is at https://wiki.lyrasis.org/display/DSDOC7x/Configurable+Entities which might help. Are you using the same external source (Open AIRE Funding) for this new submission confirmation? (or no external sources?)

At a glance, I can't see any reason why this field would be overwritten so perhaps there is something else going on. When you test this out, is the target collection mapped to the correct submission process and form which includes your new project relation field?

Cheers

Kim

Vicente Zapatero Martin

unread,
Nov 3, 2022, 10:12:20 AM11/3/22
to DSpace Developers
Hi. Thanks for the answer.

I've used the same external content (Open Aire Funding) but I would like to save metadata value in other metadata field different of dc.relation, for example: dc.relation.projectID3. I finded out a way to customize project popup. I've mapped target collection like you advised me. Before I enabled entities and open aire entities following wiki. I've changed virtual-metadata.xml.

In [dspace]\config\spring\api\virtual-metadata.xml

    <util:map id="isProjectOfPublicationMap">
        <entry key="dc.relation" value-ref="publicationProject_name"/>
        <entry key="dc.relation.projectID3" value-ref="publicationProject_name"/>
..

In submission form:

            <row>
                <relation-field>
                    <relationship-type>isProjectOfPublication</relationship-type>
                    <search-configuration>project</search-configuration>
                    <repeatable>true</repeatable>
                    <name-variants>false</name-variants>
                    <label>Funding</label>
                    <hint>Add a related Funding</hint>
                    <linked-metadata-field>
                        <dc-schema>dc</dc-schema>
                        <dc-element>relation</dc-element>
                        <dc-qualifier>projectID3</dc-qualifier>
                        <input-type>onebox</input-type>
                    </linked-metadata-field>
                    <externalsources>openAIREFunding</externalsources>
                    <required></required>
                </relation-field>
            </row>


And now I'm trying to customize front end project pop up, extending functionality in [dspace-ang]\src\app\shared\form\builder\ds-dynamic-form-ui\ds-dynamic-form-control-container.component.ts:
...
  ngOnInit(): void {
    this.isRelationship = hasValue(this.model.relationship);

    if(this.isRelationship) {
      switch(this.model.metadataFields[0])
      {
        case "dc.relation":
        case "dc.relation.projectID3":
          this.ntePopup = true;
          break;
      }
    }
...
I'm testing it.

Thanks.

Reply all
Reply to author
Forward
0 new messages