Active/Contour activity browsing
Marco Martin
notmart at gmail.com
Mon May 9 23:28:43 CEST 2011
Hi all,
let's see what happened recently in the usage of Nepomuk by Plasma Active,
also building blocks for one of the main user interface pieces for Contour.
(long message but has pictures ;)
a central point is using Activities to organize all our resources, being
files, contacts or applications, in brief what will be represented by Nepomuk
resources.
a central piece for wiring up Plasma and Nepomuk is the metadata DataEngine.
here is possible to do arbitrary queries to Nepomuk.
Today i did a little marathon to rework its api, to permit more easily to use
more than one applet connected to the dataengine and track of the queries that
can auto update over time.
Now each query is a separate dataengine source and a custom DataContainer for
each source.
this means a separate QueryServiceClient per query, that can keep track of any
change.
there is now a new source type, called CurrentActivityResources: (followed by
the activity id)
this lists all the resources associated with the given activity, and this will
be used in a view used by default in the center on the Contour activity view.
a service is present too to make possible to add/remove associations between
activity and resources.
a user interface has been done as well, and here it is how it looks right now:
http://i.imgur.com/GpmUM.png
this is a qml only containment, and uses the common resource delegates
developed before/during Tokamak. (for different resource types they will
eventually look in a different way)
it's still rough, (for instance resource types still have the internal user
unfriendly name, like PaginatedTextDocument) but at this point, modulo some
bugs i will talk about later, just needs refinements.
what is possible to do with those icons?
a single click opens it, a press and hold opens a menu:
http://i.imgur.com/L8NBx.png
the entries present are just a proof of concept for demo purposes, they just
show a brief feedback message (they will eventually use the actions provided
by the share/like/connect service)
one entry that does work is the last: "add to the current activity".
tapping on it it will add that resource to the default view (when no query is
present)
this entry, in the default view becomes instead "remove from current activity"
It does actually work, however there are still some bugs.
it seems that when a resource is removed, QueryServiceClient sends
entriesRemoved() for all of the associated resources, and is necessary to
reset the query and do it again to get the correct results.
Sebastian, any ideas?
To conclude, a question about the api:
right now the add/remove association is done by a service with those two
possible operations:
it requires to pass both the nepomuk url of the resources and of the activity
(means that would even be possible to associate a resource with an activity
different from the current one, if there will be a ui for it)
a different implementation would be to use kactivityconsumer to figure out the
current activity and just let add/remove associations to the current *running*
activity.
Cheers,
Marco Martin
More information about the Active
mailing list