Re: [Zope] Best way to subclass DTML Document and some other ZClasses questions
On Wed, 16 Aug 2000, Marcin Kasperski wrote: > REQUEST)"> > > >How can I change original title? > > > > > On which object (which property sheet) should I call > manage_editProperties to change document title? I believe the title goes in the 'default' property sheet, but more than that I can't tell you. 'default' gets some special handling I think, but you could certainly try just using it in place of Extra in the call up there. --RDM ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Best way to subclass DTML Document and some other ZClasses questions
Marcin Kasperski writes: > > > 1) How can I set standard DTML Document properties (title!) from my > > > constructor? I created constructor form and constructor method, I > > > succesfully prompt for and set all my properties but I do not know how > > > to set properties belonging to DTML Document. > > Your ZClass inherits the methods of its base classes. > > You use the base classes methods to access their features. > > > > In your specific case, you would use "manage_changeProperties" > > to change the DTML Document properties. > > "manage_changeProperties" is defined by "OFS.PropertyManager.PropertyManager". > > What exactly should I write? > On which object (which property sheet) should I call > manage_editProperties to change document title? On the object you want the title changed Okay, let's admit: I am a bit confused. Above, I understood that your class derives from DTML Document. Then each instance of your class is an instance of DTML Document, too. You use the inherited methods in the same way you use the methods defined in your class. I.e. What confuses me: below your custom class does not seem to be derived from DTML Document. > > > 2) Can I do anything to have single property screen which would behave > > > as original DTML Document property screen but present both original > > > properties and properties belonging to my custom property sheet? > > You can create your own ZClass "view" that does this. > > So it is impossible to use original DTML Document property screen? I > like it. You can use the source and extend it (slightly). > > > 4) Can I do something to have ZCatalog PrincipiaSearch (i.e. full text > > > search) to scan some property of my custom ZClass (say property body > > > from propertysheet Basic)? > > You just define "Meta Data" or indexes for them. > > Not exactly. I would like to have bodies of my DTML Documents and my > custom class (which does not subclass DTML Document) .body property > contents to be indexed with _the same_ full text index. What should this "the same" mean? > I tried defining method PrincipiaSearchSource in my custom class but it > did not helped (ZCatalog did not indexed my objects in PrincipiaSearch > index - according to its status screen). Any parameterless method (or any attribute) should work. Maybe, your methods throws an exception. Then, it will not contribute to the indexing. Test it in isolation. > > > 5) Can I write index_html method of my custom class so it interpret DTML > > > tags (like dtml-var substitution)? > > I do not understand this question: > > > > "index_html" has nothing to do with interpreting DTML tags. > > Yes I know. In fact I ask 'what can I do to parse DTML in a method of > object which does not subclass DTML Document?' > > > When you want to interpret DTML tags, you will need to somehow > > use DocumentTemplate instances. > > And that 'somehow' is what I am asking for. You either use the Zope wrapped Document Template objects (DTML method/document) or you use the DocumentTemplate directly in Python (external method, product, maybe Python method). The DTML user guide contains a chapter on how to use Document Template from Python. > The archives are not searchable :-( You look at the wrong archives. NIP archives the main Zope mailing lists. *These* archives *are* searchable. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Best way to subclass DTML Document and some other ZClasses questions
[ I reply both to the author and Zope list, feel free to answer to the list only ] > > 1) How can I set standard DTML Document properties (title!) from my > > constructor? I created constructor form and constructor method, I > > succesfully prompt for and set all my properties but I do not know how > > to set properties belonging to DTML Document. > Your ZClass inherits the methods of its base classes. > You use the base classes methods to access their features. > > In your specific case, you would use "manage_changeProperties" > to change the DTML Document properties. > "manage_changeProperties" is defined by "OFS.PropertyManager.PropertyManager". What exactly should I write? Currently my constructor method contains the following (mk_dtml_document is my custom class which subclasses DTML Document, Extra is the name of my custom propertysheet): How can I change original title? On which object (which property sheet) should I call manage_editProperties to change document title? > > > 2) Can I do anything to have single property screen which would behave > > as original DTML Document property screen but present both original > > properties and properties belonging to my custom property sheet? > You can create your own ZClass "view" that does this. > So it is impossible to use original DTML Document property screen? I like it. > > 4) Can I do something to have ZCatalog PrincipiaSearch (i.e. full text > > search) to scan some property of my custom ZClass (say property body > > from propertysheet Basic)? > You just define "Meta Data" or indexes for them. Not exactly. I would like to have bodies of my DTML Documents and my custom class (which does not subclass DTML Document) .body property contents to be indexed with _the same_ full text index. I tried defining method PrincipiaSearchSource in my custom class but it did not helped (ZCatalog did not indexed my objects in PrincipiaSearch index - according to its status screen). > > 5) Can I write index_html method of my custom class so it interpret DTML > > tags (like dtml-var substitution)? > I do not understand this question: > > "index_html" has nothing to do with interpreting DTML tags. Yes I know. In fact I ask 'what can I do to parse DTML in a method of object which does not subclass DTML Document?' > When you want to interpret DTML tags, you will need to somehow > use DocumentTemplate instances. And that 'somehow' is what I am asking for. > > > And one question after the whole mess. I migrated my (fairly small so > > far) website from DTML Documents to my custom document class - and I did > > it manually. But I would not like to perform similar operation manually > > if the site contained 500 or 5000 pages. > You will find in the list's archive a suggestion for converting > DTML documents into DTML methods. > It could be adapted for your purpose. > The archives are not searchable :-( I will try downloading them but if anyone has this article handy, I'd be grateful. Regards -- Serwis nie tylko mieszkaniowy: http://www.mk.w.pl | | Osoba jest omegalizacją ewolucji uniwersalnej na określonym odcinku | etapowym (Teilhard de Chardin) | ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Best way to subclass DTML Document and some other ZClasses questions
Marcin Kasperski writes: > I decided to subclass DTML Document and (using ZClass) create my own > document class > > 1) How can I set standard DTML Document properties (title!) from my > constructor? I created constructor form and constructor method, I > succesfully prompt for and set all my properties but I do not know how > to set properties belonging to DTML Document. Your ZClass inherits the methods of its base classes. You use the base classes methods to access their features. In your specific case, you would use "manage_changeProperties" to change the DTML Document properties. "manage_changeProperties" is defined by "OFS.PropertyManager.PropertyManager". > 2) Can I do anything to have single property screen which would behave > as original DTML Document property screen but present both original > properties and properties belonging to my custom property sheet? You can create your own ZClass "view" that does this. > 3) Can I influence property editing screens (what I want is to increase > some edit boxes)? Same as 2) > 4) Can I do something to have ZCatalog PrincipiaSearch (i.e. full text > search) to scan some property of my custom ZClass (say property body > from propertysheet Basic)? You just define "Meta Data" or indexes for them. > 5) Can I write index_html method of my custom class so it interpret DTML > tags (like dtml-var substitution)? I do not understand this question: "index_html" has nothing to do with interpreting DTML tags. If there is an "index_html", then, via the web, you can use ".../my_object" and, in fact, ".../my_object/index_html" is used. That is all. When you want to interpret DTML tags, you will need to somehow use DocumentTemplate instances. > And one question after the whole mess. I migrated my (fairly small so > far) website from DTML Documents to my custom document class - and I did > it manually. But I would not like to perform similar operation manually > if the site contained 500 or 5000 pages. You will find in the list's archive a suggestion for converting DTML documents into DTML methods. It could be adapted for your purpose. You may have a look at ZPublisher.Client, too. It allows to control Zope by external Python scripts. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Best way to subclass DTML Document and some other ZClasses questions
I decided to subclass DTML Document and (using ZClass) create my own document class (in fact I wanted all my documents to possess some standard properties and prompt for them on initialization and also to be CatalogAware). I succeeded (everything more-or-less works), but I still have some doubts: 1) How can I set standard DTML Document properties (title!) from my constructor? I created constructor form and constructor method, I succesfully prompt for and set all my properties but I do not know how to set properties belonging to DTML Document. 2) Can I do anything to have single property screen which would behave as original DTML Document property screen but present both original properties and properties belonging to my custom property sheet? 3) Can I influence property editing screens (what I want is to increase some edit boxes)? I created also some classes which do not inherit DTML Document or DTM method. I have questions about such a configuration: 4) Can I do something to have ZCatalog PrincipiaSearch (i.e. full text search) to scan some property of my custom ZClass (say property body from propertysheet Basic)? 5) Can I write index_html method of my custom class so it interpret DTML tags (like dtml-var substitution)? And one question after the whole mess. I migrated my (fairly small so far) website from DTML Documents to my custom document class - and I did it manually. But I would not like to perform similar operation manually if the site contained 500 or 5000 pages. 6) What you, Zope gurus, would do if you were to find all the DTML Documents in some directory tree and remove them, creating instead Documents (where Document is some subclass of DTML Document) - and keeping the document id, title, contents and properties without change? 7) And what if you were to change something a little - say detect that some property belongs to custom propertysheet and put it there instead on putting on standard DTML Document propertysheet? Regards and thanks in advance for any hints and references Marcin -- Serwis nie tylko mieszkaniowy: http://www.mk.w.pl | | Osoba jest omegalizacją ewolucji uniwersalnej na określonym odcinku | etapowym (Teilhard de Chardin) | ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )