org-protocol.el: URL rewrites
commit69b46e10aab3b2374ecbc1a963ba56e77102a9a4
authorCarsten Dominik <carsten.dominik@gmail.com>
Sun, 15 Nov 2009 11:24:40 +0000 (15 12:24 +0100)
committerCarsten Dominik <carsten.dominik@gmail.com>
Sun, 15 Nov 2009 11:24:40 +0000 (15 12:24 +0100)
treee67b91a2d2320e6a19d406617230ce3907c79784
parent570878b7e5a510f6bee75a9d40f6690aaaf04407
org-protocol.el: URL rewrites

Sebastian Rose writes:

> * This is how it works:
>
>   Each project in `org-protocol-project-alist' may now have a new
>   element `:rewrites'. `:rewrites' is a list of cons cells, that maps
>   regular expressions to relative paths.
>
>
>
> * Example:
>
>   (setq org-protocol-project-alist
>       '(("http://fairposter.de/"
>          :base-url "http://example-web-shop.de/"
>          :working-directory "/path/to/working/directory/"
>          :online-suffix ".php"
>          :working-suffix ".php"
>          :rewrites (("example-web-shop.de/cars/" . "products.php")
>                     ("example-web-shop.de/$" . "index.php")
>                     ))
>
>          ;; .... more projects here
>          ))
>
>
>   Today, if I visit http://www.example-web-shop.de/, the URL would
>   not match a path to any of the files below my working directory.
>
>   Tomorrow, /path/to/working/directory/index.php is opened, because there's
>   a matching rewrite.
>
>
>   Today, a rewritten URL like
>     http://example-web-shop.de/cars/lamborghini/Gallardo_LP560-4_MY09
>   would not match a path to any of the files below my working
>   directory, because URLS like `..../cars/' would be rewritten on the
>   server and served through http://example-web-shop.de/products.php.
>
>   Tomorrow, that URL will be mapped to
>   /path/to/working/directory/products.php, because there's a matching
>   rewrite defined.
lisp/org-protocol.el