3 require_once dirname(__FILE__) .
'/../libs/swordappv2/packager_mets_swap.php';
10 if($this->sac_filecount) {
11 parent::writeFileGrp($fh);
16 parent::writeDmdSec($fh);
17 if (!empty($this->sac_name_records)) {
18 fwrite($fh,
"<dmdSec ID=\"sword-mets-dmd-2\" GROUPID=\"sword-mets-dmd-2_group-2\">\n");
19 fwrite($fh,
"<mdWrap LABEL=\"MODS Metadata\" MDTYPE=\"MODS\" MIMETYPE=\"text/xml\">\n");
20 fwrite($fh,
"<xmlData>\n");
21 fwrite($fh,
"<mods version=\"3.7\" xmlns=\"http://www.loc.gov/mods/v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"https://www.loc.gov/standards/mods/xml.xsd\">\n");
22 foreach($this->sac_name_records as $name_record) {
23 fwrite($fh,
"<name type=\"personal\">\n");
24 fwrite($fh,
"<namePart type=\"given\">" . $name_record[
'given'] .
"</namePart>");
25 fwrite($fh,
"<namePart type=\"family\">" . $name_record[
'family'] .
"</namePart>");
26 fwrite($fh,
"<nameIdentifier type=\"email\">" . $name_record[
'email'] .
"</nameIdentifier>");
27 fwrite($fh,
"<role><roleTerm>author</roleTerm></role>");
28 if ($name_record[
'primary_contact']){
29 fwrite($fh,
"<role><roleTerm>pkp_primary_contact</roleTerm></role>");
31 fwrite($fh,
"</name>\n");
33 fwrite($fh,
"</mods>\n");
34 fwrite($fh,
"</xmlData>\n");
35 fwrite($fh,
"</mdWrap>\n");
36 fwrite($fh,
"</dmdSec>\n");
41 $this->primaryAuthor = $author;