Skip to content

Commit

Permalink
Merge branch 'release-0.6.2-alpha'
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbohl committed Feb 9, 2015
2 parents b5e428e + 1139538 commit 9e1a0ec
Show file tree
Hide file tree
Showing 15 changed files with 390 additions and 72 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ proofMEIdata

The proofMEIdata Suite is a set of tools for proofreading MEI encoded XML-files. The suite is setup as eXist-db app.

Code-Mamagement
---------------

We apply the git branching model as described at: http://nvie.com/posts/a-successful-git-branching-model/ and known more commonly as "gitflow".

Building
--------

Expand All @@ -14,10 +19,11 @@ ant

This wil create a folder 'build' that includes the respective XAR for deployment in eXist-db.

Latest Version 0.5.0alpha
-------------------------
Versioning
----------

- this version has mere documentary purposes and documents the latest status from the database before switching to github development.
We apply semantic versioning as proposed under : http://semver.org
For a description of version differences please see: https://github.com/Freischuetz-Digital/proofMEIdata/releases

License
-------
Expand Down
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="proofMEIdata">

<property name="project.version" value="0.6.0-alpha"/>
<property name="project.version" value="0.6.2-alpha"/>
<property name="project.app" value="proofMEIdata"/>
<property name="build.dir" value="build"/>

