Re: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexingrevisited)

2001-06-19 Thread Rik Hoekstra

 
 Rik Hoekstra writes:
   This raises the question how dependent the splitter on the paticularities of the
   document source - I do not really see how different splitters could be useful
   for one single document. This is perhaps less obvious than it appears, as you
   may want to use different splitters for documents in different languages. Taken
   as a whole I would say choosing a splitter would be a decision that had to be
   taken at indexing time anyway. But perhaps it's just my imagination that is

 
 Of couse, the search must follow the same splitting rules
 than the indexing did. Changing the rules (the splitter
 or its configuration) after indexing will make the index
 inconsistent.
 

I agree; in fact I think we're saying the same. What is more interesting, is how
(less than when) you decide to use which splitter. With heterogeneous documents
I'd think it would be difficult to decide automagically...

Rik

___
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: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexingrevisited)

2001-06-18 Thread Rik Hoekstra



Chris McDonough wrote:
 
 It just occurred to me that depending on the splitter to do
 positions makes it impossible to alter the splitter without
 reindexing the whole text index... but I think this is a
 reasonable tradeoff.  Other opinions welcome.
 

This raises the question how dependent the splitter on the paticularities of the
document source - I do not really see how different splitters could be useful
for one single document. This is perhaps less obvious than it appears, as you
may want to use different splitters for documents in different languages. Taken
as a whole I would say choosing a splitter would be a decision that had to be
taken at indexing time anyway. But perhaps it's just my imagination that is
lacking. 

There is a much greater dependence on the lexicon here. And indeed several
different lexicons could be applied to a set of documents depending of what is
wanted. 

my 2 cents

Rik

___
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: PossitionIndex (was: Re: [Zope-dev] ZCatalog phrase indexingrevisited)

2001-06-18 Thread Rik Hoekstra

 
  Once you're satisfied with the implementation, would you be willing
  submit the module to the collector?
 
 Do you think you (or someone else for that matter) could have a look at
 [1] the method that returns the position in the document - positionInDoc()
 - to how that could be made to run much faster?  Maybe it is how it
 used...  It is too slow to be very useful when indexing large amounts of
 data.
 
 Anyway, I suck at making Python fast (or using it the right way, which
 ever I've fallen pray for this time ;-), and any hints would be greatly
 appretiated.
 
 I've been indexing and searching a lot this weekend, and bar that problem
 with the indexing-speed it seems ok and I have no issues submitting it to
 the Collector.
 
Doing something similar (in fact what I needed was citations of word usage) I
took a two step approach, with the idea that most of the actual returning of
results would have to be done on a much smaller subset of documents than if
you'd have to index all documents with word indexes and positions.

I use a normal textindex for querying. Then if a document is returned by the
query I start processing the documents. This requires parsing the query in a
slightly different way (throw out the NOTs). The two step approach has the
advantage that you can postpone processing actual documents until you return the
results for the specific documents. 

Using your positionInDoc will require a _lot_ of processing (why does it use
string.split btw and not Splitter?; why split on   and not on
string.whitespace?). I have used string.find for finding word positions, which
is probably faster than looping a list of words. BTW, I'd rather use Splitter,
but word positions appeared not to be reliable (bug, or something I didn't
understand; anyhow, string.find works for me and is fast)

def splitit(txt, word):
postions = []
start = 0
while 1:
  res = string.find(txt, word, start)
  if res is -1:
  break
  else:
  start = res+1
  postions.append(res)
return postions


sidenotePerhaps using re would perhaps also be an option, but allowing regular
expressions will complicate searching a lot, so I use globbing lexicon for
expanding and then do the matching on the expanded items (if necessary - not if
using [wordpart]*)/sidenote

Advantages of using this approach:
- it's faster. 
- it splits up the query processing part in different subparts which also
contributes to speeding things up. 
- it's also more flexible, as you can divide searching and parsing over
different webrequests, and even make them dependend on the number of results.
For example: why return text fragments from all documents if your users will not
be able to see all the results anyway. Or why return all fragments containing
word combinations from one single document while returning a few occurrences
from different documents is more useful for your users. Note that this will
mainly affect returning text fragments, which may or may not be useful.

There's also a couple of disadvantages (as I see them , but there may be more):
- it only works with exact word positions and not numbers in a text. The within
two words approach may be remedied by using string.split on substrings however
if really needed. Depending on you purposes an even rougher approach is by
taking some default length for words (this is a bit faster). These are not very
elegant solutions, though.
- because of an approach that is not so coupled with (Z)Catalog, integration
strategies are less obvious (at least for me)
- the positionIndex might be used for further processing as is, in my approach
this is less obvious.


another 2 cents

Rik

___
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] Deleting objects by the users

2001-03-22 Thread Rik Hoekstra

one small correction: 

the line:
 dtml-call expr="manage_delObjects(getId())"
should read:
 dtml-call expr="manage_delObjects([getId(),])"

as the manage_delObjects takes a list as argument

hth

Rik


___
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] Object DB versus Relational DB

2001-01-22 Thread Rik Hoekstra



Tom Deprez wrote:
 
 Hi,
 
 Can somebody provide me informational links of documents which present the
 benefits and non-benefits of both DB? eg. When to use one and when not to
 use one?
 
 Thanks,
 Tom.

A starting point is http://www.zope.org/Members/anthony/sql_vs_ZODB

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] zope2.3.0b1 and userfolders

2001-01-17 Thread Rik Hoekstra



Chris McDonough wrote:
 
  sorry for the false alarm.
  at least i know what inituser and emergency users are now :)
 
 It's ok, I don't know exactly how it all works either.  :-)
 

Hm, coming from a DC guy this is a reply that is at once disconcerting
("if _you_ don't understand it, how would we") and reassuring  ("see it
can't be simple, even at DC itself not everyone understands") it seems
that it would be useful if this is explained _very_ clearly at a _very_
visible place...

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] DTML-dtml-in dtml-call

2001-01-16 Thread Rik Hoekstra



 Angietel wrote:
 
 
 Is dtml-call REQUEST['sqlSearchcust3'] equal to dtml-in
 sqlSearchcust3

No, if only of a syntax error in the dtml-call: dtml-call
REQUEST['sqlSearchcust3'] should be dtml-call
expr="REQUEST['sqlSearchcust3']"

Now in this case they _may_ be equal, but only if sqlSearchcust3 lives
in the REQUEST object. It may (and judging by the name probably will)
also live in the object database. This is available from the _ 
namespace, which also includes REQUEST, but not from REQUEST.

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] 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] Zope Projects in NL/Europe?

2001-01-03 Thread Rik Hoekstra

(Writing from the Netherlands)


 Just wondering: are there any Zope projects are available in the
 Netherlands/Benelux/Europe? We did one last year but they seem hard to
 find. Are there commercial projects available or is Zope mostly used on
 internal projects? Is there any demand for Zope expertise around here?

From the (spontaneous) requests I have had over the last year about Zope
expertise, I can assure you that there is plenty of demand for Zope
expertise. The problem is mainly that it is harder to find (commercial)
expertise than to have projects available. Zope not (yet) being such a
widespread Web developing alternative, needs are less visible. We are using
Zope in our institution and there is too much work for me to handle, but I
have had a hard time finding developers who can help me out. I'm sure this
applies to more institutions and companies in the Netherlands (and Belgium
for that matter).

And, btw, not to be nitpicking, but how would people know you have Zope
expertise? Is it in your company profile, are you on the Zope service
provider page, have you offered your services somewhere visible.

The second point is of course that you could also prove Zope to be a viable
alternative over other web developing tasks, by just doing projects in Zope.
Or are all you customers asking for applications in specific technologies
rather than solutions with the highest quality/for the best price/in the
shortest time possible?



 Reason I'm asking is that I'd love to continue working with Zope, but
 it's hard to justify in a company focused on Microsoft and Oracle,
 especially if there is no money to be made. I can learn Perl on company
 time and Linux is our internet server OS of choice, but JSP/Java and
 .NET (the latter is not that bad, uses SOAP/XML-RPC) is next if we don't
 find a use for our Zope expertise.


I'd say: just do it and make yourself heard. You might be surprised.


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] objectValues Question

2001-01-03 Thread Rik Hoekstra


I'm new to Zope and while 'playing' around I wondered about the following:

I've created a DTML method (called MyListFiles) that lists the 'File'
objects contained in a folder:
snip
Now when I create a DTML document and call this method like this:

dtml-var MyListFiles

it produces no output.


Because DTML Documents are object of their own and DTML Methods are not.
THis means that if you are trying to get the 'objectValues' from the DTML
Method it will get them from the containing object, a Folder. If you try to
get them from a DTML Document, it will not return anything, as the DTML
Document holds no other objects. The solutions is to make the DTML Method
call its parent's (=containing object) objectValues. For example (untested):

dtml-with expr="PARENT[0]"
dtml-var MyListFiles
/dtml-with

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] More on DB Transactions

2000-12-13 Thread Rik Hoekstra



 Paolo Quaglia wrote:
 
 Reading the [EMAIL PROTECTED] archive I found one message with an
 interesting sentence:
 
 [Message]
  I am currently considering and evaluating Zope as one of the options
 we have
  to build a really large, completely databasedriven "enterprise
 scale"
  web-platform. I am a bit worried about this "maximum of 7 threads
 per db
 
 This isn't a maximum.  It's just the default.  It's easy to increase
 the
 number of connections.
 [/Message]
 
 
 Where is this Default and How can I increase this counter??
 Thanks very much in advance
 

AFAIK the ZODBC adapter is still single threaded. See
http://www.zope.org/Members/petrilli/DARoadmap for more information,
though I'm not certain wether this page is still up to date. There are
rumours that for SQL Server you could use the mxODBC adapter, though I
know nothing more of it. Recently there were posts on this list about
using the ZSybase Adapter for SQL Server they're probably thread safe as
well (?). 
Do a search in the archives for more info

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] HTML formatting from a text field

2000-12-13 Thread Rik Hoekstra



Lee Hunter wrote:
 
 Hi Ausum,
 
 Do you mean a text field that shows a row of formatting buttons at the top
 for 'bold', 'italic' 'add link' etc.
 
 There is an ActiveX control that is built in to IE Explorer 5.x - you just
 have to call it from your page.
 
 Here's the information from Microsoft:
 
 http://msdn.microsoft.com/workshop/author/dhtml/edit/ref/cncpt.asp
 
 If you get it working with Zope (which shouldn't be a problem) let us know.
 


There was a start at a product doing this (called ZIE) by Johan Carlsson
, but it looks like it was aborted quite some time ago. Dont know about
its status. You could try how far it would get you, tho
see:
http://www.zope.org/Members/johanc/ZIE

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] turning off inheritance

2000-12-13 Thread Rik Hoekstra



"Kyler B. Laird" wrote:
 
 I am working on generating a directory from Zope
 objects.  There is a folder full of units (other
 folders).  These units contain people (more
 folders).
 
 Units and people both have contact information
 stored in their properties.  How do I detect if a
 person has, for example, 'contact_email' set?
 
 I've tried
 dtml-if "_.hasattr(this(), 'contact_email')"
 It succeeds if the person doesn't have
 contact_email set but its unit does.  I've also
 tried variations of dtml-with ... only, with no
 success.
 
 Any pointers?  Where could I have found the
 answer to this on my own?
 

I don't claim to know the complete answer, but one approach could be to
do a comparison something like:

(warning code untested):

 dtml-if "_.hasattr(this(), 'contact_email') and contact_email
!= PARENT[0].contact_email"

another approach is to set contact_email by default and test for
emptiness 



dtml-if "contact_email==''"
dtml-let contact_email="PARENTS[0].contact_email"


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

2000-12-08 Thread Rik Hoekstra



Cees de Groot wrote:
 
 Chris Withers [EMAIL PROTECTED] said:
 ...I disagree, ZPatterns only major flaw is that its totally immersed in
 its own jargon which very few people understand :-(
 
 That said, my impression is that if you can wade through the b/s, it's
 more than worth the effort...
 
 Hmm, maybe it's the time for a translate-zPatterns-to-english effort?
 
 --

In fact, IMHO the problem is not so much a translation (of concepts) to
English, because there are a few of those. 

See pje's own DropZone Example
http://www.zope.org//Members/pje/Wikis/ZPatterns/DropZoneExample

and Shane's more basic explanation of what is what
http://www.zope.org//Members/pje/Wikis/ZPatterns/RacksAndSpecialistsSimplified

The basic problem as I experience it is not so much the jargon, because
you get used to it. I'll add some more specific questions where my
understanding gets muddled to illustrate this

Where _I_ get stuck is:
1) How do Racks (and their associates) relate to normal propertysheets
and how to attributes. What is the relation to objects? 
2) What do I add to a Rack and what to a Specialist to get a) a property
b) a propertysheet c) an object
3) How do I switch from one implementation to another (for example from
persistent storage to non-persistent storage) and what parts do I have
to update
4) if I add a SkinScript, what does it really do? How does it relate to
my Rack, and how to the Specialist? How can I use it and where do I use
it - in the Rack or in the Specialist, or do they both have their own
domain?
5) How do I talk to a Specialists? What will it say back? For example,
if I have a 'virtual object' (let's say a person that gets its
properties from ad RDB and is accessed by its name), should I be able to
access it by direct URL traversal blabla/WhateverSpecialist/Name or do
I add a querystring blabla/WhateverSpecialist?name=Name

There should just be some annotated step by step guides. I'd like to add
some, but i first have to find out how ;-(

my 2 cents

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-dev] case insensitive sorts

2000-12-06 Thread Rik Hoekstra



 Andy McKay wrote:

  Minor nit and patch: I've found that really for me what users want to
see is
  a case insensitive sort of objects, not the current python case
sensitive
  sort. So that the order of objects from dtml-in and tree is a, A, b, B
as
  apposed to A, B, a, b.
 
  Anyway Ive patched dtml-in and dtml-tree to do this sort on a
ignore_case
  tag. Is this useful to anyone else? And Ive thought of patching my Zope
so
  this is the default behaviour what does anyone else think. The next
  thing to patch is ZCatalog...


 The way I approached this was to have a ZPatterns attribute provider, or
 a method, that provides a modified version of the value I want to sort on.

 For example, I have a load of documents and folders with titles like

   Big Folder

   brown document

   "Berries for Cooking" list

 I wanted to present these sorted by non-case-sensitive first letter or
 number. So, I made a method "title_for_sorting" that stripped off any
 punctuation at the start, and returned the first 20 characters in all
 lower case.  In this case, as it was a ZPatterns application, the method
 was presented as an attribute of the object using some skin-script. I
 used this attribute as a field-index in my SiteIndex ZCatalog.

 The reason I mention this is that sometimes case-insensitivity is not
 enough for sensible sorting. In this case, I had to strip out
 punctuation too.

Hm, reading this... just a loose comment.
In light of the awkward search interface of ZCatalogs, would it be a good
idea to make a search interface for ZCatalog ZPatterns based? This would add
the possibility to make it configurable wrt case sensitivity, and to do nice
things with ANDing and ORing different kinds of indexes.
The only thing I can't judge whether it would be possible to make this
generic enough.

for-what-it's-worth

Rik


___
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] dtml syntax problem

2000-12-06 Thread Rik Hoekstra



Francois-regis Chalaoux wrote:
 
 How to render this code ??
 

change 
4 dtml-with
"_.namespace(foo=_.whrandom.choice(objectValues(['toto'])).id)"

to

4 dtml-with
"_.namespace(foo=_.whrandom.choice(objectValues(['toto'])).id)"

? 

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] [ot] python book

2000-12-05 Thread Rik Hoekstra



 What I'm still missing is something like the perl cookbook but for Python
:(

I don't know the perl cookbook, but the eff-bot guide to the Python library
has some 300 scripts in it. You can get it from fatbrain.com. It is in pdf
version only (or at least a
print-it-yourself-with-some-fancy-epublishing-wrapping-by-fatbrain-version)

URL:
http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=EB00019352vm=

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] Zope with Microsoft Access

2000-11-24 Thread Rik Hoekstra


 Hi, this is my first posting to the list, and about my 4th day working
with
 Zope.  I have a bit of a problem.  All my code so far is working well.
Just
 the following section is defying my attempts to make it run.  What it does
 is to update a field in the database (to allow employees to quickly update
 their hours in the hours tracking thing I'm creating)  it's complex since
 all the employees hours will be listed on one page and will be instantly
 updatable (with a select box that allows the choice of +/- (name is
 modifydtml-var hoursID and value is either + hours already input or -
 hours already input) and a text field for entering hours to add or
 subtract (name is mod_hoursdtml-var hoursID)).

 The code (in the DTML document) is:

 dtml-in "REQUEST.form.items()"
 dtml-if "_.string.find(_['sequence-key'], 'mod_hours')"
 dtml-else
 dtml-let mykey=sequence-key myval=sequence-item
 dtml-in "REQUEST.form.items()"
 dtml-if "_.string.find(_['sequence-key'], 'modify')"
 dtml-else
 dtml-if "_['sequence-key'][6:9] == mykey[9:12]"
 dtml-if myval
 dtml-call UpdateHours(REQUEST)
 /dtml-if
 /dtml-if

 /dtml-if
 /dtml-in

 /dtml-let
 /dtml-if
 /dtml-in

 and the SQL method UpdateHours is:

 update emp_hours set hours =
 dtml-var expr="_['sequence-item']"
 dtml-var expr="_['myval']"
 where
 hoursID = dtml-var expr="_['mykey'][9:12]";

 with arguments: sequence-item, myval, mykey

 I've tried everything I can think of but it not only refuses to do
anything,
 it also refuses to raise an error.

 If anyone can help out I'd be very grateful.


This seems to be more of a DTML problem than an Access problem. It is hard
to follow anyway...
A few questions: have you tried using something like changing the form names
to using the name.item:records syntax. something like

input type="checkbox" name="modify.dtml-var hoursID:records" value="+"
input type="checkbox" name="modify.dtml-var hoursID:records" value="-"
input type="hidden" name="modify.inputhrs:records" value="hours already
input"
and a text field for entering hours to add or
input type= "text"  name="modify.mod_hours:records" value="dtml-var
hoursID"

this will give your dtml method a dictionary like structure called modify
you can loop over.

Starting from there will save you a whole lot of hacking. Also I'm not at
all sure that you can use the [sequenct-key] as arguments for your SQL
Method.

On the records and types in forms see:
http://www.zope.org/Members/Zen/howto/FormVariableTypes

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] New ZPatterns example... was Re: [Zope] New releases of Zwiff and ZCVSMixin...

2000-11-23 Thread Rik Hoekstra


 OK.. The new ZPatterns Example is up there   now off to fix
 some EMarket problems

for which the secret url is:
http://www.zope.org/Members/sspickle/DumbZPatternsExample

I hope you don't mind me reveiling it ;-)

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] zope basics

2000-11-23 Thread Rik Hoekstra

Using Zope, I have managed to put together a nice site for friends to create
folders, pages and upload images, etc. But there are some fundamentals that
are eluding me.

I am able to 'register' a new user through a form to create a new acl_user.
But I cannot figure out how to let them login again using that name/password
and be an AUTHENTICATED_USER with that acl_user name--other than Anonymous
User. I tried to look at AUTHENTICATION_PATH, but my browser wants to
download it--an empty file.

[rh]If you have an object to which an Anonymous user has no access, an
authentication dialog automatically pops up. If you want a real login page,
just give it restricted access, but you could any page in a restricted area
for that. Using basic authentication this is a bit clumsy. There are more
sophisticated authentication mechanisms available for Zope.

I can manage objects using dtml pretty well: create, delete, edit. If I can
figure out how to authenticate a user, I would like to be able to add a
property to new objects as they are created: (createdby:AUTHENTICATED_USER)
so that I can control which objects get a checkbox (for delete) and an edit
link for a particular user. InOtherWords, if a user creates a object, I want
that same person to be able to go back and delete or edit that object.
Anyone else can see it, but they won't be able to delete or edit the object.

[rh]Objects normally get an Owner property (under the ownder tab). In this
case you could use something like (untested)

  !--#if "AUTHENTICATED_USER.has_role('Owner',this())"--
  You own this Folder.
  !--#/if--

this is taken from http://www.zope.org/Documentation/How-To/DetectRoles


This confuses me: manage_addProperty takes (id, value, type and optionally
REQUEST) as args. What is the id? Is it the ID of the object that you want
to add a property to? Or is it the ID of the new property? The Zope Quick
Reference doesn't say, but I think it is the property's ID.

[rh]It's the id of the property. Remember you call the method on an object
(or rather in the context of an object) with an id, so passing the
manage_addProperty the object's id once again would be superfluous.


I am trying to learn from looking at the Zope interface work. After
submitting the add property form, the page url looks like this:
appRoot/objectname/manage_addProperty. I see that the objectname is behind
manage_addProperty, I know the value, id and type are passed in the REQUEST.
How can I take advantage of this following a line like:

dtml-call expr="manage_addImage(id=title, file=file, title=title)"

...to add a property to that image?

several options (just in dtml, all not tested):

dtml-call expr="your_image.manage_addProperty(id=yourid,
value=yourvalue, type=yourtype)"

dtml-with your_image
   dtml-call expr="manage_addProperty(id=yourid, value=yourvalue,
type=yourtype)"
/dtml-with

Note that if the REQUEST has the right values (from a form)   you can
alternatively also just pass it the REQUEST , the manage_addProperty method
will know how to take the variables from the REQUEST.

I found some useful tidbits at a howto page on Zope site somewhere. But it
was pretty sparse and just whetted my appetite. I am coming from NT/IIS ASP
world. So I am struggling.

[rh] But you have much to win ;-)

Can anyone point me to a richer source of samples that will help me get up
this hill?

There are a faq and a ZSnippets on zdp.zope.org which may provide some more
examples. Also look at the many howtos. The documentation section of the
zope site should be making them more easily accessible in some time.

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-dev] How do I create folders/methods etc. within the code?

2000-11-16 Thread Rik Hoekstra

Some additions:

  2. To create folders, mthods etc in the code. I have found some
functions
  manage_addDTMLMethod, manage_addFolder, but how do I use them?

 well look at their signature in the code eg:

 self.manage_addFolder(id='Testing')

The Zope Help system that comes with your Zope installation gives a
contextual help with exactly these methods. Another friend is the Zope Quick
Reference (http://zdp.zope.org/projects/zqr).


  3. I need to make a site that allows users to register ( i.e. to
generate
  user folder with some standard documents in them). Anyone have hints
  regarding this? (or in fact a whole application I can use?)

 Look at GenericUserFolder or LoginManager.


As an addition: look at the PTK: it does many of these things for you
already and at least it may be a source of information
(http://www.zope.org/Products/PTK). The only issue is that it's, um, quite
dynamic at the moment if you want to develop code with the PTK as a base.
Some might say a moving target. But if you look for inspiration it will be
fine on all accounts.

hth

Rik-


___
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] Zope and Windows DB's = NOT! ?

2000-11-14 Thread Rik Hoekstra



 hi,
 
 is anybody successfully using a Windows DB such as MS SQL
 server 7 with Zope?
 
 it seems that the ODBC adaptor is ancient and very error
 prone  so can i conclude that Zope and DB integration
 under windows is not an option?

In general, the ODBC adapter may be old, but it works well and generally
without problems in my experience. In the Zope Book it's even claimed
that it's commercially supported! The point is just that it's single
threaded. If you need to use SQL Server 7 there also is a mxODBC
adapter, that claimed to be multithreaded. I don't know about its status
right now.


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] Problems with Zope 2.2.2 and MS SQL Server

2000-11-14 Thread Rik Hoekstra


 I'm having some troubles connecting Zope 2.2.2 to Microsoft SQL Server. I
downloaded and installed the product ZODBCDA, and I was able to connect to
the SQL Server. I was able to define the SQL methods, and when I test them,
everything is successful. The problem is that when I use for example the
dtml-in tag to iterate over the results, and display them in a page, I am
always prompted for a password, but I can enter whatever password I want, I
can never get through.

 Does anybody has an idea of what I'm doing wrong and how I can solve it??


Did you use a Search interface on you SQL Methods (it is a standard product
in your Zope installation)? Did  it give the same problems?

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] Zope and Windows DB's = NOT! ?

2000-11-14 Thread Rik Hoekstra


 hello andy, hello all others who answered my post,

 first of all thank you for letting me know the positive
 experiences you have had with the ODBC adaptor and your
 various installations. i'm relieved that Zope and window's
 DB's do work together -- and this prompted some new
 tests on my part.

 their still seems to be a minor issue with an error message
 the first time we query a MS SQL 6.5 DB. a few reloads later
 everything seems to work fine. kind of weird.

there used to be a similar issue in a previous version, that had to do with
single threads and transactions not being committed. But that was patched
long ago. That's probably not it and I know it's kind of cryptic, just
thought I'd bring it up, just in case.


 guess the only major thing left is the single thread issue.

yes, that's bad.

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] Newbie question(s)

2000-11-13 Thread Rik Hoekstra



"Bowyer, Alex" wrote:
 
 Hi,
 
 I have what I'm sure is a very simple question about Zope programming style:
 I want to count how many objects are contained in the current container
 object and then do something with that value, but I can't do the bit I need
 to do at the point of reading the count variable because I am in the wrong
 namespace.
 I can't begin a dtml-let because I would need to close dtml-if before
 dtml-let, which is not allowed.
 
 dtml-in objectValues
 dtml-if sequence-end
 dtml-var count-id  !-- this is the value I want to use --
 /dtml-if
 /dtml-in
 !-- this is the scope in which I want to do something with the value. --
 

try (untested):

dtml-call expr="REQUEST.set('countids', _.len(objectValues())"
dtml-in objectValues
dtml-if sequence-end
dtml-var countids
/dtml-if
/dtml-in
!-- do something with the value. --



 What is the "accepted" way of passing a value into a different scope? Do I
 have do a REQUEST.set or is there a tidier way?

