joniles / rtfparserkit

Primary repository for RTF Parser Kit library
Apache License 2.0
104 stars 42 forks source link

RTF document model #5

Open stippi opened 9 years ago

stippi commented 9 years ago

Hi Jon,

thanks for making this nice piece of code. I am trying to use it in my project, but the StandardRtfParser is still too low level for my purposes. I am pondering whether to contribute to your project and start on an RTF document model, especially, since it would allow to create an RTF writer as well. I have some ideas how to approach this, but I would love to discuss with you first and find out what you had in mind. Do you think the issue tracker is the ideal place for discussion? If so we could use this issue, otherwise we could switch to other means of communication. For example, I think chatting in IRC could be beneficial, then noting the result back here. My nick on Freenode is stippi.

stippi commented 9 years ago

Hi again,

I have begun implementing. My thoughts were that it is best to design a builder pattern. The core builder implementation would only work with interfaces, and there would be a default implementation which constructs a document model. As such, it would be possible to connect a completely different document model directly to the builder, parsing an RTF straight into an unknown document model. This would be achieved by writing thin wrappers implementing the interfaces defined by RTF Parser Kit in terms of the foreign document model. At the same time, the default RTF Parser Kit document model implementation could be used to transfer a foreign model and then write an RTF. But maybe there is an even better way, I have not yet started on that part. For now, I have text landing in the right destinations and will start looking into styling next.

Regards, -Stephan

joniles commented 9 years ago

Sounds good! Sorry I'm slow at replying... and thanks for the pull request, I'll get that merged as soon as I can. I really appreciate you taking the time to help out!

Jon

stippi commented 9 years ago

At the moment, I have imported the RTF Parser Kit code into my large application and am developing the changes there. That's mainly because I wanted to see first how well it all worked out, before separating the code and changing the build system to deal with one more dependency (also, I still target Java 5). But when you have some time to review my code, just tell me and I'll transfer the changes into the repository which I forked on GitHub.

Regards, -Stephan

stippi commented 9 years ago

Hi,

just to let you know I am making progress... rewrote my additions today and it's beginning to take shape.

Just curious: Will you have any time to implement the writing RTFs part?

Best regards, -Stephan

stippi commented 9 years ago

You can see my current work here:

https://github.com/stippi/rtfparserkit/tree/document-builder

... though I realized after publishing that I forgot to fix the license headers to also use the APL. Sorry about that, will do at the next syncing point.

stippi commented 9 years ago

Hi Jon, would be great to get your feedback on my work. It is all fresh in my mind if you have questions or would like to discuss. But I don't have much time to keep working on this, as I need to shift my priorities to other stuff. Best regards, -Stephan

stippi commented 9 years ago

Hey Jon, really no feedback at all in all this time? :-(