Hello Ashok,I would like to ask you if tables
and lists are supported via xml configuration to be generated in xml AkomaNtoso file format?
--
You received this message because you are subscribed to the Google Groups "bungeni-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bungeni-edito...@googlegroups.com.
To post to this group, send email to bungeni...@googlegroups.com.
Visit this group at http://groups.google.com/group/bungeni-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
XTextTable xTextTable = (XTextTable)((XMultiServiceFactory)TextDocument).createInstance("com.sun.star.text.TextTable");
xTextTable.initialize(4, 2);Hi Samar --
Let me document the steps of how to implement table -
Just some points to understand the concept :
1) sectionTypes in the editor are containers (think of them like <div> elements in html ) . They are place holders to embed metadata and content.
2) Tables are pure content - so you would put a table *inside* a sectionType (the sectionType is NOT a table).
3) In openoffice there is native support for tables, so we dont need to invent our own table - we just use the Openoffice table.
The implementation would be in 2 parts - you need to implement the table markup and then you need to implement the translation of the table markup into Akoma Ntoso (in the middleware)
Implementing tables markup :
4) The editor uses an action-> router architecture to take user input and translate that into markup on the document.
a ) you need to implement a router action to create a table. Just like the way we have a router action to create a section "routerCreateSection", you will need to create a router Action to create a table "routerCreateTable". This action will call the openoffice UNO api and generate a table on the current document.
routerCreateSection has the method "route_TextSelectedInsert" which I don't know how to edit to obtain the code specified for tables !!
b) However, creating a table requires some human input (e.g. how many rows and columns does the table have ? ) - so the action will have to implement a dialog accept the rows and columns information from the user and then use that information to inject a table where the cursor is. e.g. the UNO api for creating a table looks something like this :
XTextTable xTextTable = (XTextTable)((XMultiServiceFactory)TextDocument).createInstance("com.sun.star.text.TextTable");
xTextTable.initialize(4, 2);
to create a table of 4 rows and 2 columns
Yes, this is done when the user creates a new table .. but what if the table is already there through out the act text ?
c) Connect the router to a user action via the toolbar actions infrastructure ... specify the rules as to which kinds of section types support tables and you will have the markup support completed
I think this is clear ..
Implementing tables akomantoso rendering :
5) This is very straightforward - you just need implement a template matcher for text:table (the openoffice table) and render it as Akoma Ntoso table in the XSLT , i think the right place to do it is perhaps in : system_configs/generator/type_meta_ident_publi_generator.xsl
Have I need to implement td, tr, inside table tages ??
On Thursday, March 14, 2013 10:26:43 AM UTC+2, Ashok Hariharan wrote:b) However, creating a table requires some human input (e.g. how many rows and columns does the table have ? ) - so the action will have to implement a dialog accept the rows and columns information from the user and then use that information to inject a table where the cursor is. e.g. the UNO api for creating a table looks something like this :
XTextTable xTextTable = (XTextTable)((XMultiServiceFactory)TextDocument).createInstance("com.sun.star.text.TextTable");
xTextTable.initialize(4, 2);
to create a table of 4 rows and 2 columns
Yes, this is done when the user creates a new table .. but what if the table is already there through out the act text ?and we just want to select and mark it as table ? Does the user need to count all rows and columns there?
Implementing tables akomantoso rendering :Have I need to implement td, tr, inside table tages ??
5) This is very straightforward - you just need implement a template matcher for text:table (the openoffice table) and render it as Akoma Ntoso table in the XSLT , i think the right place to do it is perhaps in : system_configs/generator/type_meta_ident_publi_generator.xsl
<table:table xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0">
<table:table-columns>
<table:table-column/>
<table:table-column/>
</table:table-columns>
<table:table-rows>
<table:table-row>
<table:table-cell>
<text:p>row one, column one</text:p>
</table:table-cell>
<table:table-cell>
<text:p>row one, column two</text:p>
</table:table-cell>
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>row two, column one</text:p>
</table:table-cell>
<table:table-cell>
<text:p>row two, column two</text:p>
</table:table-cell>
</table:table-row>
</table:table-rows>
</table:table> --
I added the xslt mapping as required .. and this the resulting odt file .. still table are not shown on AN xml file!