Class DtProjectDataSource
java.lang.Object
com._1c.g5.v8.dt.internal.compare.datasource.DtProjectDataSource
- All Implemented Interfaces:
IComparisonDataSource
- Direct Known Subclasses:
ActiveDtProjectDataSource,LibraryComparisonDataSource,OverlayComparisonDataSource
A comparison data source for any supported type of the project
-
Field Summary
FieldsFields inherited from interface com._1c.g5.v8.dt.compare.datasource.IComparisonDataSource
PROJECT_FILE, PROJECT_SOURCE_FOLDER -
Constructor Summary
ConstructorsConstructorDescriptionDtProjectDataSource(DataSourceType dataSourceType, IExtendedProjectSourceProvider sourceProvider, ISymbolicNameService symbolicNameService, IQualifiedNameFilePathConverter qualifiedNameFilePathConverter, IBmModelManager bmModelManager, IWorkspaceOrchestrator workspaceOrchestrator, IVirtualProjectResourceImportService resourceImportService, IDerivedDataManagerProvider derivedDataManagerProvider, ILibraryRepository libraryRepository) Constructs a new data source for the specified V8 project. -
Method Summary
Modifier and TypeMethodDescriptionBegins the data source operation transaction.booleanbooleanfileExists(Path path) Checks whether a file for the specified path exists.Gets the BM model associated with the sourcegetCollectionSymlinks(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference collectionReference, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Returns a list of symbolic links for objects owned by this data source and referenced by the specified multi-reference from the specified context object.Returns the distribution support information for this data source.Gets theIDtProjectinstance associated with this data source and related to the project being represented by this sourcegetFileListRecursively(Path path) Returns the file list for given folder path and all its subfolders.getFileStream(Path path) Returns a file stream for the specified path.Returns the model editing support provider for this data source.org.eclipse.emf.ecore.EObjectgetObjectById(long id) Returns an object by the specified Id.Returns the file path for the specified top-level MD objectReturns project name for this data source.Returns the stored project nature.Gets the associated source providergetSymlink(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject eObject, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Returns a symbolic link for an object owned by this data source.getSymlink(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Returns a symbolic link for an object owned by this data source, as defined by a single reference from a context object.getSymlinksOfTopObjects(org.eclipse.xtext.scoping.IScopeProvider scopeProvider, List<org.eclipse.emf.ecore.EClass> eClasses) Gets all top level object symlinks for a given set ofEClass'es.Gets the target runtime version for the project behind this sourceorg.eclipse.emf.ecore.EObjectgetTopLevelObject(String symlink, org.eclipse.emf.ecore.EClass eClass) Returns a top-level MD object by the specified symbolic link.longGets top-level object Id by FQN.getType()Gets the type of the data source.inthashCode()booleanisOverlayOf(IComparisonDataSource comparisonDataSource) Checks if this data source overlays the provided source.protected voidonStart(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Prepares the data of the source (like import, etc)protected voidonStop()Clears all the data for the source (like internal model, etc)voidprepareTopObjectInfos(List<TopObjectInfo> topObjectInfos) Prepares information for the specified top objects.protected final voidsetBmModel(IBmModel bmModel) Sets the BM model associated with the data source.final voidstartIfNecessary(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Starts the data source in the flow of the comparison session creation.final voidstop()Stops the data source in the flow of the comprison session closure.voidsynchronize(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Synchronizes the data source with external changes being made to this source.booleantopObjectExists(String symlink, org.eclipse.emf.ecore.EClass eClass) Checks if the referenced top object exists in the data source.toString()
-
Field Details
-
symbolicNameService
the symbolic name service
-
-
Constructor Details
-
DtProjectDataSource
public DtProjectDataSource(DataSourceType dataSourceType, IExtendedProjectSourceProvider sourceProvider, ISymbolicNameService symbolicNameService, IQualifiedNameFilePathConverter qualifiedNameFilePathConverter, IBmModelManager bmModelManager, IWorkspaceOrchestrator workspaceOrchestrator, IVirtualProjectResourceImportService resourceImportService, IDerivedDataManagerProvider derivedDataManagerProvider, ILibraryRepository libraryRepository) Constructs a new data source for the specified V8 project.- Parameters:
dataSourceType- the type of the data source according to the description. May not benullsourceProvider- theIExtendedProjectSourceProviderabstraction of project sources file access. May not benullsymbolicNameService- the symbolic name service, notnullqualifiedNameFilePathConverter- the qualified name file path provider, notnullbmModelManager- the BM model manager, notnullworkspaceOrchestrator- the link to theIWorkspaceOrchestratorservice. May not benullresourceImportService- the link to theIVirtualProjectResourceImportServiceservice. May not benullderivedDataManagerProvider- the link to theIDerivedDataManagerProviderservice. May not benulllibraryRepository- the library repository. May not benull
-
-
Method Details
-
beginTransaction
Description copied from interface:IComparisonDataSourceBegins the data source operation transaction.- Specified by:
beginTransactionin interfaceIComparisonDataSource- Returns:
- The newly started transaction. Cannot be
null
-
equals
-
fileExists
Description copied from interface:IComparisonDataSourceChecks whether a file for the specified path exists.- Specified by:
fileExistsin interfaceIComparisonDataSource- Parameters:
path- the specified path to check the existence for, cannot benull- Returns:
trueif the file exists,falseotherwise
-
getBmModel
Description copied from interface:IComparisonDataSourceGets the BM model associated with the source- Specified by:
getBmModelin interfaceIComparisonDataSource- Returns:
- The BM model instance. May not be
null
-
getCollectionSymlinks
public List<String> getCollectionSymlinks(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference collectionReference, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Description copied from interface:IComparisonDataSourceReturns a list of symbolic links for objects owned by this data source and referenced by the specified multi-reference from the specified context object.- Specified by:
getCollectionSymlinksin interfaceIComparisonDataSource- Parameters:
context- the referencing object, notnullcollectionReference- the referencing feature, notnull, must be multi-referencescopeProvider- the scope provider- Returns:
- a list of symbolic links, never
null
-
getDistributionDescription
Description copied from interface:IComparisonDataSourceReturns the distribution support information for this data source.- Specified by:
getDistributionDescriptionin interfaceIComparisonDataSource- Returns:
- the distribution support information or
nullif no information for this data source was specified
-
getDtProject
Description copied from interface:IComparisonDataSourceGets theIDtProjectinstance associated with this data source and related to the project being represented by this source- Specified by:
getDtProjectin interfaceIComparisonDataSource- Returns:
- The
IDtProjectinstance. May not benull
-
getFileListRecursively
Description copied from interface:IComparisonDataSourceReturns the file list for given folder path and all its subfolders.- Specified by:
getFileListRecursivelyin interfaceIComparisonDataSource- Parameters:
path- the relative folder path to get the file list for, can not benull- Returns:
- the list of relative file paths, never
null
-
getFileStream
Description copied from interface:IComparisonDataSourceReturns a file stream for the specified path.- Specified by:
getFileStreamin interfaceIComparisonDataSource- Parameters:
path- the string with the path- Returns:
- the input stream
-
getModelEditingSupport
Description copied from interface:IComparisonDataSourceReturns the model editing support provider for this data source.- Specified by:
getModelEditingSupportin interfaceIComparisonDataSource- Returns:
- the model editing support provider or
nullif no provider for this data source was specified
-
getPath
Returns the file path for the specified top-level MD object- Specified by:
getPathin interfaceIComparisonDataSource- Parameters:
symlink- the symlink of the top-level MD objecteClass- TODO- Returns:
- a string with the relative path of the MD object, may be
null
-
getProjectName
Description copied from interface:IComparisonDataSourceReturns project name for this data source.- Specified by:
getProjectNamein interfaceIComparisonDataSource- Returns:
- the project name, never
null
-
getProjectNature
Description copied from interface:IComparisonDataSourceReturns the stored project nature.- Specified by:
getProjectNaturein interfaceIComparisonDataSource- Returns:
- the stored project nature, may be
ICoreConstants.V8_CONFIGURATION_NATUREorICoreConstants.V8_EXTENSION_NATUREorICoreConstants.V8_EXTERNAL_OBJECTS_NATUREornullif the data source does not store V8 project
-
getSymlink
public String getSymlink(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject eObject, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Description copied from interface:IComparisonDataSourceReturns a symbolic link for an object owned by this data source.- Specified by:
getSymlinkin interfaceIComparisonDataSource- Parameters:
context- the referencing object, notnullreference- the reference feature, notnulleObject- the referenced object, notnullscopeProvider- the scope provider- Returns:
- the symbolic link, never
null
-
getSymlink
public String getSymlink(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Description copied from interface:IComparisonDataSourceReturns a symbolic link for an object owned by this data source, as defined by a single reference from a context object.- Specified by:
getSymlinkin interfaceIComparisonDataSource- Parameters:
context- the referencing object, notnullreference- the referencing feature, notnull, must be single referencescopeProvider- the scope provider- Returns:
- the symbolic link, never
null
-
getSymlinksOfTopObjects
public Map<org.eclipse.emf.ecore.EClass,List<String>> getSymlinksOfTopObjects(org.eclipse.xtext.scoping.IScopeProvider scopeProvider, List<org.eclipse.emf.ecore.EClass> eClasses) Description copied from interface:IComparisonDataSourceGets all top level object symlinks for a given set ofEClass'es. If this data source is associated with Configuration-aware project, the order of the returned instances will be the same as in the corresponding collection of the Configuration.- Specified by:
getSymlinksOfTopObjectsin interfaceIComparisonDataSource- Parameters:
scopeProvider- the scope provider for symbolic links, cannot benulleClasses- the given set ofEClass'es, may benull- Returns:
- all top level object symlinks for a given set of
EClass'es, nevernull
-
getTargetRuntimeVersion
Description copied from interface:IComparisonDataSourceGets the target runtime version for the project behind this source- Specified by:
getTargetRuntimeVersionin interfaceIComparisonDataSource- Returns:
- The version of the target 1C runtime. Cannot be
null
-
getTopLevelObject
public org.eclipse.emf.ecore.EObject getTopLevelObject(String symlink, org.eclipse.emf.ecore.EClass eClass) Description copied from interface:IComparisonDataSourceReturns a top-level MD object by the specified symbolic link.- Specified by:
getTopLevelObjectin interfaceIComparisonDataSource- Parameters:
symlink- the symbolic link (FQN) of the MD object, notnull; an exception will be thrown for an invalid or a non-top object argumenteClass- TheEClassthat defines the context of the symlink resolution, may benull- Returns:
- the object, never
null
-
getType
Description copied from interface:IComparisonDataSourceGets the type of the data source.- Specified by:
getTypein interfaceIComparisonDataSource- Returns:
- The type of the data source. May not be
null
-
hashCode
public int hashCode() -
isOverlayOf
Description copied from interface:IComparisonDataSourceChecks if this data source overlays the provided source. Used to syncrhonize the data in case of underlying data source data changes- Specified by:
isOverlayOfin interfaceIComparisonDataSource- Returns:
-
prepareTopObjectInfos
Description copied from interface:IComparisonDataSourcePrepares information for the specified top objects. Deletes top object info if the referenced top object doesn't exist in the data source.- Specified by:
prepareTopObjectInfosin interfaceIComparisonDataSource- Parameters:
topObjectInfos- the list of top object information containers, cannot benull
-
startIfNecessary
public final void startIfNecessary(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:IComparisonDataSourceStarts the data source in the flow of the comparison session creation. Implementation should take care about multiple attempts of start request being submitted to the data source- Specified by:
startIfNecessaryin interfaceIComparisonDataSource- Parameters:
progressMonitor- Progress monitor of a start sequence. May not benull
-
stop
public final void stop()Description copied from interface:IComparisonDataSourceStops the data source in the flow of the comprison session closure. Should be failure-proof to not hinder othe sources sequential stops- Specified by:
stopin interfaceIComparisonDataSource
-
synchronize
public void synchronize(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:IComparisonDataSourceSynchronizes the data source with external changes being made to this source. Until this method call the data source should store any change tasks without applying- Specified by:
synchronizein interfaceIComparisonDataSource- Parameters:
progressMonitor- Progress monitor of a update/synchronization sequence. May not benull
-
topObjectExists
Description copied from interface:IComparisonDataSourceChecks if the referenced top object exists in the data source. The implementation of this method should be as quick as possible.- Specified by:
topObjectExistsin interfaceIComparisonDataSource- Parameters:
symlink- The symlink to check existence for.eClass- The eClass of expected object.- Returns:
- True if the data source is able to retrieve referenced object; false otherwise.
-
toString
-
getObjectById
public org.eclipse.emf.ecore.EObject getObjectById(long id) Description copied from interface:IComparisonDataSourceReturns an object by the specified Id.- Specified by:
getObjectByIdin interfaceIComparisonDataSource- Parameters:
id- the Id- Returns:
- the object found or
null
-
getTopObjectIdByFqn
Description copied from interface:IComparisonDataSourceGets top-level object Id by FQN.- Specified by:
getTopObjectIdByFqnin interfaceIComparisonDataSource- Parameters:
fqn- the FQN to get Id by, may not benull- Returns:
- the Id or
-1Lif there is no object with the specified FQN
-
getSourceProvider
Gets the associated source provider- Returns:
IExtendedProjectSourceProviderprovider. May not benull
-
onStart
protected void onStart(org.eclipse.core.runtime.IProgressMonitor progressMonitor) Prepares the data of the source (like import, etc)- Parameters:
progressMonitor- The progress monitor to control the process. May not benull
-
onStop
protected void onStop()Clears all the data for the source (like internal model, etc)- Parameters:
progressMonitor- The progress monitor to control the process. May not benull
-
setBmModel
Sets the BM model associated with the data source. Should be called during the start sequence of the data source
-