dtml-let

 Also I think I read somewhere that you can use the object.subobject or
 object.property syntax but I never got that to work, what's the catch?

dtml-var expr="object.subobject"

note that this is a Python expression and the code between quotes has
Python behaviour.
 

 
 One last thing, I sent a couple of mails to the list about problems I had
 with manage_delObjects. I still haven't got it to work. Since the best way
 to learn Zope is by example, I wonder if anyone could direct me to a sample
 piece of code where a container of some sort deletes one of its children
 subobjects?
 


try (untested):
dtml-call "subobject.manage_delObjects([id1, id2, ..])"


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

2000-11-13 Thread Rik Hoekstra



Chris Withers wrote:
 
 Lalo Martins wrote:
 
  On Fri, Nov 10, 2000 at 10:28:44AM +, Chris Withers wrote:
  
   Oh yeah, while I'm here, how's the HiperDOM project getting on? That
   stuff would be raally useful for a project here...
 
  HiperDom is usable right now; we've been quite quiet because
  we're working on documentation and unit testing (and to have
  unit testing, we had to have ZUnit).
 
  Right now, we would "raally" encourage you to use HiperDom
  in your project, specially if the deployment schedule = 2
  months, and then please send us that feedback :-)
 
 I'd love to, but it'd be 'raally' helpful to have some documentation
 and a download with some explanation/help for someone as brain dead as
 me on a Monday morning ;-)
 
 Is that available yet?

I believe you should be able to import it and use the example document
in the distribution (after you applied the patch also in the
distribution and imported it into Zope). 

On the other hand: I did that, and Hiperdom would neither expand nor
display, in both giving some xml Node exception. So in fact I thought it
was still under construction. The 'patching' was on win32 and manual, so
I probably did something wrong ;-(. However, in a python test setup the
module did work (?)

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

2000-11-13 Thread Rik Hoekstra

 
  I believe you should be able to import it and use the example document
  in the distribution (after you applied the patch also in the
  distribution and imported it into Zope).

 Hurgh? Where di you find all this out? Hwo do you use it when it is
 installed?

The patching is from the readme in the distribution. The download is/was(?)
on http://www.zope.org/Members/lalo/Hiperdom
The use of the thing is not quite clear, but there is a help included with
it, including syntax help. i think I figured out the example template by
myself, but I wouldn't describe that as hard ;-)



  On the other hand: I did that, and Hiperdom would neither expand nor
  display, in both giving some xml Node exception. So in fact I thought it
  was still under construction. The 'patching' was on win32 and manual, so
  I probably did something wrong ;-(. However, in a python test setup the
  module did work (?)

 Hmmm


_I f_ you get it to dance for you, please mail me how you did it. I'd like
to get this working as well


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] why DTML confusing

2000-11-11 Thread Rik Hoekstra


- Original Message -
From: Simon Michael [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 11, 2000 12:59 AM
Subject: Re: [Zope] why DTML confusing


 Charlie Wilkinson [EMAIL PROTECTED] writes:
  ...or "the python world with some Zope limitations placed on it."
 ...
  There's a third world of course, HTML.  Most of us probably have that

 True, true. Actually this sounds like a good structure for a overview
 doc:

 "Welcome to Zope.. in which we shall encounter

 1. the plain of Text
 2. the fields of HTML
 3. the DTML domain
 4. the ZClass lands
 5. the Scripting realms; in which dwell Expressions, Methods and
 Python/Perl/XSLT"
 6. the unbound Scripting realms; here be External Methods
 7. the halls of the Serpent; where dwell it's Products

 Descend now into.. DC's Seven Circles Of Hell."
 (affectionately misnamed :-)

Hm, nice overview. What would be missing is a general Web/HTTP section.
That's another part we always take for granted, but it is not. At least,
that's my experience from two recent introductions of Zope. So, to continue
in your vein: before we land in Zope land we should go through

1. The World of the Web and why it needs a Server of Applications
2. Where we draw up Requests and Encode them
3. Learn about the Protocols that are Spoken
4. Understand the mysteries of Common Gateways
5. Pass the Secret Ways of Authorisation and Authentication

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] querying status in zsql

2000-11-10 Thread Rik Hoekstra


 I have a processing script that takes emails and puts them into a table.
 I bring up a table for confirmation and then submit the whole thing by a
 iterative item:records zsql method.

 My problem is that the table requires a unique primary key and quite
 regularly there duplicates. So ofcourse it falls over with the expected
 error. I have tried in the zsql method encapsulating the sql with a
 dtml-if "checkforexistantrecord" and then at the bottom of the zsql
 loop I commit so make sure the second time around, the data is checked.
 This does not seem to work.

 So what im left with wondering is, if I can query in the zsql method:
 if error, then exit or go somewhere else

 Is this possible?

yes, this is possible. If I understand your question at least. BTW This is
untested, but I have used something similar before

mailid is the input field/variable for your method

dtml-in emailitems
   dtml-in checkexistant_error(mailid=mailid) (if this is another zsql
method)
dtml-if sequence-start
   skip or do something else
 dtml-else
upload your email. You may want to call another Zsql method
for this
 /dtml-if
/dtml-in
dtml-in




 sorry to be very vague. The conundrum is the fact that
 the zsql method it an item loop in its own, so i cannot seem to use an
 if statement because it doesnt iterate by the normal dtml-in route

 Any advice?


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-dev] ZPatterns: Non-ZODB storage and Racks

2000-11-09 Thread Rik Hoekstra

[rh]I've been following this thread. This may be a bit of a newbie question,
but it's been bugging me for a while. I see how I can store propertysheets
in Racks using ZClasses and Skinscripts, but the propertysheet term suggests
that there should always be an object that the properties are attached to.
Is that an actual ZODB object or is it the Specialist object that can
'create' virtual objects on the fly?


 It's determined by the radio button setting on the Storage tab.  If you
 neglected to set it to "loaded by accessing attribute " and
 fill in the
 blank, then your objects have been stored in the ZODB, as well as in the
 RDBMS.

Roche wrote:

Thanks.

I set "loaded by accessing attribute" to the attribute "id".  Storing items
in the RDBMS works fine.  But when I try to retrieve them with
getPersistentItemIDs() nothing is returned?  I have a skinsript method
getCustomer:

WITH getCustomerSQL(CUSTOMER_ID=self.id) COMPUTE id=CUSTOMER_ID, name=NAME

and getCustomerSQL is a SQL method.


[rh] If I read this right, this suggests that an object stored in a SQL
database and 'masquerades' as a Zope object? Or does an object always have
to exist in the ZODB (with it's own id that corresponds to the id in the RDB
or knows how to retrieve it).
In other words, does the ZPatterns framework need an 'anchor' in the ZODB to
connect it's properties to, or can you create pure virtual objects, that
retrieve all of their properties from a specialist, including the ID.

If the last is the case, could someone give an example how to implement it.
A very simple one would suffice I suppose (hope).

I hope I expressed my question clearly, 'cos this is difficult matter?

tia
Rik


___
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: Non-ZODB storage and Racks

2000-11-09 Thread Rik Hoekstra

snip great explanation

Thanks, Phillip, that was enlightening

Rik


___
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: New Name for Python Methods

2000-11-09 Thread Rik Hoekstra


 Thus the poll did not ask the right question.

To be honest, I was surprised that Python Method was still in the poll list.
A new poll is not a good alternative, though. Any plans about what to do -
take the second best. Re-polling.

Apparently it was a bad day for elections in the US in general ;-) (sorry,
couldn't resist)

Rik


___
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] objectValues type?

2000-11-06 Thread Rik Hoekstra

I have this simple tree:

dtml-tree branches="objectValues" skip_unauthorized="1"
input type="checkbox" name="delItems:list" VALUE="dtml-var id"
a target=main href="dtml-absolute_url;"dtml-var title_or_id/a
 /dtml-tree

The anchor's target is main. But it if it is a Folder I want the target to
be self.

And I want to skip some items.

How do I return the objectType (eg Folder, Document, Method) so I can alter
the anchor, and/or object Properties that I might set to make other
decisions?


try (untested):

dtml-tree branches="objectValues" skip_unauthorized="1"
input type="checkbox" name="delItems:list" VALUE="dtml-var id"
dtml-if  "meta_type != 'Folder'"
a href="dtml-absolute_url;"dtml-var title_or_id/a
dtml-else
a target=main href="dtml-absolute_url;"dtml-var title_or_id/a
/dtml-else
 /dtml-tree

with the dtml-if tag you can test for other properties in the same way.

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] university portal

2000-11-05 Thread Rik Hoekstra


 I'm another Zope newbie with a few questions. My appologies if this
message is being sent to the wrong mailing list.

this is the list


 I'm a final year student doing a project to create a course/personal
management system for my university. I
 understand there's quite a lot of similar work going on in this field
already.

 I aim to create a database to store student information in (using mySQL or
Zope?)

or both. This really depends on what you want and how many users you expect
. Some user management products (Zopish for components) are flexible enough
to accommodate both. ZPatterns and a Zpattern based products (like
LoginManager?) allow you to switch from one implementation to another
halfway. Experimenting with ZPatterns is not a newby thing though... ;-)

which the user (the lecturer) can
 add content to (details of grades, etc) via a web browser and use for bulk
manipulation of data... sending email
 amongst other things. In addition, I hope to provide a 'wizard' (in a
browser window) to provide facilities for
 uploading lecture material, news, etc. to the course web page. Going
through Zope's 'Elvis' tutorial this seems
 possible.

this is the realm Zope is suited for par excellence


 [Q] Is it possible to present a user with various web forms to input
information (say, a news article with headline
  content) that once submitted will be displayed on the page in a suitable
format? I think Zope is capable of
 this... is Python/anything required. Are there any examples I can look at?

Yes, many. Try looking at Squishdot for a start. It's a flexible weblog
style product (http://www.zope.org/Members/chrisw/Squishdot)  The Zope
Portal Toolkit may provide much of you want, but it's a project in the
making (http://www.zope.org/Products/PTK)
My own Zope Edu Course Framework (http://www.zope.org/Members/Hoekstra/ZECF)
is a product for publishing courses online. It's intended for people with
few technical web skills. However, this too is under development


 I am in the process of reading the online Zope book - if anyone has any
advice for reading material, I would be
 grateful to hear it :-)


watch the documentation pages, they will be much improved within a few days

 [Q] There are a lot of Zope products available - am I right in thinking
that, say a 'Zope Discussion Board' product,
 could be download and integrated into a Zope-powered web-site?

yes.

 i.e. Are Zope products 'plug and play' TM? ;-o


many are, some are not.This really depends on the product.Most have
installation instructions. They should tell you more.

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] Where is the code?

2000-11-05 Thread Rik Hoekstra


 I have played with Zope and got everything working. It is
 however not clear to me how the code (DTML and so on) is
 merged into Zope and where it is kept. Would gurus out there
 point this to me? thanks.


DTML and Zope (code) objects are kept in the object database. It is in
zopehome/var/data.fs on your filesystem.
If you create a new object, Zope creates a new instance of a class that is
in Zope. They are defined in Products. The products are visible in your zope
site at http://your.site/Control_Panel/Products
Zope products/classes may be defined in Python modules. In that case the
modules live in the zopehome/lib/python/Products directory. They may also
be defined in ZClasses, which are defined completely through the web. They
are not visible on the filesystem, only in Zope itself.

I don't know whether that was your question, but DTML is interpreted at
runtime by the Zope system. It takes the dtml bits from your template and
returns the filled in template.

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] Reverse SendMail Question

2000-10-26 Thread Rik Hoekstra

 Has anyone thought of using SendMail (or any other e-mail program) to send
 e-mail to Zope and have that e-mail be loaded directly into a specific
folder
 (say, based on the e-mail address or subject line)?

 This would be handy to keep track of e-mail.  All the person would have to
do is
 cc the project and all the e-mail could be viewed centrally.

 Any ideas?



There has been quite a bit of discussion/ideas exchange on this in a
zope-dev thread about the ZWikiNG (new generation), search the archives (or
the Wiki at http://dev.zope.org/Wikis/DevSite/Proposals/WikiNG amd
especially the discussion page). There is also a product called ZMailIn
available from http://www.zope.org/Members/NIP/ZMailIn/

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] Trying to follow tutorial

2000-10-25 Thread Rik Hoekstra



Olivier Ricou wrote:
 
 On Tue, Oct 24, 2000 at 01:40:58PM +0200, Rik Hoekstra wrote:
  Go to the management interface and add a zope user in the acl_users
  folder. Give it Management rights. Shut you browser, reopen it and
  authenticate as the user you just entered. Get on with the tutorial...
 
 BTW there is no easier way than to shut the browser and reopen it ?

No easy sure way at least. That is, if you have basic authentication
(which is always the case when you have Zope out of the box). It's
reported that in some cases
http://user:[EMAIL PROTECTED]:whateverport may log you out/log you
in differently, but afaik that won't work in all browsers and all
platforms _and_ it may present you with an authorization box

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] problem(100) ZServer Computing local hostname on windows install

