Skip to content

Commit

Permalink
updated rif.vm for freeText creators. Prepared for release of redbox …
Browse files Browse the repository at this point in the history
…core and config projects only.
  • Loading branch information
Matthew Mulholland committed Feb 26, 2018
1 parent f6c0a89 commit 1a446df
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 15 deletions.
2 changes: 1 addition & 1 deletion config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<parent>
<groupId>com.googlecode.redbox-mint</groupId>
<artifactId>redbox-project</artifactId>
<version>1.10.1-SNAPSHOT</version>
<version>1.10</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<build>
Expand Down
12 changes: 12 additions & 0 deletions config/src/main/config/home/templates/rif.vm
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,18 @@
</rif:relatedObject>
#end
#end

### Free text support
#set($valueMap = $util.getList($item, "identifierText"))
#foreach($key in $valueMap.keySet())
#set ($value = $valueMap.get($key).get("creatorName.input"))
#if ("$!value" != "")
<rif:relatedObject>
<rif:key>$util.encodeXml($value)</rif:key>
<rif:relation type="hasCollector"></rif:relation>
</rif:relatedObject>
#end
#end



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@ class RifVelocityTest extends GenericVelocitySpecification {
" \"dc:creator.foaf:Person.3.foaf:familyName\": \"Chambers\",\n" +
" \"dc:creator.foaf:Person.3.foaf:Organization.dc:identifier\": \"redbox-mint.googlecode.com/parties/group/2\",\n" +
" \"dc:creator.foaf:Person.3.foaf:Organization.skos:prefLabel\": \"Faculty of Technology\",\n" +
" \"dc:creator.foaf:Person.4.dc:identifier\": \"https://www.scopus.com/authid/detail.uri?authorId=000111\",\n" +
" \"identifierText.4.creatorName.input\": \"https://www.scopus.com/authid/detail.uri?authorId=000111\",\n" +
" \"dc:creator.foaf:Person.4.foaf:name\": \"Smith, John\",\n" +
" \"dc:creator.foaf:Person.4.foaf:title\": \"Prof\",\n" +
" \"dc:creator.foaf:Person.4.redbox:isCoPrimaryInvestigator\": \"\",\n" +
" \"dc:creator.foaf:Person.4.redbox:isPrimaryInvestigator\": \"\",\n" +
" \"dc:creator.foaf:Person.4.foaf:givenName\": \"John\",\n" +
" \"dc:creator.foaf:Person.4.foaf:familyName\": \"Smith\",\n" +
" \"dc:creator.foaf:Person.4.foaf:Organization.dc:identifier\": \"redbox-mint.googlecode.com/parties/group/2\",\n" +
" \"dc:creator.foaf:Person.4.foaf:Organization.skos:prefLabel\": \"Faculty of Technology\",\n" +
" \"locrel:prc.foaf:Person.dc:identifier\": \"\",\n" +
" \"locrel:prc.foaf:Person.foaf:name\": \"\",\n" +
" \"locrel:prc.foaf:Person.foaf:title\": \"\",\n" +
Expand Down Expand Up @@ -995,6 +1005,10 @@ class RifVelocityTest extends GenericVelocitySpecification {
" <key>http://orcid.org/0000-0001-6810-1260</key>\n" +
" <relation type=\"hasCollector\"/>\n" +
" </relatedObject>\n" +
" <relatedObject>\n" +
" <key>https://www.scopus.com/authid/detail.uri?authorId=000111</key>\n" +
" <relation type=\"hasCollector\"/>\n" +
" </relatedObject>" +
" <subject type=\"local\" xml:lang=\"en\">keywords</subject>\n" +
" <subject type=\"anzsrc-for\" xml:lang=\"en\">0402</subject>\n" +
" <description type=\"full\" xml:lang=\"en\">&lt;p&gt;The description&lt;/p&gt;</description>\n" +
Expand Down
36 changes: 24 additions & 12 deletions config/src/test/resources/rif.vm
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#macro(showElementRifCS $tag $field $attr $label $anzsrc)
#set($valueMap = $util.getList($item, $field))
#foreach($key in $valueMap.keySet())
#set($value = $valueMap.get($key))
#if ($label != "" && $value.get($label)!= "")
#set($labelVal = $value.get($label))
#set($value = $valueMap.get($key))
#if ($label != "" && $value.get($label)!= "")
#set($labelVal = $value.get($label))
#if ($anzsrc == "anzsrc")
#set($lastIndex = $labelVal.lastIndexOf('/') + 1 )
#set($labelVal = $labelVal.substring($lastIndex) )
#end
<$tag$attr>$util.encodeXml($labelVal)</$tag>
<$tag$attr>$util.encodeXml($labelVal)</$tag>
#end
#end
#end

#macro(showRelatedInfo $field $relatedInfoType $identifierType)

#set($valueMap = $util.getList($item, $field))
#foreach($key in $valueMap.keySet())
#set ($row = $valueMap.get($key))
Expand Down Expand Up @@ -304,16 +304,28 @@
</rif:relatedObject>
#end
#end




### Free text support
#set($valueMap = $util.getList($item, "identifierText"))
#foreach($key in $valueMap.keySet())
#set ($value = $valueMap.get($key).get("creatorName.input"))
#if ("$!value" != "")
<rif:relatedObject>
<rif:key>$util.encodeXml($value)</rif:key>
<rif:relation type="hasCollector"></rif:relation>
</rif:relatedObject>
#end
#end



#showElementRifCS ("rif:subject" "dc:subject.vivo:keyword" " type=${quote}local${quote} $lang" "rdf:PlainLiteral" "")
#showElementRifCS ("rif:subject" "dc:subject.anzsrc:for" " type=${quote}anzsrc-for${quote} $lang" "rdf:resource" "anzsrc")
#showElementRifCS ("rif:subject" "dc:subject.anzsrc:seo" " type=${quote}anzsrc-seo${quote} $lang" "rdf:resource" "anzsrc")







#set ($value = $util.get($item, "dc:subject.anzsrc:toa.skos:prefLabel"))
#if ("$!value" != "")
<rif:subject type="anzsrc-toa">$util.encodeXml($value)</rif:subject>
Expand Down Expand Up @@ -406,7 +418,7 @@
</rif:rights>
#end
#################

#showRelatedInfo("dc:relation.swrc:Publication", "publication", "uri")
#showRelatedInfo("dc:relation.bibo:Website", "website", "uri")
#showRelatedInfo("dc:relation.vivo:Service", "service", "uri")
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.googlecode.redbox-mint</groupId>
<artifactId>redbox-project</artifactId>
<version>1.10.1-SNAPSHOT</version>
<version>1.10</version>
<relativePath>parent/pom.xml</relativePath>
</parent>
<modules>
Expand Down Expand Up @@ -122,7 +122,7 @@
<dependency>
<groupId>com.googlecode.redbox-mint</groupId>
<artifactId>plugin-transaction-curation-redbox</artifactId>
<version>1.10-SNAPSHOT</version>
<version>1.9</version>
</dependency>
<!-- Fascinator Plugins -->
<dependency>
Expand Down

0 comments on commit 1a446df

Please sign in to comment.