Class DataExportService

    • 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
    • Constructor Detail

      • DataExportService

        public DataExportService()
    • 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 export
        moduleId - 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