Re: [Zope-dev] Internationalization

2001-01-05 Thread Federico Di Gregorio

On Thu, Jan 04, 2001 at 12:02:17PM -0700, [EMAIL PROTECTED] wrote:
 Hello,
 
 
 Has anyone translated a site within Zope ? I have tried the ZBabel
 Translation System (http://www.zope.org/Members/TheJester/ZBabel) and
 didn't think it did really what I was after.
 
 I need to translate the site into French , German , and Japanese .
 
 I assume the best way is to pull the different languages from a database
 via a python external method or just Zmysql

you can use the Translator product (that does *not* use an external database.)
try our cvs via html interface (cvs.mixadlive.com) or download directly
from the zope site: http://www.zope.org/Members/fog/Translator/

ciao,
federico


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Product dev

2001-01-05 Thread Chris Withers

Shane Hathaway wrote:
 
 when a product has syntax errors.  One of the first things I did at
 Digital Creations was make sure that got fixed. :-)

Does this mean this bit from your average product's __init__.py isn't
neeeded anymore?

except: # If we can't register, complain!
import sys, traceback, string
type, val, tb = sys.exc_info()
sys.stderr.write(string.join(traceback.format_exception(type,
val, tb), ''))
del type, val, tb

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] case insensitive sorts

2001-01-05 Thread Chris Withers

Shane Hathaway wrote:
 
 Shane Hathaway wrote:
  def sort_strings(data):
sortable_data = list(map(lambda s: (lower(s), s), data))
sortable_data.sort()
return map(lambda s: s[1], sortable_data)
 
 ... Or better, you could pass a comparison function to sort() like Tres
 suggested.  :-)

This is where this whole thread started ;-)
We end up using a comparision function every time we call sort, which is
messy and results in a lot of duplicated code...

My suggestion was for the default sort function to change so that when
you want the sorting that makes sense to humans, you'd just have to do:

list.sort()

...and when you wanted sort as it is now, then you could something like:

list.sort(lambda x, y: old_cmp(y,x)) 

But this thread has lost noth its ends, so to speak, so I shall duck out
;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Acquisition wishlist :-)

2001-01-05 Thread Martijn Pieters

On Thu, Jan 04, 2001 at 10:46:35AM +, Chris Withers wrote:
 Dieter Maurer wrote:
  
 acquisition.donotacquire('index_html')
  This would be great.
 
 Indeed :-)
 
class MyClass (Acquisition.Explicit):
   
 acquisition = ClassAcquisitionInfo()
   
 acquisition.acquire('index_html')
 acquisition.acquire('fred')
  You already can do that, though with a different syntax
  (I would need to search for in the documentation).
 
 You may mean that if x is an Acquisition.Explicit object, you can do:
 
 x.aq_acquire('your_attribute') (syntax may be wrong ;-)
 
 What I meant is that through a declaration in the class you could saying
 acquire the 'your_attribute' attribute but nothing else. So, you could
 still do:
 
 x.your_attribute ...which would be acquired, but...
 x.index_html ...which wouldn't be acquired.

You could use ComputedAttribute for that:

class MyClass(Acquisition.Explicit):
# The following attribute is acquired transparently
def _acquired_your_attribute(self):
return self.aq_acquire('your_attribute')
your_attribute = ComputedAttribute(_acquired_your_attribute, 1)

# index_html isn't
index_html = None

Or you could define a __getattr__ that does a lookup in a list for
explicetly acquired attributes:

_acquired = ('index_html', 'fred')
def __getitem__(self, key):
if key in self._acquired:
return self.aq_acquire(key)
raise AttributeError, name

-- 
Martijn Pieters
| Software Engineer  mailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
-

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] CatalogAware

2001-01-05 Thread Chris Withers

Michael Bernstein wrote:
 
 Your example is correct as far as it goes, but as I
 understand it, you are not really specifying the default
 catalog per se, but the default catalog *name*.

snip

This is true, and one of the reasons why I (and maybe only I ;-)
consider CatalogAware somewhat less useful than it could be.

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] CatalogAware

2001-01-05 Thread Chris Withers

Michael Bernstein wrote:
 
 Aha!
 
 You're saying that catalog_object and uncatalog_object are
 methods of the catalog, so when the catalog contains the
 objects directly, it's all that's neccessary, correct?

Yes :-)

 uncatalog_object to be called on it (I'm not sure what
 method reindex_object causes to be called).

unindex_object followed by index_object. I'm not convinced it's
necessary, as no-one has said that uncataloging is a necessary step
before catalogng something that's already in the catalog.

 So, postings would only need to be CatalogAware if you
 wanted them to be able to 'live' anywhere within the Zope
 heirarchy, instead of being contained directly within the
 Squishdot object (which inherits from ZCatalog).

Yes, but Squishdot postings are intimately tied to the Squishdot
folderish object anyway, so that's not going to happen ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] RE: objectIds accessiblilty and a proposal

2001-01-05 Thread Chris Withers

Brian Lloyd wrote:
 
 Are you talking about 'ProtocolAccessibility'? It's still
 there (though Jim has done some rearranging of things there
 lately)...

http://www.zope.org//Wikis/DevSite/Proposals/ProtocolAccessibility

So it is :-)

Comments are still welcome...

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Re: ComputedAttribute

2001-01-05 Thread Martijn Pieters

On Fri, Jan 05, 2001 at 12:22:32PM +, Chris Withers wrote:
 Martijn Pieters wrote:
  
  You could use ComputedAttribute for that:
  
  class MyClass(Acquisition.Explicit):
  # The following attribute is acquired transparently
  def _acquired_your_attribute(self):
  return self.aq_acquire('your_attribute')
  your_attribute =ComputedAttribute(_acquired_your_attribute, 1)
  
  # index_html isn't
  index_html = None
 
 That looks cool :-)
 
 Where's it documented? what does the 1 mean?

Erm. The ExtensionClass.stx documentation hints at a ComputedAttribute
class (but as an example of how you could use an ExtensionClass). The
current C implementation of ComputedAttribute is not, as far as I can see,
documented.

As for the '1', the CVS log has the following to say on that:

  Added second "level" argument for computed attributes.  This makes it
  easier to create computed attributes that work with acquisition.
  Normally, computed attributes are called with unwrapped objects. Passing
  a level of 1, causes computed attributes to be called with one level of
  wrapping.  Note that the innermost (single) level of wrapping typically
  reflects a containment context with any extra access contexts stripped
  off.

As I understand it, it makes self.aq_acquire possible.

See also:

  http://cvs.zope.org/Zope2/lib/Components/ExtensionClass/ComputedAttribute.c

-- 
Martijn Pieters
| Software Engineer  mailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
-

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] RFE: Make PythonScripts.standard available from DTML _.standard

2001-01-05 Thread Steve Alexander

This is an RFE for Zope 2.3.

I'm posting it here for discussion, rather than in the Collector.


In the new PythonScripts product (that is a standard part of Zope 2.3) 
there is a standard utility module that can be imported into a Python 
Script with

   import Products.PythonScripts.standard

or

   from Products.PythonScripts.standard import *

It contains useful functions such as those for text formatting 
(html_quote, url_quote_plus, and so on). It also contains the DTML class 
for creating temporary chunks of restricted DTML.

These functions would be really useful as part of the DTML _ namespace 
variable. I sometimes find myself wanting to use html_quote in a DTML 
expression. I'd also be able to use these functions from ZPatterns 
SkinScript.

The PythonScripts product could add these functions to the _ namespace 
variable at product init time, so there would be no need to change the 
DocumentTemplate modules.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] protocol accesibility

2001-01-05 Thread Chris Withers

Toby Dickenson wrote:
 
 On Fri, 05 Jan 2001 12:18:07 +, Chris Withers [EMAIL PROTECTED]
 wrote:
 
 http://www.zope.org//Wikis/DevSite/Proposals/ProtocolAccessibility
 
 So it is :-)
 
 Comments are still welcome...
 
 Comments provided as requested

With sensible defaults, what I was proposing would be just as simple as
things are now, but explicit and flexible.

For example, if you start a method name with _, it's not URL
traversable, or available in DTML. I have no idea about FTP but it
probabyl won't be accessible through DAV.

Alternatively, if you give a method in a python a doc string, it will be
URL traversable. Take that doc string away and it won't be url
traversable but will be accessible in DTML. Again, don't know about FTP
or DAV.

I agree the wording might be bad (that proposal is very old now), but
how can something that seeks to clearly define and document something
that has already been partially and accidentally implemented (as was
often the Zope way ;-) be a bad thing?

cheers,

Chris

PS: 

How would you hide things like standard_html_header and _footer from
users?

Access Contents Information is needed by a lot of methods (some of which
aren't available to give proxy roles to) that using it to prevent peole
from sniffing around in your site isn't feasible.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] RFE: Make PythonScripts.standard available from DTML _.standard

2001-01-05 Thread Steve Alexander

Steve Alexander wrote:

 
 The PythonScripts product could add these functions to the _ namespace 
 variable at product init time, so there would be no need to change the 
 DocumentTemplate modules.

And here's a patch:
Just add these lines at the end of
   lib/python/Products/PythonScripts/standard.py

from DocumentTemplate.DT_Util import d
import standard
d['standard']=standard
del standard

Of course, you could add similar lines to PythonScripts/__init__.py, or 
in a completely new "enable python scripts standard module with dtml" 
product.

-- 
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] RFE: Make PythonScripts.standard available from DTML _.standard

2001-01-05 Thread Steve Alexander

Chris Withers wrote:


 If you have something like that, wouldn't it be better, more readable,
 etc, for it to be moved intop a python script, even if that script was
 only 1 line long?
 
 eg:
 dtml-if
 "mysomething(_['title_or_id'],_.standard.html_quote(absolute_url()+_[id]))"

You are being deliberately Byzantine there!

Not to mention that _['title_or_id'] is equivalent to just title_or_id.

However, I agree with you in principle.
I've had other, much simpler, cases where I want to html_quote just a 
part of something. I can't put my finger on an example right now, so 
that does weaken my case a little :-)

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] RFE: Make PythonScripts.standard available from DTML _.standard

2001-01-05 Thread Chris Withers

Steve Alexander wrote:
 
  eg:
  dtml-if
  "mysomething(_['title_or_id'],_.standard.html_quote(absolute_url()+_[id]))"
 
 You are being deliberately Byzantine there!

I provided a good example for my case, don't know what Byzantine means,
erk :-S

 However, I agree with you in principle.
 I've had other, much simpler, cases where I want to html_quote just a
 part of something. I can't put my finger on an example right now, so
 that does weaken my case a little :-)

*grinz*

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZPatterns question

2001-01-05 Thread Chris Withers

Christian Scholz wrote:
 
  yeah, this is exactly what I'm after too. I'd like the virtual objects
  the specialist is responsible for to have normal Zope management
  screens.
 
 Well, I think this shouldn't be too difficult to create. Just a subclass
 of Specialist and add some Contents-Tab, define objectIds() etc. in the
 Methods tab and call it in the management screen of "Contents".
 Though the more advanced things like Copy/Paste/Rename might then not
 be available.. But for me actually it would be sufficient to get the
 contents.

:-S

I was hoping for something along the lines of subclass from Specialist
and Folder, and override objectIds (+ whatver else?) in my new class to
do 'the right thing'

I wonder how that would pan out?

  Also, much mroe trickily, I'd like them to be able to contain each
  other, although Steve A's __bobo_traverse__ trick might help with this
  bit...
 
 What do you mean? Nesting Specialists (or these virtual folder specialists)?

The DataSkins stored in the specialist ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Product dev

2001-01-05 Thread Shane Hathaway

Chris Withers wrote:
 
 Shane Hathaway wrote:
 
  when a product has syntax errors.  One of the first things I did at
  Digital Creations was make sure that got fixed. :-)
 
 Does this mean this bit from your average product's __init__.py isn't
 neeeded anymore?
 
 except: # If we can't register, complain!
 import sys, traceback, string
 type, val, tb = sys.exc_info()
 sys.stderr.write(string.join(traceback.format_exception(type,
 val, tb), ''))
 del type, val, tb

That's right.  As long as you're in -D mode or you have the event log
going somewhere, you'll see these kind of exceptions.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Product dev

2001-01-05 Thread Chris Withers

Shane Hathaway wrote:
 
   when a product has syntax errors.  One of the first things I did at
   Digital Creations was make sure that got fixed. :-)
 
  Does this mean this bit from your average product's __init__.py isn't
  neeeded anymore?
 
  except: # If we can't register, complain!
  import sys, traceback, string
  type, val, tb = sys.exc_info()
  sys.stderr.write(string.join(traceback.format_exception(type,
  val, tb), ''))
  del type, val, tb
 
 That's right.  As long as you're in -D mode or you have the event log
 going somewhere, you'll see these kind of exceptions.

Cool, what version was it fixed in?

I'll chop the code out of Squishdot et al as soon as I get the chance
:-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Objects with multiple parents and storage flexibility, ZPatterns?

2001-01-05 Thread Chris Withers

Steve Spicklemire wrote:
 
 No... I don't think so! If you don't mind keeping stuff in ZODB
 then you *could* have a traversal interface that made stuff 'appear'
 wherever you want it to, though its persistent storage would 'really'
 be in a Rack or FwCS.

Cool... how would I go about doing that?

 Hmm. not really...  the Zope 'id' is used by the Rack to keep track
 of all the objects of a single type. If all your 'X's are kept in one
 Rack, they all need a unique 'id'. 

Ah, yes, now I see, in my case, as with the ZODB, the unique id would be
the path from the specialist/FwCS to the DataSkin in question, ending in
the dataskin's ID, I think :-S

The difference is that, because of the multiple parents thing, unique id
- dataskin isn't a one to one mapping.
many unique id's map onto one dataskin.

I suppose that means the _actual_ unique id for the dataskin needs to be
a unique integer number or some such. But I guess the user would never
need to be exposed to that?

Does strike me that this is all redo-ing Zope's traversal stuff, which
is why I'm trying to find a better way... wagh! My head hurts :-S

 The idea context_id is an id-like
 attribute that 'plays the role of id' in the context of a particular
 parent. It's probably a bad name... but all I could think of in 5
 minutes...

I think id would be better, because it's closest to Zope's notion of id,
the bit that goesi nto the Rack probably wants to be called 'unique
idenitifier' or maybe even 'path' depending on what gets used :-S

 Wow... multiple parents, multiple children.. it's almost incestuous!

inbred objects, now there's a concept ;-)

 So long as you can write queries for 'find parents for child x' and
 'find children for parent y' it shouldn't matter. 

cool...

 Chris Hurm... I'd love them to have a UI identical to normal Zope
 Chris folders/objectmanagers, though, with properties, a security
 Chris tab, and, in a dream world, the ability to drop normal DTML
 Chris methods, python Scripts and the like into the foldersish
 Chris objects.
 
 Chris Is this asking for too much? ;-)
 
 You can never *ask* for too much. ;-)

But then what happens if I ask how to do it?

 Seriously though... for this you'll probably need to store the objects
 persistently in the Rack(s),

Why?

 though you could farm some of their
 attributes out to other data storage systems with SkinScript. Nothing
 will prevent you from making your DataSkins inherit from ObjectManager
 or Folder, but you won't be able to completely 'virtualize' them.  

Well, that may not be a problem. The important thing is that if someone
creates a record in a.n.other system, then one of these 'virtual'
objects automatically appears in the Zope side of things... reckon
that's not too hard?

 The
 only way I *think* you could make this work with completely virtual
 data-skins is to create 'sister' classes to everything you wanted to
 add (e.g. 'SkinDTML Method' and 'SkinPython Script' which would be new
 classes that inherit from DataSkin *and* the class you want to emulate
 (and probably yet another class that hanldles the interconnection glue
 parents/context and all that). Then you'd need to add whatever
 attribute providers were necessary to keep all the attributes of the
 original classes (e.g., DTML Method) in your external storage. But it
 sounds like you just want to keep 'some' of the associated data
 in the external source... so I don't think any of that will be
 necessary.

Why would the sister classes be needed? Anyway, how do I break this down
into small beginner sized steps and start doing it?

thanks for all your help,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] protocol accesibility

2001-01-05 Thread Chris Withers

Toby Dickenson wrote:
 
 IMO their goals are achieved better, and simpler, with a HOWTO
 that explains how to configure the 'access contents information' permission.

That's not been my experience, but maybe that How-To would help :-)
Care to write it? ;-)

 I think perhaps you havent appreciated the simplicity of the current
 arrangement - all protocols work the same.

That remains to be proved, even given the DTML wart you mentioned ;-)

 Your word 'accidentally' is a good hint as to the reason. A better (IMO)
 principal is 'protocol independance' - a method should behave the same no
 matter how it is called.

Protocol independence is not necessarily a good thing in this case.
Different protocols have different capabilities. For example, you might
trust someone a lot more if they were using HTTPS rather HTTP. 

So, there is a disagreement here. What I proposed would enable us both
to be happy, without anymore work on your part thanks to defaults that
leave things as they are now. Your point of view leaves only you happy
;-)

  How would you hide things like standard_html_header and _footer from
  users?
 
 Im not sure why they need to be, please explain. I dont think 'tidyness' is
 a sufficient reason. 

I do, and I'm sure others do to. It's doesn't look very professional
when things like http://www.zope.org/standard_html_header and
http://www.cbsnewyork.com/objectIds are left hanging out.
http://www.cbsnewyork.com/rubbish ain't none too nice either, likewise
http://www.cbsnewyork.com/manage...

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Product dev

2001-01-05 Thread Shane Hathaway

Chris Withers wrote:
 
 Shane Hathaway wrote:
 
when a product has syntax errors.  One of the first things I did at
Digital Creations was make sure that got fixed. :-)
  
   Does this mean this bit from your average product's __init__.py isn't
   neeeded anymore?
  
   except: # If we can't register, complain!
   import sys, traceback, string
   type, val, tb = sys.exc_info()
   sys.stderr.write(string.join(traceback.format_exception(type,
   val, tb), ''))
   del type, val, tb
 
  That's right.  As long as you're in -D mode or you have the event log
  going somewhere, you'll see these kind of exceptions.
 
 Cool, what version was it fixed in?

One of the 2.2.0 betas, I think.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] protocol accesibility

2001-01-05 Thread Chris Withers

Toby Dickenson wrote:
 
  That's not been my experience, but maybe that How-To would help :-)
  Care to write it? ;-)
 
 It is on my todo list

cool :-)

  Protocol independence is not necessarily a good thing in this case.
  Different protocols have different capabilities.
 
 The zope way of modelling different capabilities is through roles. The right
 way to achieve this is to allocate different roles based on protocol.

how do you do that? (refs to how-to's, docs, etc all good, just that I
never knew you could do that :-)

 You could do this today using LoginManager, which allows for roles to be
 *computed* during authentication. Give your users different roles depending
 on whether they use http or https. (

or ftp?

 Indeed, I would be keen to see this
 feature in the standard user folder)

