[jbosstools-issues] [JBoss JIRA] (JBIDE-5307) Generalize the model creation code

Max Rydahl Andersen (JIRA) jira-events at lists.jboss.org
Tue Jun 18 10:17:32 EDT 2013


     [ https://issues.jboss.org/browse/JBIDE-5307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Rydahl Andersen closed JBIDE-5307.
--------------------------------------

    Resolution: Out of Date


Thank you for reporting the issue but this is being closed as out-of-date since the 'smooks' component is not currently being developed and have been removed for 1+ year. Thus it no longer makes sense to keep these issues around.

If you feel this issue was closed for the wrong reason then please open a new issue.

                
> Generalize the model creation code
> ----------------------------------
>
>                 Key: JBIDE-5307
>                 URL: https://issues.jboss.org/browse/JBIDE-5307
>             Project: Tools (JBoss Tools)
>          Issue Type: Task
>          Components: smooks
>            Reporter: Tom Fennelly
>             Fix For: LATER
>
>   Original Estimate: 0 minutes
>  Remaining Estimate: 0 minutes
>
> At the moment, we are using the Smooks programmatic APIs to configure the input parser etc for creating the input model.  This requires translation of the EMF config model into java code instructions for configuring the Smooks Reader - see JsonInputDataParser, CSVDataParser, EDIDataParser.
> I think this can be simplified significantly by simply asking Smooks to process the Smooks config and then extracting the reader configuration from the Smooks instance and reuse that to configure an empty Smooks config... and then parse the input to extract the model.
> The code would be something like this...
> // Get the Reader config from the Smooks config file....
> Smooks smooks1 = new Smooks(smooksConfigStream);
> ExecutionContext execCtx = smooks1.createExecutionContext();
> SmooksResourceConfiguration readerConfig = AbstractParser.getSAXParserConfiguration(execCtx.getDeliveryConfig());
> // Create a second "empty" Smooks instance and add the reader config to it....
> Smooks smooks2 = new Smooks();
> smooks.addConfiguration(readerConfig);
> // Filter the input message through this second Smooks instance and capture the model in the DOMResult...
> DOMResult result = new DOMResult();
> smooks2.filterSource(new StreamSource(inputMessageStream), result);
> // And get the model DOM instance (org.w3c.dom.Document)... 
> Document inputModelDOM = (Document) result.getNode();

--
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


More information about the jbosstools-issues mailing list