Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenAccess Entity types to FQM / Lists App #277

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

n-bux
Copy link
Contributor

@n-bux n-bux commented May 23, 2024

Purpose

Add relevant views from the OpenAccess module (as identified by the Reporting SIG in the Wiki) as new entity types to FQM Manager in order to make them available in "Lists" app

Approach

  • add Source Views via a new Liquibase "harvested-views.xml"
  • define Entity Types in JSON5-files and the corresponding labels in the translation folder

TODOS and Open Questions

  • add Source Views for all source tables of the planned views
  • add a first Entity Type representing one of the reporting views ("Party")
  • add 7 more Entity Types
  • ..?..

Learning

Describe the research stage. Add links to blog posts, patterns, libraries or addons used to solve this problem.

Pre-Merge Checklist

If you are adding entity type(s), have you:

  • Added the JSON5 definition to the src/main/resources/entity-types directory?
  • Ensured that GETing the entity type at /entity-types/{id} works as expected?
  • Added translations for all fields, per the translation guidelines? (Check this by ensuring GET /entity-types/{id} does not have mod-fqm-manager.entityType. in the response)
  • Added views to liquibase, as applicable?
  • Added required interfaces to the module descriptor?
  • Checked that querying fields works correctly and all SQL is valid?

@CLAassistant
Copy link

CLAassistant commented May 23, 2024

CLA assistant check
All committers have signed the CLA.

@n-bux n-bux changed the title [WIP] first try adding first OpenAccess Entity type Add OpenAccess Entity types to FQM / Lists App May 23, 2024
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

<changeSet id="create_view_publication_request" author="your_author_name_here">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super small thing, but

Suggested change
<changeSet id="create_view_publication_request" author="your_author_name_here">
<changeSet id="create_view_publication_request" author="[email protected]">

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I wasn't sure which address to use yet.. my student mail won't be accessible after graduation.. I will add one!

id: '0f8f6d6f-504f-4aa9-9d98-9779aaaa907b',
name: 'drv_openaccess_party',
private: false,
fromClause: 'src_oa_party AS party\nLEFT JOIN src_oa_alternate_email_address ON alternate_email_address.aea_owner_fk=party.p_id\nLEFT JOIN src_oa_refdata_value AS p_institution_level_1 ON p_institution_level_1.rdv_id=party.p_institution_level_1_fk',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is JSON5, you can add line breaks to make this more readable

Suggested change
fromClause: 'src_oa_party AS party\nLEFT JOIN src_oa_alternate_email_address ON alternate_email_address.aea_owner_fk=party.p_id\nLEFT JOIN src_oa_refdata_value AS p_institution_level_1 ON p_institution_level_1.rdv_id=party.p_institution_level_1_fk',
fromClause: 'src_oa_party AS party \
LEFT JOIN src_oa_alternate_email_address ON alternate_email_address.aea_owner_fk=party.p_id \
LEFT JOIN src_oa_refdata_value AS p_institution_level_1 ON p_institution_level_1.rdv_id=party.p_institution_level_1_fk',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I entered line break in the entity type creator, and it changed it to "\n" automatically..

when I tried changing this to line breaks in the source file, it didn't work (I used line breaks plus indentation, maybe that doesn't work?)

but for me no big deal here..

Comment on lines 7 to 15
{
name: 'party_id',
dataType: {
dataType: 'openUUIDType',
},
queryable: true,
visibleByDefault: true,
valueGetter: 'party.p_id',
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe at least 1 column needs isIdColumn: true (something like that... I might have the property name wrong).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I did tick the box in entity type creator, but it wasn't written to the file.. I did it manually now..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem was: entity type creator has got a bug, the checkbox in the UI is mislinked to visibleByDefault

id: '0f8f6d6f-504f-4aa9-9d98-9779aaaa907b',
name: 'drv_openaccess_party',
private: false,
fromClause: 'src_oa_party AS party\nLEFT JOIN src_oa_alternate_email_address ON alternate_email_address.aea_owner_fk=party.p_id\nLEFT JOIN src_oa_refdata_value AS p_institution_level_1 ON p_institution_level_1.rdv_id=party.p_institution_level_1_fk',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like src_oa_alternate_email_address or src_oa_refdata_value are actually used, so this could just be

Suggested change
fromClause: 'src_oa_party AS party\nLEFT JOIN src_oa_alternate_email_address ON alternate_email_address.aea_owner_fk=party.p_id\nLEFT JOIN src_oa_refdata_value AS p_institution_level_1 ON p_institution_level_1.rdv_id=party.p_institution_level_1_fk',
fromClause: 'src_oa_party AS party',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they will be used for more columns, I just wanted to start testing with a few columns only

Copy link

sonarcloud bot commented Jun 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants