Skip to content

Commit

Permalink
fixed an issue with the creation of HTML metatdata
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed May 30, 2014
1 parent 540a5ec commit d7e0b97
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions webapp/modules/diary_singleView.xql
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import module namespace date="http://xquery.weber-gesamtausgabe.de/modules/date"

declare option exist:serialize "method=xhtml media-type=text/html indent=no omit-xml-declaration=yes encoding=utf-8 doctype-public=-//W3C//DTD XHTML 1.0 Strict//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";

declare function local:collectMetaData($diaryDay as node(), $authorID as xs:string, $lang as xs:string) as element(wega:metaData) {
declare function local:collectMetaData($diaryDay as document-node(), $authorID as xs:string, $lang as xs:string) as element(wega:metaData) {
let $name := wega:printFornameSurname(wega:getRegName($authorID))
let $dateFormat :=
if ($lang eq 'en') then '%A, %B %d, %Y'
else '%A, %d. %B %Y'
let $date := date:strfdate($diaryDay/string(@n), $lang, $dateFormat)
let $date := date:strfdate($diaryDay/tei:ab/string(@n), $lang, $dateFormat)
let $pageTitle := concat($name, ' – ', lang:get-language-string('diarySingleViewTitle', $date, $lang))
let $pageDescription :=
if(string-length(data($diaryDay)) > 200) then concat(substring(wega:cleanString($diaryDay), 1, 200), '…')
Expand Down Expand Up @@ -97,7 +97,7 @@ let $domLoaded :=
return

<html>
{xho:createHtmlHead(('layout76-22.css', 'diary_singleView.css'), (), local:collectMetaData($doc/tei:ab, $authorID, $lang), $domLoaded, ())}
{xho:createHtmlHead(('layout76-22.css', 'diary_singleView.css'), (), local:collectMetaData($doc, $authorID, $lang), $domLoaded, ())}
<body>
<div id="container">
{xho:createHeadContainer($lang)}
Expand Down Expand Up @@ -194,7 +194,7 @@ return
</div>
</div>
</div>
{xho:createFooter($lang, document-uri($doc/root()))}
{xho:createFooter($lang, document-uri($doc))}
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions webapp/modules/doc_singleView.xql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import module namespace lang="http://xquery.weber-gesamtausgabe.de/modules/lang"

declare option exist:serialize "method=xhtml media-type=text/html indent=no omit-xml-declaration=yes encoding=utf-8 doctype-public=-//W3C//DTD&#160;XHTML&#160;1.0&#160;Strict//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";

declare function local:collectMetaData($doc as node(), $lang as xs:string) as element(wega:metaData) {
declare function local:collectMetaData($doc as document-node(), $lang as xs:string) as element(wega:metaData) {
let $pageTitle := string-join($doc//tei:fileDesc/tei:titleStmt/tei:title[@level='a'], '. ')
let $pageDescription := wega:cleanString($doc//tei:note[@type='summary'])
let $commonMetaData := xho:collectCommonMetaData($doc)
Expand Down Expand Up @@ -144,7 +144,7 @@ return
</div>
</div>
</div>
{xho:createFooter($lang, document-uri($doc/root()))}
{xho:createFooter($lang, document-uri($doc))}
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions webapp/modules/news_singleView.xql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import module namespace lang="http://xquery.weber-gesamtausgabe.de/modules/lang"

declare option exist:serialize "method=xhtml media-type=text/html indent=no omit-xml-declaration=yes encoding=utf-8 doctype-public=-//W3C//DTD&#160;XHTML&#160;1.0&#160;Strict//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";

declare function local:collectMetaData($doc as node(), $lang as xs:string) as element(wega:metaData) {
declare function local:collectMetaData($doc as document-node(), $lang as xs:string) as element(wega:metaData) {
let $pageTitle := wega:cleanString($doc//tei:fileDesc/tei:titleStmt/tei:title[@level='a'])
let $pageDescription := concat(substring(normalize-space($doc//tei:text), 1, 200), '…')
let $commonMetaData := xho:collectCommonMetaData($doc)
Expand Down Expand Up @@ -137,7 +137,7 @@ return
</div>
</div>
</div>
{xho:createFooter($lang, document-uri($news/root()))}
{xho:createFooter($lang, document-uri($news))}
</div>
</body>
</html>
14 changes: 7 additions & 7 deletions webapp/modules/person_singleView.xql
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import module namespace lang="http://xquery.weber-gesamtausgabe.de/modules/lang"

declare option exist:serialize "method=xhtml media-type=text/html indent=no omit-xml-declaration=yes encoding=utf-8 doctype-public=-//W3C//DTD&#160;XHTML&#160;1.0&#160;Strict//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";

declare function local:collectMetaData($person as node(), $lang as xs:string) as element(wega:metaData) {
let $personID := $person/string(@xml:id)
let $name := wega:printFornameSurname($person/tei:persName[@type='reg'])
declare function local:collectMetaData($person as document-node(), $lang as xs:string) as element(wega:metaData) {
let $personID := $person/tei:person/string(@xml:id)
let $name := wega:printFornameSurname($person//tei:persName[@type='reg'])
let $pageTitle := concat($name, ' – ', lang:get-language-string('tabTitle_bio', $lang))
let $pnd_dates := concat(date:printDate($person//tei:birth/tei:date[1],$lang), '–', date:printDate($person//tei:death/tei:date[1],$lang))
let $occupations := string-join($person//tei:occupation/normalize-space(), ', ')
Expand Down Expand Up @@ -57,9 +57,9 @@ declare function local:collectMetaData($person as node(), $lang as xs:string) as
let $lang := request:get-parameter('lang','')
let $id := request:get-parameter('id','A002068')
let $withJS := request:get-parameter('js','true')
let $person := core:doc($id)/tei:person
let $name := wega:cleanString($person/tei:persName[@type='reg'])
let $pnd := $person/tei:idno[@type='gnd']
let $person := core:doc($id)
let $name := wega:cleanString($person//tei:persName[@type='reg'])
let $pnd := $person//tei:idno[@type='gnd']
let $xslParams := config:get-xsl-params(())
let $domLoaded :=
if($withJS eq 'true') then
Expand Down Expand Up @@ -153,7 +153,7 @@ return
{xho:createWorksDocumentsUL($id, $lang)}
</div>
</div>
{xho:createFooter($lang, document-uri($person/root()))}
{xho:createFooter($lang, document-uri($person))}
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion webapp/modules/xho.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ declare function xho:createWorksDocumentsUL($id as xs:string, $lang as xs:string
: @return item of meta data
:)
declare function xho:collectCommonMetaData($doc as node()?) as element(wega:metaData) {
declare function xho:collectCommonMetaData($doc as document-node()?) as element(wega:metaData) {
let $docID := $doc/*/data(@xml:id)
let $contributors :=
if(exists($doc//tei:fileDesc/tei:titleStmt/(tei:author | tei:editor))) then for $i in $doc//tei:fileDesc/tei:titleStmt/(tei:author | tei:editor) return <xhtml:meta name="DC.contributor" content="{$i}"/>
Expand Down

0 comments on commit d7e0b97

Please sign in to comment.