-
Notifications
You must be signed in to change notification settings - Fork 53
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
[3.3] 1924 export associations as resource relationship #1933
base: Development
Are you sure you want to change the base?
[3.3] 1924 export associations as resource relationship #1933
Conversation
…nd begin to implement some of the export logic
"request": "launch", | ||
"port": 9003, | ||
"xdebugSettings": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was autoformatted. But also the xdebugSettings section was added because my xDebugger values were being very confusingly truncated. Fixed here slash not at all sure why this is being tracked in the repo.
Fixed in 20a3b08. |
… omoccurrences so that occurrenceID can be queried
- Load associations via 2 separate queries: -- one using occid -- the other using occidAssociate with the relationship translated to its inverse
association export mod
…rceID, which required some logic change since omoccurrences does not have objectID nor instanceID
$termArr['deleteMeOccidAssociate'] = 'https://dwc.tdwg.org/terms/#dwc:resourceRelationshipID'; | ||
$columnArr['deleteMeOccidAssociate'] = 'oa.occidAssociate'; | ||
$termArr['resourceRelationshipID'] = 'https://dwc.tdwg.org/terms/#dwc:resourceRelationshipID'; | ||
// $columnArr['resourceRelationshipID'] = 'IFNULL(IFNULL(IFNULL(oa.objectID, o.occurrenceID), o.recordID), oa.resourceUrl)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll delete some of these commented-out lines once we're more confident about the current strategy.
return array_diff_key($dataArr, array_flip($trimArr)); | ||
} | ||
|
||
// @TODO decide if setDynamicFields is needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, right?
foreach($this->fieldArr['fields'] as $colName){ | ||
if($colName) $sqlFrag .= ', ' . $colName; | ||
} | ||
// $this->sqlBase = 'SELECT ' . trim($sqlFrag, ', ') . ' FROM omoccurassociations '; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove upon approval.
</div> | ||
<div class="formField-div"> | ||
<input name="collid" type="hidden" value="<?= $collid ?>" > | ||
<input name="MAX_FILE_SIZE" type="hidden" value="10000000" /> | ||
<button name="submitAction" type="submit" value="initiateImport"><?= $LANG['INITIALIZE_IMPORT'] ?></button> | ||
<button name="submitAction" class="submit__button--no-left-margin" type="submit" value="initiateImport"><?= $LANG['INITIALIZE_IMPORT'] ?></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little styling fix
@@ -8,7 +8,7 @@ | |||
else include_once($SERVER_ROOT . '/content/lang/collections/datasets/datapublisher.en.php'); | |||
header('Content-Type: text/html; charset=' . $CHARSET); | |||
|
|||
$collid = array_key_exists('collid', $_REQUEST) ? filter_var($_REQUEST['collid'], FILTER_SANITIZE_NUMBER_INT) : 0; | |||
$collid = array_key_exists('collid', $_REQUEST) ? filter_var($_REQUEST['collid'], FILTER_SANITIZE_NUMBER_INT) : 0; // @TODO collid is really coming from db in the searchvar attribute of the request, right? So it'll always be incorrect here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a future easy issue to clean up?
@@ -337,11 +338,14 @@ function importTypeChanged(selectElement){ | |||
<option value="externalOccurrence"><?= $LANG['EXTERNAL_OCCURRENCE'] ?></option> | |||
<option value="observational"><?= $LANG['OBSERVATION'] ?></option> | |||
</select> | |||
<div class="top-breathing-room-rel danger" style="color: var(--danger-color);"> | |||
<caption><?= $LANG['ASSOCIATION_UPLOAD_WARNING'] ?></caption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little behavioral nudge for the end users who could footgun themselves with bulk uploading associations matching to the correct catalogNumber in an off-target collection (since cross-collection associations are correctly allowed as well).
@@ -33,7 +33,7 @@ | |||
$LANG['FIELD_MAPPING'] = 'Field Mapping'; | |||
$LANG['BATCH_DELETE'] = 'Batch Delete'; | |||
$LANG['NEW_BLANK_RECORD'] = 'Link media to new blank record if catalog number does not exist'; | |||
$LANG['MATCHING_IDENTIFIERS'] = 'Update or delete records with matching identifiers (subject identifier plus objectID or resourceUrl)'; | |||
$LANG['MATCHING_IDENTIFIERS'] = 'Update or delete existing association with matching identifiers (subject identifier plus objectID or resourceUrl)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per conversations with @themerekat , minor copy adjustments here.
Oh interesting. This is an observational association. Maybe we make that a problem for FutureMark? |
* swap the occid and occidAssociate in getAssociatedRecords in classes/AssociationManager.php in order to get any results in the external observation export * add third logic block to getAssociatedRecords targetting observations and external observations * begin to remove cruft on 1924-pt2-external-and-observational-occurrences branch * remove more cruft * remove more cruft * respond to code review feedback
Description
This PR allows for the download of related records. It addresses issue #1924 .
From the issue specs:
QA Notes
Live on dev001. In addition to all of the nuances of what we should map from Symbiota Native fields to DwC, note that I haven't tested the Darwin Core-only download or skipping the download entirely in a while.
Notes/Known Issues
This PR does not accommodate external or observational associations. They are in a separate issue.
Pull Request Checklist:
Pre-Approval
master
branch and PR'd using the merge option (not squashed) into thehotfix
branch.Development
branch, NOTmaster
Post-Approval
Development
branch, remember to use the squash & merge optionhotfix
branch, remember to use the merge option (i.e., no squash).Development
branch into the master branch, remember to use the merge optionhotfix
branch into themaster
branch use the squash & merge optionmaster
intoDevelopment
should be made with the merge option (i.e., no squash).hotfix
branch and create a newhotfix
branchhotfix
branch.Development
branch before a tagged release (i.e., before an imminent merge into the master branch), make sure to notify the team and lock theDevelopment
branch to prevent accidental merges while QA takes place. Follow the release protocol here.Thanks for contributing and keeping it clean!