Maybe that's what I should haev said in my proposal ;-)

 Note that protocol is not a key factor here: you might also trust them more
 if the socket connection comes from localhost.

very true

  http://www.zope.org/standard_html_header
 
 Can you explain *why* this is a problem? While I agree it's untidy, its only
 an untidyness seen by people who go looking for it.

Some people (or am I the only one ;-) don't really find that acceptable.
The paranoid part of me also wants to know that it isn't possible to
find this, as it should only be used by other stuff inside zope, why
should stuff outside of zope get to play with it?

  http://www.cbsnewyork.com/objectIds are left hanging out.
 
 I propose securing the 'access contents information' permission, and you
 havent explained why this is flawed.

Securing the permission? perhaps you could explain that a bit more :-S

  http://www.cbsnewyork.com/rubbish ain't none too nice either, likewise
 
 That document has since been removed. 

Nope, that's the point, it give a yucking Zope Error which lowers user
confidence, rather than saying 'that page wasn't found, perhaps you'd
like to look here or here', but, to be fair, that's because whoever
built that site didn't bother to make standard_error_message useful
(don't get me started on tacking tracebacks on the end of html generated
by that page ;-)

  http://www.cbsnewyork.com/manage...
 
 I get an authentication dialog so?

Hit cancel. Again, a yucky Zope error rather than saying 'sorry, your
username or password were wrong', or, in reference to this thread, not
actually being _visible_ to this protocol at all. eg: should raise a
404, as standard_html_header should ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] CatalogAware

2001-01-05 Thread Chris Withers

Michael Bernstein wrote:
 
 Now I'm wondering how to duplicate the behaviour of Postings
 being contained within Squishdot, but not appearing in the
 'Contents' tab.

that's definitely a 'bad' thing :-(

Why duplicate anyway? You writing a replacement? ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Acquisition wishlist :-)

2001-01-05 Thread Shane Hathaway

There's a (much) simpler way:

class MyClass(Acquisition.Explicit):
your_attribute = Acquisition.Acquired

# index_html isn't
index_html = None

"Acquired" is a special object that the acquisition module looks for.

However, I wasn't aware you could add a "1" to the ComputedAttribute
constructor.  Thanks!

Shane

Martijn Pieters wrote:
 
 On Thu, Jan 04, 2001 at 10:46:35AM +, Chris Withers wrote:
  Dieter Maurer wrote:
  
  acquisition.donotacquire('index_html')
   This would be great.
 
  Indeed :-)
 
 class MyClass (Acquisition.Explicit):

  acquisition = ClassAcquisitionInfo()

  acquisition.acquire('index_html')
  acquisition.acquire('fred')
   You already can do that, though with a different syntax
   (I would need to search for in the documentation).
 
  You may mean that if x is an Acquisition.Explicit object, you can do:
 
  x.aq_acquire('your_attribute') (syntax may be wrong ;-)
 
  What I meant is that through a declaration in the class you could saying
  acquire the 'your_attribute' attribute but nothing else. So, you could
  still do:
 
  x.your_attribute ...which would be acquired, but...
  x.index_html ...which wouldn't be acquired.
 
 You could use ComputedAttribute for that:
 
 class MyClass(Acquisition.Explicit):
 # The following attribute is acquired transparently
 def _acquired_your_attribute(self):
 return self.aq_acquire('your_attribute')
 your_attribute = ComputedAttribute(_acquired_your_attribute, 1)
 
 # index_html isn't
 index_html = None
 
 Or you could define a __getattr__ that does a lookup in a list for
 explicetly acquired attributes:
 
 _acquired = ('index_html', 'fred')
 def __getitem__(self, key):
 if key in self._acquired:
 return self.aq_acquire(key)
 raise AttributeError, name
 
 --
 Martijn Pieters
 | Software Engineer  mailto:[EMAIL PROTECTED]
 | Digital Creations  http://www.digicool.com/
 | Creators of Zope   http://www.zope.org/
 -
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Acquisition wishlist :-)

2001-01-05 Thread Chris Withers

Shane Hathaway wrote:
 
 There's a (much) simpler way:
 
 class MyClass(Acquisition.Explicit):
 your_attribute = Acquisition.Acquired
 
 # index_html isn't
 index_html = None

Cool :-)

And I suppose the other part of my wishlist:

 class MyClass(Acquisition.Implicit):
 # your_attribute will be acquied
 
 # index_html won't
 index_html = None

Sorry for wasting the lists' time :-S 

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] CatalogAware

2001-01-05 Thread Christopher Petrilli

On 1/5/01 7:16 AM, "Chris Withers" [EMAIL PROTECTED] wrote:

 uncatalog_object to be called on it (I'm not sure what
 method reindex_object causes to be called).
 
 unindex_object followed by index_object. I'm not convinced it's
 necessary, as no-one has said that uncataloging is a necessary step
 before catalogng something that's already in the catalog.

Actually this is where the luminous KeyError lurks.  If you don't
unindex_object first (prior to 2.2.4), then you could potentially have words
in the forward index that your object no longer contains, and eventually it
could get into a state where you get a KeyError.

In 2.2.4 I modified it (rather bluntly) to always do an unindex_object
before even starting the index_object proceedings... This is obviously
rather heavy, but it did prevent a lot of faulty uses... CatalogAware was
wrong, for example :-)

In 2.3a2 (hopefully :-) and if not a3), Jim and I have developed some
merging code that will do much more intelligent merging of new and old data,
reducing the size of transactions in the Catalog, and also preventing things
from being touched when in fact nothing changed---this can be responsible
for 70-80% of the bloat in some sites.

In addition, many needless objects were touched when they had no relevance
to the object being indexed.  This should also help reduce bloat.  Speed, so
far is on par, and eventually we hope faster for most sites.

Chris
-- 
| Christopher Petrilli Digital Creations
| [EMAIL PROTECTED]Where Zope comes from


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] BTree Folders

2001-01-05 Thread Chris Withers

Hi,

There was talk a while back of re-doing BTree's in Zope so they were
more efficient. Is that still going ahead?
If I start using BTree folders now, will there be any nasties when the
changes happen?

Right, BTree folders wise, what I'm looking for is to have, in effect
two Contents tabs for one BTree folder object, one showing all contained
items of a particular meta_type (with the BTree Folder's interface to
deal with lots of objects), and the other containing all other items in
the folder (DTML Methods, Gifs, etc, with a normal folder's interface).

What's the best way to do this?

I was going going to subclass BTreeFolder, and overide the contents tab
and provide an extra one, copying and hacking the DTML as appropriate to
filter on meta_type. this strikes me as not very robust as I won't
benefit from any improvements to either GUI that are made in the future.
Is there perhaps a better way?

Also, what's the difference between a 'Full' and a 'Basic' BTreeFolder,
which one should I use?

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] zope on win95

2001-01-05 Thread nando n

where can i download (exact url) binary version
of zope to install it on my win95 system?
for now i've only been able to download python
source code version of zope.
how do i execute dtml files?

i just want to know that. thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] BTree Folders

2001-01-05 Thread Steve Alexander

Chris Withers wrote:


 Right, BTree folders wise, what I'm looking for is to have, in effect
 two Contents tabs for one BTree folder object, one showing all contained
 items of a particular meta_type (with the BTree Folder's interface to
 deal with lots of objects), and the other containing all other items in
 the folder (DTML Methods, Gifs, etc, with a normal folder's interface).
 
 What's the best way to do this?

If you're using ZPatterns anyway, you might like to look at PlugIns. The 
idea with PlugIns is that a PlugIn manager delegates the handling of 
objects it contains to its various PlugIns. Typically, a PlugIn will 
claim objects based on the object's meta-type.
PlugIns appear in the user-interface as separate tabs. See the 
Customizers and Data Plug-ins tabs in a Folder w/ Customizer Support 
instance for an example.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] SkinScript reference in two-up postscript

2001-01-05 Thread Steve Alexander

Hi folks,

   http://www.cat-box.net/steve/skinscript_ref-0-4-3b2.ps.gz

This is a two-up A4 postscript version of PJE's most useful SkinScript 
reference. It prints out to four landscape-orientation A4 pages.

  http://www.cat-box.net/steve/skinscript_ref-0-4-3b2_letter.ps.gz

This is similar, but for letter size paper.

Also available in pdf:

   http://www.cat-box.net/steve/skinscript_ref-0-4-3b2.pdf
   http://www.cat-box.net/steve/skinscript_ref-0-4-3b2_letter.pdf

The files were produced from the skinscript help page of ZPatterns 
0-4-3b2, printed to a file with Mozilla, and then converted to 2-up 
pages using impose.

The pdf versions were produced using ps2pdf on the postscript files.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZPaterns, Pluggins

2001-01-05 Thread Chris Withers

Steve Alexander wrote:
 
 If you're using ZPatterns anyway,

After looking at ZPatterns for a few more days again, I still can't
justify introducing that ammount of complexity to the project concerned.
Also, ZPatterns seems very skewed towards TTW development now and, for
CVS and distributability reasons, that's also innappropriate for this
project.

 you might like to look at PlugIns. The
 idea with PlugIns is that a PlugIn manager delegates the handling of
 objects it contains to its various PlugIns. Typically, a PlugIn will
 claim objects based on the object's meta-type.

As I understand it, the pluggins archicture is now wholey seperated from
the ZPatterns one, so I might still take a look at that. Are there any
docs about the pluggin architecture anywhere?

 PlugIns appear in the user-interface as separate tabs. See the
 Customizers and Data Plug-ins tabs in a Folder w/ Customizer Support
 instance for an example.

