Mart

a cute little home a cute little boy a cute little cow: mooo!

Tale of a little pixel

a cute little girl

Resources and Activities

After an update by Sebastian Kügler on the status of PlasmaActive, let's see what's happening lately on its semantic Contour user interface and backend.

During Tokamak together Sebastian, we designed a plugin system for delegates of arbitrary Nepomuk resources.

What's that? Well, exactly what they are and how they work is probably material from a next entry, but what's enough to say for now is that it's a system that will be able to represent any kind of resource (file, bookmark, contact...) coming out of nepomuk, in the form that is most adapt to it (icon, photo, thumbnail..)

Resource items will be used by many plasmoids, for now in mobile-related projects (they will probably get a desktop version as well once reached stability)

Today i want to talk in particular to one of them: the central view of the Contour ui:

OGG version

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. It's about organizing all of the "objects" I will interact to, in regard to what I'm doing right now: the concept of activity, that it's starting to be exploited in the desktop but we can integrate it more deeply and quickly on mobile devices at first, were we still have more of a blank canvas.

This ui not only will permit a full text search trough all resources indexed by Nepomuk, but permits to associate any resources, from any of those search results to the current running activity, in order to have all the information and documents related to what I'm doing, in the corresponding activity.

And later on from any source, being an open application (via share-like-connect, but this is for another story), a web bookmark or an incoming phone call.

As shown in the video, every resource type will offer a series of actions relevant to that type: for instance I may want to share a photo on flicker, a presentation on SlideShare, or add a contact in my address book (this as well will come with share-like-connect, stay tuned for that).

The context menu has been tought to work well especially on touchscreens, it appears with a prolungate tap and is possible to select an item and activate it without detaching the finger from the glass, with a gesture of a single tap in total.

This is possible of course thanks to the Nepomuk backend, and while I'm not the best one to talk about what's happening aat that level, let's see how we can talk to this backend from any plasmoid, also in a pretty easy way from scripted plasmoids, Javascript and/or QML.

A central piece for wiring up Plasma and Nepomuk is the metadata DataEngine. here is possible to do arbitrary queries to it: just for instance connect to its source called "thesis" and will return the most relevant results in Nepomuk connected with that word.

It is also possible trough the engine to retrieve the list of resources that are connected with any activity (the ui shows always those connected with the current one), as well services are provided to both connect and unconnect resources from an arbitrary activity.

Since a geeky blog isn't geeky enough with at least an hint of code, let's say our query to the engine was "thesis": how do i add any of its results to the current activity? with the usual Javascript Service API, of course:

    //service for the last query
    var service = metadataSource.serviceForSource("thesis")
    //we want to add an association
    var operation
    operation = service.operationDescription("addAssociation")
    //contextMenu.resourceUrl contains a valid nepomuk url:
    //those arrive from the dataengine as well
    operation.ResourceUrl = contextMenu.resourceUrl
    //and associate with the *current* activity id
    operation.ActivityUrl = plasmoid.activityId
    //done!
    service.startOperationCall(operation)

The user interface shown here is still at an early stage, but it's working already, and marks another step in the activity awareness of both the workspace (still many other goodies in this sense to come) and every application (on a related note the client library to access activities will be publicly available as an experimental state with the upcoming 4.7 release of the KDE Platform)



Submit comment



Article: