Actually it is not so difficult as it sounds. It depends on the input file format. What I have implemented is a custom parser which is reading the data from an Excel file and builds an InMemory data model with easy java beans in order to have a short of hierarchies and dependencies. The key point here is to use the right template engine which in my case is the Apache Velocity.
A template for a WM dictionary should be like this:
<?xml version="1.0"?>
<FFDictionary>
<RecordDictionaryEntry>
<EntryName>PCDATA</EntryName>
<RecordDefinition>
<CheckFields>false</CheckFields>
#foreach( $element in ${list})
<RecordElement>
<FieldUsage>
<FieldName>${element.getName()}</FieldName>
<Mandatory>false</Mandatory>
<Field>
<FieldDefinition>
<Description>${element.description}</Description>
</FieldDefinition>
</Field>
<FixedPositionExtractor>
<StartPos>$element.getStart()</StartPos>
<EndPos>$element.getEnd()</EndPos>
</FixedPositionExtractor>
</FieldUsage>
</RecordElement>
#end
</RecordDefinition>
</RecordDictionaryEntry>
</FFDictionary>
while a schena should have the following form:
<?xml version="1.0"?>
<FFSchema>
<Delimiters>
<FieldDelimInfo>
<HardCodedDelimiter>
</HardCodedDelimiter>
</FieldDelimInfo>
</Delimiters>
<DocumentStructure>
<Ordered>true</Ordered>
<RecordStructure>
<Ordered>true</Ordered>
<RecordUsage>
<RecordId>PCDATA</RecordId>
<Mandatory>false</Mandatory>
<MaxOccur>1</MaxOccur>
<AllowUndefinedData>true</AllowUndefinedData>
<Position>NoPosition</Position>
<AreaId>NoArea</AreaId>
<Record>
<RecordDefinition>
<CheckFields>false</CheckFields>
#foreach( $element in ${list})
<RecordElement>
<FieldUsage>
<FieldName>${element.getName()}</FieldName>
<Mandatory>false</Mandatory>
<Field>
<FieldDefinition>
<Description>${element.description}</Description>
</FieldDefinition>
</Field>
<FixedPositionExtractor>
<StartPos>$element.getStart()</StartPos>
<EndPos>$element.getEnd()</EndPos>
</FixedPositionExtractor>
</FieldUsage>
</RecordElement>
#end
</RecordDefinition>
</Record>
</RecordUsage>
</RecordStructure>
</DocumentStructure>
<RecordParser>
<FixedLengthParser>
<RecordLength>500</RecordLength>
</FixedLengthParser>
</RecordParser>
<RecordIdentifier>
<FixedPositionIdentifier>
<StartPos>197</StartPos>
</FixedPositionIdentifier>
</RecordIdentifier>
<UndefinedDataAllowed>false</UndefinedDataAllowed>
</FFSchema>
You have to use these templates and last but not least you can build a service !Capture24.09.2009-10.56.4225.11.2009-12.54.1625.11.2009-14.02.4225.11.2009-14.29.3517.02.2011-15.01.16.png|border=1!
like the above in order to import the generated schemas remotely. Of course you will use the java client that Developer offers in order to access the service. After you got this dummy entries in your IS you can start with your implementation.
Best regards |