<target name="xar">
<mkdir dir="${build.dir}"/>
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}.xar" excludes="${build.dir},${build.dir}/*, .gitattributes, .gitignore"/>
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}.xar" excludes="${build.dir},${build.dir}/*, .gitattributes, .gitignore, build.xml"/>
</target>
</project>
25 changes: 9 additions & 16 deletions controller.xql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
xquery version "3.0";

import module namespace freidi-rest="http://freischuetz-digital.de/freidi-tools/rest" at "modules/rest.xql";
import module namespace freidi-app="http://freischuetz-digital.de/freidi-tools/app" at "modules/app.xql";
import module namespace freidi-pmd="http://www.freischuetz-digital.de/proofMEIdata" at "modules/app.xql";

declare namespace control="http://edirom.de/apps/freidi/controller";

Expand Down Expand Up @@ -34,37 +34,30 @@ declare %private function control:get-path-variables($input as xs:string, $templ

declare %private function control:get-tools-root-path($path as xs:string) as xs:string {
(:concat(substring-before($path, '/freidi-tools'), 'http://freischuetz-digital.de/freidi-tools'):)
concat(substring-before($path, '/freidi-tools'), '/freidi-tools')
concat(substring-before($path, '/proofMEIdata'), '/proofMEIdata')
};



if ($exist:path eq '') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="{$exist:controller}/"/>
<redirect url="{concat(request:get-uri(), '/')}/"/>
</dispatch>

else if ($exist:path eq "/") then
(: forward root path to index.xql :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="{$exist:controller}/index.html"/>
<redirect url="index.html"/>
</dispatch>
else if ($exist:path eq "/login/doLogin") then (
util:declare-option("exist:serialize", "method=json media-type=application/json"),
freidi-app:login()
freidi-pmd:login()
)
else if (xmldb:get-current-user() = "guest" and ends-with($exist:resource, ".html") and $exist:resource != 'login.html') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="{$exist:controller}/login/login.html?path={encode-for-uri($exist:path)}"/>
</dispatch>
else if($exist:path = '/coreBuilder/index.html')
then(
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
<forward url="{$exist:controller}/coreBuilder/index.xql">
<set-header name="Cache-Control" value="no-cache"/>
</forward>
</view>
<redirect url="{control:get-tools-root-path(request:get-uri())}/login/login.html?path={encode-for-uri($exist:path)}"/>
</dispatch>
)

else if (ends-with($exist:resource, ".html")) then
(: the html page is run through view.xql to expand templates :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
Expand Down
2 changes: 1 addition & 1 deletion expath-pkg.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://freischuetz-digital.de/proofMEIdata" abbrev="proofMEIdata" version="0.6.0-alpha" spec="1.0">
<package xmlns="http://expath.org/ns/pkg" name="http://freischuetz-digital.de/proofMEIdata" abbrev="proofMEIdata" version="0.6.2-alpha" spec="1.0">
<title>FreiDi:proofMEIdata</title>
<dependency package="http://exist-db.org/apps/shared"/>
<dependency package="http://www.functx.com"/>
Expand Down
8 changes: 6 additions & 2 deletions modules/app.xql
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
xquery version "3.0";

module namespace freidi-app="http://freischuetz-digital.de/freidi-tools/app";
module namespace freidi-pmd = 'http://www.freischuetz-digital.de/proofMEIdata';

declare variable $freidi-pmd:facsimileServerURI := 'http://www.freischuetz-digital.de';
declare variable $freidi-pmd:ce-data := '/db/apps/controlevents-data/';


import module namespace templates="http://exist-db.org/xquery/templates" ;
import module namespace config="http://freischuetz-digital.de/tools/config" at "config.xqm";

declare function freidi-app:login() {
declare function freidi-pmd:login() {
try {
let $user := request:get-parameter("username", ())
let $password := request:get-parameter("password", ())
Expand Down
2 changes: 1 addition & 1 deletion modules/view.xql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import module namespace templates="http://exist-db.org/xquery/templates" ;
: templating.
:)
import module namespace config="http://freischuetz-digital.de/tools/config" at "config.xqm";
import module namespace freidi-app="http://freischuetz-digital.de/freidi-tools/app" at "app.xql";
import module namespace freidi-pmd="http://www.freischuetz-digital.de/proofMEIdata" at "app.xql";

declare option exist:serialize "method=html5 media-type=text/html enforce-xhtml=yes";

Expand Down
5 changes: 1 addition & 4 deletions pmdCE/resources/css/freidiPMD.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@
background-color: #ffffff;
box-shadow: 0 1px 3px rgba(0,0,0,0.5) inset;
border-radius: 5px;
overflow: scroll;
padding: 10px;
border: 1px solid #cccccc;
}

Expand All @@ -196,8 +194,7 @@
box-shadow: 0 1px 3px rgba(0,0,0,0.5) inset;
border-radius: 5px;
padding: 5px 10px;
overflow: hidden;
overflow-x: scroll;
overflow: scroll;
}

.staffBox2 svg {
Expand Down
1 change: 1 addition & 0 deletions pmdCE/resources/js/controlEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var controlevents = (function(){
if(type === 'slur') {
obj.endIDs = new Array();
obj.endStaffID = '';
obj.endPageName = String(sourcePath).split('/').pop(-1);
obj.curvedir = 'above';

editor.getTemplate(type,obj.id);
Expand Down
11 changes: 8 additions & 3 deletions pmdCE/resources/js/guiEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var guiEditor = (function() {
unloadControlEvent();
}

//console.log('guiEditor.loadControlEvent(' + json.id + ', ' + path + ')');
console.log(json);

controlEvent = json;
sourcePath = path;
Expand Down Expand Up @@ -409,34 +409,39 @@ var guiEditor = (function() {
};

var getRendering = function(position){
console.log(controlEvent);

if(['start','end'].indexOf(position) == -1)
return;

var staffID;
var prefix;
var selector;
var endPageName;

if(position === 'start') {
staffID = controlEvent.startStaffID;
prefix = startPrefix;
selector = '#' + controlEvent.type + 'StartBox';
endPageName = controlEvent.endPageName;

} else {
staffID = controlEvent.endStaffID;
prefix = endPrefix;
selector = '#' + controlEvent.type + 'EndBox';
endPageName = controlEvent.endPageName;
}

new jQuery.ajax('resources/xql/getExtendedStaff.xql', {
method: 'get',
data: {path: sourcePath, staffID: staffID, id_prefix: prefix},
data: {path: sourcePath, staffID: staffID, id_prefix: prefix, endPageName: endPageName},
success: function(result) {
var response = result || '';

var options = JSON.stringify({
inputFormat: 'mei',
pageWidth: $(selector).width() * 3,
pageHeight: 75,
pageHeight: $(selector).height() * 2,
border: 0,
ignoreLayout: 0
});
Expand Down
65 changes: 38 additions & 27 deletions pmdCE/resources/xql/getControlEvents.xql
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
xquery version "3.0";

import module namespace freidi-pmd="http://www.freischuetz-digital.de/proofMEIdata" at "../../../modules/app.xql";

declare namespace request="http://exist-db.org/xquery/request";
declare namespace mei="http://www.music-encoding.org/ns/mei";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace xmldb="http://exist-db.org/xquery/xmldb";
declare namespace system="http://exist-db.org/xquery/system";
declare namespace transform="http://exist-db.org/xquery/transform";

declare option exist:serialize "method=xhtml media-type=text/html omit-xml-declaration=yes indent=yes";
(: :declare option exist:serialize "method=xhtml media-type=text/html omit-xml-declaration=yes indent=yes";:)
declare option exist:serialize "method=text media-type=text/plain omit-xml-declaration=yes";


declare variable $path := request:get-parameter('path', '');
declare variable $staffN := request:get-parameter('staff', '');

declare variable $resourceName := tokenize($path,'/')[last()];
declare variable $parentCollectionURI := substring-before($path, $resourceName);

declare variable $doc := doc($freidi-pmd:ce-data || $path);

declare variable $slurs := $doc//(mei:slur[not(./parent::mei:*/parent::mei:choice)]|mei:choice[.//mei:slur]);
declare variable $hairpins := $doc//mei:hairpin;
declare variable $dynams := $doc//mei:dynam;
declare variable $dirs := $doc//mei:dir;

declare function local:jsonifySlurs($slurs) {

Expand All @@ -33,7 +50,10 @@ declare function local:jsonifySlurs($slurs) {
let $layer := $event/ancestor::mei:layer
let $predecessors := $layer//mei:*[local-name() = ('note','chord') and not(parent::mei:chord) and following::mei:*[@xml:id = $event/@xml:id]]

let $endEvent := $elem/root()/id(substring($endID,2))
let $endUri := concat($freidi-pmd:ce-data,$parentCollectionURI)
let $endEvent := if($elem/root()/id(substring($endID,2)))then($elem/root()/id(substring($endID,2)))else(collection($endUri)/id(substring($endID,2)))
let $endPageName := concat($endEvent/root()/mei:mei/@xml:id,'.xml')

let $endStaff := $endEvent/ancestor::mei:staff
let $endLayer := $endEvent/ancestor::mei:layer
let $endMeasure := $endLayer/ancestor::mei:measure
Expand Down Expand Up @@ -62,7 +82,10 @@ declare function local:jsonifySlurs($slurs) {
'"curvedir":"',$curvedir,'",',
'"staff":"',$staffText,'",',
'"startStaffID":"',$staff/@xml:id,'",',
'"endStaffID":"',$endStaff/@xml:id,'"',
'"endStaffID":"',$endStaff/@xml:id,'",',
'"endPageName":"',$endPageName,'",',
'"placement":"',$placement,'",',
'"xml":"',replace(replace(serialize($elem),'"','&amp;#x0027;'),'\n',''),'"',
'}')

(:concat('{"id":"',$id,'",',
Expand Down Expand Up @@ -124,28 +147,16 @@ declare function local:jsonifyDirs($dirs) {

};

let $path := request:get-parameter('path', '')
let $staffN := request:get-parameter('staff', '')

let $doc := doc('/db/apps/controlevents-data/' || $path)
(:concat('["',string-join($sources/@xml:id,'","'),'"]'):)
(
'{"slurs":[',
local:jsonifySlurs($slurs),
'],"hairpins":[',
local:jsonifyHairpins($hairpins),
'],"dynams":[',
local:jsonifyDynams($dynams),
'],"dirs":[',
local:jsonifyDirs($dirs),
']}'

let $slurs := $doc//(mei:slur[not(./parent::mei:*/parent::mei:choice)]|mei:choice[.//mei:slur])
let $hairpins := $doc//mei:hairpin
let $dynams := $doc//mei:dynam
let $dirs := $doc//mei:dir

return
(:concat('["',string-join($sources/@xml:id,'","'),'"]'):)
(
'{"slurs":[',
local:jsonifySlurs($slurs),
'],"hairpins":[',
local:jsonifyHairpins($hairpins),
'],"dynams":[',
local:jsonifyDynams($dynams),
'],"dirs":[',
local:jsonifyDirs($dirs),
']}'

)

)
17 changes: 11 additions & 6 deletions pmdCE/resources/xql/getExtendedStaff.xql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
xquery version "3.0";

import module namespace freidi-pmd="http://www.freischuetz-digital.de/proofMEIdata" at "../../../modules/app.xql";

declare namespace request="http://exist-db.org/xquery/request";
declare namespace mei="http://www.music-encoding.org/ns/mei";
declare namespace tei="http://www.tei-c.org/ns/1.0";
Expand All @@ -9,16 +11,19 @@ declare namespace transform="http://exist-db.org/xquery/transform";

declare option exist:serialize "method=xml media-type=text/plain omit-xml-declaration=yes indent=yes";


let $path := request:get-parameter('path', '')
let $path := concat($freidi-pmd:ce-data,request:get-parameter('path', ''))
let $staffID := request:get-parameter('staffID', '')
let $id_prefix := request:get-parameter('id_prefix', '')
let $xslbase := concat(replace(system:get-module-load-path(), 'embedded-eXist-server', ''), '/../xsl/')
let $endPageName := request:get-parameter('endPageName','')

let $pageName := tokenize($path,'/')[last()]
let $endPagePath := replace($path,$pageName,$endPageName)
let $xslbase := concat(replace(system:get-module-load-path(), 'embedded-eXist-server', ''), '/../xsl/')

let $doc := doc('/db/apps/controlevents-data/' || $path)
let $doc := if($id_prefix = 'slurEnd___' and $pageName != $endPageName)then(doc($endPagePath))else(doc($path))

let $snippet := transform:transform($doc, doc($xslbase || 'stripPage2staff.xsl'), <parameters><param name="staffID" value="{$staffID}"/><param name="id_prefix" value="{$id_prefix}"/></parameters>)
let $snippet := transform:transform($doc, doc($xslbase || 'stripPage2staff.xsl'), <parameters><param name="staffID" value="{$staffID}"/><param name="id_prefix" value="{$id_prefix}"/><param name="path" value="{$path}"/><param name="endPageName" value="{$endPageName}"/></parameters>)
let $preparedSnippet := transform:transform($snippet, doc($xslbase || 'prepareRendering.xsl'), <parameters></parameters>)

return
$snippet
$preparedSnippet
4 changes: 3 additions & 1 deletion pmdCE/resources/xql/pmd_ce_getFacsimilePage.xql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
xquery version "3.0";

import module namespace freidi-pmd="http://www.freischuetz-digital.de/proofMEIdata" at "../../../modules/app.xql";

declare namespace mei="http://www.music-encoding.org/ns/mei";

declare option exist:serialize "method=text media-type=text/plain omit-xml-declaration=yes";
Expand All @@ -20,7 +22,7 @@ let $wy := 0
let $ww := 1
let $wh := 1

let $imgSrc := concat('/digilib/Scaler/freidi/',$path,'?dw=',$dw,'&amp;amp;wx=',$wx,'&amp;amp;wy=',$wy,'&amp;amp;ww=',$ww,'&amp;amp;wh=',$wh)
let $imgSrc := concat($freidi-pmd:facsimileServerURI, '/digilib/Scaler/freidi/',$path,'?dw=',$dw,'&amp;amp;wx=',$wx,'&amp;amp;wy=',$wy,'&amp;amp;ww=',$ww,'&amp;amp;wh=',$wh)

return
$imgSrc
Loading

0 comments on commit 9e1a0ec

Please sign in to comment.