Class BaseXMLEntityConverter

    • Constructor Detail

      • BaseXMLEntityConverter

        public BaseXMLEntityConverter()
    • Method Detail

      • clear

        protected void clear()
      • addToInsertOrUpdateLists

        protected void addToInsertOrUpdateLists​(String id,
                                                BaseOBObject bob,
                                                boolean writable,
                                                boolean updated,
                                                boolean hasReferenceAttribute,
                                                boolean preventRealUpdate)
      • repairReferences

        protected void repairReferences()
      • checkClientOrganizationSet

        protected void checkClientOrganizationSet​(BaseOBObject bob)
      • warnDifferentClientOrg

        protected void warnDifferentClientOrg​(BaseOBObject bob,
                                              String prefix)
      • checkDanglingObjects

        protected void checkDanglingObjects()
        Checks for objects which were not found in the database but are neither defined in the imported xml. This is not allowed and can result in strange errors. If a dangling object is found then the error message is added to the list of error messages.
      • warn

        protected void warn​(String msg)
      • log

        protected void log​(String msg)
      • hasErrorOccured

        protected boolean hasErrorOccured()
      • error

        protected void error​(String msg)
      • resolve

        protected BaseOBObject resolve​(String entityName,
                                       String id,
                                       boolean reference,
                                       boolean filterOrganizations)
      • getClient

        public Client getClient()
      • setClient

        public void setClient​(Client client)
      • setOrganization

        public void setOrganization​(Organization organization)
      • getToUpdate

        public List<BaseOBObject> getToUpdate()
        Returns the objects which exist in the database and will be updated.
        Returns:
        list of objects which will be updated in the database.
      • getToInsert

        public List<BaseOBObject> getToInsert()
        Returns the list of objects which should be inserted in the database
        Returns:
        the list of new BaseOBObjects which should be inserted in the database
      • getErrorMessages

        public String getErrorMessages()
        The error messages logged during the import process. If no error message exist then null is returned. If error messages exist then the user of this class should not update the database and do a rollback.
        Returns:
        the logged error messages, null if no error messages are present
      • getWarningMessages

        public String getWarningMessages()
        The warning messages logged during the import process. Warning messages are non-failing messages. The database can be updated if there are warning messages. If no warning message exist then null is returned.
        Returns:
        the logged warning messages, null if no warning messages are present
      • getLogMessages

        public String getLogMessages()
        The standard log messages logged during the import process. If no log message exist then null is returned.
        Returns:
        the logged messages, null if no messages are present
      • getEntityResolver

        public EntityResolver getEntityResolver()
        Returns:
        the EntityResolver used by this Converter.
      • isOptionClientImport

        public boolean isOptionClientImport()
        Determines if this a client import. A client import differs from a standard import because it is assumed that all Client/Organization level information is present in the xml and only System objects should be retrieved from the database.
        Returns:
        the value of the client import option (default is false)
      • setOptionClientImport

        public void setOptionClientImport​(boolean optionClientImport)
        Determines if this a client import. A client import differs from a standard import because it is assumed that all Client/Organization level information is present in the xml and only System objects should be retrieved from the database.
        Parameters:
        optionClientImport - sets the value of the client import option (default is false)
      • setImportProcessor

        public void setImportProcessor​(EntityXMLProcessor importProcessor)
      • setEntityResolver

        public void setEntityResolver​(EntityResolver entityResolver)
      • isOptionImportAuditInfo

        public boolean isOptionImportAuditInfo()
      • setOptionImportAuditInfo

        public void setOptionImportAuditInfo​(boolean optionImportAuditInfo)