*** empty log message ***

mp2079 [2003-05-15 16:29:46]
*** empty log message ***
Filename
discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.cs
discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.xsd
discus2/csharpsrc/PSL.TotalRecall/PolicyManager/NotEvaluator.cs
discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyEditor/PolicyEditor.cs
discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyManager.cs
diff --git a/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.cs b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.cs
new file mode 100644
index 0000000..d81cd74
--- /dev/null
+++ b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <autogenerated>
+//     This code was generated by a tool.
+//     Runtime Version: 1.0.3705.288
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </autogenerated>
+//------------------------------------------------------------------------------
+
+//
+// This source code was auto-generated by xsd, Version=1.0.3705.288.
+//
+using System.Xml.Serialization;
+
+namespace PSL.TotalRecall.PolicyManager
+{
+
+	/// <remarks/>
+	[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://psl.cs.columbia.edu/discus2/Not")]
+	[System.Xml.Serialization.XmlRootAttribute(Namespace="http://psl.cs.columbia.edu/discus2/Not", IsNullable=false)]
+	public class Not
+	{
+
+		/// <remarks/>
+		[System.Xml.Serialization.XmlAnyElementAttribute()]
+		public System.Xml.XmlElement Any;
+	}
+
+}
\ No newline at end of file
diff --git a/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.xsd b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.xsd
new file mode 100644
index 0000000..6a50598
--- /dev/null
+++ b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/Not.xsd
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<xs:schema id="Not" elementFormDefault="qualified" xmlns="http://psl.cs.columbia.edu/discus2/Not" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://psl.cs.columbia.edu/discus2/Not">
+	<xs:element name="Not">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:sequence minOccurs="1" maxOccurs="1">
+					<xs:any />
+				</xs:sequence>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/NotEvaluator.cs b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/NotEvaluator.cs
new file mode 100644
index 0000000..fadd008
--- /dev/null
+++ b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/NotEvaluator.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace PSL.TotalRecall.PolicyManager
+{
+	/// <summary>
+	/// Evaluates a Not policy expression, which returns the inverse of the result of the one
+	/// nested policy expression
+	/// </summary>
+	public class NotEvaluator : IPolicyEvaluator
+	{
+		public const string TAG = "Not";
+
+		private XmlSerializer serializer = new XmlSerializer(typeof(Not));
+
+		public EvaluationResult evaluateExpression(XmlElement expressionDoc, IContext context)
+		{
+
+			// first deserialize expression into a Not instance
+			Not expression = null;
+			try
+			{
+				XmlNodeReader reader = new XmlNodeReader(expressionDoc);
+				expression = (Not) serializer.Deserialize(reader);
+			}
+			catch (Exception e)
+			{
+				throw new PolicyManagerException("Could not deserialize Not node", e);
+			}
+
+			EvaluationResult result = PolicyManager.invokeEvaluator(expression.Any, context);
+
+			return new EvaluationResult(TAG, !result.Result, "Nested expression evaluated " +
+				result.Result);
+
+
+		}
+
+	}
+}
diff --git a/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyEditor/PolicyEditor.cs b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyEditor/PolicyEditor.cs
index af9daa8..412db1b 100644
--- a/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyEditor/PolicyEditor.cs
+++ b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyEditor/PolicyEditor.cs
@@ -216,9 +216,10 @@ namespace PSL.TotalRecall.PolicyManager
 			// tabs
 			//
 			this.tabs.Controls.AddRange(new System.Windows.Forms.Control[] {
-																			   this.resourcesTab,
+																			   this.policiesTab,
 																			   this.categoriesTab,
-																			   this.policiesTab});
+																			   this.resourcesTab
+																			   });
 			this.tabs.Dock = System.Windows.Forms.DockStyle.Fill;
 			this.tabs.Name = "tabs";
 			this.tabs.SelectedIndex = 0;
diff --git a/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyManager.cs b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyManager.cs
index 91f1eff..cf9497a 100644
--- a/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyManager.cs
+++ b/discus2/csharpsrc/PSL.TotalRecall/PolicyManager/PolicyManager.cs
@@ -129,7 +129,14 @@ namespace PSL.TotalRecall.PolicyManager
 			}

 			// now evaluate the one element in this policy
-			return invokeEvaluator(policy.Any, context);
+			if (policy.Any != null)
+			{
+				return invokeEvaluator(policy.Any, context);
+			}
+			else
+			{
+				return new EvaluationResult(TAG, true, "Blank policy");
+			}

 		}