Hi Svante,
Thank you so much for looking into this.
I definitely like that approach as it simplifies programmatic access the
document without digging into the low level xml details - much like the
current table methods. It also provides a easier path to migrate from
the SimpleAPI and if the code can be migrated from the old SimpleAPI
then I hope it's easy enough to do that it can make it to the next BETA.
I don't think I'm skilled enough to do the migration but I can certainly
help out with testing.
Andrew
On 2023-05-22 11:52, Svante Schubert wrote:
Hello Andrew,
I am sorry, I was travelling the past week but now took a quick look into
the last Simple API by checking out 0.9.0
*git checkout v0.9.0*
I have found the Simple API functionality here:
https://github.com/tdf/odftoolkit/tree/0.9/simple/src/main/java/org/odftoolkit/simple/common/field
I took one field, like
https://github.com/tdf/odftoolkit/blob/0.9/simple/src/main/java/org/odftoolkit/simple/common/field/TimeField.java
searched for the ODF XML in the ODFDOM and grepped for further dependencies
Found the ODF XML
https://tdf.github.io/odftoolkit/odf1.3/OpenDocument-v1.3-reference.html#element_text:time_1
In ODFDOM I have found three places where former colleagues from
Open-XChange added some Field functionality:
I wonder how it fits in there and how to bring it together:
1.
https://github.com/tdf/odftoolkit/blob/master/odfdom/src/main/java/org/odftoolkit/odfdom/changes/FieldMap.java
2.
https://github.com/tdf/odftoolkit/blob/master/odfdom/src/main/java/org/odftoolkit/odfdom/changes/TextFieldSelection.java
The selection is something similar to a span.
3.
https://github.com/tdf/odftoolkit/blob/master/odfdom/src/main/java/org/odftoolkit/odfdom/changes/JsonOperationConsumer.java
The JSON Consumer is the reader of JSON changes
I do not think we have this functionality in ODFDOM and it makes sense
to copy functionality from Simple API to ODFDOM.
So most of it works on its own and we might copy the whole package to the
ODF Toolkit - perhaps adding a field package beyond
https://github.com/tdf/odftoolkit/tree/master/odfdom/src/main/java/org/odftoolkit/odfdom/doc
Looking at the imports of
https://github.com/tdf/odftoolkit/blob/0.9/simple/src/main/java/org/odftoolkit/simple/common/field/TimeField.java
there are close to no dependencies to Simple API.
But there is
https://github.com/tdf/odftoolkit/blob/0.9/simple/src/main/java/org/odftoolkit/simple/common/field/TimeField.java#L36
import org.odftoolkit.simple.Component;
This is likely the mapping between XML syntax and semantic puzzle pieces -
if so how do we basically want to solve this in the ODFDOM - we had
resolved earlier for table in our ODFDOM
https://github.com/tdf/odftoolkit/pull/197/files
If we need a mapping from XML objects to high level semantic objects we
might as well place such a map at the each document (but I am open and
curious for any pro/con here).
Discussed this already briefly with Michael (on CC).
Does this answer your question, Andrew?
Otherwise, let's enhance the answer in this thread.
Best regards,
Svante
Am Di., 16. Mai 2023 um 20:12 Uhr schrieb Andrew Willerding <
awillerding@callistacti.com>:
Hi,
I'm trying to migrate off of the deprecated SimpleAPI and I've been able
to convert most of my code over however I can't find a way to manipulate
Fields and Variable Fields like the examples below
https://odftoolkit.org/simple/demo/demo7.html
or
https://tdf.github.io/odftoolkit/simple/document/cookbook/Fields.html
Mr. Google is not revealing anything that is not based on the SimpleAPI.
Does anyone have any code examples or can point me in the direction I
can get and set Fields? It's probably obvious which is why I'm missing
it. ;-)
Thanks!
Andrew
--
To unsubscribe e-mail to: dev+unsubscribe@odftoolkit.org
Problems?
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.odftoolkit.org/dev/
Privacy Policy: https://www.documentfoundation.org/privacy
--
Andrew Willerding
Callista CTI
ph: 416 444-9702 x9455
fx: 416 444-9732
cell: 416 712-2323
www: http://www.callistacti.com
--
To unsubscribe e-mail to: dev+unsubscribe@odftoolkit.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.odftoolkit.org/dev/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.