Thanks, I'll take a look :-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] ZPatterns: __getitem__ on a DataSkin instance

2001-01-05 Thread Steve Alexander

Let's say I have a DataSkin-derived ZClass that has the attribute 
"forename" (in a dataskin attribute propertysheet).

If I get an instance of this ZClass from the ZODB (set up to use a 
Folder w/ customizer suppport), I can refer to the "forename" attribute 
using dtml-var "this()['forename']".

However, if I get an instance of the same class from a Specialist, 
dtml-var "this()['forename']" gives me

Error Type: AttributeError
Error Value: __getitem__

Any idea why there's the difference?

Can the latter case be fixed?

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Re: ZPatterns: __getitem__ on a DataSkin instance

2001-01-05 Thread Steve Alexander

Steve Alexander wrote:

 Let's say I have a DataSkin-derived ZClass that has the attribute 
 "forename" (in a dataskin attribute propertysheet).
 
 If I get an instance of this ZClass from the ZODB (set up to use a 
 Folder w/ customizer suppport), I can refer to the "forename" attribute 
 using dtml-var "this()['forename']".
 
 However, if I get an instance of the same class from a Specialist, 
 dtml-var "this()['forename']" gives me
 
Error Type: AttributeError
Error Value: __getitem__
 
 Any idea why there's the difference?
 
 Can the latter case be fixed?

A workaround, using the ever-flexible skinscript:

I've defined __getitem__ through skinscript and a PythonScript.

SkinScript:
   WITH SELF COMPUTE __getitem__=getattr

PythonScript:
   parameter list: index

   return getattr(index)


-- 
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Re: Spitter.c Hack

2001-01-05 Thread Jason Spisak

Zopists,

I finally got Splitter.c to let me index numbers and 'C++' in a TextIndex. 
I have about 50,000 objects in that index, and search performance is nearly
instantaneous still.  I am running on a big machine though.  If anyone
wants those changes there's really easy.  Just mail me directly, since it's
a long file to post.

All my best,

Jason Spisak

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Re: ZPatterns: __getitem__ on a DataSkin instance

2001-01-05 Thread Steve Spicklemire


Hi Steve,

   Hmm.. is the 'id' of your PythonScript also getattr?

thanks,
-steve

 "Steve" == Steve Alexander [EMAIL PROTECTED] writes:

Steve Steve Alexander wrote:

 Let's say I have a DataSkin-derived ZClass that has the
 attribute "forename" (in a dataskin attribute propertysheet).
 
 If I get an instance of this ZClass from the ZODB (set up to
 use a Folder w/ customizer suppport), I can refer to the
 "forename" attribute using dtml-var "this()['forename']".
 
 However, if I get an instance of the same class from a
 Specialist, dtml-var "this()['forename']" gives me
 
 Error Type: AttributeError Error Value: __getitem__
 
 Any idea why there's the difference?
 
 Can the latter case be fixed?

Steve A workaround, using the ever-flexible skinscript:

Steve I've defined __getitem__ through skinscript and a
Steve PythonScript.

Steve SkinScript: WITH SELF COMPUTE __getitem__=getattr

Steve PythonScript: parameter list: index

Stevereturn getattr(index)


Steve -- Steve Alexander Software Engineer Cat-Box limited
Steve http://www.cat-box.net



Steve ___ Zope-Dev
Steve maillist - [EMAIL PROTECTED]
Steve http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
Steve posts or HTML encoding!  ** (Related lists -
Steve http://lists.zope.org/mailman/listinfo/zope-announce
Steve http://lists.zope.org/mailman/listinfo/zope )


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Re: ZPatterns: __getitem__ on a DataSkin instance

2001-01-05 Thread Steve Alexander

Steve Spicklemire wrote:

 Hi Steve,
 
Hmm.. is the 'id' of your PythonScript also getattr?

Yes. I forgot to mention that. And, I realized just after posting the 
email to the list that calling a method "getattr" is asking for trouble :-)

Actually, my workaround doesn't work except in the most trivial cases.
My code was making more errors as Zope tried to look up the _ variable 
via __getitem__ and thus via my PythonScript.

I've ended up using a dtml-if to choose whether to use a dtml-with 
stuff mapping block or just a plain dtml-with stuff block.

I'd still like to know why a Dataskin from a specialist is behaving 
differently from one in the ZODB in this respect.
--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Re: Spitter.c Hack

2001-01-05 Thread Casey Duncan

Jason Spisak wrote:
 
 Zopists,
 
 I finally got Splitter.c to let me index numbers and 'C++' in a TextIndex.
 I have about 50,000 objects in that index, and search performance is nearly
 instantaneous still.  I am running on a big machine though.  If anyone
 wants those changes there's really easy.  Just mail me directly, since it's
 a long file to post.

Could you maybe post just the diff for poserity?

-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] RFE: Make PythonScripts.standard available from DTML _.standard

2001-01-05 Thread Dieter Maurer

Steve Alexander writes:
  
I like your idea.

It is one way to implement my recent "lobbying" request
with minimal effort.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Acquisition wishlist :-)

2001-01-05 Thread Dieter Maurer

Chris Withers writes:
  And I suppose the other part of my wishlist:
  
   class MyClass(Acquisition.Implicit):
   # your_attribute will be acquied
   
   # index_html won't
   index_html = None
No, that is not enough!

As a side effect to turn off acquisition, you defined
the attribute. This will not play well with inheritance:
You will not only prevent acquisition of "index_html" but
also prevent inheritance of it (which may be really necessary
in some contexts).


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] ZPatterns: catching exceptions raised by triggers

2001-01-05 Thread Steve Alexander

Let's say I have a trigger that is called to ensure that what something 
is changed to holds true.

I use some skinscript like this:

WHEN OBJECT ADDED, CHANGED CALL self.ensure_conditions_hold()


I write the ensure_conditions_hold method so that it returns None if 
everything is ok, but raises an exception if there is a problem with the 
new state of the object.

That's all fine. However, I want to catch this exception in my 
application, and handle it in a friendly way. However, I've tried using 
dtml-try blocks and try: except: blocks from Python Scripts, and either 
way, I cannot catch the exception. It still causes Zope to return the 
standard_error_message screen.

I can only speculate that this is all due to the way that triggers get 
executed at the end of transaction. I guess I'll have to validate the 
data twice if I want to provide helpful feedback to the user.


Stranger still, the error message is reporting itself to have a strange 
content-type, so my browser is asking me if I want to download it as a 
file; I'm pretty sure this isn't related to the skinscript though, as I 
can get the same effect with other errors.

How do I catch an error raised by a Trigger?

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZPatterns: catching exceptions raised by triggers

2001-01-05 Thread Phillip J. Eby

At 12:49 AM 1/6/01 +, Steve Alexander wrote:

WHEN OBJECT ADDED, CHANGED CALL self.ensure_conditions_hold()

I write the ensure_conditions_hold method so that it returns None if 
everything is ok, but raises an exception if there is a problem with the 
new state of the object.

That's all fine. However, I want to catch this exception in my 
application, and handle it in a friendly way. However, I've tried using 
dtml-try blocks and try: except: blocks from Python Scripts, and either 
way, I cannot catch the exception. It still causes Zope to return the 
standard_error_message screen.

I can only speculate that this is all due to the way that triggers get 
executed at the end of transaction. I guess I'll have to validate the 
data twice if I want to provide helpful feedback to the user.

How do I catch an error raised by a Trigger?

What Ty and I usually do is raise user-friendly error messages (in HTML) to
begin with, so there's no need to trap them in an except block; Zope's
normal handling works okay then.  This is the "as designed/intended"
solution to your overall problem.  (We often use dtml-raise for this, as it
makes it easier to create a full-screen HTML error page.)

But to answer the question you asked, you can do it by performing a
subtransaction commit, wrapped in a try or dtml-try block.  This will fire
the triggers in a context where you can trap the exception.  We suggest you
only use this trick when you really need it, however, and in your situation
as described I don't think you really need it.  Even if
"ensure_conditions_hold" can't be changed to raise friendly exceptions, you
can always put a wrapper routine around it that catches and re-raises them.

The key idea here is that it's perfectly okay to let an exception propagate
to the user, if formatted properly.  You probably *want* it to happen, to
ensure that *everything* gets rolled back.  Even if you do the
subtransaction trick and trap the error, you still want to make sure the
transaction as a whole aborts, since SQL (for example) might already have
been sent to a database.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Re: Spitter.c Hack

2001-01-05 Thread Jason Spisak

Casey Duncan:

It truely is nothing more than cutting out the two parts that eliminate
single letter words and numbers:

*** Zope-2.2.4-src/lib/python/SearchIndex/Splitter.c 
--- Zope-2.2.4-src/lib/python/SearchIndex/Splitter_Old.c 
***
*** 169,192 
  len = PyString_Size(word) - 1;
  
  len = PyString_Size(word);
- /*if(len  2)  Single-letter words are stop words!
- {
-   Py_INCREF(Py_None);
-   return Py_None;
- } */
- 
- /*
-   Test whether a word has any letters.   */
  
  for (; --len = 0  ! isalpha((unsigned char)cword[len]); );
- /*if (len  0)
- {
- Py_INCREF(Py_None);
- return Py_None;
- }
- 
-  * If no letters, treat it as a stop word.
-  */
  
  Py_INCREF(word);
  
--- 169,176 


All my best,


