From paylesworth@stclaircollege.ca Sun Sep 2 20:23:01 2001 From: paylesworth@stclaircollege.ca (Phil Aylesworth) Date: Sun, 02 Sep 2001 15:23:01 -0400 Subject: [ZPT] Structured text in a ZPT Message-ID: <3B928715.2080708@stclaircollege.ca> Can I use format attrubutes in ZPT the way I can in DTML. For example I have an object which contains structured text. In DTML I can use: (or something like that) Is there an equivilant way to do this in ZPT? This has been holding me back from really jumping into ZPT. I hope I am just overlooking something obvious. Phil. From evan@zope.com Sun Sep 2 20:58:49 2001 From: evan@zope.com (Evan Simpson) Date: Sun, 2 Sep 2001 15:58:49 -0400 Subject: [ZPT] Structured text in a ZPT References: <3B928715.2080708@stclaircollege.ca> Message-ID: <002f01c133e9$b17a66b0$75a1f9d1@evansys> From: "Phil Aylesworth" > This has been holding me back from really jumping into ZPT. I hope I am > just overlooking something obvious. It's not obvious, but it's possible. You need to use the 'modules' variable to get the dictionary of standard formatting functions, like this:
The blurb
All of the DTML formatting functions are accessible through special_formats. Since structured-text emits tags, you need to use the 'structure' keyword in the tal:replace statement. Since it's a function, you need to use nocall: when making the nickname 'sttxt', to avoid prematurely calling it. Cheers, Evan @ Zope From sullivan@fotoasia.com Sun Sep 2 19:58:03 2001 From: sullivan@fotoasia.com (FotoAsia) Date: Sun, 02 Sep 2001 18:58:03 GMT Subject: [ZPT] Something to brighten your day! Message-ID: <99945609101@202.157.153.2> FotoAsia Newsletter 2001 September
=09This is a HTML document=2E If you are unable to view this page,= copy this link http://www=2Efotoasia=2Ecom/email/HTML/newsletter/ne= wsletter_200109=2Ehtml
=09into your web browser to view our complete range of= Inspirational Posters=2E
=09=09 =09=09 =09=09 =09=09 =09 =09 =09=09 =09=09 =09=09 =09 =09 =09=09 =09=09 =09 =09 =09=09 =09 =09 =09 =09 =09 =09 =09 =09=09 =09 =09 =09=09 =09=09 =09 =09 =09 =09 =09 =09 =09=09 =09 =09 =09=09 =09
=09=09=09 =09=09=09 =09=09=09 =09=09=09
  =09
 
From mail@peterbe.com Mon Sep 3 10:34:54 2001 From: mail@peterbe.com (Peter Bengtsson) Date: Mon, 3 Sep 2001 11:34:54 +0200 Subject: [ZPT] Stranger than fiction Message-ID: <001401c1345b$b9720450$1c64a8c0@PBN> Zope 2.4.0 and PageTemplates/TAL 1.3.3 I stole some DTML Methods and mixed them among a PageTemplate based site. The DTML Method lists a bunch of files and if viewed alone does NOT render an error. However, when the DTML Method is being "included" by the PageTemplate, I get an error. A cryptic one too. http://zigurat.galdrion.com:8180/Projects/zabber/files/ where the PageTemplate does with http://zigurat.galdrion.com:8180/Projects/zabber/files/listfiles which as you can see works!! What is going on here?? I know that DTML and PageTemplates CAN mix, but what are the restrictions and quirks that I should know of? the 'listfiles' DTML Method calls getFilesequence() (Python Script) which looks like this: return context.REQUEST.PARENTS[0].objectValues('File') Thank you, Peter From evan@zope.com Mon Sep 3 15:10:39 2001 From: evan@zope.com (Evan Simpson) Date: Mon, 3 Sep 2001 10:10:39 -0400 Subject: [ZPT] Stranger than fiction References: <001401c1345b$b9720450$1c64a8c0@PBN> Message-ID: <001101c13482$386a2dc0$75a1f9d1@evansys> From: "Peter Bengtsson" > However, when the DTML Method is being "included" by the PageTemplate, I get > an error. A cryptic one too. Making Page Templates and DTML interoperate well has been a chore, and it's not quite there yet. When a PT calls DTML (in a path expression), it contructs a namespace and pushes some useful values (such as the PT variables) onto it, and passes the namespace to the DTML object. In Zope 2.4 and ZPT 1.3.3, this namespace was missing important security functions :-(. In ZPT 1.4, the security works, but there can be strange effects since the Zope code didn't recognize subclasses of the namespace class. I *hope* everything will be fixed in the next release of ZPT and Zope. Cheers, Evan @ Zope From dieter@handshake.de Mon Sep 3 23:37:10 2001 From: dieter@handshake.de (Dieter Maurer) Date: Tue, 4 Sep 2001 00:37:10 +0200 (CEST) Subject: [ZPT] Stranger than fiction In-Reply-To: <001401c1345b$b9720450$1c64a8c0@PBN> References: <001401c1345b$b9720450$1c64a8c0@PBN> Message-ID: <15252.1558.784890.727642@lindm.dm> Peter Bengtsson writes: > http://zigurat.galdrion.com:8180/Projects/zabber/files/ where the > PageTemplate > does Try: Dieter From alex@quad.com.ar Tue Sep 4 09:16:48 2001 From: alex@quad.com.ar (alex@quad.com.ar) Date: Tue, 4 Sep 2001 05:16:48 -0300 Subject: [ZPT] html being quoted Message-ID: <006f01c13519$f1d6df50$0201a8c0@ALEX> Hi there ZPT'ers some time ago I've developed a poll product that outputs html code and ZPT html_quote's the result. in DTML i usually do and I get what I expect. now I've tried to use that under Page Template by doing: but all the HTML outputed by myProduct is being quoted by ZPT. just like when I call it with I guess there can be 2 workarounds.. one by doing something at ZPT, another by tweaking my poll Product.. I was actually intersted in both solutions (if both exist). any suggestions would be great. Thanks Alex Verstraeten From Geir Bækholt Tue Sep 4 09:18:01 2001 From: Geir Bækholt (Geir Bækholt) Date: Tue, 4 Sep 2001 10:18:01 +0200 Subject: [ZPT] html being quoted In-Reply-To: <006f01c13519$f1d6df50$0201a8c0@ALEX> References: <006f01c13519$f1d6df50$0201a8c0@ALEX> Message-ID: <51194747.20010904101801@funcom.com> this behaviour is deliberate.. use : tal:replace=3D"structure container/pollBooth"> on or about, Tuesday, September 04, 2001, we have reason to believe that al= ex@quad.com.ar wrote something along the lines of : aqca> Hi there ZPT'ers aqca> some time ago I've developed a poll product that outputs html code an= d ZPT aqca> html_quote's the result. aqca> in DTML i usually do and I get what I expect= . now aqca> I've tried to use that under Page Template by doing: tal:replace=3D"container/pollBooth"> but all the HTML outputed by myP= roduct is aqca> being quoted by ZPT. aqca> just like when I call it with aqca> I guess there can be 2 workarounds.. one by doing something at ZPT, a= nother aqca> by tweaking my poll Product.. I was actually intersted in both soluti= ons (if aqca> both exist). aqca> any suggestions would be great. aqca> Thanks aqca> Alex Verstraeten --=20 Geir B=E6kholt web-developer/zopatista geirh@funcom.com funcom oslo | webdev-team From phil.harris@zope.co.uk Tue Sep 4 14:22:33 2001 From: phil.harris@zope.co.uk (Phil Harris) Date: Tue, 4 Sep 2001 09:22:33 -0400 Subject: [ZPT] html being quoted In-Reply-To: <006f01c13519$f1d6df50$0201a8c0@ALEX> References: <006f01c13519$f1d6df50$0201a8c0@ALEX> Message-ID: <01090409223301.01501@localhost.localdomain> ed, Simply change the call to this: This stops the quoting. hth Phil On Tuesday 04 September 2001 04:16, alex@quad.com.ar wrote: > Hi there ZPT'ers > > some time ago I've developed a poll product that outputs html code and ZPT > html_quote's the result. > > in DTML i usually do and I get what I expect. now > I've tried to use that under Page Template by doing: tal:replace="container/pollBooth"> but all the HTML outputed by myProduct > is being quoted by ZPT. > just like when I call it with > > I guess there can be 2 workarounds.. one by doing something at ZPT, another > by tweaking my poll Product.. I was actually intersted in both solutions > (if both exist). > > any suggestions would be great. > > Thanks > > Alex Verstraeten > > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From phil.harris@zope.co.uk Tue Sep 4 14:27:34 2001 From: phil.harris@zope.co.uk (Phil Harris) Date: Tue, 4 Sep 2001 09:27:34 -0400 Subject: [ZPT] html being quoted In-Reply-To: <01090409223301.01501@localhost.localdomain> References: <006f01c13519$f1d6df50$0201a8c0@ALEX> <01090409223301.01501@localhost.localdomain> Message-ID: <01090409273403.01501@localhost.localdomain> Why did I think you were ed colmar? I'm going a bit blind I think! On Tuesday 04 September 2001 09:22, Phil Harris wrote: > ed, > > Simply change the call to this: > > > > This stops the quoting. > > hth > > Phil > > On Tuesday 04 September 2001 04:16, alex@quad.com.ar wrote: > > Hi there ZPT'ers > > > > some time ago I've developed a poll product that outputs html code and > > ZPT html_quote's the result. > > > > in DTML i usually do and I get what I expect. > > now I've tried to use that under Page Template by doing: > tal:replace="container/pollBooth"> but all the HTML outputed by myProduct > > is being quoted by ZPT. > > just like when I call it with > > > > I guess there can be 2 workarounds.. one by doing something at ZPT, > > another by tweaking my poll Product.. I was actually intersted in both > > solutions (if both exist). > > > > any suggestions would be great. > > > > Thanks > > > > Alex Verstraeten > > > > > > _______________________________________________ > > ZPT mailing list > > ZPT@zope.org > > http://lists.zope.org/mailman/listinfo/zpt > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From Fred L. Drake" Tue Sep 4 15:53:26 2001 From: Fred L. Drake" (Fred L. Drake" ) Date: Tue, 4 Sep 2001 10:53:26 -0400 Subject: [ZPT] CVS: Packages/TAL/tests - test_htmlparser.py:1.15 Message-ID: <200109041453.f84ErQT20780@cvs.baymountain.com> Update of /cvs-repository/Packages/TAL/tests In directory cvs.zope.org:/tmp/cvs-serv20772 Modified Files: test_htmlparser.py Log Message: Add more tests to cover edge cases that are legal in either HTML (bare pointy brackets & ampersands) or XHTML (hexadecimal character references), but not both. Also added a test for DOCTYPE declaration parsing. === Packages/TAL/tests/test_htmlparser.py 1.14 => 1.15 === self.append(("pi", data)) + def unknown_decl(self, decl): + self.append(("unknown decl", decl)) + class EventCollectorExtra(EventCollector): @@ -117,6 +120,7 @@ comment1b--> sample text +“ """, [ @@ -131,13 +135,36 @@ ("data", "\n"), ("starttag", "img", [("src", "Bar"), ("ismap", None)]), ("data", "sample\ntext\n"), + ("charref", "x201C"), + ("data", "\n"), ("comment", "comment2a-- --comment2b"), ("data", "\n"), ("endtag", "html"), ("data", "\n"), ]) + def check_doctype_decl(self): + inside = """\ +DOCTYPE html [ + + + + + + + %paramEntity; + +]""" + self._run_check("" % inside, [ + ("decl", inside), + ]) + def check_bad_nesting(self): + # Strangely, this *is* supposed to test that overlapping + # elements are allowed. HTMLParser is more geared toward + # lexing the input that parsing the structure. self._run_check("", [ ("starttag", "a", []), ("starttag", "b", []), @@ -145,6 +172,16 @@ ("endtag", "b"), ]) + def check_bare_ampersands(self): + self._run_check("this text & contains & ampersands &", [ + ("data", "this text & contains & ampersands &"), + ]) + + def check_bare_pointy_brackets(self): + self._run_check("this < text > contains < bare>pointy< brackets", [ + ("data", "this < text > contains < bare>pointy< brackets"), + ]) + def check_attr_syntax(self): output = [ ("starttag", "a", [("b", "v"), ("c", "v"), ("d", "v"), ("e", None)]) @@ -174,6 +211,14 @@ ("starttag", "a", [("a.b", "v"), ("c:d", "v"), ("e-f", "v")]), ]) + def check_illegal_declarations(self): + s = 'abcdef' + self._run_check(s, [ + ("data", "abc"), + ("unknown decl", 'spacer type="block" height="25"'), + ("data", "def"), + ]) + def check_starttag_end_boundary(self): self._run_check("""""", [("starttag", "a", [("b", "<")])]) self._run_check("""""", [("starttag", "a", [("b", ">")])]) @@ -196,17 +241,12 @@ self._run_check([""], output) def check_starttag_junk_chars(self): - self._parse_error("<") - self._parse_error("<>") self._parse_error("") self._parse_error("") self._parse_error("") self._parse_error("") - self._parse_error("<$") - self._parse_error("<$>") self._parse_error("") self._parse_error(" Tue Sep 4 15:55:18 2001 From: Fred L. Drake" (Fred L. Drake" ) Date: Tue, 4 Sep 2001 10:55:18 -0400 Subject: [ZPT] CVS: Packages/TAL - HTMLParser.py:1.17 Message-ID: <200109041455.f84EtI421421@cvs.baymountain.com> Update of /cvs-repository/Packages/TAL In directory cvs.zope.org:/tmp/cvs-serv21413 Modified Files: HTMLParser.py Log Message: Move several comments to become docstings. Added reasonable parsing of the DOCTYPE declaration, fixed edge cases regarding bare ampersands in content. === Packages/TAL/HTMLParser.py 1.16 => 1.17 === +"""A parser for HTML and XHTML.""" # This file is derived from sgmllib.py, which is part of Python. @@ -15,10 +15,10 @@ interesting_normal = re.compile('[&<]') interesting_cdata = re.compile(r'<(/|\Z)') -incomplete = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*|#[0-9]*)?') +incomplete = re.compile('&[a-zA-Z#]') entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') -charref = re.compile('&#([0-9]+)[^0-9]') +charref = re.compile('&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]') starttagopen = re.compile('<[a-zA-Z]') piopen = re.compile(r'<\?') @@ -73,32 +73,35 @@ return result -# HTML parser class -- find tags and call handler functions. -# Usage: -# -# p = HTMLParser(); p.feed(data); ...; p.close() - -# Start tags are handled by calling self.handle_starttag() or -# self.handle_startendtag(); end tags by self.handle_endtag(). The -# data between tags is passed from the parser to the derived class by -# calling self.handle_data() with the data as argument (the data may -# be split up in arbitrary chunks). Entity references are passed by -# calling self.handle_entityref() with the entity reference as the -# argument. Numeric character references are passed to -# self.handle_charref() with the string containing the reference as -# the argument. - class HTMLParser: + """Find tags and other markup and call handler functions. + + Usage: + p = HTMLParser() + p.feed(data) + ... + p.close() + + Start tags are handled by calling self.handle_starttag() or + self.handle_startendtag(); end tags by self.handle_endtag(). The + data between tags is passed from the parser to the derived class + by calling self.handle_data() with the data as argument (the data + may be split up in arbitrary chunks). Entity references are + passed by calling self.handle_entityref() with the entity + reference as the argument. Numeric character references are + passed to self.handle_charref() with the string containing the + reference as the argument. + """ CDATA_CONTENT_ELEMENTS = ("script", "style") - # Interface -- initialize and reset this instance def __init__(self): + """Initialize and reset this instance.""" self.reset() - # Interface -- reset this instance. Loses all unprocessed data def reset(self): + """Reset this instance. Loses all unprocessed data.""" self.rawdata = '' self.stack = [] self.lasttag = '???' @@ -106,16 +109,17 @@ self.offset = 0 self.interesting = interesting_normal - # Interface -- feed some data to the parser. Call this as - # often as you want, with as little or as much text as you - # want (may include '\n'). (This just saves the text, all the - # processing is done by goahead().) def feed(self, data): + """Feed data to the parser. + + Call this as often as you want, with as little or as much text + as you want (may include '\n'). + """ self.rawdata = self.rawdata + data self.goahead(0) - # Interface -- handle the remaining data def close(self): + """Handle any buffered data.""" self.goahead(1) # Internal -- update line number and offset. This should be @@ -135,14 +139,14 @@ self.offset = self.offset + j-i return j - # Interface -- return current line number and offset. def getpos(self): + """Return current line number and offset.""" return self.lineno, self.offset __starttag_text = None - # Interface -- return full source of start tag: "<...>" def get_starttag_text(self): + """Return full source of start tag: '<...>'.""" return self.__starttag_text def set_cdata_mode(self): @@ -180,45 +184,56 @@ k = self.parse_pi(i) elif declopen.match(rawdata, i): # ' n = len(rawdata) + decltype = None + extrachars = "" while j < n: c = rawdata[j] if c == ">": # end of declaration syntax - self.handle_decl(rawdata[i+2:j]) + data = rawdata[i+2:j] + if decltype == "doctype": + self.handle_decl(data) + else: + self.unknown_decl(data) return j + 1 if c in "\"'": m = declstringlit.match(rawdata, j) @@ -269,11 +291,241 @@ if not m: return -1 # incomplete j = m.end() + if decltype is None: + decltype = m.group(0).rstrip().lower() + if decltype != "doctype": + extrachars = "=" + elif c == "[" and decltype == "doctype": + j = self.parse_doctype_subset(j + 1, i) + if j < 0: + return j + elif c in extrachars: + j = j + 1 + while j < n and rawdata[j] in string.whitespace: + j = j + 1 + if j == n: + # end of buffer while in declaration + return -1 else: raise HTMLParseError( "unexpected char in declaration: %s" % `rawdata[j]`, self.getpos()) + decltype = decltype or '' return -1 # incomplete + + # Internal -- scan past the internal subset in a n: + # end of buffer; incomplete + return -1 + if rawdata[j:j+4] == " From steve@spvi.com Wed Sep 5 10:57:55 2001 From: steve@spvi.com (Steve Spicklemire) Date: Wed, 5 Sep 2001 04:57:55 -0500 Subject: [ZPT] Batching and sequence-index ? In-Reply-To: <11590341484.20010905110347@funcom.com> Message-ID: <7A5AB47E-A1E4-11D5-BD7C-0050E480B13C@spvi.com> Hi Geir, from Batch.py: def __getitem__(self, index): if index < 0: if index + self.end < self.first: raise IndexError, index return self._sequence[index + self.end] if index >=3D self.size: raise IndexError, index return self._sequence[index+self.first] Looks like you want "path('repeat/yourvar/index') +=20 whatYouUsedAsStart - 1" or even better "path('repeat/yourvar/index') + batchObject.first" The Batch object doesn't seem to store this anywhere handy. -steve On Wednesday, September 5, 2001, at 04:03 AM, Geir B=E6kholt wrote: > > Does the Batch-module of ZTUtils return something similar to=20 > sequence-number or > sequence-index?? > > I seem to be able to whatever else i want , but i cannot find any > reference to a variable telling me where in the sequence i am... > > -- > Geir B=E6kholt web-developer/zopatista > geirh@funcom.com funcom oslo | webdev-team > > > > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From Geir Bækholt Wed Sep 5 11:40:00 2001 From: Geir Bækholt (Geir Bækholt) Date: Wed, 5 Sep 2001 12:40:00 +0200 Subject: [ZPT] Batching and sequence-index ? In-Reply-To: <7A5AB47E-A1E4-11D5-BD7C-0050E480B13C@spvi.com> References: <7A5AB47E-A1E4-11D5-BD7C-0050E480B13C@spvi.com> Message-ID: <19396114084.20010905124000@funcom.com> Thanks, Steve. That did it. :-) on or about, Wednesday, September 05, 2001, we have reason to believe that = Steve Spicklemire wrote something along the lines of : SS> Hi Geir, SS> from Batch.py: SS> def __getitem__(self, index): SS> if index < 0: SS> if index + self.end < self.first: raise IndexError, index SS> return self._sequence[index + self.end] SS> if index >=3D self.size: raise IndexError, index SS> return self._sequence[index+self.first] SS> Looks like you want "path('repeat/yourvar/index') +=20 SS> whatYouUsedAsStart - 1" SS> or even better SS> "path('repeat/yourvar/index') + batchObject.first" SS> The Batch object doesn't seem to store this anywhere handy. SS> -steve --=20 Geir B=E6kholt web-developer/zopatista geirh@funcom.com funcom oslo | webdev-team From frank_stephan@gmx.de Wed Sep 5 12:32:49 2001 From: frank_stephan@gmx.de (Frank Stephan) Date: Wed, 5 Sep 2001 13:32:49 +0200 Subject: [ZPT] Using Zope with Amaya, Dreamweaver, and Other WYSIWYG Tools Message-ID: Hi, I tried to follow the article http://www.zope.org/Documentation/Articles/ZPT3 I have a problem with this: Now, with your editor, save the above HTML to the URL http://your.zope/FileLib/index_html/source.html. Notice that the URL to save the index_html page ends in source.html. As there is alread a file called 'index_html' in URL /FileLib/, I can not create a directory called 'index_html' where I have to put the 'source.html' in. TIA Frank From smoerk@gmx.de" Message-ID: I also needed Acquisition, ComputedAttribute, ExtensionClass and MultiMapping. But this are all *.pyd files (from windows zope 2.4.1), which I assume are C extensions. Not very plug and play portable. TAL works without any additional modules with Python 2.x, but I didn't found a description how to use TAL in Python. Is there any documentation? On Wed, 15 Aug 2001 16:15:58 -0400, Evan Simpson wrote: >smoerk@gmx.de wrote: >> is it possible to use ZPT without Zope in Python program? > >It is possible to use PageTemplates without Zope, not ZPT (short for >Zope Page Templates). With ExtensionClass, TAL, ZTUtils, and >PageTemplates on your Python path, you should be able to: > >>>> from PageTemplates.PageTemplate import PageTemplate >>>> pt = PageTemplate() > >>> pt.write('''

