/// <summary> /// /// </summary> /// <param name="apply"></param> public FunctionExecution( pol.ApplyBaseReadWrite apply ) { _apply = apply; //TODO: find the function data type. this.Text = "[" + "dataType" + "] " + apply.FunctionId; foreach( inf.IExpression arg in apply.Arguments ) { if( arg is pol.ApplyBaseReadWrite ) { this.Nodes.Add( new FunctionExecution( (pol.ApplyBaseReadWrite)arg ) ); } else if( arg is pol.FunctionElementReadWrite ) { this.Nodes.Add( new FunctionParameter( (pol.FunctionElementReadWrite)arg ) ); } else if( arg is pol.AttributeValueElementReadWrite ) { this.Nodes.Add( new AttributeValue( (pol.AttributeValueElementReadWrite)arg ) ); } else if( arg is pol.AttributeDesignatorBase ) { this.Nodes.Add( new AttributeDesignator( (pol.AttributeDesignatorBase)arg ) ); } else if( arg is pol.AttributeSelectorElement ) { this.Nodes.Add( new AttributeSelector( (pol.AttributeSelectorElement)arg ) ); } } }
/// <summary> /// /// </summary> /// <param name="apply"></param> public FunctionExecution(pol.ApplyBaseReadWrite apply) { _apply = apply; //TODO: find the function data type. this.Text = "[" + "dataType" + "] " + apply.FunctionId; foreach (inf.IExpression arg in apply.Arguments) { if (arg is pol.ApplyBaseReadWrite) { this.Nodes.Add(new FunctionExecution((pol.ApplyBaseReadWrite)arg)); } else if (arg is pol.FunctionElementReadWrite) { this.Nodes.Add(new FunctionParameter((pol.FunctionElementReadWrite)arg)); } else if (arg is pol.AttributeValueElementReadWrite) { this.Nodes.Add(new AttributeValue((pol.AttributeValueElementReadWrite)arg)); } else if (arg is pol.AttributeDesignatorBase) { this.Nodes.Add(new AttributeDesignator((pol.AttributeDesignatorBase)arg)); } else if (arg is pol.AttributeSelectorElement) { this.Nodes.Add(new AttributeSelector((pol.AttributeSelectorElement)arg)); } } }
private void CreateAttributeSelectorFromFunction(object sender, EventArgs args) { TreeNodes.FunctionExecution func = (TreeNodes.FunctionExecution)tvwCondition.SelectedNode; pol.ApplyBaseReadWrite parentApply = func.ApplyBaseDefinition; pol.AttributeSelectorElement attr = new pol.AttributeSelectorElement(string.Empty, false, "TODO: Add XPath", Xacml.XacmlVersion.Version11); TreeNodes.AttributeSelector node = new TreeNodes.AttributeSelector(attr); func.Nodes.Add(node); parentApply.Arguments.Add(attr); }
private void CreateAttributeValueFromFunction(object sender, EventArgs args) { TreeNodes.FunctionExecution func = (TreeNodes.FunctionExecution)tvwCondition.SelectedNode; pol.ApplyBaseReadWrite parentApply = func.ApplyBaseDefinition; pol.AttributeValueElementReadWrite attr = new pol.AttributeValueElementReadWrite(Xacml.Consts.Schema1.InternalDataTypes.XsdString, "TODO: Add content", Xacml.XacmlVersion.Version11); TreeNodes.AttributeValue node = new TreeNodes.AttributeValue(attr); func.Nodes.Add(node); parentApply.Arguments.Add(attr); }
private void CreateFunctionParameterFromFunction(object sender, EventArgs args) { TreeNodes.FunctionExecution func = (TreeNodes.FunctionExecution)tvwCondition.SelectedNode; pol.ApplyBaseReadWrite parentApply = func.ApplyBaseDefinition; pol.FunctionElementReadWrite function = new pol.FunctionElementReadWrite("urn:new_function_param", Xacml.XacmlVersion.Version11); TreeNodes.FunctionParameter node = new TreeNodes.FunctionParameter(function); func.Nodes.Add(node); parentApply.Arguments.Add(function); }
private void CreateFunctionExecutionFromFunction(object sender, EventArgs args) { TreeNodes.FunctionExecution func = (TreeNodes.FunctionExecution)tvwCondition.SelectedNode; pol.ApplyBaseReadWrite parentApply = func.ApplyBaseDefinition; pol.ApplyElement apply = new pol.ApplyElement("urn:new_function", new pol.ExpressionReadWriteCollection(), Xacml.XacmlVersion.Version11); TreeNodes.FunctionExecution node = new TreeNodes.FunctionExecution(apply); func.Nodes.Add(node); parentApply.Arguments.Add(apply); }
/// <summary> /// Creates a new ApplyBase using the ApplyBase form the policy document. /// </summary> /// <param name="apply"></param> protected ApplyBase(ApplyBaseReadWrite apply) { _applyBase = apply; }