The preview of the changes.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwferu-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Index: lib/openwfe/expressions/fe_value.rb
===================================================================
--- lib/openwfe/expressions/fe_value.rb	(revision 1440)
+++ lib/openwfe/expressions/fe_value.rb	(working copy)
@@ -152,7 +152,7 @@
             if vkey
                 set_variable vkey, value
             elsif fkey
-                workitem.attributes[fkey] = value
+                workitem.set_attribute fkey, value
             else
                 raise "'variable' or 'field' attribute missing from 'set' expression"
             end
@@ -202,7 +202,7 @@
             if vkey
                 delete_variable(vkey)
             elsif fkey
-                workitem.attributes.delete(fkey)
+                workitem.unset_attribute fkey
             else
                 raise "attribute 'variable' or 'field' is missing for 'unset' expression"
             end
Index: lib/openwfe/utils.rb
===================================================================
--- lib/openwfe/utils.rb	(revision 1440)
+++ lib/openwfe/utils.rb	(working copy)
@@ -41,7 +41,10 @@
 require 'tmpdir'
 require 'open-uri'
 
+require('ruby-debug')
 
+
+
 module OpenWFE
 
     #
@@ -479,6 +482,22 @@
     end
 
     #
+    # This method is used within the InFlowWorkItem and the CsvTable classes.
+    #
+    def OpenWFE.unset_attribute (container, key)
+
+        i = key.rindex(".")
+
+        if not i
+            container.delete key
+            return
+        end
+
+        container = lookup_attribute(container, key[0..i-1])
+        container.delete key[i+1..-1]
+    end
+
+    #
     # Returns true if this host is currently online (has access to the web / 
     # internet).
     #
Index: lib/openwfe/workitem.rb
===================================================================
--- lib/openwfe/workitem.rb	(revision 1440)
+++ lib/openwfe/workitem.rb	(working copy)
@@ -188,9 +188,17 @@
             OpenWFE.set_attribute(@attributes, key, value)
         end
 
+        #
+        # unset_attribute() accomodates itself with nested key constructs.
+        #
+        def unset_attribute (key)
+            OpenWFE.unset_attribute(@attributes, key)
+        end
+
         alias :lookup_field :lookup_attribute
         alias :has_field? :has_attribute?
         alias :set_field :set_attribute
+        alias :unset_field :unset_attribute
 
     end
 

Reply via email to