summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-28 13:23:00 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-28 13:23:00 +0100
commit44f957669c4d7603c8279c41987ee5a74c818bca (patch)
treef2848cee21045c51d128c9781ad1b8eefc77c096 /docs
parenta5061675138193a1306e3c154d3b91cb693de810 (diff)
downloadkube-44f957669c4d7603c8279c41987ee5a74c818bca.tar.gz
kube-44f957669c4d7603c8279c41987ee5a74c818bca.zip
Docs on pre-action handler and accounts
Diffstat (limited to 'docs')
-rw-r--r--docs/design.md57
1 files changed, 51 insertions, 6 deletions
diff --git a/docs/design.md b/docs/design.md
index 1330cc28..03c37899 100644
--- a/docs/design.md
+++ b/docs/design.md
@@ -83,13 +83,23 @@ An action represents something that can be done, such as "mark as read", "delete
83 83
84An action has: 84An action has:
85* an id (i.e. org.kube.actions.make-as-read) 85* an id (i.e. org.kube.actions.make-as-read)
86* an active state (a property for the UI to know when the action can be triggered, that changes depending on the context) 86* an ready state (a property for the UI to know when the action can be triggered, that changes depending on the context)
87* an action context, which contains everything the action needs to execute. 87* an action context, which contains everything the action needs to execute.
88* an icon 88* an icon
89* a name 89* a name
90 90
91The action context contains the dataset the action works upon plus any additional information that is required. A mark-as-read action for instance only requires the mail-set to work on, while a tag-with action requires any entity (mail, event, ...) and a tag (unless there is one action per tag...). 91The action context contains the dataset the action works upon plus any additional information that is required. A mark-as-read action for instance only requires the mail-set to work on, while a tag-with action requires any entity (mail, event, ...) and a tag (unless there is one action per tag...).
92The action can, through property-binding, reevaluate its active state based on the currently set context that the UI continuously updates through property binding. Context objects can be shared by various actions. 92The action can, through property-binding, reevaluate its ready state based on the currently set context that the UI continuously updates through property binding. Context objects can be shared by various actions.
93
94#### Pre-action handler
95A pre-action handler can be used to supply additional context information for the action to execute. This can be used to i.e. retrieve configuration information or resolve a user uid over ldap.
96
97An action can be executed if a set of available pre-action handlers plus the initially supplied informatin can complete the context so the target action-handler can be executed.
98
99#### Selecting action handlers out of candidates.
100It is possible that multiple action handlers are avialable for the same action, i.e. because different accounts supplied an action handler for the same action. In such a case it is necessary to select the right action handler based on the context.
101
102A simple criteria could be the currently selected account.
93 103
94#### Automatic action discovery 104#### Automatic action discovery
95While in many places explicit instantiation of actions is desirable, sometimes we may want to offer all available actions for a certain type. For this it should be possible to i.e. query for all actions that apply to a mail. That way it is possible to centrally add a new action that automatically becomes available everywhere. Note that this only works for actions that don't require an additional UI, since the components would have to embedd that somewhere. 105While in many places explicit instantiation of actions is desirable, sometimes we may want to offer all available actions for a certain type. For this it should be possible to i.e. query for all actions that apply to a mail. That way it is possible to centrally add a new action that automatically becomes available everywhere. Note that this only works for actions that don't require an additional UI, since the components would have to embedd that somewhere.
@@ -99,14 +109,19 @@ Actions are objects that provide the API, and that QML can instantiate directly
99 109
100* Action: The interface to execute/launch the action. Forwards request and context to broker. 110* Action: The interface to execute/launch the action. Forwards request and context to broker.
101* ActionHandler: A handler for a specific action. Registers itself with the broker. 111* ActionHandler: A handler for a specific action. Registers itself with the broker.
102* ActionBroker: Forwards action requests to handlers. 112* PreActionHandler: A handler that runs before the action and supplies additional information.
113* ActionBroker: Forwards action requests to handlers. Selects and executes suitable pre-action handlers.
103* Context: The context containing everything the handler needs to execute the action. 114* Context: The context containing everything the handler needs to execute the action.
104 115
105### Controller 116### Controller
106For every domain object a controller is implemented to be able to edit the domain object. The domain object is a QObject with a QObject-property for every property of th edomain object and a QValidator, so editors can easily be build using property binding while providing property-level validation and feedback. 117Controllers are used to interact with the system. The controller is a QObject with a QObject-property every property that should be editable, and a QValidator for every property, so editors can easily be built using property binding while providing property-level validation and feedback.
107 118
108The domain object is exposed as an opaque QVariant that can i.e. be used in an action-context. This way details from the infrastructure layer don't leak to the UI layer 119The domain object is exposed as an opaque QVariant that can i.e. be used in an action-context. This way details from the infrastructure layer don't leak to the UI layer
109 120
121Controllers may execute actions or directly interact with infrastructure where suitable.
122
123TODO: we need to find a solution for autocompletion for individual properties. This could be something like a plasma-components specific completer class that is supported by a text component (QCompleter only works for widgets).
124
110### Notifications 125### Notifications
111The system will provide notifications from various sources. 126The system will provide notifications from various sources.
112 127
@@ -151,6 +166,7 @@ Same as files? Import/Export calendar data
151* iCal: KCalCore 166* iCal: KCalCore
152* vCard: KContacts 167* vCard: KContacts
153* iTip: extract from kdepim repo 168* iTip: extract from kdepim repo
169* SMTP: based on libcurl
154 170
155### Cryptography 171### Cryptography
156* PGP, PEP 172* PGP, PEP
@@ -169,8 +185,6 @@ TBD
169 185
170## Problems/Notes: 186## Problems/Notes:
171* Dynamic switching between various component UI's can be solved using KPackage 187* Dynamic switching between various component UI's can be solved using KPackage
172* change-requests sometimes also need to be handled by sub-components
173** If you hit the reply button in the main view, but replies always work inline in the messagelist, the messagelist should still be able to capture the request and handle it. But if the request only goes to parent objects, that is not possible. Perhaps we need a pub-sub mechanism.
174 188
175## Example usage in QML 189## Example usage in QML
176 190
@@ -249,3 +263,34 @@ KubeComponents.MailView {
249 * MailModel 263 * MailModel
250 * subject, date, sender, folder, content, attachments 264 * subject, date, sender, folder, content, attachments
251 265
266## Configuration and Accounts
267Kube is a groupware application, so one of its most important features is being able to work with various remote backends. We live in a world of multiple devies and applications, so it is interesting to share as much state and configuration accross all different devices and applications, which is why we try to store as much of that in the backend.
268
269From the perspective of Kube we are working with different "Accounts". Each account represents a different backend, such as your personal IMAP or Kolab server, or a hosted offering such as GMail or KOLAB NOW. Each of those accounts may interact with various protocols such as imap, smtp, ldap, caldav etc.
270
271To add support for a new backend thus means that a new account type has to be added to Kube.
272
273An account consists of:
274
275* One or more sink resources to access the remote data
276* A configuration UI in QML that can be embedded in the accounts setup
277* Potentially custom action handlers if the default action handlers are not sufficient.
278* A configuration controller to modify and access the data
279* A set of action pre-handler to supply the configuration to actions
280
281### Configuration Controller
282The configuraton controller is not only used in the configuration UI to provide the data, but it is also used by the rest of the system to access configuration of this account.
283
284This allows the account to retrieve configruation data on a property-by-property basis i.e. from Sink or a local config file.
285
286### Accounts-Plugin
287The account is supplied as a kpackage based plugin. The plugin is loaded into kube directly from QML. The plugin registers it's configuration controller and potentially actions.
288
289Note: We could have a plugin mechanism that discovers account-plugins should that become necessary at some point.
290
291## Application Context
292Various parts of the system are context sensitive. I.e. the currently selected account affects which transport is used to send an email, or which folders are currently visble.
293
294In future iterations that context can be expanded i.e. with projects that affect prioritization of various data items.
295
296The application context is globally available, although it may be altered locally.