Re: [Zope] manage_workspace

2000-09-08 Thread R. David Murray

On Fri, 8 Sep 2000, Mechtild Hofmann wrote:
> I'am looking for the source-code from "manage_workspace". Where do I
> find this file or is it part of a *.py - file ?

Yes, it's in a .py file.  I think the one you are looking for
is in lib/python/App/Management.py.

--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] change_properties

2000-09-08 Thread R. David Murray

On Fri, 8 Sep 2000 [EMAIL PROTECTED] wrote:
>  neuesBudget})">
> 
> This means I'd like to change in a token property only one value but it's
> not working.

I don't think you can do that.  I presume that manage_changeProperties
uses the variable names passed in to look the property up in the
property dictionary, and it isn't going to find a property named
'Budget[0]' in that list.  I think you'll have to pass it the
whole value of budget with the appropriate cell modified:



--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] Not able to render a base class...

2000-09-08 Thread R. David Murray

On Fri, 8 Sep 2000, Brian Withun wrote:
> I was rather expecting to see 'Renderable' as an option in the BASE CLASSES,
> but it's not there.  If it's supposed to be there, can you fathom what I may
> have done wrong?

You need to install the Renderable product.

--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] Zclass not reindexing (it is CatalogAware)

2000-09-07 Thread R. David Murray

On Thu, 7 Sep 2000, Tim Hicks wrote:
> So each time there is a change made to the text, I must call
> reindex_object, is that correct?  If so, how do I make it so that each
> time I hit the 'Change' button at the bottom of the text box,
>  is executed?

If you take a close look at the how-to, it also tells you you have
to write your own management 'editForm' method and assign it to the
view tab.  In the action method for that form, you do the
reindex_object.

--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] Zclass not reindexing (it is CatalogAware)

2000-09-07 Thread R. David Murray

On Thu, 7 Sep 2000, Tim Hicks wrote:
> The question is, do I need to add the equivalent of what is written in
> 'How-To: Creating a CatalogAware ZClass' for reindexing zclass
> properties, but for reindexing the actual text?  How could I do this?

When is the text created?  After it is, you have to call reindex_object.

--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] Editing of ZClasses using FTP: Access denied

2000-09-07 Thread R. David Murray

On Thu, 7 Sep 2000, Harald Koschinski wrote:
> I am trying to edit methods inside a ZClass. The problem is, that the
> ZClasse-folder don´t has any permissions via FTP - so there is no chance
> to come into the folder.
> 
> Where do I have to change the permission??

You don't.

However, if you specify the URL of the method directly (make sure you
use the full URL as shown on the management edit screen), you will
be able to access it.  At least, so it has been reported on this
mailing list in the recent past.

--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] Folder and SQL security

2000-09-04 Thread R. David Murray

On Mon, 4 Sep 2000, George wrote:
> asks for the password even for the viewing. Then I enable 'access the
> content' and the site works as long as I do not try to use sql. When I
> how ever enable 'use sql methods' permission they can access my
> database, delete and add entries to it. What do I have to do to allow

Chris may have pointed you in the right direction, but depending on
the complexity of what you are doing you may also need to learn about
using proxy roles.  This allows you to write a dtml-method that
an anonymous user can call, where the dtml-method can accessed
privileged functions.  Since you control the method code, you
thereby control the security of that access and can limit it
to just what you need to make the site functional.

--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] Render the number of occurrence in a batch

2000-09-04 Thread R. David Murray

On Fri, 1 Sep 2000, Kapil Thangavelu wrote:
> Francois-Regis CHALAOUX wrote:
> > How to render the total number of result coming from the search in a ZCatalog
> > even if the batch will be render in several sequences ?
> > 
> > Howto render  : "Your search contain  results"
> 
> 

Or just

 while inside the dtml-in, say inside
the  block.

--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] Objet : Re: [Zope] Searching in all field with ZCatalog

2000-08-31 Thread R. David Murray

> No, you asked the right question, scuse me for the error !! 
> I would like only one entry in the form to search in all indexed fields.
> I like this solution cause it is sometimes difficult for a no regulmar user in
> this aera (Protein Data Bank) to question the right field.
> In fact I would like create a simple form ;)

You can have one field, and copy the value so that it gets searched
for in all the fields when you make the catalog call.  But you don't
want to do that, because Catalog will AND the results from all
the fields.

The Advanced ZCatalog Searching HowTo shows how to OR the fields
programatically.  But what may work better for you would be to
create a method on all of your objects that returns the concatenation
of the values of all the fields of interest.  Index *that* field,
and search that field.

--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] CRC-32 checksum

2000-08-31 Thread R. David Murray

On Wed, 30 Aug 2000, Jim Sanford wrote:
> Does anyone have or know the whereabouts of a python module that will do 32 bit CRC 
>checksums?

I found a crc32 function in the zlib module for python.

--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] Export/import problem

2000-08-30 Thread R. David Murray

On Wed, 30 Aug 2000, Oras Kaarel (2914) wrote:
> I have two different Zope types (Zope 1.10.3 (binary release, python 1.5.1,
> win32-x86) and Zope version: Zope 2.2.1 (binary release, python 1.5.2,
> win32-x86)) and our intranet is located in the older version. I thought that
> exporting/importing would be a great idea. I managed to export *.bbe file
> and I copied it in import catalog in new Zope, but the new version of Zope
> announced, that:

Somewhere in the 2.2.1 tree there should be a utility for converting
bbe files to the new format (zexp).

--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] symbolic links or invisible objects..?

2000-08-29 Thread R. David Murray

On Tue, 29 Aug 2000, Geoffrey L. Wright wrote:
> Aparently the fact that a number of other non-content objects are visible
> at the same level of heirarchy in the site is a problem.  So my question
> is this:
> 
>  Is there any way to make zope understand something like a UNIX symbolic
>  link?  If so, I could easily create a single directory with a symlinks to
>  all the appropriate objects in the site.  Content managers would then
>  have access only to this dir and would therefor see all appropriate
>  objects.
> 
>  Or perhaps there is a way to make other objects invisable to those w/out
>  the necessary permission to use them?  I've played with Zope permissions
>  a but, and haven't yet found a way to do this.
> 
>  Or is the some other way entirely to look at this problem?

How about creating a custom management page that just lists the
objects they need to change?  You could do this by hand if the
object list is static.  If, as is more likely, it changes, you
could create a Catalog that indexes meta_type or (if body_content
is not a specialized class) id, and thereby be able to pull up a
list of all body_content objects and list them on the custom
management page using dtml-in.  You can even use dtml-in batching
to keep the page size down if there are lots of these things.

--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] SSL and PGP

2000-08-29 Thread R. David Murray

On Tue, 29 Aug 2000, Diego Rodrigo Neufert wrote:
> Anyone know how to send a pgp cryped email in zope? (using  or
> anything else)
> 
> and
> 
> How to run a SSL server with ZServer?

Search for M2Crypto on zope.org.  It does both.

--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] Question relating to a zope product 'Tracker': emailproblems

2000-08-29 Thread R. David Murray

On Tue, 29 Aug 2000, Julian Harris wrote:
> PS if I wanted to make a change to the source on my machine, do I have to
> compile it? I see these PYC files everywhere but I thought Python was an
> interpreted language? How would I make a change if I found that I had to
> tweak the code a little?

If the .py file changes, then the next time python rereads the file
(read: when you restart Zope) a new pyc file will be generated.  The
pyc is a 'pcode' sort of thing, essentially a preparsed version
of the source code providing a considerable load-time optimization
for python apps.

--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] Sub Class Question

2000-08-28 Thread R. David Murray

On Sun, 27 Aug 2000, Loren Stafford wrote:
> Here's what MJ told me about that case. I'm not sure it applies to your
> case. Did you try it? Did it work?

Thanks for the info.  It was the Extension class piece I was missing.
I tested it on a regular class, of course .

The original problem wasn't mine.  I think his problem was different
(passing **kw on to a class method), and I think I pointed him to
the right answer but haven't seen a followup post.

--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] "Automatic" creation of searchable documents from OracleDB tables

2000-08-27 Thread R. David Murray

On Sun, 27 Aug 2000, Chris Beaumont wrote:
> Then, one (in the case of the event types without possible "parents") 
> or both of the SQL Methods are called in an DTML Document input form. 
> When the form is submitted a DTML Method is triggered, which right 
> now only shows an acknowledging thank you to the person who submits 
> the information.
> 
> So, if I understand you correctly, **I should then use that action to 
> create a class that is tied to the primary key of the database table. 
> Is there an example somewhere of this RDBMS table-keyed "automatic" 
> creation of ZClasses or DTML documents?*
[...]
> Anyway, if you have the time and can think of any handy pointers to 
> documentation or relevant examples, Id appreciate it.. But even if 
> not, you already have given me a good start..  It shouldn't be very 

I'm still not clear on why you want to instantiate objects instead
of just dynamically generating the pages out of the database.  But
if instantiating ZClasses when the action method is called is what
you want to do, check out the HowTo Adding ZClass Instances Programatically:

 http://www.zope.org/Members/taz/addZClasses

