#define MAPISTORE_FOLDER 1
#define MAPISTORE_MESSAGE 2
+#define MAPISTORE_ATTACHMENT 3
#define MAPISTORE_SOFT_DELETE 1
#define MAPISTORE_PERMANENT_DELETE 2
MAPISTORE_LIVEFILTERED_QUERY,
};
+/* proof of concept: a new structure to simplify property queries */
+struct mapistore_property_data {
+ void *data;
+ int error; /* basically MAPISTORE_SUCCESS or MAPISTORE_ERR_NOT_FOUND */
+};
+
struct mapistore_backend {
const char *name;
const char *description;
int (*op_set_sort_order)(void *, uint64_t, uint8_t, struct SSortOrderSet *, uint8_t *);
int (*op_get_folders_list)(void *, uint64_t fmid, struct indexing_folders_list **folders_list);
+
+ /***
+ proof of concept
+ */
+
+ /** oxcmsg operations */
+ /** oxcstor operations */
+ struct {
+ int (*release)(void *);
+ } store;
+
+ /* note: the mid parameter will be replaced with a message object here once we have a "pocop_open_message"... */
+ struct {
+ int (*get_attachment_table)(void *, uint64_t, void **, uint32_t *);
+ int (*get_attachment)(void *, uint64_t, uint32_t, void **);
+ int (*create_attachment)(void *, uint64_t, uint32_t *, void **);
+ } message;
+
+ /** oxctabl operations */
+ struct {
+ int (*set_columns)(void *, uint16_t, enum MAPITAGS *);
+ int (*get_row)(void *, enum table_query_type, uint32_t, struct mapistore_property_data *);
+ } table;
+
+ /** oxcprpt operations */
+ struct {
+ int (*get_properties)(void *, uint16_t, enum MAPITAGS *, struct mapistore_property_data *);
+ int (*set_properties)(void *, struct SRow *);
+ } properties;
};
struct indexing_context_list;
int mapistore_set_restrictions(struct mapistore_context *, uint32_t, uint64_t, uint8_t, struct mapi_SRestriction *, uint8_t *);
int mapistore_set_sort_order(struct mapistore_context *, uint32_t, uint64_t, uint8_t, struct SSortOrderSet *, uint8_t *);
+/* proof of concept */
+int mapistore_pocop_get_attachment_table(struct mapistore_context *, uint32_t, uint64_t mid, void **, uint32_t *);
+int mapistore_pocop_get_attachment(struct mapistore_context *, uint32_t, uint64_t mid, uint32_t, void **);
+int mapistore_pocop_create_attachment(struct mapistore_context *, uint32_t, uint64_t mid, uint32_t *, void **);
+
+int mapistore_pocop_set_table_columns(struct mapistore_context *, uint32_t, void *, uint16_t, enum MAPITAGS *);
+int mapistore_pocop_get_table_row(struct mapistore_context *, uint32_t, void *, enum table_query_type, uint32_t, struct mapistore_property_data *);
+
+int mapistore_pocop_get_properties(struct mapistore_context *, uint32_t, void *, uint16_t, enum MAPITAGS *, struct mapistore_property_data *);
+int mapistore_pocop_set_properties(struct mapistore_context *, uint32_t, void *, struct SRow *);
+
+int mapistore_pocop_release(struct mapistore_context *, uint32_t, void *);
+
/* definitions from mapistore_processing.c */
int mapistore_set_mapping_path(const char *);
{
return bctx->backend->op_set_sort_order(bctx->private_data, fid, type, set, table_status);
}
+
+
+/* proof of concept */
+int mapistore_backend_pocop_get_attachment_table(struct backend_context *bctx, uint64_t mid,
+ void **table, uint32_t *row_count)
+{
+ return bctx->backend->message.get_attachment_table(bctx->private_data, mid, table, row_count);
+}
+
+int mapistore_backend_pocop_get_attachment(struct backend_context *bctx, uint64_t mid, uint32_t aid, void **attachment)
+{
+ return bctx->backend->message.get_attachment(bctx->private_data, mid, aid, attachment);
+}
+
+int mapistore_backend_pocop_create_attachment(struct backend_context *bctx, uint64_t mid, uint32_t *aid, void **attachment)
+{
+ return bctx->backend->message.create_attachment(bctx->private_data, mid, aid, attachment);
+}
+
+int mapistore_backend_pocop_set_table_columns(struct backend_context *bctx, void *table,
+ uint16_t count, enum MAPITAGS *properties)
+{
+ return bctx->backend->table.set_columns(table, count, properties);
+}
+
+int mapistore_backend_pocop_get_table_row(struct backend_context *bctx, void *table,
+ enum table_query_type query_type, uint32_t rowid,
+ struct mapistore_property_data *data)
+{
+ return bctx->backend->table.get_row(table, query_type, rowid, data);
+}
+
+int mapistore_backend_pocop_get_properties(struct backend_context *bctx,
+ void *object,
+ uint16_t count, enum MAPITAGS
+ *properties,
+ struct mapistore_property_data *data)
+{
+ return bctx->backend->properties.get_properties(object, count, properties, data);
+}
+
+int mapistore_backend_pocop_set_properties(struct backend_context *bctx,
+ void *object, struct SRow *aRow)
+{
+ return bctx->backend->properties.set_properties(object, aRow);
+}
+
+int mapistore_backend_pocop_release(struct backend_context *bctx, void *object)
+{
+ return bctx->backend->store.release(object);
+}
return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
}
+
+
+/* proof of concept */
+_PUBLIC_ int mapistore_pocop_get_attachment_table(struct mapistore_context *mstore_ctx, uint32_t context_id, uint64_t mid,
+ void **table, uint32_t *row_count)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_get_attachment_table(backend_ctx, mid, table, row_count);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
+
+_PUBLIC_ int mapistore_pocop_get_attachment(struct mapistore_context *mstore_ctx, uint32_t context_id,
+ uint64_t mid, uint32_t aid,
+ void **attachment)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_get_attachment(backend_ctx, mid, aid, attachment);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
+
+_PUBLIC_ int mapistore_pocop_create_attachment(struct mapistore_context *mstore_ctx, uint32_t context_id,
+ uint64_t mid,
+ uint32_t *aid, void **attachment)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_create_attachment(backend_ctx, mid, aid, attachment);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
+
+_PUBLIC_ int mapistore_pocop_set_table_columns(struct mapistore_context *mstore_ctx, uint32_t context_id, void *table, uint16_t count, enum MAPITAGS *properties)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_set_table_columns(backend_ctx, table, count, properties);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
+
+_PUBLIC_ int mapistore_pocop_get_table_row(struct mapistore_context *mstore_ctx, uint32_t context_id, void *table,
+ enum table_query_type query_type, uint32_t rowid, struct mapistore_property_data *data)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_get_table_row(backend_ctx, table, query_type, rowid, data);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
+
+_PUBLIC_ int mapistore_pocop_get_properties(struct mapistore_context
+ *mstore_ctx, uint32_t context_id,
+ void *object,
+ uint16_t count, enum MAPITAGS *properties,
+ struct mapistore_property_data *data)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_get_properties(backend_ctx, object, count, properties, data);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
+
+_PUBLIC_ int mapistore_pocop_set_properties(struct mapistore_context
+ *mstore_ctx, uint32_t context_id,
+ void *object,
+ struct SRow *aRow)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_set_properties(backend_ctx, object, aRow);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
+
+_PUBLIC_ int mapistore_pocop_release(struct mapistore_context
+ *mstore_ctx, uint32_t context_id,
+ void *object)
+{
+ struct backend_context *backend_ctx;
+ int ret;
+
+ /* Sanity checks */
+ MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
+
+ /* Step 1. Search the context */
+ backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
+ MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
+
+ /* Step 2. Call backend operation */
+ ret = mapistore_backend_pocop_release(backend_ctx, object);
+
+ return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
+}
int mapistore_backend_set_restrictions(struct backend_context *, uint64_t, uint8_t, struct mapi_SRestriction *, uint8_t *);
int mapistore_backend_set_sort_order(struct backend_context *, uint64_t, uint8_t, struct SSortOrderSet *, uint8_t *);
+/* proof of concept */
+int mapistore_backend_pocop_get_attachment_table(struct backend_context *, uint64_t, void **, uint32_t *);
+int mapistore_backend_pocop_get_attachment(struct backend_context *, uint64_t, uint32_t, void **);
+int mapistore_backend_pocop_create_attachment(struct backend_context *, uint64_t, uint32_t *, void **);
+
+int mapistore_backend_pocop_set_table_columns(struct backend_context *, void *, uint16_t, enum MAPITAGS *);
+int mapistore_backend_pocop_get_table_row(struct backend_context *, void *, enum table_query_type, uint32_t, struct mapistore_property_data *);
+
+int mapistore_backend_pocop_get_properties(struct backend_context *, void *, uint16_t, enum MAPITAGS *, struct mapistore_property_data *);
+int mapistore_backend_pocop_set_properties(struct backend_context *, void *, struct SRow *);
+
+int mapistore_backend_pocop_release(struct backend_context *, void *);
+
/* definitions from mapistore_tdb_wrap.c */
struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *, const char *, int, int, int, mode_t);