how to customize the Insert table row ?

ashok
Posts: 4
Joined: Thu Jul 08, 2021 2:19 pm

how to customize the Insert table row ?

Post by ashok » Fri Jul 16, 2021 3:17 pm

hi,
we need to add a table row in the existing Table with existing class attributes in the Oxygen XML web author .
Existing table row :

Code: Select all

 <row class="- topic/row ">
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">    Pear Tree Quality Fund </p>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">USBOX </p>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">QGIAX </p>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">QGIRX </p>
                  </entry>
               </row>
we would like to add a new row after the row using "Insert Row Below" option. But it creating row without class attributes like below

Code: Select all

 <row class="- topic/row ">
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">    Pear Tree Quality Fund </p>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">USBOX </p>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">QGIAX </p>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p ">QGIRX </p>
                  </entry>
               </row>
               <row>
                  <entry/>
                  <entry/>
                  <entry/>
                  <entry/>
               </row>
how to customize the Insert table row option in web author to add a row like the following with attributes ?

Code: Select all

<row class="- topic/row ">
                  <entry class="- topic/entry ">
                     <p class="- topic/p "/>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p "/>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p "/>
                  </entry>
                  <entry class="- topic/entry ">
                     <p class="- topic/p "/>
                  </entry>
               </row>
row.JPG
row.JPG (83.25 KiB) Viewed 254 times
regards,
Ashok

mihaela
Posts: 267
Joined: Wed May 20, 2009 2:40 pm

Re: how to customize the Insert table row ?

Post by mihaela » Mon Jul 19, 2021 1:40 pm

Hello,

By default no DITA action inserts the class attribute. So, I think that "Insert table row" action may not be the only action that you want to update to set the class attributes, right?

We need some details to better understand your use case, in order to provide a solution. Is the class attribute added by your CMS? If you use the "Insert table row" action, then save the document and open it again, the inserted row contains the class attributes? If you insert an element from the content completion (a paragraph for example) the class attribute is set on the new element right after insert?

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com

ashok
Posts: 4
Joined: Thu Jul 08, 2021 2:19 pm

Re: how to customize the Insert table row ?

Post by ashok » Wed Jul 21, 2021 1:29 pm

mihaela wrote:
Mon Jul 19, 2021 1:40 pm
Hello,

By default no DITA action inserts the class attribute. So, I think that "Insert table row" action may not be the only action that you want to update to set the class attributes, right?

We need some details to better understand you use case, in order to provide a solution. Is the class attribute added by your CMS? If you use the "Insert table row" action, then save the document and open it again, the inserted row contains the class attributes? If you insert an element from the content completion (a paragraph for example) the class attribute is set on the new element right after insert?

Best Regards,
Mihaela

Hi,
Yes right by default no DITA action inserts the class attribute .

Existing class attributes added while do the split paragraph action. its adding the existing class attributes in the newly split paragraph tags in the oxygen.
Example :

Code: Select all

 <p class="- topic/p ">Beginning January 1, 2021, as permitted by regulations adopted by the
         Securities and Exchange Commission </p>
  <p class="- topic/p ">Pear Tree Funds your financial intermediary,  access the
         report.</p>
Requirement:
we required class attributes while inserting table row , paragraph , ordered list ...
If the existing table row contains class attribute like the following(class="- topic/row ") then it should be added in the newly inserted table row. oxygen is not adding the attributes .
<row class="- topic/row ">
<entry class="- topic/entry ">
<p class="- topic/p ">    <b class="- hi-d/b ">Pear</b></p>
</entry>
</row>
Please let me know how to make this happen through customization.

regards,
Ashok

mihaela
Posts: 267
Joined: Wed May 20, 2009 2:40 pm

Re: how to customize the Insert table row ?

Post by mihaela » Wed Jul 21, 2021 3:03 pm

Hi,

There is an API called ro.sync.ecss.extensions.api.AuthorDocumentFilter [1] that allows you to modify the content that is inserted in your document. For example, you can use the insertNode or insertFragment actions to insert class attributes for all the elements that will be inserted in the document (regardless of the action used to add the node or the fragment).
Please let us know if you need more information about this.

If this API is not suitable for what you want to obtain, please answer the following questions (to search for a better solution):
- why do you need class attributes to be explicitly specified?
- after you insert the new row, save the document and reopen it, the new row has the class attribute set?
- the "Insert Row" action is the only action that you want to customize? Other actions like "Insert Column", "Insert Table" or "Insert Image" result in elements with class attributes set or do you need to also customize these actions?

[1] https://www.oxygenxml.com/InstData/Edit ... ilter.html


Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com

Post Reply