2000-10-25 Thread Rik Hoekstra

 
 when I try to start zope on windows machine i get:
 problem(100) ZServer Computing local hostname

this is 'normal' and not a problem (though I always wonder what it
really means)

snip

 
 The dos window seems to hang after this.

nope, this is just the console window for the server. This is also
normal. You only get output here if something strange happens (and in
ftp sessions)

 
 when I start a browser and goto http://localhost:8099/manage I get an
 number, apparently an error:
 972402587.52
 
 back in the dos window, I see:
 ZServer uncaptured python exception, closing channel PCGIChannel at
 1307340 exceptions.ValueError:invalid literal for atio: Get/ manag
 [c:\programfiles/home/zserver/medusa/asyncore.py|75]
 [c:\programfiles/home/zserver/medusa/asyncore.py|handle_read_event|327]
 [c:\programfiles/home/zserver/medusa/asynchat.py|handle_read|110]
 [c:\programfiles/home/zserver/pcgi.server.py|found_terminator|146]

try accessing it via the http port. In your case http://localhost:8080
or http://localhost:8080/manage then it should work.

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] OT:NT and rebooting (was:How many houres do I need to manage a Zope) site?

2000-10-25 Thread Rik Hoekstra

 My 2 ZoNT (Zope on NT workstation) boxen haven't needed rebooting yet.
They
 sit mostly idle with occasional light loads.  They are P100/32MB/1.2GB
 old(er than dirt) Industrial Computer Supply boxes.  You know, 19" rack
 mount 4U units.  Good, solid, slow hardware.  They survive NT rather well.
 One is running 2 instances of Zope (one for dev) and has been for 15 days
 since last reboot.  I will be looking for at least a 6 month uptime.
 They serve a departmental intranet application that I am writing.  It's on
 NT because I need to use ODBC to get to a local MS Access Database.
Bummer.

 Troy

 -Original Message-
 From: Bak @ kedai [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 25, 2000 10:49 AM
 To: Diny van Gool; [EMAIL PROTECTED]; J. Atwood
 Subject: Re: [Zope] OT:NT and rebooting (was:How many houres do I need
 to manage a Zope) site?



 sorry if this is offtopic, but i see reference of rebooting every so often
 with NT( and maybe W2K).  is this real?  or FUD?
 i use linux myself and would like to confirm this from all you guys'
 experience

I have had a number of Zope sites running on NT with rather modest hardware.
It performed reasonably to good and without troubles for months on an end,
even with several people developing on it and a number of students accessing
it. Mostly ODBC (SQL Server and even Access) will also work without trouble.
It will also behind IIS. If something goes wrong it is usually an ODBC
problem no Zope internal problem. The only real major problem is when SQL
This is no pro NT argument, but just a reassurance that there is no reason
not to use Zope on NT, though I would switch to Linux if I could...

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] OT:NT and rebooting

2000-10-25 Thread Rik Hoekstra



 "Months without rebooting"?

 That is certainly not something to brag about. With three of my
 installations of Zope on Linux I have the machines at 194, 204 and 55 days
 of uptime (and the 55 was because of a bad powerstrip, the other others
have
 been up since I brought them up). While NT can and does stay up for long
 periods of time, it still is a very poor server choice as anything you
 install leads to a reboot. I have installed countless things on the Linux
 boxes and never brought it down. That is the difference and makes all the
 difference when it comes to a website.



Agreed, but that wasn't the point

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] Trying to follow tutorial

2000-10-24 Thread Rik Hoekstra



 
 Hi all, I am trying to follow the quick tutorial and immediately run into
 things I do not understand. I am trying to create a folder as explained in
 the docs.
 I get the error:
 
 Error Type: SuperCannotOwn
 Error Value: Objects cannot be owned by the superuser
 
 This is the example in which "Stan" needs to create a folder. Can anyone
 tell me
 what goes wrong and how to get it right?

This is related to the tutorial not being up to date with the current
zope version, but is simply remedied.

Go to the management interface and add a zope user in the acl_users
folder. Give it Management rights. Shut you browser, reopen it and
authenticate as the user you just entered. Get on with the tutorial...

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

2000-10-24 Thread Rik Hoekstra

 
 how to for that function REDIRECT understand a variable.
 
 ex.
 
 dtml-call "RESPONSE.redirect('http://zope.org/index.htm?cod=dtml-var
 test')"

You can't nest dmtl tags

try :

dtml-call "RESPONSE.redirect('http://zope.org/index.htm?cod=' + test)"

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] non oreilly zope book

2000-10-17 Thread Rik Hoekstra

 Is the same one that got cancelled?
 

the very same

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] Content Management System

2000-10-12 Thread Rik Hoekstra


 This query started out in a separate thread about permissions, but it's
 sufficiently important to me to pose again here.

 I've been struggling to make the CMS abilities of zope user-friendly
enough
 for 'joe average' end-users.  Really it's designed for a 'power' content
 manager who delegates, secures, and generally has taken the time to study
 all the Content Management docs, etc.  However, most of my clients don't
 have those kinds of requirements and aren't that technologically savvy, so
I
 end up coding ultra-simplified interfaces for them on a per-project basis.

 I know you can restrict permissions on just about every available method,
 and I am aware of the current skinnable zope project, which may improve
the
 situation drastically.  But I'm interested to know, how many of you offer
 the Zope TTW interface to clients as a content management system, and how
 many just use it as a development interface?  I'm beginning to wonder if
 content management and system administration should be split out into
 separate subsystems.  Or if a CMS Tool Kit should be developed.
(workflows,
 syndication, etc...).  But I'm still far from being a zope power user
 myself, and have yet to appreciate the range of its potential.

 What do you people think?


The PTK might offer you some help in this respect. Zope as a CMS _is_
possible, but IMO you'll have to wrap the parts of the management interface
that you want to expose to your users and hide the rest. This will
effectively limit you as to what you will let your users add to Zope, but in
a CMS situation, this will probably be the case anyway. The management
interface as is won't mean much to most of them, but custom forms can also
call the manage methods.
It's probably a good idea to use something like the HTML Widgets product
that was recently announced here, or the HiperDom thing.

For most of the user management parts you will probably need someone with
affinity for web developing, though as long as you keep the tasks
constrained, some simple instructions will probably suffice.

I have been developing something similar in what should be a course
framework (a product that I don't seem to be able able to finish) that is
geared toward an educational situation. It's predecessor has been in use at
a university for some time and it seems to suffice as least as good as
commercial packages.

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] Need preferred 'import' format for ReportLab Image module

2000-10-12 Thread Rik Hoekstra


  to reply to Andy? In my own reportlab distribution I changed;
  import Image
  to
  from PIL import Image

 Well, it sounds right and if it works then it probably is ;-) It
 probably depends exactly where you install PIL, though, which I haven't
 done yet :-S

The Photo product and the ExtImage products do more or less the same - this
seems to become the standard way. It would be nice to have one place to put
PIL, though. the lib/python/shared directory would be a good place I think.

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] Stupid questions

2000-10-11 Thread Rik Hoekstra

Am i supposed to get "XML methods" and "Python methods" in the add product
drop down?
I'm baffled.

Not unless you add them ;-)
The XML Document (presume you meant that) and Python Methods are both
Products, that is the Zope name for components

XML Document can be downloaded from http://www.zope.org/Products/XMLDocument
Python Methods from http://www.zope.org/Members/4am/PythonMethod


PD: the subject says it all. Please don't flame me.  I think we need a
little bit more organization, some kind of comprehensive index instead of
looking for documentation in several places.

this is not a documentation question I think, but the documentation is being
worked on.

hth
Rik

--
Manuel Amador (Rudd-O)



___
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] expr=id 'index_html issue

2000-10-09 Thread Rik Hoekstra




 Okay, this is my second question for the day.  Hopefully it won't be as
easy as
 the first -- otherwise, I'll have to stick to practicing law.

 I'm looking for a way to list the DTML Methods in a folder -- except the
 index_html method.  So far, I've had to do it by using this:

 dtml-in expr="objectValues('DTML Method')" sort="title"
   dtml-if expr="title  'The Title'"
  td align="center"a href="dtml-absolute_url;"dtml-var
 title_or_id/a/td
   /dtml-if
 /dtml-in


 This works but it is a maintenance headache.  A more elegant (and
reuseable)
 solution would be to use the id, which is always 'index_html' for the
 to-be-excluded method.  However...

 dtml-in expr="objectValues('DTML Method')" sort="title"
   dtml-if expr="id  'index_html'"
  td align="center"a href="dtml-absolute_url;"dtml-var
 title_or_id/a/td
   /dtml-if
 /dtml-in


 .. doesn't work.

 Does anyone know why?

Short answer because id is not always a string you have to call it
differently

try untested but this is a faq:

dtml-in expr="objectValues('DTML Method')" sort="title"
   dtml-if expr="_[id]  'index_html'"
  td align="center"a href="dtml-absolute_url;"dtml-var
 title_or_id/a/td
   /dtml-if
/dtml-in


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] IIS port problem

2000-10-03 Thread Rik Hoekstra

snip description


 http://srnt/ChatClub/index_html

note that most probably the reference will look something like
http://srnt/cgi-bin/Zope.pcgi/ChatClub/index_html

That is, you'll loose the port, but you rape your url.
If you want a shorter url, you most probably have to do other (isapi like)
things to IIS


 I don't want any reference to the server port 8080.
 I have read several help documents on IIS and PCGI AND THEY ALL SAY
 DIFFERENT THINGS.

 One document said to copy the Zope.pcgi to the IIS cgi-bin folder and
 another said to copy it to the IIS scripts folder.


the main point is you need _one_ (not several) Zope.pcgi file that has the
proper locations of all the things needed in it.  It does not matter where
you put it. In your  zopehome/pcgi/util directory there is a pcgifile.py
script that will help you check the pcgi info file (that is the very
Zope.pcgi file I referred to). If this doesn't report any errors, your
IIS-pcgi connection will probably work.


 One document showed the Zope.pcgi file path configuration completely
 different from mine. The document showed :
 PCGI_MODULE_PATH=X:\WebSite\lib\python\Main.py

 And mine showed
 PCGI_MODULE_PATH=F:\InetPub\wwwroot\cgi-bin\ZopeSite\lib\python\Zope


this may be true, but it's a strange place for a Zope installation

 The document even had files I didn't have anywhere in my directory like
 pcgi.soc and some in completely different folders like:

hm, IIRC the soc file is Unix only.

 Help document:
 PCGI_MODULE_PATH=X:\WebSite\pcgi\pcgi.pid

 My file:
 PCGI_MODULE_PATH=F:\InetPub\wwwroot\cgi-bin\ZopeSite\var\pcgi.pid

 I know there must be a a simple way to accomplish this.

It can be simple, but it may turn into a nightmare if it doesn't work (you
have been warned). As a comfort, it took me no more than a quarter of an
hour to get it installed on several different NT machines.


I just need someone
 to tell me how to do it STEP BY STEP.


Your best step by step guide is on
http://zdp.zope.org/projects/zbook/book/VII/PlatformInstallation/InstallDraf
ts/instwindraft3/

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-dev] mailing list 'noise'

2000-10-01 Thread Rik Hoekstra


 
 I dont see this as a problem: You only create a new list when the
 traffic for that proposal gets too great for zope-dev. Threading
is
 good enough before that point.
   
Yes, but zope-dev has a relatively high traffic load... Why should
you
have to put up with all that 'noise' if you're only interested in
posts
for your comparatively small discussion?

  I read the
  2-10 articles that I'm probably interested in, and miss the 95% which
  is almost always noise.
 
 The question is why you'd want to receive all this if you don't have to
 (as remarked above).

 ...because it is usually a mistake to categorize any discussion as
 small, to exclude it from the mainstream zope-dev. I started this
 thread with a request that developers use zope-dev in the way
 requested by the Fishbowl Process document - but (I assume) it has
 also been valuable to people thinking about a next-generation wiki.

 That would not have happened if discussion was partitioned into Wikis
 (Todays wikis - not VaporWikiNG) unless some WikiNgWiki person was (by
 coincidence) keeping up with the FishbowlWiki.

 Are you really advocating that?

No, did I sound like I did?


 as long as you can follow it. But for prolonged and diverging
 discussions? Not quite IMO/Experience.

 Can you explain why?


Because discussion change topics.  Because most people only answer parts of
the post.
Because you throw away parts of the posts (I know you shouldn't but the mail
client is not under your control).
Because you loose overview and you can't step back and take a look at the
whole thread.. Because no one ever summarizes the discussions. They could,
but they won't.
I have done these kind of summaries for several intricate Zope related
discussions and when you start summarizing it gets very clear that for a
larger discussion only parts of the issues involved ever get discussed.
Or, to summarize my point, maillist discussion are hardly ever consolidated.
It's like having a meeting without an agenda or a chairman who gets the
thing going. In the case of a meething once in a while a good
chairman/moderator takes back the discussion, summarizes and puts up the
open points for further discussion. If you ever experience a meeting that
needed someone to guide it, but didn't have one, then you probably know what
I mean.



 Or for discussions that you fall
 into in the middle?

 Agreed - Todays Wikis are better than todays email list archives.

