@PublicAPI public interface IDocumentTemplateWriter
Modifier and Type | Method and Description |
---|---|
void |
addStructure(IMoleculeData molecule)
Adds the molecule and its properties into the predefined template.
|
void |
addStructure(IMoleculeData molecule,
ITemplateWriterOptions options)
Adds the molecule and its properties into the predefined template.
|
void |
addStructures(IMoleculeData[] molecules)
Adds the array of molecule structures and their corresponding properties to the predefined template.
|
void |
addStructures(IMoleculeData[] molecules,
ITemplateWriterOptions options)
Adds the array of molecule structures and their corresponding properties to the predefined template.
|
void |
close()
Clear up resources collected during the report generation process.
|
java.lang.String[] |
getReportedFiles()
Return list of all successfully generated report file paths so far.
|
void |
load(java.io.InputStream stream)
Loads the molecule structure(s) and their corresponding properties from
the given stream into the predefined template.
|
void |
load(java.io.InputStream stream,
ITemplateWriterOptions options)
Loads the molecule structure(s) and their corresponding properties from
the given stream into the predefined template.
|
void |
load(java.lang.String filePath)
Loads the molecule structure(s) and their corresponding properties from
the given file into the predefined template.
|
void |
load(java.lang.String filePath,
ITemplateWriterOptions options)
Loads the molecule structure(s) and their corresponding properties from
the given file into the predefined template.
|
void |
merge(java.lang.String masterDocumentName,
boolean deleteIntermediateItems)
Merge all reported documents into one report file.
|
void addStructure(IMoleculeData molecule) throws java.lang.Exception
The following is one example of the use of the addStructure. The code:
IDocumentTemplateWriter writer = DocumentHandlerFactory.createDocumentTemplateWriter(DocumentType.PPT, stream, folder); Molecule molecule = MolImporter.importMol("C1=CC=CC=C1"); molecule.properties().set("Mass", new MStringProp(String.valueOf(molecule.getMass()))); writer.addStructure(new MoleculeData(molecule));
molecule
- - IMoleculeData that is reported/filled into the template.java.lang.Exception
void addStructure(IMoleculeData molecule, ITemplateWriterOptions options) throws java.lang.Exception
The following is one example of the use of the addStructure. The code:
IDocumentTemplateWriter writer = DocumentHandlerFactory.createDocumentTemplateWriter(DocumentType.PPT, stream, folder); Molecule molecule = MolImporter.importMol("C1=CC=CC=C1"); molecule.properties().set("Mass", new MStringProp(String.valueOf(molecule.getMass()))); writer.addStructure(new MoleculeData(molecule), new TemplateWriterOptions());
molecule
- - IMoleculeData that is reported/filled into the template.options
- - ITemplateWriterOptions that can be passed to influence the report e.g. with the reporting quality, file size etc.java.lang.Exception
void addStructures(IMoleculeData[] molecules) throws java.lang.Exception
The following is one example how to use the addStructures. The code:
molecules
- - Array of IMoleculeData what should be added to the edited
documentjava.lang.Exception
void addStructures(IMoleculeData[] molecules, ITemplateWriterOptions options) throws java.lang.Exception
The following is one example how to use the addStructures. The code:
molecules
- - Array of IMoleculeData what should be added to the edited
documentoptions
- - ITemplateWriterOptions that can be passed to influence the report e.g. with the reporting quality, file size etc.java.lang.Exception
void load(java.lang.String filePath) throws java.lang.Exception
The following is one example how to use the load. The code:
IDocumentTemplateWriter writer = DocumentHandlerFactory.createDocumentTemplateWriter(DocumentType.PPT, stream, folder); writer.load("ShortSDF.sdf");
filePath
- - The path of the file from where the structures will be
loadedjava.lang.Exception
void load(java.lang.String filePath, ITemplateWriterOptions options) throws java.lang.Exception
The following is one example how to use the load. The code:
IDocumentTemplateWriter writer = DocumentHandlerFactory.createDocumentTemplateWriter(DocumentType.PPT, stream, folder); writer.load("ShortSDF.sdf", new TemplateWriterOptions());
filePath
- - The path of the file from where the structures will be
loadedoptions
- - ITemplateWriterOptions that can be passed to influence the report e.g. with the reporting quality, file size etc.java.lang.Exception
void load(java.io.InputStream stream) throws java.lang.Exception
The following is one example how to use the load. The code:
IDocumentTemplateWriter writer = DocumentHandlerFactory.createDocumentTemplateWriter(DocumentType.PPT, stream, folder); InputStream stream2 = this.getClass().getResourceAsStream("ShortSDF.sdf"); try{ writer.load(stream2); }finally { stream2.close(); }
stream
- - The input stream from where the structures will be loadedjava.lang.Exception
void load(java.io.InputStream stream, ITemplateWriterOptions options) throws java.lang.Exception
The following is one example how to use the load. The code:
IDocumentTemplateWriter writer = DocumentHandlerFactory.createDocumentTemplateWriter(DocumentType.PPT, stream, folder); InputStream stream2 = this.getClass().getResourceAsStream("ShortSDF.sdf"); try{ writer.load(stream2, new TemplateWriterOptions()); }finally { stream2.close(); }
stream
- - The input stream from where the structures will be loadedoptions
- - ITemplateWriterOptions that can be passed to influence the report e.g. with the reporting quality, file size etc.java.lang.Exception
void merge(java.lang.String masterDocumentName, boolean deleteIntermediateItems) throws java.lang.Exception
*IDocumentTemplateWriter writer = DocumentHandlerFactory.createDocumentTemplateWriter(DocumentType.PPT, stream, folder); try{ InputStream stream2 = this.getClass().getResourceAsStream("ShortSDF.sdf"); try{ writer.load(stream2, new TemplateWriterOptions()); writer.merge("MasterDocument.dotx", true); }finally { stream2.close(); } }finally{ writer.close(); }
masterDocumentName
- - The master document name that needs to be filled with the intermediate reports and written out to the report folder.deleteIntermediateItems
- - Option to delete all intermediate report files from the folder,java.lang.Exception
java.lang.String[] getReportedFiles() throws java.lang.Exception
java.lang.Exception
void close()