protected override StructureDiscoveryCommand InstantiateCommand(AbstractItem item)
        {
            var factory = discoveryProvider.Instantiate(item.GetConnectionString());

            var target = BuildTarget(item);
            var filters = BuildFilters(item);

            var command = factory.Instantiate(target, TargetType.Relation, filters);
            return command;
        }
Пример #2
0
        internal MetadataDiscoveryRequest Build(AbstractItem item, MetadataDiscoveryRequestType type)
        {
            var properties = new string[] { "Perspective", "Dimension", "Hierarchy", "Level", "Property", "MeasureGroup", "DisplayFolder", "Measure", "Table", "Column" };

            IFilter filter = null;
            var filters = new List<IFilter>();
            foreach (var property in properties)
            {
                filter = BuildCaptionFilter(item, property);
                if (filter != null)
                    filters.Add(filter);
            }

            var target = GetTarget(item);

            filter = BuildCaptionFilterForCaptionProperty(item, target);
            if (filter != null)
                filters.Add(filter);

            var connectionString = item.GetConnectionString();

            var factory = new DiscoveryRequestFactory();
            MetadataDiscoveryRequest request = null;
            switch (type)
            {
                case MetadataDiscoveryRequestType.Direct:
                    request = factory.BuildDirect(connectionString, target, filters);
                    break;
                case MetadataDiscoveryRequestType.Relation:
                    target = GetTargetRelation(item);
                    request = factory.BuildRelation(connectionString, target, filters);
                    break;
                default:
                    break;
            }
            return request;
        }
        protected virtual IDataTypeDiscoveryCommand InstantiateCommand(AbstractItem item)
        {
            var factory = discoveryProvider.Instantiate(item.GetConnectionString());

            var target = BuildTarget(item);
            var filters = BuildFilters(item);

            var command = factory.Instantiate(target, filters);
            return command;
        }