You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2006/05/08 09:21:21 UTC
svn commit: r404947 [3/7] - in
/webservices/axis2/trunk/c/modules/wsdl/woden: ./ include/woden/
include/woden/schema/ include/woden/wsdl20/
include/woden/wsdl20/extensions/ include/woden/wsdl20/xml/
include/woden/xml/ src/schema/ src/util/ src/wsdl20/ ...
Modified: webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/imported_schema.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/imported_schema.c?rev=404947&r1=404946&r2=404947&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/imported_schema.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/imported_schema.c Mon May 8 00:21:09 2006
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-#include <woden/axis2_woden_imported_schema.h>
+#include <woden/schema/axis2_woden_imported_schema.h>
+#include <xml_schema/axis2_xml_schema.h>
#include <axis2_url.h>
typedef struct axis2_woden_imported_schema_impl axis2_woden_imported_schema_impl_t;
@@ -27,6 +28,7 @@
{
axis2_woden_imported_schema_t imported_schema;
axis2_woden_schema_t *schema;
+ axis2_woden_obj_types_t obj_type;
axis2_hash_t *methods;
axis2_url_t *f_schema_location;
};
@@ -35,41 +37,142 @@
((axis2_woden_imported_schema_impl_t *) schema)
axis2_status_t AXIS2_CALL
-axis2_woden_imported_schema_free(void *schema,
- axis2_env_t **env);
+axis2_woden_imported_schema_free(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_imported_schema_type(
+ void *schema,
+ axis2_env_t **env);
axis2_woden_schema_t *AXIS2_CALL
-axis2_woden_imported_schema_get_base_impl(void *schema,
- axis2_env_t **env);
+axis2_woden_imported_schema_get_base_impl(
+ void *schema,
+ axis2_env_t **env);
axis2_status_t AXIS2_CALL
-axis2_woden_imported_schema_set_location(void *schema,
- axis2_env_t **env,
- axis2_url_t *location);
+axis2_woden_imported_schema_set_location(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *location);
axis2_url_t *AXIS2_CALL
-axis2_woden_imported_schema_get_location(void *schema,
- axis2_env_t **env);
+axis2_woden_imported_schema_get_location(
+ void *schema,
+ axis2_env_t **env);
+axis2_status_t AXIS2_CALL
+axis2_woden_imported_schema_set_namespace(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
+
+axis2_url_t *AXIS2_CALL
+axis2_woden_imported_schema_get_namespace(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_imported_schema_set_schema_def(
+ void *schema,
+ axis2_env_t **env,
+ axis2_xml_schema_t *schema_def);
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_woden_imported_schema_get_schema_def(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_imported_schema_set_referenceable(
+ void *schema,
+ axis2_env_t **env,
+ axis2_bool_t referenceable);
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_imported_schema_is_referenceable(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_woden_imported_schema_get_namespace_as_string(
+ void *schema,
+ axis2_env_t **env);
+
+
+static axis2_woden_imported_schema_t *
+create(axis2_env_t **env);
+
+/************************Woden C Internal Methods******************************/
AXIS2_DECLARE(axis2_woden_imported_schema_t *)
-axis2_woden_imported_schema_create(axis2_env_t **env)
+axis2_woden_imported_schema_to_schema(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(!schema)
+ {
+ schema_impl = (axis2_woden_imported_schema_impl_t *) create(env);
+ }
+ else
+ schema_impl = (axis2_woden_imported_schema_impl_t *) schema;
+ schema_impl->imported_schema.schema.ops =
+ AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_schema_ops_t));
+ axis2_woden_schema_resolve_methods(&(schema_impl->imported_schema.schema),
+ env, schema_impl->methods);
+
+ return schema;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_imported_schema_to_schema_free(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->imported_schema.schema.ops)
+ {
+ AXIS2_FREE((*env)->allocator, schema_impl->imported_schema.schema.ops);
+ schema_impl->imported_schema.schema.ops = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+/************************End of Woden C Internal Methods***********************/
+
+static axis2_woden_imported_schema_t *
+create(
+ axis2_env_t **env)
{
axis2_woden_imported_schema_impl_t *schema_impl = NULL;
- axis2_status_t status = AXIS2_FAILURE;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
schema_impl = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_woden_imported_schema_impl_t));
schema_impl->schema = NULL;
+ schema_impl->obj_type = AXIS2_WODEN_IMPORTED_SCHEMA;
schema_impl->methods = NULL;
schema_impl->f_schema_location = NULL;
+
+ schema_impl->imported_schema.schema.ops = NULL;
+
schema_impl->imported_schema.ops =
AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_woden_imported_schema_ops_t));
schema_impl->imported_schema.ops->free =
axis2_woden_imported_schema_free;
+ schema_impl->imported_schema.ops->type =
+ axis2_woden_imported_schema_type;
schema_impl->imported_schema.ops->get_base_impl =
axis2_woden_imported_schema_get_base_impl;
schema_impl->imported_schema.ops->set_location =
@@ -86,22 +189,61 @@
}
axis2_hash_set(schema_impl->methods, "free",
AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_free);
+ axis2_hash_set(schema_impl->methods, "to_schema_free",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_to_schema_free);
+ axis2_hash_set(schema_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_type);
axis2_hash_set(schema_impl->methods, "set_location",
AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_set_location);
axis2_hash_set(schema_impl->methods, "get_location",
AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_get_location);
+ axis2_hash_set(schema_impl->methods, "set_namespace",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_set_namespace);
+ axis2_hash_set(schema_impl->methods, "get_namespace",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_get_namespace);
+ axis2_hash_set(schema_impl->methods, "set_schema_def",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_set_schema_def);
+ axis2_hash_set(schema_impl->methods, "get_schema_def",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_get_schema_def);
+ axis2_hash_set(schema_impl->methods, "set_referenceable",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_set_referenceable);
+ axis2_hash_set(schema_impl->methods, "is_referencealbe",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_is_referenceable);
+ axis2_hash_set(schema_impl->methods, "get_namespace_as_string",
+ AXIS2_HASH_KEY_STRING, axis2_woden_imported_schema_get_namespace_as_string);
+
+ return &(schema_impl->imported_schema);
+}
+AXIS2_DECLARE(axis2_woden_imported_schema_t *)
+axis2_woden_imported_schema_create(
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = (axis2_woden_imported_schema_impl_t *) create(env);
schema_impl->schema = axis2_woden_schema_create(env);
- status = axis2_woden_schema_resolve_methods(&(schema_impl->
- imported_schema.base), env, schema_impl->
- schema, schema_impl->methods);
- if(AXIS2_SUCCESS != status) return NULL;
return &(schema_impl->imported_schema);
}
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_imported_schema_type(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->obj_type;
+}
+
axis2_status_t AXIS2_CALL
-axis2_woden_imported_schema_free(void *schema,
- axis2_env_t **env)
+axis2_woden_imported_schema_free(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_imported_schema_impl_t *schema_impl = NULL;
@@ -126,6 +268,12 @@
schema_impl->schema = NULL;
}
+ if(schema_impl->imported_schema.schema.ops)
+ {
+ AXIS2_FREE((*env)->allocator, schema_impl->imported_schema.schema.ops);
+ schema_impl->imported_schema.schema.ops = NULL;
+ }
+
if((&(schema_impl->imported_schema))->ops)
{
AXIS2_FREE((*env)->allocator, (&(schema_impl->imported_schema))->ops);
@@ -141,8 +289,9 @@
}
axis2_woden_schema_t *AXIS2_CALL
-axis2_woden_imported_schema_get_base_impl(void *schema,
- axis2_env_t **env)
+axis2_woden_imported_schema_get_base_impl(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_imported_schema_impl_t *schema_impl = NULL;
@@ -154,49 +303,52 @@
axis2_status_t AXIS2_CALL
axis2_woden_imported_schema_resolve_methods(
- axis2_woden_imported_schema_t *schema,
- axis2_env_t **env,
- axis2_woden_imported_schema_t *schema_impl,
- axis2_hash_t *methods)
+ axis2_woden_imported_schema_t *schema,
+ axis2_env_t **env,
+ axis2_hash_t *methods)
{
- axis2_woden_imported_schema_impl_t *schema_impl_l = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, schema_impl, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
- schema_impl_l = (axis2_woden_imported_schema_impl_t *) schema_impl;
-
- schema->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_woden_imported_schema_ops_t));
schema->ops->free =
axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
- schema->ops->get_base_impl =
- schema_impl_l->imported_schema.ops->get_base_impl;
- schema->ops->set_location = schema_impl_l->imported_schema.ops->set_location;
- schema->ops->get_location = schema_impl_l->imported_schema.ops->get_location;
+ schema->ops->to_imported_schema_free =
+ axis2_hash_get(methods, "to_imported_schema_free",
+ AXIS2_HASH_KEY_STRING);
+ schema->ops->type =
+ axis2_hash_get(methods, "type", AXIS2_HASH_KEY_STRING);
+ schema->ops->set_location = axis2_hash_get(methods, "set_location",
+ AXIS2_HASH_KEY_STRING);
+ schema->ops->get_location = axis2_hash_get(methods, "get_location",
+ AXIS2_HASH_KEY_STRING);;
- return axis2_wsdl_ext_resolve_methods(&(schema->base),
- env, schema_impl_l->schema, methods);
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
-axis2_woden_imported_schema_set_location(void *schema,
- axis2_env_t **env,
- axis2_url_t *location)
+axis2_woden_imported_schema_set_location(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *location)
{
axis2_woden_imported_schema_impl_t *schema_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
schema_impl = INTF_TO_IMPL(schema);
+ if(schema_impl->f_schema_location)
+ {
+ AXIS2_URL_FREE(schema_impl->f_schema_location, env);
+ schema_impl->f_schema_location = NULL;
+ }
schema_impl->f_schema_location = location;
return AXIS2_SUCCESS;
}
axis2_url_t *AXIS2_CALL
-axis2_woden_imported_schema_get_location(void *schema,
- axis2_env_t **env)
+axis2_woden_imported_schema_get_location(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_imported_schema_impl_t *schema_impl = NULL;
@@ -204,5 +356,103 @@
schema_impl = INTF_TO_IMPL(schema);
return schema_impl->f_schema_location;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_imported_schema_set_namespace(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *namespc)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, namespc, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_SET_NAMESPACE(schema_impl->schema, env, namespc);
+}
+
+axis2_url_t *AXIS2_CALL
+axis2_woden_imported_schema_get_namespace(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_GET_NAMESPACE(schema_impl->schema, env);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_imported_schema_set_schema_def(
+ void *schema,
+ axis2_env_t **env,
+ axis2_xml_schema_t *schema_def)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, schema_def, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_SET_SCHEMA_DEF(schema_impl->schema, env,
+ schema_def);
+}
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_woden_imported_schema_get_schema_def(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_GET_SCHEMA_DEF(schema_impl->schema, env);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_imported_schema_set_referenceable(
+ void *schema,
+ axis2_env_t **env,
+ axis2_bool_t referenceable)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_SET_REFERENCEABLE(schema_impl->schema, env,
+ referenceable);
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_imported_schema_is_referenceable(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_IS_REFERENCEABLE(schema_impl->schema, env);
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_woden_imported_schema_get_namespace_as_string(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_GET_NAMESPACE_AS_STRING(schema_impl->schema, env);
}
Modified: webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/inlined_schema.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/inlined_schema.c?rev=404947&r1=404946&r2=404947&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/inlined_schema.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/inlined_schema.c Mon May 8 00:21:09 2006
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-#include <woden/axis2_woden_inlined_schema.h>
+#include <woden/schema/axis2_woden_inlined_schema.h>
+#include <xml_schema/axis2_xml_schema.h>
+#include <axis2_url.h>
typedef struct axis2_woden_inlined_schema_impl axis2_woden_inlined_schema_impl_t;
@@ -26,49 +28,151 @@
{
axis2_woden_inlined_schema_t inlined_schema;
axis2_woden_schema_t *schema;
+ axis2_woden_obj_types_t obj_type;
axis2_hash_t *methods;
- axis2_char_t *f_id;
+ axis2_char_t *f_schema_id;
};
#define INTF_TO_IMPL(schema) \
((axis2_woden_inlined_schema_impl_t *) schema)
axis2_status_t AXIS2_CALL
-axis2_woden_inlined_schema_free(void *schema,
- axis2_env_t **env);
+axis2_woden_inlined_schema_free(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_inlined_schema_type(
+ void *schema,
+ axis2_env_t **env);
axis2_woden_schema_t *AXIS2_CALL
-axis2_woden_inlined_schema_get_base_impl(void *schema,
- axis2_env_t **env);
+axis2_woden_inlined_schema_get_base_impl(
+ void *schema,
+ axis2_env_t **env);
axis2_status_t AXIS2_CALL
-axis2_woden_inlined_schema_set_id(void *schema,
- axis2_env_t **env,
- axis2_char_t *id);
+axis2_woden_inlined_schema_set_id(
+ void *schema,
+ axis2_env_t **env,
+ axis2_char_t *id);
axis2_char_t *AXIS2_CALL
-axis2_woden_inlined_schema_get_id(void *schema,
- axis2_env_t **env);
+axis2_woden_inlined_schema_get_id(
+ void *schema,
+ axis2_env_t **env);
+axis2_status_t AXIS2_CALL
+axis2_woden_inlined_schema_set_namespace(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
+
+axis2_url_t *AXIS2_CALL
+axis2_woden_inlined_schema_get_namespace(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_inlined_schema_set_schema_def(
+ void *schema,
+ axis2_env_t **env,
+ axis2_xml_schema_t *schema_def);
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_woden_inlined_schema_get_schema_def(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_inlined_schema_set_referenceable(
+ void *schema,
+ axis2_env_t **env,
+ axis2_bool_t referenceable);
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_inlined_schema_is_referenceable(
+ void *schema,
+ axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_woden_inlined_schema_get_namespace_as_string(
+ void *schema,
+ axis2_env_t **env);
+
+
+static axis2_woden_inlined_schema_t *
+create(axis2_env_t **env);
+
+/************************Woden C Internal Methods******************************/
AXIS2_DECLARE(axis2_woden_inlined_schema_t *)
-axis2_woden_inlined_schema_create(axis2_env_t **env)
+axis2_woden_inlined_schema_to_schema(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(!schema)
+ {
+ schema_impl = (axis2_woden_inlined_schema_impl_t *) create(env);
+ }
+ else
+ schema_impl = (axis2_woden_inlined_schema_impl_t *) schema;
+ schema_impl->inlined_schema.schema.ops =
+ AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_schema_ops_t));
+ axis2_woden_schema_resolve_methods(&(schema_impl->inlined_schema.schema),
+ env, schema_impl->methods);
+
+ return schema;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_inlined_schema_to_schema_free(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->inlined_schema.schema.ops)
+ {
+ AXIS2_FREE((*env)->allocator, schema_impl->inlined_schema.schema.ops);
+ schema_impl->inlined_schema.schema.ops = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+/************************End of Woden C Internal Methods***********************/
+
+static axis2_woden_inlined_schema_t *
+create(
+ axis2_env_t **env)
{
axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
- axis2_status_t status = AXIS2_FAILURE;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
schema_impl = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_woden_inlined_schema_impl_t));
schema_impl->schema = NULL;
+ schema_impl->obj_type = AXIS2_WODEN_INLINED_SCHEMA;
schema_impl->methods = NULL;
- schema_impl->f_id = NULL;
+ schema_impl->f_schema_id = NULL;
+
+ schema_impl->inlined_schema.schema.ops = NULL;
+
schema_impl->inlined_schema.ops =
AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_woden_inlined_schema_ops_t));
schema_impl->inlined_schema.ops->free =
axis2_woden_inlined_schema_free;
+ schema_impl->inlined_schema.ops->type =
+ axis2_woden_inlined_schema_type;
schema_impl->inlined_schema.ops->get_base_impl =
axis2_woden_inlined_schema_get_base_impl;
schema_impl->inlined_schema.ops->set_id =
@@ -85,32 +189,71 @@
}
axis2_hash_set(schema_impl->methods, "free",
AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_free);
+ axis2_hash_set(schema_impl->methods, "to_schema_free",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_to_schema_free);
+ axis2_hash_set(schema_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_type);
axis2_hash_set(schema_impl->methods, "set_id",
AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_set_id);
axis2_hash_set(schema_impl->methods, "get_id",
AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_get_id);
+ axis2_hash_set(schema_impl->methods, "set_namespace",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_set_namespace);
+ axis2_hash_set(schema_impl->methods, "get_namespace",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_get_namespace);
+ axis2_hash_set(schema_impl->methods, "set_schema_def",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_set_schema_def);
+ axis2_hash_set(schema_impl->methods, "get_schema_def",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_get_schema_def);
+ axis2_hash_set(schema_impl->methods, "set_referenceable",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_set_referenceable);
+ axis2_hash_set(schema_impl->methods, "is_referencealbe",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_is_referenceable);
+ axis2_hash_set(schema_impl->methods, "get_namespace_as_string",
+ AXIS2_HASH_KEY_STRING, axis2_woden_inlined_schema_get_namespace_as_string);
+
+ return &(schema_impl->inlined_schema);
+}
+AXIS2_DECLARE(axis2_woden_inlined_schema_t *)
+axis2_woden_inlined_schema_create(
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = (axis2_woden_inlined_schema_impl_t *) create(env);
schema_impl->schema = axis2_woden_schema_create(env);
- status = axis2_woden_schema_resolve_methods(&(schema_impl->
- inlined_schema.base), env, schema_impl->
- schema, schema_impl->methods);
- if(AXIS2_SUCCESS != status) return NULL;
return &(schema_impl->inlined_schema);
}
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_inlined_schema_type(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->obj_type;
+}
+
axis2_status_t AXIS2_CALL
-axis2_woden_inlined_schema_free(void *schema,
- axis2_env_t **env)
+axis2_woden_inlined_schema_free(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
schema_impl = INTF_TO_IMPL(schema);
- if(schema_impl->f_id)
+ if(schema_impl->f_schema_id)
{
- AXIS2_URL_FREE(schema_impl->f_id, env);
- schema_impl->f_id = NULL;
+ AXIS2_FREE((*env)->allocator, schema_impl->f_schema_id);
+ schema_impl->f_schema_id = NULL;
}
if(schema_impl->methods)
@@ -125,6 +268,12 @@
schema_impl->schema = NULL;
}
+ if(schema_impl->inlined_schema.schema.ops)
+ {
+ AXIS2_FREE((*env)->allocator, schema_impl->inlined_schema.schema.ops);
+ schema_impl->inlined_schema.schema.ops = NULL;
+ }
+
if((&(schema_impl->inlined_schema))->ops)
{
AXIS2_FREE((*env)->allocator, (&(schema_impl->inlined_schema))->ops);
@@ -140,8 +289,9 @@
}
axis2_woden_schema_t *AXIS2_CALL
-axis2_woden_inlined_schema_get_base_impl(void *schema,
- axis2_env_t **env)
+axis2_woden_inlined_schema_get_base_impl(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
@@ -153,55 +303,156 @@
axis2_status_t AXIS2_CALL
axis2_woden_inlined_schema_resolve_methods(
- axis2_woden_inlined_schema_t *schema,
- axis2_env_t **env,
- axis2_woden_inlined_schema_t *schema_impl,
- axis2_hash_t *methods)
+ axis2_woden_inlined_schema_t *schema,
+ axis2_env_t **env,
+ axis2_hash_t *methods)
{
- axis2_woden_inlined_schema_impl_t *schema_impl_l = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, schema_impl, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
- schema_impl_l = (axis2_woden_inlined_schema_impl_t *) schema_impl;
-
- schema->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_woden_inlined_schema_ops_t));
schema->ops->free =
axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
- schema->ops->get_base_impl =
- schema_impl_l->inlined_schema.ops->get_base_impl;
- schema->ops->set_id = schema_impl_l->inlined_schema.ops->set_id;
- schema->ops->get_id = schema_impl_l->inlined_schema.ops->get_id;
+ schema->ops->to_inlined_schema_free =
+ axis2_hash_get(methods, "to_inlined_schema_free",
+ AXIS2_HASH_KEY_STRING);
+ schema->ops->type =
+ axis2_hash_get(methods, "type", AXIS2_HASH_KEY_STRING);
+ schema->ops->set_id = axis2_hash_get(methods, "set_id",
+ AXIS2_HASH_KEY_STRING);
+ schema->ops->get_id = axis2_hash_get(methods, "get_id",
+ AXIS2_HASH_KEY_STRING);;
- return axis2_wsdl_ext_resolve_methods(&(schema->base),
- env, schema_impl_l->schema, methods);
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
-axis2_woden_inlined_schema_set_id(void *schema,
- axis2_env_t **env,
- axis2_char_t *id)
+axis2_woden_inlined_schema_set_id(
+ void *schema,
+ axis2_env_t **env,
+ axis2_char_t *id)
{
axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
schema_impl = INTF_TO_IMPL(schema);
- schema_impl->f_id = id;
+ if(schema_impl->f_schema_id)
+ {
+ AXIS2_FREE((*env)->allocator, schema_impl->f_schema_id);
+ schema_impl->f_schema_id = NULL;
+ }
+ schema_impl->f_schema_id = AXIS2_STRDUP(id, env);
return AXIS2_SUCCESS;
}
axis2_char_t *AXIS2_CALL
-axis2_woden_inlined_schema_get_id(void *schema,
- axis2_env_t **env)
+axis2_woden_inlined_schema_get_id(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->f_schema_id;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_inlined_schema_set_namespace(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *namespc)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, namespc, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_SET_NAMESPACE(schema_impl->schema, env, namespc);
+}
+
+axis2_url_t *AXIS2_CALL
+axis2_woden_inlined_schema_get_namespace(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_GET_NAMESPACE(schema_impl->schema, env);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_inlined_schema_set_schema_def(
+ void *schema,
+ axis2_env_t **env,
+ axis2_xml_schema_t *schema_def)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, schema_def, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_SET_SCHEMA_DEF(schema_impl->schema, env,
+ schema_def);
+}
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_woden_inlined_schema_get_schema_def(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_GET_SCHEMA_DEF(schema_impl->schema, env);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_inlined_schema_set_referenceable(
+ void *schema,
+ axis2_env_t **env,
+ axis2_bool_t referenceable)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_SET_REFERENCEABLE(schema_impl->schema, env,
+ referenceable);
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_inlined_schema_is_referenceable(
+ void *schema,
+ axis2_env_t **env)
+{
+ axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return AXIS2_WODEN_SCHEMA_IS_REFERENCEABLE(schema_impl->schema, env);
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_woden_inlined_schema_get_namespace_as_string(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_inlined_schema_impl_t *schema_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
schema_impl = INTF_TO_IMPL(schema);
- return schema_impl->f_id;
+ return AXIS2_WODEN_SCHEMA_GET_NAMESPACE_AS_STRING(schema_impl->schema, env);
}
Modified: webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/schema.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/schema.c?rev=404947&r1=404946&r2=404947&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/schema.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/schema/schema.c Mon May 8 00:21:09 2006
@@ -14,10 +14,8 @@
* limitations under the License.
*/
-#include <woden/axis2_woden_schema.h>
+#include <woden/schema/axis2_woden_schema.h>
#include <xml_schema/axis2_xml_schema.h>
-#include <axis2_url.h>
-#include <axis2_hash.h>
typedef struct axis2_woden_schema_impl axis2_woden_schema_impl_t;
@@ -36,41 +34,51 @@
#define INTF_TO_IMPL(schema) ((axis2_woden_schema_impl_t *) schema)
axis2_status_t AXIS2_CALL
-axis2_woden_schema_free(void *schema,
- axis2_env_t **envv);
+axis2_woden_schema_free(
+ void *schema,
+ axis2_env_t **envv);
axis2_status_t AXIS2_CALL
-axis2_woden_schema_set_namespace(void *schema,
- axis2_env_t **env,
- axis2_url_t *namespc);
+axis2_woden_schema_set_namespace(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
axis2_url_t *AXIS2_CALL
-axis2_woden_schema_get_namespace(void *schema,
- axis2_env_t **env);
+axis2_woden_schema_get_namespace(
+ void *schema,
+ axis2_env_t **env);
axis2_status_t AXIS2_CALL
-axis2_woden_schema_set_schema_def(void *schema,
- axis2_env_t **env,
- axis2_xml_schema_t *schema_def);
+axis2_woden_schema_set_schema_def(
+ void *schema,
+ axis2_env_t **env,
+ axis2_xml_schema_t *schema_def);
axis2_xml_schema_t *AXIS2_CALL
-axis2_woden_schema_get_schema_def(void *schema,
- axis2_env_t **env);
+axis2_woden_schema_get_schema_def(
+ void *schema,
+ axis2_env_t **env);
+
axis2_status_t AXIS2_CALL
-axis2_woden_schema_set_referenceable(void *schema,
- axis2_env_t **env,
- axis2_bool_t referenceable);
+axis2_woden_schema_set_referenceable(
+ void *schema,
+ axis2_env_t **env,
+ axis2_bool_t referenceable);
axis2_bool_t AXIS2_CALL
-axis2_woden_schema_is_referenceable(void *schema,
- axis2_env_t **env);
+axis2_woden_schema_is_referenceable(
+ void *schema,
+ axis2_env_t **env);
axis2_char_t *AXIS2_CALL
-axis2_woden_schema_get_namespace_as_string(void *schema,
- axis2_env_t **env);
+axis2_woden_schema_get_namespace_as_string(
+ void *schema,
+ axis2_env_t **env);
AXIS2_DECLARE(axis2_woden_schema_t *)
-axis2_woden_schema_create(axis2_env_t **env)
+axis2_woden_schema_create(
+ axis2_env_t **env)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
@@ -101,8 +109,9 @@
}
axis2_status_t AXIS2_CALL
-axis2_woden_schema_free(void *schema,
- axis2_env_t **env)
+axis2_woden_schema_free(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
@@ -136,38 +145,38 @@
}
axis2_status_t AXIS2_CALL
-axis2_woden_schema_resolve_methods(axis2_woden_schema_t *schema,
- axis2_env_t **env,
- axis2_woden_schema_t *schema_impl,
- axis2_hash_t *methods)
+axis2_woden_schema_resolve_methods(
+ axis2_woden_schema_t *schema,
+ axis2_env_t **env,
+ axis2_hash_t *methods)
{
- axis2_woden_schema_impl_t *schema_impl_l = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, schema_impl, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
- schema_impl_l = (axis2_woden_schema_impl_t *) schema_impl;
-
- schema->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_woden_schema_ops_t));
schema->ops->free = axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
- schema->ops->set_namespace = schema_impl_l->schema.ops->set_namespace;
- schema->ops->get_namespace = schema_impl_l->schema.ops->get_namespace;
- schema->ops->set_schema_def = schema_impl_l->schema.ops->set_schema_def;
- schema->ops->get_schema_def = schema_impl_l->schema.ops->get_schema_def;
- schema->ops->set_referenceable = schema_impl_l->schema.ops->set_referenceable;
- schema->ops->is_referenceable = schema_impl_l->schema.ops->is_referenceable;
- schema->ops->get_namespace_as_string =
- schema_impl_l->schema.ops->get_namespace_as_string;
+ schema->ops->set_namespace = axis2_hash_get(methods, "set_namespace",
+ AXIS2_HASH_KEY_STRING);
+ schema->ops->get_namespace = axis2_hash_get(methods,
+ "get_namespace", AXIS2_HASH_KEY_STRING);
+ schema->ops->set_schema_def = axis2_hash_get(methods,
+ "set_schema_def", AXIS2_HASH_KEY_STRING);
+ schema->ops->get_schema_def = axis2_hash_get(methods,
+ "get_schema_def", AXIS2_HASH_KEY_STRING);
+ schema->ops->set_referenceable = axis2_hash_get(methods,
+ "set_referenceable", AXIS2_HASH_KEY_STRING);
+ schema->ops->is_referenceable = axis2_hash_get(methods,
+ "is_referenceable", AXIS2_HASH_KEY_STRING);
+ schema->ops->get_namespace_as_string = axis2_hash_get(methods,
+ "get_namespace_as_string", AXIS2_HASH_KEY_STRING);
return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
-axis2_woden_schema_set_namespace(void *schema,
- axis2_env_t **env,
- axis2_url_t *namespc)
+axis2_woden_schema_set_namespace(
+ void *schema,
+ axis2_env_t **env,
+ axis2_url_t *namespc)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
@@ -175,14 +184,20 @@
AXIS2_PARAM_CHECK((*env)->error, namespc, AXIS2_FAILURE);
schema_impl = INTF_TO_IMPL(schema);
+ if(schema_impl->f_namespc)
+ {
+ AXIS2_URL_FREE(schema_impl->f_namespc, env);
+ schema_impl->f_namespc = NULL;
+ }
schema_impl->f_namespc = namespc;
return AXIS2_SUCCESS;
}
axis2_url_t *AXIS2_CALL
-axis2_woden_schema_get_namespace(void *schema,
- axis2_env_t **env)
+axis2_woden_schema_get_namespace(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
@@ -193,24 +208,31 @@
}
axis2_status_t AXIS2_CALL
-axis2_woden_schema_set_schema_def(void *schema,
- axis2_env_t **env,
- axis2_xml_schema_t *schema_def)
+axis2_woden_schema_set_schema_def(
+ void *schema,
+ axis2_env_t **env,
+ axis2_xml_schema_t *schema_def)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, schema_def, AXIS2_FAILURE);
schema_impl = INTF_TO_IMPL(schema);
-
+
+ if(schema_impl->f_schema_def)
+ {
+ AXIS2_XML_SCHEMA_FREE(schema_impl->f_schema_def, env);
+ schema_impl->f_schema_def = NULL;
+ }
schema_impl->f_schema_def = schema_def;
return AXIS2_SUCCESS;
}
axis2_xml_schema_t *AXIS2_CALL
-axis2_woden_schema_get_schema_def(void *schema,
- axis2_env_t **env)
+axis2_woden_schema_get_schema_def(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
@@ -221,9 +243,10 @@
}
axis2_status_t AXIS2_CALL
-axis2_woden_schema_set_referenceable(void *schema,
- axis2_env_t **env,
- axis2_bool_t referenceable)
+axis2_woden_schema_set_referenceable(
+ void *schema,
+ axis2_env_t **env,
+ axis2_bool_t referenceable)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
@@ -236,8 +259,9 @@
}
axis2_bool_t AXIS2_CALL
-axis2_woden_schema_is_referenceable(void *schema,
- axis2_env_t **env)
+axis2_woden_schema_is_referenceable(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
@@ -248,8 +272,9 @@
}
axis2_char_t *AXIS2_CALL
-axis2_woden_schema_get_namespace_as_string(void *schema,
- axis2_env_t **env)
+axis2_woden_schema_get_namespace_as_string(
+ void *schema,
+ axis2_env_t **env)
{
axis2_woden_schema_impl_t *schema_impl = NULL;
Modified: webservices/axis2/trunk/c/modules/wsdl/woden/src/util/om_util.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/util/om_util.c?rev=404947&r1=404946&r2=404947&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/util/om_util.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/util/om_util.c Mon May 8 00:21:09 2006
@@ -926,4 +926,5 @@
return AXIS2_OM_NAMESPACE_GET_URI(om_ns, env);
}
return NULL;
-}
\ No newline at end of file
+}
+
Modified: webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/Makefile.am?rev=404947&r1=404946&r2=404947&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/Makefile.am Mon May 8 00:21:09 2006
@@ -1,9 +1,15 @@
-SUBDIRS = extensions
+SUBDIRS = extensions xml
noinst_LTLIBRARIES = libaxis2_woden_wsdl20.la
libaxis2_woden_wsdl20_la_SOURCES = \
wsdl_element.c \
- wsdl_obj.c
+ wsdl_obj.c \
+ documentable.c \
+ documentation.c \
+ wsdl_component.c \
+ nested_component.c \
+ feature.c \
+ types.c
-INCLUDES = -I$(top_builddir)/include/woden \
+INCLUDES = -I$(top_builddir)/include \
-I$(AXIS2C_HOME)/include
Added: webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentable.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentable.c?rev=404947&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentable.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentable.c Mon May 8 00:21:09 2006
@@ -0,0 +1,203 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <woden/wsdl20/axis2_woden_documentable.h>
+#include <woden/wsdl20/xml/axis2_woden_documentation_element.h>
+
+typedef struct axis2_woden_documentable_impl axis2_woden_documentable_impl_t;
+
+/**
+ * @brief Documentable Struct Impl
+ * Axis2 Documentable
+ */
+struct axis2_woden_documentable_impl
+{
+ axis2_woden_documentable_t documentable;
+ axis2_woden_wsdl_obj_t *wsdl_obj;
+ axis2_array_list_t *f_doc_elems;
+};
+
+#define INTF_TO_IMPL(documentable) ((axis2_woden_documentable_impl_t *) documentable)
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentable_free(
+ void *documentable,
+ axis2_env_t **env);
+
+axis2_woden_wsdl_obj_t *AXIS2_CALL
+axis2_woden_documentable_get_base_impl(
+ void *documentable,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentable_add_documentation_element(
+ void *documentable,
+ axis2_env_t **env,
+ axis2_woden_documentation_element_t *documentation);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentable_get_documentation_elements(
+ void *documentable,
+ axis2_env_t **env);
+
+static axis2_woden_documentable_t *
+create(
+ axis2_env_t **env)
+{
+ axis2_woden_documentable_impl_t *documentable_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentable_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_documentable_impl_t));
+
+ documentable_impl->f_doc_elems = NULL;
+
+ documentable_impl->documentable.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_documentable_ops_t));
+
+ documentable_impl->documentable.ops->free = axis2_woden_documentable_free;
+ documentable_impl->documentable.ops->get_base_impl = axis2_woden_documentable_get_base_impl;
+ documentable_impl->documentable.ops->add_documentation_element =
+ axis2_woden_documentable_add_documentation_element;
+ documentable_impl->documentable.ops->get_documentation_elements =
+ axis2_woden_documentable_get_documentation_elements;
+
+ return &(documentable_impl->documentable);
+}
+
+AXIS2_DECLARE(axis2_woden_documentable_t *)
+axis2_woden_documentable_create(
+ axis2_env_t **env)
+{
+ axis2_woden_documentable_impl_t *documentable_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentable_impl = (axis2_woden_documentable_impl_t *) create(env);
+
+ documentable_impl->wsdl_obj = axis2_woden_wsdl_obj_create(env);
+
+ return &(documentable_impl->documentable);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentable_free(
+ void *documentable,
+ axis2_env_t **env)
+{
+ axis2_woden_documentable_impl_t *documentable_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentable_impl = INTF_TO_IMPL(documentable);
+
+ if(documentable_impl->f_doc_elems)
+ {
+ AXIS2_ARRAY_LIST_FREE(documentable_impl->f_doc_elems, env);
+ documentable_impl->f_doc_elems = NULL;
+ }
+
+ if(documentable_impl->wsdl_obj)
+ {
+ AXIS2_WODEN_WSDL_OBJ_FREE(documentable_impl->wsdl_obj, env);
+ documentable_impl->wsdl_obj = NULL;
+ }
+
+ if(documentable_impl->documentable.ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentable_impl->documentable.ops);
+ documentable_impl->documentable.ops = NULL;
+ }
+
+ if(documentable_impl)
+ {
+ AXIS2_FREE((*env)->allocator, documentable_impl);
+ documentable_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_woden_wsdl_obj_t *AXIS2_CALL
+axis2_woden_documentable_get_base_impl(
+ void *documentable,
+ axis2_env_t **env)
+{
+ axis2_woden_documentable_impl_t *documentable_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ documentable_impl = INTF_TO_IMPL(documentable);
+
+ return documentable_impl->wsdl_obj;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentable_resolve_methods(
+ axis2_woden_documentable_t *documentable,
+ axis2_env_t **env,
+ axis2_hash_t *methods)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ documentable->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_documentable_ops_t));
+ documentable->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ documentable->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+ documentable->ops->add_documentation_element = axis2_hash_get(methods,
+ "add_documentation_element", AXIS2_HASH_KEY_STRING);
+ documentable->ops->get_documentation_elements = axis2_hash_get(methods,
+ "get_documentation_elements", AXIS2_HASH_KEY_STRING);
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentable_add_documentation_element(
+ void *documentable,
+ axis2_env_t **env,
+ axis2_woden_documentation_element_t *documentation)
+{
+ axis2_woden_documentable_impl_t *documentable_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, documentation, AXIS2_FAILURE);
+ documentable_impl = INTF_TO_IMPL(documentable);
+
+ if(!documentable_impl->f_doc_elems)
+ {
+ documentable_impl->f_doc_elems = axis2_array_list_create(env, 0);
+ if(!documentable_impl->f_doc_elems)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ }
+ return AXIS2_ARRAY_LIST_ADD(documentable_impl->f_doc_elems, env,
+ documentation);
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentable_get_documentation_elements(
+ void *documentable,
+ axis2_env_t **env)
+{
+ axis2_woden_documentable_impl_t *documentable_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentable_impl = INTF_TO_IMPL(documentable);
+
+ return documentable_impl->f_doc_elems;
+}
+
Added: webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentation.c?rev=404947&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentation.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/documentation.c Mon May 8 00:21:09 2006
@@ -0,0 +1,688 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <woden/wsdl20/axis2_woden_documentation.h>
+#include <woden/wsdl20/xml/axis2_woden_documentation_element.h>
+#include <woden/wsdl20/extensions/axis2_woden_ext_element.h>
+#include <woden/xml/axis2_woden_xml_attr.h>
+
+typedef struct axis2_woden_documentation_impl axis2_woden_documentation_impl_t;
+
+/**
+ * @brief Documentation Struct Impl
+ * Axis2 Documentation
+ */
+struct axis2_woden_documentation_impl
+{
+ axis2_woden_documentation_t documentation;
+ axis2_woden_obj_types_t obj_type;
+ axis2_woden_wsdl_element_t *wsdl_element;
+ axis2_hash_t *methods;
+ void *f_content;
+};
+
+#define INTF_TO_IMPL(documentation) ((axis2_woden_documentation_impl_t *) documentation)
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_free(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_documentation_type(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_woden_wsdl_element_t *AXIS2_CALL
+axis2_woden_documentation_get_base_impl(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_set_content(
+ void *documentation,
+ axis2_env_t **env,
+ void *doc_el);
+
+void *AXIS2_CALL
+axis2_woden_documentation_get_content(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_set_ext_attr(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type,
+ axis2_woden_xml_attr_t *attr);
+
+axis2_woden_xml_attr_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_attr(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_attrs(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_attrs_for_namespace(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_documentation_has_ext_attrs_for_namespace(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_add_ext_element(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_woden_ext_element_t *ext_el);
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_remove_ext_element(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_woden_ext_element_t *ext_el);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_elements(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_elements_of_type(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_qname_t *ext_type);
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_documentation_has_ext_elements_for_namespace(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
+
+static axis2_woden_documentation_t *
+create(axis2_env_t **env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_DECLARE(axis2_woden_documentation_t *)
+axis2_woden_documentation_to_documentation_element(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ if(!documentation)
+ {
+ documentation_impl = (axis2_woden_documentation_impl_t *) create(env);
+ }
+ else
+ documentation_impl = (axis2_woden_documentation_impl_t *) documentation;
+
+ documentation_impl->documentation.base.documentation_element.ops =
+ AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_documentation_element_ops_t));
+ axis2_woden_documentation_element_resolve_methods(&(documentation_impl->
+ documentation.base.documentation_element), env,
+ documentation_impl->methods);
+ return documentation;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_to_documentation_element_free(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ if(documentation_impl->documentation.base.documentation_element.ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.base.
+ documentation_element.ops);
+ documentation_impl->documentation.base.documentation_element.ops =
+ NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_DECLARE(axis2_woden_documentation_t *)
+axis2_woden_documentation_to_attr_extensible(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(!documentation)
+ {
+ documentation_impl = (axis2_woden_documentation_impl_t *) create(env);
+ }
+ else
+ documentation_impl = (axis2_woden_documentation_impl_t *) documentation;
+
+ documentation_impl->documentation.base.wsdl_element.base.attr_extensible.
+ ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_attr_extensible_ops_t));
+ axis2_woden_attr_extensible_resolve_methods(&(documentation_impl->
+ documentation.base.wsdl_element.base.attr_extensible), env,
+ documentation_impl->methods);
+ return documentation;
+
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_to_attr_extensible_free(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ if(documentation_impl->documentation.base.wsdl_element.base.attr_extensible.
+ ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.
+ base.wsdl_element.base.attr_extensible.ops);
+ documentation_impl->documentation.base.wsdl_element.base.
+ attr_extensible.ops = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_DECLARE(axis2_woden_documentation_t *)
+axis2_woden_documentation_to_element_extensible(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ if(!documentation)
+ {
+ documentation_impl = (axis2_woden_documentation_impl_t *) create(env);
+ }
+ else
+ documentation_impl = (axis2_woden_documentation_impl_t *) documentation;
+ documentation_impl->documentation.base.wsdl_element.base.
+ element_extensible.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_element_extensible_ops_t));
+ axis2_woden_element_extensible_resolve_methods(&(documentation_impl->
+ documentation.base.wsdl_element.base.element_extensible),
+ env, documentation_impl->methods);
+ return documentation;
+
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_to_element_extensible_free(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ if(documentation_impl->documentation.base.wsdl_element.base.
+ element_extensible.ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.base.
+ wsdl_element.base.element_extensible.ops);
+ documentation_impl->documentation.base.wsdl_element.base.
+ element_extensible.ops = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+/************************End of Woden C Internal Methods***********************/
+static axis2_woden_documentation_t *
+create(axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_documentation_impl_t));
+
+ documentation_impl->wsdl_element = NULL;
+ documentation_impl->obj_type = AXIS2_WODEN_DOCUMENTATION;
+ documentation_impl->f_content = NULL;
+ documentation_impl->methods = NULL;
+
+ documentation_impl->documentation.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_documentation_ops_t));
+
+ documentation_impl->documentation.ops->free = axis2_woden_documentation_free;
+ documentation_impl->documentation.ops->type = axis2_woden_documentation_type;
+ documentation_impl->documentation.ops->get_base_impl =
+ axis2_woden_documentation_get_base_impl;
+
+ documentation_impl->methods = axis2_hash_make(env);
+ if(!documentation_impl->methods)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(documentation_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_woden_documentation_free);
+ axis2_hash_set(documentation_impl->methods, "to_documentation_element_free",
+ AXIS2_HASH_KEY_STRING,
+ axis2_woden_documentation_to_documentation_element_free);
+ axis2_hash_set(documentation_impl->methods, "to_attr_extensible_free",
+ AXIS2_HASH_KEY_STRING,
+ axis2_woden_documentation_to_attr_extensible_free);
+ axis2_hash_set(documentation_impl->methods, "to_element_extensible_free",
+ AXIS2_HASH_KEY_STRING,
+ axis2_woden_documentation_to_element_extensible_free);
+ axis2_hash_set(documentation_impl->methods, "type", AXIS2_HASH_KEY_STRING,
+ axis2_woden_documentation_type);
+ axis2_hash_set(documentation_impl->methods, "set_content",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_set_content);
+ axis2_hash_set(documentation_impl->methods, "get_content",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_get_content);
+ axis2_hash_set(documentation_impl->methods, "set_ext_attr",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_set_ext_attr);
+ axis2_hash_set(documentation_impl->methods, "get_ext_attr",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_get_ext_attr);
+ axis2_hash_set(documentation_impl->methods, "get_ext_attrs",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_get_ext_attrs);
+ axis2_hash_set(documentation_impl->methods, "get_ext_attrs_for_namespace",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_get_ext_attrs_for_namespace);
+ axis2_hash_set(documentation_impl->methods, "has_ext_attrs_for_namespace",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_has_ext_attrs_for_namespace);
+ axis2_hash_set(documentation_impl->methods, "add_ext_element",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_add_ext_element);
+ axis2_hash_set(documentation_impl->methods, "remove_ext_element",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_remove_ext_element);
+ axis2_hash_set(documentation_impl->methods, "get_ext_elements",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_get_ext_elements);
+ axis2_hash_set(documentation_impl->methods, "get_ext_elements_of_type",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_get_ext_elements_of_type);
+ axis2_hash_set(documentation_impl->methods, "has_ext_elements_for_namespace",
+ AXIS2_HASH_KEY_STRING, axis2_woden_documentation_has_ext_elements_for_namespace);
+
+ return &(documentation_impl->documentation);
+}
+
+AXIS2_DECLARE(axis2_woden_documentation_t *)
+axis2_woden_documentation_create(axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = (axis2_woden_documentation_impl_t *) create(env);
+
+ documentation_impl->wsdl_element = axis2_woden_wsdl_element_create(env);
+
+ return &(documentation_impl->documentation);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_free(void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ if(documentation_impl->f_content)
+ {
+ /*AXIS2_FREE(documentation_impl->f_content, env);*/
+ documentation_impl->f_content = NULL;
+ }
+
+ if(documentation_impl->methods)
+ {
+ axis2_hash_free(documentation_impl->methods, env);
+ documentation_impl->methods = NULL;
+ }
+
+ if(documentation_impl->wsdl_element)
+ {
+ AXIS2_WODEN_WSDL_OBJ_FREE(documentation_impl->wsdl_element, env);
+ documentation_impl->wsdl_element = NULL;
+ }
+
+ if(documentation_impl->documentation.base.documentation_element.ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.base.
+ documentation_element.ops);
+ documentation_impl->documentation.base.documentation_element.ops =
+ NULL;
+ }
+
+ if(documentation_impl->documentation.base.wsdl_element.base.attr_extensible.
+ ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.
+ base.wsdl_element.base.attr_extensible.ops);
+ documentation_impl->documentation.base.wsdl_element.base.
+ attr_extensible.ops = NULL;
+ }
+
+ if(documentation_impl->documentation.base.wsdl_element.base.
+ element_extensible.ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.base.
+ wsdl_element.base.element_extensible.ops);
+ documentation_impl->documentation.base.wsdl_element.base.
+ element_extensible.ops = NULL;
+ }
+
+ if((&(documentation_impl->documentation))->ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.ops);
+ (&(documentation_impl->documentation))->ops = NULL;
+ }
+
+ if(documentation_impl)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl);
+ documentation_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_documentation_type(void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ return documentation_impl->obj_type;
+}
+
+axis2_woden_wsdl_element_t *AXIS2_CALL
+axis2_woden_documentation_get_base_impl(void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ return documentation_impl->wsdl_element;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_resolve_methods(
+ axis2_woden_documentation_t *documentation,
+ axis2_env_t **env,
+ axis2_hash_t *methods)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ documentation->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_woden_documentation_ops_t));
+ documentation->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ documentation->ops->to_documentation_free = axis2_hash_get(methods,
+ "to_documentation_free", AXIS2_HASH_KEY_STRING);
+ documentation->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_set_ext_attr(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type,
+ axis2_woden_xml_attr_t *attr)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *attr_ext = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ attr_ext = axis2_woden_wsdl_element_to_attr_extensible(
+ documentation_impl->wsdl_element, env);
+ status = AXIS2_WODEN_ATTR_EXTENSIBLE_SET_EXT_ATTR(attr_ext, env, attr_type,
+ attr);
+ AXIS2_WODEN_ATTR_EXTENSIBLE_TO_ATTR_EXTENSIBLE_FREE(attr_ext, env);
+ return status;
+}
+
+axis2_woden_xml_attr_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_attr(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *attr_ext = NULL;
+ void *ret = NULL;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ attr_ext = axis2_woden_wsdl_element_to_attr_extensible(
+ documentation_impl->wsdl_element, env);
+ ret = AXIS2_WODEN_ATTR_EXTENSIBLE_GET_EXT_ATTR(attr_ext, env, attr_type);
+ AXIS2_WODEN_ATTR_EXTENSIBLE_TO_ATTR_EXTENSIBLE_FREE(attr_ext, env);
+ return ret;
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_attrs(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *attr_ext = NULL;
+ void *ret = NULL;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ attr_ext = axis2_woden_wsdl_element_to_attr_extensible(
+ documentation_impl->wsdl_element, env);
+ ret = AXIS2_WODEN_ATTR_EXTENSIBLE_GET_EXT_ATTRS(attr_ext, env);
+ AXIS2_WODEN_ATTR_EXTENSIBLE_TO_ATTR_EXTENSIBLE_FREE(attr_ext, env);
+ return ret;
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_attrs_for_namespace(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_url_t *namespc)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *attr_ext = NULL;
+ void *ret = NULL;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ attr_ext = axis2_woden_wsdl_element_to_attr_extensible(
+ documentation_impl->wsdl_element, env);
+ ret = AXIS2_WODEN_ATTR_EXTENSIBLE_GET_EXT_ATTRS_FOR_NAMESPACE(
+ attr_ext, env, namespc);
+ AXIS2_WODEN_ATTR_EXTENSIBLE_TO_ATTR_EXTENSIBLE_FREE(attr_ext, env);
+ return ret;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_documentation_has_ext_attrs_for_namespace(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_url_t *namespc)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *attr_ext = NULL;
+ axis2_bool_t ret = AXIS2_FALSE;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ attr_ext = axis2_woden_wsdl_element_to_attr_extensible(
+ documentation_impl->wsdl_element, env);
+ ret = AXIS2_WODEN_ATTR_EXTENSIBLE_HAS_EXT_ATTRS_FOR_NAMESPACE(
+ attr_ext, env, namespc);
+ AXIS2_WODEN_ATTR_EXTENSIBLE_TO_ATTR_EXTENSIBLE_FREE(attr_ext, env);
+ return ret;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_add_ext_element(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_woden_ext_element_t *ext_el)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *element_ext = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ element_ext = axis2_woden_wsdl_element_to_element_extensible(
+ documentation_impl->wsdl_element, env);
+ status = AXIS2_WODEN_ELEMENT_EXTENSIBLE_ADD_EXT_ELEMENT(element_ext, env,
+ ext_el);
+ AXIS2_WODEN_ELEMENT_EXTENSIBLE_TO_ELEMENT_EXTENSIBLE_FREE(element_ext, env);
+ return status;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_remove_ext_element(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_woden_ext_element_t *ext_el)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *element_ext = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ element_ext = axis2_woden_wsdl_element_to_element_extensible(
+ documentation_impl->wsdl_element, env);
+ status = AXIS2_WODEN_ELEMENT_EXTENSIBLE_REMOVE_EXT_ELEMENT(element_ext, env,
+ ext_el);
+ AXIS2_WODEN_ELEMENT_EXTENSIBLE_TO_ELEMENT_EXTENSIBLE_FREE(element_ext, env);
+ return status;
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_elements(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *element_ext = NULL;
+ void *ret = NULL;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ element_ext = axis2_woden_wsdl_element_to_element_extensible(
+ documentation_impl->wsdl_element, env);
+ ret = AXIS2_WODEN_ELEMENT_EXTENSIBLE_GET_EXT_ELEMENTS(element_ext, env);
+ AXIS2_WODEN_ELEMENT_EXTENSIBLE_TO_ELEMENT_EXTENSIBLE_FREE(element_ext, env);
+ return ret;
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_woden_documentation_get_ext_elements_of_type(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_qname_t *ext_type)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *element_ext = NULL;
+ void *ret = NULL;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ element_ext = axis2_woden_wsdl_element_to_element_extensible(
+ documentation_impl->wsdl_element, env);
+ ret = AXIS2_WODEN_ELEMENT_EXTENSIBLE_GET_EXT_ELEMENTS_OF_TYPE(element_ext, env,
+ ext_type);
+ AXIS2_WODEN_ELEMENT_EXTENSIBLE_TO_ELEMENT_EXTENSIBLE_FREE(element_ext, env);
+ return ret;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_woden_documentation_has_ext_elements_for_namespace(
+ void *documentation,
+ axis2_env_t **env,
+ axis2_url_t *namespc)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ void *element_ext = NULL;
+ axis2_bool_t ret = AXIS2_FALSE;
+
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ element_ext = axis2_woden_wsdl_element_to_element_extensible(
+ documentation_impl->wsdl_element, env);
+ ret = AXIS2_WODEN_ELEMENT_EXTENSIBLE_HAS_EXT_ELEMENTS_FOR_NAMESPACE(
+ element_ext, env, namespc);
+ AXIS2_WODEN_ELEMENT_EXTENSIBLE_TO_ELEMENT_EXTENSIBLE_FREE(element_ext, env);
+ return ret;
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_woden_documentation_set_content(
+ void *documentation,
+ axis2_env_t **env,
+ void *doc_el)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, documentation, AXIS2_FAILURE);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ if(documentation_impl->f_content)
+ {
+ /* Free f_content */
+ }
+ documentation_impl->f_content = doc_el;
+ return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+axis2_woden_documentation_get_content(
+ void *documentation,
+ axis2_env_t **env)
+{
+ axis2_woden_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = INTF_TO_IMPL(documentation);
+
+ return documentation_impl->f_content;
+}
+
Modified: webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/Makefile.am?rev=404947&r1=404946&r2=404947&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/Makefile.am Mon May 8 00:21:09 2006
@@ -1,9 +1,9 @@
-lib_LTLIBRARIES = libaxis2_woden_extensions.la
+noinst_LTLIBRARIES = libaxis2_woden_extensions.la
libaxis2_woden_extensions_la_SOURCES = \
element_extensible.c \
attr_extensible.c \
component_exts.c
-INCLUDES = -I$(top_builddir)/include/woden \
+INCLUDES = -I$(top_builddir)/include \
-I$(AXIS2C_HOME)/include
Modified: webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/attr_extensible.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/attr_extensible.c?rev=404947&r1=404946&r2=404947&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/attr_extensible.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/woden/src/wsdl20/extensions/attr_extensible.c Mon May 8 00:21:09 2006
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#include <woden/axis2_woden_attr_extensible.h>
-#include <woden/axis2_woden_xml_attr.h>
+#include <woden/wsdl20/extensions/axis2_woden_attr_extensible.h>
+#include <woden/xml/axis2_woden_xml_attr.h>
#include <axis2_url.h>
#include <axis2_hash.h>
@@ -28,6 +28,7 @@
struct axis2_woden_attr_extensible_impl
{
axis2_woden_attr_extensible_t extensible;
+ axis2_woden_obj_types_t obj_type;
axis2_hash_t *f_ext_attrs;
axis2_array_list_t *temp_attrs;
};
@@ -36,41 +37,50 @@
((axis2_woden_attr_extensible_impl_t *) extensible)
axis2_status_t AXIS2_CALL
-axis2_woden_attr_extensible_free(void *extensible,
- axis2_env_t **envv);
+axis2_woden_attr_extensible_free(
+ void *extensible,
+ axis2_env_t **env);
+
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_attr_extensible_type(
+ void *extensible,
+ axis2_env_t **env);
axis2_status_t AXIS2_CALL
axis2_woden_attr_extensible_set_ext_attr(
- void *extensible,
- axis2_env_t **env,
- axis2_qname_t *attr_type,
- axis2_woden_xml_attr_t *attr);
+ void *extensible,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type,
+ axis2_woden_xml_attr_t *attr);
-axis2_woden_xml_attr_t *AXIS2_CALL
+void *AXIS2_CALL
axis2_woden_attr_extensible_get_ext_attr(
- void *extensible,
- axis2_env_t **env,
- axis2_qname_t *attr_type);
+ void *extensible,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type);
axis2_array_list_t *AXIS2_CALL
-axis2_woden_attr_extensible_get_ext_attrs(void *extensible,
- axis2_env_t **env);
+axis2_woden_attr_extensible_get_ext_attrs(
+ void *extensible,
+ axis2_env_t **env);
axis2_array_list_t *AXIS2_CALL
-axis2_woden_attr_extensible_get_ext_attrs_for_namespace(void *extensible,
- axis2_env_t **env,
- axis2_url_t *namespc);
+axis2_woden_attr_extensible_get_ext_attrs_for_namespace(
+ void *extensible,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
axis2_bool_t AXIS2_CALL
axis2_woden_attr_extensible_has_ext_attrs_for_namespace(
- void *extensible,
- axis2_env_t **env,
- axis2_url_t *namespc);
+ void *extensible,
+ axis2_env_t **env,
+ axis2_url_t *namespc);
AXIS2_DECLARE(axis2_woden_attr_extensible_t *)
-axis2_woden_attr_extensible_create(axis2_env_t **env)
+axis2_woden_attr_extensible_create(
+ axis2_env_t **env)
{
axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
@@ -78,6 +88,7 @@
extensible_impl = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_woden_attr_extensible_impl_t));
+ extensible_impl->obj_type = AXIS2_WODEN_ATTR_EXTENSIBLE;
extensible_impl->f_ext_attrs = NULL;
extensible_impl->temp_attrs = NULL;
@@ -87,6 +98,8 @@
extensible_impl->extensible.ops->free =
axis2_woden_attr_extensible_free;
+ extensible_impl->extensible.ops->type =
+ axis2_woden_attr_extensible_type;
extensible_impl->extensible.ops->set_ext_attr =
axis2_woden_attr_extensible_set_ext_attr;
extensible_impl->extensible.ops->get_ext_attr =
@@ -102,8 +115,9 @@
}
axis2_status_t AXIS2_CALL
-axis2_woden_attr_extensible_free(void *extensible,
- axis2_env_t **env)
+axis2_woden_attr_extensible_free(
+ void *extensible,
+ axis2_env_t **env)
{
axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
@@ -145,43 +159,54 @@
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
-axis2_woden_attr_extensible_resolve_methods(axis2_woden_attr_extensible_t *extensible,
- axis2_env_t **env,
- axis2_woden_attr_extensible_t *extensible_impl,
- axis2_hash_t *methods)
+axis2_woden_obj_types_t AXIS2_CALL
+axis2_woden_attr_extensible_type(
+ void *extensible,
+ axis2_env_t **env)
{
- axis2_woden_attr_extensible_impl_t *extensible_impl_l = NULL;
+ axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ extensible_impl = INTF_TO_IMPL(extensible);
+ return extensible_impl->obj_type;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_woden_attr_extensible_resolve_methods(
+ axis2_woden_attr_extensible_t *extensible,
+ axis2_env_t **env,
+ axis2_hash_t *methods)
+{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, extensible_impl, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
- extensible_impl_l = (axis2_woden_attr_extensible_impl_t *) extensible_impl;
-
- extensible->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_woden_attr_extensible_ops_t));
- extensible->ops->free = axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
- extensible->ops->set_ext_attr =
- extensible_impl_l->extensible.ops->set_ext_attr;
- extensible->ops->get_ext_attr =
- extensible_impl_l->extensible.ops->get_ext_attr;
- extensible->ops->get_ext_attrs =
- extensible_impl_l->extensible.ops->get_ext_attrs;
- extensible->ops->get_ext_attrs_for_namespace =
- extensible_impl_l->extensible.ops->get_ext_attrs_for_namespace;
- extensible->ops->has_ext_attrs_for_namespace =
- extensible_impl_l->extensible.ops->has_ext_attrs_for_namespace;
+ extensible->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ extensible->ops->to_attr_extensible_free = axis2_hash_get(methods,
+ "to_attr_extensible_free", AXIS2_HASH_KEY_STRING);
+ extensible->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+ extensible->ops->set_ext_attr = axis2_hash_get(methods,
+ "set_ext_attr", AXIS2_HASH_KEY_STRING);
+ extensible->ops->get_ext_attr = axis2_hash_get(methods,
+ "get_ext_attr", AXIS2_HASH_KEY_STRING);
+ extensible->ops->get_ext_attrs = axis2_hash_get(methods,
+ "get_ext_attrs", AXIS2_HASH_KEY_STRING);
+ extensible->ops->get_ext_attrs_for_namespace = axis2_hash_get(methods,
+ "get_ext_attrs_for_namespace", AXIS2_HASH_KEY_STRING);
+ extensible->ops->has_ext_attrs_for_namespace = axis2_hash_get(methods,
+ "has_ext_attrs_for_namespace", AXIS2_HASH_KEY_STRING);
return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_woden_attr_extensible_set_ext_attr(
- void *extensible,
- axis2_env_t **env,
- axis2_qname_t *attr_type,
- axis2_woden_xml_attr_t *attr)
+ void *extensible,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type,
+ axis2_woden_xml_attr_t *attr)
{
axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
axis2_char_t *str_attr_type = NULL;
@@ -200,10 +225,11 @@
return AXIS2_SUCCESS;
}
-axis2_woden_xml_attr_t *AXIS2_CALL
-axis2_woden_attr_extensible_get_ext_attr(void *extensible,
- axis2_env_t **env,
- axis2_qname_t *attr_type)
+void *AXIS2_CALL
+axis2_woden_attr_extensible_get_ext_attr(
+ void *extensible,
+ axis2_env_t **env,
+ axis2_qname_t *attr_type)
{
axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
axis2_char_t *str_attr_type = NULL;
@@ -218,8 +244,9 @@
}
axis2_array_list_t *AXIS2_CALL
-axis2_woden_attr_extensible_get_ext_attrs(void *extensible,
- axis2_env_t **env)
+axis2_woden_attr_extensible_get_ext_attrs(
+ void *extensible,
+ axis2_env_t **env)
{
axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
axis2_hash_index_t *index = NULL;
@@ -255,8 +282,8 @@
axis2_array_list_t *AXIS2_CALL
axis2_woden_attr_extensible_get_ext_attrs_for_namespace(void *extensible,
- axis2_env_t **env,
- axis2_url_t *namespc)
+ axis2_env_t **env,
+ axis2_url_t *namespc)
{
axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
axis2_char_t *str_namespc = NULL;
@@ -297,8 +324,8 @@
axis2_bool_t AXIS2_CALL
axis2_woden_attr_extensible_has_ext_attrs_for_namespace(void *extensible,
- axis2_env_t **env,
- axis2_url_t *namespc)
+ axis2_env_t **env,
+ axis2_url_t *namespc)
{
axis2_woden_attr_extensible_impl_t *extensible_impl = NULL;
axis2_bool_t result = AXIS2_FALSE;