Quantcast

oXygen Content Completion plugin for personography

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

oXygen Content Completion plugin for personography

Easterly, Joseph
Hi,

Have you (or do you know of anyone) who has developed a plugin for oXygen which allows editors to search through external XML files (or an xml database) from oXygen's autocomplete / content completion interface?

An example of how such a plugin might be used is in doing personography work with primary source materials, and at the point in the TEI editing process where you add the @ref attribute to a <persName> tag, a searchable pop-up list appears, populated with entries from your personography file.

Such a plugin wouldn’t necessarily modify oXygen’s content completion functionality, but I imagine it would somewhat mimic its behavior.

many thanks,

Joe Easterly
Digital Humanities Librarian
River Campus Libraries, University of Rochester
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

Martin Holmes
Hi Joe,

I have a feeling this might now be possible in Oxygen -- check with
their support -- but up to now, we've been doing this in a sort of
roundabout way: I have ant build files which rebuild our ODD file using
all the values of personography @xml:ids as a valList for the attribute
concerned, and then build the schema for it. Then Oxygen does prompt for
the correct values. It's slightly annoying because it means you have to
run that job every time you modify the personography before you can use
a new id in the pointer attribute, but it does work.

Cheers,
Martin

On 15-06-24 01:19 PM, Easterly, Joseph wrote:

> Hi,
>
> Have you (or do you know of anyone) who has developed a plugin for oXygen which allows editors to search through external XML files (or an xml database) from oXygen's autocomplete / content completion interface?
>
> An example of how such a plugin might be used is in doing personography work with primary source materials, and at the point in the TEI editing process where you add the @ref attribute to a <persName> tag, a searchable pop-up list appears, populated with entries from your personography file.
>
> Such a plugin wouldn’t necessarily modify oXygen’s content completion functionality, but I imagine it would somewhat mimic its behavior.
>
> many thanks,
>
> Joe Easterly
> Digital Humanities Librarian
> River Campus Libraries, University of Rochester
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

ron.vandenbranden
Administrator
Hi,

On 24/06/2015 22:39, Martin Holmes wrote:

>
> I have a feeling this might now be possible in Oxygen -- check with
> their support -- but up to now, we've been doing this in a sort of
> roundabout way: I have ant build files which rebuild our ODD file
> using all the values of personography @xml:ids as a valList for the
> attribute concerned, and then build the schema for it. Then Oxygen
> does prompt for the correct values. It's slightly annoying because it
> means you have to run that job every time you modify the personography
> before you can use a new id in the pointer attribute, but it does work.
>