Jason Spisak
CIO
__ ___   ____
   / // (_)_/_  __/__ / /  ___  ___  __ _
  / _  / / __/ -_) / / -_) __/ _ \(_-_/ __/ _ \/  ' \
 /_//_/_/_/  \__/_/  \__/\__/_//_/___(_)__/\___/_/_/_/

6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Re: Spitter.c Hack

2001-01-05 Thread Jason Spisak

Erik,

 [Jason Spisak]
 
 | I am running on a big machine though.  If anyone wants those changes
 | there's really easy.  Just mail me directly, since it's a long file
 | to post.
 
 Hi.  I would be interested in the file :-).
 

Okay, here's the diff. It truely is nothing more than cutting out the two
parts that eliminate single letter words and numbers:

*** Zope-2.2.4-src/lib/python/SearchIndex/Splitter.c 
--- Zope-2.2.4-src/lib/python/SearchIndex/Splitter_Old.c 
***
*** 169,192 
  len = PyString_Size(word) - 1;
  
  len = PyString_Size(word);
- /*if(len  2)  Single-letter words are stop words!
- {
-   Py_INCREF(Py_None);
-   return Py_None;
- } */
- 
- /*
-   Test whether a word has any letters.   */
  
  for (; --len = 0  ! isalpha((unsigned char)cword[len]); );
- /*if (len  0)
- {
- Py_INCREF(Py_None);
- return Py_None;
- }
- 
-  * If no letters, treat it as a stop word.
-  */
  
  Py_INCREF(word);
  
--- 169,176 



 Would you also be willing to share some statistics on how many objects
 you have in how many indexes, and how much time "complex" searches
 take?  I do understand if this is not possible, but it'd be appetiated
 if it was possible. :-)
 
 Thanks.

Well, here's the some output of the "Status" tab in the Catalog.

Subtransactions are Disabled

 Subtransactions

  -

Index Status

   * 48205 object are indexed in bobobase_modification_time
   * 48205 object are indexed in calendar_date
   * 48205 object are indexed in calendar_day
   * 48205 object are indexed in call_date
   * 48205 object are indexed in curators
   * 48205 object are indexed in data
   * 48205 object are indexed in id
   * 48205 object are indexed in meta_type
   * 48205 object are indexed in resume_in
   * 48205 object are indexed in status
   * 48205 object are indexed in users_calendar

The only TextIndex is the 'data' index though.  It is the one that gets
hammered.

Let's see...time stats...hmmm

I put a REQUEST.set with the ZopeTime at the top of the search page and at
the bottom after the 'in' tag for the Catalog. 

Search terms are:  los and angeles and C++ and MFC and 310

Subtracting the float of the two times I get 1.85400104523  I'm not sure
what that comes out to, I think it's part of a day though because of
DateTime.

The server stats:

Dual Intel 400mhz Xenon w/ 1MB cache each
LVD RAID 5 7200 RPM disk array
1GB RAM
RedHat Linux 6.1 with some kernel updates...
And the best piece of open source software I know:  Zope 2.2.4 binary
release
 
Hope that helps.


All my best,


Jason Spisak
CIO
__ ___   ____
   / // (_)_/_  __/__ / /  ___  ___  __ _
  / _  / / __/ -_) / / -_) __/ _ \(_-_/ __/ _ \/  ' \
 /_//_/_/_/  \__/_/  \__/\__/_//_/___(_)__/\___/_/_/_/

6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] CatalogAware

2001-01-05 Thread Michael Bernstein

Chris Withers wrote:
 
 Michael Bernstein wrote:
 
  Now I'm wondering how to duplicate the behaviour of Postings
  being contained within Squishdot, but not appearing in the
  'Contents' tab.
 
 that's definitely a 'bad' thing :-(

Why is that bad? A custom object management UI ('Postings'
and 'Moderation' tabs) seems appropriate for Squishdot. I
wouldn't want to manage postings from the standard
management interface.

 Why duplicate anyway? You writing a replacement? ;-)

No, I'm creating two different applications, an image
archive and a book catalog. Both need to handle large
numbers of items. The standard management interface does not
scale to the number of objects involved from a usability
perspective.

Neither of my projects need objects to nest (as squishdot
postings do) so I don't need to duplicate the tree
interface, but instead I'll probably create a batching
interface to allow relatively easy access to all contained
objects.

I'd like to know how to prevent the objects being listed in
the 'Contents' tab, while still allowing other objects (like
DTML methods) to be added there.

Any clues?

Michael Bernstein.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Oleg Broytmann

Hello!

   Can anyone here explain clearly what is the difference between DTML
Methods and DTML Documents regarding acquisition?

   Well, in simple cases I think I understand it. When I call a Method
through the web, it use dynamic (based on current URL) acquisition path. A
Document uses static (based on its position in ZODB) path.

   But what if I want to look a bit deeper? What are acquision paths for a
Method called from a Document, not directly from the web? I beleive when a
Document called from a Method it always uses static acquisition path. But
what about a Method called from a Document? It seems my Methods stopped
using dynamic paths and use static paths, provided by its callee. Right?

   Let's see a running demo. The site http://phd.russ.ru/pcgi/TEST/
constructed as follows:

/TEST - folder
   index_html - standard DTML Document with default content
   standard_html_header - DTML Method
   standard_html_footer - DTML Method
   2 - folder, empty

Both folders /TEST and /TEST/2 have a property "foobar". In /TEST its value
is "First test!", in /TEST/2 - "This is SECOND test." standard_html_header
show the property with dtml-var foobar.

   When I call standard_html_header directly through the web, it acquires
foobar using dynamic acquisition path:

http://phd.russ.ru/pcgi/TEST/standard_html_header
   show foobar from root (/TEST)
http://phd.russ.ru/pcgi/TEST/2/standard_html_header
   show foobar from /TEST/2

But then I call standard_html_header from DTML Document index_html:

http://phd.russ.ru/pcgi/TEST/index_html
   show foobar from root (/TEST); exactly as I expected, no problem
http://phd.russ.ru/pcgi/TEST/2/index_html
   WOW! It show foobar again from root, not from /TEST/2!
standard_html_header acquires using static path provided by index_html!

   Is it normal and intended behaviour? If it is, how can I "solve" my
problem? (I want to acquire different properties in standard_html_header,
but call standard_html_header from different DTML Documents).

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
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] Hookable PUT Creation

2001-01-05 Thread Chris Withers

Tres Seaver wrote:
 
   http://dev.zope.org/Wikis/Proposals/HookablePUTCreation

That gives me a NotFound :-S

cheers,

Chris

___
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 it possible to install the Bug Collector Product in my Zope ???

2001-01-05 Thread Chris Withers

Frederic Quin wrote:
 
 Hi all,
 
 I can't find the bug collector product to install it in my zope. Maybe it's not 
possible... If it is, please tell me where to download it.

http://www.zope.org/Members/klm/TrackerWiki/

cheers,

Chris

___
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 call ancestral method in ZClass method?

2001-01-05 Thread Steve Spicklemire


Hi Dirksen,

   In python you would normally do:

  super_class_object.manage_delete(self)

   but it might be easier/better in the case of a DataSkin 
to use a SkinScript 'WHEN OBJECT DELETED xxx  '.

-steve

 "Dirksen" == Dirksen  [EMAIL PROTECTED] writes:

Dirksen I have a ZClass 'stuff' which is a subclass of
Dirksen DataSkin. 'stuff' overrides 'manage_delete' method, so as
Dirksen to do some extra clean-up jobs. After that, it will call
Dirksen its ancestor's 'manage_delete' method to wipe itself
Dirksen off. In java, you can do this by calling
Dirksen 'super.manage_delete()', but how to do it in zope?

Dirksen Dirksen

Dirksen __ Do You
Dirksen Yahoo!?  Yahoo! Photos - Share your holiday photos
Dirksen online!  http://photos.yahoo.com/

Dirksen ___ Zope
Dirksen maillist - [EMAIL PROTECTED]
Dirksen http://lists.zope.org/mailman/listinfo/zope ** No cross
Dirksen posts or HTML encoding!  ** (Related lists -
Dirksen http://lists.zope.org/mailman/listinfo/zope-announce
Dirksen http://lists.zope.org/mailman/listinfo/zope-dev )


___
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] installing zope on win95

2001-01-05 Thread nando n

where can i download (exact url) binary version
of zope to install it on my win95 system?
for now i've only been able to download python
source code version of zope.
how do i execute dtml files?
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


___
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] Creating a Database connection.

2001-01-05 Thread Darren Carney

Dear Zope,

I am very new to the Zope idea. I like what Zope is trying to do.
But I am trying to set up an external SQL database connection.

I have read the information thats on the Zope website.
It has not made it any clearer about setting up a DA and making the 
connection.

Thanks in advance for any help that you would be able to supply.

King regards

Darren

___
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] Calling a DTML method in a subfolder that uses PARENTS[0]

2001-01-05 Thread Soren Roug

Hello,

I'm trying to call a method inside a folder that uses this common way of
listing its content:

dtml-in "PARENTS[0].objectValues('File')"
dtml-var absolute_urlbr
/dtml-in

Let's call this folder FileLibrary. (It's actually a Z Class subclassed
from ObjectManager)

My problem is when I call the method from the folder above, then PARENTS
is unchanged and the script will try to enumerate the files in the
folder I'm calling from. I've tried several things, e.g.

dtml-with FileLibrary...
dtml-with "_.getitem('FileLibrary')"...

dtml-with FileLibrary
dtml-call "REQUEST.PARENTS.append(_)"...

Nothing works.

How do I get it to work?

___
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] Hookable PUT Creation

2001-01-05 Thread Tres Seaver

On Fri, 5 Jan 2001, Chris Withers wrote:

 Tres Seaver wrote:
  
