Thread: [Syncato-general] Stylesheet library
Status: Alpha
Brought to you by:
kstaken
|
From: Garth C. <gc...@ab...> - 2004-07-14 18:51:56
|
Anyone got any cool xsl stylsheets for syncato that they'd like to share? I was thinking that it would be nice to put together a collection of stylesheets that people have created for syncato that are not part of the distribution. This is mostly so I can steal your ideas as I'm sure there must be some interesting applications of xslt out there. I don't really have anything to contribute at the moment but I've been trying to get up to speed so I can try a couple of things. I'd like to try to hack together something to add/delete categories from the admin interface. Also, is there currently a way to present query results in a category-like list? I've just copied/modified category.xsl to results-list.xsl but I thought that I might be missing an existing way to do this. Just basic stuff, really, but it seems like it wouldn't be a stretch to do basic calendaring or todo lists, etc. Garth |
|
From: Kimbro S. <ks...@xm...> - 2004-07-15 00:23:22
|
On Jul 14, 2004, at 11:51 AM, Garth Corral wrote: > > Anyone got any cool xsl stylsheets for syncato that they'd like to > share? There aren't a whole lot of Syncato sites around and the ones I've seen have stayed pretty close to default so far. The site for my Photography business is different but it's not anything too useful at this point. http://www.freezinglife.com > > I was thinking that it would be nice to put together a collection of > stylesheets that people have created for syncato that are not part of > the distribution. This will be useful in the future, just be aware that the structure of stylesheets on disk is probably going to change quite a bit after my next commit. I'm separating the blog application from the Syncato backend. As you've begun to realize Syncato is a generic framework for XML based applications and blogging was just my initial target application. It will still do blogging out of the box, but the Syncato "engine" won't have any blogging specific code in it anymore. > This is mostly so I can steal your ideas as I'm sure there must be > some interesting applications of xslt out there. > > I don't really have anything to contribute at the moment but I've been > trying to get up to speed so I can try a couple of things. I'd like > to try to hack together something to add/delete categories from the > admin interface. This should be very easy to do. I'm hoping to have a vastly improved admin interface for the next release, but no promises on when. :-) > Also, is there currently a way to present query results in a > category-like list? Not sure what you mean? > I've just copied/modified category.xsl to results-list.xsl but I > thought that I might be missing an existing way to do this. > > Just basic stuff, really, but it seems like it wouldn't be a stretch > to do basic calendaring or todo lists, etc. Exactly. :-) > > > Garth > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Syncato-general mailing list > Syn...@li... > https://lists.sourceforge.net/lists/listinfo/syncato-general > > Kimbro Staken Software, Consulting and Writing http://www.xmldatabases.org/ |
|
From: Garth C. <gc...@ab...> - 2004-07-15 01:42:36
|
On Jul 14, 2004, at 1:56 PM, Kimbro Staken wrote: >> Also, is there currently a way to present query results in a >> category-like list? > > Not sure what you mean? > I just mean that if I do some arbitrary query like /item/description[photo] or somesuch, I'd like to apply a stylesheet to the results such that I get back a list of titles with a link to the actual item like in a category archive. Like I said, I hacked category.xsl to results-list.xsl so that I can specify ?t=results-list and get what I want but I thought that maybe I was missing something already in the distribution. Sometimes I'm dim that way. >> Just basic stuff, really, but it seems like it wouldn't be a stretch >> to do basic calendaring or todo lists, etc. > > Exactly. :-) > I've been playing around with Tinderbox (not the mozilla build tool) on my powerbook and it kind of scratches an itch I've had for a freeform PIM type application. Unfortunately it doesn't scale that well and I'm pretty much tied to whatever box it's installed on (mac or windows only). It seems like the core of Syncato is just crying out to have something like that built on it. Only it would be available everywhere, on whatever platform I have available so long as I have a web browser (or maybe a python client). And with dbxml it might actually scale. :-) |
|
From: Garth C. <gc...@ab...> - 2004-07-15 02:25:04
|
On Jul 14, 2004, at 6:42 PM, Garth Corral wrote: > > On Jul 14, 2004, at 1:56 PM, Kimbro Staken wrote: > >>> Also, is there currently a way to present query results in a >>> category-like list? >> >> Not sure what you mean? >> > I just mean that if I do some arbitrary query like > /item/description[photo] or somesuch, I'd like to apply a stylesheet > to the results such that I get back a list of titles with a link to > the actual item like in a category archive. Like I said, I hacked > category.xsl to results-list.xsl so that I can specify ?t=results-list > and get what I want but I thought that maybe I was missing something > already in the distribution. Sometimes I'm dim that way. > Just looked at that query and realized it's bogus for this example. I guess I should have just said a query that returns items. |
|
From: Kimbro S. <ks...@xm...> - 2004-07-15 04:35:29
|
On Jul 14, 2004, at 6:42 PM, Garth Corral wrote: > > On Jul 14, 2004, at 1:56 PM, Kimbro Staken wrote: > >>> Also, is there currently a way to present query results in a >>> category-like list? >> >> Not sure what you mean? >> > I just mean that if I do some arbitrary query like > /item/description[photo] or somesuch, I'd like to apply a stylesheet > to the results such that I get back a list of titles with a link to > the actual item like in a category archive. Like I said, I hacked > category.xsl to results-list.xsl so that I can specify ?t=results-list > and get what I want but I thought that maybe I was missing something > already in the distribution. Sometimes I'm dim that way. There probably isn't an existing way. > >>> Just basic stuff, really, but it seems like it wouldn't be a stretch >>> to do basic calendaring or todo lists, etc. >> >> Exactly. :-) >> > I've been playing around with Tinderbox (not the mozilla build tool) > on my powerbook and it kind of scratches an itch I've had for a > freeform PIM type application. Unfortunately it doesn't scale that > well and I'm pretty much tied to whatever box it's installed on (mac > or windows only). It seems like the core of Syncato is just crying > out to have something like that built on it. Only it would be > available everywhere, on whatever platform I have available so long as > I have a web browser (or maybe a python client). And with dbxml it > might actually scale. :-) > If I can ever take Syncato where I want it to go it should be very interesting then. Of course where it is today is just a tiny scratch on the surface and right now I'm just building the little bits in the hope that something useful emerges. > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Syncato-general mailing list > Syn...@li... > https://lists.sourceforge.net/lists/listinfo/syncato-general > > Kimbro Staken Software, Consulting and Writing http://www.xmldatabases.org/ |
|
From: darryl <dev...@cs...> - 2004-07-15 02:49:39
|
Kimbro Staken wrote: > > This will be useful in the future, just be aware that the structure of > stylesheets on disk is probably going to change quite a bit after my > next commit. I'm separating the blog application from the Syncato > backend. As you've begun to realize Syncato is a generic framework for > XML based applications and blogging was just my initial target > application. It will still do blogging out of the box, but the Syncato > "engine" won't have any blogging specific code in it anymore. Sounds interesting Kimbro... -darryl -- http://randomthoughts.vandorp.ca/WK/blog |
|
From: Kimbro S. <ks...@xm...> - 2004-07-15 04:22:31
|
Cool. Did you ever get etags working? On Jul 14, 2004, at 9:41 PM, darryl wrote: > Kimbro Staken wrote: > >> >> This will be useful in the future, just be aware that the structure >> of stylesheets on disk is probably going to change quite a bit after >> my next commit. I'm separating the blog application from the Syncato >> backend. As you've begun to realize Syncato is a generic framework >> for XML based applications and blogging was just my initial target >> application. It will still do blogging out of the box, but the >> Syncato "engine" won't have any blogging specific code in it anymore. > > > Sounds interesting Kimbro... > > -darryl > > -- > http://randomthoughts.vandorp.ca/WK/blog > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Syncato-general mailing list > Syn...@li... > https://lists.sourceforge.net/lists/listinfo/syncato-general > > Kimbro Staken Software, Consulting and Writing http://www.xmldatabases.org/ |
|
From: darryl <dev...@cs...> - 2004-07-15 16:33:54
|
Kimbro Staken wrote:
> Cool.
>
> Did you ever get etags working?
>
>>
>>
Yes and no.
Getting etags working is really simple.
That being said there might be a subtle bug in there somewhere.
It seems to work well enough for aggregators but seems to not work
correctly with multiple reloads with a browser.
What i'm doing is a md5 digest of the result of a GET request. So in
order to get maximum mileage you have to minimize the dynamic content in
the stylesheets. For example the default rss20 template always supplies
the current date. This would, of course, cause the digest to change
every request. So in my template i dropped the date.
------------------8<-------------------------------------------------
def respondToGet(self, transaction):
m = md5.new()
request = transaction.request()
response = transaction.response()
try:
etag = request.serverDictionary()['HTTP_IF_NONE_MATCH']
except:
etag = None
try:
lastmodified =
request.serverDictionary()['HTTP_IF_MODIFIED_SINCE']
except:
lastmodified = None
pathInfo = request.extraURLPath()
print "pathInfo: %s" % pathInfo
try:
stylesheet = request.field('t', "")
# Extra optional argument that can be passed to the stylesheet
arg = request.field('a', "")
# Content query that can be applied as a final step to extract
# something from the rendered content
contentQuery = request.field('c', "")
result = self.weblog.handleRequest(pathInfo, stylesheet,
arg, contentQuery)
# Determine the content-type for the result
if (result.startswith("<?xml")):
contentType = "text/xml"
elif (result.startswith("<html")):
contentType = "text/html"
else:
contentType = "text/plain"
# here we are setting the db-status (which is the timestamp
# of the last modification) as the etag. i'm using an md5 hash
# which is probably completely unnecessary
xml = self.weblog.db.xpathQuery(None, "/status/db-status")
doc = libxml2.parseDoc(xml)
status = doc.xpathEval("//db-status")[0].content
modified = time.strftime("%a, %d %b %Y %H:%M:%S
GMT",time.gmtime(float(status)))
m.update(result)
digest = m.hexdigest()
if digest == etag or modified == lastmodified:
response.setStatus(304, 'Not Modified')
response.write()
else:
response.setStatus(200, 'OK')
response.setHeader('Content-type', contentType)
response.setHeader('Content-length', str(len(result)))
response.setHeader('Etag', digest)
response.setHeader('Last-Modified', modified)
response.write(result)
except NotFoundError:
response.setStatus(404, 'Not Found')
---------8<-----------------------------------------
-darryl
---------
http://randomthoughts.vandorp.ca/WK/blog
|