Ejemplo n.º 1
0
 public XmlCataloguePolicyWriter(XmlNode xmlParentNode, ICataloguePolicy cataloguePolicy)
     : base(xmlParentNode)
 {
     m_cataloguePolicy = cataloguePolicy;
 }
Ejemplo n.º 2
0
 public CataloguePolicy(ICataloguePolicy rhs, bool readOnly)
     : base(rhs, readOnly, false)
 {
     m_status = rhs.Status;
 }
Ejemplo n.º 3
0
        public void WritePolicy(IPolicySet policySet, ICataloguePolicy cataloguePolicy)
        {
            NxParameter catalogueNameParam = new NxParameter("Name", cataloguePolicy);
            List<NxParameter> beforeRuleParams = NxUtils.GetAttributes(cataloguePolicy as IPolicy);
            beforeRuleParams.Add(catalogueNameParam);
            NxEvaluate b4Policy = new NxEvaluate("BeforeRule", beforeRuleParams);
            NxInvokeSet invokeSet = new NxInvokeSet(cataloguePolicy.Identifier.ToString());
            NxEvaluate afterPolicy = new NxEvaluate("AfterRule", catalogueNameParam);

            foreach (NxPolicySet policyset in m_policysets.PolicySets)
            {
                NxSet rulesSet = policyset.GetPolicy(new Guid("{C1C0D5EA-5B82-4607-AE41-D52739AA6AB1}"));
                if (rulesSet == null)
                {
                    rulesSet = new NxSet("C1C0D5EA-5B82-4607-AE41-D52739AA6AB1");
                    rulesSet.Append(b4Policy);
                    rulesSet.Append(invokeSet);
                    rulesSet.Append(afterPolicy);
                    policyset.Policies.Add(rulesSet);
                }
                else
                {
                    rulesSet.Append(b4Policy);
                    rulesSet.Append(invokeSet);
                    rulesSet.Append(afterPolicy);
                }
                policyset.Policies.Add(new NxSet(cataloguePolicy.Identifier.ToString()));
            }
        }
Ejemplo n.º 4
0
        public void WriteCataloguePolicy(ICataloguePolicy cataloguePolicy)
        {
            if (null == cataloguePolicy)
                return;

            CollectionInserter<ICataloguePolicy>.Insert(m_cataloguePolicies, cataloguePolicy);
        }
Ejemplo n.º 5
0
		public void WritePolicy(IPolicySet policySet, ICataloguePolicy cataloguePolicy)
		{
			if ((cataloguePolicy == null) || (policySet == null))
			{
				return;
			}

			string policyXpath = string.Format(CultureInfo.InvariantCulture, "PolicySet[@id='{0}']/Policies", XmlHelpers.GetPolicyObjectIdString(policySet));
			XmlNode xmlPolicyNode = m_policieSetsNode.SelectSingleNode(policyXpath);

			new XmlCataloguePolicyWriter(xmlPolicyNode, cataloguePolicy).Write();
		}