http://dev.zope.org/Wikis/Proposals/HookablePUTCreation
 
 That gives me a NotFound :-S

Hmm, sure enough.  I wonder why the "DevSite" has to be there
even inside dev.zope.org?  At any rate, the "correct" URL is:

  http://dev.zope.org/Wikis/DevSite/Proposals/HookablePUTCreation

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org


___
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] External Methods

2001-01-05 Thread Marcus Mendes

Phil Harris wrote:
 
 Wouldn't it be better to pass in self?
 
 As in:
 
 def my_method(self,REQUEST=None):
   '''my_method interpreting *REQUEST*.form.'''
   if REQUEST is None:
 REQUEST=self.REQUEST # safety_valve in case you forget to pass in
 REQUEST
   form= REQUEST.form # this is a dictionary containing form
  # variables and associated values
 


Hello,

Ok Sirs, I'm very late in my checking my mailbox ;-) 

I've a question in this code above : How can I get the values of a
dictionary form?
In my Method, I used form.values(), form.Name_Of_Variable_OF_my_form,
but it is not working.

Thanks

Marcus Mendes

___
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] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Stephane Bortzmeyer

On Friday 5 January 2001, at 12 h 26, the keyboard of Oleg Broytmann 
[EMAIL PROTECTED] wrote:

Can anyone here explain clearly what is the difference between DTML
 Methods and DTML Documents regarding acquisition?

Not me but this HOWTO:

http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo

saved my life.



___
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] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Oleg Broytmann

On Fri, 5 Jan 2001, Stephane Bortzmeyer wrote:
 http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo
 saved my life.

   Thanks. I'be read it yesterday. It does not help much because it does
not answer my question:

   If I call http://machine:port/top/middle/AFolder/ADocument (in terms of
this HOWTO), and ADocument calls dtml-var AMethod, what is acquisition
path for AMethod?

   I showed an example, where AMethod do acquisition using static path, and
I think it is a bug. Or, may be, just my misunderstanding...

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


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

2001-01-05 Thread Gross, Chedva

I have an array created using javascript on one web page.  I want to access
that same array (or piece of it) on another page.  How can I go  about doing
this without using forms?

___
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] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Oleg Broytmann

On Fri, 5 Jan 2001, Stephane Bortzmeyer wrote:
  http://phd.russ.ru/pcgi/TEST/2/index_html
 WOW! It show foobar again from root, not from /TEST/2!
  standard_html_header acquires using static path provided by index_html!

 You started acquisition from index_html. Since it has no foobar, it looked
 into its own container, /TEST, then in root.

   Exactly as I wrote - in this situation standard_html_header acquires
using static path provided by index_html :(

 You can but the "problem" in your case, comes from the acquisition of an
 index_html document in a different folder. I suggest to add index_html
 documents in every folder *or* make index_html a method (this is what I
 use).

   There are many Documents on my site, not only index_html. Should I make
them all Methods? Why after this I need Documents at all?

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
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] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Stephane Bortzmeyer

On Friday 5 January 2001, at 12 h 26, the keyboard of Oleg Broytmann 
[EMAIL PROTECTED] wrote:

When I call standard_html_header directly through the web, it acquires
 foobar using dynamic acquisition path:

Actually, if I understand it myself :-) it acquires foobar because a method 
has no poperties, so it looks first in the innermost container, the folder 
TEST or TEST/2.

 But then I call standard_html_header from DTML Document index_html:

In that case, you start the acquisition with the document index_html (reread 
the HOWTO http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo: 
the acquisition can start from a document or a folder, not from a method).

 http://phd.russ.ru/pcgi/TEST/index_html
show foobar from root (/TEST); exactly as I expected, no problem
 http://phd.russ.ru/pcgi/TEST/2/index_html
WOW! It show foobar again from root, not from /TEST/2!
 standard_html_header acquires using static path provided by index_html!

You started acquisition from index_html. Since it has no foobar, it looked 
into its own container, /TEST, then in root.

Is it normal and intended behaviour? If it is, how can I "solve" my
 problem? (I want to acquire different properties in standard_html_header,
 but call standard_html_header from different DTML Documents).

You can but the "problem" in your case, comes from the acquisition of an index_html 
document in a different folder. I suggest to add index_html documents in every folder 
*or* make index_html a method (this is what I use).



___
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] External Methods

2001-01-05 Thread Ryan M. Dolensek

Try...

for k,v in form.items():
  k should contain the key name
  v should contain the value

Otherwise...

value = form['Name_Of_Variable_OF_my_form']

Hope that helps.

Ryan



 Hello,

 Ok Sirs, I'm very late in my checking my mailbox ;-)

 I've a question in this code above : How can I get the values of a
 dictionary form?
 In my Method, I used form.values(), form.Name_Of_Variable_OF_my_form,
 but it is not working.

 Thanks

 Marcus Mendes



___
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] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Stephane Bortzmeyer

On Friday 5 January 2001, at 17 h 58, the keyboard of Oleg Broytmann 
[EMAIL PROTECTED] wrote:

There are many Documents on my site, not only index_html. Should I make
 them all Methods? Why after this I need Documents at all?

Because not all documents are acquired (from an above folder). For index_html, for 
instance, it is common to have a different index_html (and in that case a document) in 
each folder. 




___
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] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Dario Lopez-Kästen

Hello!

I think hade a similar problem. It seems that you can only use methods for
acquisition, not documents.

I had an index_html DOC where I specified the structure of my site. In
index_html I used dtml-var some_doc that and in some_doc I once dtml-var
other_doc.

The idea was that in my subfolers I only needed to have the objects some_doc
and other_doc, and that I would use the structure from the index_html higher
up. This way I could provide "modules" to managers of subfolders, so they
need not to concern themselvs with the proper way of setting up their
index_html.

It didn't work unitl I changed index_html and all other objects from
dtml-docs to dtml-methods. Otherwise I would always end up with the parent
(in my case the root level) documents. I wanted to have DTML-documents in
the firts place, because I noticed that in dtml-methods the dtml-var
title_or_id call has no effect; it does not use the methods title_or_id, it
uses the toplevel (or the calling documents) title_or_id.

Is this a similar situation to yours?

/dario

- Original Message -
From: "Oleg Broytmann" [EMAIL PROTECTED]


There are many Documents on my site, not only index_html. Should I make
 them all Methods? Why after this I need Documents at all?

 Oleg.



___
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: translator / zbabel

2001-01-05 Thread Federico Di Gregorio

Scavenging the mail folder uncovered Olaf Zanger's letter:
 hi there,
 
 i'm searching for a i18n product,
 
 on translator i seam to miss "xmlio".

use attached xmlio.py (put it in $ZOPE_HOME/lib/python/Shared)
you don't have to use the makefile. just untar the tarball into
$ZOPE_HOME. (i use the makefile when i develop to automatically
copy files and to produce the distribution tarball.)

ciao,
federico

-- 
Federico Di Gregorio
MIXAD LIVE Chief of Research  Technology  [EMAIL PROTECTED]
Debian GNU/Linux Developer  Italian Press Contact[EMAIL PROTECTED]
 A short story: I want you. I love you. I'll miss you. -- Me

___
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] How to split a string in a python method?

2001-01-05 Thread Juan Carlos Coruña

Is there any way to split a string in a PythonMethod without passing the
object _.string as an argument?

I have tried to "import string" but Zope generates an ImportError:

ImportError: __import__ not found

I'm using PythonMethod 0.1.7


___
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] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Rik Hoekstra

 On Fri, 5 Jan 2001, Stephane Bortzmeyer wrote:
  http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo
  saved my life.

Thanks. I'be read it yesterday. It does not help much because it does
 not answer my question:

If I call http://machine:port/top/middle/AFolder/ADocument (in terms of
 this HOWTO), and ADocument calls dtml-var AMethod, what is acquisition
 path for AMethod?

Oleg,

what might come handy in your case is the howto "Shane's Aquisition
Understander" at

 http://www.zope.org/Members/chrisw/showaq

it'll help you visualize the acquisition path from your document.

You may also want to look at my howto Changing Contexts in Zope
http://www.zope.org/Members/Hoekstra/ChangingZopeContexts

Or Jim's acquisition algebra from a Python point of view of these matters:

http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/index.html


hth

Rik


___
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 split a string in a python method?

2001-01-05 Thread Jim Washington

Yes. Just use it. string is already in the Python Methods namespace.

EXAMPLE:

Python Method 

Parameter list: self

Python function body:

testsentence = 'I want this sentence to be converted into a list of its
component words.'
thelist = string.split(testsentence)
for aword in thelist:
  print aword
return printed

-- Jim Washington

Juan Carlos Coruña wrote:
 
 Is there any way to split a string in a PythonMethod without passing the
 object _.string as an argument?
 
 I have tried to "import string" but Zope generates an ImportError:
 
 ImportError: __import__ not found
 
 I'm using PythonMethod 0.1.7

___
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] images bi XML-RPC

2001-01-05 Thread Nuno Goncalves

Hi there !
I'm trying to add imagens with a perl XML-RPC script
Does anyone knows how to do that ??
I'm tring something like this
but Zope adds a conten-type like text/x-unknown-content-type
and i wanted a image content-type !

here's the code :
-
#!/usr/bin/perl

use Frontier::Client;

$c = new
Frontier::Client(url="http://localhost:/name/Template/images");

$arr_teste[0]='primeiro';
$arr_teste[1]='segundo';

$arr = $c-call('manage_addImage',('id-img_pl','banner_bck.gif'));



thanks !!
Nuno


___
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] Z2 Log question

2001-01-05 Thread Stuart Foster

