Skip to content

Commit

Permalink
Cleanup and addition of hints to meta data form
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed May 24, 2022
1 parent a47c03e commit 2f297e4
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 225 deletions.
Expand Up @@ -112,15 +112,17 @@
</tracking>

<meta type="group" label="Meta data" optional="true">
<explanation label="Note: to share this project using oai-pmh, you need to give your assent and the fields 'Category' and 'Education level' need to be filled in." type="info" condition="oai_pmh_available" mandatory="true"/>
<course label="Course" type="Course" wysiwyg="false" defaultValue="" optional="true" tooltip="The course this learning object is part of."/>
<module label="Module" type="TextInput" wysiwyg="false" defaultValue="" optional="true" tooltip="The module/subject of this learning object."/>
<category label="Category" type="Category" optional="true" tooltip="The category of this learning object (i.e. Maths)."/>
<metaDescription type="script" wysiwyg="false" label="Description" height="50" optional="true" defaultValue="" tooltip="Describe this learning obect. Not only its subject, but also the learning goals and expected level."/>
<metaKeywords type="script" wysiwyg="false" label="Keywords" height="50" optional="true" defaultValue="" tooltip="Enter keywords other people are likely to use to find this learning object. Use a new line for each keyword."/>
<metaAuthor type="TextInput" wysiwyg="false" label="Author" defaultValue="" optional="true" tooltip="Author name(s) the will be published when publishing the metadata. If not specified, the cretor and co-author names are used."/>
<metaAuthorInclude type="CheckBox" label="Include author when harvesting" defaultValue="true" optional="true" tooltip="Whether the author name is included in the metadata record when publishing the meta data as oai-pmh (optional functionality). If disabled the name of the instatution that runs the Xerte install will be used."/>
<metaAuthorInclude type="CheckBox" label="Include author when harvesting" defaultValue="true" optional="true" tooltip="Whether the author name is included in the metadata record when publishing the meta data as oai-pmh (optional functionality). If disabled the name of the instatution that runs the Xerte install will be used." condition="oai_pmh_available"/>
<metaEducation type="EducationLevelList" label="Education level" defaultValue="" optional="true" tooltip="The level of the education, i.e. primary education, secondary education, etc."/>
<metaThumbnail type="media" label="Thumbnail" defaultValue="Choose Image" optional="true" tooltip="The thumbnail to publish with the metadata"/>
<oaiPmhAgree label="Assent" extraCheckBoxLabel="I agee to share this project through oai-pmh and I confirm that there are no copyrighted materials used in this project." type="CheckBox" mandatory="true" defaultValue="false" tooltip="The project will only be shared if checked" condition="oai_pmh_available"/>
</meta>

<twittercard type="group" label="Twitter card" optional="true">
Expand Down
10 changes: 5 additions & 5 deletions oai-pmh/management/educational.php
Expand Up @@ -43,25 +43,25 @@ function clearEducationalTable() {
global $xerte_toolkits_site;
$prefix = $xerte_toolkits_site->database_table_prefix;

$q = "delete from {$xerte_toolkits_site->database_table_prefix}educationlevel";
$q = "delete from {$prefix}educationlevel";
db_query($q);

$q = "delete from {$xerte_toolkits_site->database_table_prefix}oai_education";
$q = "delete from {$prefix}oai_education";
db_query($q);
}

function insertEducational($termID, $label){
global $xerte_toolkits_site;
$prefix = $xerte_toolkits_site->database_table_prefix;

$q = "INSERT INTO {$xerte_toolkits_site->database_table_prefix}educationlevel(educationlevel_name) VALUES (?)";
$q = "INSERT INTO {$prefix}educationlevel(educationlevel_name) VALUES (?)";
$res = db_query($q,array($label));

$q2 = "SELECT educationlevel_id,educationlevel_name FROM {$xerte_toolkits_site->database_table_prefix}educationlevel WHERE educationlevel_name like ?";
$q2 = "SELECT educationlevel_id,educationlevel_name FROM {$prefix}educationlevel WHERE educationlevel_name like ?";
$result = db_query($q2,array($label));
$return_id = $result[0]['educationlevel_id'];

$q3 = "INSERT INTO {$xerte_toolkits_site->database_table_prefix}oai_education(education_id,term_id,label) VALUES (?,?,?)";
$q3 = "INSERT INTO {$prefix}oai_education(education_id,term_id,label) VALUES (?,?,?)";
$params = array($return_id,$termID,$label);
$res = db_query($q3,$params);

Expand Down
24 changes: 17 additions & 7 deletions oai-pmh/management/rights.php
Expand Up @@ -5,6 +5,7 @@
// php rights.php ./vocabularies/copyrightsandotherrestrictions.xml

if ($argc > 1) {
createRightsTable();
clearRightsTable();

$xmlfile = $argv[1];
Expand All @@ -27,41 +28,50 @@
$c = $node->children();

$tempLabel = (string)$c->caption->langstring;
insertRights($tempLabel);
$tempID = (string)$c->termIdentifier;
insertRights($tempID, $tempLabel);
}
}
/*

function createRightsTable() {
global $xerte_toolkits_site;
$prefix = $xerte_toolkits_site->database_table_prefix;

$q = "CREATE TABLE IF NOT EXISTS {$prefix}oai_rights(
rights_id INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL,
rights_id INT(11) PRIMARY KEY NOT NULL,
term_id VARCHAR(63) NOT NULL,
label VARCHAR(255) NOT NULL)";

db_query($q);
}
*/

function clearRightsTable() {
global $xerte_toolkits_site;
$prefix = $xerte_toolkits_site->database_table_prefix;

$q = "delete from {$xerte_toolkits_site->database_table_prefix}syndicationlicenses";
$q = "delete from {$prefix}syndicationlicenses";
db_query($q);

$q = "delete from {$prefix}oai_rights";
db_query($q);
}

