You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ma...@apache.org on 2007/04/24 13:35:31 UTC

svn commit: r531884 - /webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c

Author: manjula
Date: Tue Apr 24 04:35:30 2007
New Revision: 531884

URL: http://svn.apache.org/viewvc?view=rev&rev=531884
Log:
Modified neethi engine to support assertion normalization.

Modified:
    webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c

Modified: webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c?view=diff&rev=531884&r1=531883&r2=531884
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c (original)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/src/engine.c Tue Apr 24 04:35:30 2007
@@ -18,6 +18,7 @@
 
 
 #include <neethi_engine.h>
+#include <neethi_assertion_builder.h>
 
 /*Private functions*/
 
@@ -319,11 +320,11 @@
                         }                            
                         else
                         {                            
-                        /*  neethi_assertion_t *assertion = neethi_assertion_builder_build(env, child_node, child_element);
+                            neethi_assertion_t *assertion = neethi_assertion_builder_build(env, child_node, child_element);
                             operator = neethi_operator_create(env);
                             neethi_operator_set_value(operator, env, assertion, OPERATOR_TYPE_ASSERTION);
                             neethi_engine_add_policy_component(env,neethi_operator,operator);
-                        */    
+                            
                         }                            
                     }
                 }
@@ -331,7 +332,7 @@
         }
         return AXIS2_SUCCESS;
     }
-    return AXIS2_FAILURE;        
+    else return AXIS2_FAILURE;        
 }
 
 
@@ -346,6 +347,7 @@
     neethi_policy_t *neethi_policy = NULL;
     neethi_exactlyone_t *exactlyone = NULL;
     neethi_all_t *all = NULL;
+    neethi_assertion_t *assertion = NULL;
 
     type = neethi_operator_get_type(container_operator,env);
     value = neethi_operator_get_value(container_operator,env);        
@@ -377,6 +379,9 @@
                 break;
 
             case OPERATOR_TYPE_ASSERTION:
+                assertion = (neethi_assertion_t *)value;
+                neethi_assertion_add_operator(assertion, env, component);
+                printf("assertion\n");
                 break;
 
             case OPERATOR_TYPE_REFERENCE:
@@ -442,8 +447,22 @@
     neethi_operator_t *operator = NULL;
     neethi_operator_t *component = NULL;
     neethi_exactlyone_t *exactlyone = NULL;
+    axis2_char_t *policy_name = NULL;
+    axis2_char_t *policy_id = NULL;
 
     resultant_neethi_policy = neethi_policy_create(env);
+
+    policy_name = neethi_policy_get_name(neethi_policy, env);
+    if(policy_name)
+    {
+        neethi_policy_set_name(resultant_neethi_policy, env, policy_name);
+    }        
+    policy_id = neethi_policy_get_id(neethi_policy, env);
+    if(policy_id)
+    {
+        neethi_policy_set_id(resultant_neethi_policy, env, policy_id);
+    }        
+
     operator = neethi_operator_create(env);
     neethi_operator_set_value(operator,env,neethi_policy,OPERATOR_TYPE_POLICY);
 
@@ -506,6 +525,7 @@
     neethi_policy_t *neethi_policy = NULL;
     neethi_exactlyone_t *exactlyone = NULL;
     neethi_all_t *all = NULL;
+    neethi_assertion_t *assertion = NULL;
 
     type = neethi_operator_get_type(operator,env);
     value = neethi_operator_get_value(operator,env);
@@ -534,6 +554,8 @@
                 break;
 
             case OPERATOR_TYPE_ASSERTION:
+                assertion = (neethi_assertion_t *)value;
+                return neethi_assertion_is_empty(assertion, env);
                 break;
 
             case OPERATOR_TYPE_REFERENCE:
@@ -556,6 +578,7 @@
     neethi_policy_t *neethi_policy = NULL;
     neethi_exactlyone_t *exactlyone = NULL;
     neethi_all_t *all = NULL;
+    neethi_assertion_t *assertion = NULL;
 
     type = neethi_operator_get_type(operator,env);
     value = neethi_operator_get_value(operator,env);
@@ -584,11 +607,12 @@
                 break;
 
             case OPERATOR_TYPE_ASSERTION:
+                assertion = (neethi_assertion_t *)value;
+                return neethi_assertion_get_policy_components(assertion, env);
                 break;
 
             case OPERATOR_TYPE_REFERENCE:
                 break;
-
         }
     }
     
@@ -639,6 +663,26 @@
         if(component_type == OPERATOR_TYPE_ASSERTION)
         {
             /*Assertion normalization part comes here*/
+            if(deep)
+            {
+                printf("We still not handling deep normalization of assertions");
+                return NULL;
+            }               
+            else
+            {
+                neethi_exactlyone_t *exactlyone = NULL;
+                neethi_all_t *all = NULL;
+                neethi_operator_t *op = NULL;
+
+                exactlyone = neethi_exactlyone_create(env);
+                all = neethi_all_create(env);
+                op = neethi_operator_create(env);
+
+                neethi_all_add_operator(all, env, child_component);
+                neethi_operator_set_value(op, env, all,OPERATOR_TYPE_ALL);
+                neethi_exactlyone_add_operator(exactlyone, env, op);
+                axutil_array_list_add(child_component_list, env, exactlyone);
+            }                
         }
         
         else if(component_type == OPERATOR_TYPE_REFERENCE)



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org