/// <summary> /// Convert physicalPath to a logical path /// </summary> /// <param name="aLanguage"></param> /// <param name="physicalPath"></param> /// <returns></returns> private string ToLogicalPath(string aLanguage, string physicalPath) { Path pathProcessor = new Path(physicalPath); string logicalPath = null; do { logicalPath += "/" + pathProcessor.CurrentAttribute; if (pathProcessor.IsCurrentIdentified) { ArchetypeTerm archetypeTerm = this.Ontology.TermDefinition(aLanguage, pathProcessor.CurrentNodeId); string name = archetypeTerm.Items.Item("text"); if (string.IsNullOrEmpty(name)) { throw new ApplicationException(string.Format(CommonStrings.XIsNullOrEmpty, name)); } logicalPath += "[" + name + "]"; } } while (pathProcessor.NextStep()); Check.Ensure(!string.IsNullOrEmpty(logicalPath), "logicalPath must not be null or empty."); return(logicalPath); }
/// <summary> /// The concept name of the archetype in language a_lang; corresponds to the term definition of /// the concept attribute in the archetype ontology. /// </summary> /// <param name="aLanguage">language</param> /// <returns></returns> public string ConceptName(string aLanguage) { Check.Require(!string.IsNullOrEmpty(aLanguage), string.Format(CommonStrings.XMustNotBeNullOrEmpty, "aLanguage")); Check.Require(this.Definition != null, string.Format(CommonStrings.XMustNotBeNull, "Definition")); ArchetypeTerm termDefinition = this.Ontology.TermDefinition(aLanguage, this.Definition.NodeId); if (termDefinition == null) { throw new ApplicationException(string.Format(CommonStrings.XIsNull, "termDefinition")); } return(termDefinition.Items.Item("text")); }
protected void Validate(ArchetypeTerm archetypeTerm) { Invariant(!string.IsNullOrEmpty(archetypeTerm.Code), "archetypeTerm.Code must not be null or empty."); Invariant(archetypeTerm.Keys() != null, "archeytpeTerm.Keys() must not be null."); }