Skip to Content
0
Former Member
Dec 02, 2009 at 06:25 PM

IDocDocument flat file representation

140 Views

I'm using the JCo API in conjunction with the IDoc Class Library and am trying to find out how to get a textual flat file representation of an IDocDocument instance. It's easy produce an XML representation using the IDocXMLProcessor, e.g.:

public String getIDocAsText( IDocDocument doc )
{
	return JCoIDoc.getIDocFactory().getIDocXMLProcessor().render( doc );
}

I also need to be able to parse the textual representation of an IDoc back into an IDocDocument. Again, this is simple to do with the XML representation. e.g.:

public IDocDocument getIDocFromText( IDocRepository repo, String idocXML )
                                                        throws IDocParseException
{
      return JCoIDoc.getIDocFactory().getIDocXMLProcessor().parse( 
                                                        repo, idocXML ).get( 0 );
}

However, I need to this with the tradtional (i.e. non-XML) representation; can anyone give me some pointers as to how this can be acheived?

The most promising lead I've found is this How-To:

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a&overridelayout=true

However, I need to do this purely in Java.

Kind regards and thanks in advance for yout time,

Jon