I was looking at my Z2 log and notice an entry that repeats itself over 
and over and was wondering if anyone could tell me how to trace it down.

The message is

 [20/Nov/2000:13:00:11 -0700] "HEAD /opnix/portal HTTP/1.0" 401 1906 "" 
"" 
 [20/Nov/2000:13:00:17 -0700] "HEAD /opnix/portal HTTP/1.0" 401 1906 "" 
"" 

and as you can see it happens about every 5-6 seconds and there are many 
entries for it. 

Where would I start to back track this. 
We are running Zope behind Apache using proxy pass.

Any thoughts.

TIA Stuart 

___
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] Pb. of Inheritance lost between packages. (after too manyexport/imports ?)export/imports ?)

2001-01-05 Thread Thierry Nabeth

Hello,

Here is this problem again that has reappeared  
I already posted about this problem some months ago,
but did not manage to make it work, and I had to rewrite
all the class from scratch.
(of course, I did a lot of cut and past, but you
have to do a lot of manual work recreating the
Properties, and you loose all the instance you had created).

Here is my problem: 

I have 3 Products PA PB PC
and I have the 3 classes A, B and C defined in each of the
different Products.

PA has class A
PB has class B
PC has class C.

Besides, the inheritence tree is the following:

A -- B  -- C.
(A inherits from B, etc.)

The problem is that after some time (after many export and re-import of
Products),
the inheritance does not work anymore between the package.

For instance if I define a new method in class A,
it is invisible from class B.
Or if I redefine a method in a Class A, the class B still 
see the old method of class B.

Note that at the beginning, when you create those three packages
and classes, everything seems to work fine.
(I have done the test).

Did someone already encountered a similar problems ?
Do someone has an idea what could be wrong, and has some idea about
how to fix the problem ? 
(my guess is that something wrong happens after too many
export and imports which confuses python).

Thierry Nabeth
Research Fellow,
INSEAD CALT (The Centre for Advanced Learning Technologies)
http://www.insead.edu/CALT/
[EMAIL PROTECTED]

___
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] SQL editing

2001-01-05 Thread Mohan Baro

You can use the ZNolk SQL wizard also available from zope.org

Mohan


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Alex
Burton
Sent: Friday, January 05, 2001 12:47 PM
To: [EMAIL PROTECTED]
Subject: [Zope] SQL "editing"



  Hello All,

  I'm quite happy, got MySQL + the necessary adapters running in no 
time. Imported tab-delimited text and enjoying Zsearches... Zope 
kicks ass!

  Now, i'm wondering if there's anyone who've done some work as to 
permit easy editing of records in SQL tables? What i have in kind is 
something like:

  - do a search - a list of matches come up;
  - select a match - a form comes up filled with the data, and a 
"submit" button
  - press submit - SQL gets altered

  A bit like the "edit this page" philosophy, but for SQL records...

  Thanks!

Alex.
 

___
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 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] zope on Win95

2001-01-05 Thread nando n


where can i download (exact url) binary version
of zope to install it on my win95 system?
for now i've only been able to download python
source code version of zope.
how do i execute dtml files?

i just want to know that. thanks


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


___
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] SQL editing

2001-01-05 Thread Stuart Foster

We use the Znolk wizard. It's good for creating the initial entry, edit, 
list forms as well as the queries to add, edit and delete.

 Original Message 

On 1/5/01, 10:47:14 AM, Alex Burton [EMAIL PROTECTED] wrote regarding 
[Zope] SQL "editing":


   Hello All,

   I'm quite happy, got MySQL + the necessary adapters running in no
 time. Imported tab-delimited text and enjoying Zsearches... Zope
 kicks ass!

   Now, i'm wondering if there's anyone who've done some work as to
 permit easy editing of records in SQL tables? What i have in kind is
 something like:

   - do a search - a list of matches come up;
   - select a match - a form comes up filled with the data, and a
 "submit" button
   - press submit - SQL gets altered

   A bit like the "edit this page" philosophy, but for SQL records...

   Thanks!

   Alex.


 ___
 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 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] manage_editProperties Question

2001-01-05 Thread Ronald L. Roeber

I have looked through the Zope book and other documentation, but still
am unable to properly allow others to change properties in a product
with a custom built form.

Case in point, a product with a Property called

contact
which is a string

The product changing method  I am trying to make work contains the
following

def editProductInfo(self, newcontact):
 ...
 self.manage_editProperties(REQUEST=None,contact=newcontact)
 ...

Which is not correct obiously since it generates the following error:

Error Type: TypeError
Error Value: unexpected keyword argument: contact

--

TIA for helping someone so slow as myself...

Ron Roeber
University of Nebraska



___
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] External Methods

2001-01-05 Thread Marcus Mendes

"Ryan M. Dolensek" wrote:
 
 Try...
 
 for k,v in form.items():
   k should contain the key name
   v should contain the value
 
 Otherwise...
 
 value = form['Name_Of_Variable_OF_my_form']
 
 Hope that helps.
 
 Ryan
 
  Hello,
 
  Ok Sirs, I'm very late in my checking my mailbox ;-)
 
  I've a question in this code above : How can I get the values of a
  dictionary form?
  In my Method, I used form.values(), form.Name_Of_Variable_OF_my_form,
  but it is not working.
 
  Thanks
 
  Marcus Mendes
 


Hello again,

I've got the follow content : Key Error SERVER_NAME, that is, 
Look at my code, please:



def log_info(REQUEST):
if REQUEST is None:
   REQUEST=self.REQUEST 
form= REQUEST.form 

try: log=open('/home/mvmendes/testes_zope/log.txt', 'a')
except IOError:
  log=open('/home/mvmendes/testes_zope/log.txt', 'w')
server = form['SERVER_NAME']
connection = form['CONNECTION_TYPE']
line='Server: %s, Connection type : %s\n' % ( server, connection )
log.write(line)
log.close()
return


I calling my external method using : dtml-call "grava_arq(REQUEST)"
I also tried with "for" command but isn't working.

Can you help me?

Thanks in advance.

Marcus Mendes

___
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 redirecting manage_workspace?!

2001-01-05 Thread Dieter Maurer

Edmund Goppelt writes:
  ... manage_workspace redirects ...
It does this, if the current permissions does not allow
the use of any of the available tabs.

Are you sure, you set the permission mappings correctly?


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] UserFolder Alternate Login

2001-01-05 Thread dlee

Zopatistas,

I need functionality that none of the UserManagers seem to address. I 
need to allow a user to elect to log in (and set 
AUTHENTICATED_USER) as opposed to have them access a restricted 
resource to trigger cookie authentication. 

I am essentially limited to GUF because it's the only thing I can install 
on my provider's system (I can't compile the LoginManager). Is there 
a way to allow the user to login at will, and still get 
AUTHENTICATED_USER set?

There are no "restricted" parts of the site I am building (except for the 
management interface) however, I would like to generate dynamic 
menus (using hasrole) which allow users in specific groups (authors, 
members, etc) to have additional menu options.

I'm hoping there is a way to do this...

Thanks in advance,
Darin Lee



___
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] UserFolder Alternate Login

2001-01-05 Thread Oliver Bleutgen

 Zopatistas,

 I need functionality that none of the UserManagers seem to address. I
 need to allow a user to elect to log in (and set
 AUTHENTICATED_USER) as opposed to have them access a restricted
 resource to trigger cookie authentication.


You mean you want to use AUTHENTICATED_USER like a cookie, i.e.
loggin in and every password authenticates?
Using basic auth it might be a nice way to get cookie functionality
without using cookies.
You could write a custum method which triggers authentication and
rewrite the method of GUF to always return 1. If someone wants
to "log in", he could click on a link to this method. 
Maybe

dtml-unless "AUTHENTICATED_USER.getUserName()=='Anonymous User'"
dtml-raise type="Unauthorized"
Logout!!
/dtml-raise
/dtml-unless
You are now logged out!

could be a starting  point. If it is contained in standard_html_header it
would force everyone to choose a user name, and in conjuction with
the GUF-hack mentioned above he would always be logged in - 
well unless he decides to call himself "Anonymous User" (luck that
this isn't coward ;).

If you want to use cookies anyways, take a look at session manager or
code it yourself and don't use hasrole.

cheers,
oliver





___
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] SELECT COUNT(*) ZSQL method - displaying results?

2001-01-05 Thread Lee

Hi,

I am having difficulty displaying the results from an SQL query:

SELECT COUNT(*)
FROM REGISTRY
WHERE dtml-sqltest classcode op=eq type="float"

When I call the ZSQL method from my DTML method and try and display the
result (using dtml-var count) I get a rather horid, "This resource may
be trying to reference a nonexistent object or variable count" error.

My only thought is that because 'count' isn't actually a proper variable
(i.e. a column name) it is handled differently.

Can anyone see my error / offer advice?

Thanks very much in advance.

- Best regards,
Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]
http://www.footkick.co.uk/lee




___
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] SELECT COUNT(*) ZSQL method - displaying results?

2001-01-05 Thread Alex Reid

Lee,

Have you tried SELECT COUNT(*) AS myCountField

and then using dtml-var myCountField

May work.

Alex
[EMAIL PROTECTED]

