Package org.openbravo.service.db
Class DataExportService
- java.lang.Object
-
- org.openbravo.service.db.DataExportService
-
- All Implemented Interfaces:
OBProvidable
,OBSingleton
public class DataExportService extends Object implements OBSingleton
Exports business objects to XML on the basis of Datasets, DataSetTables and DataSetColumns.- Author:
- Martin Taal
- See Also:
DataSetService
,EntityXMLConverter
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLIENT_DATA_SET_NAME
Name of the dataset used for client export.static String
CLIENT_ID_PARAMETER_NAME
The name of the client id parameter used in the datasets
-
Constructor Summary
Constructors Constructor Description DataExportService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exportClientToXML(Map<String,Object> parameters, boolean exportAuditInfo, Writer out)
Exports data of a client.String
exportDataSetToXML(DataSet dataSet)
Export the data of a specific dataSet to XML.String
exportDataSetToXML(DataSet dataSet, String moduleId, Map<String,Object> parameters)
Export the data of a specific dataSet to XML.static DataExportService
getInstance()
Returns the current singleton instance of the DataExportService.static void
setInstance(DataExportService instance)
Makes it possible to set a specific DataExportService instance which will be used by the rest of the Openbravo system.
-
-
-
Field Detail
-
CLIENT_DATA_SET_NAME
public static final String CLIENT_DATA_SET_NAME
Name of the dataset used for client export.- See Also:
- Constant Field Values
-
CLIENT_ID_PARAMETER_NAME
public static final String CLIENT_ID_PARAMETER_NAME
The name of the client id parameter used in the datasets- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static DataExportService getInstance()
Returns the current singleton instance of the DataExportService.- Returns:
- the DataExportService instance
-
setInstance
public static void setInstance(DataExportService instance)
Makes it possible to set a specific DataExportService instance which will be used by the rest of the Openbravo system.- Parameters:
instance
- the DataExportService instance used by the
-
exportDataSetToXML
public String exportDataSetToXML(DataSet dataSet)
Export the data of a specific dataSet to XML. If the dataset is empty then a null value is returned.- Parameters:
dataSet
- the dataset to export- Returns:
- the XML string containing the data of the dataset
-
exportClientToXML
public void exportClientToXML(Map<String,Object> parameters, boolean exportAuditInfo, Writer out)
Exports data of a client. The main difference with the standard dataset export is that also references to client and organizations are exported. The dataset with the name Client Definition is used for the export.- Parameters:
parameters
- the parameters used in the queries, the client id should be passed in this map with the parameter name ClientID (note is case sensitive)out
- the xml is written to this writer- See Also:
CLIENT_DATA_SET_NAME
,CLIENT_ID_PARAMETER_NAME
-
exportDataSetToXML
public String exportDataSetToXML(DataSet dataSet, String moduleId, Map<String,Object> parameters)
Export the data of a specific dataSet to XML. If the dataset is empty then a null value is returned.- Parameters:
dataSet
- the dataset to exportmoduleId
- is used as a parameter in where clauses of the DataSetTable and is used to set the module id in the AD_REF_DATA_LOADED table- Returns:
- the XML string containing the data of the dataset
-
-