... tal:content="python:x+1">???

''') > >>> print pt(x=1) >

11

> > >>> > >Cheers, > >Evan @ 4-am & Zope > From alex@quad.com.ar Wed Sep 5 14:08:21 2001 From: alex@quad.com.ar (alex@quad.com.ar) Date: Wed, 5 Sep 2001 10:08:21 -0300 Subject: [ZPT] Using Zope with Amaya, Dreamweaver, and Other WYSIWYG Tools References: Message-ID: <001701c1360b$d7039180$0201a8c0@ALEX> well, I'm not sure how you can perform that if you use dreamweaver, what I do is start zope with -W 8010, this opens a webdav "source" port, then connect to that port from DW, so, you just open and save the file directly, without having to save it as 'file/source.html'. maybe there's another workaround, but I find this way quite straight forward. Alex ----- Original Message ----- From: "Frank Stephan" To: "Zope ZPT" Sent: Wednesday, September 05, 2001 8:32 AM Subject: [ZPT] Using Zope with Amaya, Dreamweaver, and Other WYSIWYG Tools > Hi, > > I tried to follow the article > http://www.zope.org/Documentation/Articles/ZPT3 > > I have a problem with this: > > Now, with your editor, save the above HTML to the URL > http://your.zope/FileLib/index_html/source.html. > Notice that the URL to save the index_html page ends in source.html. > > As there is alread a file called 'index_html' in URL /FileLib/, > I can not create a directory called 'index_html' where I have to put the > 'source.html' in. > > TIA > Frank > > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt > From jim@zope.com Wed Sep 5 14:57:56 2001 From: jim@zope.com (Jim Fulton) Date: Wed, 05 Sep 2001 09:57:56 -0400 Subject: [ZPT] Using Zope with Amaya, Dreamweaver, and Other WYSIWYG Tools References: Message-ID: <3B962F64.260FE5DF@zope.com> Frank Stephan wrote: > > Hi, > > I tried to follow the article > http://www.zope.org/Documentation/Articles/ZPT3 > > I have a problem with this: > > Now, with your editor, save the above HTML to the URL > http://your.zope/FileLib/index_html/source.html. > Notice that the URL to save the index_html page ends in source.html. > > As there is alread a file called 'index_html' in URL /FileLib/, This is a page template you created according to the instructions. Right? > I can not create a directory called 'index_html' where I have to put the > 'source.html' in. The page template "contains" source.html, and you can save updated source to it. If you tell Amaya to save to this URL, it should work. I prefer to approach this slightly differently. I browse to the source via the link on the edit screen and edit the page there. Then when I save, Amaya will do the right thing. I have discovered a fairly serious problem with using the .../pagetemplate/source.html approach, which is that relative links aren't handled correctly. This is particularly painful with images. :( Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (888) 344-4332 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org From ksmith@99hats.com Wed Sep 5 23:15:17 2001 From: ksmith@99hats.com (ksmith@99hats.com) Date: Wed, 5 Sep 2001 18:15:17 -0400 Subject: [ZPT] Batching Oddity Message-ID: <200109052215.SAA11740@ns3.99hats.com> This is a multi-part message in MIME format. ----------999728117 Content-Type: text/plain Content-Transfer-Encoding: 7bit I have ZPT 1.4.0 on Zope 2.3.2 I'm using classes to create a UBB clone. I never had any problems displaying forums and topics until I added batching to the forum_template. Whenever I use batching as described in the DTMLtoZPT conversion wiki page, I run to intermittent DNS errors on IE or Unexpected Network Read Error on Lynx. When jumping around to other ZPT pages. It can take four or five attempts to load a ZPT page. Once loaded, the page is easy to access after that. In the Z2.log, no activity shows until I can finally load the page. However, when it does load the page I get a 304. Does anyone have any ideas where I should be looking for trouble? ZBoard (Folderish Zclass) - index_html --> dtml-var board_template (ZPT) ZForum (Folderish Zclass) - index_html --> dtml-var forum_template (ZPT) ZTopic (Folderish Zclass) - index_html --> dtml-var topic_template (ZPT) ZReply (Folderish ZClass) forum_template < table border="0" cellpadding="4" cellspacing="1" width="100%" tal:define="b_start python:path('request/b_start') or 0; results python:here.listTopics(); Batch python:modules['ZTUtils'].Batch; batch python:Batch(results, 10, int(b_start),orphan=6)" > < tr bgcolor=ffffff> < a href="nextbatch" tal:define="p batch/previous" tal:condition="p" tal:attributes="href string:?b_start=${p/first}"> << Previous < span tal:replace="p/length" >n
    < a href="nextbatch" tal:define="n batch/next" tal:condition="n" tal:attributes="href string:?b_start=${batch/end}" > Next < span tal:replace="n/length" >n< /span > >> < /a > < /td >< /tr > ----------999728117-- From alex@quad.com.ar Thu Sep 6 02:02:02 2001 From: alex@quad.com.ar (alex@quad.com.ar) Date: Wed, 5 Sep 2001 22:02:02 -0300 Subject: [ZPT] Batching Oddity References: <200109052215.SAA11740@ns3.99hats.com> Message-ID: <001501c1366f$8a030cd0$0201a8c0@ALEX> there's something I dont get, why doing batching on a template system, it's supposed to be just for presentation, my suggestion: write a python script that does all the batching and stuff, then call the template from it. wrapping templates from python script makes a much better separation of logic/presentation imho... anyone agrees? Alex ----- Original Message ----- From: To: Sent: Wednesday, September 05, 2001 7:15 PM Subject: [ZPT] Batching Oddity > I have ZPT 1.4.0 on Zope 2.3.2 > > I'm using classes to create a UBB clone. > > I never had any problems displaying forums and topics until I added batching to the forum_template. Whenever I use batching as described in the DTMLtoZPT conversion wiki page, I run to intermittent DNS errors on IE or Unexpected Network Read Error on Lynx. When jumping around to other ZPT pages. > > It can take four or five attempts to load a ZPT page. Once loaded, the page is easy to access after that. > > > In the Z2.log, no activity shows until I can finally load the page. However, when it does load the page I get a 304. > > Does anyone have any ideas where I should be looking for trouble? > > > ZBoard (Folderish Zclass) > - index_html --> dtml-var board_template (ZPT) > ZForum (Folderish Zclass) > - index_html --> dtml-var forum_template (ZPT) > ZTopic (Folderish Zclass) > - index_html --> dtml-var topic_template (ZPT) > ZReply (Folderish ZClass) > > > > forum_template > > < table border="0" cellpadding="4" cellspacing="1" width="100%" tal:define="b_start python:path('request/b_start') or 0; > results python:here.listTopics(); > Batch python:modules['ZTUtils'].Batch; > batch python:Batch(results, 10, int(b_start),orphan=6)" > > > > < tr bgcolor=ffffff> > < a href="nextbatch" > tal:define="p batch/previous" > tal:condition="p" > tal:attributes="href string:?b_start=${p/first}"> > << Previous < span tal:replace="p/length" >n > >     > < a href="nextbatch" tal:define="n batch/next" > tal:condition="n" > tal:attributes="href string:?b_start=${batch/end}" > > Next < span tal:replace="n/length" >n< /span > >> > < /a > > > < /td >< /tr > > > > From tony.mcdonald@ncl.ac.uk Thu Sep 6 14:20:07 2001 From: tony.mcdonald@ncl.ac.uk (Tony McDonald) Date: Thu, 06 Sep 2001 14:20:07 +0100 Subject: [ZPT] Can't use 'document_src' in python script - a PageTemplate alternative? Message-ID: Hi all, This is a rehash of a XXX-PythonMethod (remember them!) I had this at the top of my original XXX-PythonMethod import DocumentTemplate savedir = self.savedir template_str = self.template.read_raw() template = DocumentTemplate.HTML(template_str) ...and further on... theresult = template(self, results=results, identifier=identifier) return theresult (ie it gets a DTML method called 'template' and then fills in the and areas to create a filled-in document) But the PythonScript complained a bit, so I changed it to import DocumentTemplate self = context REQUEST = self.REQUEST savedir = self.savedir # template_str = self.template.read_raw() template_str = self.template.document_src() template = DocumentTemplate.HTML(template_str) But it still doesn't want to let me touch document_src (it also complained about read_raw). I'm in the process of changing this site to use ZPT, so is there a better way of doing this using PythonScripts and PageTemplates? What is the idiom for doing this sort of thing in ZPT anyhow? TIA Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope From mail@peterbe.com Thu Sep 6 17:53:20 2001 From: mail@peterbe.com (Peter Bengtsson) Date: Thu, 6 Sep 2001 18:53:20 +0200 Subject: [ZPT] METAL expansion only when editing Message-ID: <00f301c136f6$399f7210$1c64a8c0@PBN> I have a site; with lots of little pieces of PageTemplates. Some just contain a little HTML table on 10 lines. There is no one page that I can open in Dreamweaver (if I'd want to) and have a look of how all will look. index_html looks like this:
(almost) So, here's my simple problem: 1) I want to have the cool functionality of METAL when editing so that I can have a header and footer around little tables in Dreamweaver. 2) When rendered as a webpage I want no METAL expansion. Is this possible without a hack? With a hack? A hack? Cheers, Peter From ksmith@99hats.com Thu Sep 6 19:25:34 2001 From: ksmith@99hats.com (ksmith@99hats.com) Date: Thu, 6 Sep 2001 14:25:34 -0400 Subject: [ZPT] python:OR problems Message-ID: <200109061825.OAA17698@ns3.99hats.com> This is a multi-part message in MIME format. ----------999800734 Content-Type: text/plain Content-Transfer-Encoding: 7bit This works: tal:define="batchsize python:5; b_start python:path('request/b_start');" This causes Network Errors if the or side is excecuted: tal:define="batch python:path('request/batch') or 5; b_start python:path('request/b_start') or 5;" Am I doing something wrong here? Or perhaps this is a bug? Kevin Zope 2.3.2 ZTUtils-1.1.1.tar.gz 1.1.1 (Stable) 2001/08/13 TAL-1.4.0.tar.gz 1.4.0 (Stable) 2001/08/13 PageTemplates-1.4.0.tar.gz 1.4.0 (Stable) 2001/08/13 ----------999800734-- From mail@peterbe.com Fri Sep 7 10:01:33 2001 From: mail@peterbe.com (Peter Bengtsson) Date: Fri, 7 Sep 2001 11:01:33 +0200 Subject: [ZPT] DTML lawyers, please look here Message-ID: <000901c1377b$b4a5e2c0$1c64a8c0@PBN> I just added this http://www.zope.org/Members/peterbe/DTML2ZPT/examples/example18/view All the pipes are to simulate the way DTML works when it's trying to find a reference. Can you check that I've got this right? Cheers, Peter From evan@zope.com Fri Sep 7 16:02:05 2001 From: evan@zope.com (Evan Simpson) Date: Fri, 07 Sep 2001 11:02:05 -0400 Subject: [ZPT] Re: [Zope] using ZPT/TAL without zope References: Message-ID: <3B98E16D.8000703@zope.com> smoerk@gmx.de wrote: > TAL works without any additional modules with Python 2.x, but I didn't > found a description how to use TAL in Python. Is there any > documentation? Not apart from the "examples" in the TAL source and unit tests, no. Cheers, Evan @ Zope From evan@zope.com Fri Sep 7 19:12:32 2001 From: evan@zope.com (Evan Simpson) Date: Fri, 07 Sep 2001 14:12:32 -0400 Subject: [ZPT] python:OR problems References: <200109061825.OAA17698@ns3.99hats.com> Message-ID: <3B990E10.9030405@zope.com> ksmith@99hats.com wrote: > tal:define="batchsize python:5; b_start python:path('request/b_start');" > > This causes Network Errors if the or side is excecuted: > > tal:define="batch python:path('request/batch') or 5; b_start python:path('request/b_start') or 5;" Why 'batchsize' in one, and 'batch' in the other? 'batch' isn't conflicting with another variable, is it? > Am I doing something wrong here? Or perhaps this is a bug? Hard to tell. I'd need to see more context. Cheers, Evan @ Zope From evan@zope.com Fri Sep 7 19:16:30 2001 From: evan@zope.com (Evan Simpson) Date: Fri, 07 Sep 2001 14:16:30 -0400 Subject: [ZPT] METAL expansion only when editing References: <00f301c136f6$399f7210$1c64a8c0@PBN> Message-ID: <3B990EFE.5080501@zope.com> Peter Bengtsson wrote: > I have a site; with lots of little pieces of PageTemplates. Some just > contain a little HTML table on 10 lines. >
>
>
Are these the little tables in PageTemplates? Why not use macros instead of tal:replace? Macros were invented specifically so that you *wouldn't* need to have a zillion little HTML fragments with no page context. > 1) I want to have the cool functionality of METAL when editing so that I > can have a header and footer around little tables in Dreamweaver. > > 2) When rendered as a webpage I want no METAL expansion. Sorry, I don't understand. Cheers, Evan @ Zope From evan@zope.com Fri Sep 7 19:18:23 2001 From: evan@zope.com (Evan Simpson) Date: Fri, 07 Sep 2001 14:18:23 -0400 Subject: [ZPT] Can't use 'document_src' in python script - a PageTemplate alternative? References: Message-ID: <3B990F6F.2050200@zope.com> Tony McDonald wrote: > (ie it gets a DTML method called 'template' and then fills in the results> and areas to create a filled-in document) Why don't you just call the template directly? Why make a temporary copy of it? Cheers, Evan @ Zope From evan@zope.com Fri Sep 7 19:20:21 2001 From: evan@zope.com (Evan Simpson) Date: Fri, 07 Sep 2001 14:20:21 -0400 Subject: [ZPT] Batching Oddity References: <200109052215.SAA11740@ns3.99hats.com> <001501c1366f$8a030cd0$0201a8c0@ALEX> Message-ID: <3B990FE5.5030007@zope.com> alex@quad.com.ar wrote: > there's something I dont get, why doing batching on a template system, it's > supposed to be just for presentation, my suggestion: write a python script > that does all the batching and stuff, then call the template from it. > wrapping templates from python script makes a much better separation of > logic/presentation imho... anyone agrees? It's a matter of taste, I guess. I would usually write a Script, unless the batch is dirt-simple, in which case I might be tempted to just embed it in the template. Cheers, Evan @ Zope From evan@zope.com Fri Sep 7 19:23:36 2001 From: evan@zope.com (Evan Simpson) Date: Fri, 07 Sep 2001 14:23:36 -0400 Subject: [ZPT] Batching Oddity References: <200109052215.SAA11740@ns3.99hats.com> Message-ID: <3B9910A8.4080409@zope.com> ksmith@99hats.com wrote: > tal:attributes="href string:?b_start=${p/first}"> I don't know if this has anything to do with the symptoms you describe, but this href really should have a full path in it, as in '${request/URL}?b_start=${p/first}', rather than a bare query string. I know, you just copied it from my example, mea culpa :-) Cheers, Evan @ Zope From dieter@handshake.de Fri Sep 7 21:57:47 2001 From: dieter@handshake.de (Dieter Maurer) Date: Fri, 7 Sep 2001 22:57:47 +0200 (CEST) Subject: [ZPT] [BUG & PATCH] Parse restarts for incomplete entity reference Message-ID: <15257.13515.639036.796502@lindm.dm> --p5o5JR7Yed Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit When ZPT's (version 1.4) HTML parser finds an incomplete entity (or character) reference, it restarts parsing at the start. If it encountered a macro definition before the incomplete entity reference, this will lead to a TAL.TALDefs.METALError: duplicate macro definition: .... exception, as shown by the attached ZPT. Patch attached... Dieter --p5o5JR7Yed Content-Type: text/x-zpt Content-Description: ZPT demonstrating parsing restart for incomplete entity/character reference Content-Disposition: inline; filename="x.zpt" Content-Transfer-Encoding: 7bit & bug

& bug

a & b


Dieter Maurer
Last modified: Fri Sep 7 22:39:53 CEST 2001 --p5o5JR7Yed Content-Type: application/x-patch Content-Description: Patch for "parse restart for incomplete entity reference" Content-Disposition: attachment; filename="zpt_parse_ent.pat" Content-Transfer-Encoding: base64 LS0tIGxpYi9weXRob24vVEFMLzpIVE1MUGFyc2VyLnB5CVdlZCBKdWwgMTggMTg6MzU6NTQgMjAw MQorKysgbGliL3B5dGhvbi9UQUwvSFRNTFBhcnNlci5weQlGcmkgU2VwICA3IDIyOjQ3OjIzIDIw MDEKQEAgLTIxNiw2ICsyMTYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgcmFpc2UgSFRN TFBhcnNlRXJyb3IoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVPRiBpbiBtaWRkbGUg b2YgZW50aXR5IG9yIGNoYXIgcmVmIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxm LmdldHBvcygpKQorICAgICAgICAgICAgICAgICAgICBzZWxmLnJhd2RhdGE9IHJhd2RhdGFbaTpd CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtMSAjIGluY29tcGxldGUKICAgICAgICAgICAg ICAgICByYWlzZSBIVE1MUGFyc2VFcnJvcigiJyYnIG5vdCBwYXJ0IG9mIGVudGl0eSBvciBjaGFy IHJlZiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5nZXRwb3Mo KSkK --p5o5JR7Yed-- From dieter@handshake.de Fri Sep 7 23:40:01 2001 From: dieter@handshake.de (Dieter Maurer) Date: Sat, 8 Sep 2001 00:40:01 +0200 (CEST) Subject: [ZPT] python:OR problems In-Reply-To: <200109061825.OAA17698@ns3.99hats.com> References: <200109061825.OAA17698@ns3.99hats.com> Message-ID: <15257.19649.385081.861489@lindm.dm> ksmith@99hats.com writes: > tal:define="batch python:path('request/batch') or 5; b_start python:path('request/b_start') or 5;" The "path(...)" will fail (exception) when "request" does not contain the given names. While the '|' in "path1 | path2" evaluates "path2" if "path1" evaluation raises an exception, Python's "or" does not work this way: "exp1 or exp2" raises an exception, if "exp1" does.... Dieter From dieter@handshake.de Sat Sep 8 18:41:34 2001 From: dieter@handshake.de (Dieter Maurer) Date: Sat, 8 Sep 2001 19:41:34 +0200 (CEST) Subject: [ZPT] Batching Oddity In-Reply-To: <3B9910A8.4080409@zope.com> References: <200109052215.SAA11740@ns3.99hats.com> <3B9910A8.4080409@zope.com> Message-ID: <15258.22606.41105.265439@lindm.dm> Evan Simpson writes: > ksmith@99hats.com wrote: > > > tal:attributes="href string:?b_start=${p/first}"> > > I don't know if this has anything to do with the symptoms you describe, > but this href really should have a full path in it, as in > '${request/URL}?b_start=${p/first}', rather than a bare query string. I > know, you just copied it from my example, mea culpa :-) Why? Relative URI references should work... The browser should make an absolute URL be prepending the document URL (and not the base URL). Dieter From alan runyan" i am in need of having a textarea display lines like you do in DTML. subject1 subject2 subject3 but the problem is when there are no contentSubjects i get a huge gaping space inbetween , should I just parse this before saving it in a python script or is there something i could do in ZPT to make it format like DTML thanks, ~runyaga From evan@zope.com Sat Sep 8 22:55:44 2001 From: evan@zope.com (Evan Simpson) Date: Sat, 08 Sep 2001 17:55:44 -0400 Subject: [ZPT] textareas and spacing References: <001801c138a3$35f5cb10$1701640a@pythonic> Message-ID: <3B9A93E0.7020402@zope.com> alan runyan wrote: > > > > i am in need of having a textarea display lines like you do in DTML. You might be able to use: Cheers, Evan @ zope From mail@peterbe.com Mon Sep 10 08:23:03 2001 From: mail@peterbe.com (Peter Bengtsson) Date: Mon, 10 Sep 2001 09:23:03 +0200 Subject: [ZPT] METAL expansion only when editing References: <00f301c136f6$399f7210$1c64a8c0@PBN> <3B990EFE.5080501@zope.com> Message-ID: <004601c139cb$00574c30$1c64a8c0@PBN> Ok then. What is the difference between using macros or tal:replace when you're always having the little "Expand while editing" thing off? What is most precious to me is processing speed in this case. We must avoid all luxiurios editing options to gain time. Besides, at run time, these templates will not have to worry too much about where they are and how they are included. Another stringent entity does that. Do I sound silly? > > I have a site; with lots of little pieces of PageTemplates. Some just > > contain a little HTML table on 10 lines. > > > >
> >
> >
> > > Are these the little tables in PageTemplates? Why not use macros > instead of tal:replace? Macros were invented specifically so that you > *wouldn't* need to have a zillion little HTML fragments with no page > context. > > > 1) I want to have the cool functionality of METAL when editing so that I > > can have a header and footer around little tables in Dreamweaver. > > > > 2) When rendered as a webpage I want no METAL expansion. > > Sorry, I don't understand. > > Cheers, > > Evan @ Zope > From chrisw@nipltd.com Mon Sep 10 10:09:22 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 10:09:22 +0100 Subject: [ZPT] [BUG & PATCH] Parse restarts for incomplete entity reference References: <15257.13515.639036.796502@lindm.dm> Message-ID: <3B9C8342.74DE6094@nipltd.com> Dieter Maurer wrote: > > When ZPT's (version 1.4) HTML parser finds an incomplete entity (or character) > reference, it restarts parsing at the start. This is a bug in HTMLParser.py which is probably screwing up whatever is using it, I had the same thing with Strip-o-Gram. Updating that file to the latest one from the python CVS repository on SourceForge shoudl fix the problem... >

a & b

...or you could just change that to :

a & b

cheers, Chris From fdrake@acm.org Mon Sep 10 13:32:27 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 10 Sep 2001 08:32:27 -0400 Subject: [ZPT] [BUG & PATCH] Parse restarts for incomplete entity reference In-Reply-To: <3B9C8342.74DE6094@nipltd.com> References: <15257.13515.639036.796502@lindm.dm> <3B9C8342.74DE6094@nipltd.com> Message-ID: <15260.45787.934647.897738@grendel.digicool.com> Chris Withers writes: > This is a bug in HTMLParser.py which is probably screwing up > whatever is using it, I had the same thing with > Strip-o-Gram. Updating that file to the latest one from the python > CVS repository on SourceForge shoudl fix the problem... The one in the TAL CVS should work fine as well now. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From chrisw@nipltd.com Mon Sep 10 14:02:44 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 14:02:44 +0100 Subject: [ZPT] Alternate Paths Question Message-ID: <3B9CB9F4.428CD3B9@nipltd.com> Hi, Just reading the second ZPT article and it looks cool. How does the alternate paths thing decide that a path doesn't exist? I'm guessing some kind of exception catching? If so, what exceptions and where is this documented? cheers, Chris From jwm@plain.co.nz Mon Sep 10 14:47:51 2001 From: jwm@plain.co.nz (John Morton) Date: Tue, 11 Sep 2001 01:47:51 +1200 Subject: [ZPT] METAL expansion only when editing In-Reply-To: <004601c139cb$00574c30$1c64a8c0@PBN> References: <00f301c136f6$399f7210$1c64a8c0@PBN> <3B990EFE.5080501@zope.com> <004601c139cb$00574c30$1c64a8c0@PBN> Message-ID: <01091101475107.00940@subterraneans> On Monday 10 September 2001 19:23, Peter Bengtsson wrote: > Ok then. > > What is the difference between using macros or tal:replace when you're > always having the little "Expand while editing" thing off? If you're using tal:replace to drop a fragment of markup into another=20 document, it can't be a full html document in it's own right. This means = that=20 it won't behave itself when edited in an html editor and can't be feed to= =20 tools like 'tidy' to verify that it's fully formed html or xhtml and so o= n.=20 If you use metal instead, you can include all the usual document scaffold= ing=20 to keep those tools happy, and mark out the bit that you want to use as a= =20 macro.=20 One of the nice things about METAL is that it makes it fairly easy to bui= ld a=20 tool to discover the relationships between a set of page tempates - what = is=20 use where, what fills slots in some template and so on - as you can be pr= etty=20 sure that anything refered to in a METAL statement is going to be some pa= ge=20 template. If you use tal:replace, you can't be sure that the thing refere= d to=20 by the statement isn't an attribute of some object, or what the object is= =20 without practically rendering each and every template.=20 > What is most precious to me is processing speed in this case. We must > avoid all luxiurios editing options to gain time. Macro expansion is cheap as far as I know; no more expensive than tal:rep= lace=20 and conveniently separate from all other tal command. Certainly, Zope=20 routinely does other more expensive operations every access (aquisition,=20 security checks and so on). John From chrisw@nipltd.com Mon Sep 10 14:59:46 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 14:59:46 +0100 Subject: [ZPT] DTML 2 ZPT question Message-ID: <3B9CC752.4EC4FF2F@nipltd.com> Hi, Can someone help me turn: ...into ZPT? cheers, Chris From chrisw@nipltd.com Mon Sep 10 15:04:48 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 15:04:48 +0100 Subject: [ZPT] Yuk! Someone please improve on this... References: <3B9CC752.4EC4FF2F@nipltd.com> Message-ID: <3B9CC880.3C5DABEC@nipltd.com> Chris Withers wrote: > > Can someone help me turn: > > > > ...into ZPT? This works: Title ...but I feel a bit sick now. Can anyone suggest something nicer or should I start sleeping with my sister? Chris From magnus.heino@rivermen.se Mon Sep 10 15:07:30 2001 From: magnus.heino@rivermen.se (Magnus Heino (Rivermen)) Date: Mon, 10 Sep 2001 16:07:30 +0200 Subject: SV: [ZPT] Yuk! Someone please improve on this... Message-ID: > > Can someone help me turn: > > > > > > > > ...into ZPT? > > This works: > > tal:content="structure python:title or ' '">Title > > ...but I feel a bit sick now. > > Can anyone suggest something nicer or should I start sleeping > with my sister?   /Magnus From evan@zope.com Mon Sep 10 15:11:45 2001 From: evan@zope.com (Evan Simpson) Date: Mon, 10 Sep 2001 10:11:45 -0400 Subject: [ZPT] DTML 2 ZPT question References: <3B9CC752.4EC4FF2F@nipltd.com> Message-ID: <3B9CCA21.5080504@zope.com> Chris Withers wrote: > This might do what you want:   Cheers, Evan @ Zope From phil.harris@zope.co.uk Mon Sep 10 20:19:28 2001 From: phil.harris@zope.co.uk (Phil Harris) Date: 10 Sep 2001 15:19:28 -0400 Subject: SV: [ZPT] Yuk! Someone please improve on this... In-Reply-To: Message-ID: <200109101448.PAA21503@ns.zope.co.uk> how about Phil On 10 Sep 2001 16:07:30 +0200, Magnus Heino (Rivermen) wrote: > > > > > Can someone help me turn: > > > > > > > > > > > > ...into ZPT? > > > > This works: > > > > > tal:content="structure python:title or ' '">Title > > > > ...but I feel a bit sick now. > > > > Can anyone suggest something nicer or should I start sleeping > > with my sister? > >   > > /Magnus > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From phil.harris@zope.co.uk Mon Sep 10 20:20:16 2001 From: phil.harris@zope.co.uk (Phil Harris) Date: 10 Sep 2001 15:20:16 -0400 Subject: SV: [ZPT] Yuk! Someone please improve on this... In-Reply-To: Message-ID: <200109101449.PAA21507@ns.zope.co.uk> better than my last: Phil On 10 Sep 2001 16:07:30 +0200, Magnus Heino (Rivermen) wrote: > > > > > Can someone help me turn: > > > > > > > > > > > > ...into ZPT? > > > > This works: > > > > > tal:content="structure python:title or ' '">Title > > > > ...but I feel a bit sick now. > > > > Can anyone suggest something nicer or should I start sleeping > > with my sister? > >   > > /Magnus > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From rbickers-dated-1000736414.b726e0@logicetc.com Mon Sep 10 15:20:14 2001 From: rbickers-dated-1000736414.b726e0@logicetc.com (Ron Bickers) Date: Mon, 10 Sep 2001 10:20:14 -0400 Subject: [ZPT] Yuk! Someone please improve on this... In-Reply-To: <3B9CC880.3C5DABEC@nipltd.com> Message-ID: > > Can someone help me turn: > > > > > > > > ...into ZPT? > > This works: > > tal:content="structure python:title or ' '">Title > > ...but I feel a bit sick now. So did I when this is what I thought I had to do. I believe you can do: Title and avoid the define, but one problem with this method is that using 'structure' on the title would break titles like 'This is a title.', since it wouldn't quote the < and >. Not very happily, I ended up doing this:   That works, but it eliminates the benefit of having sample data in the cell. Is there a way to specify structure on just the   in the example above and not the title, or should this whole thing be done differently? _______________________ Ron Bickers Logic Etc, Inc. From chrisw@nipltd.com Mon Sep 10 15:34:23 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 15:34:23 +0100 Subject: [ZPT] DTML 2 ZPT question References: <3B9CC752.4EC4FF2F@nipltd.com> <3B9CCA21.5080504@zope.com> Message-ID: <3B9CCF6F.5947CCC5@nipltd.com> Evan Simpson wrote: > > This might do what you want: > >   Nope... the problem is that title exists, it's just a blank string. The above would work if title didn't exist (well, see my earlier question about alternate paths...) but because it does here, all I get in the output is: ...which shows up badly ;-( Any other ideas? cheers, Chris From chrisw@nipltd.com Mon Sep 10 15:35:51 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 15:35:51 +0100 Subject: SV: [ZPT] Yuk! Someone please improve on this... References: Message-ID: <3B9CCFC7.258BE2D3@nipltd.com> "Magnus Heino (Rivermen)" wrote: > > > Can anyone suggest something nicer or should I start sleeping > > with my sister? > >   What if title may or not be callable? I also despise abusing python's 'or' like that, it should have Guido turning in his grave (if he were in one, which I hope he's not, unless he's secretly a vampire ;-) cheers, Chris From chrisw@nipltd.com Mon Sep 10 15:36:34 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 15:36:34 +0100 Subject: SV: [ZPT] Yuk! Someone please improve on this... References: <200109101448.PAA21503@ns.zope.co.uk> Message-ID: <3B9CCFF2.4C0811CD@nipltd.com> Phil Harris wrote: > > how about > > Nope. title exists, it's just an empty string (or potentially a method which returns an empty string when called ;-) cheers, Chris From chrisw@nipltd.com Mon Sep 10 15:37:34 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 15:37:34 +0100 Subject: SV: [ZPT] Yuk! Someone please improve on this... References: <200109101449.PAA21507@ns.zope.co.uk> Message-ID: <3B9CD02E.1822C61E@nipltd.com> Phil Harris wrote: > > better than my last: > > :-( Chris From mail@peterbe.com Mon Sep 10 15:26:25 2001 From: mail@peterbe.com (Peter Bengtsson) Date: Mon, 10 Sep 2001 16:26:25 +0200 Subject: [ZPT] METAL expansion only when editing References: <00f301c136f6$399f7210$1c64a8c0@PBN> <3B990EFE.5080501@zope.com> <004601c139cb$00574c30$1c64a8c0@PBN> <01091101475107.00940@subterraneans> Message-ID: <019801c13a06$9518a680$1c64a8c0@PBN> Well, I guess you're right. You said that macro expansion is as cheap as tal:replace "as far as I know". Can somebody (hint Evan) confirm this who knows for sure? Cheers, Peter ----- Original Message ----- From: "John Morton" To: "Peter Bengtsson" Cc: Sent: Monday, September 10, 2001 3:47 PM Subject: Re: [ZPT] METAL expansion only when editing On Monday 10 September 2001 19:23, Peter Bengtsson wrote: > Ok then. > > What is the difference between using macros or tal:replace when you're > always having the little "Expand while editing" thing off? If you're using tal:replace to drop a fragment of markup into another document, it can't be a full html document in it's own right. This means that it won't behave itself when edited in an html editor and can't be feed to tools like 'tidy' to verify that it's fully formed html or xhtml and so on. If you use metal instead, you can include all the usual document scaffolding to keep those tools happy, and mark out the bit that you want to use as a macro. One of the nice things about METAL is that it makes it fairly easy to build a tool to discover the relationships between a set of page tempates - what is use where, what fills slots in some template and so on - as you can be pretty sure that anything refered to in a METAL statement is going to be some page template. If you use tal:replace, you can't be sure that the thing refered to by the statement isn't an attribute of some object, or what the object is without practically rendering each and every template. > What is most precious to me is processing speed in this case. We must > avoid all luxiurios editing options to gain time. Macro expansion is cheap as far as I know; no more expensive than tal:replace and conveniently separate from all other tal command. Certainly, Zope routinely does other more expensive operations every access (aquisition, security checks and so on). John _______________________________________________ ZPT mailing list ZPT@zope.org http://lists.zope.org/mailman/listinfo/zpt From evan@zope.com Mon Sep 10 15:49:15 2001 From: evan@zope.com (Evan Simpson) Date: Mon, 10 Sep 2001 10:49:15 -0400 Subject: [ZPT] METAL expansion only when editing References: <00f301c136f6$399f7210$1c64a8c0@PBN> <3B990EFE.5080501@zope.com> <004601c139cb$00574c30$1c64a8c0@PBN> <01091101475107.00940@subterraneans> <019801c13a06$9518a680$1c64a8c0@PBN> Message-ID: <3B9CD2EB.8040609@zope.com> Peter Bengtsson wrote: > You said that macro expansion is as cheap as tal:replace "as far as I know". > Can somebody (hint Evan) confirm this who knows for sure? The cost to fetch a macro is the same as the cost of fetching a string. Executing the macro is very slightly heavier than just inserting a string, but not so much that you'd notice. Cheers, Evan @ Zope From mail@peterbe.com Mon Sep 10 15:49:12 2001 From: mail@peterbe.com (Peter Bengtsson) Date: Mon, 10 Sep 2001 16:49:12 +0200 Subject: [ZPT] DTML 2 ZPT question References: <3B9CC752.4EC4FF2F@nipltd.com> <3B9CCA21.5080504@zope.com> <3B9CCF6F.5947CCC5@nipltd.com> Message-ID: <01c201c13a07$d10e4540$1c64a8c0@PBN> > >   > > Nope... the problem is that title exists, it's just a blank string. > > The above would work if title didn't exist (well, see my earlier question about > alternate paths...) but because it does here, all I get in the output is: > > > > ...which shows up badly ;-(   becomes   since 'default' is ' ' Didn't that work? > Any other ideas? > > cheers, > > Chris > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From fdrake@acm.org Mon Sep 10 15:43:50 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 10 Sep 2001 10:43:50 -0400 Subject: SV: [ZPT] Yuk! Someone please improve on this... In-Reply-To: <3B9CCFC7.258BE2D3@nipltd.com> References: <200109101449.PAA21507@ns.zope.co.uk> <3B9CD02E.1822C61E@nipltd.com> <3B9CCFC7.258BE2D3@nipltd.com> Message-ID: <15260.53670.315822.397595@grendel.digicool.com> Chris Withers writes: > I also despise abusing python's 'or' like that, This is not abuse; we write code like this all the time. The resulting behavior is intentional. > it should have Guido turning in > his grave (if he were in one, which I hope he's not, unless he's secretly a > vampire ;-) First, you ask us if you should start sleeping with your sister, and now you're considering that Guido might be a night-dweller? Get some help! Phil Harris wrote: > Chris Withers writes: > In an ideal world, what I'd really like would be: ...but: 1. I get: 2. It won't work, I'll still get a blank string substituted when title exists but is blank. cheers, Chris From rbickers-dated-1000740032.fd196b@logicetc.com Mon Sep 10 16:20:32 2001 From: rbickers-dated-1000740032.fd196b@logicetc.com (Ron Bickers) Date: Mon, 10 Sep 2001 11:20:32 -0400 Subject: SV: [ZPT] Yuk! Someone please improve on this... In-Reply-To: <3B9CD7DC.C73B9CEC@nipltd.com> Message-ID: > In an ideal world, what I'd really like would be: > That would be nice indeed. Any solution that uses structure before item/title will not work if the title has special characters in it because they will not be quoted. I think this will cover the bases:   However, I hate using 'default' like this because then I can't put a sample title there. _______________________ Ron Bickers Logic Etc, Inc. From chrisw@nipltd.com Mon Sep 10 16:30:35 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 16:30:35 +0100 Subject: [ZPT] Can anyone beat this? References: Message-ID: <3B9CDC9B.CB7ADC32@nipltd.com> Ron Bickers wrote: > > I think this will cover the bases: > >   This is actually probably as good as it gets... > However, I hate using 'default' like this because then I can't put a sample > title there. Well, you can, just do it as a dummy row:
 
my sample content
cheersm Chris From rbickers-dated-1000741325.0408dd@logicetc.com Mon Sep 10 16:42:05 2001 From: rbickers-dated-1000741325.0408dd@logicetc.com (Ron Bickers) Date: Mon, 10 Sep 2001 11:42:05 -0400 Subject: [ZPT] Partial structure (was: Can anyone beat this?) In-Reply-To: <3B9CDC9B.CB7ADC32@nipltd.com> Message-ID: > > However, I hate using 'default' like this because then I can't > put a sample > > title there. > > Well, you can, just do it as a dummy row: > > > > >
 
my sample content
A dummy table row just to put sample data somewhere other than it really should be defeats much of the beaty of ZPT to me. A semi nice solution might be something like this: My Happy Title Basically, a way to specify structure on only part of the content. _______________________ Ron Bickers Logic Etc, Inc. From evan@zope.com Mon Sep 10 16:45:41 2001 From: evan@zope.com (Evan Simpson) Date: Mon, 10 Sep 2001 11:45:41 -0400 Subject: SV: [ZPT] Yuk! Someone please improve on this... References: Message-ID: <3B9CE025.60900@zope.com> Ron Bickers wrote: > I think this will cover the bases: > >   > > However, I hate using 'default' like this because then I can't put a sample > title there. This isn't really better aesthetically, but it's more "accurate", and lets you use a placeholder: My Title Cheers, Evan @ Zope From chrisw@nipltd.com Mon Sep 10 16:47:27 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 16:47:27 +0100 Subject: [ZPT] Partial structure (was: Can anyone beat this?) References: Message-ID: <3B9CE08F.4700FEB4@nipltd.com> Ron Bickers wrote: > > > My Happy Title > > > Basically, a way to specify structure on only part of the content. Now that is a good idea, where do we put feature requests? cheers, Chris From chrisw@nipltd.com Mon Sep 10 16:51:36 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 16:51:36 +0100 Subject: [ZPT] WebDAV PT idea Message-ID: <3B9CE188.82DFE5DE@nipltd.com> Hi, Been trying to get DreamWeaver and PageTemplates to 'play nice' over a WebDrive connection. No dice yet, but I had an idea. The source.html thing look really very cool and could solve a whole lot of problems (nneeding .html as an extension, the write-temp-delete-rename things, etc) How hard would it be to make ZPT's appear to be collections containing a single source.html object to WebDAV clients? cheers, Chris From mail@peterbe.com Mon Sep 10 16:38:56 2001 From: mail@peterbe.com (Peter Bengtsson) Date: Mon, 10 Sep 2001 17:38:56 +0200 Subject: [ZPT] DTML 2 ZPT question References: <3B9CC752.4EC4FF2F@nipltd.com> <3B9CCA21.5080504@zope.com> <3B9CCF6F.5947CCC5@nipltd.com> <01c201c13a07$d10e4540$1c64a8c0@PBN> <3B9CD5E3.FEF00D9B@nipltd.com> Message-ID: <01f701c13a10$46557d20$1c64a8c0@PBN> > >   > > becomes   since 'default' is ' ' > > That's only true if title doesn't actually exist ;-) > > And since title always exists in Zope but is often blank, '' is what's usually > substituted, unless I'm missing something very obvious :-( Oops! I was too quick. NULL=" "   Along the line of this (thanks Evan!) http://www.zope.org/Members/peterbe/DTML2ZPT/examples/example6/view > cheers, > > Chris > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt From chrisw@nipltd.com Mon Sep 10 17:00:23 2001 From: chrisw@nipltd.com (Chris Withers) Date: Mon, 10 Sep 2001 17:00:23 +0100 Subject: [ZPT] :-) References: <3B9CE025.60900@zope.com> Message-ID: <3B9CE397.E11958FF@nipltd.com> Evan Simpson wrote: > > > My Title > So far, to me, this feels like the 'right' answer... cheers, Chris From rbickers-dated-1000742634.d87026@logicetc.com Mon Sep 10 17:03:54 2001 From: rbickers-dated-1000742634.d87026@logicetc.com (Ron Bickers) Date: Mon, 10 Sep 2001 12:03:54 -0400 Subject: [ZPT] RE: :-) In-Reply-To: <3B9CE397.E11958FF@nipltd.com> Message-ID: > > > > My Title > > > > So far, to me, this feels like the 'right' answer... Yeah. I like it enough, but it still feels like there should be a shorter way. _______________________ Ron Bickers Logic Etc, Inc. From francis@meadowbase.com Mon Sep 10 16:54:00 2001 From: francis@meadowbase.com (Francis Potter) Date: Mon, 10 Sep 2001 08:54:00 -0700 Subject: [ZPT] METAL expansion only when editing In-Reply-To: <01091101475107.00940@subterraneans> Message-ID: <001c01c13a10$e1ac0780$6701a8c0@fpotter5> Another big difference between tal:replace and metal:fill-slot is that metal passes variable definitions down (from tal:define and tal:repeat) to the code being inserted (because the macros are all expanded before the tal is processed). --- Francis Potter --- desk +1 (415) 826 3646 --- cell +1 (415) 310 5162 --- AIM heliumfrancis > -----Original Message----- > From: zpt-admin@zope.org [mailto:zpt-admin@zope.org] On=20 > Behalf Of John Morton > Sent: Monday, September 10, 2001 6:48 AM > To: Peter Bengtsson > Cc: zpt@zope.org > Subject: Re: [ZPT] METAL expansion only when editing >=20 >=20 > On Monday 10 September 2001 19:23, Peter Bengtsson wrote: > > Ok then. > > > > What is the difference between using macros or tal:replace=20 > when you're > > always having the little "Expand while editing" thing off? >=20 > If you're using tal:replace to drop a fragment of markup into another=20 > document, it can't be a full html document in it's own right.=20 > This means that=20 > it won't behave itself when edited in an html editor and=20 > can't be feed to=20 > tools like 'tidy' to verify that it's fully formed html or=20 > xhtml and so on.=20 >=20 > If you use metal instead, you can include all the usual=20 > document scaffolding=20 > to keep those tools happy, and mark out the bit that you want=20 > to use as a=20 > macro.=20 >=20 > One of the nice things about METAL is that it makes it fairly=20 > easy to build a=20 > tool to discover the relationships between a set of page=20 > tempates - what is=20 > use where, what fills slots in some template and so on - as=20 > you can be pretty=20 > sure that anything refered to in a METAL statement is going=20 > to be some page=20 > template. If you use tal:replace, you can't be sure that the=20 > thing refered to=20 > by the statement isn't an attribute of some object, or what=20 > the object is=20 > without practically rendering each and every template.=20 >=20 > > What is most precious to me is processing speed in this=20 > case. We must > > avoid all luxiurios editing options to gain time. >=20 > Macro expansion is cheap as far as I know; no more expensive=20 > than tal:replace=20 > and conveniently separate from all other tal command. Certainly, Zope=20 > routinely does other more expensive operations every access=20 > (aquisition,=20 > security checks and so on). >=20 > John >=20 > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt >=20 From waltonl@franklin.edu Mon Sep 10 19:29:06 2001 From: waltonl@franklin.edu (Lynn Walton) Date: Mon, 10 Sep 2001 13:29:06 -0500 Subject: [ZPT] Any reason this wouldn't work? Message-ID: <3B9D0672.678F8A0@franklin.edu> I wrote a while back indicating that since I had a need to reuse CONTENT/DATA in the midst of other content but that the placement of where in other content would not always be the same/predictable location ... that I thought what would best meet my needs would be a CMF object that was also a PageTemplate. I didn't get any input from either the CMF or ZPT list, so I figured it might be because my post was rather long. I'm trying again now with a shorter post. ;-) I'm just beginning to look into making such a thing and since I never made anything besides the most barebone new CMF type, it will be a new experience for me. I would really love to have some input on whether this is feasible from Evan or others. And some advise on whether there is anything in particular that I should look out for that will be non-trivial. That is, if just making a new ZClass that inherits from CMFDocument and PageTemplate is going to do it or not? Thanks, Lynn From richard@bizarsoftware.com.au Tue Sep 11 06:25:44 2001 From: richard@bizarsoftware.com.au (Richard Jones) Date: Tue, 11 Sep 2001 15:25:44 +1000 Subject: [ZPT] Dreamweaver hints Message-ID: <0109111525440U.01597@ike> Now that we've got a fair amount of experience under our belts with ZPT and Dreamweaver, one of the biggest problems we have is people "losing" TAL statements. In the Good Old Days, page-munging code was fairly visible - *SP, PHP, etc. showed up in the page and people could drag-n-drop pretty much to their hearts content (we have one guy visiting here pining for the good ol' days with UltraDev and ColdFusion ferchrissake :) So, what this rambling message is all about: we need to make TAL more visible in Dreamweaver for it to be really viable. It's just too damn confusing right now. Being in the Land Of Oz, we have a very helpful Macromedia sales team at our disposal. Which doesn't really help us when we're asking questions like "how do we make Dreamweaver recognise and highlight tags with specific attributes?". Hence I'm punting the question above to the list. Anyone have enough Dreamweaver-fu to know the answer? Richard From chrisw@nipltd.com Tue Sep 11 12:06:08 2001 From: chrisw@nipltd.com (Chris Withers) Date: Tue, 11 Sep 2001 12:06:08 +0100 Subject: [ZPT] M$ Error Messages from TALES? ;-) Message-ID: <3B9DF020.45CDE84E@nipltd.com> Hi, I got this: File \PageTemplates\ZRPythonExpr.py, line 121, in __call__ (Info: here.portal_actions.listFilteredActionsFor(here)['top_menu']) File Python expression "here.portal_actions.listFilteredActionsFor(here)['top_menu']", line 2, in f (Object: guarded_getitem) File E:\Zope\2.4.0\lib\python\AccessControl\ZopeGuards.py, line 151, in guarded_getitem TALESError: Sorry, an error occurred ..from a ZPT. TALES really isn't being very helpful here :-( Could it not give you the exception type and value which it caught? It's already giving the traceback (from which, with a bit of digging, I'm pretty sure I've deduced the above is a KeyError on 'top_menu') cheers, Chris From Geir Bækholt Tue Sep 11 12:15:53 2001 From: Geir Bækholt (Geir Bækholt) Date: Tue, 11 Sep 2001 13:15:53 +0200 Subject: [ZPT] new parser bug in 1.4 (tal:on-error mangles attributes)! Message-ID: <1616728378.20010911131553@funcom.com> seems like tal:on-error somehow mangles class=3D"xx" declarations in HTML-tags in ZPT1.4..
somehow becomes
when saving. Only happens when expand-macros while editing is checked (i thought that bit only concerned METAL) , and it only , as far as i can see, happens to 'class' attributes. tested a bit , and couldnt find it happening with any other tal-statement, or any other HTML-attribute.. it does not seem to matter what is in the on-error , except if left empty , like this: tal:on-error=3D"" .. Then it leaves the html alone.. Yep , i tested this in an empty template as well, just to make sure nothing else interfered.. Didn't happen in 1.3. - Anyone seeen anything like it =3F --=20 Geir B=E6kholt web-developer/zopatista geirh@funcom.com funcom oslo | webdev-team From mruberl@etnoteam.it Tue Sep 11 13:37:05 2001 From: mruberl@etnoteam.it (Ruberl Michele) Date: Tue, 11 Sep 2001 14:37:05 +0200 Subject: [ZPT] [CMF-ZPT] maybe I missed something while installing... Message-ID: Hi everybody, sorry for the stupidity of the question, I serached the archives but I didn't find anything... Ok, I did the following: - installed Zope 2.3.3: ok - made the INSTANCE_HOME stuff as from http://www.zope.org/Members/4am/instancehome : ok - installed CMF 1.1: ok - checked out CMFDecor from CMF cvs: ok - installed TAL, ZTUtils, PageTemplates and CMFDecor as from http://cmf.zope.org/Members/teyc/skinPageTemplate/view After having changed my skin preference (in Preferences) to ZPT Basic, I get the following error: **** Error Type: Undefined Error Value: "zpt_stylesheet" not found in "here/zpt_stylesheet/absolute_url" ---------------------------------------------------------------------------- ---- Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File /usr/local/Zope-2.3.3-linux2-x86/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/Zope-2.3.3-linux2-x86/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope-2.3.3-linux2-x86/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/Zope-2.3.3-linux2-x86/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope-2.3.3-linux2-x86/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: personalize_form) File /usr/local/Zope-2.3.3-linux2-x86/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: personalize_form) File /usr/local/Zope-2.3.3-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: personalize_form) File /usr/local/Zope-2.3.3-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in _bindAndExec (Object: personalize_form) File /prj/alambitco/zope/Products/PageTemplates/ZopePageTemplate.py, line 267, in _exec (Object: personalize_form) File /prj/alambitco/zope/Products/CMFDecor/FSPageTemplate.py, line 165, in pt_render (Object: personalize_form) File /prj/alambitco/zope/Products/PageTemplates/PageTemplate.py, line 156, in pt_render (Object: personalize_form) (Info: {'container': , 'here': , 'modules': , 'nothing': None, 'options': {'args': ()}, 'request':

form

portal_status_message'Member changed.'

cookies

tree-s'eJyLjlZ3hANPW3UdhWiESJhJtq16LBAAAL3rChM'
portal_skin'Basic ZPT'

other

< tr valign="top" align="left">< /tr>
AUTHENTICATION_PATH'alacmf'
URL1'http://dozzine.alambitco.com:8081/alacmf'
BASE3'http://dozzine.alambitco.com:8081/alacmf/per sonalize_form'
PUBLISHED<FSPageTemplate instance at 8b20fd8>
portal_skin'Basic ZPT'
BASE0'http://dozzine.alambitco.com:8081'
URL2'http://dozzine.alambitco.com:8081'
BASE1'http://dozzine.alambitco.com:8081'
traverse_subpath[]
URL0'http://dozzine.alambitco.com:8081/alacmf/pers onalize_form'
SERVER_URL'http://dozzine.alambitco.com:8081'
tree-s'eJyLjlZ3hANPW3UdhWiESJhJtq16LBAAAL3rChM'
URL'http://dozzine.alambitco.com:8081/alacmf/perso nalize_form'
AUTHENTICATED_USERmik
BASE2'http://dozzine.alambitco.com:8081/alacmf'
TraversalRequestNameStack[]
portal_status_message'Member changed.'
URL0http://dozzine.alambitco.com:8081/alacmf/perso nalize_form
URL1http://dozzine.alambitco.com:8081/alacmf
URL2http://dozzine.alambitco.com:8081
BASE0http://dozzine.alambitco.com:8081
BASE1http://dozzine.alambitco.com:8081
BASE2http://dozzine.alambitco.com:8081/alacmf
BASE3http://dozzine.alambitco.com:8081/alacmf/pers onalize_form

environ

< tr valign="top" align="left">
SCRIPT_NAME
HTTP_ACCEPT_ENCODINGgzip, deflate
channel.creation_time1000210787
HTTP_REFERERhttp://dozzine.alambitco.com:8081/alac mf/personalize_form
QUERY_STRINGportal_status_message=Member+changed.< /td>
SERVER_PROTOCOL1.1
SERVER_PORT8081
PATH_TRANSLATED/alacmf/personalize_form
HTTP_ACCEPTimage/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
REQUEST_METHODGET
SERVER_SOFTWAREZope/Zope 2.3.3 (binary release, python 1.5.2, linux2-x86) ZServer/1.1b1
HTTP_COOKIEtree-s="eJyLjlZ3hANPW3UdhWiESJhJtq 16LBAAAL3rChM"; portal_skin="Basic ZPT"
PATH_INFO/alacmf/personalize_form
HTTP_ACCEPT_LANGUAGEit
HTTP_CACHE_CONTROLno-cache
HTTP_HOSTdozzine.alambitco.com:8081
GATEWAY_INTERFACECGI/1.1
SERVER_NAMEdozzine
REMOTE_ADDR194.185.248.130
HTTP_USER_AGENTMozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
CONNECTION_TYPEKeep-Alive
, 'root': , 'template': , 'traverse_subpath': [], 'user': mik}) File /usr/local/Zope-2.3.3-linux2-x86/lib/python/TAL/TALInterpreter.py, line 232, in __call__ File /usr/local/Zope-2.3.3-linux2-x86/lib/python/TAL/TALInterpreter.py, line 265, in interpret File /usr/local/Zope-2.3.3-linux2-x86/lib/python/TAL/TALInterpreter.py, line 620, in do_useMacro File /usr/local/Zope-2.3.3-linux2-x86/lib/python/TAL/TALInterpreter.py, line 265, in interpret File /usr/local/Zope-2.3.3-linux2-x86/lib/python/TAL/TALInterpreter.py, line 311, in do_startTag File /usr/local/Zope-2.3.3-linux2-x86/lib/python/TAL/TALInterpreter.py, line 380, in attrAction_tal File /prj/alambitco/zope/Products/PageTemplates/TALES.py, line 311, in evaluateText File /prj/alambitco/zope/Products/PageTemplates/TALES.py, line 297, in evaluate Undefined: (see above) **** How can I solve this in order to have the whole thing working, start working whith it and stop make such stupid questions? Thanks a lot Michele From evan@zope.com Tue Sep 11 13:59:36 2001 From: evan@zope.com (Evan Simpson) Date: Tue, 11 Sep 2001 08:59:36 -0400 Subject: [ZPT] [CMF-ZPT] maybe I missed something while installing... References: Message-ID: <3B9E0AB8.6050109@zope.com> Ruberl Michele wrote: > Error Type: Undefined > Error Value: "zpt_stylesheet" not found in > "here/zpt_stylesheet/absolute_url" Sounds like you don't have the ZPT skin folders installed in your portal_skins tool. I'm pretty sure that there's an install script in CMFDecor that does it for you, or you can go to portal_skins and add every filesystem skin that it offers you that starts with "zpt_". Cheers, Evan @ Zope From evan@zope.com Tue Sep 11 14:02:05 2001 From: evan@zope.com (Evan Simpson) Date: Tue, 11 Sep 2001 09:02:05 -0400 Subject: [ZPT] Batching Oddity References: <200109052215.SAA11740@ns3.99hats.com> <3B9910A8.4080409@zope.com> <15258.22606.41105.265439@lindm.dm> Message-ID: <3B9E0B4D.3010800@zope.com> Dieter Maurer wrote: > Relative URI references should work... > The browser should make an absolute URL be prepending the > document URL (and not the base URL). I can't remember the exact behaviour, but IE and Netscape 4.7 for Linux do very different things when presented with a bare query string. I think Netscape trims the last entry off of the document URL. Cheers, Evan @ Zope From evan@zope.com Tue Sep 11 14:05:27 2001 From: evan@zope.com (Evan Simpson) Date: Tue, 11 Sep 2001 09:05:27 -0400 Subject: [ZPT] Alternate Paths Question References: <3B9CB9F4.428CD3B9@nipltd.com> Message-ID: <3B9E0C17.2050309@zope.com> Chris Withers wrote: > How does the alternate paths thing decide that a path doesn't exist? I'm > guessing some kind of exception catching? If so, what exceptions and where is > this documented? AttributeError, KeyError, TypeError, IndexError, and 'Unauthorized' are caught during path traversal (not while calling, though). It's "documented" in Expressions.py :-( Cheers, Evan @ Zope From evan@zope.com Tue Sep 11 14:11:47 2001 From: evan@zope.com (Evan Simpson) Date: Tue, 11 Sep 2001 09:11:47 -0400 Subject: [ZPT] WebDAV PT idea References: <3B9CE188.82DFE5DE@nipltd.com> Message-ID: <3B9E0D93.50000@zope.com> Chris Withers wrote: > Been trying to get DreamWeaver and PageTemplates to 'play nice' over a WebDrive > connection. > > No dice yet, but I had an idea. > > The source.html thing look really very cool and could solve a whole lot of > problems (nneeding .html as an extension, the write-temp-delete-rename things, > etc) > > How hard would it be to make ZPT's appear to be collections containing a single > source.html object to WebDAV clients? I played with this recently, and almost got it to work. It plays havok with relative paths in the page, and it's pretty annoying to have to "open" each template. It would probably take a bit of work to get this to play nicely with DreamWeaver's "Sync" features, too. On the other hand, it *might* be possible to make the Page Template gracefully handle the whole "make temp file;rename;rename;delete" process that unwary emacs and WebDrive editing does. Cheers, Evan @ Zope From evan@zope.com Tue Sep 11 14:24:44 2001 From: evan@zope.com (Evan Simpson) Date: Tue, 11 Sep 2001 09:24:44 -0400 Subject: [ZPT] Any reason this wouldn't work? References: <3B9D0672.678F8A0@franklin.edu> Message-ID: <3B9E109C.9070604@zope.com> Lynn Walton wrote: > I wrote a while back indicating that since I had a need to reuse > CONTENT/DATA in the midst of other content but that the placement of > where in other content would not always be the same/predictable location > ... that I thought what would best meet my needs would be a CMF object > that was also a PageTemplate. I didn't get any input from either the > CMF or ZPT list, so I figured it might be because my post was rather > long. I'm trying again now with a shorter post. ;-) I regret that I still don't really understand the problem that you're trying to solve. > non-trivial. That is, if just making a new ZClass that inherits from > CMFDocument and PageTemplate is going to do it or not? I'm not sure, but I definitely suggest that you make a filesystem base class that does all of the inheriting, and make that class the sole base class of your ZClass. That makes it a lot easier to change your mind later. Cheers, Evan @ Zope From chrisw@nipltd.com Tue Sep 11 14:34:21 2001 From: chrisw@nipltd.com (Chris Withers) Date: Tue, 11 Sep 2001 14:34:21 +0100 Subject: [Zope-CMF] Re: [ZPT] [CMF-ZPT] maybe I missed something while installing... References: <3B9E0AB8.6050109@zope.com> Message-ID: <3B9E12DD.395A174A@nipltd.com> Evan Simpson wrote: > > Ruberl Michele wrote: > > > Error Type: Undefined > > Error Value: "zpt_stylesheet" not found in > > "here/zpt_stylesheet/absolute_url" > > Sounds like you don't have the ZPT skin folders installed in your > portal_skins tool. Actually, I think you need to use a version of CMFCore which recognises .css files and turns them into FSDTMLMethods. The latest CVS checkouts do this. cheers, Chris From chrisw@nipltd.com Tue Sep 11 16:44:58 2001 From: chrisw@nipltd.com (Chris Withers) Date: Tue, 11 Sep 2001 16:44:58 +0100 Subject: [ZPT] METAL: attributes as slots Message-ID: <3B9E317A.E77BEC27@nipltd.com> Hi, How's this for a possible extension to METAL: In master_template: Dummy body In a_page: My real body What do other people think? cheers, Chris From waltonl@franklin.edu Tue Sep 11 20:04:55 2001 From: waltonl@franklin.edu (Lynn Walton) Date: Tue, 11 Sep 2001 14:04:55 -0500 Subject: [ZPT] Any reason this wouldn't work? References: <3B9D0672.678F8A0@franklin.edu> <3B9E109C.9070604@zope.com> Message-ID: <3B9E6057.D0F92926@franklin.edu> Evan Simpson wrote: > I regret that I still don't really understand the problem that you're > trying to solve. I was looking into using Zope because I see several content management related applications that I'd like to have in place in the future on our site. But before we get to that, we have to roll out a new look and feel that will contain hundreds of "mostly static" html documents that contain information currently on our old site. But, we also have a significant number of cases of chunks of data that get reused throughout other documents. If I were using SSI I'd use #includes. If using JSP or PHP - it's include facilities to achieve some of this. I started out studying ZPT because I liked the looks/use of it more than dtml. I developed a master template that includes a call to an external method which builds a menu based on the presence of some "properties" in the ZPT that is calling the master template. So, I was heading down the road of creating hundreds of ZPT's that declare some properties at the top, and have a use-macro that calls the master template. Then Ethan Mindlace replied to one of my questions saying "Page Templates are NOT content". While I know that, and agree with ideas of separating presentation from content .... I was hesitant to "drink the CMF Kool-ais" (also Ethan's words I believe) due to the complexity of CMF and it's unstructured documentation. But I decided to go for it. So I planned on having my hundreds of mostly static html pages that need presented be my own CMF object that is just a CMFDocument but with some "properties" set that the master template's call to the external method that builds the menus need. At this point in time, I really don't want the site to be a portal. I don't want regular uses to even see a login or join type of thing, so already I have to do some customizing of the standard CMF portal to make it less portal like. But because my different web staff members need to make and edit the documents, they need to login to the portal because that's the only way to create/edit portal content. But now, when I want to start handling the dozens of different kind of documents where I want to reuse some content, I need to create a ZPT in order to have the facility to do some basic logic .... even if it's just an include like command, to pull in say some other document's cookedBody into this document. Or if I want to use a macro that doesn't have a set defined slot in some other template. The kind of reuse I'm talking about isn't like say the Actions Box or News Item where you always no where in the page layout it should occur, so you include it a template that is used by all documents of a certain type. Instead, I'm talking about content reuse where the spot in the page that the included/reused content may need to be pulled in is different in each of the various documents I will want to use it in. Thus each different document that will have some reuse of common data will need to be it's own template. Thus I could end up with lots of ZPTs containing content and I'm back to not being much ahead of if I'd just made ALL my several hundred pages each ZPT's that used a master template, and didn't use CMF at all. If I try to use CMF for the hundreds that don't have reuse then it seems weird/awkward, to have a mixure of many items on the site are CMFDocuments (or my variation) and many others are ZPT's that are kept in the portal's different subdirectories. It seems to make providing site wide searching more difficult since the ZPT's wouldn't be part of the portal catalog ( unless someone tells me I can make them be part ... I'm still very fuzzy on the cataloging.). So it seemed to me that what I needed was a CMF object that had page template abilities (that is the ability to use tal and metal to pull in stuff I want when needed.) So I could have hundreds of plain CMFDocument like objects, but dozens of others that are this new suped up CMF-PageTemplate mix type object that can give me the control for deciding what data to bring in at what spot by using some tal and/or metal. Here is an example of a way I forsee reusing different data in different web pages in different places on those different pages. If we have a contact database we're accessing. Of course we'll have some templates that are truly serving as templates to present just different views of the contact database's data. But, we also have all kinds of different pages of university information that will may refer to a particular person in different ways and different spots, but we'd rather get their name/email/title, etc from one database than hard code it in 10 different types of pages. I'd need to use dtml or zpt to make the appropriate calls to get back the info. So if I make it a zpt that uses my master template to get the look and feel, but then I have paragraphs, tables, lists etc of CONTENT all filling in the main "slot" including a call to get the info on a person who is mentioned some place on the page, then that ZPT itself IS content. But I have to use zpt in order to get to make the call to get my reusable data. Does this give you more of an idea of my dilemma? Thanks for your patience. Lynn From evan@zope.com Tue Sep 11 20:46:00 2001 From: evan@zope.com (Evan Simpson) Date: Tue, 11 Sep 2001 15:46:00 -0400 Subject: [ZPT] Any reason this wouldn't work? References: <3B9D0672.678F8A0@franklin.edu> <3B9E109C.9070604@zope.com> <3B9E6057.D0F92926@franklin.edu> Message-ID: <3B9E69F8.2080505@zope.com> Lynn Walton wrote: > I developed a master template that includes a call to an external method which > builds a menu based on the presence of some "properties" in the ZPT that is > calling the master template. So, I was heading down the road of creating > hundreds of ZPT's that declare some properties at the top, and have a use-macro > that calls the master template. Then Ethan Mindlace replied to one of my > questions saying "Page Templates are NOT content". Hmph. I think this depends on what you mean by "content". If you have hundreds of pages that have different layouts, with more complex structure than can be captured well with structured text, then I'd say that Page Templates are a fine solution. After all, if you pull a chunk of complex HTML into some kind of content object, then plug it back into a master template, I don't see what has been gained. > since the ZPT's wouldn't be part of the portal catalog ( unless someone tells me > I can make them be part ... I'm still very fuzzy on the cataloging.). So it > seemed to me that what I needed was a CMF object that had page template > abilities You want ZPTs that participate in the portal_catalog, yes? Given that you're using the CMF, it's probably sufficient to make a filesystem class that mixes ZopePageTemplate with PortalContent (ZPT first!). I wouldn't bother with a ZClass; skins give you the best part of those without the headaches. Cheers, Evan @ Zope From waltonl@franklin.edu Tue Sep 11 20:55:05 2001 From: waltonl@franklin.edu (Lynn Walton) Date: Tue, 11 Sep 2001 14:55:05 -0500 Subject: [ZPT] Any reason this wouldn't work? References: <3B9D0672.678F8A0@franklin.edu> <3B9E109C.9070604@zope.com> <3B9E6057.D0F92926@franklin.edu> <3B9E69F8.2080505@zope.com> Message-ID: <3B9E6C19.919B9047@franklin.edu> Evan Simpson wrote: > Hmph. I think this depends on what you mean by "content". If you have > hundreds of pages that have different layouts, with more complex > structure than can be captured well with structured text, then I'd say > that Page Templates are a fine solution. After all, if you pull a chunk > of complex HTML into some kind of content object, then plug it back into > a master template, I don't see what has been gained. Well, I guess maybe what's gained is someone non technical can start the page off with the various static content, and not have to worry about getting the correct tal and metal:use-macro calls to the master template. Then the techie can come in and add the tal: or macro: stuff to get the dynamic stuff. In otherwords the use of the master template containing the main look & feel, menu's, etc would be handled by the CMF skins rather than someone having to start with a blank zpt and make the correct tal & metal stuff at the top to pull in the master template. > > since the ZPT's wouldn't be part of the portal catalog ( unless someone tells me > > I can make them be part ... I'm still very fuzzy on the cataloging.). So it > > seemed to me that what I needed was a CMF object that had page template > > abilities > > You want ZPTs that participate in the portal_catalog, yes? Given that > you're using the CMF, it's probably sufficient to make a filesystem > class that mixes ZopePageTemplate with PortalContent (ZPT first!). I > wouldn't bother with a ZClass; skins give you the best part of those > without the headaches. So I assume this filesystem class you're talking about wouldn't be a CMF object? Lynn From evan@zope.com Tue Sep 11 21:31:10 2001 From: evan@zope.com (Evan Simpson) Date: Tue, 11 Sep 2001 16:31:10 -0400 Subject: [ZPT] Any reason this wouldn't work? References: <3B9D0672.678F8A0@franklin.edu> <3B9E109C.9070604@zope.com> <3B9E6057.D0F92926@franklin.edu> <3B9E69F8.2080505@zope.com> <3B9E6C19.919B9047@franklin.edu> Message-ID: <3B9E748E.3020308@zope.com> Lynn Walton wrote: >>You want ZPTs that participate in the portal_catalog, yes? Given that >>you're using the CMF, it's probably sufficient to make a filesystem >>class that mixes ZopePageTemplate with PortalContent (ZPT first!). I >>wouldn't bother with a ZClass; skins give you the best part of those >>without the headaches. >> > > So I assume this filesystem class you're talking about wouldn't be a CMF object? It would be, thanks to its PortalContent ancestry. Cheers, Evan @ Zope From dieter@handshake.de Tue Sep 11 23:20:57 2001 From: dieter@handshake.de (Dieter Maurer) Date: Wed, 12 Sep 2001 00:20:57 +0200 (CEST) Subject: [ZPT] METAL: attributes as slots In-Reply-To: <3B9E317A.E77BEC27@nipltd.com> References: <3B9E317A.E77BEC27@nipltd.com> Message-ID: <15262.36425.785486.194110@lindm.dm> Chris Withers writes: > How's this for a possible extension to METAL: Good - almost perfect! > In master_template: > > > > tal:replace="structure here/css_inline_or_link"> > > > metal:define-attribute-slot="bgcolor" > metal:define-slot="body"> > Dummy body > > > > In a_page: > > metal:fill-slot="page"> > My real body > > > > What do other people think? You need to specify how the "fill-attribute-slot" and "fill-slot" interact. Your example suggests that you first do "fill-slot" and then *IN THE RESULT* "fill-attribute-slot" which is not completely intuitive. I personally would prefer an alternative solution: Allow to override and extend a set of definitions in a "define-slot" by that in the "fill-slot" (and similarly for "define-macro" and "use-macro"). We need parameters (placeholder, slots) for different things than element, for example for attributes, too. I imagine to have something like this: ...... I feel, it would be good, if the definitions of the "use-macro" were effectively appended to the definition list of the "define-macro". This way, the "use" could override and extend the definitions provided by the macro definition. Dieter From robert@redcor.ch Wed Sep 12 18:24:44 2001 From: robert@redcor.ch (Robert Rottermann) Date: Wed, 12 Sep 2001 19:24:44 +0200 Subject: [ZPT] Dreamwever and webdav aka how to enter index_html/source.html Message-ID: <002d01c13baf$d05017b0$0a01a8c0@stravinsky> Hi there, I tried every way I could dream up entering a name like index_html/source.html but failed miserably. Can any one of you give me a tip how to do it?? Thanks for your time Robert From alex@quad.com.ar Wed Sep 12 18:58:41 2001 From: alex@quad.com.ar (alex@quad.com.ar) Date: Wed, 12 Sep 2001 14:58:41 -0300 Subject: [ZPT] Dreamwever and webdav aka how to enter index_html/source.html References: <002d01c13baf$d05017b0$0a01a8c0@stravinsky> Message-ID: <005d01c13bb4$8e91b3b0$0201a8c0@ALEX> as an alternative start zope with -W which opens a 'webdav source' port and then you can open files directly on that port. ----- Original Message ----- From: "Robert Rottermann" To: Sent: Wednesday, September 12, 2001 2:24 PM Subject: [ZPT] Dreamwever and webdav aka how to enter index_html/source.html > Hi there, > > I tried every way I could dream up entering a name like > index_html/source.html but failed miserably. > > Can any one of you give me a tip how to do it?? > > Thanks for your time > > Robert > > > _______________________________________________ > ZPT mailing list > ZPT@zope.org > http://lists.zope.org/mailman/listinfo/zpt > From robert@redcor.ch Wed Sep 12 19:46:54 2001 From: robert@redcor.ch (Robert Rottermann) Date: Wed, 12 Sep 2001 20:46:54 +0200 Subject: [ZPT] Dreamwever and webdav aka how to enter index_html/source.html References: <002d01c13baf$d05017b0$0a01a8c0@stravinsky> <005d01c13bb4$8e91b3b0$0201a8c0@ALEX> Message-ID: <003901c13bbb$4b095330$0a01a8c0@stravinsky> Thanks for your answer, I tried theat. However I still have the problem of not being able to show the file in Dreamweaver since it does not deal with extesionless files. How do I get to the source.html. Or do I have to add a .html to all the page templates ?? Robert ----- Original Message ----- From: To: "Robert Rottermann" Cc: Sent: Wednesday, September 12, 2001 7:58 PM Subject: Re: [ZPT] Dreamwever and webdav aka how to enter index_html/source.html > as an alternative start zope with -W which opens a 'webdav > source' port and then you can open files directly on that port. > > ----- Original Message ----- > From: "Robert Rottermann" > To: > Sent: Wednesday, September 12, 2001 2:24 PM > Subject: [ZPT] Dreamwever and webdav aka how to enter index_html/source.html > > > > Hi there, > > > > I tried every way I could dream up entering a name like > > index_html/source.html but failed miserably. > > > > Can any one of you give me a tip how to do it?? > > > > Thanks for your time > > > > Robert > > > > > > _______________________________________________ > > ZPT mailing list > > ZPT@zope.org > > http://lists.zope.org/mailman/listinfo/zpt > > > > From brentmh@ece.rice.edu Thu Sep 13 16:20:53 2001 From: brentmh@ece.rice.edu (Brent Hendricks) Date: Thu, 13 Sep 2001 10:20:53 -0500 Subject: [ZPT] Using on-error allows transaction to commit? Message-ID: <20010913102053.A23097@splinter.ece.rice.edu> Here's my setup: I have a ZPT which calls a python script. That script writes some things to a dabatase and then calls an external method that does a CVS commit. What I'd like is if the CVS commit fails, for the Zope transaction to be aborted so the database writes from the python script don't get committed. This seems to work fine if my external method raises an exception on failure. The exception causes Zope to abort the transaction and all is well with the world....except that I'd like to detect this error and print a nice message to the user explaining what to do. I figured that tal:on-error would be a good way to do it. The problem is that when on-error catches the exception, Zope no longer aborts the database transaction. I tired catching the exception myself in the python script and manually calling get_transaction().abort() but get_transation() doesn't seem to be defined for python scripts. I suppose I could try putting that in my external method, but that just seems like the wrong place to do it. Any help is appreciated, Brent ------------------------------------------------------------------------- "The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures." -- Frederick Brooks, Jr., The Mythical Man Month From dieter@handshake.de Thu Sep 13 21:51:30 2001 From: dieter@handshake.de (Dieter Maurer) Date: Thu, 13 Sep 2001 22:51:30 +0200 (CEST) Subject: [ZPT] Using on-error allows transaction to commit? In-Reply-To: <20010913102053.A23097@splinter.ece.rice.edu> References: <20010913102053.A23097@splinter.ece.rice.edu> Message-ID: <15265.7250.909225.75754@lindm.dm> Brent Hendricks writes: > ... > The exception causes Zope to abort the transaction and all > is well with the world....except that I'd like to detect this error > and print a nice message to the user explaining what to do. I figured > that tal:on-error would be a good way to do it. The problem is that > when on-error catches the exception, Zope no longer aborts the > database transaction. > > I tired catching the exception myself in the python script and > manually calling get_transaction().abort() but get_transation() > doesn't seem to be defined for python scripts. I suppose I could try > putting that in my external method, but that just seems like the wrong > place to do it. Your options: * do it in an External Method (as you explained above) * customize the error handling page to recognize your exception and provide adequate explanatory text. Dieter From chrisw@nipltd.com Fri Sep 14 09:40:40 2001 From: chrisw@nipltd.com (Chris Withers) Date: Fri, 14 Sep 2001 09:40:40 +0100 Subject: [ZPT] More... References: <3B9CE025.60900@zope.com> <3B9CE397.E11958FF@nipltd.com> Message-ID: <3BA1C288.1D94A6AE@nipltd.com> Chris Withers wrote: > > Evan Simpson wrote: > > > > > > My Title > > Okay, so now what if title my or may not exist? The best I've got is: My Title ...which is pretty yucky ;-) cheers, Chris From magnus.heino@rivermen.se Fri Sep 14 10:37:25 2001 From: magnus.heino@rivermen.se (Magnus Heino (Rivermen)) Date: Fri, 14 Sep 2001 11:37:25 +0200 Subject: SV: [ZPT] More... Message-ID: > > > > > > My Title > > > > > Okay, so now what if title my or may not exist? > > The best I've got is: > > > My Title > > > ...which is pretty yucky ;-) My Title ...and create a python script getTitle that does the work for you. /Magnus From chrisw@nipltd.com Fri Sep 14 12:07:11 2001 From: chrisw@nipltd.com (Chris Withers) Date: Fri, 14 Sep 2001 12:07:11 +0100 Subject: [ZPT] ZTUtil documentation? Message-ID: <3BA1E4DF.E3458215@nipltd.com> Hi, I think I want to use some stuff in ZTUtil. Is there any documentation anywhere? cheers, Chris From chrisw@nipltd.com Fri Sep 14 12:33:35 2001 From: chrisw@nipltd.com (Chris Withers) Date: Fri, 14 Sep 2001 12:33:35 +0100 Subject: [ZPT] AGGGH! Bug in ZTUtils.Zope Message-ID: <3BA1EB0F.E3926C19@nipltd.com> Line 213-214 of Zope.py: def __init__(self, sequence, size, start=0, end=0, orphan=3, overlap=0, skip_unauthorized=None): PLEASE change that orphan to 0 by default, ASAP... Chris From robert@redcor.ch Fri Sep 14 10:12:40 2001 From: robert@redcor.ch (Robert Rottermann) Date: Fri, 14 Sep 2001 11:12:40 +0200 Subject: [ZPT] how to access zpt with dramweaver ??? Message-ID: <000b01c13cfd$67b25f20$8415a2d9@karin> Hi, is there somebody out there who can tell me how I can access Zope/ZPT using Dreamweaver (or Golive) I see no way to have a situation that deals with the following conditions: - no dots on the Zope side. - a way to deal with the layout on dreamweaver side. I tried to use the WebDAV source port with the -W option I tried to save a file with "/source.html" appended to it I made a directory on the windows side named like the Zope object and put its content into a file called source.html in that directory. I cant upload this directory/file to Zope using either Dreamwever4 or Golive5. I have been banging my head to the wall none has helped. Since there is a tutorial on the Zope site rather prominently promising to tell how to use ZPT and Dreamweaver I assume it should be possible. Please somebody tell me how. From rbickers-dated-1001172954.650cfb@logicetc.com Sat Sep 15 16:35:53 2001 From: rbickers-dated-1001172954.650cfb@logicetc.com (Ron Bickers) Date: Sat, 15 Sep 2001 11:35:53 -0400 Subject: [ZPT] how to access zpt with dramweaver ??? In-Reply-To: <000b01c13cfd$67b25f20$8415a2d9@karin> Message-ID: > -----Original Message----- > From: zpt-admin@zope.org [mailto:zpt-admin@zope.org]On Behalf Of Robert > Rottermann > is there somebody out there who can tell me how I can access > Zope/ZPT using > Dreamweaver (or Golive) ZPT works great with Dreamweaver for me. It works fine with Zope via WebDAV (using -W) and FTP. > - no dots on the Zope side. > - a way to deal with the layout on dreamweaver side. The problem you describe is Dreamweaver's stupid (really stupid) limitation that it can't directly open files without extensions. I've complained officially to them about this at length with at least some positive feedback about it. Hopefully they'll do something about it in a future release. I do two things to help alleviate this problem: 1) Use .html extensions on page templates that will be "viewed" (ie, will be part of a URL), but not just as a snippet of code or a macro definition. 2) To open files without extensions: in the site window I select File | Open With...Browse and find and select Dreamweaver.exe. In DW (at least in version 4.01), this will open files without extensions and allow the layout view. It's a stupid thing to have to do, but it does work and it's not too painful since most of my page templates use #1 above. > I tried to use the WebDAV source port with the -W option This works just fine for me. Remember that when you specify the host for FTP or WebDAV in DW, you must include the port number (eg, http://www.myshost.com:8021/) > I tried to save a file with "/source.html" appended to it > I made a directory on the windows side named like the Zope object and put > its content into a file called source.html in that directory. I > cant upload > this directory/file to Zope using either Dreamwever4 or Golive5. I've never tried any solution that uses source.html. One thing that is a bit annoying, is that you must create a Page Template object of the same name before you can just transfer it from DW to Zope. Otherwise, Zope will create a DTML Document. In WebDAV mode, it won't even create a DTML Document. DW just complains that it can't transfer the file, but will create a WebDAV locked file with the same name in Zope. I don't know if there's a way (without patching Zope) to get it to create ZPT by default or not, but it would be a nice thing to be able to do. > I have been banging my head to the wall Probably not going to do much more than hurt the wall. ;-) > Since there is a tutorial on the Zope site rather prominently promising to > tell how to use ZPT and Dreamweaver I assume it should be possible. > Please somebody tell me how. I hope these notes help. ZPT and DW work fine together as promised. The biggest problem is DW's stupid extension requirement. _______________________ Ron Bickers Logic Etc, Inc. From robert@redcor.ch Mon Sep 17 10:37:24 2001 From: robert@redcor.ch (Robert Rottermann) Date: Mon, 17 Sep 2001 11:37:24 +0200 Subject: [ZPT] how to access zpt with dramweaver ??? References: Message-ID: <01c901c13f5c$5b9a8940$0a01a8c0@stravinsky> Thank you very much for your detailed answer. The "open with" trick should do it for the situations where I do not add .html to the name. My real problem is that I am to stubborn to have a solution explained to (the /source.html thing) and leving the computer before I have it working. I do not believe that anybody ever tried that stunt with dreamweaver (either on windows or mac). thanks again Robert ----- Original Message ----- From: "Ron Bickers" To: "Robert Rottermann" ; Sent: Saturday, September 15, 2001 5:35 PM Subject: RE: [ZPT] how to access zpt with dramweaver ??? > > -----Original Message----- > > From: zpt-admin@zope.org [mailto:zpt-admin@zope.org]On Behalf Of Robert > > Rottermann > > > is there somebody out there who can tell me how I can access > > Zope/ZPT using > > Dreamweaver (or Golive) > > ZPT works great with Dreamweaver for me. It works fine with Zope via WebDAV > (using -W) and FTP. > > > - no dots on the Zope side. > > - a way to deal with the layout on dreamweaver side. > > The problem you describe is Dreamweaver's stupid (really stupid) limitation > that it can't directly open files without extensions. I've complained > officially to them about this at length with at least some positive feedback > about it. Hopefully they'll do something about it in a future release. > > I do two things to help alleviate this problem: > > 1) Use .html extensions on page templates that will be "viewed" (ie, will be > part of a URL), but not just as a snippet of code or a macro definition. > > 2) To open files without extensions: in the site window I select File | > Open With...Browse and find and select Dreamweaver.exe. In DW (at least in > version 4.01), this will open files without extensions and allow the layout > view. It's a stupid thing to have to do, but it does work and it's not too > painful since most of my page templates use #1 above. > > > I tried to use the WebDAV source port with the -W option > > This works just fine for me. Remember that when you specify the host for > FTP or WebDAV in DW, you must include the port number (eg, > http://www.myshost.com:8021/) > > > I tried to save a file with "/source.html" appended to it > > I made a directory on the windows side named like the Zope object and put > > its content into a file called source.html in that directory. I > > cant upload > > this directory/file to Zope using either Dreamwever4 or Golive5. > > I've never tried any solution that uses source.html. > > One thing that is a bit annoying, is that you must create a Page Template > object of the same name before you can just transfer it from DW to Zope. > Otherwise, Zope will create a DTML Document. In WebDAV mode, it won't even > create a DTML Document. DW just complains that it can't transfer the file, > but will create a WebDAV locked file with the same name in Zope. I don't > know if there's a way (without patching Zope) to get it to create ZPT by > default or not, but it would be a nice thing to be able to do. > > > I have been banging my head to the wall > > Probably not going to do much more than hurt the wall. ;-) > > > Since there is a tutorial on the Zope site rather prominently promising to > > tell how to use ZPT and Dreamweaver I assume it should be possible. > > Please somebody tell me how. > > I hope these notes help. ZPT and DW work fine together as promised. The > biggest problem is DW's stupid extension requirement. > > _______________________ > > Ron Bickers > Logic Etc, Inc. > > From bkc@murkworks.com Mon Sep 17 20:32:21 2001 From: bkc@murkworks.com (Brad Clements) Date: Mon, 17 Sep 2001 15:32:21 -0400 Subject: [ZPT] DOCTYPE declaration in master macro in ZPT 1.4 Message-ID: <3BA6174C.19512.1E8335D3@localhost> Is this a faq, I found only one reference in the mailing list archives. This link http://dev.zope.org/Wikis/DevSite/Projects/ZPT/WholePageMacros and http://dev.zope.org/Wikis/DevSite/Projects/ZPT/CurrentIssues speaks to this problem. Is there something in CVS I can use now to solve this problem? The CurrentStatus page seems to be quite out of date. Now that PageTemplates have properties, maybe this could be solved with a use- macro property? -- My Master starts with: The title and of course the "client" PageTemplate doesn't get the DOCTYPE from the master because it's outside the HTML entity. validator complains.. Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements From bkc@murkworks.com Mon Sep 17 22:48:34 2001 From: bkc@murkworks.com (Brad Clements) Date: Mon, 17 Sep 2001 17:48:34 -0400 Subject: [ZPT] Best way to use structured-text with cataloged ZPT? Message-ID: <3BA63739.614.1EFFED1A@localhost> I'm building my new company site using all Page Templates instead of DTML, however I'd like to have a lot of my content in Structured Text Files. I could create a PageTemplate for every structured Text file that will have the PageTemplate render the structured text using a "master" macro. But .. that's tedious. Also, I'd like to be able to index the content of my site and allow users to search. The catalog will index the structured text files, (not the page templates).. So a catalog search will return a list of structured text objects.. Which if the user clicks on them I then have to actually direct them to a Page Template that falls within the same folder (to keep the navigation context correct) as the structured text file. Is their an "easy" way to catalog and use structured text with PageTemplates, or do I need to manually make the "twin pagetemplate" files for every structured text file? I suppose I could use one PageTemplate and pass args to it to select the appropriate Structured Text document, but I'd like to avoid using query strings .. and I'd prefer that every element in the URL really "exist" (so I'd rather not use PathHandler). Thoughts? Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements From evan@zope.com Tue Sep 18 02:50:19 2001 From: evan@zope.com (Evan Simpson) Date: Mon, 17 Sep 2001 21:50:19 -0400 Subject: [ZPT] Best way to use structured-text with cataloged ZPT? References: <3BA63739.614.1EFFED1A@localhost> Message-ID: <3BA6A85B.2060509@zope.com> Brad Clements wrote: > I could create a PageTemplate for every structured Text file that will have the > PageTemplate render the structured text using a "master" macro. I'm not sure I understand. Do you want all of the structured text files rendered the same way, apart from the text itself? In this case I would just do something like: Page Template "stview" ====================== ...whatever...
This is where the structured text will go.
...more stuff ...and write URLs like http://myhost.com/foo/blah/MySTDoc1/stview. Then "here" is the structured text object. I'm assuming that calling it will generate HTML, but if a method of the object needs to be called you just write "structure here/theMethod". Cheers, Evan @ Zope From richard@bizarsoftware.com.au Tue Sep 18 02:41:03 2001 From: richard@bizarsoftware.com.au (Richard Jones) Date: Tue, 18 Sep 2001 11:41:03 +1000 Subject: [ZPT] Tempalte "program" not persistent Message-ID: <0109181141031U.01597@ike> We're having problems with the non-persistence of the page template programs. The first being that it takes a while to cook the templates, and that has to be done every time the server is restarted. The second is that we see strange problems with the program only being updated in some threads (we think). I haven't really had much chance to think about it - so are there any obvious reasons why the program can't be made persistent? Richard From evan@zope.com Tue Sep 18 03:04:34 2001 From: evan@zope.com (Evan Simpson) Date: Mon, 17 Sep 2001 22:04:34 -0400 Subject: [ZPT] DOCTYPE declaration in master macro in ZPT 1.4 References: <3BA6174C.19512.1E8335D3@localhost> Message-ID: <3BA6ABB2.3020902@zope.com> Brad Clements wrote: > This link http://dev.zope.org/Wikis/DevSite/Projects/ZPT/WholePageMacros and > http://dev.zope.org/Wikis/DevSite/Projects/ZPT/CurrentIssues speaks to this problem. > > Is there something in CVS I can use now to solve this problem? Not yet. We haven't had much development time available recently to get this done, but that will change soon. > > Message-ID: <3BA6AD16.6070108@zope.com> Richard Jones wrote: > We're having problems with the non-persistence of the page template programs. > The first being that it takes a while to cook the templates, and that has to > be done every time the server is restarted. The second is that we see strange > problems with the program only being updated in some threads (we think). The first is expected, the second isn't. If you could pin that behavior down reproducibly, I'd appreciate it. > I haven't really had much chance to think about it - so are there any obvious > reasons why the program can't be made persistent? None whatsoever. There's a storage space cost, of course, for the time savings. The compiled program is somewhat larger than the original text. I really wish we could create a compact "parser hints" data structure that allowed fast re-parsing, but I don't know enough to do it, and it might not be possible without getting into the parsers' guts. Meanwhile, there should probably be some way of indicating that you want the program for some or all templates to be saved, so that people can pick their tradeoff. Cheers, Evan @ Zope From richard@bizarsoftware.com.au Tue Sep 18 03:10:17 2001 From: richard@bizarsoftware.com.au (Richard Jones) Date: Tue, 18 Sep 2001 12:10:17 +1000 Subject: [ZPT] Tempalte "program" not persistent In-Reply-To: <3BA6AD16.6070108@zope.com> References: <0109181141031U.01597@ike> <3BA6AD16.6070108@zope.com> Message-ID: <0109181210171W.01597@ike> On Tuesday 18 September 2001 12:10, Evan Simpson wrote: > Richard Jones wrote: > > We're having problems with the non-persistence of the page template > > programs. The first being that it takes a while to cook the templates, > > and that has to be done every time the server is restarted. The second is > > that we see strange problems with the program only being updated in some > > threads (we think). > > The first is expected, the second isn't. If you could pin that behavior > down reproducibly, I'd appreciate it. That's one of the problems - it's not exactly consistent (which is why we're blaming it on threads). It's on my TODO to get a solid example, and when I do, I'll let you know :) > > I haven't really had much chance to think about it - so are there any > > obvious reasons why the program can't be made persistent? > > None whatsoever. There's a storage space cost, of course, for the time > savings. The compiled program is somewhat larger than the original > text. I really wish we could create a compact "parser hints" data > structure that allowed fast re-parsing, but I don't know enough to do > it, and it might not be possible without getting into the parsers' guts. OK, we'll switch over to persisting the programs on one of our dev machines and see if that makes our errors go away. Richard From jwm@plain.co.nz Tue Sep 18 03:39:12 2001 From: jwm@plain.co.nz (John) Date: Tue, 18 Sep 2001 14:39:12 +1200 Subject: [ZPT] Tempalte "program" not persistent References: <0109181141031U.01597@ike> <3BA6AD16.6070108@zope.com> <0109181210171W.01597@ike> Message-ID: <3BA6B3D0.6AC280BE@plain.co.nz> Richard Jones wrote: > On Tuesday 18 September 2001 12:10, Evan Simpson wrote: > > Richard Jones wrote: > > > We're having problems with the non-persistence of the page template > > > programs. The first being that it takes a while to cook the templates, > > > and that has to be done every time the server is restarted. The second is > > > that we see strange problems with the program only being updated in some > > > threads (we think). > > > > The first is expected, the second isn't. If you could pin that behavior > > down reproducibly, I'd appreciate it. > That's one of the problems - it's not exactly consistent (which is why we're > blaming it on threads). It's on my TODO to get a solid example, and when I > do, I'll let you know :) I've encountered similar behaviour when testing templates from the file system in debugging mode. I suspect that some templates are not being recooked under certain circumstances - possibly if they are a macro that you've just updated and are looking at by reloading a page that call it. I'll test this hypothesis later today. John From jwm@plain.co.nz Tue Sep 18 06:43:51 2001 From: jwm@plain.co.nz (John) Date: Tue, 18 Sep 2001 17:43:51 +1200 Subject: [ZPT] Tempalte "program" not persistent References: <0109181141031U.01597@ike> <3BA6AD16.6070108@zope.com> <0109181210171W.01597@ike> <3BA6B3D0.6AC280BE@plain.co.nz> Message-ID: <3BA6DF17.2B9F88C4@plain.co.nz> John wrote: > Richard Jones wrote: > > > On Tuesday 18 September 2001 12:10, Evan Simpson wrote: > > > Richard Jones wrote: > > > > We're having problems with the non-persistence of the page template > > > > programs. The first being that it takes a while to cook the templates, > > > > and that has to be done every time the server is restarted. The second is > > > > that we see strange problems with the program only being updated in some > > > > threads (we think). > > > > > > The first is expected, the second isn't. If you could pin that behavior > > > down reproducibly, I'd appreciate it. > > > That's one of the problems - it's not exactly consistent (which is why we're > > blaming it on threads). It's on my TODO to get a solid example, and when I > > do, I'll let you know :) > > I've encountered similar behaviour when testing templates from the file system > in debugging mode. I > suspect that some templates are not being recooked under certain circumstances - > possibly if they are > a macro that you've just updated and are looking at by reloading a page that > call it. I'll test this hypothesis later today. I tested several flavours of template access and couldn't replicate the lack of update behaviour, so it may well be thread related. John From fdrake@acm.org Tue Sep 18 15:09:06 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Tue, 18 Sep 2001 10:09:06 -0400 Subject: [ZPT] Tempalte "program" not persistent In-Reply-To: <3BA6B3D0.6AC280BE@plain.co.nz> References: <0109181141031U.01597@ike> <3BA6AD16.6070108@zope.com> <0109181210171W.01597@ike> <3BA6B3D0.6AC280BE@plain.co.nz> Message-ID: <15271.21890.300871.660859@grendel.digicool.com> John writes: > I've encountered similar behaviour when testing templates from the file system > in debugging mode. I > suspect that some templates are not being recooked under certain circumstances - > possibly if they are > a macro that you've just updated and are looking at by reloading a page that > call it. I'll test this hypothesis later today. I've seen this as well, and that's exactly the diagnosis I made, though I haven't had time to dig around and see how easy it would be to fix. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From bkc@murkworks.com Tue Sep 18 16:48:16 2001 From: bkc@murkworks.com (Brad Clements) Date: Tue, 18 Sep 2001 11:48:16 -0400 Subject: [ZPT] Macro Master templates can't reach their own properties.. Message-ID: <3BA73443.16374.22DC63B2@localhost> I have a Master page template with a property "leftcolumnwidth" defined. When this template is "called" from another page template, stuff like tal:content="template/leftcolumnwidth" fails with "leftcolumnwidth not found in template/leftcolumnwidth" I suppose this happens because the macro is expanded into the "client template" before being processed. Don't suppose properties could be "copied over" too during rendering? Clearly properties defined in the client template should have precedence.. otherwise, having properties in anything that defines a macro serves no purpose. Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements From cyrille@ktaland.com Tue Sep 18 17:13:00 2001 From: cyrille@ktaland.com (Cyrille Giquello) Date: Tue, 18 Sep 2001 18:13:00 +0200 Subject: [ZPT] (general) TAL is THE template solution Message-ID: <3BA7728C.977C0CA4@ktaland.com> Hi all, for many years, I participe cgi with many languages and many template engines ... My mind is that TAL general idea (not yet read all spec) is THE template solution . Why other template engines doesn't implement the same idea ??? Is there some people who're working on implementing TAL in another language than Python ??? I think about Perl, Java, Php and others ... Thanx for your opinion ! Cyrille ----------------------------------------- Encryption | Duncan Campbell | DST | Blacklisted 411 | ECHELON | 2600 | PGP | Corsica | NSA From dieter@handshake.de Tue Sep 18 22:41:40 2001 From: dieter@handshake.de (Dieter Maurer) Date: Tue, 18 Sep 2001 23:41:40 +0200 (CEST) Subject: [ZPT] Tempalte "program" not persistent In-Reply-To: <0109181141031U.01597@ike> References: <0109181141031U.01597@ike> Message-ID: <15271.49044.892101.457066@lindm.dm> Richard Jones writes: > We're having problems with the non-persistence of the page template programs. > The first being that it takes a while to cook the templates, and that has to > be done every time the server is restarted. You find a patch at that delays cooking until the ZPT is really needed. Not completely what you are looking for, but better than the "stock" version. > The second is that we see strange > problems with the program only being updated in some threads (we think). > > I haven't really had much chance to think about it - so are there any obvious > reasons why the program can't be made persistent? Fortunately, I have never seen that. Dieter From richard@bizarsoftware.com.au Wed Sep 19 00:24:18 2001 From: richard@bizarsoftware.com.au (Richard Jones) Date: Wed, 19 Sep 2001 09:24:18 +1000 Subject: [ZPT] Tempalte "program" not persistent In-Reply-To: <3BA6B3D0.6AC280BE@plain.co.nz> References: <0109181141031U.01597@ike> <0109181210171W.01597@ike> <3BA6B3D0.6AC280BE@plain.co.nz> Message-ID: <01091909241827.01597@ike> On Tuesday 18 September 2001 12:39, John wrote: > I've encountered similar behaviour when testing templates from the file > system in debugging mode. I > suspect that some templates are not being recooked under certain > circumstances - possibly if they are > a macro that you've just updated and are looking at by reloading a page > that call it. I'll test this hypothesis later today. We make no use of macros... Richard From evan@zope.com Wed Sep 19 17:03:30 2001 From: evan@zope.com (Evan Simpson) Date: Wed, 19 Sep 2001 12:03:30 -0400 Subject: [ZPT] Macro Master templates can't reach their own properties.. References: <3BA73443.16374.22DC63B2@localhost> Message-ID: <3BA8C1D2.3090703@zope.com> Brad Clements wrote: > I have a Master page template with a property "leftcolumnwidth" defined. > > When this template is "called" from another page template, stuff like > > tal:content="template/leftcolumnwidth" > > fails with "leftcolumnwidth not found in template/leftcolumnwidth" > > I suppose this happens because the macro is expanded into the "client template" > before being processed. > > Don't suppose properties could be "copied over" too during rendering? Hmm. That, or we could add the ability to explicitly address the current macro object, as in "macro/leftcolumnwidth", and have macro==template when not in a macro use. Cheers, Evan @ Zope From rbickers-dated-1001524808.8a1de6@logicetc.com Wed Sep 19 18:20:08 2001 From: rbickers-dated-1001524808.8a1de6@logicetc.com (Ron Bickers) Date: Wed, 19 Sep 2001 13:20:08 -0400 Subject: [ZPT] Macro Master templates can't reach their own properties.. In-Reply-To: <3BA8C1D2.3090703@zope.com> Message-ID: > -----Original Message----- > From: zpt-admin@zope.org [mailto:zpt-admin@zope.org]On Behalf Of Evan > Simpson > > Don't suppose properties could be "copied over" too during rendering? > > Hmm. That, or we could add the ability to explicitly address the current > macro object, as in "macro/leftcolumnwidth", and have > macro==template when > not in a macro use. This sounds like a good idea to me. That way, if two macros each have a leftcolumnwidth property, they won't conflict if the macros are used in the same place. _______________________ Ron Bickers Logic Etc, Inc. From bkc@murkworks.com Wed Sep 19 18:25:41 2001 From: bkc@murkworks.com (Brad Clements) Date: Wed, 19 Sep 2001 13:25:41 -0400 Subject: [ZPT] Macro Master templates can't reach their own properties.. In-Reply-To: References: <3BA8C1D2.3090703@zope.com> Message-ID: <3BA89C93.10866.285BE540@localhost> On 19 Sep 2001 at 13:20, Ron Bickers wrote: > > -----Original Message----- > > From: zpt-admin@zope.org [mailto:zpt-admin@zope.org]On Behalf Of Evan > > Simpson > > > > Don't suppose properties could be "copied over" too during rendering? > > > > Hmm. That, or we could add the ability to explicitly address the current > > macro object, as in "macro/leftcolumnwidth", and have macro==template > > when not in a macro use. > > This sounds like a good idea to me. That way, if two macros each have a > leftcolumnwidth property, they won't conflict if the macros are used in the > same place. _______________________ I agree, having a "macro" context would be good. Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements From mark@kaluma.com Thu Sep 20 11:16:11 2001 From: mark@kaluma.com (Mark Henderson) Date: Thu, 20 Sep 2001 12:16:11 +0200 Subject: [ZPT] [NEWBIE] Permissions problem with "Test" screen/tab Message-ID: New to Zope and just installed 2.4.1 as well as PageTemplates 1.4.0, ZTUtils 1.1.1 and TAL 1.4.0. Followed Evan's install instructions on http://www.zope.org/Members/4am/ZPT, electing to put PageTemplates into "lib/python/Products". This was all done as root. (On Linux Mandrake 8.1b3) I started Zope, created a test PageTemplate (called "test-tem"), and having looked at it in the Edit screen, I attempted to go the the Test screen and Konqueror gave me a "Authentication Failed" error. I have been able to successfully work through the included Zope tutorials, so I'm assuming general installation of Zope was ok. FWIW, I had a permissions problem with a couple of the files when installing Zope (as root), but this was covered in the docs and I fixed it. Any help appreciated. Cheers, Mark --- Mark Henderson mark@kaluma.com +27 83 258-6937 From dieter@handshake.de Thu Sep 20 20:21:33 2001 From: dieter@handshake.de (Dieter Maurer) Date: Thu, 20 Sep 2001 21:21:33 +0200 (CEST) Subject: [ZPT] metal design flaw: converting "define-macro" into "use-macro" Message-ID: <15274.16829.414678.256344@lindm.dm> Zope 2.3.3 with PageTemplates 1.4.0 When a PageTemplate containing a macro definition is processed (read in, uploaded, FTP-put), 'metal:define-macro="macroname"' is converted into 'metal:use-macro="macroname"'. When this template is subsequently changed via the Management Interface or FTP-get->modified->FTP-put, then we get a 'Metal error: macro not found "macroname"', as we have now a "use-macro" and no longer a "define-macro". It seems to me that the conversion "metal:define-macro" into "metal:use-macro" is a bad thing. Dieter From amos@zope.com Thu Sep 20 23:59:34 2001 From: amos@zope.com (Amos Latteier) Date: Thu, 20 Sep 2001 18:59:34 -0400 Subject: [ZPT] CVS: Products/PageTemplates/help - tal-attributes.stx:1.1 tal-condition.stx:1.1 tal-content.stx:1.1 tal-define.stx:1.1 tal-on-error.stx:1.1 tal-repeat.stx:1.1 tal-replace.stx:1.1 tal.stx:1.1 Message-ID: <200109202259.f8KMxYI20234@cvs.baymountain.com> Update of /cvs-repository/Products/PageTemplates/help In directory cvs.zope.org:/tmp/cvs-serv20219 Added Files: tal-attributes.stx tal-condition.stx tal-content.stx tal-define.stx tal-on-error.stx tal-repeat.stx tal-replace.stx tal.stx Log Message: first cut at a TAL reference. === Added File Products/PageTemplates/help/tal-attributes.stx === attributes - Replace element attributes Syntax 'tal:attributes' syntax:: argument ::= attribute_statement [';' attribute_statement]* attribute_statement ::= attribute_name expression attribute_name ::= [namespace ':'] Name namespace ::= Name *Note: If you want to include a semi-colon (;) in an 'expression', it must be escaped by doubling it (;;).* Description The 'tal:attributes' statement replaces the value of an attribute (or create an attribute) with a dynamic value. You can qualify an attribute name with a namespace prefix, for example 'html:table', if you are generating an XML document with multiple namespaces. The value of each expression is converted to a string, if necessary. If the expression associated with an attribute assignment evaluates to *nothing*, then that attribute is deleted from the statement element. If the expression evaluates to *default*, then that attribute is left unchanged. Each attribute assignment is independent, so attributes may be assigned in the same statement in which some attributes are deleted and others are left alone. If you use 'tal:attributes' on an element with an active 'tal:replace' command, the implementation may ignore the 'tal:attributes' statement. If it does not, the replacement must use the 'structure' type, the structure returned by the expression must yield at least one element, and the attributes will be replaced on the first such element only. For example:: May result in either:: or:: *Note: Zope will return the second result* If you use 'tal:attributes' on an element with a 'tal:repeat' statement, the replacement is made on each repetition of the element, and the replacement expression is evaluated fresh for each repetition. Examples Replacing a link:: Replacing two attributes::