- Original Message - 
From: Lee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 05, 2001 10:12 PM
Subject: [Zope] SELECT COUNT(*) ZSQL method - displaying results?


 Hi,
 
 I am having difficulty displaying the results from an SQL query:
 
 SELECT COUNT(*)
 FROM REGISTRY
 WHERE dtml-sqltest classcode op=eq type="float"
 
 When I call the ZSQL method from my DTML method and try and display the
 result (using dtml-var count) I get a rather horid, "This resource may
 be trying to reference a nonexistent object or variable count" error.
 
 My only thought is that because 'count' isn't actually a proper variable
 (i.e. a column name) it is handled differently.
 
 Can anyone see my error / offer advice?
 
 Thanks very much in advance.
 
 - Best regards,
 Lee
 
 --
 Lee Reilly
 mailto:[EMAIL PROTECTED]
 http://www.footkick.co.uk/lee
 
 
 
 
 ___
 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 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] emacs and zope

2001-01-05 Thread Mehmet Yousouf

Hi,
I am trying to get xemacs to use dtml tags (zope), I downloaded .dtd,
.ent, .el files and can get it to go into "dtml-mode", but I can't get any
of the tags to appear in the menus. I put the files in ~/Emacs/ (this is
referenced in my .emacs file) it seems to find my public file, and the .el
file as I do get into "dtml-mode". I tried putting the .dtd and .ent files
in /usr/lib/xemacs/xemacs-packages/etc/psgml but still no luck.
What am I doing wrong?

Regards, Mehmet

___
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] External Methods

2001-01-05 Thread Dieter Maurer

Marcus Mendes writes:
  I've got the follow content : Key Error SERVER_NAME, that is, 
  
  form= REQUEST.form 
  
  server = form['SERVER_NAME']
The error report is unambiguous.

Your "REQUEST.form" does not contain "SERVER_NAME".
You may try "REQUEST['SERVER_NAME']".

Remember:
   "REQUEST.form" contains just the form variable or
   parameter definitions in the URL's query string.

   "REQUEST" contains other information in
   "REQUEST.cookies", "REQUEST.other" and
   "REQUEST.environ", all of which are
   accessible through "REQUEST[...]".

   "SERVER_NAME" is a CGI variable, defined in
   "REQUEST.environ".


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Dieter Maurer

Oleg Broytmann writes:
 Can anyone here explain clearly what is the difference between DTML
  Methods and DTML Documents regarding acquisition?
I think, I gave a good answer to a similar question
in zope-dev recently -- searchable list archive.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Calling a DTML method in a subfolder that uses PARENTS[0]

2001-01-05 Thread Dieter Maurer

Soren Roug writes:
  Hello,
  
  I'm trying to call a method inside a folder that uses this common way of
  listing its content:
  
  dtml-in "PARENTS[0].objectValues('File')"
  dtml-var absolute_urlbr
  /dtml-in
  
  Let's call this folder FileLibrary. (It's actually a Z Class subclassed
  from ObjectManager)
  
  My problem is when I call the method from the folder above, then PARENTS
  is unchanged and the script will try to enumerate the files in the
  folder I'm calling from. I've tried several things, e.g.
  
  ...
  dtml-with FileLibrary
  dtml-call "REQUEST.PARENTS.append(_)"...

   dtml-call "REQUEST.PARENTS.append(FileLibrary)"

would do it, but would be *VERY* hacky code.

Instead:
   Give your method a parameter, say "sourcefolder".
   In your method:

  dtml_in "(_.has_key('sourcefolder') and sourcefolder or 
PARENT[0]).objectValues('File')"
   
   (You may want to factor the "(_.has_keyPARENT[0])" out.)

   Then, when your method should use a special folder, use:

 dtml-let sourcefolder=whatever
   dtml-var FileLibrary
 /dtml-let


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] newbie q -- 2.3.0a1, file object precondition

2001-01-05 Thread John Gerard Malecki

hi,

i'm very new to zope and am trying to get familiar with the variety of
mechanisms i can use.  zope is indeed a very nice package!

i am starting with version 2.3.0a1 (because it matches the book).
i've not yet had success getting preconditions to work with file
objects.  i hope i'm not doing anything too bone-headed.

here is what i have: in a folder i have file objects T and U.  T has
the precondition 'preco(1)' and U has the precondition 'preco(0)'.  in
the same folder (or above, it doesn't matter) i have the python script
preco with the contents

if r == 0:
raise "preco"
else:
return r

when i the manager or type in the URL directly i can view/download
both T and U.  i was hoping only T would be "visible".  

i'm not sure how to debug something like this.  if you can tell me how
i can debug this on my own that would be best.

-cheers


___
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] Z2 Log question

2001-01-05 Thread Dieter Maurer

Stuart Foster writes:
  I was looking at my Z2 log and notice an entry that repeats itself over 
  and over and was wondering if anyone could tell me how to trace it down.
  
  The message is
  
   [20/Nov/2000:13:00:11 -0700] "HEAD /opnix/portal HTTP/1.0" 401 1906 "" 
  "" 
   [20/Nov/2000:13:00:17 -0700] "HEAD /opnix/portal HTTP/1.0" 401 1906 "" 
  "" 
  
  and as you can see it happens about every 5-6 seconds and there are many 
  entries for it. 
  
  Where would I start to back track this. 
  We are running Zope behind Apache using proxy pass.
Someone repeats the HEAD HTTP request.

Look at the Apache log. You should see there similar requests.
The first component in each log line is the the hostname or
its internet address from where the request came (may be a proxy).
Maybe, this information gives you a hint about the
requests origin.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] UserFolder Alternate Login

2001-01-05 Thread Bill Anderson

[EMAIL PROTECTED] wrote:

 Zopatistas,
 
 I need functionality that none of the UserManagers seem to address. I 
 need to allow a user to elect to log in (and set 
 AUTHENTICATED_USER) as opposed to have them access a restricted 
 resource to trigger cookie authentication. 

*Ahem* Actually, Membership *does* provide login/logout forms that do 
not require accessing a private section of a site.

 I am essentially limited to GUF because it's the only thing I can install 
 on my provider's system (I can't compile the LoginManager). Is there 
 a way to allow the user to login at will, and still get 
 AUTHENTICATED_USER set?

Ok, that's different.

Dead Simple way(tm):
Make page that *does* have a need for login. Put a link to it, call the 
link "login".
When they access the page, they wil not have permission to see it, and 
will thus be given a request for authentication, the logging them in part.

If you put this method in the root of your site, say calling it 'login' 
for an id, then you could put a link in your menuing system that calls 
it with an href of "login".

Then, in your 'login' method/page, you set it up to redirect back to the 
page they were on when they clicked the login link. There are several 
examples of this part around; search the Mailing List(s) archives.

Until such time as they do log in, the user will be 'Anonymous'. As 
such, you would make the appearance of the login link dependant on the 
AUTHENTICAT_USER having the Role 'Anonymous'.

Without using a cookie login system, you _must_ access a restricted 
resource, even if it just a redirect. That is how basic Authentication 
works. If you are using cookie login, there are HowTos on that around as 
well. You just show the user the login page.



Bill Anderson



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

2001-01-05 Thread Jason Cunliffe

Nando

This should be what you are looking for:

http://www.zope.org/Products/Zope/2.2.4/Zope-2.2.4-win32-x86.exe/view

I have been running Zope on Win95 and Win98 on laptops for learning,
development and off-line site demsontration very happily for a long time.

You don't 'execute dtml files' ... Zope uses them for many purposes as
server-side scripts which are rendered and returned as ordinary HTML in the
client web browser. DTML files can combine Zope-specific syntax, Python
sytnax, Javascript stuff, CSS etc.

Learning how to design for Zope, factoring the application, when and where
to use the many tools and techniques - it takes time and practice to do
well. But it is possible to get simple but impressive results very fast.

DTML can be called within other DTML, Python or directly in a URL from a web
browser.
For example: http://www.myzopesite.com/invent
'invent' might be one of many things including:
- a DTML Document or Method
- some other script or method typically programmed in Python and accessible
to Zope
- a Zope other object in the ZODB [Zope Object Data Base]
- a Zope 'folder' which appears as a hierarchical file system tree of
containers for Zope applications, projects and data


1. See the online version of the new Zope Book
http://www.zope.org/Members/michel/ZB/
This will be published very soon by O'Reilly

2. Run through the tutuorials which are included when you download Zope.

3. See many more guides, how-to's etc are linked from
http://www.zope.org/Documentation

Good luck!

- Jason
___
Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']

- Original Message -
From: nando n [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 05, 2001 2:16 PM
Subject: [Zope] zope on Win95



 where can i download (exact url) binary version
 of zope to install it on my win95 system?
 for now i've only been able to download python
 source code version of zope.
 how do i execute dtml files?

 i just want to know that. thanks



___
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] PoPy Problems

2001-01-05 Thread J. Atwood

Linux 6.2, Zope 2.2.4, PostgreSQL 7.0.3, PoPy 1.4.1, ZPoPyDA 0.7.0

I installed the PoPy module and at the Python command line can 
import PoPy' with no problems. I then untarred the ZPoPyDA and 
restarted Zope at which point I get (in the Zope management screen).

ZPoPyDA Import Traceback

Traceback (innermost last):
   File /usr/local/zope/lib/python/OFS/Application.py, line 397, in 
import_products
 product=__import__(pname, global_dict, global_dict, silly)
   File /usr/local/zope/lib/python/Products/ZPoPyDA/__init__.py, line 32, in ?
 import sys, os, Globals, DA
   File /usr/local/zope/lib/python/Products/ZPoPyDA/DA.py, line 35, in ?
 from PoPy_db import DB
   File /usr/local/zope/lib/python/Products/ZPoPyDA/PoPy_db.py, line 35, in ?
 raise The PoPy module is not installed
The PoPy module is not installed

There is really no more instructions on the site, in the INSTALL or README.

If have installed and worked with ZPygreSQL before but was under the 
impression that it did not work with the newer versions of Zope and 
Postgresql.

Thanks,
J

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