I think I have found a slightly more flexible approach using Schematron
Quick Fixes (https://github.com/schematron-quickfix/), which are
supported since Oxygen 17 (see
http://www.oxygenxml.com/demo/Schematron_Quick_Fixes.html).

For example, this rudimentary Schematron file could do the job (untested!):

<schema
   xmlns="http://purl.oclc.org/dsdl/schematron"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:tei="http://www.tei-c.org/ns/1.0"
   xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
   queryBinding="xslt2">
     <ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
     
   <xsl:variable name="person.index" select="doc('person-index.xml')//tei:person"/>
   
   <pattern>
     <rule context="tei:name">
       <report role="warning" test="not(@ref)" sqf:fix="add.ref">
         A name should have a @ref attribute pointing to a person definition.
       </report>
       <let name="person.id" value="$person.index[matches(tei:persName, normalize-space(current()))]/@xml:id"/>
       <sqf:fix id="add.ref">
         <sqf:description>
           <sqf:title>
             Add a @ref pointing to a person definition.
           </sqf:title>
         </sqf:description>
         <sqf:add match="." node-type="attribute" target="ref" select="concat('#', $person.id)"/>
       </sqf:fix>
     </rule>
   </pattern>

</schema>

The $person.index variable loads all person definitions from an index
file; the Schematron rule matching <tei:name> elements will try to look
up a person definition in $person.index matching the current name. Next,
the SQF will propose to add a @ref attribute to the <tei:name> pointing
to the the @xml:id value of the matching <tei:person> element in
$person.index.

Though this example is very rudimentary, you could add some degree of
'dynamism' to offer multiple suggestions, should multiple possible
person definitions be found (see the discussion at
https://github.com/schematron-quickfix/sqf/issues/3).

While I think this is slightly more flexible than Martin's approach in
that the ODD file doesn't have to be regenerated over again, the
definition of $person.index in my example still requires a precompiled
index file containing all unique names found in a TEI document or
collection. While it is theoretically possible to do a live search over
a collection (by swapping the doc() function with a collection() call
over the entire collection), this would probably hardly be workable
since each new Schematron validation run (basically after each keystroke
in an XML document being validated against this Schematron in Oxygen)
will have to scan the collection again for each name in that document.
But perhaps Oxygen allows for database integration with e.g. an eXist-db
instance that could boost performance of the $person.index lookup; I
don't know if that's possible (if it is possible, I'd be interested to
learn more).

Best,

Ron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

Radu Coravu
Hi,

The idea of using quick fixes to guide end users into selecting the
proper custom values for an attribute is quite interesting.

One more thing Oxygen 17.0 added was support to have a special XML
configuration file which can add content completion values for elements
or attributes (even by applying an XSLT stylesheet):

> http://www.oxygenxml.com/doc/versions/17.0/ug-editor//#topics/configuring-content-completion-proposals.html

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 6/25/2015 12:49 AM, [hidden email] wrote:

> Hi,
>
> On 24/06/2015 22:39, Martin Holmes wrote:
>>
>> I have a feeling this might now be possible in Oxygen -- check with
>> their support -- but up to now, we've been doing this in a sort of
>> roundabout way: I have ant build files which rebuild our ODD file
>> using all the values of personography @xml:ids as a valList for the
>> attribute concerned, and then build the schema for it. Then Oxygen
>> does prompt for the correct values. It's slightly annoying because it
>> means you have to run that job every time you modify the personography
>> before you can use a new id in the pointer attribute, but it does work.
>>
>
> I think I have found a slightly more flexible approach using Schematron
> Quick Fixes (https://github.com/schematron-quickfix/), which are
> supported since Oxygen 17 (see
> http://www.oxygenxml.com/demo/Schematron_Quick_Fixes.html).
>
> For example, this rudimentary Schematron file could do the job (untested!):
>
> <schema
>    xmlns="http://purl.oclc.org/dsdl/schematron"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:tei="http://www.tei-c.org/ns/1.0"
>    xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
>    queryBinding="xslt2">
>      <ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
>    <xsl:variable name="person.index"
> select="doc('person-index.xml')//tei:person"/>
>    <pattern>
>      <rule context="tei:name">
>        <report role="warning" test="not(@ref)" sqf:fix="add.ref">
>          A name should have a @ref attribute pointing to a person
> definition.
>        </report>
>        <let name="person.id" value="$person.index[matches(tei:persName,
> normalize-space(current()))]/@xml:id"/>
>        <sqf:fix id="add.ref">
>          <sqf:description>
>            <sqf:title>
>              Add a @ref pointing to a person definition.
>            </sqf:title>
>          </sqf:description>
>          <sqf:add match="." node-type="attribute" target="ref"
> select="concat('#', $person.id)"/>
>        </sqf:fix>
>      </rule>
>    </pattern>
>
> </schema>
>
> The $person.index variable loads all person definitions from an index
> file; the Schematron rule matching <tei:name> elements will try to look
> up a person definition in $person.index matching the current name. Next,
> the SQF will propose to add a @ref attribute to the <tei:name> pointing
> to the the @xml:id value of the matching <tei:person> element in
> $person.index.
>
> Though this example is very rudimentary, you could add some degree of
> 'dynamism' to offer multiple suggestions, should multiple possible
> person definitions be found (see the discussion at
> https://github.com/schematron-quickfix/sqf/issues/3).
>
> While I think this is slightly more flexible than Martin's approach in
> that the ODD file doesn't have to be regenerated over again, the
> definition of $person.index in my example still requires a precompiled
> index file containing all unique names found in a TEI document or
> collection. While it is theoretically possible to do a live search over
> a collection (by swapping the doc() function with a collection() call
> over the entire collection), this would probably hardly be workable
> since each new Schematron validation run (basically after each keystroke
> in an XML document being validated against this Schematron in Oxygen)
> will have to scan the collection again for each name in that document.
> But perhaps Oxygen allows for database integration with e.g. an eXist-db
> instance that could boost performance of the $person.index lookup; I
> don't know if that's possible (if it is possible, I'd be interested to
> learn more).
>
> Best,
>
> Ron
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

Conal Tuohy-3
In reply to this post by Easterly, Joseph
Joseph you may be interested in the EATS (Entity Authority Tool Set) application which was originally designed for recording e.g. personographic data for a TEI corpus, and which included an Oxygen client:

http://eats.readthedocs.org/en/latest/clients.html


On 25 June 2015 at 06:19, Easterly, Joseph <[hidden email]> wrote:
Hi,

Have you (or do you know of anyone) who has developed a plugin for oXygen which allows editors to search through external XML files (or an xml database) from oXygen's autocomplete / content completion interface?

An example of how such a plugin might be used is in doing personography work with primary source materials, and at the point in the TEI editing process where you add the @ref attribute to a <persName> tag, a searchable pop-up list appears, populated with entries from your personography file.

Such a plugin wouldn’t necessarily modify oXygen’s content completion functionality, but I imagine it would somewhat mimic its behavior.

many thanks,

Joe Easterly
Digital Humanities Librarian
River Campus Libraries, University of Rochester



--
@conal_tuohy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

Andreas Wagner
In reply to this post by Easterly, Joseph
Hi Joe and list,

Am 24.06.2015 um 22:19 schrieb Easterly, Joseph:
> Have you (or do you know of anyone) who has developed a plugin for oXygen which allows editors to search through external XML files (or an xml database) from oXygen's autocomplete / content completion interface?
>
> An example of how such a plugin might be used is in doing personography work with primary source materials, and at the point in the TEI editing process where you add the @ref attribute to a <persName> tag, a searchable pop-up list appears, populated with entries from your personography file.
>
> Such a plugin wouldn’t necessarily modify oXygen’s content completion functionality, but I imagine it would somewhat mimic its behavior.

I am aware of two things (and we are not settled on what to use for a
similar task, so I am keen on reading up on the other suggestions), but
both involve an instance of eXist database:

dbtagger by Alexander Erhard - https://github.com/aerhard/dbTagger
ediarum by BBAW - https://github.com/telota/ediarum/wiki

I have seen the ediarum work very well, but since I have not yet managed
to get myself into the Java routines that they have developed for oXygen
for the very purpose you mentioned, I have for now tried mostly to adapt
dbtagger to our needs. To this end, I have written some functions that
manage a data roundtrip between a google spreadsheet where we can
maintain personography info and authority db id numbers, our eXist
database and dbtagger which brings this back into oXygen.
I have started to document this and a first glimpse can be gotten at

https://en.wikibooks.org/wiki/XQuery/Google_Docs

and (better):

http://thread.gmane.org/gmane.text.xml.exist/46884/focus=46886

(Note to self: Get the documentation done!)

As I said, I am looking forward to seeing other approaches/solutions, too.
Cheers,

Andreas


--
Dr. Andreas Wagner
Project "The School of Salamanca"
Academy of Sciences and Literature, Mainz
and Institute of Philosophy
Goethe University Frankfurt
http://salamanca.adwmainz.de

IGF HP 25 / R 2.455
Norbert-Wollheim-Platz 1
60629 Frankfurt am Main
Tel. +49 (0)69/798-32774
Fax  +49 (0)69/798-32794
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

Easterly, Joseph
In reply to this post by ron.vandenbranden
Thanks to everyone for sharing your ideas—very helpful!

best,

Joe

> On Jun 24, 2015, at 5:49 PM, [hidden email] wrote:
>
> Hi,
>
> On 24/06/2015 22:39, Martin Holmes wrote:
>>
>> I have a feeling this might now be possible in Oxygen -- check with their support -- but up to now, we've been doing this in a sort of roundabout way: I have ant build files which rebuild our ODD file using all the values of personography @xml:ids as a valList for the attribute concerned, and then build the schema for it. Then Oxygen does prompt for the correct values. It's slightly annoying because it means you have to run that job every time you modify the personography before you can use a new id in the pointer attribute, but it does work.
>>
>
> I think I have found a slightly more flexible approach using Schematron Quick Fixes (https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_schematron-2Dquickfix_&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=1wkMY7jHdz9Z88kxnwfocqo01hVA03vCABwUTNrZscc&e= ), which are supported since Oxygen 17 (see https://urldefense.proofpoint.com/v2/url?u=http-3A__www.oxygenxml.com_demo_Schematron-5FQuick-5FFixes.html&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=CvaNAWn49zqXE_aHcNeIs-3qoPBzaZUsdvatuz8DQN4&e= ).
>
> For example, this rudimentary Schematron file could do the job (untested!):
>
> <schema
>  xmlns="https://urldefense.proofpoint.com/v2/url?u=http-3A__purl.oclc.org_dsdl_schematron&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=jpHX_EDmgTDXhLJ62_jWz1oWezCwnIoE44-XcYNETDY&e= "
>  xmlns:xsl="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.w3.org_1999_XSL_Transform&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=NFFi5B9Zx71ffjxRYEVKCPx5IdQgxqlfJfYimjDpifw&e= "
>  xmlns:tei="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.tei-2Dc.org_ns_1.0&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=RYdhsNWzVA9Dn-r_RWy8ELOPqoBP9PmExR9f04Wq7ys&e= "
>  xmlns:sqf="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.schematron-2Dquickfix.com_validator_process&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=ebMl78-mxuWg5rd1rQ8uImBFtFgq6P4-ALGHccZ6Vi4&e= "
>  queryBinding="xslt2">
>    <ns prefix="tei" uri="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.tei-2Dc.org_ns_1.0&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=RYdhsNWzVA9Dn-r_RWy8ELOPqoBP9PmExR9f04Wq7ys&e= "/>
>      <xsl:variable name="person.index" select="doc('person-index.xml')//tei:person"/>
>    <pattern>
>    <rule context="tei:name">
>      <report role="warning" test="not(@ref)" sqf:fix="add.ref">
>        A name should have a @ref attribute pointing to a person definition.
>      </report>
>      <let name="person.id" value="$person.index[matches(tei:persName, normalize-space(current()))]/@xml:id"/>
>      <sqf:fix id="add.ref">
>        <sqf:description>
>          <sqf:title>
>            Add a @ref pointing to a person definition.
>          </sqf:title>
>        </sqf:description>
>        <sqf:add match="." node-type="attribute" target="ref" select="concat('#', $person.id)"/>
>      </sqf:fix>
>    </rule>
>  </pattern>
>
> </schema>
>
> The $person.index variable loads all person definitions from an index file; the Schematron rule matching <tei:name> elements will try to look up a person definition in $person.index matching the current name. Next, the SQF will propose to add a @ref attribute to the <tei:name> pointing to the the @xml:id value of the matching <tei:person> element in $person.index.
>
> Though this example is very rudimentary, you could add some degree of 'dynamism' to offer multiple suggestions, should multiple possible person definitions be found (see the discussion at https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_schematron-2Dquickfix_sqf_issues_3&d=AwICaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=zUqVKkCNo0cB6Y6v0xLjLNBpxuuVRxlSwBBuOT7HCkM&m=D9oBFiMAs7zAFZALSNgRCjTE-Ntbp4aJ5LithE4Cseg&s=b2gLvXQcmf4mVrQokH5w_MY_ueHcYGuxpi8vsOXHIYo&e= ).
>
> While I think this is slightly more flexible than Martin's approach in that the ODD file doesn't have to be regenerated over again, the definition of $person.index in my example still requires a precompiled index file containing all unique names found in a TEI document or collection. While it is theoretically possible to do a live search over a collection (by swapping the doc() function with a collection() call over the entire collection), this would probably hardly be workable since each new Schematron validation run (basically after each keystroke in an XML document being validated against this Schematron in Oxygen) will have to scan the collection again for each name in that document. But perhaps Oxygen allows for database integration with e.g. an eXist-db instance that could boost performance of the $person.index lookup; I don't know if that's possible (if it is possible, I'd be interested to learn more).
>
> Best,
>
> Ron

Joe Easterly
Digital Humanities Librarian
River Campus Libraries, University of Rochester

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

ron.vandenbranden
Administrator
In reply to this post by Radu Coravu
Hi Radu,

This is even more interesting, a dedicated mechanism for customized
content completion.

On 25/06/2015 7:20, Radu Coravu wrote:
> One more thing Oxygen 17.0 added was support to have a special XML
> configuration file which can add content completion values for
> elements or attributes (even by applying an XSLT stylesheet):
>
>> http://www.oxygenxml.com/doc/versions/17.0/ug-editor//#topics/configuring-content-completion-proposals.html 
>>
>

Is there an example available of a configuration file that looks up the
values in e.g. an eXist-db database (which is hinted at in the last
example in the documentation)?

Best,

Ron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

Radu Coravu
Hi Ron,

Please take a look at the second part of the presentation my colleague
Alex Jitianu had at XML Prague 2014 (somewhere starting with minute 10):

> http://oxygenxml.com/events/2014/oXygen-user-meetup-Prague.html#Controlled_values

At that time the content completion via XML configuration file was not
yet part of Oxygen but starting with Oxygen 17 it is. So some things
might slightly differ from the presentation.

Enjoy.
Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 6/29/2015 11:37 AM, [hidden email] wrote:

> Hi Radu,
>
> This is even more interesting, a dedicated mechanism for customized
> content completion.
>
> On 25/06/2015 7:20, Radu Coravu wrote:
>> One more thing Oxygen 17.0 added was support to have a special XML
>> configuration file which can add content completion values for
>> elements or attributes (even by applying an XSLT stylesheet):
>>
>>> http://www.oxygenxml.com/doc/versions/17.0/ug-editor//#topics/configuring-content-completion-proposals.html
>>>
>>
>
> Is there an example available of a configuration file that looks up the
> values in e.g. an eXist-db database (which is hinted at in the last
> example in the documentation)?
>
> Best,
>
> Ron
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oXygen Content Completion plugin for personography

Toma Tasovac-2
In reply to this post by ron.vandenbranden
Dear Ron,

the config file itself doesn’t care about how you look up your data. All the config file does is select what element or attribute you want to retrieve suggestions for, and what XSL file will do that job for. So, for instance, if you want to autocomplete the target attribute of <ref/>, you would do this:

 <!-- The contributed values are obtained by executing the given XSLT -->
    <match elementName="ref" elementNS="http://www.tei-c.org/ns/1.0" attributeName="target">
        <xslt href="cc_ref_targets2.xsl" useCache="false" action="replace"/>
    </match>

The documentation for the XSL file shows what kind of output oXygen needs from your XSL. The only difference, I think, between looking things up in eXist and the file system is that instead of getting the values from doc(/path/to/your/file.xml), you will do something like doc("http://localhost:8080/exist/servlet/db/file.xml”) or wherever you saved your file in eXist.

All best,
Toma

-- 
Toma Tasovac | @ttasovac 
Belgrade Center for Digital Humanities
http://humanistika.org


On Mon, Jun 29, 2015 at 10:38 AM, [hidden email] <[hidden email]> wrote:

Hi Radu,

This is even more interesting, a dedicated mechanism for customized
content completion.

On 25/06/2015 7:20, Radu Coravu wrote:
> One more thing Oxygen 17.0 added was support to have a special XML
> configuration file which can add content completion values for
> elements or attributes (even by applying an XSLT stylesheet):
>
>> http://www.oxygenxml.com/doc/versions/17.0/ug-editor//#topics/configuring-content-completion-proposals.html
>>
>

Is there an example available of a configuration file that looks up the
values in e.g. an eXist-db database (which is hinted at in the last
example in the documentation)?

Best,

Ron


Loading...