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
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
194 changes: 194 additions & 0 deletions src/main/resources/db/changelog/changes/v2.1.1/harvested-views.xml
n-bux marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
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!

<preConditions onFail="CONTINUE">
<tableExists tableName="publication_request" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_publication_request">
SELECT * FROM ${tenant_id}_mod_oa.publication_request
</createView>
</changeSet>

<changeSet id="create_view_refdata_value" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="refdata_value" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_refdata_value">
SELECT * FROM ${tenant_id}_mod_oa.refdata_value
</createView>
</changeSet>

<changeSet id="create_view_request_party" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="request_party" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_request_party">
SELECT * FROM ${tenant_id}_mod_oa.request_party
</createView>
</changeSet>

<changeSet id="create_view_party" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="party" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_party">
SELECT * FROM ${tenant_id}_mod_oa.party
</createView>
</changeSet>

<changeSet id="create_view_work" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="work" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_work">
SELECT * FROM ${tenant_id}_mod_oa.work
</createView>
</changeSet>

<changeSet id="create_view_title_instance" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="title_instance" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_title_instance">
SELECT * FROM ${tenant_id}_mod_oa.title_instance
</createView>
</changeSet>

<changeSet id="create_view_identifier_occurrence" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="identifier_occurrence" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_identifier_occurrence">
SELECT * FROM ${tenant_id}_mod_oa.identifier_occurrence
</createView>
</changeSet>

<changeSet id="create_view_identifier" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="identifier" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_identifier">
SELECT * FROM ${tenant_id}_mod_oa.identifier
</createView>
</changeSet>

<changeSet id="create_view_identifier_namespace" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="identifier_namespace" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_identifier_namespace">
SELECT * FROM ${tenant_id}_mod_oa.identifier_namespace
</createView>
</changeSet>

<changeSet id="create_view_charge" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="charge" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_charge">
SELECT * FROM ${tenant_id}_mod_oa.charge
</createView>
</changeSet>

<changeSet id="create_view_monetary_value" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="monetary_value" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_monetary_value">
SELECT * FROM ${tenant_id}_mod_oa.monetary_value
</createView>
</changeSet>

<changeSet id="create_view_exchange_rate" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="exchange_rate" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_exchange_rate">
SELECT * FROM ${tenant_id}_mod_oa.exchange_rate
</createView>
</changeSet>

<changeSet id="create_view_alternate_email_address" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="alternate_email_address" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_alternate_email_address">
SELECT * FROM ${tenant_id}_mod_oa.alternate_email_address
</createView>
</changeSet>

<changeSet id="create_view_checklist_item" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="checklist_item" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_checklist_item">
SELECT * FROM ${tenant_id}_mod_oa.checklist_item
</createView>
</changeSet>

<changeSet id="create_view_checklist_item_definition" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="checklist_item_definition" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_checklist_item_definition">
SELECT * FROM ${tenant_id}_mod_oa.checklist_item_definition
</createView>
</changeSet>

<changeSet id="create_view_payer" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="payer" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_payer">
SELECT * FROM ${tenant_id}_mod_oa.payer
</createView>
</changeSet>

<changeSet id="create_view_publication_status" author="your_author_name_here">
<preConditions onFail="CONTINUE">
<tableExists tableName="publication_status" schemaName="${tenant_id}_mod_oa"/>
</preConditions>
<createView
replaceIfExists="true"
viewName="src_oa_publication_status">
SELECT * FROM ${tenant_id}_mod_oa.publication_status
</createView>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
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..

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

columns: [
{
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

{
name: 'party_version',
dataType: {
dataType: 'integerType',
},
queryable: true,
valueGetter: 'party.version',
},
{
name: 'party_title',
dataType: {
dataType: 'stringType',
},
queryable: true,
valueGetter: 'party.p_title',
},
{
name: 'party_family_name',
dataType: {
dataType: 'stringType',
},
queryable: true,
visibleByDefault: true,
valueGetter: 'party.p_family_name',
},
{
name: 'party_given_names',
dataType: {
dataType: 'stringType',
},
queryable: true,
visibleByDefault: true,
valueGetter: 'party.p_given_names',
},
],
defaultSort: [
{
columnName: 'party_id',
direction: 'ASC',
},
],
}
Loading