S
sandygs
I am having to interface data from different databases in my
org to other orgs (so far within the company).
I have Servlets taking the request and returning the data (adding
extra values in certain cases).
The existing users are expecting either XML or delimited or positional
formats.
I had written formatters to do this job about several yrs ago.
Since we are getting more users asking data in different flavors to fit
their new or legacy apps, I was thinking of rewriting our
formatting classes now than later before it can clutter.
My approach is to use Jaxp to create a DOM structures from the
data retrieved, add an attribute like "PAD_LEN" for each data
element, pass the document to the Formatter, which...
- Uses DOM Transformers to build xml format for xml clients.
- Custom Delimiter Transformer1: Walks through the document and appends
data and delimiters to the resultbuffer in case of delimited clients.
- Custom Positional Transformer2: Walks through the document and pads
trailing spaces for fixed-positional format users.
Though this will take a lot of work to re-write the existing queries, I
think it would be worth a while before it gets even bulkier.
I thought this approach will also help if we migrate towards soap
structure.
I am curious to know if there are better approaches for such a
scenario. I read Biztalk is capable of something like this... but we
dont want to use any third-party tools to do this job for sure, just
because it gives us more control over the formats.
Any suggestions appreciated. Thnks.
org to other orgs (so far within the company).
I have Servlets taking the request and returning the data (adding
extra values in certain cases).
The existing users are expecting either XML or delimited or positional
formats.
I had written formatters to do this job about several yrs ago.
Since we are getting more users asking data in different flavors to fit
their new or legacy apps, I was thinking of rewriting our
formatting classes now than later before it can clutter.
My approach is to use Jaxp to create a DOM structures from the
data retrieved, add an attribute like "PAD_LEN" for each data
element, pass the document to the Formatter, which...
- Uses DOM Transformers to build xml format for xml clients.
- Custom Delimiter Transformer1: Walks through the document and appends
data and delimiters to the resultbuffer in case of delimited clients.
- Custom Positional Transformer2: Walks through the document and pads
trailing spaces for fixed-positional format users.
Though this will take a lot of work to re-write the existing queries, I
think it would be worth a while before it gets even bulkier.
I thought this approach will also help if we migrate towards soap
structure.
I am curious to know if there are better approaches for such a
scenario. I read Biztalk is capable of something like this... but we
dont want to use any third-party tools to do this job for sure, just
because it gives us more control over the formats.
Any suggestions appreciated. Thnks.