function insertRights($label){
function insertRights($term_id, $label){
global $xerte_toolkits_site;
$prefix = $xerte_toolkits_site->database_table_prefix;

$q = "INSERT INTO {$xerte_toolkits_site->database_table_prefix}syndicationlicenses(license_name) VALUES (?)";
$q = "INSERT INTO {$prefix}syndicationlicenses(license_name) VALUES (?)";
$params = array($label);
db_query($q,$params);

$q2 = "SELECT license_id FROM {$prefix}syndicationlicenses WHERE license_name like ?";
$result = db_query($q2,array($label));
$return_id = $result[0]['license_id'];

$q3 = "INSERT INTO {$prefix}oai_rights(rights_id,term_id,label) VALUES (?,?,?)";
$params = array($return_id,$term_id,$label);
$res = db_query($q3,$params);

}


161 changes: 0 additions & 161 deletions oai-pmh/management/vocabularies/copyrightsandotherrestrictions.xml
Expand Up @@ -90,106 +90,6 @@
<dc:identifier>http://creativecommons.org/licenses/by-sa/4.0/</dc:identifier>
</metadata>
</term>
<!-- Creative Commons (nl) 3.0 -->
<term orderSignificant="false" validIndex="true">
<termIdentifier>cc-by-30</termIdentifier>
<caption>
<langstring language="nl">CC Naamsvermelding 3.0 Nederland licentie</langstring>
<langstring language="en">CC Attribution 3.0 Netherlands license</langstring>
</caption>
<description>
<langstring language="nl">De Nederlandse Creative Commons 3.0 licentie waarbij de gebruiker het werk mag kopiëren, verspreiden en doorgeven en afgeleide werken mag maken onder de voorwaarde: Naamsvermelding, zie http://creativecommons.org/licenses/by/3.0/nl/.</langstring>
<langstring language="en">The Netherlands Creative Commons 3.0 copyright license where the use is free to copy, distribute and transmit the work and to adapt the work under the condition: Attribution, see http://creativecommons.org/licenses/by/3.0/nl/.</langstring>
</description>
<metadata>
<dc:identifier>http://creativecommons.org/licenses/by/3.0/nl/</dc:identifier>
</metadata>
</term>
<term orderSignificant="false" validIndex="true">
<termIdentifier>cc-by-nd-30</termIdentifier>
<caption>
<langstring language="nl">CC Naamsvermelding-GeenAfgeleideWerken 3.0 Nederland licentie</langstring>
<langstring language="en">CC Attribution-NoDerivativeWorks 3.0 Netherlands license</langstring>
</caption>
<description>
<langstring language="nl">De Nederlandse Creative Commons 3.0 licentie waarbij de gebruiker het werk mag kopiëren, verspreiden en doorgeven onder de voorwaarden: Naamsvermelding en Geen Afgeleide Werken, zie http://creativecommons.org/licenses/by-nd/3.0/nl/.</langstring>
<langstring language="en">The Netherlands Creative Commons 3.0 copyright license where the use is free to copy, distribute and transmit the work under the conditions: Attribution and No Derivative Works, see http://creativecommons.org/licenses/by-nd/3.0/nl/.</langstring>
</description>
<metadata>
<dc:identifier>http://creativecommons.org/licenses/by-nd/3.0/nl/</dc:identifier>
</metadata>
</term>
<term orderSignificant="false" validIndex="true">
<termIdentifier>cc-by-nc-30</termIdentifier>
<caption>
<langstring language="nl">CC Naamsvermelding-NietCommercieel 3.0 Nederland licentie</langstring>
<langstring language="en">CC Attribution-NonCommercial 3.0 Netherlands license</langstring>
</caption>
<description>
<langstring language="nl">De Nederlandse Creative Commons 3.0 licentie waarbij de gebruiker het werk mag kopiëren, verspreiden en doorgeven en afgeleide werken mag maken onder de voorwaarden: Naamsvermelding en Niet-commercieel, zie http://creativecommons.org/licenses/by-nc/3.0/nl/.</langstring>
<langstring language="en">The Netherlands Creative Commons 3.0 copyright license where the use is free to copy, distribute and transmit the work and to adapt the work under the conditions: Attribution and Noncommercial, see http://creativecommons.org/licenses/by-nc/3.0/nl/.</langstring>
</description>
<metadata>
<dc:identifier>http://creativecommons.org/licenses/by-nc/3.0/nl/</dc:identifier>
</metadata>
</term>
<term orderSignificant="false" validIndex="true">
<termIdentifier>cc-by-nc-nd-30</termIdentifier>
<caption>
<langstring language="nl">CC Naamsvermelding-NietCommercieel-GeenAfgeleideWerken 3.0 Nederland licentie</langstring>
<langstring language="en">CC Attribution-NonCommercial-NoDerivativeWorks 3.0 Netherlands license</langstring>
</caption>
<description>
<langstring language="nl">De Nederlandse Creative Commons 3.0 licentie waarbij de gebruiker het werk mag kopiëren, verspreiden en doorgeven onder de voorwaarden: Naamsvermelding, Niet-commercieel en Geen Afgeleide Werken, zie http://creativecommons.org/licenses/by-nc-nd/3.0/nl/.</langstring>
<langstring language="en">The Netherlands Creative Commons 3.0 copyright license where the use is free to copy, distribute and transmit the work under the conditions: Attribution, Noncommercial and No Derivative Works, see http://creativecommons.org/licenses/by-nc-nd/3.0/nl/.</langstring>
</description>
<metadata>
<dc:identifier>http://creativecommons.org/licenses/by-nc-nd/3.0/nl/</dc:identifier>
</metadata>
</term>
<term orderSignificant="false" validIndex="true">
<termIdentifier>cc-by-nc-sa-30</termIdentifier>
<caption>
<langstring language="nl">CC Naamsvermelding-NietCommercieel-GelijkDelen 3.0 Nederland licentie</langstring>
<langstring language="en">CC Attribution-NonCommercial-ShareAlike 3.0 Netherlands license</langstring>
</caption>
<description>
<langstring language="nl">De Nederlandse Creative Commons 3.0 licentie waarbij de gebruiker het werk mag kopiëren, verspreiden en doorgeven en afgeleide werken mag maken onder de voorwaarden: Naamsvermelding, Niet-commercieel en Gelijk Delen, zie http://creativecommons.org/licenses/by-nc-sa/3.0/nl/.</langstring>
<langstring language="en">The Netherlands Creative Commons 3.0 copyright license where the use is free to copy, distribute and transmit the work and to adapt the work under the conditions: Attribution, Noncommercial and Share Alike, see http://creativecommons.org/licenses/by-nc-sa/3.0/nl/.</langstring>
</description>
<metadata>
<dc:identifier>http://creativecommons.org/licenses/by-nc-sa/3.0/nl/</dc:identifier>
</metadata>
</term>
<term orderSignificant="false" validIndex="true">
<termIdentifier>cc-by-sa-30</termIdentifier>
<caption>
<langstring language="nl">CC Naamsvermelding-GelijkDelen 3.0 Nederland licentie</langstring>
<langstring language="en">CC Attribution-ShareAlike 3.0 Netherlands license</langstring>
</caption>
<description>
<langstring language="nl">De Nederlandse Creative Commons 3.0 licentie waarbij de gebruiker het werk mag kopiëren, verspreiden en doorgeven en afgeleide werken mag maken onder de voorwaarden: Naamsvermelding en Gelijk Delen, zie http://creativecommons.org/licenses/by-sa/3.0/nl/.</langstring>
<langstring language="en">The Netherlands Creative Commons 3.0 copyright license where the use is free to copy, distribute and transmit the work and to adapt the work under the conditions: Attribution and Share Alike, see http://creativecommons.org/licenses/by-sa/3.0/nl/.</langstring>
</description>
<metadata>
<dc:identifier>http://creativecommons.org/licenses/by-sa/3.0/nl/</dc:identifier>
</metadata>
</term>
<!-- ja/nee -->
<term orderSignificant="false" validIndex="true">
<termIdentifier>no</termIdentifier>
<caption>
<langstring language="nl">nee</langstring>
<langstring language="en">no</langstring>
</caption>
</term>
<term orderSignificant="false" validIndex="true">
<termIdentifier>yes</termIdentifier>
<caption>
<langstring language="nl">ja</langstring>
<langstring language="en">yes</langstring>
</caption>
</term>
<!-- Creative Commons 4.0 -->
<relationship>
<sourceTerm>cc-by-40</sourceTerm>
Expand Down Expand Up @@ -251,65 +151,4 @@
<targetTerm>cc-by-sa-40</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">NT</relationshipType>
</relationship>
<!-- Creative Commons (nl) 3.0 -->
<relationship>
<sourceTerm>cc-by-30</sourceTerm>
<targetTerm>yes</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">BT</relationshipType>
</relationship>
<relationship>
<sourceTerm>cc-by-nd-30</sourceTerm>
<targetTerm>yes</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">BT</relationshipType>
</relationship>
<relationship>
<sourceTerm>cc-by-nc-30</sourceTerm>
<targetTerm>yes</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">BT</relationshipType>
</relationship>
<relationship>
<sourceTerm>cc-by-nc-nd-30</sourceTerm>
<targetTerm>yes</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">BT</relationshipType>
</relationship>
<relationship>
<sourceTerm>cc-by-nc-sa-30</sourceTerm>
<targetTerm>yes</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">BT</relationshipType>
</relationship>
<relationship>
<sourceTerm>cc-by-sa-30</sourceTerm>
<targetTerm>yes</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">BT</relationshipType>
</relationship>
<relationship>
<sourceTerm>yes</sourceTerm>
<targetTerm>cc-by-30</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">NT</relationshipType>
</relationship>
<relationship>
<sourceTerm>yes</sourceTerm>
<targetTerm>cc-by-nc-30</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">NT</relationshipType>
</relationship>
<relationship>
<sourceTerm>yes</sourceTerm>
<targetTerm>cc-by-nc-nd-30</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">NT</relationshipType>
</relationship>
<relationship>
<sourceTerm>yes</sourceTerm>
<targetTerm>cc-by-nc-sa-30</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">NT</relationshipType>
</relationship>
<relationship>
<sourceTerm>yes</sourceTerm>
<targetTerm>cc-by-nd-30</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">NT</relationshipType>
</relationship>
<relationship>
<sourceTerm>yes</sourceTerm>
<targetTerm>cc-by-sa-30</targetTerm>
<relationshipType source="http://www.imsglobal.org/vocabularies/iso2788_relations.xml">NT</relationshipType>
</relationship>
</vdex>

0 comments on commit 2f297e4

Please sign in to comment.