Skip to content

Commit

Permalink
Merge pull request #43 from Edirom/develop
Browse files Browse the repository at this point in the history
merging current develop branch into master for release 1.4.0
  • Loading branch information
KristinaRichts committed Oct 14, 2015
2 parents 1e6b9f4 + bc13913 commit 2700130
Show file tree
Hide file tree
Showing 25 changed files with 10,359 additions and 7,268 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
.sass-cache
build/
tmp/
dist/
expath-pkg.xml
resources/fonts
resources/pix/upb-logo.png
Expand All @@ -10,3 +12,5 @@ resources/pix/adwMainz.png
bower_components/

local.build.properties

WeGA-WebApp.xpr
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Instead, copy it to local.build.properties and edit that.
#
project.app=WeGA-WebApp
project.version=1.3.0
project.version=1.4.0
build.dir=build
smufl.font=http://www.smufl.org/files/bravura-1.02.zip
smufl.font=http://www.smufl.org/files/bravura-1.18.zip
additional.img.dir=/Users/pstadler/WeGA/Subversion/trunk/webapp/pix
17,334 changes: 10,165 additions & 7,169 deletions catalogues/charDecl.xml

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions catalogues/dictionary_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<entry xml:id="isBorn">wird geboren.</entry>
<entry xml:id="isBaptised">wird getauft.</entry>
<entry xml:id="writesTo">schreibt an</entry>
<entry xml:id="editorialGuidelines">Editionsrichtlinien</entry>
<entry xml:id="editorialGuidelines">Editionsrichtlinien Text</entry>
<entry xml:id="guidelines">Richtlinien</entry>
<entry xml:id="publications">Publikationen</entry>
<entry xml:id="projectDescription">Projektbeschreibung</entry>
Expand All @@ -204,7 +204,11 @@
<entry xml:id="tools">Tools</entry>
<entry xml:id="development">Entwicklung</entry>
<!-- error warnings -->
<entry xml:id="noBioFound">Keine biographischen Angaben gefunden</entry>
<entry xml:id="noBioFound">Biographische Kurzübersicht nicht vorliegend</entry>
<entry xml:id="noBioFoundReason">Kurzbiographie aus einem der folgenden Gründe nicht vorhanden</entry>
<entry xml:id="noBioFoundReason1">Daten werden erst zu einem späteren Zeitpunkt ergänzt</entry>
<entry xml:id="noBioFoundReason2">Die Recherchen der WeGA waren bislang erfolglos</entry>
<entry xml:id="noBioFoundReason3">Es handelt sich um eine allgemein bekannte Person, die bereits ausreichend an anderer Stelle erschlossen ist, vgl. etwa den Wikipedia-Link</entry>
<entry xml:id="noDataFound">keine Angaben gefunden</entry>
<entry xml:id="dateUnknown">Datum unbekannt</entry>
<!-- Schlüsselwörter aus MARC Code List for Relators, siehe http://www.loc.gov/marc/relators/relaterm.html -->
Expand Down Expand Up @@ -379,7 +383,7 @@
<entry xml:id="talks">Vorträge</entry>
<entry xml:id="abstract">Abstract</entry>
<entry xml:id="addendum">Addendum</entry>
<entry xml:id="editorialGuidelines-works">Editionsrichtlinien-Werkausgabe</entry>
<entry xml:id="editorialGuidelines-works">Editionsrichtlinien Musik</entry>
<entry xml:id="restrictSelection">Auswahl einschränken</entry>
<entry xml:id="and">und</entry>
<entry xml:id="vol">Bd.</entry>
Expand Down
10 changes: 7 additions & 3 deletions catalogues/dictionary_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
<entry xml:id="isBorn">was born.</entry>
<entry xml:id="isBaptised">was baptised.</entry>
<entry xml:id="writesTo">writes to</entry>
<entry xml:id="editorialGuidelines">Editorial Guidelines</entry>
<entry xml:id="editorialGuidelines">Editorial Guidelines Text</entry>
<entry xml:id="guidelines">Guidelines</entry>
<entry xml:id="publications">Publications</entry>
<entry xml:id="projectDescription">Project Description</entry>
Expand All @@ -201,7 +201,11 @@
<entry xml:id="tools">Tools</entry>
<entry xml:id="development">Development</entry>
<!-- error warnings -->
<entry xml:id="noBioFound">No biographical data found</entry>
<entry xml:id="noBioFound">Biographical data not available</entry>
<entry xml:id="noBioFoundReason">Biography not available due to one of the following causes</entry>
<entry xml:id="noBioFoundReason1">Data will be added at a later stage</entry>
<entry xml:id="noBioFoundReason2">Research of the WeGA was without success so far</entry>
<entry xml:id="noBioFoundReason3">It is a well known person where enough information is available online elsewhere, cf. e.g Wikipedia</entry>
<entry xml:id="noDataFound">no data found</entry>
<entry xml:id="dateUnknown">date unknown</entry>
<!-- Schlüsselwörter aus MARC Code List for Relators, siehe http://www.loc.gov/marc/relators/relaterm.html -->
Expand Down Expand Up @@ -348,7 +352,7 @@
<entry xml:id="talks">Talks</entry>
<entry xml:id="abstract">Abstract</entry>
<entry xml:id="addendum">Addendum</entry>
<entry xml:id="editorialGuidelines-works">Editorial-Guidelines-Works</entry>
<entry xml:id="editorialGuidelines-works">Editorial Guidelines Music</entry>
<entry xml:id="restrictSelection">Restrict selection</entry>
<entry xml:id="and">and</entry>
<entry xml:id="vol">vol.</entry>
Expand Down
6 changes: 3 additions & 3 deletions catalogues/options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
<entry xml:id="maxNewsDays">120</entry>
<entry xml:id="googleWebsiteMetatag">EAO5d_GiQPkJeTGACYYOFahJm2HRNvJUWwIkyw4j0Ys</entry>
<entry xml:id="microsoftBingWebsiteMetatag">AE39DA5613844228642EE48196AAA94A</entry>
<entry xml:id="version">1.3</entry>
<entry xml:id="versionNews">A050157</entry>
<entry xml:id="versionDate">2014-12-19</entry>
<entry xml:id="version">1.4</entry>
<entry xml:id="versionNews">A050158</entry>
<entry xml:id="versionDate">2015-10-13</entry>
</div>
<div xml:id="externalPNDResources">
<entry xml:id="wikipedia">http://tools.wmflabs.org/persondata/redirect/gnd/</entry>
Expand Down
16 changes: 8 additions & 8 deletions controller.xql
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,16 @@ else if (matches($exist:path, concat('^/', $lang, '/', $volContents, '/?$'))) th
</dispatch>

(: Personen - Weiterleitung :)
else if (matches($exist:path, '^/A00\d{4}/?$')) then
else if (matches($exist:path, '^/A00[A-F0-9]{4}/?$')) then
controller:redirect-docID($exist-vars, $exist:resource)

(: Andere Dokumenten - Weiterleitung :)
else if (matches($exist:path, '^/(de/|en/)?A0[3456]\d{4}/?$')) then
controller:redirect-docID($exist-vars, $exist:resource)

(: Personen - Briefliste :)
else if (matches($exist:path, concat('^/', $lang, '/A00\d{4}/', $correspondence, '/?$'))) then
let $authorID := string-join(functx:get-matches($exist:path, 'A00\d{4}'), '')
else if (matches($exist:path, concat('^/', $lang, '/A00[A-F0-9]{4}/', $correspondence, '/?$'))) then
let $authorID := string-join(functx:get-matches($exist:path, 'A00[A-F0-9]{4}'), '')
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{concat($exist:controller, '/modules/register.xql')}">
Expand All @@ -302,8 +302,8 @@ else if (matches($exist:path, concat('^/', $lang, '/A00\d{4}/', $correspondence,
</dispatch>

(: Personen - Schriftenliste :)
else if (matches($exist:path, concat('^/', $lang, '/A00\d{4}/', $writings, '/?$'))) then
let $authorID := string-join(functx:get-matches($exist:path, 'A00\d{4}'),'')
else if (matches($exist:path, concat('^/', $lang, '/A00[A-F0-9]{4}/', $writings, '/?$'))) then
let $authorID := string-join(functx:get-matches($exist:path, 'A00[A-F0-9]{4}'),'')
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{concat($exist:controller, '/modules/register.xql')}">
Expand All @@ -314,8 +314,8 @@ else if (matches($exist:path, concat('^/', $lang, '/A00\d{4}/', $writings, '/?$'
</dispatch>

(: Personen - Werkeliste :)
else if (matches($exist:path, concat('^/', $lang, '/A00\d{4}/', $works, '/?$'))) then
let $authorID := string-join(functx:get-matches($exist:path, 'A00\d{4}'),'')
else if (matches($exist:path, concat('^/', $lang, '/A00[A-F0-9]{4}/', $works, '/?$'))) then
let $authorID := string-join(functx:get-matches($exist:path, 'A00[A-F0-9]{4}'),'')
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{concat($exist:controller, '/modules/register.xql')}">
Expand All @@ -338,7 +338,7 @@ else if (matches($exist:path, concat('^/', $lang, '/A002068/', $diaries, '/?$'))
</dispatch>

(: Personen - Einzelansicht :)
else if (matches($exist:path, concat('^/', $lang, '/A00\d{4}/?$'))) then
else if (matches($exist:path, concat('^/', $lang, '/A00[A-F0-9]{4}/?$'))) then
let $js := if(request:get-parameter-names() = $ajaxCrawlerParameter) then 'false' else 'true'
let $person := core:doc($exist:resource)/tei:person
return if(exists($person)) then
Expand Down
17 changes: 11 additions & 6 deletions modules/ajax.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,15 @@ return (
</div>
else
if($person//tei:event) then ()
else <div id="bioSummary"><i>({lang:get-language-string('noBioFound',$lang)})</i></div>,
else <div id="bioSummary">
<p><i>{lang:get-language-string('noBioFound',$lang)}</i></p>
<p style="font-size: smaller;">{lang:get-language-string('noBioFoundReason',$lang)}:</p>
<ul style="font-size: smaller;">
<li> {lang:get-language-string('noBioFoundReason1',$lang)} </li>
<li> {lang:get-language-string('noBioFoundReason2',$lang)} </li>
<li> {lang:get-language-string('noBioFoundReason3',$lang)} </li>
</ul>
</div>,
if($id eq 'A002068') then
if ($lang eq 'en') then ()
else <p class="linkAppendix">Einen ausführlichen Lebenslauf finden Sie in der <a href="{core:join-path-elements(($baseHref, '/de/Biographie'))}">erweiterten Biographie</a></p>
Expand Down Expand Up @@ -343,7 +351,7 @@ declare function ajax:getADB($pnd as xs:string, $lang as xs:string) as element()
:)

declare function ajax:getDNB($pnd as xs:string, $lang as xs:string) as element(div) {
let $dnbContentRoot := wega:grabExternalResource('dnb', $pnd, (), true())//httpclient:body//xhtml:div[@class='chapters'][data(./xhtml:h2)=concat(config:get-option('dnb'),$pnd)]/xhtml:table[1]
let $dnbContentRoot := wega:grabExternalResource('dnb', $pnd, (), true())//xhtml:table[@id='fullRecordTable']
let $name := normalize-space($dnbContentRoot//xhtml:td[preceding-sibling::xhtml:td/xhtml:strong = 'Person'])
let $roleName := normalize-space($dnbContentRoot//xhtml:td[preceding-sibling::xhtml:td/xhtml:strong = 'Adelstitel'])
let $otherNames := string-join($dnbContentRoot//xhtml:td[preceding-sibling::xhtml:td/xhtml:strong ='Andere Namen']/text()/normalize-space(.), '; ')
Expand Down Expand Up @@ -609,10 +617,7 @@ declare function ajax:printTranscription($docID as xs:string, $lang as xs:string
else ()
let $head :=
if(config:is-letter($docID)) then wega:getLetterHead($doc, $lang)
else if(config:is-news($docID)) then element h1 {
transform:transform($doc//tei:fileDesc/tei:titleStmt/tei:title[@level='a'], doc(concat($config:xsl-collection-path, '/common_main.xsl')), config:get-xsl-params(()))
(:string($doc//tei:title[@level='a']):)
}
else if(config:is-news($docID)) then element h1 {string($doc//tei:title[@level='a'])}
else if(config:is-writing($docID)) then wega:getWritingHead($doc, $xslParams, $lang)
else ()
let $body :=
Expand Down
15 changes: 5 additions & 10 deletions modules/bibl.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ declare function bibl:printCitation($biblStruct as element(tei:biblStruct), $wra
case 'mastersthesis' return bibl:printBookCitation($biblStruct, $wrapperElement, $lang)
case 'review' return bibl:printArticleCitation($biblStruct, $wrapperElement, $lang)
case 'phdthesis' return bibl:printBookCitation($biblStruct, $wrapperElement, $lang)
case 'monogrOnly' return bibl:printJournalCitation($biblStruct/tei:monogr, $wrapperElement, $lang)
default return bibl:printGenericCitation($biblStruct, $wrapperElement, $lang)
};

Expand Down Expand Up @@ -157,15 +158,7 @@ declare function bibl:printIncollectionCitation($biblStruct as element(tei:biblS
declare function bibl:printJournalCitation($monogr as element(tei:monogr), $wrapperElement as xs:string, $lang as xs:string) as element() {
let $journalTitle := <span class="journalTitle">{string-join($monogr/tei:title, '. ')}</span>
(: let $date := concat('(', $monogr/tei:imprint/tei:date, ')'):)
let $biblScope := bibl:biblScope($monogr/tei:imprint, $lang) (:concat(
if($monogr/tei:imprint/tei:biblScope[@type = 'vol']) then concat(', ', lang:get-language-string('vol', $lang), '&#160;', $monogr/tei:imprint/tei:biblScope[@type = 'vol']) else (),
if($monogr/tei:imprint/tei:biblScope[@type = 'jg']) then concat(', ', 'Jg.', '&#160;', $monogr/tei:imprint/tei:biblScope[@type = 'jg']) else (),
if($monogr/tei:imprint/tei:biblScope[@type = 'issue']) then concat(', ', lang:get-language-string('issue', $lang), '&#160;', $monogr/tei:imprint/tei:biblScope[@type = 'issue']) else (),
if($monogr/tei:imprint/tei:biblScope[@type = 'nr']) then concat(', ', 'Nr.', '&#160;', $monogr/tei:imprint/tei:biblScope[@type = 'nr']) else (),
if(exists($monogr/tei:imprint/tei:date)) then concat(' ', $date) else (),
if($monogr/tei:imprint/tei:biblScope[@type = 'pp']) then concat(', ', lang:get-language-string('pp', $lang), '&#160;', replace($monogr/tei:imprint/tei:biblScope[@type = 'pp'], '-', '–')) else (),
if($monogr/tei:imprint/tei:biblScope[@type = 'col']) then concat(', ', lang:get-language-string('col', $lang), '&#160;', replace($monogr/tei:imprint/tei:biblScope[@type = 'col'], '-', '–')) else ()
):)
let $biblScope := bibl:biblScope($monogr/tei:imprint, $lang)
return
element {$wrapperElement} {
$journalTitle,
Expand Down Expand Up @@ -269,7 +262,9 @@ declare %private function bibl:printpubPlaceNYear($imprint as element(tei:imprin
: @return the entry type as string, the empty sequence if nothing could be inferd
:)
declare %private function bibl:guess-biblio-type($biblStruct as element(tei:biblStruct)) as xs:string? {
if($biblStruct/@type = $bibl:supportedBiblioTypes) then $biblStruct/@type cast as xs:string
(: An Schriften wird nur die Zeitschrift ausgegeben :)
if(config:is-writing($biblStruct/ancestor::tei:TEI/data(@xml:id))) then 'monogrOnly'
else if($biblStruct/@type = $bibl:supportedBiblioTypes) then $biblStruct/@type cast as xs:string
else if($biblStruct/tei:analytic and $biblStruct/tei:monogr/tei:title[@level='j']) then 'article'
else()
};
4 changes: 2 additions & 2 deletions modules/config.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ declare function config:get-doctype-by-id($id as xs:string?) as xs:string? {
: @return xs:boolean
:)
declare function config:is-person($docID as xs:string?) as xs:boolean {
matches($docID, '^A00\d{4}$')
matches($docID, '^A00[0-9A-F]{4}$')
};

(:~
Expand Down Expand Up @@ -342,7 +342,7 @@ declare function config:is-biblioType($string as xs:string) as xs:boolean {
declare function config:getCollectionPath($docID as xs:string) as xs:string? {
let $docType := config:get-doctype-by-id($docID)
return
if(exists($docType)) then core:join-path-elements(($config:data-collection-path, $docType, replace($docID, '\d{2}$', 'xx')))
if(exists($docType)) then core:join-path-elements(($config:data-collection-path, $docType, replace($docID, '[A-F0-9]{2}$', 'xx')))
else ()
};

Expand Down
52 changes: 47 additions & 5 deletions modules/dev/dev.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ declare function dev:addFffiEntry($IDFile as document-node(), $id as xs:string?)
let $currentdateTime := util:system-dateTime()
let $newNode := <entry xml:id="{$id}" dateTime="{$currentdateTime}" xmlns="http://xquery.weber-gesamtausgabe.de/modules/dev"/>
let $storeNode :=
if (matches($id, '_A\d{6}')) then update insert $newNode into $IDFile/dev:dictionary
if (config:get-doctype-by-id(substring($id, 2))) then update insert $newNode into $IDFile/dev:dictionary
else error(xs:QName('dev:error'), 'got wrong ID: ' || $id)
return
$IDFile//id($id)/string(@xml:id)
Expand Down Expand Up @@ -97,7 +97,9 @@ declare function dev:removeOldEntries($IDFile as document-node()) as empty() {

declare %private function dev:getNewID($max as xs:integer, $coll1 as xs:string+, $coll2 as xs:string+) as xs:string {
let $IDPrefix := substring($coll1[22], 1, 3) (: use a higher element diary summaries, e.g. diary_Weber_1817 :)
let $rand := functx:pad-integer-to-length(util:random($max) + 1, 4)
let $rand :=
if(config:is-person($coll1[22])) then dev:pad-hex-to-length(dev:int2hex(util:random($max)), 4)
else functx:pad-integer-to-length(util:random($max), 4)
let $newID := concat($IDPrefix, $rand)
return
if ($newID = ($coll1, $coll2)) then dev:getNewID($max, $coll1, $coll2)
Expand All @@ -123,7 +125,7 @@ declare function dev:createNewID($docType as xs:string) as xs:string {
let $removeOldTempIDS := dev:removeOldEntries($IDFile)
let $maxID := count($coll1) + count($coll2) + 200
let $newID :=
if ($maxID lt 9999) then dev:addFffiEntry($IDFile, concat('_', dev:getNewID($maxID, $coll1, $coll2)))
if ($maxID lt 65535) then dev:addFffiEntry($IDFile, concat('_', dev:getNewID($maxID, $coll1, $coll2)))
else '_kein Eintrag verfügbar'

return substring($newID, 2)
Expand Down Expand Up @@ -213,11 +215,51 @@ declare function dev:validatePaths($docType as xs:string) as element() {
: @return map with entries 'rev' and 'success'
:)
declare function dev:ant-log() as map(*) {
let $logFile := util:binary-doc(core:join-path-elements(($config:tmp-collection-path, 'logs', max(xmldb:get-child-resources($config:tmp-collection-path || '/logs')))))
let $currLogRev := max(xmldb:get-child-resources($config:tmp-collection-path || '/logs') ! (substring-before(., '.log') cast as xs:int))
let $logFile := util:binary-doc(core:join-path-elements(($config:tmp-collection-path, 'logs', $currLogRev || '.log')))
let $logLines := tokenize(util:binary-to-string($logFile), '\n')
return
map:new((
map:entry('rev', substring-after($logLines[contains(., 'Current revision of the working copy: ')], ': ')),
map:entry('rev', $currLogRev),
map:entry('success', if($logLines = 'BUILD SUCCESSFUL') then 'success' else 'failed')
))
};

declare variable $dev:int2hex as map() := map {
'0' := '0',
'1' := '1',
'2' := '2',
'3' := '3',
'4' := '4',
'5' := '5',
'6' := '6',
'7' := '7',
'8' := '8',
'9' := '9',
'10' := 'A',
'11' := 'B',
'12' := 'C',
'13' := 'D',
'14' := 'E',
'15' := 'F'
};

declare function dev:int2hex($number as xs:int) as xs:string {
let $div := $number div 16
let $count := floor($div)
let $remainder := ($div - $count) * 16
return
concat(
if($count gt 15) then dev:int2hex($count)
else $dev:int2hex($count),
$dev:int2hex($remainder)
)
};

declare function dev:pad-hex-to-length($stringToPad as xs:string?, $length as xs:integer) as xs:string {
if ($length lt string-length($stringToPad)) then error(xs:QName('dev:Hex_Longer_Than_Length'))
else concat(
functx:repeat-string('0', $length - string-length($stringToPad)),
$stringToPad
)
};
Loading

0 comments on commit 2700130

Please sign in to comment.