--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] is possible ?

2000-08-27 Thread R. David Murray

On Sun, 27 Aug 2000, Bill Welch wrote:
> 

Hmm.  Don't you mean _[myPropName]?  I think that will throw a key
error if the value of myPropName is a key in the namespace, though,
which I don't think is what he wants.

If the question is specifically whether or not the property is in
request, then



would probably be the best approach.

--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] Sub Class Question

2000-08-27 Thread R. David Murray

On Sat, 26 Aug 2000, Loren Stafford wrote:
>   def index_object(self):
> if self.nextEventTime() is not None:
> CatalogAware.index_object.im_func(self)
> # see Python Reference Manual "The standard type hierarchy"
> # for the built-in type im_func

I realize this is a Python and a not a Zope question, but
what is the difference between

  CatalogAware.index_object.im_func(self)

and

  CatalogAware.index_object(self)

?

--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] How to implement a round through the whole web site

2000-08-25 Thread R. David Murray

On 25 Aug 2000, Christian Leutloff wrote:
> My problem is now how to store the intermediate results in
> variables. I'm able to define a variable (myseq), but I'm not able to change
> the value afterwards:
> 
> < snip
> 
> 
>  
>   <-- wrong!!!

You're going to kick yourself on this one :



> Are there better solutions?
> 
> Do you know of a predefined way to implement the round through the web
> site? 

Given your description, which I'm not sure I completely understand,
I'd suggest adding a Catalog to your site, and creating an index field
in the catalog that indexes your document sequence number.  Also
make a meta data property in the catalog for the index field.  To get
your complete list of documents, just call the catalog, and you'll
get back everything indexed.  (If you index more stuff than your
documents, just query the Catalog for meta_type DTMLDocument, or
query your index field for >0 and 
  do your processing


Take a look at the Catalog HowTo's to decide what stuff you want in
meta data fields and how to get the object given its Catalog pointer
if you decide you need to do that.

Hmm.  To do prev and next buttons you could find the right document
by doing a search on your index field for a value less then the
current id (prev), sort in reverse, and do size=1 on the dtml-in.
For next, do >id and normal sort order and again size=1.

--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] Sub Class Question

2000-08-25 Thread R. David Murray

On Fri, 25 Aug 2000, Daniel Rusch wrote:
> def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):
> print 'Sub Class __call__'
> DTMLMethod.__call__(self, client, REQUEST, RESPONSE, kw)
[...]
> when I view the BasicMethod in Zope, I get:
> Error Type: TypeError 
> Error Value: too many arguments; expected 4, got 5
> 
> I believe that I need the self arg, if I remove it I get an unbound
> python method error.
> 
> Any thoughts???

DTMLMethod's __call__ only takes three arguments: client, REQUEST,
and RESPONSE.  **kw turns any additional keyword arguments (x=y)
into a dictionary kw.  To pass the ones your __call__ receives on
to DTMLMethod's __call__, you have to turn them back into a keyword
list somehow.  A quick check of the python language reference
doesn't reveal any special syntactic sugar for doing this.  However,
in the definition of __call__ in DTMLMethod I found this:

r = apply(HTML.__call__, (self, client, REQUEST), kw)

Reading about apply in the python docs, it's obviously designed to
do just the job you need .

--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] ZCatalog - OR'ing on different colums (indices)

2000-08-25 Thread R. David Murray

On Fri, 25 Aug 2000, Aleksander Salwa wrote:
> Is there any better method of OR'ing on differend indices in quering
> ZCatalog, then the method described in 'Advanced ZCatalog Searching'

Ah, my solution obviously only works if all your fields are text
indexes...

--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] ZCatalog - OR'ing on different colums (indices)

2000-08-25 Thread R. David Murray

On Fri, 25 Aug 2000, Aleksander Salwa wrote:
> Is there any better method of OR'ing on differend indices in quering
> ZCatalog, then the method described in 'Advanced ZCatalog Searching'
> How-To:

One way that works well but only works if you always do the same
type of search (which it sounds like is true in your case) is to
create a method for all of the objects that returns the concatenation
of all of the data fields of intrest, and index that in the Catalog.
You then search on the field, and return the relevant documents.
Since the Catalog only stores word indexes and document indexes and not
the text itself, this is not as inefficient as it sounds.  It's
also a little more execution-time efficient (which is good for a
web ap) since you are effectively pre-computing the between-fields
OR portion of the search.

--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] Where do I find out about cookies?

2000-08-25 Thread R. David Murray

On Fri, 25 Aug 2000, Jean Jordaan wrote:
> 
> 
>  REQUEST.form['sort_key'])">
> 
> 
>  REQUEST.cookies['sort_key'])">
> 
> 
> 
> 
> 
[...]
> 

Since anything in any of the REQUEST dictionaries is on the name space
stack, you should be able to reduce the above IF block to:


  

  

  
  


If the 'cookie' dictionary is "closer" than the 'form' dictionary in the
namespace stack you'd need to stick one more REQUEST.set in the
inner if.

Obviously, I haven't tested this :)

--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] How do I create a folder full of "virtual" DTML objectsfrom records in a database records in a database

2000-08-24 Thread R. David Murray

On Thu, 24 Aug 2000, Chris Beaumont wrote:
> Thank you, I've been successful in setting up basic SQL methods, data
> input forms and query forms,
> the problem Ive been having is in trying to break each table record (one
> row in a table, say) out into a separate DTML document.. with fields in
> the record forming the parts of the document..  (I'm making a web
> heirarchy of events which each have to have their own page with various
> kinds of constantly changing information about the event on them.. 
> These pages have to live at relatively stable URLs.. (of course, it
> doesnt matter if they are physical documents to a search engine..)
[...]
> What I want to build are lists *and their linked documents*  the
> records' fields flowing into  the meta tags and body text of many
> individual objects. When a record is deleted from the source SQL table,
> I want to be able to have that deletion propagate to the child
> document..

Maybe I'm misunderstanding your question, or maybe I'm misuderstanding
ZSQL methods , because it does seem pretty straightforward to me.
I haven't done what I'm about to describe, though, so I could be way
off base.

It seems to me that what you want to do is have a ZSQL method that
takes an argument from the URL (they can do that), where the argument
is the 'id' of the record.  Then your method uses that argument to
retrieve *just* that row from your database.  Then you have your
html template filled in using the column variables from that record.
No need to have actual document objects sitting around, just the
template.  If you delete a record the corresponding page is therefore
gone.  And you get stable URLs, if the ids don't change:

http://www.yoursite.com/yourmethod/recordid

--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] How do I create a folder full of "virtual" DTML objectsfrom records in a database records in a database

2000-08-24 Thread R. David Murray

On Wed, 23 Aug 2000, Chris Beaumont wrote:
> I need to take rows in an SQL database table, and create one or 
> several nested folders of web pages out of them..

I'd suggest checking out the ZSQL Methods manual, and then asking any
questions that you still have (and there probably will be some!)

--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] compiling on windows

2000-08-23 Thread R. David Murray

On Wed, 23 Aug 2000, Wolfgang Strobl wrote:
> > Zope builds happily on a stock python 1.5.2 and the cvs versions of
> > 2.0 too.
>
> Huh? I was under the impression that building python C extensions 
> needs some stuff from the source dist. But I might be wrong here.

>From my unix viewpoint, I assumed that "stock 1.5.2" *was* the
source dist .  Seriously, though, I believe Python 1.5.2 builds
on Windows, so you shouldn't have a problem.  And yes, building the
Zope C extensions requires at least a "devopers" installation of
Python, which usually means the source dist.  (I *think* that the
stuff that is needed is actually a fairly limited number of files,
at least if you are using loadable modules, so it might in fact
be true that the stock Python Windows install includes the necessary
files.)

--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] method

2000-08-23 Thread R. David Murray

On Wed, 23 Aug 2000, Phil Harris wrote:
> I seem to remember a entry to the collector about this, I think your stuck
> with having a 'static' sort key.

http://classic.zope.org:8080/Collector/1541/view

Oh, wait, no that's the wrong one.  Hmm.  I don't seem to have saved
the one specifically about the sort tag, but it also was posted by
Adam Karpierz, with a request for comment.  He's been trying to
get some version of his patch accepted for a while now.  Since
he's proposing a syntax change it I think acceptance is probably
being slowed down by global concerns over the need for DTML syntax
improvements.  But nobody has been making comments, so I'm not
sure . 

You can always you his patch in the meantime, though.

--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] Vocabulary and stop words

2000-08-22 Thread R. David Murray

On Tue, 22 Aug 2000, Andy McKay wrote:
> I havent been able to the find TFM to read on Vocabulary and stop words in ZCatalog. 
>I need to search by stuff such as XML::Parser and I think I need to patch 2.2 to do 
>it. But a FM would help. Can anyone point me that way.

I don't think there is one.  Basically, if you want to search on terms
that include punctuation, you have to write your own Splitter.c.
Have fun .  You don't by the way, have to write it
in C, although not doing so presumably has performance implications
or it wouldn't have been written in C to begin with.  But if all
you want the splitter to do is split at blanks and truncate long
words, you probably don't need C...

