public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$"); parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$"); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(TemplateType.ToStepValue()); parameters.Add(PrimaryMeasureType != null ? PrimaryMeasureType.ToStepValue() : "$"); parameters.Add(SecondaryMeasureType != null ? SecondaryMeasureType.ToStepValue() : "$"); parameters.Add(Enumerators != null ? Enumerators.ToStepValue() : "$"); parameters.Add(PrimaryUnit != null ? PrimaryUnit.ToStepValue() : "$"); parameters.Add(SecondaryUnit != null ? SecondaryUnit.ToStepValue() : "$"); parameters.Add(Expression != null ? Expression.ToStepValue() : "$"); parameters.Add(AccessState.ToStepValue()); return(string.Join(", ", parameters.ToArray())); }
/////////////////////////////////////////////////////////////////////////////////////////////////// ////////////BUILD FROM V2.1 SCHEMA ////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Initializes a new instance of the <see cref="PrimaryMeasureCore"/> class. /// </summary> /// <param name="primaryMeasure"> /// The primary measure. /// </param> /// <param name="parent"> /// The parent. /// </param> public PrimaryMeasureCore(PrimaryMeasureType primaryMeasure, IMeasureList parent) : base(primaryMeasure, _primaryMeasureType, parent) { this.Validate(); }
static StructureType createStructure(PXModel model) { // Create structure StructureType structure = new StructureType(); // Create concepts container ConceptsType concepts = new ConceptsType(); structure.Concepts = concepts; // Concept Schemes List <ConceptSchemeType> conceptSchemes = new List <ConceptSchemeType>(); //Create Common Concept Scheme conceptSchemes.Add(createCommonConcepts()); // Create instance concept scheme ConceptSchemeType conceptScheme = new ConceptSchemeType(); conceptScheme.agencyID = model.Meta.Agency().CleanID(); conceptScheme.id = "DEFAULT"; conceptScheme.version = "1.0"; List <TextType> name = new List <TextType>(); { TextType enName = new TextType(); enName.lang = "en"; enName.Value = "Default Concept Scheme"; name.Add(enName); } conceptScheme.Name = name.ToArray(); List <ConceptType> schemeConcepts = new List <ConceptType>(); // Create fixed concepts (not contained in CDC) // Stock/flow/average indicator { ConceptType concept = new ConceptType(); concept.id = "SFA_INDICATOR"; name = new List <TextType>(); { TextType enName = new TextType(); enName.lang = "en"; enName.Value = "Stock, flow, average indicator"; name.Add(enName); } concept.Name = name.ToArray(); schemeConcepts.Add(concept); } // Seasonal adjustement { ConceptType concept = new ConceptType(); concept.id = "SEAS_ADJ"; name = new List <TextType>(); { TextType enName = new TextType(); enName.lang = "en"; enName.Value = "Seasonally adjustement"; name.Add(enName); } concept.Name = name.ToArray(); schemeConcepts.Add(concept); } // Daily adjustement { ConceptType concept = new ConceptType(); concept.id = "DAY_ADJ"; name = new List <TextType>(); { TextType enName = new TextType(); enName.lang = "en"; enName.Value = "Daily adjustement"; name.Add(enName); } concept.Name = name.ToArray(); schemeConcepts.Add(concept); } // Price basis { ConceptType concept = new ConceptType(); concept.id = "PRICE_BASIS"; name = new List <TextType>(); { TextType enName = new TextType(); enName.lang = "en"; enName.Value = "Price basis"; name.Add(enName); } concept.Name = name.ToArray(); schemeConcepts.Add(concept); } // Create codelists container List <CodeListType> codeLists = new List <CodeListType>(); //Create Common Code Lists codeLists.AddRange(createCommonCodes(model)); // Create key family KeyFamilyType keyFamily = new KeyFamilyType(); keyFamily.agencyID = model.Meta.Agency().CleanID(); keyFamily.id = model.Meta.Matrix.CleanID(); keyFamily.version = "1.0"; name = new List <TextType>(); { TextType enName = new TextType(); enName.lang = "en"; enName.Value = model.Meta.Matrix; name.Add(enName); } keyFamily.Name = name.ToArray(); ComponentsType components = new ComponentsType(); keyFamily.Components = components; // Create attributes List <AttributeType> attributes = new List <AttributeType>(); if (model.Meta.ContentVariable == null) { //Any non-null key words will be data set level attributes //Unit of measure attributes.Add(createUnitsAttribute(false, model.Meta.Agency().CleanID())); if (model.Meta.ContentInfo != null) { // Stock, flow, average if (model.Meta.ContentInfo.StockFa != null) { attributes.Add(createStockFlowAttribute(false, model.Meta.Agency().CleanID())); } // Seasonal adjustement if (model.Meta.ContentInfo.SeasAdj != null) { attributes.Add(createSeasAdjAttribute(false, model.Meta.Agency().CleanID())); } // Daily adjustment if (model.Meta.ContentInfo.DayAdj != null) { attributes.Add(createDayAdjAttribute(false, model.Meta.Agency().CleanID())); } // Base period if (model.Meta.ContentInfo.Baseperiod != null) { attributes.Add(createBasePeriodAttribute(false)); } // Reference period if (model.Meta.ContentInfo.RefPeriod != null) { attributes.Add(createReferencePeriodAttribute(false)); } // Current / fixed prices if (model.Meta.ContentInfo.CFPrices != null) { attributes.Add(createPriceBasisAttribute(false, model.Meta.Agency().CleanID())); } } } else { //Any non-null key words will be series level attributes //Unit of measure attributes.Add(createUnitsAttribute(true, model.Meta.Agency().CleanID())); if (model.Meta.ContentInfo != null) { // Stock, flow, average if (model.Meta.ContentInfo.StockFa != null) { attributes.Add(createStockFlowAttribute(true, model.Meta.Agency().CleanID())); } // Seasonal adjustement if (model.Meta.ContentInfo.SeasAdj != null) { attributes.Add(createSeasAdjAttribute(true, model.Meta.Agency().CleanID())); } // Daily adjustment if (model.Meta.ContentInfo.DayAdj != null) { attributes.Add(createDayAdjAttribute(true, model.Meta.Agency().CleanID())); } // Base period if (model.Meta.ContentInfo.Baseperiod != null) { attributes.Add(createBasePeriodAttribute(true)); } // Reference period if (model.Meta.ContentInfo.RefPeriod != null) { attributes.Add(createReferencePeriodAttribute(true)); } // Current / fixed prices if (model.Meta.ContentInfo.CFPrices != null) { attributes.Add(createPriceBasisAttribute(true, model.Meta.Agency().CleanID())); } } } attributes.Add(createObsStatusAttribute()); attributes.Add(createDecimalsAttribute()); // Add attributes to key family components components.Attribute = attributes.ToArray(); // Create dimensions List <DimensionType> dimensions = new List <DimensionType>(); // Create frequency dimension DimensionType freq = new DimensionType(); freq.conceptAgency = "SDMX"; freq.conceptSchemeRef = "CROSS_DOMAIN_CONCEPTS"; freq.conceptRef = "FREQ"; freq.conceptVersion = "1.0"; freq.codelistAgency = "SDMX"; freq.codelist = "CL_FREQ"; freq.codelistVersion = "1.0"; freq.isFrequencyDimension = true; dimensions.Add(freq); // Loop through variables to create concepts, codelists, and dimensions foreach (Variable var in model.Meta.Variables) { if (!isStandardConcept(var)) { // Create concept schemeConcepts.Add(createConcept(var)); // Create codelist codeLists.Add(createCodelist(var)); // Create dimension dimensions.Add(createDimension(var, model.Meta.Agency().CleanID())); } } // Create time dimension TimeDimensionType time = new TimeDimensionType(); time.conceptAgency = "SDMX"; time.conceptSchemeRef = "CROSS_DOMAIN_CONCEPTS"; time.conceptRef = "TIME_PERIOD"; time.conceptVersion = "1.0"; TextFormatType timeFormat = new TextFormatType(); timeFormat.textType = TextTypeType.ObservationalTimePeriod; time.TextFormat = timeFormat; components.TimeDimension = time; // Add dimensions to key family components components.Dimension = dimensions.ToArray(); // Create primary measure PrimaryMeasureType obsValue = new PrimaryMeasureType(); obsValue.conceptSchemeAgency = "SDMX"; obsValue.conceptSchemeRef = "CROSS_DOMAIN_CONCEPTS"; obsValue.conceptRef = "OBS_VALUE"; obsValue.conceptVersion = "1.0"; TextFormatType obsFormat = new TextFormatType(); obsFormat.textType = TextTypeType.Decimal; obsValue.TextFormat = obsFormat; components.PrimaryMeasure = obsValue; // Add key family to structure List <KeyFamilyType> keyFamilies = new List <KeyFamilyType>(); keyFamilies.Add(keyFamily); structure.KeyFamilies = keyFamilies.ToArray(); // Add concepts to scheme conceptScheme.Concept = schemeConcepts.ToArray(); conceptSchemes.Add(conceptScheme); concepts.ConceptScheme = conceptSchemes.ToArray(); // Add codelists to structure structure.CodeLists = codeLists.ToArray(); structure.Header = createHeader(model, false); return(structure); }