teacup/config/play-chunk-template.xml

98 lines
7.4 KiB
XML
Raw Normal View History

2021-12-15 11:29:23 +00:00
<!-- point to a collection to use information from the XML already stored there -->
<formTemplate collection="/SS/content" contentType="tei">
<!-- @xpath will be resolved against each item in the collection, to pre-populate the field -->
<item name="volumeid" xpath="/*:TEI/@xml:id" type="textfield" readOnly="true" title="Volume Id"/>
<!-- Extract title value from TEI documents and it will be rendered as textfield on the UI.-->
<item name="title" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:titleStmt/*:title" type="textfield" readOnly="true" title="Volume title"/>
<!-- Extract title value from TEI documents and it will be rendered as textfield on the UI.-->
<item name="play_title" xpath="/*:TEI/*:text/*:body/*:div[@type = 'play']/*:head[1]" type="textfield" readOnly="true" title="Play title"/>
<!-- some shouldn't be editable -->
<!-- Extract pubdate value from TEI documents and it will be rendered as textfield on the UI.-->
<item name="pubdate" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:date[@type='publication']" type="textfield" title="Original publication date" assert=". castable as xs:gYear" readOnly="true" />
<!-- List all the role value from the configured role XML in the database and it will be rendered as textarea on the UI. -->
<!-- <item name="role" xpath="fn:doc('bloomsbury/config/roles.xml')/roles/role/name" type="dropdown" title="Role" readOnly="true" /> -->
<item name="Copyright" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:availability/string-join(*:ab[@type = ('copyrightYear', 'copyrightHolder')], ' ')" type="textfield" title="Copyright" readOnly="false" />
<!-- Extract description value from ONIX documents and it will be rendered as textarea on the UI.-->
<!-- <item name="description" title="Description" readOnly="false" type="textarea" xpath="
let $isbns := /*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt
/*:idno[@type='isbn']/replace(., '[^\d]', '')
let $desc := fn:collection('/ONIXDB/ONIX')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[
.=
$isbns
]]/OtherText[TextTypeCode='01']/Text
let $doc := parse-xml('&lt;p&gt;'||replace($desc, '&lt;br(/)?&gt;', '&#xA;')||'&lt;/p&gt;')
return xslt:transform($doc, 'transforms/desc2html.xsl')" /> -->
<item name="description" title="Description" readOnly="false" type="textarea" xpath="
let $isbns := /*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt
/*:idno[@type='isbn']/replace(., '[^\d]', '')
let $desc := fn:collection('/ONIXDB/ONIX')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[
.=
$isbns
]]/OtherText[TextTypeCode='01']/Text
return $desc" />
<!-- Extract authors value from ONIX documents. and it will be rendered as checkbox on the UI.-->
<group xpath="let $isbns := /*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:idno[@type='isbn']/replace(., '[^\d]', '')
return fn:collection('/ONIXDB/ONIX/')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[. = $isbns]]/Contributor" name="creators" title="Creators" subgroup="creator" allowdelete="true">
<item xpath="PersonName" name="creator_name" title="Name" type="textfield" readOnly="true"/>
<item xpath="replace(replace(replace(concat('¬1', PersonNameIdentifier[PersonNameIDType = '01']/IDValue, '¬2', PersonName, '¬3'), '¬1¬2', ''), '¬2.*¬3', ''), '¬\d', '')" name="onix_id" title="ONIX ID" type="textfield" readOnly="true"/>
<item xpath="let $isbns := /*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:idno[@type='isbn']/replace(., '[^\d]', '')
for $contributorRole in fn:collection('/ONIXDB/ONIX/')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[. = $isbns]]/Contributor/ContributorRole
return fn:doc('bloomsbury/config/creatorRoles.xml')/*:controlledList/*:name[*:onixId[@type = 'ContributorRole']/@id/string()=$contributorRole]/@xml:id" name="creator_role" title="Role" type="dropdown" ControlledList="bloomsbury/config/creatorRoles.xml" ItemValue="xml:id" ItemText="label" readOnly="true"/>
</group>
<group xpath="" name="performance_rights_agents" title="Performance rights agents" subgroup="performance_rights_agent" allowdelete="true">
<item name="performanceRightsAgent" xpath="" title="Performance rights agent" type="content-type-dropdown" content-type='organisation' readOnly="false"/>
<item xpath="" name="performance_type" title="Type" type="dropdown" readOnly="false" ControlledList="bloomsbury/config/performanceRightsTypes.xml" ItemValue="text" ItemText="text"/>
<item xpath="" name="performance_rights_territory" title="Territory" type="dropdown" readOnly="false" ControlledList="bloomsbury/config/performanceRightsTerritories.xml" ItemValue="text" ItemText="text"/>
</group>
<item name="notes" xpath="let $isbns := /*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:idno[@type='isbn']/replace(., '[^\d]', '')
let $onix := fn:collection('/ONIXDB/ONIX/')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[. = $isbns]]
let $company := $onix/ancestor::*:ONIXMessage/*:Header/*:FromCompany
let $authorsCheck :=
for $contrib in $onix/Contributor
let $contribName := $contrib/PersonName
let $contribId := replace(replace(replace(concat('¬1', $contrib/PersonNameIdentifier[PersonNameIDType = '01']/IDValue, '¬2', $contribName, '¬3'), '¬1¬2', ''), '¬2.*¬3', ''), '¬\d', '')
let $contribRole := fn:doc('bloomsbury/config/creatorRoles.xml')/*:controlledList/*:name[*:onixId[@type = 'ContributorRole']/@id = $contrib/ContributorRole]/@xml:id
let $personIdMapping := collection('/metadataonlycontent/person/mapping/')/*:mapping[@role = 'OnixToPersonId']
let $personRef := $personIdMapping/*:item[*:instance[@company = $company][@onixId = $contribId]]/@personId/data()
return if ($contribRole eq 'author')
then if ($personRef)
then ()
else '**NO PERSON RECORD FOUND FOR ' || $contribName || '!**'
else ()
let $authorsCheck := string-join($authorsCheck, ' ')
return $authorsCheck" type="textarea" title="Notes" readOnly="true" />
<!-- Extract the content types values and it will be rendered as dropdown on the UI.-->
<item name="relatedContent" xpath="" title="Related content" type="relatedcontent" ControlledList="bloomsbury/config/content-types.xml" ItemValue="xml:id" ItemText="label" readOnly="false"/>
<!-- <item name="territorialrestriction" title="Territorial restriction" readOnly="true" type="textarea" xpath=" (
let $isbns := /*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt
/*:idno[@type='isbn']/replace(., '[^\d]', '')
for $desc in fn:collection('/ONIXDB/ONIX')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[
.=
$isbns
]]/SalesRights[SalesRightsType = '03']/RightsCountry
return $desc , let $isbns := /*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt
/*:idno[@type='isbn']/replace(., '[^\d]', '')
for $desc in fn:collection('/ONIXDB/ONIX')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[
.=
$isbns
]]/NotForSale/RightsCountry
return $desc )" /> -->
<!-- <item name="additionalrole" xpath="" title="Additional Role" readOnly="false" type="textfield"/> -->
<!-- <item name="performancerights" xpath="" title="Performance rights" readOnly="false" type="dropdown"/> -->
</formTemplate>