AniDB:AJAX development

Revision as of 10:58, 29 October 2007 by Fahrenheit (talk | contribs) (AJAX development page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Page dedicated to AJAX Development.

Some copy/paste from mail's from sphere.

hi

I've seen the basic stuff of what's going on. I've also tried to tweak the xml specification a little to single out those that are general (to all of anime community) and those that are anidb specific (I use a namespace idea so that anidb stuff like ids, ratings etc are clearly marked).

Also tried throwing in a more general resource tag so that anything can be referenced there. (one example is the anime's main image, any weblinks to external databases, official sites, additional links to images and videos etc)

As I was reading up stuff, it occured to me that if we had some ajax-ready xml api, it could be far more useful than just for ajax. Using XSLT, what was traditionally done on server (transforming data to html) can be pushed to the client. If the data is carefully segmented into largely static ones (like basic anime info that doesn't update a lot) and more dynamic ones (like episodes and files), there is potential gain if inter-server caching can be exploited (since the xsl does not change at all, and the xmls can be chopped up such that some parts do not need to be updated that often and can be locally/isp cached).

The only shortcoming is that xsl is a pure declarative language. So to achive some dynamic formatting (e.g. say if you want every odd row in a table to have different style), may need runtime javascript.

There are some quirks though... e.g. I can't see the generated html source anymore. when I look at source, I see the xml only. dunno whether that's good or bad atm.

one nice thing about this is that the AJAX parts can be built directly on the xml so one common data format may serve the various clients (raw html, xslt, full ajax web app (see the javeline demo link I placed in the readme file))

anyway, attached a sample of what I was trying out. it consists of only a xsl and xml file. Just open the xml file in your browser and the xsl will be automatically applied. If you think this is interesting enough to the rest of the mods (regardless of whether it needs to be interested, I just thought that if they did not know yet, at least they should know that this is possible?)

btw, from the looks of things and the political reason you mentioned for not supporting ajax, I really don't know where to go start or where to go from here. If the general mood is to stick to what we have, does that mean that you and I are just working towards a closed door?


last version doesn't have the language icons, but I made it lookup a publicly available language file (http://schmidt.devlib.org/data/language-names.xml) for the language description translation. took me a while to get used to declarative approach but this version has the nice lang icons we get from AniDB's default styles.


sorry for sending you three mails in a row. this is the final update for some time to come.

following update: --standardized some of the tags to allow dynamic searching.. e.g. when main title is needed and not found, it will grab any title that's available. If maiun image not found it will take any image.

--more proper title management. now titles can be given in any manner as long as it defines a language and the cdata. the xslt will automatically find all the unique values, collect all the languages and display them in one row per unique official title.

--fixed the odd-even row formatting. now the formatting should be correct regardless of how many rows are in the info.

--episode list (no files yet) added. sorted on type and episode number. Episode title is chosen by <defaultlang>...</defaultlang> in the config part of xml. if the language is not found, it will take any language. If no title is found, it will display "unknown title"

--pasted back in the menu (guest access).

--all the links on page is based on anidb.net, so any relative link still link correctly back to anidb site

--added another test data (a235.xml eh.. chosen for the large number of official languages)

I think I will take a break until there is feedback. xslt is just a middle ground, but it is probably the basis for future ajax development, as it totally separates the xml's dependency on formatting. If you are still busy, perhaps I can bring this to the forum by creating an ajax development thread?

Edit the page has fit.

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.