Ha! ;-)


 And what if you want to follow discussions at
 different places, with different tools and you depend on a POP Server or
 differential access (POP/IMAP/Web) to a mailserver?

 Its true that the web model is increasingly becoming a lowest common
 denominator. Are your suggesting that a majority of Zope developers
 actually need that?

Um, I couldn't tell with any certainty. In light of the adoption of Wikis, I
suppose so yes. People seem to have been unsattisfied by the maillist and or
other discussion tools. It's also remarkable that DC did not adopt Squishdot
as a discussion forum, yes.

And apart from this, a WikiNG would benefit a much larger community, of
which I _am_ sure that it needs it.


 (Agreed, a VaporWikiNG that does both would be nice)

Agreed that for now there are no tools that do such thing. That is also why
it's worthwile to get WikiNG out of the vapor notwithstanding the myriad of
discussion tools that have been around for many years already.


 As I understood it, the discussion is less about tools and more about
 modes of discussion.

 But we couldnt be having this discussion (in any mode) without tools.


did I say that?

 *My* email and news tools support the mode of discussion that we are
 advocating *better* than *Todays* Wikis


I think everyone agees about that, but at least some of the participants in
this discussion also agree that most of the existing discussion tools for
any mode of discussion are frustrating and insufficient at times. Moreover,
apparently not everyone favours the same mode of discussion and this alone
would be more than enough justification for a product that would cater
different modes of discussion _at_the_same_time_.

Rik



___
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] mailing list 'noise'

2000-09-29 Thread Rik Hoekstra



Karl Anderson wrote:
 
 Ken Manheimer [EMAIL PROTECTED] writes:
 
I dont see this as a problem: You only create a new list when the
traffic for that proposal gets too great for zope-dev. Threading is
good enough before that point.
  
   Yes, but zope-dev has a relatively high traffic load... Why should you
   have to put up with all that 'noise' if you're only interested in posts
   for your comparatively small discussion?
 
  Yeah - maillists flow by, and not everyone can follow all the traffic all
  the time!! The cool thing about "content-based" mailling lists, where
  people can subscribe to notifications about changes in subthreads, is that
  you just subscribe to the part of the discussion that has your interests!!
 
 I haven't understood this gripe ever since I started reading mail with
 Gnus.  Before anyone groans, I'm not sure that Gnus is ready for
 general use by anyone who doesn't want to learn elisp - but surely
 there's anther reader with these features?


most have features a bit/lot/sufficiently like this. They (apparently)
do not work for everyone. Moreover,not everyone works the same way. 

 
 The point that I'm trying to make is that a mailing list has all the
 strucure needed to keep abreast of an important thread.  I don't think
 it's perfect when you can't afford to miss a single important article,
 but it works great for general lists.

as long as you can follow it. But for prolonged and diverging
discussions? Not quite IMO/Experience. Or for discussions that you fall
into in the middle? And what if you want to follow discussions at
different places, with different tools and you depend on a POP Server or
differential access (POP/IMAP/Web) to a mailserver? 

 I read the
 2-10 articles that I'm probably interested in, and miss the 95% which
 is almost always noise.

The question is why you'd want to receive all this if you don't have to
(as remarked above).
As I understood it, the discussion is less about tools and more about
modes of discussion.

Rik

___
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] Use of the :records variable type and ZSQL methods

2000-09-26 Thread Rik Hoekstra



Calvin Parker wrote:
 
   Error Type: Bad Request
   Error Value: ['Field1', 'Field2']
  
   Here is the code I used and sqlTest is the ZSQL Method that
  just inserts the
   two fields into a test DB:
  
   dtml-in testlist
   dtml-call sqlTest
   /dtml-in
  
   What am I doing wrong?
  
 
  you'll have to feed a named argument to your Zsql method (that is in its
  definition). In this case that would be testlist. Then it should work as
  expected
 
 
 Here is the Z SQL Method.  It takes the arguments Field1 and Field2.
 

that's where the problem is: in your REQUEST there _are_ no Field1 and
Field2: they are in the testlist (pseudo) dictionary.


notreallytestedbutshouldwork

Make you method (something like):

dtml-in testlist
 INSERT INTO Test_Fields
 (Field1,Field2)
 VALUES
 (
 dtml-sqlvar Field1 type=nb optional,
 dtml-sqlvar Field2 type=nb optional
 )
/dtml-in 

/notreallytestedbutschouldwork

Am I calling testlist incorrectly?  I have tried forcing the namespace with
the dtml-with tag, but it doesn't seem to be making any difference.  Are the
arguments field in the Method what you are refering to when you say named
argument?

I think so (terminology is a bit confusing here). ZSQL methods only take
named arguments. There has been quite a bit of threads on this on the
list. SO you might want to search the archives for them.

In this case the named argument would have to be testlist, as this is
the argument REQUEST contains.

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-dev] I feel your Wiki Pain ;-)

2000-09-25 Thread Rik Hoekstra

 Do you feel that weblogs are bad models for debates?  I think they're
 pretty good least-common-denominators.  I would probably prefer the
 kind of annotation-based thing i described in my last message (and
 began to sketch in the WikiNG proposal) for collaborative generation
 of documents, but i can see the place for weblogs, just as i can see a
 place for network chats.  With adequate integration of email
 (for notification and response), i see them as better than just
 email...

I like the email list proposal of Martijn Faassen earlier on this list. I
added some comments to the Wiki discussion page, where someone proposed
using XML for Wikis:

I agree with Peter that the proposal is practically shouting XML all over
the place. In a Zopish way this would mean dividing up a Wiki page in
different objects (say Topics or Paragraphs or whatever). So a Wiki page
would become an XML document, consisting of Wiki node documents. The
advantage is that this would allow for a presentation in the form of

- one or several continuous pages as in the OFWikis (OF=Old Fashioned as
opposed to NG).

- a presentation with 'folded' nodes (like in a folding editor)

- a threaded discussion a la S[qu|w]ishdot or the Discussable thingy

- an XML document (for who would want it)

The editing could be in the form of Martijn Faassens XML Widgets editor: put
a node point in front of a 'discussable' node, promote that one to the top
when the 'node point' is clicked on and allow for editing. An example below,
in which the o stands for an editable (=clickable) node point (for wiki
reasons I have not put blank lines between them.

pre
o this is the first editable node
  (user::time) this is a comment to it
(user::time) and another comment to that
  (user::time) this another one
(user::time) more comments
o this the second one
this one is not editable
o this one is
  (user::time) a commennt to the last node
/pre

alternate view (in threaded discussion mode - probably know to all):
(- is foldable; + is expandable)
pre
-This is the first editable node
 + this is a comment to it
 -  this another one
   - and another one to that
- this the second one
this one is not editable
+this one is
/pre


another 2 cents

Rik


___
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] Use of the :records variable type and ZSQL methods

2000-09-25 Thread Rik Hoekstra

 
 Error Type: Bad Request
 Error Value: ['Field1', 'Field2']
 
 Here is the code I used and sqlTest is the ZSQL Method that just inserts the
 two fields into a test DB:
 
 dtml-in testlist
 dtml-call sqlTest
 /dtml-in
 
 What am I doing wrong?
 

you'll have to feed a named argument to your Zsql method (that is in its
definition). In this case that would be testlist. Then it should work as
expected

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-dev] ODBC Error

2000-09-15 Thread Rik Hoekstra

There _was_ a patch available (can't find it now, search the maillist
archives)

Rik

___
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] is INSTANCE_HOME broken on Win32?

2000-09-14 Thread Rik Hoekstra


 Any ideas?


the python way of getting the right path separators is to use 

os.path.join(item1, item2, ...)

Works even for macs ;-)

Rik


___
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] id_quote

2000-09-14 Thread Rik Hoekstra


 Given the new strictness characters allowed in id's, it'd be great if
 there was something called id_quote which behaved in the same way as
 html_quote or url-quote except it made a string suitable for use as an
 id. It's be great if ti was available as a methdo in python as well :-)

 What do people think?


This might wind up rather confusing: you can't find back your objects. If
they are created automatically you may create them such that they do not
create invalid ids. In such a case the id-quote method might be a good idea.
If you create them by hand (have them create by hand) then you'd better
throw in an exception (or error page) instead of mutilating the id. If only
for educational purposes ;-)

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] My Z Class

2000-09-12 Thread Rik Hoekstra



Karl Munroe wrote:
 
 I have constructed a z class which contians other products. Is it possible
 for me to have access and edit the properties of the objects contained in
 the z class.
 For example. MYZClass contains an image object...how do I change the and
 edit the photo contained in the class
 

I don't know if I get this right. The point of ZClasses is that they
provide common behaviour for all instances of the class. This means that
if you have an image in the ZClass, it will be available in all the
instances, but if you change it 1) that can only be done in the ZClass
definition and 2) this will affect all your instances.

If you want an image that is specific for your ZClass instance, you'll
have to put it into the instance. You can change it there like any
normal Zope object. Creating the Image object inside your instance can
be done at the time the ZClass is created and you can also customize the
image object at that time. 

Please provide more details as to what you try to attain if I got your
question wrong.

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] TEXT FILE Operation

2000-09-12 Thread Rik Hoekstra

 anyone know how to let Zope interact with text files on the system on it
 is running.

I take it you mean files external to the ZODB database

 Like making changes to files, search and replare some text or insert or
 delete text and save the file again?
 I'm pretty new and i don't know if it is possible for Zope.

You can just about anything you want using external methods (written in
Python) or Python Products, including reading, writing, deleting and
changing and using regular expressions. Be aware of security issues,
though, as you'll effectively be opening up part of your filesystem to
access through the web

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] TEXT FILE Operation

2000-09-12 Thread Rik Hoekstra

 infact this is the problem, right now i'm not able to program in python
 but only on using zope.

Hm, you'd be surprised how easy the Python bit is. THere is excellent
documentation at the Python site (http://www.python.org)

 I used the FSSession product before and i think that should be a Similar
 product to make changes on files.

It seems to me the problem is too general to be able to make a sensible
product to deal with it.

 thank you for the help.
 

You could also have a look at the LocalFS product
(http://www.zope.org/Members/jfarr/Products/LocalFS). It will let you
incorporate local directories into your Zope site as if they were inside
Zope

There is also some documentation about writing files outside Zope
(http://www.zope.org/Members/sabaini/externalfiles-howto)

Perhaps this will get you started some more

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

2000-09-12 Thread Rik Hoekstra


 Any other good solutions are welcomed!

There are several 'Sitemap' solutions that do this more or less, but...

Any reason you can't use a catalog for this and catalog on the property?
This is much faster and much more flexible

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 Pass values to a DTML method ??

2000-09-11 Thread Rik Hoekstra




 I have a DTML method that is called from a document. I need to pass a
value
 to it like a parameter would be passed to a function.

 dtml-var some_method(param=value)


try something like:

dtml-var "method_name(_.None, _, param=value)"

or:

dtml-var "method_name(_.None, _, arg1=value1, arg2=value2)"

for a longer expose see the faq:
http://zdp.zope.org/projects/zfaq/faq/DTML/955111628

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-dev] Render DTML without having it in a Zope object

2000-09-08 Thread Rik Hoekstra

 
 I have some HTML/DTML saved in the database and I want to now display it.

What database - something different then data.fs probably?

 But before I display, I need to render the DTML that is contained in the text.
 Can anyone lead my in the right direction; maybe by telling me which file
 handles the rendering and I can read some source code. But of course, it
 would be cool, if I could get a more explained response. BTW, I can call
 the method to render the text from Python or DTML. I really don't care.
 

You'd have to feed it to
zopehome/lib/python/DocumentTemplate/DT_HTML.py and use the String
method, probably. It is not completely clear to me what you try to do.
Is it indirect dtml calling - this could be difficult (your best bet
would be to use an external method methinks). If not, why can't you
include it like any normal DTML Method?

HTH (if only slightly)

Rik

___
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] Need help with ZJetDA, Winnt4 and Zope 2.2.1

2000-09-08 Thread Rik Hoekstra



"Farrell, Troy" wrote:
 
 As you have no doubt heard my cries for help, I figure that very few are
 running NT4.  

More than would admit it, probably. Perhaps no one knows the answer to
what seems to be a rather specific situation. For one, I have the
impression most people use zodbc connections to access database then use
the zjetadapter (so do I, so chances are I might be just blabbering).


 I am having a permissions difficultie with ZJetDA trying to
 modify data in an Access97 database.  On my server, the DA is able to SELECT
 * FROM tablename with no problem, but when it comes to INSERT INTO tablename
 VALUES (...) or UPDATE, I get a Query Error with a value of INVALID
 OPERATION.  I mirror (It is identical, i checked 5+ times) all the objects
 on my NT4 laptop and it works ok.  The databases are Identical, I copied the
 working one to the non-working server and still no go.  The traceback is as
 follows:
 

hm one stupid question: isn't by accident the working one read-only by
accident (this happened to me more than once and it _will_ happen if the
access file is not copied properly. Who knows what copying properly is -
please speak up). 


 __call__
 (Object: bmsdb_jet_select_browse_state_sub_insert_into_temptablebrowse)
   File C:\PROGRA~1\JESTER\lib\python\Products\ZJetDA\db.py, line 130, in
 query
 Query Error: (see above)

you could try this with the zodbc adapter. Please make sure you odbc
connection is made under the system account though.

 
 Rant:
 I've been working on this for days.  I don't seem to understand the security
 model since I didn't have any problems before 2.2.x.  If I cannot get this
 resolved, I'll move back to the 2.1.x series.  I really want this to work as
 it is my companie's introduction to open source software.  Have a :) day.

hm is the Zope version the same on your laptop and your server then? If
so, then the security thing should be the same on both,  right? If not -
then how can you say all objects are the same? Did you copy you data.fs
database from one machine to the other?

success, let us know how it goes

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] Lock and Transaction in Zope.

