On Sat, Jul 20, 2013 at 6:53 PM, Alexander Antimonov <alexander.antimonov.od...@gmail.com> wrote: > On Thu, Jul 18, 2013 at 9:37 PM, Thomas Voß <thomas.v...@canonical.com> wrote: >> On Thu, Jul 18, 2013 at 8:28 PM, Michał Sawicz >>> What if you don't know/care what kind of app should handle, say, a >>> downloaded PDF file? >>> >> >> Good point and I do agree in general, However, once we allow mime-type >> handling we break the strict per-app siloing of content. >> >> Not sure how to solve that issue for mime-type handling. >> >> Thomas > > Just some thoughts of how it could be. > > An application that wants to spawn another app have to provide > "spawning mechanism" > with three parameters: other app's name, MIME-type of a resource, URL > of the resource. > Any two of these parameters may be optional but at least one is mandatory. > > Spawning mechanism might be: Qt.spawn(...)->Dbus->Upstart or whatever > is appropriate. > > App's name - name of the application to spawn in a form used in the app's > manifest, like "com.ubuntu.developer.username.myapp". To make not confined > apps > spawnable, Ubuntu will provide manifests for not confined apps too (if > it doesn't already).
Hmmm, I think applications knowing one another's names and assuming them to be available will result in tight coupling and introducing dependencies that we cannot resolve automatically. I would consider it similar to not relying on an interface to request functionality but instead relying on one possible implementation of an interface. Thomas > MIME-type and URL - nothing unusual, obvious. > > Hierarchy of decision making: name->MIME->URL. URL is considered only when > neither name nor MIME is provided. > > Use cases: > ${browser} could be any application registered as default handler for > "text/html" > > - spawn a browser with html page as argument, based on MIME-type: > name="", MIME="text/html", URL="http://host/page.html" > > - spawn a browser with html page as argument, based on URL's "http:" : > name="", MIME="", URL="http://host/page.html" > > - spawn the browser with fallback to default browser if requested one > is not installed/registered: > name="com.mozilla.firefox", MIME="text/html", URL="http://host/page.html" > > - spawn the browser without fallback, if Firefox is not installed > nothing is spawned: > name="com.mozilla.firefox", MIME="", URL="http://host/page.html" > > - spawn the browser without an argument: > name="com.mozilla.firefox", MIME="", URL="" > > - spawn a browser without an argument: > name="", MIME="text/html", URL="" > > "name" could be not just one app but a list of apps, with > left-to-right priority: > name(s)="com.mozilla.firefox,com.google.chrome" > > Also, there is such a thing as Uniform Type Identifier. > http://en.wikipedia.org/wiki/Uniform_Type_Identifier > > You might consider adopting it, in part or as a whole, and use it > instead of MIME-type. > Or even instead of name+MIME: > - spawn a browser with fallback, no need for MIME as parameter anymore: > names="com.mozilla.firefox,com.google.chrome,public.html" > URL="http://host/page.html" -- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp