Class BaseBmObjectExporter

    • Constructor Detail

      • BaseBmObjectExporter

        protected BaseBmObjectExporter​(IBmModelManager modelManager,
                                       ISymbolicNameService symbolicNameService,
                                       org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter,
                                       IQualifiedNameFilePathConverter qualifiedNameFilePathConverter,
                                       org.eclipse.emf.ecore.resource.Resource.Factory resourceFactory,
                                       IResourceContentExporterExtensionManager resourceContentExporterExtensionManager)
        Constructs a new instance.
        Parameters:
        modelManager - the model manager, may not be null.
        symbolicNameService - the symbolic name service to use, may not be null.
        qualifiedNameConverter - the qualified name converter, may not be null.
        qualifiedNameFilePathConverter - the qualified-name-to-file-path converter, may not be null.
        resourceFactory - the resource factory to use, may not be null.
        resourceContentExporterExtensionManager - the exporter extension manager to use, may not be null.
    • Method Detail

      • saveFile

        public final BmFileSaveResult saveFile​(IDtProject project,
                                               IBmNamespace namespace,
                                               long id)
                                        throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IBmObjectExporter
        Exports the specified top object data and saves it in the corresponding workspace file(s) as a response to the object's creation or modification.
        Specified by:
        saveFile in interface IBmObjectExporter
        Parameters:
        project - The project the top object belongs to. May not be null.
        namespace - The namespace the top object belongs to. May not be null.
        id - The identifier of the top object.
        Returns:
        an instance of BmFileSaveResult containing information about the saved file(s).
        Throws:
        org.eclipse.core.runtime.CoreException - if an error occurs.
      • deleteFile

        public final BmFileDeletionResult deleteFile​(IDtProject project,
                                                     IBmNamespace namespace,
                                                     org.eclipse.emf.ecore.EClass eClass,
                                                     String fqn)
                                              throws org.eclipse.core.runtime.CoreException
        Description copied from interface: IBmObjectExporter
        Deletes the file(s) the top object data is saved in as a response to the object's deletion.
        Specified by:
        deleteFile in interface IBmObjectExporter
        Parameters:
        project - The project the top object belongs to. May not be null.
        namespace - The namespace the top object belongs to. May not be null.
        eClass - The EMF class of the top object. May not be null.
        fqn - The FQN of the top object. May not be null.
        Returns:
        an instance of BmFileDeletionResult containing information about the deleted file(s).
        Throws:
        org.eclipse.core.runtime.CoreException - if an error occurs.
      • cloneObject

        protected IBmObject cloneObject​(IBmObject object)
        Clones object to be exported. The given object isn't attached to the transaction.
        Parameters:
        object -
        Returns:
        clone
      • waitDerivedDataComputation

        protected void waitDerivedDataComputation​(IDtProject project)
        Waits DS calculation before save. Implementing class should define the logic of waiting by itself.
        Parameters:
        project -
      • getFormatter

        protected IFormatter getFormatter()