2000-09-08 Thread Rik Hoekstra

Zope has no built in locking like that, but IIRC there was some hack in
the wiki code to prevent simultaneous editing (which wasn't bullet
proof). Perhaps you can look there. I doubt whether it will solve the
problem you pose, but I don't see why you'd want to do what you pointed
out in your mail anyway.

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] This must be a namespace problem

2000-09-08 Thread Rik Hoekstra

 
 But it uses the "root" folder "content". How can I make it us the "content"
 in the current directory, but the index_html from the root folder. Can this
 not be done??
 

This is an acquisition problem we will all be bitten by at one time or
another. There is some documentation about this, including Jim Fultons
Acquisition Algebra talk
(http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/index.html)
and my Changing Contexts in Zope
(http://www.zope.org/Members/Hoekstra/ChangingZopeContexts)

a way of showing acquisition is described in:
http://www.zope.org/Members/chrisw/showaq

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] DTML Question on lines

2000-09-07 Thread Rik Hoekstra




 I am trying to itterate through a lines property in the folder so that the
 options will drop down. I did not think that the following code would work
 but I could not think of anything else.

   dtml-in valid_codes
  option value="dtml-var valid_codes"dtml-var
 valid_codesnbsp;/option
   /dtml-in


try (untested):

dtml-in valid_codes
   option value="dtml-var sequence-item"dtml-var idnbsp;/option
/dtml-in

assuming of course that valid_codes is a list

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-dev] Call for a creation_datetime property!

2000-09-06 Thread Rik Hoekstra



"Jay, Dylan" wrote:
 
 It is really a painful thing to do without.  I realize I can add this
 capability to factories of my own objects but I don't want to have to create
 my own versions of dtml-document and everything else just to ensure that a
 creation date is kept. I've tried using transaction logs but this is very
 dodgy for the following reasons. 1) An object can be created by many
 different methods. Its guess work working out which created the object. 2)
 The odb can be packed and then you've just lost your creation date.
 
 Can anyone give a good reason not to include this property as a standard for
 all ZODB objects?
 

A me too here

Rik

___
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] DTML horror

2000-09-05 Thread Rik Hoekstra



 Nick Trout wrote:
 
 DTML is pretty horrible. Does anyone have any solutions to allow DTML
 methods to be generated using a more Pythonesque interface? It seems
 to me that DTML is a bit of a shoddy half way house between HTML and
 Python.

Use Python Methods (http://www.zope.org/Members/4am/PythonMethod) or
External Methods (available in all Zope installations RTFM). They will
probably not completely replace DTML though. 

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

2000-08-27 Thread Rik Hoekstra


I have a lot of REQUEST like this one to check, depending on what
documents are in the folder.

dtml-unless SOMEREQ
dtml-call "REQUEST.set('SOMEREQ','defaultvalue')"
/dtml-unless


RH: this should work. It works with me

so i gave all documents concerned 2 properties
myPropName,myPropValue

(in our example
myPropName : SOMEREQ
myPropValue : defaultvalue)

So i'm able to iterate the documents and check the properties and
set the REQUEST.

dtml-in "objectValues(['DTML Document'])"
dtml-if "_.hasattr(this(), 'myPropName') == 1"
  dtml-call "REQUEST.set(myPropName,myPropValue)"
/dtml-if
/dtml-in

this works OK.

But, I can't find a way to generate the
dtml-unless SOMEREQ tag.

Passing the value of myPropName seems to fail (erreur while
parsing the syntax, or check the 'myPropName' instead of his
value).
I tried a lot of things and syntax around dtml-unless
myPropName, but it failed.

RH: Um, as you describe it, you mix up the name of the  property and its
value (but that might be a matter of desciption). Try something like the
following
dtml-unless "myPropName==SOMEREQ"
dtml-call "REQUEST.set('myPropName', defaultvalue)"
/dtml-unless

note that 1) this will only work if there is a myPropName and a defaultvalue
variable in the namespace and 2) this won't change the value of the property

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] Run a java applet in Zope

2000-08-25 Thread Rik Hoekstra



Michel Houben wrote:
 
 Dear,
 
 I have a dtml-document with a Java-applet and I can't get it runnning in
 the Zope envirronement. I hope someone knows it and can solve my problem.
 

AFAIK, this is perfectly possible. We need more details to be able to
help you.
Any specific point where it goes wrong - any tracebacks or other error
messages?
Does it work in a plain (not dtml) HTML page? 
If so, what did you change with dtml to make it stop working?



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] ZClass Property : DTML Document ?

2000-08-25 Thread Rik Hoekstra



Vincent wrote:
 
 Dow do I create a ZClass Property of the type : DTML Document ?
 

If you want a DTML Document accessible in all ZClasses - just include it
in the ZClass. If you want you may make it available as a View by
mapping it under the 'Views' tab (in the ZClass definition area)

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-dev] Zope as CGI with IIS Windows 2000 Server

2000-08-24 Thread Rik Hoekstra



URGENT!  Need assistance with Zope as a PCGI with IIS 5 on Windows 2000
server.


After configuring Zope for use as a PCGI, and configuring IIS to use the
pcgi-wrapper.exe, etc...

The test link:http://localhost/Scripts/Zope.pcgi

...is returning the following message within the "Temporarily
Unavailable" error response page:

!--
Error parsing pcgi info file
pcgi-wrapper-version 2.0a4
--

I have tested the file using parseinfo and get no response.


what do you mean by no response? Is it not returning anything or just no
errors?


A theory, at this point has been that there is a
conflict/incompatibility with Zope as a PCGI with IIS 5.0 on Windows
2000.


This seems to be a pcgi (Zope) error though. Only used it on NT4 and IIS4
but from the above a basic incompatibility seems unlikely (to me).


Rik




___
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] Zope Content Management System

2000-08-24 Thread Rik Hoekstra



Hi there, I am working on a project and have been looking at the Zope
Content Management System as part of the solution. However, I have a couple
of questions. From what I have seen so far, the page generation is all done
through the Zope Management Interface, and the content of the page is done
through a textarea requiring the user to have knowledge of the zope
system(DTML) and HTML. With type type of solution I am looking for however,
I need page content to be generated be users that have little or no
knowledge of HTML. What I am wondering is if it is possible to integrate
the
Zope content management system with Cold Fusion as I can allow users with
no
knowledge of HTML to use an interface designed with Cold Fusion to create
page content. I do not wish to build a content management system from
scratch with Cold Fusion. Any suggestions and/or comments would be very
helpful.

Um, intergration with Cold Fusion would be strange I think. WHat your
question is, probably, is whether you can you wysiwyg HTML editors with
Zope. Some minor inconveniences aside that mostly have to do with file
extensions, the answer is yes. As Zope speaks ftp and WebDAV and a host of
other protocols, you can easily prepare Zope content with tools like
HomeSite and Dreamweaver (and many other tools). Just try it out on a Zope
installation

hth

Rik


___
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] The tree tag, SQL and what should be simple

2000-08-24 Thread Rik Hoekstra





I thought this was going to be simple but having read numerous postings on
the
mailing list and all related HOW-TOs I can find, I think I can confirm I am
stuck. This is sad because I've just spent a very productive couple of days
with
Zope and MySQL making the world a better place.

I have a table for chickens. Basically it looks like this


snip sql

It would appear that I need to feed two things to the dtml-tree tag.
Firstly my
starting levels (my types) and then the related data underneath but I can
only
feed one SQL query to the tag. All the stuff I read seems to assume the
info at
the top level comes from the same file (and from a key id). How do I do
this or
indeed, is it possible? I have a nasty feeling I am missing something
obvious.


Unless I do not quite understand you I think you missed Anthony Baxter's
tree_and_sql howto
(http://www.zope.org/Members/anthony/tree-coding-tricks ). It will probably
give you either exactly what you want or enough ideas to get you further.

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-dev] why is manage_addZSQLMethod unavailable ?

2000-08-18 Thread Rik Hoekstra





Why does this work

dtml-call "_['testadd'].manage_addDTMLMethod('MethodId', 'Method
Title','method text')"


While this does not:

dtml-call "_['testadd'].manage_addZSQLMethod('ZSQLID', 'ZSQL Title',
'DB','','select * from data')"

Error Type: AttributeError
 Error Value: manage_addZSQLMethod

I studies the Znolk product and found that it uses _setObject directly
instead of
manage_addZSQLMethod .


In general there is an inconsistency in adding objects: sometimes you can
use the manage_addYourProduct interface, and sometimes only going through
the addProduct invocation (don't have the whole thing handy here) will do
the trick. This can get very confusing. Wouldn't know if that's the matter
here, though. I think this should be standardized in the interfaces.


but it IMHO the visibility of manage_addDTMLMethod and manage_addZSQLMethod
_should_ be the same ?



I agree


___
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] Bug zClass subobjects?

2000-08-16 Thread Rik Hoekstra




 
 (Second post)
 
 (I speak french, sorry for my english!)
 I created a ZClass, zRow.  This class can contain other ZClass: zField_Text,
 zField_Date, etc.
 This let me define the columns contained in a zRow.
 I then defined a Class zTable, wich contains zRows.
 
 Question:
 
 -  In my manage tabs, I needed to have a tab "Define columns".  To
 achieve this, I inserted a ZRow Instance (with id "Definition") in my zTable
 product definition, and a method called "Define_Columns", containing:
 

Perhaps it is a better idea to assign the Define_Columns in the Views of
you zTable zclass definition (it is a separate tab in the management
interface there). You can assign any tab name there to any method in you
zclass. 

But I'm not sure I understand this correctly


 dtml-with Definition
   dtml-var manage_main
 /dtml-with
 
 And I defined a view "Define Columns" pointing to that method.  When
 i click on the "Define Columns", I can see the manage screen of the instance
 "Definition", that's what I wanted.
 
 But when I try to add a zField to "Definition" instance, the zField
 instance is created at the zTable level,
 not IN "Definition" instance!  All the classes are derived from on
 CatalogAware, ObjectManager.

Are they by any chance nested ZClasses? If so, this is a known problem.
If not, it is not entirely clear what you're doing. In general, if you
create a ZClass instance to make it appear in the target you intend, it
is important to do so through calling it through a
manage_addProduct['yourclass'].yourclass_factory and _not_ directly
through the yourclass_add method.

But once again, it is not entirely clear to me what you try to do

 
 I HAVE to deliver the product for the end of the week, so PLEASE
 help me!


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] I think, it is a bug in acquisition

2000-08-16 Thread Rik Hoekstra





Maybe I have found a situation, where images are not working or rather
acquisition.
For example, you create 2 documents and one image
  doc1  (DTML Document)
 contents: "document 1 dtml-var doc2
  doc2  (DTML Document)
 contents: "document 2 dtml-var image
  image (Image)
 contents: image
When you put everything in one folder and try to render doc1, everything
works fine. You get your image at the end. But if you put doc1 in a folder
below like
  doc2
  image
  subfolder
doc1
you get the appended error.

When you remove the image call from doc2
everything works again.

You're probably right about this, or my Zen has left me. I did some testing
and it will work allright if you move doc2 to the subfolder. i wonder if it
is an acquisition bug, though, as it seems to work with other objects in the
same setup. Could this be an Image bug?

I checked this with JPicture - the same. Beside,
today I posted another mail with "[Zope] __call__ error message - I gave
up". In this situation I thought my coding was wrong because I wanted to
list all documents with
dtml-in "objectItems('DTML Document')"
dtml-var sequence-item
/dtml-in


try (untested)

dtml-in "objectItems(['DTML Document'])"
  dtml-var sequence-item
/dtml-in

the object items returns you a tuple with (id, object). Are you sure you
want that - it won't show on the html page

perhaps

dtml-in "objectIds(['DTML Document'])"
  dtml-var sequence-item
/dtml-in


or

dtml-in "objectValues(['DTML Document'])"
  dtml-var sequence-item
/dtml-in

will bring you more luck

Any Help?


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] TypeError trying to use Dtml-in on Zclass

2000-08-09 Thread Rik Hoekstra



I have a Zclass object called States
built with folder and renderable

When I try

dtml-in States
dtml-var sequence-item
/dtml-in


I get
Error Type: TypeError
Error Value: hasattr, argument 2: expected string, int
found



Does anyone know why this is happening?



because you feed it (some method but presumably not dtml-in)  int, not
strings.
But seriously, could you give us some more details about what your code has
and preferably a traceback also. That way we might be able to help you
better

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] dtml-with confusion

2000-08-09 Thread Rik Hoekstra

Can someone explain the difference between:

dtml-with "PARENTS[-1]"
 dtml-with squishdot
 ...do stuff here...
 /dtml-with
/dtml-with

and

dtml-with "PARENTS[-1].squishdot"
 ...do stuff here...
/dtml-with


Do they behave differently? In what way?

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 )




[Zope] Re: [ZDP] Re: [Zope-Annce] ANN: Forthcoming Zope Book

2000-07-07 Thread Rik Hoekstra




 
  We're excited about the book and think that it will fill an important
  hole the current official Zope docs.
 
 Most importantly, have you chosen an animal for the front cover yet?
 

Aren't there any pictures of Zopes?

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] Problems and ponderings

2000-07-05 Thread Rik Hoekstra



In my site I have folder with subfolders and I would like to generate

a menu to go to those subfolders.

What I have now is:

dtml-in "objectValues()"
   dtml-var sequence-key
/dtml-in

which gives emptynes.. I've tried all kinds of combinations, tricks
from the tips and howto's, but nothing.


[rh]First, why do you use sequence-key? Use sequence-item instead

dtml-in "objectValues()"
   dtml-var sequence-item
/dtml-in

second

Actually I start thinking that zope is not for me. Yes, I'm a
programmer, but here and now creating websites. I want to create a
website, not publish objects. An abstactionlayer between zope and
python would be a good thing. (and don't tell me DTML IS an
abstractionlayer. It confuses the matter, it doesn't simplify.
Including perl straight into the pages would be simpler. Not to
mention that Python is actually decently documented..)


[rh]No one will tell you DTML is ideal,. It's meant to be a presentation
language and for that  it's powerful. If you want to write python inside
Zope - use PythonMethods.
If you really want to put perl into your webpages - there is PerlMethods
coming up, that presumably can do the same as PythonMethods.

Anyhow, I'm not giving up yet let's check my mental image:

A zope site is an tree of objects, objects inherrit from parents.

[rh]Yes, and they acquire from parents. Acquisition is a type of dynamic
inheritance

(how
do I check if a parent exists?) so there should be a way to refere to

the parent (PARENTS[]) to refer to the current object (?).

[rh]current object is this() for most purposes.  I do not quite get what
you're aiming at. But the current object depends on the namespace and the
namespace is a stack determined by parents, using acquisition. Traversing
the namespace changing the current object, and so do dtml tags like dtml-in
and dtml-with. The best introduction to these is probably in
http://www.zope.org/Documentation/How-To/AdvancedDTML

I guess there should also be a way to refer to objects in an other
branch of the tree (I would like to have a tools folder which is also

searched when asking for a DTML-methode)

[rh]This can be accomplished (simply) by using

dtml-with "yourobject.yoursubobject"
your code
/dtml-with

or more directly

dtml-var "yourfolder.theobjectyouwant()"

But there are many other methods of doing this in more sophisticated ways,
depending on your needs


Is my mental image to limited? Does it need adjusting?


[rh]it may need adjusting in your appreciation of Zope flexibility

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] Problems and ponderings

2000-07-05 Thread Rik Hoekstra

Woops, pressed send too soon





In my site I have folder with subfolders and I would like to generate

a menu to go to those subfolders.

What I have now is:

dtml-in "objectValues()"
   dtml-var sequence-key
/dtml-in

which gives emptynes.. I've tried all kinds of combinations, tricks
from the tips and howto's, but nothing.


[rh]First, why do you use sequence-key? Use sequence-item instead

dtml-in "objectValues()"
   dtml-var sequence-item
/dtml-in

second


If the code is contained in a DTMLDocument (that is an object on its own,
unlike DTMLMethod), you will have to add a dtml-with "PARENTS[0]", like
so:

dtml-with "PARENTS[0]"
 dtml-in "objectValues()"
dtml-var sequence-item
 /dtml-in
/dtml-with

for a menu you'll have to add hyperlinks etc, but I'm sure that wasn't the
question

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

2000-07-04 Thread Rik Hoekstra




can you tell me how can I use the "cookies"

try:

dtml-call "RESPONSE.setCookie('blurk', 'nonsens')"/p


dtml-if "REQUEST.cookies['blurk']"
   dtml-var "REQUEST.cookies['blurk']"
dtml-else
   no blurk today
/dtml-if

Also see the relevant portion of the DTML reference guide
http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.4.5.html#pgfId-10470
78

and the dtml-snippet

http://zdp.zope.org/projects/zsnippet/snippets/ClientServerInteraction/SetCo
okie


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] Fun with Trees

2000-07-03 Thread Rik Hoekstra




Charlie Wilkinson writes:

After RTFMing and flailing at DTML all night, I'm about stumped.
No pun intended.

I'm trying to use dtml-tree to create a selective menu of objects based
on whether or not the object has an "add_to_menu" property.  I've pretty
much figured out that I need a wrapper around objectValues that will
filter out the objects that don't have the "add_to_menu" property.
This wrapper would be called with dtml-tree's "branches" attribute.
I'm trying to do this wrapper in a DTML method and I've gotten all the
way to where I have to return a list of "actual objects", so says the
DTML Quick Reference.

Is there someone who could 'splain to me how to build a list of objects
in DTMLese?

Here's what I have so far (obviously not working):

dtml-call "REQUEST.set('ret', '')"
dtml-in "objectValues()" sort=id
dtml-if "_.has_key('add_to_menu')"
  dtml-call "REQUEST.set('ret', ret + ' ' + _['sequence-item'])"
/dtml-if
/dtml-in
dtml-return "_.string.split(ret)"


[rh]
Try (yes, this is tested):
dtml-call "REQUEST.set('ret', '')"
 dtml-in "objectValues()" sort=id
 dtml-if "_.has_key('add_to_menu')"
   dtml-call "ret.append(id)" 
 /dtml-if
 /dtml-in
dtml-return ret

Two notes:
- the string approach is an unnecessary hack. I changed it to standard
Python list idiom
- if you append sequence-item it will include your whole method, which
presumably is not what you want in your tree. Use id.


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] queries and tiny tables and python methods... oh my!

2000-06-30 Thread Rik Hoekstra



Timothy Wilson wrote:
 
 Hi everyone,
 
 (Please excuse the vague Wizard of Oz reference in the sub., but my brain
 may be imploding. :-)
 
 I'm trying to merge several type of Zope objects, and I'm getting lots of
 little errors. I wonder if someone could suggest where my problem lies.
 
 1. I'm querying our LDAP server to retrieve the records for a given person
 in the directory. No problem there.
 
 2. I'm parsing one of the entries in the LDAP directory to retrieve the
 user's location. Python method code is simple.
 
 3. I'm using a Tiny Table to look up a value for one of the parsed strings.
 Easy.
 
 The problem is hooking them all together. Passing the query to a
 PythonMethod is throwing up the following error:
 
 Error Type: TypeError
 Error Value: argument l: expected read-only character buffer, instance found

The error means you're trying to split up a string, but the argument is
no string, but an instance (a Python Object). In many cases this is
caused by an omission of parenthesis, like so 

called_object instead of called_object()

in which case the object is referenced instead of called and nothing is
returned (of course). I did not find the culprit in your description,
though. 


snip

 
 (Object: parseLocation)
 (Info: ((['SB_B208'],), {}, None))
   File string, line 2, in parseLocation
 TypeError: (see above)
 

I do not quite get what part you want to parse. Is it 'SB_B208'?
accessing this in python is a bit strange due to the returned value. You
get to the 'SB_B208'part in the following way:

whateverreturnstheresult(someargument)[0][0][0], meaning (in this
case):

the first element (of the list) of the first element (of the first
tuple) of the returned tuple


 
 parseLocation is a Python Method which takes 1 argument (a string) and
 returns the first element of the list that's formed by splitting the string.
 That first element is a two-letter code that's looked up in a Tiny Table
 called buildingCodes which returns the full name of the building.
 
 OK, it looks to my relatively inexperienced eyes that the Python Method
 isn't getting an argument of the type is expects.

yep, see above

 
 Here's the code for parseLocation ('l' is the argument):
 
 x = string.split(l, '_')
 return x[0]

I may be reading badly, but can you explain what the l is (or is
supposed to be)? Is it the tuple in the traceback?


 
 (BTW, changing it to x = string.split(`l`, '_') eliminates the error, but
 nothing is rendered.
 
 qry_person is an ZLDAP filter method that takes one argument (uid). The
 original dtml to display this mess looks like:
 
 dtml-call "REQUEST.set('user_id', user_id)"
 dtml-in "qry_person(uid = user_id)"br
   dtml-in "buildingCodes(parseLocation(l))"
 dtml-var buildingbr  # 'building' comes from the Tiny Table
   /dtml-in
 /dtml-in
 
 I'd appreciate it if anyone has any ideas about this. I'm probably making
 the whole thing too complicated, but for reasons of code reuse, this seemed
 like the most efficient approach.


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] Newbie: String work

2000-06-27 Thread Rik Hoekstra



Andy Gates wrote:
 
 Simple stuff from the simple people today: string manipulation.
 
 I have a string variable which has various chunks delimited by double
 tildes ~~. In order to do what I need to do, I need to extract the
 section of the string after the last double-tilde, so that
 
 "fred~~bloggs" returns "bloggs"
 "fred" returns "fred"
 "fred~~bloggs~aardvark" returns "aardvark"
 
 I can see that rfind is the thing I need to use, but as usual (gah!
 newbie!) I'm stuck on the syntax.  Help!


what about (in convoluted DTML very lightly tested):
dtml-call "REQUEST.set('instr', yourstring)"
dtml-call "REQUEST.set('ix', _.string.rfind(instr,'~~'))"
dtml-var "instr[ix]"

If you want the part after the ~~, you'll have to add +2 to the string
index, like instr[ix+2:]. Making this fit for the 'fred' case is left as
an exercise for the reader ;-=)

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] ZCatalog counting?

2000-06-27 Thread Rik Hoekstra

A presumably simple question:

Is there an easy way to count the number of occurences of a certain meta
type in a Catalog? E.g: I want a dtml snippet that outputs:

There are 123 DTML Documents in the Catalog.

I've browsed the howto's, but didn't find anything like this. Can anybody
offer me some assistance?



To quote a mail by RD Murray from a gew days ago:

 How do I find the size of the results returned by the catalog?
 dtml-let results=Catalog()
 dtml-var "_.len(results)" -- the results' length --
 /dtml-let

Also at the zdp site:

http://zdp.zope.org/projects/zsnippet/snippets/DTMLContent/CatalogResLength

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] ZWiki/Structured Text formatting surprise

2000-06-27 Thread Rik Hoekstra




Hi,

Just noticed that (_.None,_, gets rendered as (.None,, in a structrued
text wiki. Not useful :/


Hm, in a structuredtextdtml Wiki (such as the Zope edu Wiki) this works. See
the SandBox there http://www.zope.org/Wikis/zope-edu/SandBox. So I can't
reproduce it now.


I've got around this by doing ('_'.None,_, but that's not really the
right idea.

Does anyone know of the proper way of escaping this?


Won't the !_.None help?

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] ZCatalog counting?

2000-06-27 Thread Rik Hoekstra




On Tue, 27 Jun 2000, Alexander Limi wrote:

 Is there an easy way to count the number of occurences of a certain meta
 type in a Catalog? E.g: I want a dtml snippet that outputs:

Couldn't you do:

dtml-call "REQUEST.set('counter', 0)"

dtml-in "objectValues('DTML Document')"
  dtml-call "REQUEST.set('counter', counter+1)"
/dtml-in

This folder (dtml-var title_or_id) has dtml-var counter
number of objects with the meta type DTML Document.


um, not to be nitpicking, but if you'd want to know the number of objects
with a certain meta-type in a folder, the following is a bit shorter and
saves you an iteration:

 untested

dtml-call "REQUEST.set('counter', _.len(objectValues(['DTML Document'])"
This folder (dtml-var title_or_id) has dtml-var counter
 number of objects with the meta type DTML Document.

dtml-let counter="_.len(objectValues(['DTML Document'])"
   This folder (dtml-var title_or_id) has dtml-var counter
   number of objects with the meta type DTML Document.
/dtml-let

/untested not entirely sure of the dtml-let syntax, but you get the idea

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] parsing strings in DTML

2000-06-26 Thread Rik Hoekstra



I'm working on what should be a simple problem.

I pulling an address out of an ldap query and the data is in the form of a
$-separated string. Example:

101 Main St.$Anytown$MN$12345

