CALS Table CSS Question

Oxygen general issues.
mktollar
Posts: 3
Joined: Wed May 07, 2014 7:17 pm

CALS Table CSS Question

Post by mktollar »

Need assistance with a issue in Author display for CALS table. In the sample code below there are two ROWs. The second row has an <EFFECT> prior to the first <ENTRY>. In Author when ROW > EFFECT encountered I need a blank row between the two rows where a text string can be displayed. The table formatting should be removed for that row and then resumed when ROW > ENTRY started. Can this be done with just Author CSS.

Code: Select all


<ROW> 
<ENTRY><PARA>Cell 1</PARA> </ENTRY>
<ENTRY><PARA>Cell 2</PARA> </ENTRY>
<ENTRY><PARA>Cell 3</PARA> </ENTRY>
</ROW>
<ROW>
<EFFECT EFFRG="001999"/>
<ENTRY><PARA>Cell 1a</PARA> </ENTRY>
<ENTRY><PARA>Cell 2a</PARA> </ENTRY>
<ENTRY><PARA>Cell 3a</PARA> </ENTRY>
</ROW>
Display should look something like this in Author mode:

Code: Select all


    |Cell 1|Cell 2|Cell 3|
EFFECT: 001999
|Cell 1a|Cell 2a|Cell 3a|
alex_jitianu
Posts: 1017
Joined: Wed Nov 16, 2005 11:11 am

Re: CALS Table CSS Question

Post by alex_jitianu »

Hello,

It can't be done by CSS alone. There are some workarounds but they all require more or less working with our Java based API:

1. The base idea of this approach is to transform the initial table structure into a different one when opening the document. Either breaking it into two tables or inserting another row with the EFFECT element that spans over all columns. The user works on this structure and when the document is saved, you transform the table back to its original structure.
To do that you can use a custom protocol to open the document you can change the content loaded by the author page and on save, you can change it back. The most complex part here is that you have to read the XML file yourself in this protocol implementation and transform the table into something else (our API wont help you with that). For example you could parse it using DOM, change the DOM and serialize it into a temporary file.Then return a stream from that temporary file to be loaded into Oxygen. On save, you'll have to do the round trip. A sample custom protocol implementation that can be a good starting point can be download from here.

2. In Oxygen you can use form controls to edit attributes or the text content of an element (the element you are adding the form control on). Your situation is little different though as you don't want the EFFECT element to be present in the table layout (at least not as a cell). So the first step is to hide it using CSS:

Code: Select all

EFFECT {
display:none;
}
,implement a custom form control and add it on the first ENTRY. This custom form control will edit this hidden EFFECT. You can start from the source code of one of our built-in form controls (I can send you the source code) and you just have to change from where the value is taken and where it's committed. Then you'll add the form control from the CSS something like this:

Code: Select all


EFFECT + ENTRY:before{
content: oxy_editor(
rendererClassName, "com.custom.editors.CustomRenderer",
swingEditorClassName, "com.custom.editors.SwingCustomEditor"
)
}

This second solution will not look exactly like you want but it's a possibility worth mentioning.

Best regards,
Alex
mktollar
Posts: 3
Joined: Wed May 07, 2014 7:17 pm

Re: CALS Table CSS Question

Post by mktollar »

Would you be so kind to send the source for the second option. Thanks for your response.
Post Reply