Skip to content

Commit

Permalink
Merge pull request #1453 in PELAGOS/pelagos from release/5.0.0 to master
Browse files Browse the repository at this point in the history
* commit '51d0af193ffb622b93c8e5072ed92c7b93aa6b8d': (590 commits)
  Fixed the logic to get the spatial extent geometry
  Removed extra line
  Removed the unused exception
  Added new line at the end of the file
  Added a new listener for Doi deletion
  Undo changes to DoctrineDatasestListener
  Changed the producer msg body to doi
  Added another exception message for doi's which are public which can't be deleted
  Fixed the curl delete commands for delete action
  Fixed gcs
  Included deletion of DOI in the consumer
  Added credentials for the delete action
  Changed the name of the delete method
  Added event in the dataset listener
  Added delete routing key to the list
  Refactored the logic
  Removed the twig template for request revisions and added logic to send the appropriate datasetSubmission object
  Using the doi-issue consumer to delete from the Dataset API
  Added the consumer method to delete the Doi using the method in Util class
  Added the curl delete DOI method in the Util class
  ...
  • Loading branch information
praneethpr committed Aug 10, 2018
2 parents 839663f + 51d0af1 commit 4a45f47
Show file tree
Hide file tree
Showing 120 changed files with 9,311 additions and 1,542 deletions.
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright 2018 Texas A&M University-Corpus Christi

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 changes: 65 additions & 0 deletions app/DoctrineMigrations/Version20180112154729.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace Pelagos\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180112154729 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('CREATE SEQUENCE dataset_submission_review_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE dataset_submission_review (id INT NOT NULL, dataset_submission_id INT DEFAULT NULL, creator_id INT DEFAULT NULL, modifier_id INT DEFAULT NULL, reviewed_by TEXT NOT NULL, review_start_date_time TIMESTAMP(0) WITH TIME ZONE NOT NULL, review_end_date_time TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL, review_notes TEXT DEFAULT NULL, creation_time_stamp TIMESTAMP(0) WITH TIME ZONE NOT NULL, modification_time_stamp TIMESTAMP(0) WITH TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3FA5C62F8488BA54 ON dataset_submission_review (dataset_submission_id)');
$this->addSql('CREATE INDEX IDX_3FA5C62F61220EA6 ON dataset_submission_review (creator_id)');
$this->addSql('CREATE INDEX IDX_3FA5C62FD079F553 ON dataset_submission_review (modifier_id)');
$this->addSql('ALTER TABLE dataset_submission_review ADD CONSTRAINT FK_3FA5C62F8488BA54 FOREIGN KEY (dataset_submission_id) REFERENCES dataset_submission (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE dataset_submission_review ADD CONSTRAINT FK_3FA5C62F61220EA6 FOREIGN KEY (creator_id) REFERENCES person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE dataset_submission_review ADD CONSTRAINT FK_3FA5C62FD079F553 FOREIGN KEY (modifier_id) REFERENCES person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX rev_e624f22cebb69839b78c500501429a05_idx ON dataset_audit (rev)');
$this->addSql('CREATE INDEX rev_430039370f5303f6a2ed2dc7c106d1b3_idx ON dataset_submission_audit (rev)');
$this->addSql('CREATE INDEX rev_07dc736682092abc2e3fa598ec112518_idx ON person_data_repository_audit (rev)');
$this->addSql('CREATE INDEX rev_907be00c9c366335b3359c1e8e2f6227_idx ON person_audit (rev)');
$this->addSql('CREATE INDEX rev_113fa8fdb01329a769aae235040fe67e_idx ON dif_audit (rev)');
$this->addSql('CREATE INDEX rev_5eb2f7bb85a4fbc0eaf3364e10d48a9c_idx ON funding_organization_audit (rev)');
$this->addSql('CREATE INDEX rev_a866b5f3a5f73521e77ecb9287ac0857_idx ON data_repository_audit (rev)');
$this->addSql('CREATE INDEX rev_f167a141eabdd0230c7408c3d0b8cea4_idx ON research_group_audit (rev)');
$this->addSql('CREATE INDEX rev_7d9955a069e3cb60e7c9a5c5686509bb_idx ON person_funding_organization_audit (rev)');
$this->addSql('CREATE INDEX rev_71e9a98e69179c5c224731ec9281c9d5_idx ON person_research_group_audit (rev)');
$this->addSql('CREATE INDEX rev_a98ba133de3b2a8dbcb7a8346e81547f_idx ON funding_cycle_audit (rev)');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE dataset_submission_review_id_seq CASCADE');
$this->addSql('DROP TABLE dataset_submission_review');
$this->addSql('DROP INDEX rev_e624f22cebb69839b78c500501429a05_idx');
$this->addSql('DROP INDEX rev_113fa8fdb01329a769aae235040fe67e_idx');
$this->addSql('DROP INDEX rev_5eb2f7bb85a4fbc0eaf3364e10d48a9c_idx');
$this->addSql('DROP INDEX rev_907be00c9c366335b3359c1e8e2f6227_idx');
$this->addSql('DROP INDEX rev_7d9955a069e3cb60e7c9a5c5686509bb_idx');
$this->addSql('DROP INDEX rev_f167a141eabdd0230c7408c3d0b8cea4_idx');
$this->addSql('DROP INDEX rev_a98ba133de3b2a8dbcb7a8346e81547f_idx');
$this->addSql('DROP INDEX rev_a866b5f3a5f73521e77ecb9287ac0857_idx');
$this->addSql('DROP INDEX rev_430039370f5303f6a2ed2dc7c106d1b3_idx');
$this->addSql('DROP INDEX rev_07dc736682092abc2e3fa598ec112518_idx');
$this->addSql('DROP INDEX rev_71e9a98e69179c5c224731ec9281c9d5_idx');
}
}
34 changes: 34 additions & 0 deletions app/DoctrineMigrations/Version20180126152640.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Pelagos\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180126152640 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE dataset_submission_review ADD reviewed_by_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE dataset_submission_review DROP reviewed_by');
$this->addSql('ALTER TABLE dataset_submission_review ADD CONSTRAINT FK_3FA5C62FFC6B21F1 FOREIGN KEY (reviewed_by_id) REFERENCES person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_3FA5C62FFC6B21F1 ON dataset_submission_review (reviewed_by_id)');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$this->addSql('ALTER TABLE dataset_submission_review DROP CONSTRAINT FK_3FA5C62FFC6B21F1');
$this->addSql('DROP INDEX IDX_3FA5C62FFC6B21F1');
$this->addSql('ALTER TABLE dataset_submission_review ADD reviewed_by TEXT NOT NULL');
$this->addSql('ALTER TABLE dataset_submission_review DROP reviewed_by_id');
}
}
32 changes: 32 additions & 0 deletions app/DoctrineMigrations/Version20180130211431.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Pelagos\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180130211431 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE dataset_submission_review ADD review_ended_by_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE dataset_submission_review ADD CONSTRAINT FK_3FA5C62F8C8C2893 FOREIGN KEY (review_ended_by_id) REFERENCES person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_3FA5C62F8C8C2893 ON dataset_submission_review (review_ended_by_id)');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$this->addSql('ALTER TABLE dataset_submission_review DROP CONSTRAINT FK_3FA5C62F8C8C2893');
$this->addSql('DROP INDEX IDX_3FA5C62F8C8C2893');
$this->addSql('ALTER TABLE dataset_submission_review DROP review_ended_by_id');
}
}
36 changes: 36 additions & 0 deletions app/DoctrineMigrations/Version20180322194744.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Pelagos\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180322194744 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('ALTER TABLE dataset_submission ADD temporal_extent_nil_reason_type TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE dataset_submission_audit ADD temporal_extent_nil_reason_type TEXT DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('ALTER TABLE dataset_submission_audit DROP temporal_extent_nil_reason_type');
$this->addSql('ALTER TABLE dataset_submission DROP temporal_extent_nil_reason_type');
}
}
37 changes: 37 additions & 0 deletions app/DoctrineMigrations/Version20180327144230.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Pelagos\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180327144230 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('INSERT INTO person_dataset_submission
(id,dataset_submission_id, creation_time_stamp, modification_time_stamp, creator_id, modifier_id, person_id,role, discr, primary_contact)
SELECT NEXTVAL(\'person_dataset_submission_id_seq\'), dataset_submission.id, NOW(), NOW(), 0, 0, submitter_id, \'pointOfContact\', \'persondatasetsubmissionmetadatacontact\', false FROM dataset
JOIN dataset_submission ON dataset.dataset_submission_id = dataset_submission.id
WHERE dataset_submission.metadata_status = \'Submitted\'
AND dataset_submission.id NOT IN (SELECT dataset_submission_id FROM person_dataset_submission WHERE discr = \'persondatasetsubmissionmetadatacontact\')');

}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DELETE FROM person_dataset_submission WHERE discr = \'persondatasetsubmissionmetadatacontact\'');

}
}
117 changes: 117 additions & 0 deletions app/DoctrineMigrations/Version20180424203029.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php

namespace Pelagos\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180424203029 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('CREATE SEQUENCE data_center_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE data_center (id INT NOT NULL, creator_id INT DEFAULT NULL, modifier_id INT DEFAULT NULL, organization_name citext NOT NULL, organization_url TEXT NOT NULL, phone_number TEXT DEFAULT NULL, delivery_point TEXT DEFAULT NULL, city TEXT DEFAULT NULL, administrative_area TEXT DEFAULT NULL, postal_code TEXT DEFAULT NULL, country TEXT DEFAULT NULL, email_address TEXT DEFAULT NULL, national_center BOOLEAN DEFAULT NULL, creation_time_stamp TIMESTAMP(0) WITH TIME ZONE NOT NULL, modification_time_stamp TIMESTAMP(0) WITH TIME ZONE NOT NULL, discr VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_200EDA3D672A409B ON data_center (organization_name)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_200EDA3DFEFB1A4D ON data_center (organization_url)');
$this->addSql('CREATE INDEX IDX_200EDA3D61220EA6 ON data_center (creator_id)');
$this->addSql('CREATE INDEX IDX_200EDA3DD079F553 ON data_center (modifier_id)');
$this->addSql('CREATE TABLE data_center_audit (id INT NOT NULL, rev INT NOT NULL, creator_id INT DEFAULT NULL, modifier_id INT DEFAULT NULL, organization_name citext DEFAULT NULL, organization_url TEXT DEFAULT NULL, phone_number TEXT DEFAULT NULL, delivery_point TEXT DEFAULT NULL, city TEXT DEFAULT NULL, administrative_area TEXT DEFAULT NULL, postal_code TEXT DEFAULT NULL, country TEXT DEFAULT NULL, email_address TEXT DEFAULT NULL, national_center BOOLEAN DEFAULT NULL, creation_time_stamp TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL, modification_time_stamp TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL, discr VARCHAR(255) DEFAULT NULL, revtype VARCHAR(4) NOT NULL, PRIMARY KEY(id, rev))');
$this->addSql('CREATE INDEX rev_63f075da226b08465e0170cecd95794b_idx ON data_center_audit (rev)');