Please correct me if I'm wrong, but I could probably do dtml-call
"REQUEST.set('parsed_address', _.string.join(old_address, '$')" except for
the fact that getting "old_address" (the $-separated one) would require its
own dtml-var old_address statement. I can't nest dtmls so how to I
combine these?


I'm not sure I get you right.
try something like (untested):

dtml-call "REQUEST.set('parse_address', _string.split(old_address, '$')"

for parsing the string


Second question... Once I've got my string parsed into a list called
"parsed_string", what's the syntax for accessing certain elements of the
list?

By slicing:

dtml-call "parsed_string[0]"

gets you the first element parsed_string[1] the second etc

parsed_string[1:] is everything after the second ;-) element of the list

parsed_string[:5] is everything up to element 6

parsed_string[1:5]  is everything from element 2 to element 6

parsed_string[-1] is the last element of the list.

If you want to know more, you should probably look at the Python docs, as
this is Python stuff.


P.S. Maybe I should do this in an external or python method, but I thought
it would be overkill for a single operation like this. Am I wrong?


No, I think you're right, but others may disagree.


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] Python install included with zopeBeta.exe?

2000-06-23 Thread Rik Hoekstra



Starting over...beta2 not working on IIS.
Uninstalling Python
Uninstalling Zope (why does running unwise.exe not remove EVERYTHING?)

It almost never does remove everything

Deleting everything in Zope web site virual directory.
Looks like I installed Python and then Zope installed Python again.

? I missed the part where you installed Python. But Zope does install it's
own Python, to be able to run it right away, without having to fiddle with
PYTHONPATH, name clashes and all.

Did I miss this in the docs? (that Zope installs python in addition to
installing Zope with the x86.exe?)

Are there official installing docs then? Never seen 'em (there is something
called installation tree at the zdp site, but I lost track of that).

Seems like beta2 is working properly now (Quickstart and all).


Good.


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] Writing to LocalFS

2000-06-22 Thread Rik Hoekstra




(thanks to Jonathon and Dieter... for the permissions problem. That
did the trick)

Again, after some searching, I am looking for the syntax to write  a
file / append to a file in a Local File System.

This is certainly where my Python days seem to slow my down b/c I
would have just:

contents = open('/path/file.txt', "r")

to read and

contents = open('/path/file.txt', "a")

to append.

I am sure that I am missing some bit of Zope Zen here...

Please point me in the right direction...




Not sure if this was the question, but here's a relevant quote from the
python library reference
http://www.python.org/doc/current/lib/built-in-funcs.html#l2h-139

quote
Return a new file object (described earlier under Built-in Types). The first
two arguments are the same as for stdio's fopen(): filename is the file name
to be opened, mode indicates how the file is to be opened: 'r' for reading,
'w' for writing (truncating an existing file), and 'a' opens it for
appending (which on some Unix systems means that all writes append to the
end of the file, regardless of the current seek position).

Modes 'r+', 'w+' and 'a+' open the file for updating (note that 'w+'
truncates the file). Append 'b' to the mode to open the file in binary mode,
on systems that differentiate between binary and text files (else it is
ignored). If the file cannot be opened, IOError is raised.
/quote

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] Problem with adding items to ZClass instance

2000-06-20 Thread Rik Hoekstra

 
 I don't think there's anything "special" about my ZClass.  It's derived from
 Catalog Aware and ObjectManager.  I believe I reproduced it without the
 Catalog Aware and got the same results.
 
 I'm using Andy Dustman's version of the MySQLDA and TinyTable v0.8.2.  They
 both work just fine once I get the objects in the right place.  Maybe the
 problem just happens to be with these two products, but I have no clue.
 
 You're welcome to fetch the product at
 ftp://ftp.logicetc.com/pub/Zope/IssueTracker.zexp if you want to give it a
 look.  It's a one day throw-together port of the issue tracking system used
 by the PHP project with modifications for my own needs.
 


OK, I downloaded it and I think I found your problem (not wure how to
remediate this, though). If you look in the source of the management
screen
http://localhost/somefolder/IssueTrackerInstance/manage_main, the
dropdown list for adding Product looks like this:

  FORM ACTION="http://localhost/somefolder/IssueTrackerInstance/"
METHOD="GET"
  SELECT NAME=":method"
ONCHANGE="location.href='http://localhost/testhier/blup/'+this.options[this.selectedIndex].value"
OPTION value="manage_workspace" DISABLEDAvailable Objects
  OPTION value="manage_addProduct/OFSP/documentAdd"DTML Document
  OPTION value="manage_addProduct/OFSP/methodAdd"DTML Method
  OPTION value="manage_addProduct/MailHost/addMailHost_form"Mail
Host
  OPTION value="manage_addTinyTableForm"TinyTable
  OPTION value="manage_addProduct/OFSP/manage_addUserFolder"User
Folder
  OPTION value="manage_addZMySQLConnectionForm"Z MySQL Database
Connection
/SELECT
  INPUT TYPE="SUBMIT" VALUE=" Add "
  /FORM

As you see, most of the items have a manage_addProducts/ as a start.
Not so with TinyTables and MySQLConnection. They call the
add_TinyTableForm and manage_addZMySQLConnection form. They do not
switch the namespace to manage_addProduct (not in the form). Why this is
a problem, I can't tell, but this _is_ the problem.

I'm not quite sure about the solution. Probably it's best to make a
custom manage_main form that does the right incantations for adding
products and then map this to your Contents View in the ZCLass
definition.

As a side I'd like to remark that all products should comply with the
same manage_addProduct interface, because the current situation leads to
nasty problems.

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] Internationalization 2nd post

2000-06-20 Thread Rik Hoekstra




How are my fellow Zopers handling Internationalization, especially text.

We have a site that is composed of several hunderd pages. We don't use
classes but we have made heavy use of aquistion though. For example we
have one back button that is aquired thoughout the site etc etc.
Basically if the functionality (or code) is used in more than one place
it has been but into a method and aquired.

Any thoughts or hints?


You could use a number of different 'language specific' folders and make
your site acquire from them. There is a caveat, however, because you have to
be careful to use acquisition in this way. There is a bit of information in
my Changing Contexts in Zope 2
http://www.zope.org/members/Hoekstra/ChangingContexts1

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

2000-06-20 Thread Rik Hoekstra




I have reinstalled zope and zodb, and copied the data.fs across.  It was
about two days old.  All the changes that I had made were gone.  Luckily I
made a backup of my app yesterday by exporting it.

I must have a bad understanding of how this works.  I had imagined that
everytime I hit CHANGE, that the data.fs file would have been updated.


It should


When the computer crashed where were all my current changes?  Is there a
temp file I might be able to recover, as I am still missing quite a few
hours work!


THis never happened to me before, but it did yesterday (zope 2.1.4 on Win95)
! This seems like a bug.

As for your error: I have had to throw away a corrupted (read: one that
couldn't be opened) logfile before on NT. It made it possible to restart
Zope again. I have wondered what strange corruptions could happen to a
logfile, but apparently this may happen at times (especially if the logfile
is getting big)

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] Problem with adding items to ZClass instance

2000-06-19 Thread Rik Hoekstra



Ron Bickers wrote:
 
 On Sun, 18 Jun 2000, Rik Hoekstra wrote:
 
  This is not so easy to answer. ZClasses do strange things to adding items.
  If your ZCLass definition (in the Product) is nested in another ZClass, then
  it is your ZClass. If the ZClass  definition is defined in the top level of
  your product. There may be other things going on, including all of the above
  ;-)
  You'll need to provide more details to  be able to say more about this.
 
 I'm not sure what kind of information would help.  Let me know what and
 I'll be happy to provide it.  I'll provide the Product .zexp which
 includes a single top-level ZClass, a couple dozen methods and a single
 property sheet, if that would help.  There's nothing especially complex
 about it.  It uses ZSQLMethods (w/ MySQLDA) and TinyTables, and once I can
 get the stuff in the right place in the instance, everything works just
 fine.

Hm, this is getting hard to answer. Adding normal instances of ZCLasses
to other ZClasses should work. Are you adding everything straight from
the management interface or programmatically from DTML? 
If from the management interface, are you sure you always add TinyTable
etc from within the instance?
If programmatically, could you send the code?

Perhaps you could try and adding one of the problem products in another
way (from a dtml method instead of the management interface or the other
way around).


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

2000-06-19 Thread Rik Hoekstra



 
 I have a very simple documentclass in very simple structure in method that
 should return the properties of the document:
 
 dtml-call "REQUEST.set('tid', REQUEST.cookies['careermanid'])"
 dtml-with RESULTS  // RESULTS is a ZClass Object Manager
   dtml-call "REQUEST.set('tmp', _.getitem(_['tid']))"  // tmp is a
 document with an id equal to the cookie
   dtml-return "tmp.propertyIds"

this line should read:

dtml-var "tmp.propertyIds()"

Two things going wrong:

1. the dtml-return tag is for DTML Methods that should just return
something. You want dtml-var.
2. you call propertyIds in an expression (the line is shorthand for 
dtml-var expr="tmp.propertyIds()" - in that case you have to call it
as a function. 

 /dtml-with
 
 During the application i add properties to the document and want to display
 them with the above method.  The Property ids does not get shown though.
 I've tried:
   dtml-with tmp
 dtml-var propertyIds
   /dtml-with

this should get you a list, like ['title', 'prop1, ...]


 and also:
   dtml-in "tmp.propertyIds"
 dtml-return sequence-item
   /dtml-with

this doesn't work for reasons outlined above.


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

2000-06-19 Thread Rik Hoekstra




Thanks Rik it works.

I've noticed in some cases that one puts empty brackets at the end of
certain zope object methods.  Is that there for methods that can take
parameters?


[rh]Um, not quite, it has to do with the way of calling the object methods
in question. DTML has two ways of calling: by name and through expressions.

1. The 'normal' Zope way of writing things is dtml-var  objectValues. This
is shorthand for dtml-var name="objectValues".

2. The other way is dtml-var "objectValues". This is shorthand for
dtml-var expr="objectValues". Everything inside the expression is treated
as a python expression. If you call it without the brackets, you're just
referencing the method. If you try that in a DTML Method and look in the
source of the diplayed document you'll see something like
Python Method object at 13fcbf0. If you want to _call_ the method, you'll
have to add the brackets (with or without arguments).

Hope this is clear.



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] Problem with adding items to ZClass instance

2000-06-19 Thread Rik Hoekstra


 Hm, this is getting hard to answer. Adding normal instances of ZCLasses
 to other ZClasses should work. Are you adding everything straight from
 the management interface or programmatically from DTML?
 If from the management interface, are you sure you always add TinyTable
 etc from within the instance?
 If programmatically, could you send the code?

 Perhaps you could try and adding one of the problem products in another
 way (from a dtml method instead of the management interface or the other
 way around).

The items I'm adding aren't other ZClasses, but rather from python
products.
I haven't come up with an exhaustive list of which items cause the problem
and which don't, but I know at least the TinyTable and ZMySQL DB Connection
do, and the DTML Methods/Documents, MailHost and UserFolders don't.

Everything is being added via the interface.  I haven't tried adding them
via DTML.  I've never done that because I haven't had a use for it, so I'm
not sure I know how.

I setup a series of screen shots to demonstrate exactly what's happening.
Take a look at http://www.logicetc.com/Test/zclass_problem if you're
interested.


I looked at it, and found it fishy. The strange thing is, I tried to
reproduce it, but I can't. To be sure I added a tiny table plus to an
instance not a straight tiny table and a ZODBC adapter, but I doubt whether
this would make a difference. Anyway, they both work straight away. This is
getting very strange indeed. It seems strange things are happening to your
namespace.

I can think of some things that may cause problems, but this is all
speculation.

This may be a bug, but then it's a special one. Anything special about your
ZClass - what does it derive from (just objectmanager? anything else that
might cause strange behaviour?).
Is there a subobjects tab in it's definition? Are the products in there?

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] Problem with adding items to ZClass instance

2000-06-18 Thread Rik Hoekstra


I discovered something bizarre that happens in my 2.1.4 and 2.2b1
installations.



Bizarre, yes, unusual, no.

I have a ZClass based on ObjectManager.  In an instance of the ZClass, I
can
"Add" most of the available objects (DTML Documents, DTML Methods, User
Folder, MailHost to name a few).  However, for at least two items
(TinyTable
and ZMySQL DB Connection), when I add them, they show up in the container
folder, not in the ZClass instance.  Then, if I check it to delete it, it
gives a "does not exist" error.  Upon refreshing the container folder, the
item still shows, but then I *can* delete it.  Equally interesting is that
I
can Copy the item from the container folder and successfully Paste it into
the ZClass instance.  However, since ZMySQL DB Connections don't support
Copy/Paste, that won't work.

What's going on?  Is it a problem with my ZClass, the Product manage_add,
or
Zope?  Or me?



This is not so easy to answer. ZClasses do strange things to adding items.
If your ZCLass definition (in the Product) is nested in another ZClass, then
it is your ZClass. If the ZClass  definition is defined in the top level of
your product. There may be other things going on, including all of the above
;-)
You'll need to provide more details to  be able to say more about this.

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 )




  1   2   >