oxy_textArea

Oxygen general issues.
emmam
Posts: 16
Joined: Sat Jul 28, 2012 11:41 am

oxy_textArea

Post by emmam »

Hi all,

I'm trying to set up some form controls for the entering of metadata info in a teiHeader.
I assumed that the oxy_texArea option, combined with a 'text/xml' property, would give me a text area field where I could enter xml mixed content.

Or if the text area in the form controls of the author mode does display a the '<' and '>' of the tags, in the text mode they appear as entities (

the css :

p:before{
content:
oxy_label(text, "paragraph :", styles, "font-weight:bold;width:20%;color:navy;font-size:.85em;text-align:right")
oxy_textArea(edit, '#text', contentType, 'text/xml', rows, 10, columns, 60);
}

in author mode : bla bla bla <rs type="test">bla</rs>
result in text mode : <p>bla bla bla <rs type="test">test</rs> (...)</p>

Where am I wrong ?
What to do to get what I want, that is to edit via form controls in the author mode the xml mixed content (text and other elements) of a given element ?

thanks in advance for your help

best,

emma
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: oxy_textArea

Post by alex_jitianu »

Hello,

All the built in form controls are designed to edit either an attribute value or the text content of an element. That's why the content you are entering in the text area is escaped before is inserted in the document. It's treated as plain text.

If you want, you can create a custom form control that will edit an actual XML fragment. You will have to use the Java based API we provide. The existing text area form control can be a good starting point for such a form control (you will just have to change how the edited value is obtained and how it's commited) so if you want I can send you the source code for it.

Could you give us more details about why would you prefer editing the teiHeader inside such a text area form control instead of using the author mode? Would you like to have content completion support in it too?

Best regards,
Alex
emmam
Posts: 16
Joined: Sat Jul 28, 2012 11:41 am

Re: oxy_textArea

Post by emmam »

hi alex
thanks a lot for the answer. Yes I'd be very pleased if you sent me that code.

This way of using a form control to edit the content of a metadata field may seem redondant with the author mode, I agree. But in my opinion, the edition of short description fields with mixed content (for example <support> in the <supportDesc/> of a teiHeader is more explicit in the text mode with where you see tags in the xml syntax than in author mode with the tags showed with the yellow triangles and polygons...
To be more precise, my use case is this one : the information is partially stored in a filemaker database. I am exporting it in a pre-filled TEI file. So for a <support/> field, the user would have that way a few sentences in a <p/>, in which he is supposed to tag words or expressions corresponding to infos like <objectType/>, <material/>, with the relevant attributes.
The form control permits to show just these tags, the eyes of the user can easily focus and find very quiclky what's to be done. When the are parse, the xml tags are the clearest and concise way of expressing things...

But that's just a work hypothese for now. It would be interesting to test the use of the default author mode on that field and see what the users prefer. So if you send me the code you mentioned, maybe I could do that !

thanks a lot in advance

best
emmanuelle
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: oxy_textArea

Post by alex_jitianu »

Hi,

I'll send you the code on your email address.

If you find the tags from the text mode more helpful than the markers from the author page then you can create a similar layout in author mode by adding these CSS rules:

Code: Select all


teiHeader *:before {
content: "<" oxy_local-name() ">";
color: blue;
}

teiHeader *:after {
content: "</" oxy_local-name() ">";
color: blue;
}
Using more specific CSS selectors you can further restrict which elements are presented this way.

Best regards,
Alex
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: oxy_textArea

Post by alex_jitianu »

Hello,

Starting with Oxygen version 17.1 the text area form control can edit the XML content of an element. For example, if you have the following XML content:

Code: Select all

<codeblock>START_TEXT<ph>phase</ph><apiname><text>API</text></apiname></codeblock>
and your CSS includes the following snippet:

Code: Select all

codeblock:before{
content:
oxy_textArea(
edit, '#content',
contentType, 'text/xml');
}
then the text area form control will edit the following fragment:

Code: Select all

START_TEXT<ph>phase</ph><apiname><text>API</text></apiname>
Best regards,
Alex
Post Reply