KDE PIM/Akonadi Next/Client API: Difference between revisions

From KDE Community Wiki
No edit summary
No edit summary
Line 19: Line 19:
The query always retrieves a set of messages matching the query, while not necessarily all properties of the message need to be populated.
The query always retrieves a set of messages matching the query, while not necessarily all properties of the message need to be populated.


==== Query ===
==== Query ====
The query consists of:
The query consists of:
* A set of filters to apply
* A set of filters to apply

Revision as of 21:15, 1 December 2014

The client API consists of:

  • A modification API for messages (Create/Modify/Delete)
  • A query API to retrieve messages
  • A resource facade to abstract the resource implementation details
  • A set of standardized domain types

Domain Types

A set of standardized domain types is defined. This is necessary to decouple applications from resources (so a calendar can access events from all resources). The purpose of these domain types are strictly the interface and they are not supposed to be used by applications directly, or to be restricted by any other specifications (such as ical). By nature these types will be part of the evolving interface, and will need to be adjusted for every new property that an application must understand.

Store Facade

The store is always accessed through a store-type specific facade, which hides:

  • store access (one store could use a database, and another one plain files)
  • message type (flatbuffers, ...)
  • indexes

Query System

The query system should allow for efficient retrieval for just the amount of data required by the client. Efficient querying will be supported by the indexes povided by the resources.

The query always retrieves a set of messages matching the query, while not necessarily all properties of the message need to be populated.

Query

The query consists of:

  • A set of filters to apply
  • A minimum set of properties to retrieve

Queryable properties are defined by the [Domain Types] above.

Usecases

Mail:

  • All mails in folder X within date-range Y that are unread.
  • All mails (in all folders) that contain the string X in property Y.

Todos:

  • Give me all the todos in that collection where their RELATED-TO field maps to no other todo UID field in the collection
  • Give me all the todos in that collection where their RELATED-TO field has a given value
  • Give me all the collections which have a given collection as parent and which have a descendant matching a criteria on its attributes;

Events:

  • All events of calendar X within date-range Y.

Generic:

  • message with identifier X
  • all messages of resource X