Skip to content

Commit

Permalink
fix insert graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
olvidalo committed May 20, 2016
1 parent 56ee542 commit 21b267f
Show file tree
Hide file tree
Showing 2 changed files with 209 additions and 31 deletions.
1 change: 1 addition & 0 deletions css/epidoc_c.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TEI:before {
" " attr("rend")
;
-oxy-editable: false;
link: "http://papyri.uni-koeln.de:8080/apps/papyri-data/wissen/bibl.xml";
}
teiHeader, text, facsimile {
margin: 0.5em;
Expand Down
239 changes: 208 additions & 31 deletions epidoc_c.framework
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
</docTypeSchema>
</field>
<field name="classpath">
<String-array/>
<String-array>
<String>${framework}/lib</String>
</String-array>
</field>
<field name="parentClassLoaderID">
<null/>
Expand Down Expand Up @@ -5666,19 +5668,19 @@ Alternativ zur Angabe einzelner Maße oder ergänzend dazu können Anmerkungen i
</action>
<action>
<field name="id">
<String>choose_graphic</String>
<String>insert_graphic_remove_temp_attribute</String>
</field>
<field name="name">
<String>Grafik wählen</String>
<String>Nach Grafik einfügen temporäres Attribut löschen</String>
</field>
<field name="description">
<String></String>
</field>
<field name="largeIconPath">
<String>${framework}/img/add-20.png</String>
<String></String>
</field>
<field name="smallIconPath">
<String>${framework}/img/add-16.png</String>
<String></String>
</field>
<field name="accessKey">
<String></String>
Expand All @@ -5690,30 +5692,144 @@ Alternativ zur Angabe einzelner Maße oder ergänzend dazu können Anmerkungen i
<actionMode-array>
<actionMode>
<field name="xpathCondition">
<String>self::surface and @temp-url</String>
<String></String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>elementLocation</String>
<String>//surface</String>
</entry>
<entry>
<String>name</String>
<String>temp-url</String>
</entry>
<entry>
<String>removeIfEmpty</String>
<String>true</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
<String>ro.sync.ecss.extensions.commons.operations.ChangeAttributeOperation</String>
</field>
</actionMode>
</actionMode-array>
</field>
<field name="enabledInReadOnlyContext">
<Boolean>false</Boolean>
</field>
</action>
<action>
<field name="id">
<String>insert_all_graphics</String>
</field>
<field name="name">
<String>Alle Grafiken verknüpfen</String>
</field>
<field name="description">
<String></String>
</field>
<field name="largeIconPath">
<String></String>
</field>
<field name="smallIconPath">
<String></String>
</field>
<field name="accessKey">
<String></String>
</field>
<field name="accelerator">
<null/>
</field>
<field name="actionModes">
<actionMode-array>
<actionMode>
<field name="xpathCondition">
<String>count(./graphic) = 0</String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>actionIDs</String>
<String>insert_all_graphics_delete_temp
insert_all_graphics_insert</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
<String>ro.sync.ecss.extensions.commons.operations.ExecuteMultipleActionsOperation</String>
</field>
</actionMode>
</actionMode-array>
</field>
<field name="enabledInReadOnlyContext">
<Boolean>false</Boolean>
</field>
</action>
<action>
<field name="id">
<String>insert_all_graphics_insert</String>
</field>
<field name="name">
<String>insert_all_graphics_insert</String>
</field>
<field name="description">
<String></String>
</field>
<field name="largeIconPath">
<String></String>
</field>
<field name="smallIconPath">
<String></String>
</field>
<field name="accessKey">
<String></String>
</field>
<field name="accelerator">
<null/>
</field>
<field name="actionModes">
<actionMode-array>
<actionMode>
<field name="xpathCondition">
<String>count(./graphic) = 0</String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>action</String>
<String>Inside as first child</String>
</entry>
<entry>
<String>caretPosition</String>
<String>Preserve</String>
</entry>
<entry>
<String>expandEditorVariables</String>
<String>true</String>
</entry>
<entry>
<String>script</String>
<String>xquery version "3.0";

declare default element namespace "http://www.tei-c.org/ns/1.0";
declare namespace file="http://exist-db.org/xquery/file";


let $filename := ./@temp-url/data(.)
let $id := ./root()/TEI/@xml:id/data(.)
let $graphic := doc("http://papyri.uni-koeln.de:8080/apps/papyri/modules/oxygen-tools.xql?what=file&amp;#038;dir=${cfn}.xml&amp;amp;file="||$filename||"&amp;amp;id="||$id)
return (
insert node $graphic into .,
delete node ./@temp-url
)</String>
let $cfn := tokenize(document-uri(), "/")[last()]
let $id := //TEI/@xml:id/data(.)
let $url := concat("http://papyri.uni-koeln.de:8080/apps/papyri/modules/oxygen-tools.xql?what=file&amp;amp;dir=", $cfn, "&amp;amp;id=",$id)
let $graphics := doc($url)//graphic
return $graphics</String>
</entry>
<entry>
<String>sourceLocation</String>
<String>//TEI</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
<String>ro.sync.ecss.extensions.commons.operations.XQueryUpdateOperation</String>
<String>ro.sync.ecss.extensions.commons.operations.XQueryOperation</String>
</field>
</actionMode>
</actionMode-array>
Expand All @@ -5724,10 +5840,10 @@ return (
</action>
<action>
<field name="id">
<String>insert_graphic_remove_temp_attribute</String>
<String>insert_all_graphics_delete_temp</String>
</field>
<field name="name">
<String>Nach Grafik einfügen temporäres Attribut löschen</String>
<String>insert_all_graphics_delete_temp</String>
</field>
<field name="description">
<String></String>
Expand All @@ -5748,22 +5864,18 @@ return (
<actionMode-array>
<actionMode>
<field name="xpathCondition">
<String>parent::surface</String>
<String></String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>elementLocation</String>
<String>parent::surface</String>
<String>//surface</String>
</entry>
<entry>
<String>name</String>
<String>temp-url</String>
</entry>
<entry>
<String>removeIfEmpty</String>
<String>true</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
Expand All @@ -5778,10 +5890,10 @@ return (
</action>
<action>
<field name="id">
<String>insert_all_graphics</String>
<String>choose_graphic_insert</String>
</field>
<field name="name">
<String>Alle Grafiken verknüpfen</String>
<String>choose_graphic_insert</String>
</field>
<field name="description">
<String></String>
Expand All @@ -5802,10 +5914,18 @@ return (
<actionMode-array>
<actionMode>
<field name="xpathCondition">
<String>count(./graphic) = 0</String>
<String></String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>action</String>
<String>Inside as last child</String>
</entry>
<entry>
<String>caretPosition</String>
<String>Preserve</String>
</entry>
<entry>
<String>script</String>
<String>xquery version "3.0";
Expand All @@ -5814,15 +5934,72 @@ declare default element namespace "http://www.tei-c.org/ns/1.0";
declare namespace file="http://exist-db.org/xquery/file";


let $id := ./root()/TEI/@xml:id/data(.)
let $graphics := doc("http://papyri.uni-koeln.de:8080/apps/papyri/modules/oxygen-tools.xql?what=file&amp;#038;dir=${cfn}.xml&amp;amp;id="||$id)//graphic
return
insert node $graphics into .</String>
let $filename := //surface/@temp-url/data(.)
let $id := //TEI/@xml:id/data(.)
let $url := "http://papyri.uni-koeln.de:8080/apps/papyri/modules/oxygen-tools.xql?what=file&amp;#038;dir="||tokenize(document-uri(), "/")[last()]||"&amp;amp;file="||$filename||"&amp;amp;id="||$id

let $graphic := doc($url)
return $graphic</String>
</entry>
<entry>
<String>sourceLocation</String>
<String>//TEI</String>
</entry>
<entry>
<String>targetLocation</String>
<String></String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
<String>ro.sync.ecss.extensions.commons.operations.XQueryOperation</String>
</field>
</actionMode>
</actionMode-array>
</field>
<field name="enabledInReadOnlyContext">
<Boolean>false</Boolean>
</field>
</action>
<action>
<field name="id">
<String>choose_graphic</String>
</field>
<field name="name">
<String>choose_graphic</String>
</field>
<field name="description">
<String></String>
</field>
<field name="largeIconPath">
<String>${framework}/img/add-20.png</String>
</field>
<field name="smallIconPath">
<String>${framework}/img/add-16.png</String>
</field>
<field name="accessKey">
<String></String>
</field>
<field name="accelerator">
<null/>
</field>
<field name="actionModes">
<actionMode-array>
<actionMode>
<field name="xpathCondition">
<String></String>
</field>
<field name="argValues">
<serializableOrderedMap>
<entry>
<String>actionIDs</String>
<String>choose_graphic_insert
insert_graphic_remove_temp_attribute</String>
</entry>
</serializableOrderedMap>
</field>
<field name="operationID">
<String>ro.sync.ecss.extensions.commons.operations.XQueryUpdateOperation</String>
<String>ro.sync.ecss.extensions.commons.operations.ExecuteMultipleActionsOperation</String>
</field>
</actionMode>
</actionMode-array>
Expand Down

0 comments on commit 21b267f

Please sign in to comment.