Difference between revisions of "Custom URI Scheme"
m (moved URI Scheme to Custom URI Scheme) |
|||
Line 1: | Line 1: | ||
This wiki page discusses the possibility to register some custom [http://en.wikipedia.org/wiki/URI_scheme URL Scheme] so that the online banking functions in GnuCash can be called from a browser. | This wiki page discusses the possibility to register some custom [http://en.wikipedia.org/wiki/URI_scheme URL Scheme] so that the online banking functions in GnuCash can be called from a browser. | ||
− | |||
− | |||
− | |||
Here's my target use case: User browses on the gnucash.org/de website. Website contains a link "Click here to donate from your German bank account" where the link target contains our custom URI Scheme (the part usually called the "protocol"): | Here's my target use case: User browses on the gnucash.org/de website. Website contains a link "Click here to donate from your German bank account" where the link target contains our custom URI Scheme (the part usually called the "protocol"): | ||
Line 9: | Line 6: | ||
* "de" refers to the fact we're using the German bank account addressing scheme, | * "de" refers to the fact we're using the German bank account addressing scheme, | ||
* 1111111 is the bank code of the German bank, | * 1111111 is the bank code of the German bank, | ||
− | * | + | * 2222222 is the account number, |
+ | * and "Some Description" is the description text that is inserted in the "description" text field of the online banking transfer. | ||
Once clicked, this URL string needs to be passed to GnuCash, most probably as a command line argument similar to the file://path/filename argument. I'll have to tweak the command line parsing so that my custom schemes are redirected into the online banking module, but that shouldn't be a problem. | Once clicked, this URL string needs to be passed to GnuCash, most probably as a command line argument similar to the file://path/filename argument. I'll have to tweak the command line parsing so that my custom schemes are redirected into the online banking module, but that shouldn't be a problem. | ||
Once that URL made it into GnuCash's online banking module, it should look up the preferred online banking account which the user regularly uses, then open the dialog for transferring money. The user just has to insert the amount, then press "Send now", then entering his security numbers, and voila, here the money goes to our gnucash donation bank account. | Once that URL made it into GnuCash's online banking module, it should look up the preferred online banking account which the user regularly uses, then open the dialog for transferring money. The user just has to insert the amount, then press "Send now", then entering his security numbers, and voila, here the money goes to our gnucash donation bank account. | ||
+ | |||
+ | == Which URI Scheme to use? == | ||
+ | See | ||
+ | * http://en.wikipedia.org/wiki/URI_scheme | ||
+ | * http://www.w3.org/wiki/UriSchemes | ||
+ | * http://infomesh.net/2001/09/urischemes "New URI Schemes: 99% Harmful" | ||
+ | * http://techbase.kde.org/Policies/URI_%26_XML_Namespaces_Policy | ||
+ | |||
+ | The scheme should be | ||
+ | Tag scheme [http://tools.ietf.org/html/rfc4151 rfc4151] using gnucash.org and 2011 as a year: | ||
+ | tag:gnucash.org,2011://de/11111111/22222222?desc=Some%20Description | ||
+ | |||
+ | == How can we register gnucash as a handler for our custom scheme? == | ||
+ | * Gnome: Registering in gconf, http://people.w3.org/~dom/archives/2005/09/integrating-a-new-uris-scheme-handler-to-gnome-and-firefox/ | ||
+ | * KDE: Registering in kfmclient, only works for KDE applications?!? | ||
+ | ** http://superuser.com/questions/91611/picasa-links-in-google-chrome-linux/93419#93419 | ||
+ | ** http://lists.freedesktop.org/archives/xdg/2010-October/011635.html | ||
+ | * Windows: In the registry http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx | ||
+ | * A general but probably unimplemented proposal http://wiki.lxde.org/en/Desktop_Preferred_Applications_Specification |
Revision as of 15:04, 16 February 2011
This wiki page discusses the possibility to register some custom URL Scheme so that the online banking functions in GnuCash can be called from a browser.
Here's my target use case: User browses on the gnucash.org/de website. Website contains a link "Click here to donate from your German bank account" where the link target contains our custom URI Scheme (the part usually called the "protocol"):
hbci://de/11111111/22222222?desc=Some%20Description
- "hbci" is our URL Scheme which is unused so far
- "de" refers to the fact we're using the German bank account addressing scheme,
- 1111111 is the bank code of the German bank,
- 2222222 is the account number,
- and "Some Description" is the description text that is inserted in the "description" text field of the online banking transfer.
Once clicked, this URL string needs to be passed to GnuCash, most probably as a command line argument similar to the file://path/filename argument. I'll have to tweak the command line parsing so that my custom schemes are redirected into the online banking module, but that shouldn't be a problem.
Once that URL made it into GnuCash's online banking module, it should look up the preferred online banking account which the user regularly uses, then open the dialog for transferring money. The user just has to insert the amount, then press "Send now", then entering his security numbers, and voila, here the money goes to our gnucash donation bank account.
Which URI Scheme to use?
See
- http://en.wikipedia.org/wiki/URI_scheme
- http://www.w3.org/wiki/UriSchemes
- http://infomesh.net/2001/09/urischemes "New URI Schemes: 99% Harmful"
- http://techbase.kde.org/Policies/URI_%26_XML_Namespaces_Policy
The scheme should be Tag scheme rfc4151 using gnucash.org and 2011 as a year:
tag:gnucash.org,2011://de/11111111/22222222?desc=Some%20Description
How can we register gnucash as a handler for our custom scheme?
- Gnome: Registering in gconf, http://people.w3.org/~dom/archives/2005/09/integrating-a-new-uris-scheme-handler-to-gnome-and-firefox/
- KDE: Registering in kfmclient, only works for KDE applications?!?
- Windows: In the registry http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx
- A general but probably unimplemented proposal http://wiki.lxde.org/en/Desktop_Preferred_Applications_Specification