You are presumably talking about text indexes if you are worried
about Vocabulary and stop words.  Most of the guts of this stuff
is actually located in a module named SearchIndex.  Reading the
source code there is as close to a FM as I think you'll get right
now.  The current Vocablulary does some appropriate wrapping up
of modules in SearchIndex for use by Catalog; if you want to do
your own thing without touching Zope's default machinery you'll
need to write your own Vocabulary object.  It shouldn't be
too hard if you model it after the existing source.

The current text index *does* try to do something sensible in the
case you cite, however.  Words are indexed after being broken at
punctuation.  When a word containing embedded punctuation is used
as a search term, it is turned into a "near" search (xml near
parser, for example).  I have not tested whether or not this actually
works, but from my reading of the code I *think* what it does is
equivalent to an 'and' search on the two words except that the
nearer the two words are in the document the earlier in the result
set the document appears (assuming you don't sort the result set
yourself).

Note that there was a longstanding bug in the search term parsing
machinery that caused some search terms with embedded punctuation
to fail to return any results.  I submitted a patch for this that
has been incorporated as of 2.2.1b1.  (The bug should not have
affected a search term like XML::Parser.)

In theory, I think that instead of rewriting the splitter module
you could rewrite SearchIndex/ResultList's notion of what 'near'
means to constrain the words to be right next to each other.  You
should even be able to enforce ordering.  If it works, it might be
a easier than rewriting the splitter, since you'd only be changing
one python function.

I've been digging around in the SearchIndex code for a while now,
so if you want to ask me more questions, go ahead.  It doesn't mean
I'll know the answers, but I'm happy to share whatever I *have*
learned.

--RDM

PS: this question is really more into 'zope-dev' terratory than
'zope' terratory, if you want to move it.


___
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] QSurvey 0.23 and Zope 2.2.1b

2000-08-22 Thread R. David Murray

On Tue, 22 Aug 2000, Alexander Chelnokov wrote:
> Just installed Z2.2.1b, successfully imported some products but when
> trying to import QSurvey 0.23 got the message:
> 
> Zope Error
> Zope has encountered an error while publishing this resource. 
> 
> Error Type: Permission mapping error
> Error Value: Attempted to map a permission to a permission, Add
> QSurveyResultsItems, that is not valid. This should never happen. (Waaa). 
> 

I believe I saw a message that said that this bug would be fixed
in 2.2.1 final (which presumably means you can get the fix by
checking out the CVS version of Zope).  Search the archives...

--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] Split Data.fs

2000-08-22 Thread R. David Murray

On Tue, 22 Aug 2000, Marcus Mendes wrote:
> Is a good idea split Data.fs? (comments)

I'm sure it depends on your system design and constraints.  In a
"normal" situation (whatever that is ) it probably doesn't
matter much.  Some cases where you'd consider it: getting around the
Linux 2GB limit, putting frequently changed objects in a non-undo
storage, putting an area of the site with special characteristics
(eg: the zope.org wiki area) in its own storage.

> Is there any way to divide or split the Data.fs into some parts?

Yes, mountable storages.

--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] generalizing DTML method question

2000-08-22 Thread R. David Murray

On Tue, 22 Aug 2000, Jean Jordaan wrote:
> How do I generalize this DTML method?
[...]
> 
[...]
> The problem is that 'origin_values' bit. It's a TinyTable.
> I want to make 'makeList' a DTML method on its own, and then
> call it to make lists of:
> 
>   clearance_values  
[...]

You could try

  

where somevar holds the id of the tinytable.  I didn't test it,
so there might be some issues about calling the tinytable to resolve.

Or you could write an external method, which could take the table
as an argument.  I'd recommend that for this case, since this method
is pure logic and not presentation at all.

Or I think you could wrap the call to the dtml-method in, eg:

  


and just use  inside your method.

--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] Yihaw on 2.2.1b1, boolean properties

2000-08-22 Thread R. David Murray

On Tue, 22 Aug 2000, Wolfgang Strobl wrote:
> 9. Uncheck "Highlight" and push Save Changes.
> 
> Result: The boolean Highlight property checkbox is still checked. 
> There is no way of making it unchecked, again.

This *sounds* like the boolean property bug that appeared in 2.2 (I
think) and was supposedly fixed in 2.2.1.

By any chance does Yihaw use manage_changeProperties instead of
manage_editProperties in its propertysheet edit method?  That would
lead to the observed behavior since unchecked boolean check
boxes do not appear in REQUEST and thus are not affected by
a manage_changeProperties call.

--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] Permissions / roles question

2000-08-22 Thread R. David Murray

On Tue, 22 Aug 2000, Jean Jordaan wrote:
>## njj: change (changes to login code for GUF) ##
[...]
> I mean, the Manager role *does* have the 'Change ZWiki Pages'
> permission, and does *not* have the 'Anonymous' roles. 

Actually, in at least some versions of GUF, all users also have
the Anonymous role.

--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] Zope on HPUX

2000-08-21 Thread R. David Murray

On Mon, 21 Aug 2000, Michael Maul wrote:
> Does any one have zope running on hpux 10.20?
> It needs a thread enabled python, which I have not been able to build
> (Using pthread 1.3.7)
> each time I try to run the python Interpeter it core dumps..with..
> pthread_mutex_init: Invalid argument

For help on getting an HPux thread enabled python, you might try
www.python.org and/or the Python specific mailing lists and newsgroups.

--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] Builing DynPersist.c - LoginManager / ZPatterns ..

2000-08-21 Thread R. David Murray

On Mon, 21 Aug 2000, [iso-8859-1] Jørgen Skogstad wrote:
> DynPersist.c
> 
> It is the file above it fails on .. and I think I saw a message
> that this is a "common" problem others have experienced. Is this
> correct? And does anyone have the shared lib for RH v6.2??

If RH, probably RPMs. If RPMs, probably not the source/deveopment
RPMs.  I thnk you need the development RPM for Python, and maybe the
source RPM for Zope, in order to get this to compile.  

--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] Strange behaviour on authorization

2000-08-21 Thread R. David Murray

On Mon, 21 Aug 2000, Casey Duncan wrote:
> The fact that your external method returns a class instance explains why it
> fails where it does instead of in the dtml-let statement. It looks as though
> Zope is allowing the object to be returned, but balking when you try to
> access it. I think I will need to see exactly what your external method and
> the returned object are doing before I can try explaining this behavior.

In 2.2 the security model is tightened.  To use returned objects of 
your special-purpose classes from dtml, you have to tell Zope that it is
OK to do so.  Check out Brian's new-security-model guide at

  http://www.zope.org/Documentation/How-To/ProductAuthorUpdateGuide

(I think he also has newer stuff in the security chapter of the book
but I haven't looked at it yet).

I think what you want to do is add

__allow_access_to_unprotected_subobjects__=1

as a class variable to the class in your external method.  But read the
guide so you understand the security consquences of doing that.

--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] calling (SQL) methods dynamically from External methods

2000-08-21 Thread R. David Murray

On Mon, 21 Aug 2000, Philipp Auersperg wrote:
> Interesting fact:
> When retrieving the method object with "m=self.dbTest" and then with 
>"m1=self.__dict__['dbTest']" 
> "print m,m1" show the same string but "m==m1" results to false!
> 
> What am I doing wrong? There seems something mixed up with namespaces, but I am too 
>solly to solve it :(

I *think* what you are running into here is the difference between
an context-wrapped object and the unwrapped object.  I think __dict__
gets you the latter, but self.dbTest calls __getattr__ and the Zope
hook for that returns a wrapped object.  The wrapped object can
use acquisition to find the db connection, the unwrapped object can't.

As you found, getattr is the way to do what you want.

--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] Choose where to create a ZClass instance with EM

2000-08-17 Thread R. David Murray

On Thu, 17 Aug 2000, Andy McKay wrote:
> Get a handle to the object where you wish to create the object then create
> the object.
> 
> For example: newobj = getattr(self, 'folderA')
> 
> will give you folderA in self. The new object will be created in folderA.

Isn't it actually that he wants to do the _setObject call on object where
he wants the thing to go?:

newob=self.Control.Panel.Products.MyProduct.MyClass(id)
newob.id=id
newob.propertysheets.Properties.manage_changeProperties(data)
getattr(self,'folderA')._setObject(id,newob)
newob.reindex_object()

--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] modifying/changing DTML properties

2000-08-16 Thread R. David Murray

On Wed, 16 Aug 2000, Paul Schreiber wrote:
> --- "R. David Murray" <[EMAIL PROTECTED]> wrote:
> > On Wed, 16 Aug 2000, Paul Schreiber wrote:
> > > > 
> > 
> > 
> 
> This:
>   
>   
> 
>   
> 
> results in:
>green
> 
>green
> 
> did i miss something?

Hmm.  That should have worked.  You could try
manage_changeProperties(eggs='blue') as an alternative, but the
dictionary way should have worked.

Did you check the property after the method had executed?  Perhaps
the change is not visible until the method completes, although I
would not expect that to be the case...unless 'eggs' exists "closer"
in the name space stack as a variable than it does as a property
on the object, in which case the second dtml-var would be picking
up the variable value but the manage_changeProperties will have
affected property of the object it was called on.

--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 ZClassesquestions

2000-08-16 Thread R. David Murray

On Wed, 16 Aug 2000, Marcin Kasperski wrote:
> > Pass it as an argument to the call that creates the DTML Document.
> 
> How? 
> 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):
> 
>  "mk_dtml_document.createInObjectManager(REQUEST['id'],REQUEST)">

Hmm.  I've only done this kind of thing by calling the add method of
the class, where you could pass in, say, title=title.  I'm not
sure how you'd do it with createInObjectManager.  Although you
might try wrapping the whole thing in .  The
REQUEST title may be getting overridden by another title property
that happens to be blank.

> > Yep.  You should be able to replicate everything the original
> > constructor code does in your own code.  Read The Source, Luke .
> 
> I hate replicating code. I love calling it. Couldn't it be done this
> way?

Maybe.  You'd have to look at the source code and see if can handle being
called as a subroutine.  If not, somebody ought to refactor it .

> I tried defining DTML Method with name PrincipiaSearchSource and
> contents
> 
> 
> 
> (body is my custom property name).
> Next I clicked 'Update Catalog' in ZCatalog screen. Seems my attempt has
> been ignored - the amount of objects indexed via PrincipiaSearchSource
> (according to ZCatalog status screen) has not changed (those object are
> succesfully indexed on title etc).

As someone else said, the method has to be parameterless (yours
probably appears to be).  This also means that it can't depend on
having a name space around (that usually gets passed implicitly to
dtml methods), including REQUEST, since Catalog won't have that to
pass it in most indexing scenarios.

At first glance I'd think your code would work, but I can think of
two other things you could try:  , and defining
an external method instead and just have it just do "return
self.body".

> > > 5) Can I write index_html method of my custom class so it interpret DTML
> > > tags (like dtml-var substitution)?
> > 
> > I'm sure you can, but I don't know how .  But if you are doing
> > that, why not just subclass DTML-Method (or document)?
> 
> Because I have not done it previously and now I have about 100 objects
> of this type and do not know how to perform such a change.

Ah, yes, changing the base class of a ZClass is hard.  There's a
hold-onto-your-pants recipie for doing it, but it's not for the faint
of heart.  Check the HowTo's if you are curious.

Depending on the complexity of the objects, you could write an
external method that would write the data out to a file in some format,
and another to read the data back in and use it to instantiate
new objects of the desired type.  I did this once with a 60K
database of objects .  I *could* send you that source code
as an example, if you want.  I based the re-load code on the
"adding ZClass object programatically" howto.

> > Write an external method to do all the object creation, property
> > copying, and old object deletion.
> 
> What about some sample code?

I haven't done it myself, so I don't have any sample code for
this (but see above).

--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

2000-08-16 Thread R. David Murray

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] modifying/changing DTML properties

2000-08-16 Thread R. David Murray

On Wed, 16 Aug 2000, Paul Schreiber wrote:
> > 



--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] The mysteries of Product icons ?????

2000-08-16 Thread R. David Murray

On Wed, 16 Aug 2000, Daniel Rusch wrote:
> Then someone had the brilliant idea to change it. I can not figure out
> how to get Zope to load the new icon. I have deleted the product from
> Product Management at /Control_Panel / Products, rm the *.pyc files,
> bounced Zope, but it still hangs on to the old icon.
> 
> Can anyone out there demystify this for me???

Browser caching?

--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] DTML: fetch an object by its url?

2000-08-16 Thread R. David Murray

On Wed, 16 Aug 2000, Chris Withers wrote:
> Shame no-one implemented this into the entity syntax :(
> 
> &dtml-/some/folder/and/path/wotsit; would be so nice ;-)

Ooo, that's seriously *ugly* looking syntax .

--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] DTML: fetch an object by its url?

2000-08-15 Thread R. David Murray

On Wed, 16 Aug 2000, Scott Shepherd wrote:
> In DTML is it possible to get an object using its url? Something like
> 
> ...

Something like.

I asked this question a long time ago, and refound the answer by
searching the zope.nipltd.com mailing list archives using the
search terms 'resolve and url'.



I also have a vauge memory that this may be a depricated interface
and that 2.2 has some new method you should use instead.  But I couldn't
come up with a search phrase to get the right message for that one .

--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] String Module ??? newbie question

2000-08-15 Thread R. David Murray

On Wed, 16 Aug 2000, Indra Gunawan wrote:
> my installation is Zope 2.2.0 on W2K.
> I try to use the find method as follow, why can't it runs?
> 
> it said Attribute error: find

_.string.find

--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] How to use RESPONSE.redirect ?

2000-08-15 Thread R. David Murray

On Tue, 15 Aug 2000, Kapil Thangavelu wrote:
> #example call to above
> #

If your original form submits using the GET method, then QUERY_STRING
will contain the already URL encoded parameters that the browser
sent originally.

DTML also has a url_encode format you can use to cause a string to
be url encoded if it isn't already.  Check the dtml reference.

--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] Getting a document's contents

2000-08-15 Thread R. David Murray

On Tue, 15 Aug 2000, Joshua Brauer wrote:
> I have a folder (Parts) that contains dtml documents that are snippets of code. I 
>want to include some of them which I have listed in a variable (select).
> 
> So I use code like this:
> 
> 
> 
> 
> 
> 

Right idea, but not quite there.  Your 'select' variable holds the
string ids of the objects, but you need the actual objects in order
to get them rendered.  getitem will look up the object given the
id, but you're actually telling it here to look up the value (in
the namespace) of the string 'sequence-item'.  What you get, as
you observed, is the id string stored at that moment in sequence-item.
So you need to loose the quotes so it will look up that id string
in the namespace.  However, there's a wrinkle:  sequence-item
is not a valid python variable name.  So you have to look sequence-item
up in the namespace after all.  You could do:



However, Zope provides a shortcut for this, using the namespace variable
(_) as a dictionary:



This, though, is going to *just* retrieve the object, it won't cause
it to render (I think you'll get the DTML source, which I think is
the representation of the object as string, which is the default
conversion in this context )>.

So what you a really want to do is execute the object after you've
retreived it, which will case it (unless it is a ZClass that is
not subclassed from Renderable) to render itself, which is what
I think you want.  To do that you pass a true flag to getitem as
its second argument:



Now, _ has this additional feature (Chris Whithers would say bug) that it
calls any callable object it is asked to retrieve via the dictionary lookup.
So you should be able to shorten this to:



There's one more subtlety (are you getting tired of this yet?) involving
the need to pass the namespace to called DTML methods, but
I believe _ takes care of that for you in this example so I won't
go into it.  But it's a FAQ, too, so you might want to look for
the answer before it bites you .

--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] Struggling with Permissions

2000-08-15 Thread R. David Murray

On Tue, 15 Aug 2000, Jean Jordaan wrote:
> (this is from ccDocClass_add). When I arrive I *still* see:
> 
>   (I'm Anonymous User and I have Anonymous role(s).) 
> 
> Now I edit the URL manually and visit /docs/manage, which
> works *without* prompting me for authentication. I edit the 
> URL back to /docs, and now I see: 
> 
>   (I'm docEditor and I have ContentManager and Manager role(s).)
> 
> Also, this doesn't *always* happen. Perhaps it's an IE problem?
> Does anyone know exactly how this works?

My bet is that this is a browser caching issue.  Click on the link
that takes you back to the original page, get the cached page.
Edit the URL, edit the URL *back*, now you've undoubtably hit
return in the URL box, and IE (sometimes) does a page refresh at
that point.

--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] problem running Zope

2000-08-14 Thread R. David Murray

On Fri, 11 Aug 2000 [EMAIL PROTECTED] wrote:
> trying to run 'python z2.py" I get an error message saying the
> executable is incompatible with the hardware (obviously!!). So I tried
> to recompile the python source on the new machine and everything seemed

Note that you will also have to recompile the Zope source, since it
does contain some C code as well as a lot of Python code.

> to go through fine. However when trying to run the new executable here
> is the error message I get.
[...]
> File "/optZope-2.1.4-src/Zserver/HTTPServer.py, line 111, in ?
>   import thread
> Import Error: No module named thread

Zope requires python to be compiled with thread support.  Rerun
the python configure with --with-threads, redo the make/install,
and see if things work better.

--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] Zope - long running process

2000-08-14 Thread R. David Murray

On Sat, 12 Aug 2000, bak @ kedai wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of J.
> > Atwood
> >
> > There is a switch in z2.py that allows you to point to a PID file. It will
> > automatically restart your Zope installation once it goes down (if).
> 
> i've tried this, with 2.1.x and 2.2.0; but i'm not sure it works well.
> there are times when my zope hangs, and i need to stop and start manually.
> it may be my programming.  not too sure though.  what are others experience?

Under the unix source install, running with the monitor process active
is the default (if you remove the -D from the z2 startup command line).
I run this way with several sites, under both FreeBSD and Linux.  It
successfully restarts zope if it dies.  In certain unusual circumstances,
though, Zope will go into a spin where the python process consumes all
available CPU and Zope stops responding.  The monitor won't catch that.
(Someone wrote a script that will; search the archives).  In my experience
this happens, in 2.1.x, when certain conditions are met by the DTML
source code of referenced methods.  I'm not sure what the exact
conditions are, though I seem to recall they had to do with leading
whitespace and dtml code only at the start of the method.  I think
this bug was fixed in 2.2.

It *is* also possible to get Zope/python to spin through programming bugs.

--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] Start-up log?

2000-08-14 Thread R. David Murray

On Mon, 14 Aug 2000, William BC Crandall wrote:
> Simple question: Does Zope generate a log file 
> noting each transaction, including start-up 
> complaints?
> 
> (I get error messages that scroll out of sight
> when I run START.BAT.)

If you define the enviroment variable STUPID_LOG_FILE
to be the file where you want it to write the log, it
will.  Otherwise not.  Well, that applies to startup
and error messages.  Unified Log File log messages go
to z2.log, and there are transaction messages you
can get it to log by other means (search zope.org
for appropriate HowTos).

--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 ZClassesquestions

2000-08-14 Thread R. David Murray

On Mon, 14 Aug 2000, Marcin Kasperski wrote:
> 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.

Pass it as an argument to the call that creates the 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?

Yep.  You should be able to replicate everything the original
constructor code does in your own code.  Read The Source, Luke .

> 3) Can I influence property editing screens (what I want is to increase
> some edit boxes)?

As far as I know (until Martjin finishes his skinnable support) you
can only do that by wholesale replacing the editing screen with
your own form.  Or by modifying the source.

> 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)?

You can add that property name as an index, and construct your
search form so the search string is submitted to it (see the Advanced
ZCatalog Searching HowTo).  Or, you could define your own
PrincipiaSearchSource method and return whatever value is appropriate.
I *think* you should be able to define this as a method of your
ZClass, but I've never tried that.  I know it works from python .

> 5) Can I write index_html method of my custom class so it interpret DTML
> tags (like dtml-var substitution)?

I'm sure you can, but I don't know how .  But if you are doing
that, why not just subclass DTML-Method (or document)? 

> 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? 

Write an external method to do all the object creation, property
copying, and old object deletion.

> 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?

Easy to do in external method python code.

> Regards and thanks in advance for any hints and references

I think my answers are a little bit too cryptic to be immediately
useful.  Maybe someone else will give specifics, otherwise I
hope they serve as useful hints.

--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] dtml-in and tuples

2000-08-14 Thread R. David Murray

On Mon, 14 Aug 2000, Jonothan Farr wrote:
> Well in Python a list is mutable and a tuple is not.

Right, but he's asking why dtml-in treats tuples in a special way,
and exactly what that behavior is.

--RDM
 
> - Original Message - 
> From: Chris Withers <[EMAIL PROTECTED]>
> > Why and how are python tuples (like, this) handled differently (and not
> > in a logical way I can see...) than python lists [like, this]?


___
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] substring search on zcatalog textindex

2000-08-14 Thread R. David Murray

On Mon, 14 Aug 2000, Casey Duncan wrote:
> Searching TextIndexes you can use "and", "or" or "andnot" as query criteria.
> I also see support in the source code for near searches using "..." in the
> query string. I have not been able to get this to work (although the first
> three work great for me), and would like to.

I haven't tried to get near searches to work yet; haven't had the need.
I'm just reading the code .

I think Dieter looked at this in 2.1.x and found some bugs, and I
don't know if his fixes got into 2.2; I don't think he's had
opportunity to test 2.2 yet.  If you scan the zope.nipltd.com
archives for '...' you'll probably find the relevant messages.  Or
'zcatalog and near' if '...' isn't a valid search string.

--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] Persistence.py does not define Persistent

2000-08-14 Thread R. David Murray

On Mon, 14 Aug 2000, Skip Montanaro wrote:
> I'm trying to publish my own module with ZServer (from Zope 2.2.0).  I get
> the following traceback:
> 
>   from Persistence import Persistent
> ImportError: cannot import name Persistent
> 
> When I look at lib/python/Persistence.py, all I see is a copyright notice
> and the following short doc string:
> 
> """Provide access to Persistent and PersistentMapping
> 
> This avoids dependency on the database package name.
> """
> 
> I can't find a definition of an object named Persistent (probably ought to
> be a class or ExtensionClass, based upon the usage I saw) anywhere in the
> Zope 2.2.0 tree.

The comment implies it should work.  There's a cPersistent in the
ZODB directory, which I think is the ExtensionClass you are looking
for.  from ZODB.cPersistence import Persistent seems to do
something...but PersistentMapping.py in the ZODB directory just
does an 'import Persistence', so I don't see why that doesn't work
when I try it from the python command line.

--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] zcatalog -- returning context of hits on fulltext

2000-08-14 Thread R. David Murray

On Mon, 14 Aug 2000, Jimmie Houchin wrote:
> I may be clueless and out of my league here and I haven't read the
> sources so I don't know... Well enough of a disclaimer. :)

I *have* read the ZCatalog/SearchIndex sources, but I don't understand
this part of it yet (or really that much of it at all!).  I think
we're getting into zope-dev terratory here...

> Is there anything in there which can provide the seek or byte position
> of the hit within text object? If so, it shouldn't be too difficult to
> read X bytes before and after the position and thereby provide what your
> looking for.

The standard TextIndex implementation records a notion of "position" for
each occurence of each word indexed.  I *think* this position is a word
count position, but I'm not sure.  Part of the code references a
'row', but it isn't at all clear that that has any relationship to
a source record.  If it is a word count, the other thing you'd need to
check would be whether it is a word count before or after splitter
activity.  I think it's the latter, which makes things more complicated.
Or just means you have to use more fuzz in your context .

> This would be nice to have out of the box.

The TextIndex 'position' information is intended to be used for
the 'near' operator (...) (so you can search on multiple words
"close" to each other for some definition of close).  You could
also use it to enforce word order (Maybe the "" operator does
that?).  Currently I think the result of applying the near operator
is used to adjust the "weight" of the index match, which affects
the order of the results returned.  (I haven't tested to see if
any of this works!)

So, the basic information you are looking for is there in some sense
to establish the position, but you'd still have to retrieve the
original sentences from the object itself, or from a full-text
metadata field.  Both of these are going to be memory intensive
operations.  If you index based on, say, individual lines, you'd
loose some of the the benefits of the near operator, though.  So
I'd say indexing based on paragraphs would probably be your best
approach.  This would also help mask position errors introduced if
the word count is indeed post-splitter.  Of course, you'll have to
decend to python to get access to the methods that will return the
actual position information.  But at least the code to record it
is already there.

Take a look at lib/python/SearchIndex/TextIndex.py for source
enlightenment.

--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] Requested Zope feature

2000-08-14 Thread R. David Murray

On Wed, 9 Aug 2000, Martijn Pieters wrote:
> I am currently implementing Skinnable objects for Zope that'll allow you to
> easily define an alternative version of the management interface, and switch
> between these interfaces very easily. You could build your own version that
> doesn't use JavaScript at all.
> 
> IIRC, you can tell Mozilla to switch on JavaScript for certain sites though.
> Believe me, it'll be worth your while allowing JS in the Zope management
> screens by the time I am done.

I'm looking forward to this.  I'm hopeing we'll see some interesting
stuff come out once this capability is available.  I know I for one
am interested in putting together a management interface tailored
for use from text mode browsers like lynx and w3m.

--RDM (java-who-script-what?)


___
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] substring search on zcatalog textindex

2000-08-14 Thread R. David Murray

On Thu, 10 Aug 2000, Chris Withers wrote:
> Casey Duncan wrote:
> > TextIndexes index individual words separately (using a vocabulary object to
> > identify each word in the catalog). All non-alphanumeric characters (such as
> > punctuation) are dropped so that excludes searching for "?" or "*" or any
> > other non-alphanumerics using TextIndexes.
> 
> IIRC, you can use another Vocabulary that wouldn't necessarilly behave
> like that.
> I wonder if this works yet?
> 
> If it does, my initial question still remains ;-)

In fact, to use substring matching on a text index, you have to
set the Vocabulary to support it *when you first create the ZCatalog*.
Which seems a little bit broken to me, since unless I missed
something you have to choose not to add a vocabulary when you first
create the ZCatalog, and then go add one with substring checked
from the management screens afterwards.  In the code the difference
between the checkbox checked and not checked is two different
lexicon implementations, not just the setting of a flag.  So you
can't just change the flag, you have to see to it that the whole
lexicon gets rebuilt.  I haven't checked into how you do that yet
.

As for your question about different vocabularies, punctuation,
and globbing support, all of that happens at the lexicon level.
That is, the lexicon implements the breaking up of strings into
indexable words (calling the splitter) and it also implements the
expansion of wildcards into matches.  It gets to do that *before*
the text index machinery parses the query, so it can decide on the
syntax rules, as far as I can see.  So if you want a Vocabulary
that supports punctuation and globbing, you'll have to write one,
and then *you* get to decide what the syntax is to handle the case
you ask about .

--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] Precondition

2000-08-06 Thread R. David Murray

On Sun, 6 Aug 2000, Martijn Pieters wrote:
>   Precondition
> 
>   Allows you to specify a precondition for the File. A precondition is a
>   method or document which is executed before the File is viewed or
>   downloaded. If the precondition raises an exception then the File cannot
>   be viewed. 
> 
> This is from the Help page presented when you click the 'help' button on the
> 'Edit' tab of a 'File' object.

I knew I'd read it somewhere!

First I ran through the help menu, but I must have looked at
File/Image Add and missed File/Image Edit.  Then I looked at an
Image (I had no File objects handy), and when I saw that the help
tab for the Edit, page had no description of precondition, and indeed
that there was no way to set it, I figured the docs for it must
only be in the API section.  But the API section does not discuss
*any* of the call paramters.  So I thought it was undocumented.

Since the code supports preconditions on an Image, is this an interface
error or a design decision (the latter seems more likely)?  If it's
a design decision, shouldn't precondition still be documented in
the Image api help doc?

This is an example of a systematic problem with the (very useful
) help docs as they stand:  if the API docs implicitly assume
that the parameters are documented in the corresponding management
interface panel then there should at least by a cross link; and if
there are sometimes parameters that are *not* documented on the
manage page, then that needs to be taken into account somehow.

--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] Vocabulary??

2000-08-04 Thread R. David Murray

On Fri, 4 Aug 2000, Sven Hohage wrote:
> think I've missed something.
> What is the feature "Vocabulary"??Just a hint please!

A Vocabulary allows you to associate an arbitrary method of parsing
input text into words for the purposes of cataloging and searching in
text indexes.  The default Vocabulary uses the original Splitter.c
word parser, which is very English centric.

--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] Precondition

2000-08-04 Thread R. David Murray

On Fri, 4 Aug 2000, RC Compaan wrote:
> What does the "Precondition" property of the file class refer to?

As far as I can tell from a quick scan of the source, the precondition
is an object that is called just before the file object is rendered.
It can raise an exception, in which case the object will not get
rendered.  I could swear I read that documented somewhere, but I
can't find it.  Someone should submit a doc patch for the API help
pane.  I'd do it, but I haven't gotten around to learning how the
help system works yet so I don't know what file to patch .

--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] Zope with two platforms.

2000-08-04 Thread R. David Murray

On Fri, 4 Aug 2000, Francisco Assis Rosa wrote:
> We would like to be able to have
> new developments on products to be passed
> from the development platform to the
> staging platform and to have new
> content to be passed from the staging
> platform to the development platform.

I wonder if you could put your content in a mountable
storage and just periodically copy that storage down
to the development machine, and similarly periodically
copy the master storage (containing the ZClasses) up
from the development machine.  If your products
are Python products you wouldn't even need a mountable
storage.

> Also, how would you see schema versioning
> How could we for instance deal with
> objects generated from a product if the product
> schema changes ?

Zope uses the __setstate__ method for handling this
case in Python products.  I think there's a howto somewhere but I'm
not sure.  If not you can find examples of calling it in
the Zope sources.  For ZClasses the objects get all their
info from the ZClass, so you generally don't run into upgrade
problems (though people have run into trouble with properties
they have tried to delete hanging around on existing instances).

--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] dtml-calendar question (I GOT IT!!!!!!!!)

2000-08-04 Thread R. David Murray

On Fri, 4 Aug 2000, tom smith wrote:
> notice the startDateString=StartDateString...which I thought the  would've handled, anywaythis seems to have fixed it
> 
> can anyone tell me why?

ZSQL methods do not pick variables up out of the name space because
the possability of unintended collision with database variables is
considered too high.  So ZSQL forces you to be fairly explicit
about which variables you are passing.

--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] Zope Usage

2000-08-03 Thread R. David Murray

On Thu, 3 Aug 2000, Marc Dullien wrote:
> Q1: With what tool inside Zope do I program the HTML Templates ?

Read the DTML reference.

> Q2: I want to fill those templates with database entries

Read the ZSQL reference.

> Q3: How can I do the linkage

Isn't that the same as Q2?

> If you could send me a short Howto or something, that would be great, I can
> find ma way through from there !

Well, neither one is exactly short...so you might want to skim them
first and then go back and read in detail as you try things out.

--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] dtml-calendar question (still not working)

2000-08-03 Thread R. David Murray

On Thu, 3 Aug 2000, tom smith wrote:
> I'm still getting allsorts of errors. My code is like this...
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> I'm having trouble passing StartDateString to get_days_events. If I look at
> StartDateString using  it looks OK.

What kind of errors? 

--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] dtml-calendar question.

2000-08-03 Thread R. David Murray

On Thu, 3 Aug 2000, Chris Withers wrote:
> > In what way does it *not* follow Python (expression) syntax rules?
> 
> _['something'] doesn't just return the value from the dictionary which
> has the 'something' key, if it's callable, it'll try to call it and then
> return that... not nice :(
> 
> If you want to be safe, use _.getitem('something',0)...

True enough, that's a somewhat weird semantic, but it's still
following python *syntax* rules .

--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] dtml-calendar question.

2000-08-02 Thread R. David Murray

On Thu, 3 Aug 2000, Andrew Kenneth Milton wrote:
> | Well, yeah.  A restricted python environment.  The point being, it follows
> | python syntax rules .
> 
> kind of... :-)

In what way does it *not* follow Python (expression) syntax rules?

--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] dtml-calendar question.

2000-08-02 Thread R. David Murray

On Thu, 3 Aug 2000, Andrew Kenneth Milton wrote:
> | Untested:
> | 
> | 
> | 
> | Inside the quotes you are in Python...
> 
> kind of...

Well, yeah.  A restricted python environment.  The point being, it follows
python syntax rules .

I see I made a typo: '%s/%s/%s'.

--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] dtml-calendar question.

2000-08-02 Thread R. David Murray

On Sat, 12 Aug 2000, tom smith wrote:
> / "date.dd()">/)>

Untested:



Inside the quotes you are in Python...

--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] 2.2 Explicit/implicit problem.

2000-08-02 Thread R. David Murray

On Tue, 1 Aug 2000, Capesius, Alan wrote:
> The button displayed under Ownership indicates that they can switch, but
> does nothing when clicked.

Perhaps this is a manifestation of the 'boolean properties can't be
unset' bug reported here earlier?

--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] Separate Instances of Zope

2000-08-02 Thread R. David Murray

On Tue, 1 Aug 2000, blueeye wrote:
> If this server goes down, can I have a backup zope server that replicates the main 
>server?

Depending the on the volatility of the data, you could just periodically
copy the Data.fs file to the backup machine.

--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] dtml-in question

2000-08-01 Thread R. David Murray

On Tue, 1 Aug 2000, Webmaster wrote:
> I have a bunch of zClass instances and I want to display only the ones that
> match all three criterion (approved=1, goLiveDate<=ZopeTime(), expired=0).

One way to accomplish this is by using ZCatalog.  Index those
properties, and specify your selection criteria in the Catalog
call.  If the properties change a lot, though, you are going
to increase the amount of data getting written to your FileStorage
on each change.

--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] From a Folder to a Product

2000-08-01 Thread R. David Murray

On Tue, 1 Aug 2000, Cesar A. K. Grossmann wrote:
> You mean, put all sql-queries, dtml-docs and dtml-methods spread in the
> root folder of the zope? I'm trying to maintain the root uncluttered
> ("every thing in it's place, every place with it's thing"), and I'm
> thinking this will do the oposite, but you give me an idea:
> 
> /
> + reports
>   + files (sql queries, reports/forms, and default sql-conn)
>   + customer1
>   | + sql connection (only)

Or you could use the Transparent Folders product if you don't
want to have an extra 'reports' folder.

> Have anyone a better one idea/suggestion? Of course, making things like
> that, I lose versioning (I think), but I think I can survive without
> it...

Unless I'm misunderstanding something, I don't think you'd loose
versioning.

--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] From a Folder to a Product

2000-07-31 Thread R. David Murray

On Mon, 31 Jul 2000, Cesar A. K. Grossmann wrote:
> If someone wants to point some general guidelines, the folder contains
> only the dtml docs/methods and SQL connection/SQL Queries used to do the
> report, and the only thing that changes from one to another customer is
> the SQL connection (every different customer have his own database).
> Even the security properties are the same.

If you put everthing at the top level except the DB connection, and
put the appropriate one of those in each user's folder, I should
think they could access the report via acquisition.

--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] Old Zope

2000-07-31 Thread R. David Murray

On Mon, 31 Jul 2000, Luis Cortes wrote:
> Does anybody know where I might still be able to download Zope 2.1.6?   
> 
> Thank ahead of time for any help,

If you look at the URL you would access to download 2.2.0, and replace
the version number with 2.1.6, I think you'll find you can still download
the old version.  At least, that was true when I downloaded 2.1.4 
after 2.1.6 came out...

--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] Zpatterns makefile problem

2000-07-31 Thread R. David Murray

On Mon, 31 Jul 2000, Owen Smith wrote:
> make[1]: *** No rule to make target
> `/usr/lib/python1.5/config/Makefile', needed by `sedscript'.  Stop.
> make[1]: Leaving directory
> `/usr/local/dc/zope/lib/python/Products/ZPatterns'
> make: *** [boot] Error 2
> 
> Where am I going wrong?
> I know /usr/lib/python1.5/config/ doesnt exist so I tried

You need to install the source or development version of Python, to
get that missing file.

This is a Zope/ZPattern's FAQ .

--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] Zope and large files strategies?

2000-07-31 Thread R. David Murray

On Mon, 31 Jul 2000, Marcin Kasperski wrote:
> Are there any limitations for placing large (say 15 MB) files inside
> zope databases? What people running zope services and having to serve
> such a files usually do - place them in zope or serve them with apache
> (placing links inside zope web)?

No limits other than those imposed by the OS file system (ie: Linux
is currently limited to 2GB Data.fs files).  If your large objects
are static, placing them in the ZODB is reasonable.  If they are dynamic,
then your Data.fs is going to grown *fast* (a new 15MB chuck for
every change to the object).  You might want to look at the LocalFS
product, which allows you to serve files out of the local file
system through Zope.  Depending on your specific application, that
is probably the better way to go.

--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] ZCatalog updating

2000-07-31 Thread R. David Murray

On Mon, 31 Jul 2000, Aaron Williamson wrote:
> I am convinced this is a stupid question that has been answered a
> hundred times already, but after scouring zope.org and the archives, I
> still don't know the answer, so...
> 
> How can I automatically update my ZCatalog when items have been
> added/modified/changed?

Any objects that you want to be automatically updated in the Catalog
must have CatalogAware as one of their base classes.  And then you
have to add a reindex_object call to any forms that add or update
them.  (I fail to understand why one has to explictly call
reindex_object when properties change, even though I think someone
tried to explain it to me once).

I suppose you could do something similar with non-catalog aware
objects, where you made sure the add/update forms called the Catalog
to index them, but they wouldn't get deleted from the catalog automatically,
or reindexed automaticaly when moved.  If you are writing your own
management screens for those operations, though, you could make
it all work, I think.

You could also use ZSchedular to perioducally run the commands to
reindex your site, if instaneous reindexing is not a requirement.

--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] getslice Error?

2000-07-31 Thread R. David Murray

On Mon, 31 Jul 2000, Marko MARKOVIC wrote:
> 
>  (ns_entrydate[8:],ns_entrydate[5:7],ns_entrydate[:4]))">
>  size="10">
> 
> 
> ns_entrydate is a field of my query.

What is the type of ns_entrydate by the time it is used in this method?

> Error Type: AttributeError
> Error Value: __getslice__
[...]
>   File D:\PROGRA~1\INTRAN~1\lib\python\DocumentTemplate\DT_Util.py, line
> 335, in eval
> (Object: REQUEST.set('sdate','%s.%s.%s' %
> (ns_entrydate[8:],ns_entrydate[5:7],ns_entrydate[:4])))
> (Info: REQUEST)
>   File , line 0, in ?
>   File D:\PROGRA~1\INTRAN~1\lib\python\DocumentTemplate\DT_Util.py, line
> 174, in careful_getslice
>   File D:\PROGRA~1\INTRAN~1\lib\python\DateTime\DateTime.py, line 922, in
> __getattr__
> AttributeError: (see above)
> 
> what's wrong?  Do you know where i can found information about zope erorrs,
> i want to know what means all these errors that we get?

Well, unfortunately there is no one place you can go to to find
out about zope errors.  In fact, I'm not sure I've seen the zope
error machinery documented anywhere (and documenting it involves
discussing exactly how the dtml interpretation machinery works, which
would be a good document all by itself ). 

I can tell you what is happening in this case, I think.  You will note
that in the part of the traceback I quoted above the last Object listed
is your line that takes slices out of ns_entrydate ([n:m] is called
a 'slice' in Python jargon).  The error received is a 'getslice' error.
So it looks like the zope machinery got an error when it tried to
take a slice of ns_entrydate.

Since Python is an OO language and operators can be defined for any
object (well, more or less), whatever type ns_entrydate is *could*
have defined a slice operator.  It appears, however, that whatever type
it is, it does *not* define one, since __getslice__ is being flagged
as a non-existent attribute, and that is the attribute that the
object's class would have to define, as a function, in order to
implement the slice operator.

>From your code it appears you believe ns_entrydate is a string.  Is
it possible that it is instead some sort of datetime object?  If
so, then you'd have to call a function on it that returns the string
you want to parse, and call the slice operators on the returned
string.  But if it is a DateTime object, you can probably just call
functions to get exactly the strings you want without having
to slice anyway.

I hope this helps.

--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] search on www.zope.org

2000-07-29 Thread R. David Murray

On Fri, 28 Jul 2000, ethan mindlace fremen wrote:
> Actually, - is treated as a continuation (ala hyphen) so searching for
> dtmlin works fine.
> 
> _ is a stop word, so searching for "mod pcgi" works.
> 
> I'm going to note this on the search page.
> 
> I'm looking into changing this, but Splitter.c is a good description of
> the headache I get :)

If the index treats _ as punctuation or a stop, that would be more
or less OK as far as searching goes if the processing in the lookup
method for text indexes did the *same* splitting (you just have to
make sure it also ANDs (or better yet NEARS) the parts it splits).
This appears not to be the case, from this problem description and
my own experience.  IMO, this is a *serious* bug in ZCatalog, and
I put it in the collector a while ago.  In my experience cataloging
does not always happen correctly, either.  For instance, 'T-shirt'
as a text index input word does not appear to make the object
findable using the keyword 'shirt'.  (I have not tested the latter
behavior on 2.2 yet; I saw it on 2.1.4.)

--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] Displaying "Lines"? was: form to a email in a correctpresentation ?

2000-07-29 Thread R. David Murray

On Fri, 28 Jul 2000, Tim Cook wrote:
> Other than iterating through the property is there a way to
> display or present the lines property for edit without the
> containing ['brackets', '&', 'ticks']? 

Not that I know of.  But the iteration is a pretty simple dtml-in
loop, so I guess nobody has had enough motivation to implement
a one line solution.

> Well it works as long as I tell the user they have to enter each
> item into the box seperated by commas enclosed in single-quotes
> and contained in the list brackets.
> YEAH RIGHT!   That'll never fly.

Does that work?  I wouldn't expect it to.  The :lines coercion
expects the input to be CR separated strings, not the python string
representation of a sequence.  And you really wouldn't want dtml
to just eval the input to allow it to accept the python representation
.

--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] Batchprocessing with multiple conditions?

2000-07-28 Thread R. David Murray

On Tue, 25 Jul 2000, Peter Arvidsson wrote:
> I have objects of a certain meta-type. They have some properties and one
> of the properties is a boolean. How do I make a dtml-in loop among those
> objects with the boolean set to yes? I dont want it to traverse any
> other value at all only those that match the condition should be
> included in the sequenze because I am doing batchprocessing like in

I believe you have two choices: do if tests inside the dtml-in, or
set up a ZCatalog with indexes for the relevant fields and use a
catalog search call to retrieve the correct list of objects.  That's
still not easy if you want to do anything but an AND between the
fields (see the Advanced ZCatalog Searching HowTo), but it should
work.

--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] Re: Folderish objects and that BASE tag...

2000-07-26 Thread R. David Murray

On Mon, 24 Jul 2000, Chris Withers wrote:
> > I belive that it is returning:
> > 
> > http://my.zope/site/file.html/index_html
> 
> I wonder what index_html that is then? :S

>From lib/python/OFS/Image.py (which also implements generic file object):

def index_html(self, REQUEST, RESPONSE):
"""
The default view of the contents of a File or Image.
 
Returns the contents of the file or image.  Also, sets the
Content-Type HTTP header to the objects content type.
"""


___
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] How to require an @ symbol in email form field??

2000-07-21 Thread R. David Murray

On Tue, 18 Jul 2000, Duncan Booth wrote:
> Use javascript to check that all required fields are present before 
> the form is actually submitted. Here is some of the code I use:

Note, however, that using Javascript to do the checking client side
is only useful as a user convenience.  If you have data validation
issues you *must* repeat the validation server side, in case some
clever cracker^h^h^h^h^h^h^huser bypasses your form and submits
data without going through the javascript.

--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] Re: Folderish objects and that BASE tag...

2000-07-21 Thread R. David Murray

On Mon, 17 Jul 2000, Chris Withers wrote:
> If you go to:
> http://my.zope/site/file.html/
> 
> It will just return the DTML document :-)
> 
> I wonder if it is redirecting to http://my.zope/site/file.html?

I belive that it is returning:

http://my.zope/site/file.html/index_html

--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] Urgent Problem -> CMG - script is not working

2000-07-17 Thread R. David Murray

On Tue, 18 Jul 2000, Sven Hohage wrote:
> I know that's described in the CMG but the builder-script is not working. "Invalid 
>syntax".
> The most import thing is to be able  to clone an object and then to change the 
>propertys.
> Please mail me a version that's working because tomorrow I have to show it to my 
>boss.

Try emailing us a cut and paste of the code you are trying to enter,
as well as the line number where it is complaining about the syntax error,
and perhaps we can help you figure out where things are going wrong.

--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] (no subject)

2000-07-17 Thread R. David Murray

On 14 Jul 2000, Karl Anderson wrote:
> __bobo_traverse__ is another attribute that the object may have to
> drive the publishing process, but I haven't needed to understand why
> it's useful yet :)

Isn't that where he'd hook in to do exactly what he wants?  To have
an (arbitrary) object "eat" subsequent URL elements as arguments
to operate upon.  Like ZSQLMethods do.

I think there's a howto on this somewhere.  And I think I remember
reading that it was a lot easier to do under 2.2.

--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] Class Refactoring Question

2000-07-14 Thread R. David Murray

On Thu, 13 Jul 2000, James W. Howe wrote:
> I've developed a couple of simply Python classes which I'm using as base 
> classes for some ZClasses that I've developed.  I now realize that both of 
> these Python classes could benefit from obtaining behavior from another 
> class.  Will I complete hose myself if I change the class definition of my 
> Python base classes?  In other words, will existing ZClass instances be 
> completely screwed up if I do this?

I believe that this will work fine.  There has even been discussion
of doing this (having a python base class to reference the classes
you want your ZClass to have as bases) as a good technique for dealing
with the fact that you can't change the bases of a ZClass after it
is created using the management interface.

--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] uncatalog of absent id?

2000-07-14 Thread R. David Murray

On Thu, 13 Jul 2000, Nitesh Dhanjani wrote:
> Im fairly new to the Zope world. Im trying to delete a PTK folder, and get
> this error:
> 
>   Zope Error
> Zope has encountered an error while publishing this resource. 
> 
> Error Type: ValueError
> Error Value: Uncatalog of absent id '/icds/Members/bob/index_html'

This means you are trying to delete a CatalogAware object that was
not entered into the catalog.  (Some have argued that this is a
but, some a feature).  To get around it, you can probably just
call the URL

/icds/Members/bob/index_html/index_object

and then do the delete.

--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] Re: Re: [Zope] LocalFS Documentation

2000-07-13 Thread R. David Murray

On Thu, 13 Jul 2000, Kelvin Cheong wrote:
> I'm puzzled...there isn't any upload at the bottom of the page...but there
> has always been an upload at the top of the page in the Zope content
> management interface (along with "Contents", "Edit", "View",
> "Properties"...etc).

Was the LocalFS upload support released?  Earlier versions did not support
upload, but I know the author was working on it.

--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] Aligning Images With Text

2000-07-12 Thread R. David Murray

On Wed, 12 Jul 2000, Peter Be wrote:
> If you use .tag you can only control ALT, HEIGHT, WIDTH and BORDER
> Look for these things in the Image module and see if you can add ALIGN.

As far as I can see from the source, tag should handle arbitrary
arguments.  The comments certainly say that it does.  This is
as of 2.1.4, at least.

--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] Aligning Images With Text

2000-07-12 Thread R. David Murray

On Wed, 12 Jul 2000, Terry Babbey wrote:
> Now if only I could get my dtml-if statement working.
> > > 

I believe this should work (mostly tested):



Note that this will be true if the id exists anywhere in the
acquisition path.

--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] Aligning Images With Text

2000-07-12 Thread R. David Murray

On Wed, 12 Jul 2000, Terry Babbey wrote:
> Here is my code:
> 
> 
> 
> 
> What I would like to do is align the picture to the right of my web
> page. If I was programming html I would do it like this:  src=T043PIC align=right>

Untested, but I copied most of it from a working method:



--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] .dtml files

2000-07-12 Thread R. David Murray

On Wed, 12 Jul 2000, Daniel Rusch wrote:
> I have found function calls such as:
> manage_roleForm=HTMLFile('roleEdit', globals()) which I believe creates
> an HTML document template from the named file. But, what is the
> mechanism that calls/displays mange_roleForm?

Actually, it creates a renderable DTML object, I think.  Which
might be saying the same thing.

What calls it is the Zope management framework.  Somewhere you
should find manage_roleForm getting assigned into a structure like
manage_options= or some such.

In short, magic .

--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] How to uninstall a product such as PTK or KnowledgeKit

2000-07-12 Thread R. David Murray

I'm not saying this will fix it, but did you try restarting Zope?

--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 )




[Zope] RE: [Zope-dev] Problem with Zope

2000-07-12 Thread R. David Murray

On Wed, 12 Jul 2000, Tina Goyne (TT) wrote:
> we have actually narrowed the problem down a little more.  If we use
> Netscape--there are no problems.  The problem seems to be with IE--have you
> heard of a resolution?
> 
> BTW - I can view the file on the network server.

No, I hadn't heard about problems viewing PDF files from IE.  Anyone
else seen this?

I suppose we should know what version of Zope you are running.

--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 )




[Zope] RE: [Zope-dev] Problem with Zope

2000-07-12 Thread R. David Murray

On Wed, 12 Jul 2000, Tina Goyne (TT) wrote:
> click on the folder I created--it opens the folder, but it is as if the
> folder is empty.  If I view the file, it opens Adobe Reader--but the page is

If the folder appears empty, how do you view the file?

When viewing the file, the fact that it opens Adobe Reader indicates
that Zope returned some data and indicated the correct mime-type
for a PDF file.  That makes it sound like the data did indeed get
uploaded, otherwise Zope wouldn't have been able to figure out
its type (I think).

> blank.  If I go to the file on the network--it is fine.  I have tried
> uploading the file over and over again.  I have even moved it to different
> locations on the network.  It still doesn't work.  I changed the file from
> Publisher to PDF using Acrobat--should I have used some other method?

Moving it to different locations on the network shouldn't make
any difference.  And once you upload it to Zope, the data being
sent to the client browser is coming from data stored inside
Zope, so at that point the network location of the file would be
irrelevant.

Did you try viewing the converted file before you uploaded it?
Perhaps the conversion process produced a blank document?

Otherwise...  it sounds like Zope is returning something, but the
data is invalid in some way.  Perhaps if you tried doing a 'save'
instead of viewing the link to the file, and you look at the contents
of what gets downloaded, it might give you a clue.  If you had a
way to capture the data stream returned by accessing the file for
viewing that would be better (say by telnetting to the web service
port and typing in the get command by hand).

--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 )




[Zope] Re: [Zope-dev] Problem with Zope

2000-07-11 Thread R. David Murray

On Tue, 11 Jul 2000, Tina Goyne (TT) wrote:
> I am a novice Zope user--my web master left my company and I have been
> pegged with the responsibility of maintaining our internal website.  I am
> having a problem adding a new folder and then adding a file to the folder.
> The file is located on another server with appropriate permissions.
> However, this is the error message I get:

I'm sure we can help you figure this out, but we'll probably have
to ask a bunch of questions first to figure out where things aren't
working .

How did you go about creating the file?  What URL were you trying
to access when you got the resource not found message?  If the
file is on another server, there is going to have be be some
way for Zope to fetch the file before it can serve it, for example
by uploading the file through the browse button in the add file
screen.

--RDM

PS: this is definately more suited to the zope list than the
zope-dev list (the latter being for product developers and
the like), so I've changed the cc accordingly.


___
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] Stupid Question Time

2000-07-11 Thread R. David Murray

On Tue, 11 Jul 2000, Jerome ALET wrote:
> ' and " are equivalent

Not quite true.  dtml only recognizes " for surrounding dtml expressions.
But you are right that they are equivalent in python.

> () are for functions or methods

To call functions or methods: blah(somearg).  But also used for
grouping in expressions: a * (b+c), and for delimiting immutable sequences:
('thing', 'secondthing').

> [] are for arrays (aka list, aka tables) or dictionnaries (aka mappings)

[] can be used to index into sequences: a[3], or to slice out a
portion of a sequence: a[2:4] (see the python guide for more).
Also key lookup out of dictionaries/mappings.  But to *define*
dictionaries you use {}:  {'key1': 'val1', 'key2': 'val2'}.

The most confusing part is the interface between dtml and python.
in an expr, inside the quotes you are in python and things follow
python syntax rules.  This gets really confusing when you have
dtml variables that have hyphens in them, since in python that's
the subtraction symbol.  So inside a python expression, you have
to look up such symbols in the dtml name space.  The dtlm namespace
is named '_', and is a mapping.  So you have things like:



which prints out a number one greater than the current sequence-index.

You can leave off the 'expr=' above, and because of the "s, dtml
will assume it.  This is the way most dtml is written, with the
expr= or name= left out, and that can be very confusing when you
don't know the rules; see the dtml guide.

This is but the briefest introduction to this topic, but hopefully
it will make a few things clearer.

--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 )




  1   2   >