Class BasicBmObjectExporter

    • Constructor Detail

      • BasicBmObjectExporter

        public BasicBmObjectExporter​(ISymbolicNameService symbolicNameService,
                                     org.eclipse.emf.ecore.resource.Resource.Factory resourceFactory,
                                     BasicBmObjectExporter.IMergeStrategy mergeStrategy,
                                     IResourceContentExporterExtensionManager resourceContentExporterExtensionManager)
        Constructs a new instance.
        Parameters:
        symbolicNameService - the symbolic name service to use, may not be null.
        resourceFactory - the resource factory to use, may not be null.
        mergeStrategy - the merge strategy to use, may not be null.
        resourceContentExporterExtensionManager - the exporter extension manager to use, may not be null.
    • Method Detail

      • export

        public final void export​(IBmModel model,
                                 IBmObject bmObject,
                                 org.eclipse.core.resources.IFile file,
                                 Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
                          throws org.eclipse.core.runtime.CoreException
        Exports bmObject
        Specified by:
        export in interface IBmObjectExporter
        Parameters:
        model - the model the exported object belongs to (not null)
        bmObject - the object form Big Model (not null)
        file - the output file (not null)
        exportedExtraFiles - the collection where all the exported extra files must be placed (not null).
        Throws:
        org.eclipse.core.runtime.CoreException
      • removeExtraObjects

        public void removeExtraObjects​(IBmObject bmObject,
                                       String oldFqn)
        Description copied from interface: IBmObjectExporter
        Removes extra objects prior exporting of a new (or only) external representation of the object.
        Specified by:
        removeExtraObjects in interface IBmObjectExporter
        Parameters:
        bmObject - the object form Big Model (not null)
        oldFqn - Old object FQN, if any. May be null
      • waitDerivedDataComputation

        protected void waitDerivedDataComputation​(IBmObject bmObject)
        Waits DS calculation before save. Implementing class should define the logic of waiting by itself.
        Parameters:
        bmObject - The context object.
      • saveExtraObjects

        protected void saveExtraObjects​(IBmModel model,
                                        org.eclipse.core.resources.IFile file,
                                        IBmObject bmObject,
                                        Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
        Saves extra information attached to bmObject.
        Parameters:
        model - the model the exported object belongs to (not null)
        file - file name under which bmObject is stored; this name is taken as some basis for file name(s) of the attached object(s)
        bmObject - a top IBmObject that contains extra objects that are to be saved by this method.
        exportedExtraFiles - the collection where all the exported extra files must be placed (not null).
      • saveExtraObjects

        @Deprecated
        protected void saveExtraObjects​(org.eclipse.core.resources.IFile file,
                                        IBmObject bmObject,
                                        Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
        Deprecated.
        the method is preserved for backward compatibility only. Use four-argument counterpart.
        Saves extra information attached to bmObject.
        Parameters:
        file - file name under which bmObject is stored; this name is taken as some basis for file name(s) of the attached object(s)
        bmObject - a top IBmObject that contains extra objects that are to be saved by this method.
        exportedExtraFiles - the collection where all the exported extra files must be placed (not null).
      • deleteFile

        protected boolean deleteFile​(org.eclipse.core.resources.IProject project,
                                     String fileName)
                              throws org.eclipse.core.runtime.CoreException
        Deletes file from the project. Please note that this operation should be called from the resource operation.
        Parameters:
        project - The project to delete the file from.
        fileName - The file name to delete.
        Returns:
        True in case if the file was removed; false otherwise.
        Throws:
        org.eclipse.core.runtime.CoreException - In case of removal error.
      • doExport

        protected void doExport​(IBmModel model,
                                IBmObject bmObject,
                                IBmObject clone,
                                org.eclipse.core.resources.IFile file,
                                Collection<org.eclipse.core.resources.IFile> exportedExtraFiles)
                         throws org.eclipse.core.runtime.CoreException
        Throws:
        org.eclipse.core.runtime.CoreException