/* Function returns the data of an effect based on its description * * Inputs: strDesc - description of effect to retrieve data about * * Return value: the EPType data structure of the effect */ public EPType GetEffectByDescription(string strDesc) { // Create Expression Builder instance IIOPEXPathExprBuilder IBuilder = IOPEXPathExprBuilderFactory.CreateInstance(enuIOPEType.Effect); // Build XPath Expression string strXPathExpr = DamlConstants.SERVICE_PROFILE + IBuilder.BuildExpression(enuIOPESearchBy.COND_DESC, strDesc); XmlNode root = m_doc.DocumentElement; XmlNode node = root.SelectSingleNode(strXPathExpr, m_mgr); EPType epData = GetEPNodeData(node); return(epData); }
/* Function returns the data of an effect based on a refersTo statement * * Inputs: strRef - reference of effect to retrieve data about * * Return value: the EPType data structure of the effect */ public EPType GetEffectByReference(string strRef) { // Create Expression Builder instance IIOPEXPathExprBuilder IBuilder = IOPEXPathExprBuilderFactory.CreateInstance(enuIOPEType.Effect); // Build XPath Expression string strXPathExpr = DamlConstants.SERVICE_PROFILE + IBuilder.BuildExpression(enuIOPESearchBy.REFERS_TO, strRef); XmlNode root = m_doc.DocumentElement; XmlNode node = root.SelectSingleNode(strXPathExpr, m_mgr); node = node.ParentNode; EPType epData = GetEPNodeData(node); return(epData); }
/* Function returns the data of a named precondition * * Inputs: strName - name of precondition to retrieve data about * * Return value: the EPType data structure of the named precondition */ public EPType GetPreconditionByName(string strName) { // Create Expression Builder instance IIOPEXPathExprBuilder IBuilder = IOPEXPathExprBuilderFactory.CreateInstance(enuIOPEType.Precondition); // Build XPath Expression string strXPathExpr = DamlConstants.SERVICE_PROFILE + IBuilder.BuildExpression(enuIOPESearchBy.COND_NAME, strName); XmlNode root = m_doc.DocumentElement; XmlNode node = root.SelectSingleNode(strXPathExpr, m_mgr); node = node.ParentNode; EPType epData = GetEPNodeData(node); return(epData); }
/* Function strips the EPNode data from a description node * * Inputs: descNode - description node * * Return values: the EPType data retrieved */ private EPType GetEPNodeData(XmlNode descNode) { EPType epData = new EPType(); epData.ConditionDesc = descNode.Attributes[DamlConstants.RDF_ID].Value; XmlNode nameNode = descNode.SelectSingleNode(DamlConstants.PROFILE_CONDITION_NAME, m_mgr); epData.ConditionName = nameNode.InnerText; XmlNode stmntNode = descNode.SelectSingleNode(DamlConstants.PROFILE_STATEMENT, m_mgr); epData.Statement = stmntNode.Attributes[DamlConstants.RDF_RESOURCE].Value; XmlNode referNode = descNode.SelectSingleNode(DamlConstants.PROFILE_REFERS_TO, m_mgr); epData.RefersTo = referNode.Attributes[DamlConstants.RDF_RESOURCE].Value; return(epData); }