|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.orchestranetworks.service.ImportSpec
Defines the features of an import.
For being valid, an instance of this class must at least define a XML source and a target adaptation. The XML document used as source must be a subset or a complete document that conforms to the schema associated to the target adaptation instance.
Here is a code sample for importing a CSV table:
private ImportSpec getImportSpecForCSV(
File csvFile,
AdaptationTable table,
Header headerType)
{
ExportImportCSVSpec csvSpec = new ExportImportCSVSpec();
csvSpec.setHeader(headerType);
ImportSpec importSpec = new ImportSpec();
importSpec.setSourceFile(csvFile);
importSpec.setTargetAdaptationTable(table);
importSpec.setCSVSpec(csvSpec);
return importSpec;
}
The complete specification of XML Imports is available in the reference document XML Imports.
ProcedureContext.doImport(ImportSpec)| Constructor Summary | |
ImportSpec()
|
|
| Method Summary | |
ExportImportCSVSpec |
getCSVSpec()
Returns the specific features that have been specified so as to perform a CSV import, null if an XML import
is to be made. |
ImportSpecMode |
getImportMode()
Returns the import mode. |
File |
getSourceFile()
|
InputStream |
getSourceStream()
|
Adaptation |
getTargetAdaptation()
|
boolean |
isCloseStreamWhenFinished()
|
void |
setCloseStreamWhenFinished(boolean closeStreamWhenFinished)
Specifies that the import process must close the stream at the end. |
void |
setCSVSpec(ExportImportCSVSpec csvSpec)
Specifies the specific features so as to perform a CSV import instead of an XML import. |
void |
setImportMode(ImportSpecMode mode)
Specifies the import mode : 'insert', 'insert or update', 'update only'. |
void |
setSourceFile(File aSource)
Specifies the XML document that serves as the source of the import. |
void |
setSourceStream(InputStream aSource)
Specifies that the import process must read the document from the stream specified. |
void |
setTargetAdaptation(Adaptation aTarget)
Specifies the target of the import. |
void |
setTargetAdaptationTable(AdaptationTable aTargetTable)
Specifies the target table of the import. |
String |
toString()
|
String |
toStringInfo()
Returns information about the main attributes of this instance. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ImportSpec()
| Method Detail |
public Adaptation getTargetAdaptation()
setTargetAdaptation(Adaptation)public void setTargetAdaptation(Adaptation aTarget)
setTargetAdaptationTable(AdaptationTable)'
must be used instead.
aTarget - the adaptation that will be updated with the imported XML content.public void setTargetAdaptationTable(AdaptationTable aTargetTable)
setTargetAdaptation(Adaptation)',
in the case of a specific table import.
aTargetTable - the adaptation table that will be updated with the imported CSV content.public ImportSpecMode getImportMode()
setImportMode(ImportSpecMode)public void setImportMode(ImportSpecMode mode)
If not specified, the 'insert' mode is used.
public File getSourceFile()
setSourceFile(File)public void setSourceFile(File aSource)
aSource - the XML document to import.public InputStream getSourceStream()
setSourceStream(InputStream)public void setSourceStream(InputStream aSource)
The source stream is a more general alternative than the source file.
It is up to the caller of this method to provide a buffered input stream (if needed for performance).
aSource - the stream containing the XML content to import.public boolean isCloseStreamWhenFinished()
setCloseStreamWhenFinished(boolean)public void setCloseStreamWhenFinished(boolean closeStreamWhenFinished)
If not set, this property is true.
public ExportImportCSVSpec getCSVSpec()
null if an XML import
is to be made.
setCSVSpec(ExportImportCSVSpec)public void setCSVSpec(ExportImportCSVSpec csvSpec)
If not specified, the XML import is performed.
public String toStringInfo()
public String toString()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
(report a bug)
EBX.Platform 4.8.4 [0722]
Copyright Orchestra Networks 2000-2010. All rights reserved.