You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (Created) (JIRA)" <ji...@apache.org> on 2012/02/05 18:03:00 UTC
[jira] [Created] (ISIS-172) Domain Service (in domain-libs) to
allow domain object entities to build .docx (OpenXML) documents against a
template .docx, merging in an XML (or perhaps JSON) input format.
Domain Service (in domain-libs) to allow domain object entities to build .docx (OpenXML) documents against a template .docx, merging in an XML (or perhaps JSON) input format.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: ISIS-172
URL: https://issues.apache.org/jira/browse/ISIS-172
Project: Isis
Issue Type: New Feature
Components: Domain: Services
Reporter: Dan Haywood
Priority: Minor
Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
The signature of the interface would be something like:
[Hidden]
public interface OpenXmlDocumentBuilder {
byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
}
eg where the XML format is something like:
<input>
<LetterDate type="date">2012-01-30</LetterDate>
<CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
<Blurb>As requested, here are the recent payments made from your account</Blurb>
<Payments type="rich-table">
<row>
<Date>2012-01-20</Date>
<Merchant>Walmart</Merchant>
<Amount>123.45</Date>
</row>
<row>
<Date>2012-01-21</Date>
<Merchant>Esso</Merchant>
<Amount>45.23</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Starbucks</Merchant>
<Amount>12.01</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Amazon</Merchant>
<Amount>89.99</Date>
</row>
</Payments>
</input>
so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ISIS-172) Domain Service (in domain-libs) to
allow domain object entities to build .docx (OpenXML) documents against a
template .docx, merging in an XML (or perhaps JSON) input format.
Posted by "Dan Haywood (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ISIS-172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439576#comment-13439576 ]
Dan Haywood commented on ISIS-172:
----------------------------------
This JIRA talks about using OpenXML, but I don't know if there's a suitable API in Java to do this. The poi.apache.org project has some OpenXML support, but it looks pretty sketchy to me.
Another option might be to use OpenDocument format, ie Apache Open Office. There's lots of material online. It seems likely that there is an appropriate mail merge capability.
http://www.openoffice.org/download/sdk/
http://wiki.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide
http://codesnippets.services.openoffice.org/Writer/Writer.MailMerge.snip
> Domain Service (in domain-libs) to allow domain object entities to build .docx (OpenXML) documents against a template .docx, merging in an XML (or perhaps JSON) input format.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISIS-172
> URL: https://issues.apache.org/jira/browse/ISIS-172
> Project: Isis
> Issue Type: New Feature
> Components: Domain: Services
> Reporter: Dan Haywood
> Assignee: Mike Burton
> Priority: Minor
> Labels: newbie
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
> The signature of the interface would be something like:
> [Hidden]
> public interface OpenXmlDocumentBuilder {
> byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
> }
> eg where the XML format is something like:
> <input>
> <LetterDate type="date">2012-01-30</LetterDate>
> <CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
> <Blurb>As requested, here are the recent payments made from your account</Blurb>
> <Payments type="rich-table">
> <row>
> <Date>2012-01-20</Date>
> <Merchant>Walmart</Merchant>
> <Amount>123.45</Date>
> </row>
> <row>
> <Date>2012-01-21</Date>
> <Merchant>Esso</Merchant>
> <Amount>45.23</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Starbucks</Merchant>
> <Amount>12.01</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Amazon</Merchant>
> <Amount>89.99</Date>
> </row>
> </Payments>
> </input>
> so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (ISIS-172) Domain Service (in domain-libs) to
allow domain object entities to build .docx (OpenXML) documents against a
template .docx, merging in an XML (or perhaps JSON) input format.
Posted by "Dan Haywood (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ISIS-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood updated ISIS-172:
-----------------------------
Description:
Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
The signature of the interface would be something like:
[Hidden]
public interface OpenXmlDocumentBuilder {
byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
}
eg where the XML format is something like:
<input>
<LetterDate type="date">2012-01-30</LetterDate>
<CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
<Blurb>As requested, here are the recent payments made from your account</Blurb>
<Payments type="rich-table">
<row>
<Date>2012-01-20</Date>
<Merchant>Walmart</Merchant>
<Amount>123.45</Date>
</row>
<row>
<Date>2012-01-21</Date>
<Merchant>Esso</Merchant>
<Amount>45.23</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Starbucks</Merchant>
<Amount>12.01</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Amazon</Merchant>
<Amount>89.99</Date>
</row>
</Payments>
</input>
so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
~~~~~~~~~~~~~
The sequence diagram below shows how this service could be used by a CommunicationTemplate and Communication domain object:
http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
~~~~~~~~~~~~
generated at http://www.websequencediagrams.com/ using the following script:
title create Communication
Customer->+CommunicationTemplateRepository: lookup(templateCode)
CommunicationTemplateRepository-->-Customer:
Customer->Customer: build xml
Customer->+CommunicationTemplate: create(xml)
CommunicationTemplate->+DocumentBuilderService: mailMerge(this.odfTemplate, xml)
DocumentBuilderService-->-CommunicationTemplate: mergedOdf
CommunicationTemplate->Communication: instantiate(mergedOdf)
CommunicationTemplate-->-Customer:
was:
Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
The signature of the interface would be something like:
[Hidden]
public interface OpenXmlDocumentBuilder {
byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
}
eg where the XML format is something like:
<input>
<LetterDate type="date">2012-01-30</LetterDate>
<CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
<Blurb>As requested, here are the recent payments made from your account</Blurb>
<Payments type="rich-table">
<row>
<Date>2012-01-20</Date>
<Merchant>Walmart</Merchant>
<Amount>123.45</Date>
</row>
<row>
<Date>2012-01-21</Date>
<Merchant>Esso</Merchant>
<Amount>45.23</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Starbucks</Merchant>
<Amount>12.01</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Amazon</Merchant>
<Amount>89.99</Date>
</row>
</Payments>
</input>
so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
This sequence shows how this service could be used by a CommunicationTemplate and Communication domain object:
http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
> Domain Service (in domain-libs) to allow domain object entities to build .docx (OpenXML) documents against a template .docx, merging in an XML (or perhaps JSON) input format.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISIS-172
> URL: https://issues.apache.org/jira/browse/ISIS-172
> Project: Isis
> Issue Type: New Feature
> Components: Domain: Services
> Reporter: Dan Haywood
> Assignee: Mike Burton
> Priority: Minor
> Labels: newbie
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
> The signature of the interface would be something like:
> [Hidden]
> public interface OpenXmlDocumentBuilder {
> byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
> }
> eg where the XML format is something like:
> <input>
> <LetterDate type="date">2012-01-30</LetterDate>
> <CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
> <Blurb>As requested, here are the recent payments made from your account</Blurb>
> <Payments type="rich-table">
> <row>
> <Date>2012-01-20</Date>
> <Merchant>Walmart</Merchant>
> <Amount>123.45</Date>
> </row>
> <row>
> <Date>2012-01-21</Date>
> <Merchant>Esso</Merchant>
> <Amount>45.23</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Starbucks</Merchant>
> <Amount>12.01</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Amazon</Merchant>
> <Amount>89.99</Date>
> </row>
> </Payments>
> </input>
> so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
> ~~~~~~~~~~~~~
> The sequence diagram below shows how this service could be used by a CommunicationTemplate and Communication domain object:
> http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
> ~~~~~~~~~~~~
> generated at http://www.websequencediagrams.com/ using the following script:
> title create Communication
> Customer->+CommunicationTemplateRepository: lookup(templateCode)
> CommunicationTemplateRepository-->-Customer:
> Customer->Customer: build xml
> Customer->+CommunicationTemplate: create(xml)
> CommunicationTemplate->+DocumentBuilderService: mailMerge(this.odfTemplate, xml)
> DocumentBuilderService-->-CommunicationTemplate: mergedOdf
> CommunicationTemplate->Communication: instantiate(mergedOdf)
> CommunicationTemplate-->-Customer:
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (ISIS-172) Domain Service (in domain-libs) to
allow domain object entities to build .docx (OpenXML) documents against a
template .docx, merging in an XML (or perhaps JSON) input format.
Posted by "Dan Haywood (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ISIS-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood reassigned ISIS-172:
--------------------------------
Assignee: Mike Burton
> Domain Service (in domain-libs) to allow domain object entities to build .docx (OpenXML) documents against a template .docx, merging in an XML (or perhaps JSON) input format.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISIS-172
> URL: https://issues.apache.org/jira/browse/ISIS-172
> Project: Isis
> Issue Type: New Feature
> Components: Domain: Services
> Reporter: Dan Haywood
> Assignee: Mike Burton
> Priority: Minor
> Labels: newbie
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
> The signature of the interface would be something like:
> [Hidden]
> public interface OpenXmlDocumentBuilder {
> byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
> }
> eg where the XML format is something like:
> <input>
> <LetterDate type="date">2012-01-30</LetterDate>
> <CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
> <Blurb>As requested, here are the recent payments made from your account</Blurb>
> <Payments type="rich-table">
> <row>
> <Date>2012-01-20</Date>
> <Merchant>Walmart</Merchant>
> <Amount>123.45</Date>
> </row>
> <row>
> <Date>2012-01-21</Date>
> <Merchant>Esso</Merchant>
> <Amount>45.23</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Starbucks</Merchant>
> <Amount>12.01</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Amazon</Merchant>
> <Amount>89.99</Date>
> </row>
> </Payments>
> </input>
> so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (ISIS-172) Domain Service (in domain-libs) to
allow domain object entities to build .docx (OpenXML) documents against a
template .docx, merging in an XML (or perhaps JSON) input format.
Posted by "Dan Haywood (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ISIS-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood updated ISIS-172:
-----------------------------
Description:
Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
The signature of the interface would be something like:
[Hidden]
public interface OpenXmlDocumentBuilder {
byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
}
eg where the XML format is something like:
<input>
<LetterDate type="date">2012-01-30</LetterDate>
<CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
<Blurb>As requested, here are the recent payments made from your account</Blurb>
<Payments type="rich-table">
<row>
<Date>2012-01-20</Date>
<Merchant>Walmart</Merchant>
<Amount>123.45</Date>
</row>
<row>
<Date>2012-01-21</Date>
<Merchant>Esso</Merchant>
<Amount>45.23</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Starbucks</Merchant>
<Amount>12.01</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Amazon</Merchant>
<Amount>89.99</Date>
</row>
</Payments>
</input>
so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
This sequence shows how this service could be used by a CommunicationTemplate and Communication domain object:
http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
was:
Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
The signature of the interface would be something like:
[Hidden]
public interface OpenXmlDocumentBuilder {
byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
}
eg where the XML format is something like:
<input>
<LetterDate type="date">2012-01-30</LetterDate>
<CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
<Blurb>As requested, here are the recent payments made from your account</Blurb>
<Payments type="rich-table">
<row>
<Date>2012-01-20</Date>
<Merchant>Walmart</Merchant>
<Amount>123.45</Date>
</row>
<row>
<Date>2012-01-21</Date>
<Merchant>Esso</Merchant>
<Amount>45.23</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Starbucks</Merchant>
<Amount>12.01</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Amazon</Merchant>
<Amount>89.99</Date>
</row>
</Payments>
</input>
so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
> Domain Service (in domain-libs) to allow domain object entities to build .docx (OpenXML) documents against a template .docx, merging in an XML (or perhaps JSON) input format.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISIS-172
> URL: https://issues.apache.org/jira/browse/ISIS-172
> Project: Isis
> Issue Type: New Feature
> Components: Domain: Services
> Reporter: Dan Haywood
> Assignee: Mike Burton
> Priority: Minor
> Labels: newbie
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
> The signature of the interface would be something like:
> [Hidden]
> public interface OpenXmlDocumentBuilder {
> byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
> }
> eg where the XML format is something like:
> <input>
> <LetterDate type="date">2012-01-30</LetterDate>
> <CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
> <Blurb>As requested, here are the recent payments made from your account</Blurb>
> <Payments type="rich-table">
> <row>
> <Date>2012-01-20</Date>
> <Merchant>Walmart</Merchant>
> <Amount>123.45</Date>
> </row>
> <row>
> <Date>2012-01-21</Date>
> <Merchant>Esso</Merchant>
> <Amount>45.23</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Starbucks</Merchant>
> <Amount>12.01</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Amazon</Merchant>
> <Amount>89.99</Date>
> </row>
> </Payments>
> </input>
> so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
> This sequence shows how this service could be used by a CommunicationTemplate and Communication domain object:
> http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (ISIS-172) Domain Service (in domain-libs) to
allow domain object entities to build .docx (OpenXML) documents against a
template .docx, merging in an XML (or perhaps JSON) input format.
Posted by "Dan Haywood (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ISIS-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood updated ISIS-172:
-----------------------------
Description:
Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
The signature of the interface would be something like:
[Hidden]
public interface OpenXmlDocumentBuilder {
byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
}
eg where the XML format is something like:
<input>
<LetterDate type="date">2012-01-30</LetterDate>
<CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
<Blurb>As requested, here are the recent payments made from your account</Blurb>
<Payments type="rich-table">
<row>
<Date>2012-01-20</Date>
<Merchant>Walmart</Merchant>
<Amount>123.45</Date>
</row>
<row>
<Date>2012-01-21</Date>
<Merchant>Esso</Merchant>
<Amount>45.23</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Starbucks</Merchant>
<Amount>12.01</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Amazon</Merchant>
<Amount>89.99</Date>
</row>
</Payments>
</input>
so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
~~~~~~~~~~~~~
In terms of how a domain object would use this service, one design is to have a CommunicationTemplate domain object, which holds the .docx (or .odf) (eg as a base 64 encoded string). The CommunicationTemplate acts as a factory for Communication objects, requiring that the appropriate XML be provided to it. The template then calls the DocumentBuilderService and gets back a mail-merged version; this is stored in the resultant Communication (eg again base 64 encoded).
The sequence diagram below shows how this service could be used by a CommunicationTemplate and Communication domain object:
http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
~~~~~~~~~~~~
generated at http://www.websequencediagrams.com/ using the following script:
title create Communication
Customer->+CommunicationTemplateRepository: lookup(templateCode)
CommunicationTemplateRepository-->-Customer:
Customer->Customer: build xml
Customer->+CommunicationTemplate: create(xml)
CommunicationTemplate->+DocumentBuilderService: mailMerge(this.odfTemplate, xml)
DocumentBuilderService-->-CommunicationTemplate: mergedOdf
CommunicationTemplate->Communication: instantiate(mergedOdf)
CommunicationTemplate-->-Customer:
was:
Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
The signature of the interface would be something like:
[Hidden]
public interface OpenXmlDocumentBuilder {
byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
}
eg where the XML format is something like:
<input>
<LetterDate type="date">2012-01-30</LetterDate>
<CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
<Blurb>As requested, here are the recent payments made from your account</Blurb>
<Payments type="rich-table">
<row>
<Date>2012-01-20</Date>
<Merchant>Walmart</Merchant>
<Amount>123.45</Date>
</row>
<row>
<Date>2012-01-21</Date>
<Merchant>Esso</Merchant>
<Amount>45.23</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Starbucks</Merchant>
<Amount>12.01</Date>
</row>
<row>
<Date>2012-01-22</Date>
<Merchant>Amazon</Merchant>
<Amount>89.99</Date>
</row>
</Payments>
</input>
so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
~~~~~~~~~~~~~
The sequence diagram below shows how this service could be used by a CommunicationTemplate and Communication domain object:
http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
~~~~~~~~~~~~
generated at http://www.websequencediagrams.com/ using the following script:
title create Communication
Customer->+CommunicationTemplateRepository: lookup(templateCode)
CommunicationTemplateRepository-->-Customer:
Customer->Customer: build xml
Customer->+CommunicationTemplate: create(xml)
CommunicationTemplate->+DocumentBuilderService: mailMerge(this.odfTemplate, xml)
DocumentBuilderService-->-CommunicationTemplate: mergedOdf
CommunicationTemplate->Communication: instantiate(mergedOdf)
CommunicationTemplate-->-Customer:
> Domain Service (in domain-libs) to allow domain object entities to build .docx (OpenXML) documents against a template .docx, merging in an XML (or perhaps JSON) input format.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISIS-172
> URL: https://issues.apache.org/jira/browse/ISIS-172
> Project: Isis
> Issue Type: New Feature
> Components: Domain: Services
> Reporter: Dan Haywood
> Assignee: Mike Burton
> Priority: Minor
> Labels: newbie
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
> The signature of the interface would be something like:
> [Hidden]
> public interface OpenXmlDocumentBuilder {
> byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
> }
> eg where the XML format is something like:
> <input>
> <LetterDate type="date">2012-01-30</LetterDate>
> <CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
> <Blurb>As requested, here are the recent payments made from your account</Blurb>
> <Payments type="rich-table">
> <row>
> <Date>2012-01-20</Date>
> <Merchant>Walmart</Merchant>
> <Amount>123.45</Date>
> </row>
> <row>
> <Date>2012-01-21</Date>
> <Merchant>Esso</Merchant>
> <Amount>45.23</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Starbucks</Merchant>
> <Amount>12.01</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Amazon</Merchant>
> <Amount>89.99</Date>
> </row>
> </Payments>
> </input>
> so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
> ~~~~~~~~~~~~~
> In terms of how a domain object would use this service, one design is to have a CommunicationTemplate domain object, which holds the .docx (or .odf) (eg as a base 64 encoded string). The CommunicationTemplate acts as a factory for Communication objects, requiring that the appropriate XML be provided to it. The template then calls the DocumentBuilderService and gets back a mail-merged version; this is stored in the resultant Communication (eg again base 64 encoded).
> The sequence diagram below shows how this service could be used by a CommunicationTemplate and Communication domain object:
> http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
> ~~~~~~~~~~~~
> generated at http://www.websequencediagrams.com/ using the following script:
> title create Communication
> Customer->+CommunicationTemplateRepository: lookup(templateCode)
> CommunicationTemplateRepository-->-Customer:
> Customer->Customer: build xml
> Customer->+CommunicationTemplate: create(xml)
> CommunicationTemplate->+DocumentBuilderService: mailMerge(this.odfTemplate, xml)
> DocumentBuilderService-->-CommunicationTemplate: mergedOdf
> CommunicationTemplate->Communication: instantiate(mergedOdf)
> CommunicationTemplate-->-Customer:
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ISIS-172) Domain Service (in domain-libs) to
allow domain object entities to build .docx (OpenXML) documents against a
template .docx, merging in an XML (or perhaps JSON) input format.
Posted by "Dan Haywood (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ISIS-172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494152#comment-13494152 ]
Dan Haywood commented on ISIS-172:
----------------------------------
I found an API - docx4j - and have implemented up on github [https://github.com/danhaywood/docx-service]. I'll be donating this code back into Isis once we have our git repo up and running (INFRA-5502).
The input format is XHTML. See the readme on the github page for more info,
> Domain Service (in domain-libs) to allow domain object entities to build .docx (OpenXML) documents against a template .docx, merging in an XML (or perhaps JSON) input format.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISIS-172
> URL: https://issues.apache.org/jira/browse/ISIS-172
> Project: Isis
> Issue Type: New Feature
> Components: Domain: Services
> Reporter: Dan Haywood
> Assignee: Mike Burton
> Priority: Minor
> Labels: newbie
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Provide a standalone implementation of a document builder service that can be registered as a hidden service, and injected into domain objects so that they are able to send build OpenXml documents. The input could be an XML-based notation (or perhaps JSON) along with a template .docx document.
> The signature of the interface would be something like:
> [Hidden]
> public interface OpenXmlDocumentBuilder {
> byte[] build(byte[] documentTemplate, org.w3c.Document xmlDoc);
> }
> eg where the XML format is something like:
> <input>
> <LetterDate type="date">2012-01-30</LetterDate>
> <CustomerTitle type="rich">Dear Mrs. Jenkins</CustomerTitle>
> <Blurb>As requested, here are the recent payments made from your account</Blurb>
> <Payments type="rich-table">
> <row>
> <Date>2012-01-20</Date>
> <Merchant>Walmart</Merchant>
> <Amount>123.45</Date>
> </row>
> <row>
> <Date>2012-01-21</Date>
> <Merchant>Esso</Merchant>
> <Amount>45.23</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Starbucks</Merchant>
> <Amount>12.01</Date>
> </row>
> <row>
> <Date>2012-01-22</Date>
> <Merchant>Amazon</Merchant>
> <Amount>89.99</Date>
> </row>
> </Payments>
> </input>
> so that the information is used to merge into fields within the OpenXml. (NB: if using MS Word, this would correspond to "Content Controls", as per the Developer tab).
> ~~~~~~~~~~~~~
> In terms of how a domain object would use this service, one design is to have a CommunicationTemplate domain object, which holds the .docx (or .odf) (eg as a base 64 encoded string). The CommunicationTemplate acts as a factory for Communication objects, requiring that the appropriate XML be provided to it. The template then calls the DocumentBuilderService and gets back a mail-merged version; this is stored in the resultant Communication (eg again base 64 encoded).
> The sequence diagram below shows how this service could be used by a CommunicationTemplate and Communication domain object:
> http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgY3JlYXRlIENvbW11bmljYXRpb24KCkN1c3RvbWVyLT4rAA0NVGVtcGxhdGVSZXBvc2l0b3J5OiBsb29rdXAodAAUB0NvZGUpCgAXHy0tPi0AXAg6IABkDAAMCmJ1aWxkIHhtbABtIjoAgUAHKHhtbCkKAGcWLT4rRG9jdW1lbnRCdWlsZGVyU2VydmljZTogbWFpbE1lcmdlKHRoaXMub2RmAIFgCCwgAE0FACMWAIFABQB5Fm1lcmdlZE9kZgB0GQCCZA06IGluc3RhbnRpYXRlKAA0CQCBMhkAgi8PCg&s=qsd
> ~~~~~~~~~~~~
> generated at http://www.websequencediagrams.com/ using the following script:
> title create Communication
> Customer->+CommunicationTemplateRepository: lookup(templateCode)
> CommunicationTemplateRepository-->-Customer:
> Customer->Customer: build xml
> Customer->+CommunicationTemplate: create(xml)
> CommunicationTemplate->+DocumentBuilderService: mailMerge(this.odfTemplate, xml)
> DocumentBuilderService-->-CommunicationTemplate: mergedOdf
> CommunicationTemplate->Communication: instantiate(mergedOdf)
> CommunicationTemplate-->-Customer:
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira