Issue 105 in webreformatter: Replace the ISiteConfig by URL mappers

1 view
Skip to first unread message

webrefo...@googlecode.com

unread,
Nov 15, 2011, 8:14:04 AM11/15/11
to webreform...@googlegroups.com
Status: Accepted
Owner: mikhail....@gmail.com
Labels: Type-Task Priority-Medium

New issue 105 by mikhail....@gmail.com: Replace the ISiteConfig by URL
mappers
http://code.google.com/p/webreformatter/issues/detail?id=105

All URLs in the resolved/normalized Atom feeds are absolute. To export
multiple pages we need to perform the following operations for each URL in
the document:
1. Get the content of the referenced resource
2. Atomize/normalize all referenced HTML documents
3. Export these documents with local URLs (paths)
The first step (resource retrieval) requires absolute URLs but (in general
case) different than that mentioned in the original document
The last step - content export - requires transformation of original URLs
in localized versions. It could be a local path, hash of the original URL
etc.

Right now to implement these operations we are using ISiteConfig instances.
With this approach it is difficult to perform the following operations:
* Select only some resources to export
* Give a program-generated names for localized (exported) resources (like
SHA1(URL))

To fix this problem we need:
* Introduce a IUrlMapper interface
* Provide 2 IUrlMapper instances to run-time actions:
* The first one will be used to get the full URLs of the resources to
retrieve
* The second one will be used to map the original URL to a local path

A default implementation of the IUrlMapper interface could be done using
the site configurations.


Reply all
Reply to author
Forward
0 new messages