$this->addSql('ALTER TABLE data_center ADD CONSTRAINT FK_200EDA3D61220EA6 FOREIGN KEY (creator_id) REFERENCES person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE data_center ADD CONSTRAINT FK_200EDA3DD079F553 FOREIGN KEY (modifier_id) REFERENCES person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');

//insert data center/national data center info
$this->addSql('INSERT INTO data_center
(id, creator_id, modifier_id, organization_name, organization_url, phone_number, delivery_point, city, administrative_area, postal_code, country, email_address, national_center, creation_time_stamp, modification_time_stamp, discr)
SELECT NEXTVAL(\'data_center_id_seq\'), 0, 0, repo.description || \' (\' || repo.name || \')\', repo.url, repo.phone_number, repo.delivery_point, repo.city, repo.administrative_area, repo.postal_code, repo.country, repo.email_address, false, NOW(), NOW(), \'datacenter\'
FROM data_repository repo WHERE repo.name = \'GRIIDC\' ');

$nationalDataCenters = [
[
'orgName' => 'HYCOM',
'orgUrl' => 'https://hycom.org',
'email' => '[email protected]',
'phone' => null,
'deliveryPoint' => null,
'city' => null,
'state' => null,
'postalCode' => null,
'country' => null,
],
[
'orgName' => 'NCBI',
'orgUrl' => 'https://www.ncbi.nlm.nih.gov',
'email' => '[email protected]',
'phone' => '3014962475',
'deliveryPoint' => 'National Library of Medicine 8600 Rockville Pike',
'city' => 'Bethesda',
'state' => 'Maryland',
'postalCode' => '20894',
'country' => 'USA',
],
[
'orgName' => 'MG-RAST',
'orgUrl' => 'https://mg-rast.org',
'email' => '[email protected]',
'phone' => null,
'deliveryPoint' => null,
'city' => null,
'state' => null,
'postalCode' => null,
'country' => null,
],
[
'orgName' => 'NCEI',
'orgUrl' => 'https://www.ncei.noaa.gov',
'email' => '[email protected]',
'phone' => '3017133277',
'deliveryPoint' => 'Federal Building 151 Patton Avenue ',
'city' => 'Asheville',
'state' => 'North Carolina',
'postalCode' => '28801-5001',
'country' => 'USA',
],
[
'orgName' => 'Water Column Sonar Database',
'orgUrl' => 'https://www.ngdc.noaa.gov/mgg/wcd',
'email' => '[email protected]',
'phone' => '3034974742',
'deliveryPoint' => '325 Broadway, Mail Code E/NE42',
'city' => 'Boulder',
'state' => 'Colorado',
'postalCode' => '80305-3328',
'country' => 'USA',
]
];

foreach ($nationalDataCenters as $ndc) {
$this->addSql('INSERT INTO data_center
(id, creator_id, modifier_id, organization_name, organization_url, phone_number, delivery_point, city, administrative_area, postal_code, country, email_address, national_center, creation_time_stamp, modification_time_stamp, discr)
VALUES(NEXTVAL(\'data_center_id_seq\'), 0, 0, :orgName, :orgUrl, :phone, :deliveryPoint, :city, :state, :postalCode, :country, :email, true, NOW(), NOW(), \'nationaldatacenter\')', $ndc);
}
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('DROP SEQUENCE data_center_id_seq CASCADE');
$this->addSql('DROP TABLE data_center');
$this->addSql('DROP TABLE data_center_audit');

}
}
Loading

0 comments on commit 4a45f47

Please sign in to comment.