24 #define AFW_IMPLEMENTATION_ID "adaptor"
48 self->pub.inf = &impl_afw_request_handler_inf;
51 self->properties = properties;
54 &afw_s_defaultOptions, xctx);
57 NULL, options_object, p, xctx);
71 if (!ctx->content_type) {
73 afw_request_prepare_response_content_type(ctx->request, xctx);
75 ctx->content_type, ctx->options,
76 (
void *)ctx->request, ctx->request->write_content_cb,
101 impl_afw_request_handler_release(
166 if (parsed_path->object_type_id.len == 0) {
172 else if (parsed_path->entity_object_id.len == 0)
176 query_criteria = NULL;
177 if (request->query_string && request->query_string->len > 0) {
180 request->query_string,
181 &parsed_path->adaptor_id,
182 &parsed_path->object_type_id,
188 memset(&retrieve_cb_context, 0,
sizeof(retrieve_cb_context));
189 retrieve_cb_context.request = request;
190 retrieve_cb_context.journal_entry = journal_entry;
191 retrieve_cb_context.options = parsed_path->options;
195 &parsed_path->adaptor_id, &parsed_path->object_type_id,
196 parsed_path->options, query_criteria, journal_entry,
197 &retrieve_cb_context, impl_retrieve_cb,
198 NULL, xctx->p, xctx);
205 query_criteria = NULL;
206 if (request->query_string && request->query_string->len > 0) {
209 request->query_string,
210 &parsed_path->adaptor_id,
211 &parsed_path->object_type_id,
212 journal_entry, xctx->p, xctx);
217 &parsed_path->adaptor_id, &parsed_path->object_type_id,
218 &parsed_path->entity_object_id,
219 parsed_path->options, query_criteria,
220 journal_entry, NULL, xctx->p, xctx);
228 else if (parsed_path->first_property_name) {
230 parsed_path->first_property_name, xctx);
247 parsed_path->options, xctx);
279 if (parsed_path->entity_object_id.len == 0) {
282 if (parsed_path->first_property_name) {
284 "Object id can not have dotted property name for replace.", xctx);
287 &parsed_path->normalized_path, xctx);
289 &parsed_path->object_type_id, &parsed_path->entity_object_id,
290 obj, journal_entry, NULL, xctx);
373 if (parsed_path->object_type_id.len == 0 ||
374 parsed_path->entity_object_id.len == 0)
377 "Modify requires object type and object id", xctx);
379 if (parsed_path->first_property_name) {
381 "Object id can not have dotted property name for modify.", xctx);
384 &parsed_path->object_type_id, &parsed_path->entity_object_id,
393 if (parsed_path->object_type_id.len == 0 &&
396 response_content_type = afw_request_prepare_response_content_type(
399 obj, response_content_type, journal_entry, xctx->p, xctx);
403 else if (parsed_path->object_type_id.len == 0) {
408 else if (parsed_path->entity_object_id.len == 0) {
410 &parsed_path->object_type_id, NULL, obj, journal_entry,
416 if (parsed_path->first_property_name) {
418 "Object id can not have dotted property name for update.",
422 &parsed_path->normalized_path, xctx);
424 &parsed_path->adaptor_id,
425 &parsed_path->object_type_id,
426 &parsed_path->entity_object_id,
428 journal_entry, NULL, xctx);
446 if (parsed_path->first_property_name) {
448 "Object id can not have dotted property name for delete.",
452 &parsed_path->adaptor_id, &parsed_path->object_type_id,
453 &parsed_path->entity_object_id, journal_entry, NULL,
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
afw_action_perform(const afw_object_t *request, const afw_content_type_t *response_content_type, const afw_object_t *response, const afw_pool_t *p, afw_xctx_t *xctx)
Perform actions(s) specified in AdaptiveActions object.
afw_adaptor_modify_using_update_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *update_object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Modify using update object and remove from cache.
afw_adaptor_retrieve_objects(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_object_options_t *options, const afw_query_criteria_t *criteria, const afw_object_t *journal_entry, void *context, afw_object_cb_t callback, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx)
Retrieve objects.
afw_adaptor_replace_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *replacement_object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Replace object and remove from cache.
afw_adaptor_add_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *suggested_object_id, const afw_object_t *object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Call adaptor to add object and remove from cache.
afw_adaptor_session_commit_and_release_cache(afw_boolean_t abort, afw_xctx_t *xctx)
Commit/Abort changes and release cached sessions and objects.
afw_adaptor_modify_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_list_t *entries, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Modify object and remove from cache.
afw_adaptor_get_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_options_t *options, const afw_query_criteria_t *criteria, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx)
Get and cache object.
afw_adaptor_delete_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Delete object from cache and via adaptor.
afw_adaptor_query_criteria_parse_url_encoded_rql_string(const afw_utf8_t *url_encoded_rql_string, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_object_t *journal_entry, const afw_pool_t *p, afw_xctx_t *xctx)
Parse URL encoded RQL query string appropriate for an adaptor.
#define afw_value_is_list(A_VALUE)
Macro to determine if value is evaluated list.
#define afw_value_is_object(A_VALUE)
Macro to determine if value is evaluated object.
#define afw_object_old_get_property_as_object(object, property_name, xctx)
Get property function for data type object value.
afw_value_create_object(const afw_object_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type object value.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
#define afw_content_type_create_object_list_writer(instance, options, context, callback, p, xctx)
Call method create_object_list_writer of interface afw_content_type.
#define afw_content_type_object_list_writer_write_object(instance, object, p, xctx)
Call method write_object of interface afw_content_type_object_list_writer.
#define afw_content_type_object_list_writer_release(instance, xctx)
Call method release of interface afw_content_type_object_list_writer.
#define afw_content_type_is_application_afw(instance)
Determine if content type it application/x-afw.
#define AFW_CATCH_UNHANDLED
Catch an unhandled error that occurs in a AFW_TRY block.
#define AFW_ENDTRY
Ends an AFW try block.
#define AFW_TRY
Begin an AFW TRY block.
#define AFW_THROW_ERROR_FZ(code, xctx, format_z,...)
Macro used to set error and 0 rv in xctx and throw it.
#define AFW_MARK_UNHANDLED
Use in an AFW_CATCH or AFW_CATCH_UNHANDLED block to mark error as unhandled and break.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
afw_object_options_set_from_object(const afw_object_options_t *initial_options, const afw_object_t *options_object, const afw_pool_t *p, afw_xctx_t *xctx)
Set object processing options from options object.
afw_object_path_property_name_list_get_property(const afw_object_t *object, const afw_object_path_property_name_entry_t *first_property_name, afw_xctx_t *xctx)
Get object property value using property names.
afw_object_path_parse(const afw_utf8_t *path, const afw_utf8_t *current_path, const afw_object_options_t *default_options, const afw_pool_t *p, afw_xctx_t *xctx)
Parse an object value path in specific pool.
#define afw_object_create_managed(p, xctx)
Create an empty entity object in its own pool.
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
void impl_afw_request_handler_process(const afw_request_handler_t *instance, const afw_request_t *request, afw_xctx_t *xctx)
afw_request_handler_adaptor_create_cede_p(const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
Create an adaptor request handler.
#define afw_request_set_error_info(instance, error_info, xctx)
Call method set_error_info of interface afw_request.
#define afw_request_finish_response(instance, xctx)
Call method finish_response of interface afw_request.
#define AFW_REQUEST_Q_METHOD_GET
Request method GET quoted string.
afw_request_body_to_value(const afw_request_t *instance, const afw_pool_t *p, afw_xctx_t *xctx)
Read a request body to value in a specifed pool.
#define AFW_REQUEST_Q_METHOD_DELETE
#define AFW_REQUEST_Q_METHOD_PUT
void afw_request_write_value_to_response_body(const afw_request_t *instance, const afw_value_t *value, const afw_object_options_t *options, afw_xctx_t *xctx)
Write value to response body.
#define AFW_REQUEST_Q_METHOD_POST
afw_request_write_success_response(const afw_request_t *instance, const afw_object_t *response, afw_xctx_t *xctx)
Write simple success to response body.
#define afw_stream_write_z(writer, s_z, xctx)
Call afw_stream_write() with zero terminated string.
#define afw_stream_standard(enum_suffix, xctx)
Get xctx stream instance.
afw_stream_write_integer(const afw_stream_t *writer, afw_integer_t integer, afw_xctx_t *xctx)
Call afw_stream_write() with an integer.
afw_boolean_t afw_utf8_equal_utf8_z(const afw_utf8_t *s1, const afw_utf8_z_t *s2_z)
Check to see if a string equals a utf8_z string.
afw_boolean_t afw_utf8_equal(const afw_utf8_t *s1, const afw_utf8_t *s2)
Check to see if a string equals another string.
afw_value_undecorate(const afw_value_t *value)
Return undecorated value.
Interface afw_content_type_object_list_writer public struct.
Interface afw_content_type public struct.
Struct for object processing options.
Typedef for parsed object path.
Interface afw_object public struct.
Interface afw_pool public struct.
Interface afw_request_handler public struct.
Interface afw_request public struct.
Interface afw_stream public struct.
struct for data type list values.
struct for data type object values.
Interface afw_value public struct.
Interface afw_xctx public struct.