protected IMetadataItem GetMetadataItemFromFile(string filePath)
        {
            string fileDirectory = Path.GetDirectoryName(filePath);
            string fileName      = Path.GetFileName(filePath);

            // replace the original root folder with the one where the desired file is located
            ISettingsProvider settings       = this._dataProviderServices.GetSettingsProvider(LocalFileProviderName);
            string            originalFolder = settings.GetSetting(LocalFileProviderRootFolder, string.Empty);

            settings.SetSetting(LocalFileProviderRootFolder, fileDirectory);

            // get the metadata of the desired file
            IDataSourceMetadata localRoot = this._metadataLayerService.GetDataSourceMetadata(new ServerLocation(new DataSource {
                Id = DataSourceId, Provider = LocalFileProviderName
            }));
            IList <IMetadataItem> children = this._metadataLayerService.GetContentMetadata(localRoot);
            IMetadataItem         item     = children.FirstOrDefault(c => c.DisplayName == fileName);

            // restore the original root folder
            settings.SetSetting(LocalFileProviderRootFolder, originalFolder);

            return(item);
        }
예제 #2
0
 public MetaObject(IDataSourceMetadata source)
 {
     this.source = source;
 }
예제 #3
0
 public TablesMetaObject(IDataSourceMetadata source) : base(source)
 {
     this.mappable = false;
     this._type    = "tables";
     this._value   = "tables";
 }
예제 #4
0
 public ViewMetaObject(IDataSourceMetadata source) : base(source)
 {
     this._type = "view";
 }
예제 #5
0
 public TableMetaObject(IDataSourceMetadata source) : base(source)
 {
     this._type = "table";
 }
예제 #6
0
 public DatabaseMetaObject(IDataSourceMetadata source) : base(source)
 {
     this._type = "database";
 }
예제 #7
0
 public SchemasMetaObject(IDataSourceMetadata source) : base(source)
 {
     this.mappable = false;
     this._type    = "schemas";
     this._value   = "schemas";
 }
예제 #8
0
 public ColumnsMetaObject(IDataSourceMetadata source) : base(source)
 {
     this.mappable = false;
     this._type    = "columns";
     this._value   = "columns";
 }
 public AbstractDatabaseMetaObject(IDataSourceMetadata source) : base(source)
 {
 }
예제 #10
0
 public CatalogMetaObject(IDataSourceMetadata source) : base(source)
 {
     this._type = "catalog";
 }
예제 #11
0
 public ColumnMetaObject(IDataSourceMetadata source) : base(source)
 {
     this._type = "column";
 }
예제 #12
0
 public SchemaMetaObject(IDataSourceMetadata source) : base(source)
 {
     this._type = "schema";
 }