Learn
- Clean Code, YouTube
- PHP: The Right Way, link
- Udemy courses
- Design Pattern, Doc, Pattern Libraries
- Postman for testing API, YouTube
- Essential Scrum, Chapter [5, 7, 17, 18, 19]
- Terraform
- Ansible
- DevOps Crash Course, youtube
Todo - Project repo, doc
- Local Taverna
Done - Project
- Found
actionMint
in /protected/controller/AdminDatasetController.php
/**
* post metadata, mint a new DOI
*
*/
public function actionMint()
{
$result['status'] = false;
$status_array = array('Submitted', 'UserStartedIncomplete', 'Curation');
$mds_metadata_url="https://mds.datacite.org/metadata";
$mds_doi_url="https://mds.datacite.org/doi";
$mds_username = Yii::app()->params['mds_username'];
$mds_password = Yii::app()->params['mds_password'];
$mds_prefix = Yii::app()->params['mds_prefix'];
if (isset($_POST['doi'])) {
$doi = $_POST['doi'];
if (stristr($doi, "/")) {
$temp = explode("/", $doi);
$doi = $temp[1];
}
$doi = trim($doi);
$dataset = Dataset::model()->find("identifier=?", array($doi));
if ($dataset && ! in_array($dataset->upload_status, $status_array)) {
$xml_data = $dataset->toXML();
$ch= curl_init();
curl_setopt($ch, CURLOPT_URL, $mds_metadata_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/xml;charset=UTF-8'));
curl_setopt($ch, CURLOPT_USERPWD, $mds_username . ":" . $mds_password);
$curl_response = curl_exec($ch);
$result['md_curl_response'] = $curl_response;
$info1 = curl_getinfo($ch);
$result['md_curl_status'] = $info1['http_code'];
curl_close($ch) ;
}
if ($dataset && $result['md_curl_status'] == 201) {
$doi_data = "doi=".$mds_prefix."/".$doi."\n"."url=http://gigadb.org/dataset/".$dataset->identifier ;
$result['doi_data'] = $doi_data;
$ch2= curl_init();
curl_setopt($ch2, CURLOPT_URL, $mds_doi_url);
curl_setopt($ch2, CURLOPT_POST, 1);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_POSTFIELDS, $doi_data);
curl_setopt($ch2, CURLOPT_HTTPHEADER, array('Content-Type:application/xml;charset=UTF-8'));
curl_setopt($ch2, CURLOPT_USERPWD, $mds_username . ":" . $mds_password);
$curl_response = curl_exec($ch2);
$result['doi_curl_response'] = $curl_response;
$info2 = curl_getinfo($ch2);
$result['doi_curl_status'] = $info2['http_code'];
curl_close($ch2) ;
}
if (isset($result['doi_curl_status']) && $result['doi_curl_status'] == 201) {
$result['status'] = true;
}
}
echo json_encode($result);
Yii::app()->end();
}
Todo - Github
- Learn
Terraform
and Ansible
- Follow up PR comments
- Study #422
Done - Github
- Rebase Add-citation-box-#521 with
upstream/develop
- Start to review
fuw-cicd-#546
, review doc at here
- Terraform,
AOB
- Follow up server issues
- Create a ITSM ticket for it
Reference