RE: [Zope] Asked a million times already... Im sure

2000-11-06 Thread Max Møller Rasmussen

From: Chris Trowbridge [mailto:[EMAIL PROTECTED]]

>I know that many people have probobly already asked this, but how would I
do the >equivilant of a server side include?
>It seems obvious enough from examples that it is merely...

> 

>but I always end up with either blank content or '[]'

If you want to include it from a file on the computer and not an object in
Zope then you should probably use the FileSystem product to make it visible
to your file.

If the file you want to include is in Zope allready the you should make
shure that the incl_file is in your out_files' aquisition path. ie. directly
beside you document or in a stright line between your document and the root.
Or you should adress it directly.

/
folder1
incl_file
output_dtml
folder2
folder3

Here output_dtml can se and "include" incl_file

/
folder1
incl_file
folder2
output_dtml
folder3

Here it cannot. Except if you adress it like: 

 (Think of it as ../folder1/incl_file)

Regards Max

___
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] LDAP KeyError problem

2000-11-06 Thread Michael Blewett

Hi Everyone,

We have a problem with the LDAP Adapter. I've searched the entire Zope Doc 
website and thru the mailing list archives and can't find any examples of 
anything that come remotely close.
If we define an LDAP filter (called Academics) as thus:

Base DN: o=Monash University, c=au

and search filter as:
(&(ou=Department of Biological 
Sciences)(employeetype=Full-time)(employeetype=Academic Staff))

..it gives me a perfect list of all my LDAP entries for all of my full-time 
academic staff. i can see all of the attributes perfectly when I click the 
Test tab.
No problems there.



However, when I try to use some of the entries in a dtml-in statement, half 
of the entries give me a KeyError.

for eg.






Surname:   
Given Name: 
Initials: 
Gender:  
Phone: 






If I try to view the above document, it gives me a KeyError on phonenumber.
ie
Zope Error

Zope has encountered an error while publishing this resource.

Error Type: KeyError
Error Value: phonenumber



Traceback (innermost last):
   File /usr/Zope/lib/python/ZPublisher/Publish.py, line 222, in publish_module
   File /usr/Zope/lib/python/ZPublisher/Publish.py, line 187, in publish
   File /usr/Zope/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
 (Object: Traversable)
   File /usr/Zope/lib/python/ZPublisher/Publish.py, line 171, in publish
   File /usr/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
 (Object: index_html)
   File /usr/Zope/lib/python/ZPublisher/Publish.py, line 112, in call_object
 (Object: index_html)
   File /usr/Zope/lib/python/OFS/DTMLDocument.py, line 177, in __call__
 (Object: index_html)
   File /usr/Zope/lib/python/DocumentTemplate/DT_String.py, line 528, in 
__call__
 (Object: index_html)
   File /usr/Zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob
 (Object: Academics)
KeyError: (see above)



If I remove that line, it works perfectly.

the same thing happens on a number of other attributes including title, 
roomnumber, mail, facsimiletelephonenumber  (all the ones I want/need 
really...).


Can anybody give me any clues what I'm doing wrong here? Has anybody hit 
this problem before?

We are using Zope 2.2.2, Python version: 1.5.2, and ZopeLDAP 1.0beta1

Any help greatly appreciated


  - Michael

~~~
Michael Blewett
Computer Support Mgr - Biological Sciences
Monash University (Clayton Campus)
Victoria Australia 3168

"I'm out of my mind at the moment, but feel free to leave a message..."




___
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] ZSybaseDA not working

2000-11-06 Thread Manuel Amador (Rudd-O)

Hi to everyone, especially the experts =)

The reason for this email is an urgent need for a Sybase ASE database to
work properly.  Here's the deal.  It worked like a charm on windows with
ODBC.But now I moved to Linux, compiled ZSybaseDA and installed it. 
It works for selects and updates, etcetera, both in the test tab and in
ZSQL methods.

BUT when I try to call a stored procedure, well, lemme paste the
traceback.  A traceback is worth a million explanations:

- traceback 
Zope Error

 Zope has encountered an error while publishing
this resource. 

 Error Type: Error
 Error Value: Error processing exec
sp_gn_regionales
 '0990006792001' , null , NULL Stored procedure
'sp_gn_regionales'
 not found. Specify owner.objectname or use
sp_help to check whether
 the object exists (sp_help may produce lots of
output). 



 Troubleshooting Suggestions

 The URL may be incorrect. 
 The parameters passed to this resource may
be incorrect. 
 A resource that this resource relies on may
be encountering an error. 

 For more detailed information about the error,
please refer to the HTML
 source for this page. 

 If the error persists please contact the site
maintainer. Thank you for your
 patience. 






 



   Cambiada el: 2000/10/30
16:03:22.4513 GMT-5
  Website copyright grupo SUPÁN. Diseñado por Manuel
Amador (Rudd-O), OpenCorp
 
S.A.



Traceback (innermost last):
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /usr/local/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /usr/local/zope/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: index_html)
  File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: index_html)
  File /usr/local/zope/lib/python/OFS/DTMLDocument.py, line 177, in
__call__
(Object: index_html)
  File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: index_html)
  File /usr/local/zope/lib/python/OFS/DTMLMethod.py, line 168, in
__call__
(Object: form)
  File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: form)
  File /usr/local/zope/lib/python/OFS/DTMLMethod.py, line 168, in
__call__
(Object: dw_gn_regionales)
  File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: dw_gn_regionales)
  File /usr/local/zope/lib/python/DocumentTemplate/DT_In.py, line 633,
in renderwob
(Object:
sp_gn_regionales(cod_empresa=REQUEST.cod_empresa,cod_regional=''))
  File /usr/local/zope/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
(Object:
sp_gn_regionales(cod_empresa=REQUEST.cod_empresa,cod_regional=''))
(Info: REQUEST)
  File , line 0, in ?
  File /usr/local/zope/lib/python/Shared/DC/ZRDB/DA.py, line 453, in
__call__
(Object: sp_gn_regionales)
  File /usr/local/zope/lib/python/Products/SybaseDAv2/db.py, line 299,
in query
  File /usr/local/zope/lib/python/Products/SybaseDAv2/db.py, line 333,
in _error
Error: (see above)
- end traceback --

I'm baffled.  I just got too accustomed to Zope so that we committed to
the development of reports on the Web instead of with PowerBuilder.  If
this doesn't work, I will have to sustain several hours of psychological
punishment, and I will have to dump Zope in favor of a better solution. 
These kinds of things make Zope not suitable for enterprise
applications, where you can't rely on poorly documented things like
ZSybaseDA.  I'm even angry at liking Zope now.

For the record, I'm using Sybase ASE 11.9.2 with the latest OpenClient
RPM from Sybase.com.  As you can see, this is a ZSybaseDA problem since
everything but the stored procedures return data or alter/update it.

I need an answer soon.  OR, at least a hint of where could I tap
information sources to DigitalCreations directly for commercial support,
regarding Sybase support for our needs.
I read about the agreement between Sybase and Digital Creations.  But I
can't find any information regarding Zope support in either Digital
Creations' or Sybase's web sites.

And I have exactly one week.

Any suggesti

Re: [Zope] images in directories

2000-11-06 Thread Jason C. Leach

hi,

Sure they are.  If you ftp a jpg to the server it comes up with an id of
bla.jpg, you can then refrence it in html just like you would on an Apache
server or whaterver 

j.

..
. Jason C. Leach
... University College of the Cariboo.
.. 

On Mon, 6 Nov 2000, Chris Withers wrote:

> 
> 
> Pete Prodoehl wrote:
> > 
> > Is it possible to have an image named "image.gif" or "image.jpg" ? (Are file
> > extensions allowed? If so, how  are those objects addresses?)
> 
> 
>   
> 
> 
> or
> 
> 
> 
> cheers,
> 
> Chris
> 
> 
> > 
> > Pete
> > 
> > > --
> > > > "Farrell, Troy" wrote:
> > > >
> > > > 
> > > >   
> > > > 
> > >
> > > This also works:
> > >
> > > 
> > >
> > >
> > 
> > ___
> > Zope maillist  -  [EMAIL PROTECTED]
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> 


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




[Zope] Asked a million times already... Im sure

2000-11-06 Thread Chris Trowbridge



I know that many people have probobly already asked 
this, but how would I do the equivilant of a server side include?
It seems obvious enough from examples that it is 
merely...
 
 
 
but I always end up with either blank content or 
'[]'
 
sorry if you've answered this too many 
times
 
Thanks
 
Chris


[Zope] ISPs that host zope

2000-11-06 Thread Keith Alperin

Greetings.  I am a complete zope newbie but am enthralled by the technology.
I am about to begin working on a personal web project and would like to
build it in/with zope.  Can anyone recommend a good ISP that will:
-host and support zope
-give me access to an RDBMS (MySQL or any other system would more than
suffice)
-give me a reasonable amount of space (>50MB)
-not break my budget (<$30.00 per month.)

Does such an animal exist?  Please let me know what your experiences are
with zope-friendly ISPs regardless of whether they meet my aforementioned
criteria.

Thank you so much.

Keith R. Alperin
Sr. Web Developer
Ignite Sports Media
[EMAIL PROTECTED]  


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




Re: [Zope] dtml-in over the output from my method

2000-11-06 Thread Tim Hicks

- Original Message - 
From: Max M <[EMAIL PROTECTED]>
To: Tim Hicks <[EMAIL PROTECTED]>; Zope@Zope. Org <[EMAIL PROTECTED]>
Sent: Monday, November 06, 2000 9:48 PM
Subject: RE: [Zope] dtml-in over the output from my method




> 
> def list_messages(self):
> 
> class msg:
> def __init__(self, msgnum, msgfrom, msgsub):
> self.msgnum  = msgnum
> self.msgfrom = msgfrom
> self.msgsub  = msgsub
> 
> msgList = []
> lr = open(self.user_dir+'/msg_list', 'r')
> spl = re.compile('\s\|\s')
> for msg_line in lr.readline():
> num_from_sub = []
> num_from_sub = spl.split(msg_line, 2)
> 
> # Oh no ... this wont cut it!
> #self.msgnum = num_from_sub[0]
> #self.msgfrom = 'This is from UNKNOWN'
> #self.msgsub = 'My special subject'
> #return self.msgnum, self.msgfrom, self.msgsub
> 
> # Do it like this:
> msgList.append(msg(num_from_sub[0],'This is from UNKNOWN',
>'My special subject'))
>  return msgList
> 
> 

Brilliant, it works a treat. Thanks very much.

tim


___
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] testing a product, then it disappears after restart

2000-11-06 Thread Tim Hicks



I am trying to create a zope product and it 
basically works in python, so I thought I would start trying to 'zopify' it. I 
created a directory in the zope Products directory called zIMAP and placed my 
code in there, along with a __init__.py file to initialise the product. Here is 
what it looks like,
 
    import zIMAP
 
    def 
initialize(context):    """Initialize 
the zIMAP 
product."""    
    
context.registerClass(    
zMAP.zimap,constructors 
= (zIMAP.manage_addzIMAPForm, zIMAP.manage_addzIMAP), icon = 
'')
The main bit of my product code is in a file called 
zIMAP.py. When I restarted zope, my zIMAP product appeared in the product 
management list (broken, as I'd expected). I looked at the debug info that zope 
provides for broken products and made some changes to the code... followed by 
restarting zope. I then got a different error from the broken product info 
screen. However, when I made changes to the code and restarted zope this time, 
it was as if I had done nothing. The same error was there (despite that 
particular line of code being different, and in fact at a different line). I 
could not make zope recognise my changes no matter how many times I restarted 
zope. So I tried deleting the product from the product management screen. It did 
indeed go away, but now it won't come back! When I delete any other working 
product, it simply reappears next time I restart zope. What has gone wrong with 
my product? How can I make zope recognise it again?
 
I have included the top of my zIMAP.py file as well 
in case it is required.
 
I'd really appreciate any help.
 
tim
 
top of zIMAP.py
 
 
import imaplib, re, string, sys, os, 
DocumentTemplateimport Globalsfrom Globals import Persistent, 
Acquisitionimport AccessControlimport OFS
 
class zimap 
( Acquisition.Implicit, Persistent, AccessControl.Role.RoleManager, OFS.SimpleItem.Item, ):
 
 """zIMAP - Zope Product for displaying IMAP 
mailbox contents. """
 
 index_html =  
DocumentTemplate.HTMLFile("zIMAP1.dtml") manage_addzIMAPForm = 
Globals.HTMLFile('add_zIMAP', globals())
 
 meta_type = 'zIMAP (webmail)'
 
 def __init__(self, 
host):  self.host = host  self.product_root = 
'.'
 
 class email:
 
  def connect(self, user, 
passw):   self.user = user   self.passw = 
passw    
 self.M = 
imaplib.IMAP4(self.host)   self.M.login(self.user, 
self.passw)   self.user_dir = 
zimap.product_root+'/spool/'+self.user   email.makefiles(self)
 
...
 


RE: [Zope] Help wanted on Zope ZClasses/DTML please.

2000-11-06 Thread Bowyer, Alex

Thanks for the e-mail Seb. I am afraid I am still having problems here, so I
will show my code again, and hopefully you or someone else will be able to
help.

To recap : I am creating a news page and an interface to edit it using two
custom ZClasses, Article and Page. A Page object contains several Articles.
The following code is from a script that allows the user to delete an
Article from the Page. This method belongs to the Page class, so we are
currently in the scope of the Page. This script is supplied with the title
of a news article to be deleted, it should then delete the Article from the
Page and report back.








  
  
  
  
  


  
  
  
  

  
  

  



  Article not found
  Could not find the article to delete.Return to
maintenance page

  Article not deleted
  Deleted article '&dtml-the_match;' (id='&dtml-the_id;').Return to maintenance page





Basically I think I am somehow passing the wrong parameters to
manage_delObjects

The line
  
causes an error 'loop over non-sequence'

This made me think that the argument has to be a sequence so I tried
  
but this fails because as you say it looks for an object called the_id and I
need to pass in the value of the_id not the name of it.

Ideally I want to say

but again this fails to find the object.

Any ideas?

Thanks for helping,

Alex

> -Original Message-
> From: Seb Bacon [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 06, 2000 8:50 PM
> To: Bowyer, Alex; [EMAIL PROTECTED]
> Subject: RE: [Zope] Help wanted on Zope ZClasses/DTML please.
> 
> 
> 
> > I have worked out thanks to Seb's comments that the problem I
> > have with the
> > use of manage_delObjects is (I think) that I am passing in 
> the title or id
> > of the object to be deleted rather than the object itself.
> 
> Not quite... manage_delObjects takes a string which is the id 
> of the object
> to be deleted.  Your example
> 
> 
> 
> was passing a string 'the_id' to the method.  I might have 
> interpreted what
> you were trying to do wrongly, but I believe you actually 
> wanted to pass the
> _value_ of the_id.
> 
> > I want to put the object into the REQUEST so I can still 
> access it from a
> > different namespace - at the point I want to do the 
> deletion, my target
> > object is out of scope.
> 
> In fact you just have to put the correct string into the 
> REQUEST and then
> make sure you have the object you're trying to reference in 
> your current
> namespace, e.g. by using  "manage_delObjects(the_id)">.  If you need more 
> help, post the
> snippet you're working on again.
> 
> seb.
> 

___
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] problems with Openticket in Zope

2000-11-06 Thread Andrew Miles

Hello,

I have just installed the Openticket, ticketing system in Zope, but 
am having some troubles.  I can log into it as an ACL user and add a 
new client to it, but when I try and create a new ticket, I get an 
error of:

Zope Error
Zope has encountered an error while publishing this resource.

Error Type: AttributeError
Error Value: 'string' object has no attribute 'date_time_stamp'

Traceback (innermost last):
   File /usr/local/zope/2-1-2/lib/python/ZPublisher/Publish.py, line 
222, in publish_module
   File /usr/local/zope/2-1-2/lib/python/ZPublisher/Publish.py, line 
187, in publish
   File /usr/local/zope/2-1-2/lib/python/Zope/__init__.py, line 221, 
in zpublisher_exception_hook
 (Object: Traversable)
   File /usr/local/zope/2-1-2/lib/python/ZPublisher/Publish.py, line 
171, in publish
   File /usr/local/zope/2-1-2/lib/python/ZPublisher/mapply.py, line 
160, in mapply
 (Object: add_call_post)
   File /usr/local/zope/2-1-2/lib/python/ZPublisher/Publish.py, line 
112, in call_object
 (Object: add_call_post)
   File /usr/local/zope/2-1-2/lib/python/OFS/DTMLMethod.py, line 172, 
in __call__
 (Object: add_call_post)
   File 
/usr/local/zope/2-1-2/lib/python/DocumentTemplate/DT_String.py, line 
528, in __call__
 (Object: add_call_post)
   File /usr/local/zope/2-1-2/lib/python/DocumentTemplate/DT_Let.py, 
line 147, in render
 (Object: rc="req_fields(REQUEST.form,
 [('contact_name', 'Contact Name', 'string'),
  ('problem_summary', 'Problem Summary', 'string')])")
   File /usr/local/zope/2-1-2/lib/python/Shared/DC/ZRDB/DA.py, line 
446, in __call__
 (Object: sqlNewTicket)
   File 
/usr/local/zope/2-1-2/lib/python/DocumentTemplate/DT_String.py, line 
528, in __call__
 (Object: )
   File 
/usr/local/zope/2-1-2/lib/python/Products/OpenTicket/OpenTicket.py, 
line 162, in date_by_db_type
 (Object: Traversable)
AttributeError: (see above)



Any one seem this before or have any ideas what might be causing this?

The system I'm using is Zope 2.2.2, PoPy-1.3.6, and OpenTicket 1.0b2 
on a LinuxPPC system.

Thanks!

andrew

-- 
Andrew Miles | Systems Administrator

IN2 | 205 Hudson Street 7th Floor NYC 10013
Phone 646.613.2027 | Fax 646.613.0648 | Pager 800.776.0376



___
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] catalog DTML Document

2000-11-06 Thread Wolfgang Strobl

On 6 Nov 2000, at 21:46, Dieter Maurer wrote:

> Wolfgang Strobl writes:

>  > "Finding"a bunch of DTML Documents into a Zcatalog is easy. 
>  > But how to do that programmatically? I haven't even found a way 
>  > of doing that for a single DMTL Document. 
> You call the catalog with your search terms as keyword paramters:
> 
> 
>   
> 
> 
> Have a look at the two ZCatalog tutorials on zope.org.

Who said anything about searching? :-)

A ZCatalogs management interface contains a function
"Find Items to ZCatalog". This function performs a recursive
search and adds all objects matching the specified criteria to the
Catalog. This works quite well with DMTL Documents, as long as 
one does it via the management interface.

I asked about how to perform this function (to spell it out again: 
_adding_ a _DTML Document_) programmatically, i.e. via DTML, 
of from Python code.

There is a How-To "Adding ZClass Instances Programmatically", 
and a lot of gobbledigoop about when, how and why. But I haven't 
found anything about how to "index" or "reindex" a plain and 
simple DTML Document. 


-- 
Wolfgang Strobl

___
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 over the output from my method

2000-11-06 Thread Andy McKay

The problem is the first time your for loop runs it will return to the dtml
and will not run anymore.

Rather build up a list, or list of objects inside your method and then
return. Dtml-in needs to see a list.

--
  Andy McKay, Developer.
  ActiveState.
- Original Message -
From: "Tim Hicks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 06, 2000 12:45 PM
Subject: [Zope] dtml-in over the output from my method


I am trying to create a zope product in python but have got stuck with using
the dtml-in tag to iterate over a method (or is it a function? I get a
little mixed up) of my class. Here is the method,

def list_messages(self):
lr = open(self.user_dir+'/msg_list', 'r')
spl = re.compile('\s\|\s')
for msg_line in lr.readline():
num_from_sub = []
num_from_sub = spl.split(msg_line, 2)
print num_from_sub
self.msgnum = num_from_sub[0]
self.msgfrom = 'This is from UNKNOWN'
self.msgsub = 'My special subject'
return self.msgnum, self.msgfrom, self.msgsub

And here is an extract from the dtml file that is supposed to display the
output,



&dtml-msgfrom;
&dtml-msgsub;



However, this does not produce the desired effect. I don't know if it is
obvious from what I've written, but basically, the three variables
(self.msgnum, self.msgfrom and self.msgsub) are supposed to be inserted into
the appropriate place in the table, and then the 'for' statement re-executed
(producing different values for the variables) with the subsequent values
being inserted into the next line of the table etc... until there are no
more lines to be read from lr. I'm not sure if that is clear or not, sorry.
Obviously, this does not work as the dtml-in simply iterates over each of
the returned variables (instead of over the for statement). I can't seem to
make it do what I want. Does anyone have any ideas? Much obliged if you do.

Cheers

tim




___
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

2000-11-06 Thread Holger Hoffmann

Hi,

Brown Fox wrote:
> 
> Hello,
> i want to view a dtml-document, calling it as
> a variable.
> For example:
> 
> 
> 
> 
> 

try 

> 
> 
> 
> where this file is called with this string:
> test3
> 
> The result i now get is the id, not the content of the
> file!
> 
> Thanks,
> Bruno

... Holger

___
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 over the output from my method

2000-11-06 Thread Max M

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tim Hicks

>I am trying to create a zope product in python but have got stuck with
using the
>dtml-in tag to iterate over a method (or is it a function? I get a little
mixed
>up) of my class. Here is the method,

def list_messages(self):
msgList = []
lr = open(self.user_dir+'/msg_list', 'r')
spl = re.compile('\s\|\s')
for msg_line in lr.readline():
num_from_sub = []
num_from_sub = spl.split(msg_line, 2)
print num_from_sub
self.msgnum = num_from_sub[0]
self.msgfrom = 'This is from UNKNOWN'
self.msgsub = 'My special subject'
return self.msgnum, self.msgfrom, self.msgsub
 return msgList

The dtml-in does not call your method for every iteration, it just calls
once and then expects a list in return. What you need to do is to create a
method that returns a list of objects:

def list_messages(self):

class msg:
def __init__(self, msgnum, msgfrom, msgsub):
self.msgnum  = msgnum
self.msgfrom = msgfrom
self.msgsub  = msgsub

msgList = []
lr = open(self.user_dir+'/msg_list', 'r')
spl = re.compile('\s\|\s')
for msg_line in lr.readline():
num_from_sub = []
num_from_sub = spl.split(msg_line, 2)

# Oh no ... this wont cut it!
#self.msgnum = num_from_sub[0]
#self.msgfrom = 'This is from UNKNOWN'
#self.msgsub = 'My special subject'
#return self.msgnum, self.msgfrom, self.msgsub

# Do it like this:
msgList.append(msg(num_from_sub[0],'This is from UNKNOWN',
   'My special subject'))
 return msgList


___
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] catalog DTML Document

2000-11-06 Thread Dieter Maurer

Wolfgang Strobl writes:
 > "Finding"a bunch of DTML Documents into a Zcatalog is easy. 
 > But how to do that programmatically? I haven't even found a way 
 > of doing that for a single DMTL Document. 
You call the catalog with your search terms as keyword paramters:


  


Have a look at the two ZCatalog tutorials on zope.org.


Dieter

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




Re: [Zope] Sorting 'in'

2000-11-06 Thread Andy McKay

Put an argument as sort_order and then your statement as:

SELECT * FROM Foo ORDER BY  ASC


--
  Andy McKay, Developer.
  ActiveState.
- Original Message - 
From: "Yvonne Totty" <[EMAIL PROTECTED]>
To: "Daniel Rusch" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, November 06, 2000 8:17 AM
Subject: RE: [Zope] Sorting 'in'


> Yes, that is what I am doing, however was wanting
> to not have to write several Z SQL Methods. 8)
> 
> ~~~
> Yvonne Totty
> Database Engineer
> -
> Wolverine: You actually go outside in these things?
> Cyclops: Well, what would you prefer? Yellow spandex?
> 
> 
> > If it's a database query sorting with sql first. i.e. ORDER BY X,Y
> > 
> > HTH
> > 
> > Dan
> > > Yvonne Totty wrote:
> > > 
> > > Hi!
> > > 
> > > I need a query sorted by 2-3 different attributes. The
> > > 'in' sort only lets me do it by one. Is there a way to
> > > get around it?
> > > 
> > > TIA
> > > -y
> > > ~~~
> > > Yvonne Totty
> > > Database Engineer
> > > -
> > > Wolverine: You actually go outside in these things?
> > > Cyclops: Well, what would you prefer? Yellow spandex?
> > >
> > 
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> 


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




Re: [Zope] zope error

2000-11-06 Thread Andy McKay

It sounds like there is a problem writing to the log file. Im not sure what
errorno 9 in IO is but it could be bad filename if you have specified one.

--
  Andy McKay, Developer.
  ActiveState.
- Original Message -
From: "Atomasoft Network President" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 04, 2000 9:52 AM
Subject: [Zope] zope error


Hello,

There is a problem with my zope.Whenever someone accesses the server it has
an error and shuts down
this is the last 2 lines of what it said:

File "C:\Program Files\WebSite\ZServer\medusa\logger.py", line 65 in
maybe_flush
 self.file.flush()
IOError: [Errno 9] Bad file descriptor

How do I fix this?

Thanks,
Calin





___
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] Folderish object -API

2000-11-06 Thread Andy McKay

The error would be with aq_acquire, do you have that specified anywhere in
your code (eg in the __init__)?

--
  Andy McKay, Developer.
  ActiveState.
- Original Message -
From: "Petr Knapek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 06, 2000 4:46 AM
Subject: [Zope] Folderish object -API


> Hi Zopists,
> I try to create ISNGFolder class which is subclassed from Zope Folder
> class. During instantiation of this ISNGFolder class I also try to set
> permissions ['View', 'Access contents information'] for role 'Content'
> by calling manage_role('Content', ['View', 'Access contents
> information']) function of this object. But some error occurs and I
> don't know python API very well for folderish objects. Can somebody help
> me, please??
>
> I use Zope 2.1.6 on Linux Debian
>
>
>
> Below you can see part of my python product for folderish object and
> error output of Zope.
>
>
> Begin of code:
>
> manage_addISNGFolderForm=HTMLFile('addFolder', globals())
>
> def manage_addISNGFolder(self, cz_id, title='', key_words=[], header='',
footer='',
>  createPublic=0,
>  createUserF=0,
>  REQUEST=None):
> """Add a new 'ISNG Folder' object with id *id*."""
>
> author = repr(REQUEST.AUTHENTICATED_USER)
> id = cz_id2id(cz_id)
> ob=ISNGFolder()
> ob.id = id
> ob.cz_id = cz_id
> ob.title = title
> ob.creation = DateTime.DateTime(time.time())
> ob.author = author
> ob.modifier = author
> ob.key_words = key_words
> ob.header = header
> ob.footer = footer
> self._setObject(id, ob)
> ob.manage_role('Content', ['Access contents information', 'View'])
> if REQUEST is not None:
> return MessageDialog(
> title = 'Add ISNGFolder',
> message = 'New ISNGFolder %s was added.' %
ob.getProperty('cz_id'),
> action = './addFolder'
> )
>
>
>
> class ISNGFolder(Folder):
> """ISNGFolder class.
>
> Is created by inheritance from Folder Zope object."""
>
>
> meta_type = 'ISNG Folder'
>
> __ac_permissions__ = (
> ('View', ('manage_infoISNGForm',)),
> )
>
> _properties = (
> {'id':'title', 'type':'string', 'mode':'w'},
> {'id':'cz_id', 'type':'string', 'mode':'w'},
> {'id':'author', 'type':'string', 'mode':'w'},
> {'id':'modifier', 'type':'string', 'mode':'w'},
> {'id':'key_words', 'type':'lines', 'mode':'w'},
> {'id':'header', 'type':'text', 'mode':'w'},
> {'id':'footer', 'type':'text', 'mode':'w'}
> )
>
> _ManageOptions = (
> {'label':'Edit ISNG', 'action':'manage_editISNGForm'},
> {'label':'Info ISNG', 'action':'manage_infoISNGForm'},
> {'label':'Header ISNG', 'action':'manage_editHeaderISNGForm'},
> {'label':'Footer ISNG', 'action':'manage_editFooterISNGForm'},
> {'label':'Permissions ISNG',
'action':'manage_permissionsFrameISNGForm'},
> )
>
>
>
> Error output of Zope:
>
>
>   Zope Error
>
>   Zope has encountered an error while publishing this resource.
>
>   Error Type: AttributeError
>   Error Value: aq_acquire
>
>
>
>   Troubleshooting Suggestions
>
>   The URL may be incorrect.
>   The parameters passed to this resource may be incorrect.
>   A resource that this resource relies on may be encountering
an error.
>
>   For more detailed information about the error, please refer to
the HTML source for this page.
>
>   If the error persists please contact the site maintainer. Thank
you for your patience.
>
>
>
>
> Traceback (innermost last):
>   File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line
214, in publish_module
>   File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line
179, in publish
>   File /usr/local/www/Zope-2.1.6/lib/python/Zope/__init__.py, line 202, in
zpublisher_exception_hook
>   File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line
165, in publish
>   File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/mapply.py, line
160, in mapply
> (Object: manage_addISNGFolder)
>   File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line
102, in call_object
> (Object: manage_addISNGFolder)
>   File /usr/local/www/Zope-2.1.6/lib/python/Products/ISNG/ISNG.py, line
810, in manage_addISNGFolder
>   File /usr/local/www/Zope-2.1.6/lib/python/AccessControl/Role.py, line
179, in manage_role
> (Object: ElementWithAttributes)
>   File /usr/local/www/Zope-2.1.6/lib/python/AccessControl/Role.py, line
137, in ac_inherited_permissions
> (Object: ElementWithAttributes)
>   File /usr/local/www/Zope-2.1.6/lib/python/OFS/ObjectManager.py, line
173, in _subobject_permissions
> (Object: ElementWithAttributes)
> AttributeError: (see above)
>
> --
> Petr Knápek
> NEXTRA Czech Republic, s.r.o., Hlinky 114, 603 00 Br

Re: [Zope] time.sleep() in dtml

2000-11-06 Thread Andy McKay

Time isnt part of dtml, DateTime but doesnt include sleep. A python method
of some kind is youre only bet.

--
  Andy McKay, Developer.
  ActiveState.

- Original Message -
From: "Martin Winkler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 05, 2000 2:43 PM
Subject: [Zope] time.sleep() in dtml


> Hello all,
>
> some python functions work in dtml, mostly mathematical ones. But what I
do
> need at the moment is the "time.sleep(x)" function to prevent an immediate
> reply to a request of the users. I tried  and
> , but Zope returned an "Attribute error".
> Any ideas? Or do I have to create a special python method for this? (I'm
> not used to python until now...)
>
> Martin
>
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>


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




[Zope] dtml-in over the output from my method

2000-11-06 Thread Tim Hicks



I am trying to create a zope product in python but 
have got stuck with using the dtml-in tag to iterate over a method (or is it a 
function? I get a little mixed up) of my class. Here is the method,
 
    def 
list_messages(self):    
lr = open(self.user_dir+'/msg_list', 
'r')    
spl = 
re.compile('\s\|\s')    
for msg_line in 
lr.readline():    
num_from_sub = 
[]    
num_from_sub = spl.split(msg_line, 
2)    
print 
num_from_sub    
self.msgnum = 
num_from_sub[0]    
self.msgfrom = 'This is from 
UNKNOWN'    
self.msgsub = 'My special subject'
    
return self.msgnum, self.msgfrom, self.msgsub
 
And here is an extract from the dtml file that 
is supposed to display the output,
 
    
    
&dtml-msgfrom;    
&dtml-msgsub;    

However, this does not produce the desired effect. 
I don't know if it is obvious from what I've written, but basically, the three 
variables (self.msgnum, self.msgfrom and self.msgsub) are supposed to be 
inserted into the appropriate place in the table, and then the 'for' statement 
re-executed (producing different values for the variables) with the subsequent 
values being inserted into the next line of the table etc... until there are no 
more lines to be read from lr. I'm not sure if that is clear or not, sorry. 
Obviously, this does not work as the dtml-in simply iterates over each of the 
returned variables (instead of over the for statement). I can't seem to make it 
do what I want. Does anyone have any ideas? Much obliged if you do.
 
Cheers
 
tim
 


Re: [Zope] Sorting 'in'

2000-11-06 Thread Steve Spicklemire


Hi Yvonne,

   You could use Zieve, (http://www.zope.org/Members/sspickle/Zieve)
or you could render the 'order by' part of your clause from a variable
in the name space, or possibly the REQUEST itself. There was also a 
patch submitting at one point that allows variable (and I think multiple)
sort keys...

-steve

> "Yvonne" == Yvonne Totty <[EMAIL PROTECTED]> writes:

Yvonne> Yes, that is what I am doing, however was wanting to not
Yvonne> have to write several Z SQL Methods. 8)

Yvonne> ~~~ Yvonne Totty
Yvonne> Database Engineer - Wolverine: You
Yvonne> actually go outside in these things?  Cyclops: Well, what
Yvonne> would you prefer? Yellow spandex?


>> If it's a database query sorting with sql first. i.e. ORDER BY
>> X,Y
>> 
>> HTH
>> 
>> Dan > Yvonne Totty wrote:
>> > 
>> > Hi!
>> > 
>> > I need a query sorted by 2-3 different attributes. The > 'in'
>> sort only lets me do it by one. Is there a way to > get around
>> it?
>> > 
>> > TIA > -y > ~~~ > Yvonne
>> Totty > Database Engineer
>> > -
>> > Wolverine: You actually go outside in these things?  >
>> Cyclops: Well, what would you prefer? Yellow spandex?
>> >
>> 

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



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




[Zope] Mirroring Zope sites

2000-11-06 Thread Christopher J. Kucera

Hello,

I'd like to be able to take a "snapshot" of a Zope site (probably using
the recursive "wget") so that it can be served from Apache alone. 
I'm running into problems coping with files named "x_html" (most notably
"index_html") . . .  Apache serves up the files as plaintext, so you
just get the HTML in your browser window.

I've been messing around with srm.conf in my Apache configuration to
try and accept "_html" as a valid extention for "text/html" files,
but to no avail.

Has anyone managed to get Apache to serve "_html" as text/html?

Thanks much!
-CJ

___
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 Book Beta

2000-11-06 Thread Michel Pelletier

Robin Becker wrote:
> 
> In article <[EMAIL PROTECTED]>, Michel Pelletier
> <[EMAIL PROTECTED]> writes
> >Robin Becker wrote:
> >>
> ...
> >I belive all reference to xslt methods has been removed.  Python methods
> >will be part of the 2.3 release, and Perl methods are mentioned in the
> >book as being a component add on that must be installed.
> >
> 
> well I think I read about them in the recently released beta, not how
> they work, but I didn't pluck the name out of thin air.

Ah you are correct, I just removed the references to them.  I thought
they were purged when we removed the xml chapter.
 
> >> So is there an alpha of this future zope that we could
> >> use to check the book?
> >
> >Check out Zope and Python Methods from CVS.  Perl Methods can be
> >downloaded from the Perl wiki on (I believe) dev.zope.org.
> >
> >-Michel
> >
> 
> I'm using the CVS checkout of Zope2, where are python methods in the CVS
> tree?

I'm not sure, I suspect you would ahve to check them out of a branch,
and I don't know how to do that from the public CVS.  I'll make some
inquiries.

-Michel

___
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] recursive constructions

2000-11-06 Thread Robin Becker

I would like to duplicate a folderish zclass path and copy some properties across from 
one
tree /R/A/B/C to another /L/A/B/C.

The request to create an object is

http://localhost/R/manage_addProduct/myProd/myProd_factory/myProd_add?id=A,prop=1

I would like to then create  /L/A/B/C etc using some kind of recursive scheme, but I 
don't
know how to call a method to do this recursively and maintain the original permissions.
Somehow I seem to lose something along the way.

the actual sequence of calls would be
http://localhost/L/manage_addProduct/myProd/myProd_factory/myProd_add?id=A,prop=1
http://localhost/L/A/manage_addProduct/myProd/myProd_factory/myProd_add?id=B,prop=1
http://localhost/L/A/B/manage_addProduct/myProd/myProd_factory/myProd_add?id=C,prop=1
-- 
Robin Becker

___
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] Sorting 'in'

2000-11-06 Thread Gregory Haley

hi yvonne,

in your zsql method, you can order by several variables in the same
method call.
so you can do it all in one method.

ciao!
greg.

Gregory Haley
Venaca.com

Yvonne Totty wrote:
> 
> Yes, that is what I am doing, however was wanting
> to not have to write several Z SQL Methods. 8)
> 
> ~~~
> Yvonne Totty
> Database Engineer
> -
> Wolverine: You actually go outside in these things?
> Cyclops: Well, what would you prefer? Yellow spandex?
> 
> > If it's a database query sorting with sql first. i.e. ORDER BY X,Y
> >
> > HTH
> >
> > Dan
> > > Yvonne Totty wrote:
> > >
> > > Hi!
> > >
> > > I need a query sorted by 2-3 different attributes. The
> > > 'in' sort only lets me do it by one. Is there a way to
> > > get around it?
> > >
> > > TIA
> > > -y
> > > ~~~
> > > Yvonne Totty
> > > Database Engineer
> > > -
> > > Wolverine: You actually go outside in these things?
> > > Cyclops: Well, what would you prefer? Yellow spandex?
> > >
> >
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

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




Re: [Zope] Need win32 dll for DynPersist !

2000-11-06 Thread Bill Welch

I bounced him the one I got from Itamar a couple weeks ago.


___
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] Need win32 dll for DynPersist !

2000-11-06 Thread m.kobald

Hi all,
we need the DynPerisist.dll (Win2000) for presentation purpose.
If someone has compilied this dll, would you please mail it to me. (ZPattern
0.4.3 beta 1)
Normally we develop on Linux .. ;) .

Thanx and greetings from Heidelberg/Germany

Micha


___
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] Sorting 'in'

2000-11-06 Thread Yvonne Totty

Yes, that is what I am doing, however was wanting
to not have to write several Z SQL Methods. 8)

~~~
Yvonne Totty
Database Engineer
-
Wolverine: You actually go outside in these things?
Cyclops: Well, what would you prefer? Yellow spandex?


> If it's a database query sorting with sql first. i.e. ORDER BY X,Y
> 
> HTH
> 
> Dan
> > Yvonne Totty wrote:
> > 
> > Hi!
> > 
> > I need a query sorted by 2-3 different attributes. The
> > 'in' sort only lets me do it by one. Is there a way to
> > get around it?
> > 
> > TIA
> > -y
> > ~~~
> > Yvonne Totty
> > Database Engineer
> > -
> > Wolverine: You actually go outside in these things?
> > Cyclops: Well, what would you prefer? Yellow spandex?
> >
> 

___
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] Sorting 'in'

2000-11-06 Thread Daniel Rusch

If it's a database query sorting with sql first. i.e. ORDER BY X,Y

HTH

Dan
> Yvonne Totty wrote:
> 
> Hi!
> 
> I need a query sorted by 2-3 different attributes. The
> 'in' sort only lets me do it by one. Is there a way to
> get around it?
> 
> TIA
> -y
> ~~~
> Yvonne Totty
> Database Engineer
> -
> Wolverine: You actually go outside in these things?
> Cyclops: Well, what would you prefer? Yellow spandex?
>

___
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] Properly intergating reportlab and Zope

2000-11-06 Thread ed colmar

Hi all!

I'm still trying to get this to work, so I'm going to try the lists for
assistance again.  TIA!!!

I am working on a project using zope and reportlab.

The goal is to have uploaded images end up in a formatted PDF file.

I have both of these halves completed, I need to figure out how to connect
them.

I have been using SquishFile.py as the wrapper around uploaded images, as is
done in squishdot.  The few image types I have tried have displayed fine on
screen, but PIL/Reportlab is not able to recognise the image.  I know how to
get an image into reportlab from the filesystem, but is there a way to use
one that is in the Zodb?

How would you go about wrapping the file in a PIL.Image() ?  I've been
trying things similar to:

cardimage=PIL.Image.open(self.uploadedimage)
c.drawInlineImage(cardimage, 1,1)

This gives an error in reportlab.canvas.convert()

I tried using PIL.image.fromstring(), but I can't quite get it to work
out:

filebytes=[str(self.uploadedimage.file_bytes()), 'bytes']
cardimage=PIL.Image.fromstring(self.uploadedimage.content_type(),
   filebytes,
   self.uploadedimage.file_data())
c.drawInlineImage(cardimage, 1,1)

This gives a typeerror: PIL/Image.py, line 848, in new

has anyone succesfully done this?  can I just Leave the SquishFile wrapper
off if it is ONLY going to be images that get uploaded?

Thanks for any ideas!

-ed-


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




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




[Zope] Sorting 'in'

2000-11-06 Thread Yvonne Totty



Hi!
 
I 
need a query sorted by 2-3 different attributes. The
'in' sort only lets me do it by one. Is there a way to 

get 
around it?
 
TIA
-y
~~~
Yvonne Totty
Database Engineer
-
Wolverine: You actually go outside 
in these things?Cyclops: Well, what would you prefer? Yellow 
spandex?
 


Re: [Zope] objectValues type?

2000-11-06 Thread Rik Hoekstra

I have this simple 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):








 

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] Zope and Sybase Stored Procedures

2000-11-06 Thread Ralph Heinkel

Hi,

we are using Zope 2.1.6 with Sybase 11.9.2 on Suse Linux, and calling
stored procedures just works fine. 

e.g. 
create procedure csp_add_barcode
@tableName varchar(12), @barcode numeric(8) OUT
AS
insert into BarcodeItem (tableName) values (@tableName)
select @barcode = @@identity

This is a stored procedure that inserts one row into the table 'BarcodeItem'
and returns an automatically created unique identity key as a result named
'barcode'.

The ZSQL methods takes one parameter 'tableName' and returns the resulting
'barcode' like a normal select statement does.

The query template simply is:

csp_add_barcode 


Hope that helps. Btw, Zope 2.2.0 has a bug in connecting to SybaseDA which
is reported to digicool. Should be fixed in the next release. If interested
for the fix, send me a mail.

Ralph



--
Ralph Heinkel  Cenix Bioscience GmbH
Director of the IT-UnitTel  : +49 6221/387 915
Meyerhofstr. 1 Fax  : +49 6221/387 971
69117 Heidelberg, Germany  eMail: [EMAIL PROTECTED]

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




[Zope] Folderish object -API

2000-11-06 Thread Petr Knapek

Hi Zopists,
I try to create ISNGFolder class which is subclassed from Zope Folder
class. During instantiation of this ISNGFolder class I also try to set
permissions ['View', 'Access contents information'] for role 'Content'
by calling manage_role('Content', ['View', 'Access contents
information']) function of this object. But some error occurs and I
don't know python API very well for folderish objects. Can somebody help
me, please??

I use Zope 2.1.6 on Linux Debian



Below you can see part of my python product for folderish object and
error output of Zope.


Begin of code:

manage_addISNGFolderForm=HTMLFile('addFolder', globals())

def manage_addISNGFolder(self, cz_id, title='', key_words=[], header='', footer='',
 createPublic=0,
 createUserF=0,
 REQUEST=None):
"""Add a new 'ISNG Folder' object with id *id*."""

author = repr(REQUEST.AUTHENTICATED_USER)
id = cz_id2id(cz_id)
ob=ISNGFolder()
ob.id = id
ob.cz_id = cz_id
ob.title = title
ob.creation = DateTime.DateTime(time.time())
ob.author = author
ob.modifier = author
ob.key_words = key_words
ob.header = header
ob.footer = footer
self._setObject(id, ob)
ob.manage_role('Content', ['Access contents information', 'View'])
if REQUEST is not None:
return MessageDialog(
title = 'Add ISNGFolder',
message = 'New ISNGFolder %s was added.' % ob.getProperty('cz_id'),
action = './addFolder'
)



class ISNGFolder(Folder):
"""ISNGFolder class.

Is created by inheritance from Folder Zope object."""


meta_type = 'ISNG Folder'

__ac_permissions__ = (
('View', ('manage_infoISNGForm',)),
)

_properties = (
{'id':'title', 'type':'string', 'mode':'w'},
{'id':'cz_id', 'type':'string', 'mode':'w'},
{'id':'author', 'type':'string', 'mode':'w'},
{'id':'modifier', 'type':'string', 'mode':'w'},
{'id':'key_words', 'type':'lines', 'mode':'w'},
{'id':'header', 'type':'text', 'mode':'w'},
{'id':'footer', 'type':'text', 'mode':'w'}
)

_ManageOptions = (
{'label':'Edit ISNG', 'action':'manage_editISNGForm'},
{'label':'Info ISNG', 'action':'manage_infoISNGForm'},
{'label':'Header ISNG', 'action':'manage_editHeaderISNGForm'},
{'label':'Footer ISNG', 'action':'manage_editFooterISNGForm'},
{'label':'Permissions ISNG', 'action':'manage_permissionsFrameISNGForm'},
)



Error output of Zope:


  Zope Error

  Zope has encountered an error while publishing this resource. 

  Error Type: AttributeError
  Error Value: aq_acquire



  Troubleshooting Suggestions

  The URL may be incorrect. 
  The parameters passed to this resource may be incorrect. 
  A resource that this resource relies on may be encountering an error. 

  For more detailed information about the error, please refer to the HTML 
source for this page. 

  If the error persists please contact the site maintainer. Thank you for your 
patience. 




Traceback (innermost last):
  File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 214, in 
publish_module
  File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 179, in publish
  File /usr/local/www/Zope-2.1.6/lib/python/Zope/__init__.py, line 202, in 
zpublisher_exception_hook
  File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 165, in publish
  File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: manage_addISNGFolder)
  File /usr/local/www/Zope-2.1.6/lib/python/ZPublisher/Publish.py, line 102, in 
call_object
(Object: manage_addISNGFolder)
  File /usr/local/www/Zope-2.1.6/lib/python/Products/ISNG/ISNG.py, line 810, in 
manage_addISNGFolder
  File /usr/local/www/Zope-2.1.6/lib/python/AccessControl/Role.py, line 179, in 
manage_role
(Object: ElementWithAttributes)
  File /usr/local/www/Zope-2.1.6/lib/python/AccessControl/Role.py, line 137, in 
ac_inherited_permissions
(Object: ElementWithAttributes)
  File /usr/local/www/Zope-2.1.6/lib/python/OFS/ObjectManager.py, line 173, in 
_subobject_permissions
(Object: ElementWithAttributes)
AttributeError: (see above)

-- 
Petr Knápek
NEXTRA Czech Republic, s.r.o., Hlinky 114, 603 00 Brno, Czech Republic
e-mail: mailto:[EMAIL PROTECTED]
tel:+420-5-43 554 150
FAX:+420-5-43 554 214

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

___
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-06 Thread Rik Hoekstra



Red Pineseed wrote:



> 
> Thanks Rik,
> 
> You answered my question perfectly. This was my guess and
> found the Data.fs. This makes me wonder though how the
> implementation of the three tier separation, ie
> data/logic/presentation is achieved. Do you have any idea?

Yes I do. The key point is that in Zope everything _is_ content, DC
says. I fact I think it is more proper to say that in Zope everything is
an object. But there are several kinds of objects, as they 'specialize'
in something, so to say. This is to say that objects have behaviour and
this behaviour is of a certain type. That's why you can tier up your
application in three tiers, or even more if that's useful. An example
may clarify this. 

Say we have a simple application that presents the users with data
retrieved from a relational database. It has a navigation bar of a
breadcrumbs style (like home > mypages > myapp) and there is a
stylesheet attached to it. In schematic form a page from the app looks
like this:

* Header

* Breadcrumbs

* data from a database

* footer


in Zope you could make the following objects that represent different
parts of the application

1. stylesheet object (containing stylesheet)
2. breadcrumbs object (depends on context)
3. header object (consists of HTTP header including stylesheet and
breadcrumbs)
4. database adapter (managing the connection to your relational
database)
5. ZSQL Method (a querying object)
6. Queryform (for inputting query values optional)
7. Report object (formatting retrieved data)
8. footer (to close the page. Might also the breadcrumbs)

> What is the advantage of putting everything in a db?

The db is the object repository. It would be hard to have persistent
object without repository ;-)

> Apparently if the db down, we will lose everything and
> recovering from a db is pain as you may already know. 

Um, I'm no systems administrator, so there are probably many people who
can say much more sensible things about this then I can. Anyway, a few
remarks. First, the zope database is quite stable and it will be
difficult to break it... Recovering is mostly just done by restarting
the server. Usually SQL databases will give you much more trouble in
this respect.

Second, if you are concerned about failover of your server using the ZEO
(Zope Enterprise Option) makes it easy to make your server distributed.
This is also where Zope flexibility comes in: in default you data are
stored in the zope database, but there are a number of other storage
possibilities, including directory storage, bsddb storage, demo storage
(storing everything in RAM so that you can run Zope from CD) and
recently there Oracle storage has been added, though I'm not sure if
that's public or stable as yet (I don't have Oracle myself anyway)

If you insist on putting files on the filesystem, there is a Zope
product called LocalFS that will include local directories and serve the
contents from Zope. Moreover there are strategies for hybrid solutions
in which you may serve static content or large files from Apache and do
the dynamic stuff from Zope. 

> though it is great performance improvement to load the db in
> RAM at run time, do you know of an other benefits?

the db as a whole won't load in RAM, objects will only be 'woken up'
when they are called.
Benefits... Uh, it would be hard to imagine another way of making
persistent object available especially doing it the way Zope does.
Reversely it would be hard to make everything an object (and thus factor
out common behaviour and make reusable code) without a persistent object
system. Zope as a whole makes your applications easier to build and to
maintain, because of the everything is an object approach.

But like I wrote above, if you insist you can put part of your files on
the filesystem. Or in relational databases for that matter.


so much for 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] How to render a HTMLFile in a method in a product

2000-11-06 Thread Chris Withers

Max Møller Rasmussen wrote:

> def __call__(self,client=None,mapping={},**kw):
> 
> This method accepts an object in which it will look up values to insert in
> the dtml file, and a mapping object (dictionary) that also will look up
> values to insert.
> 
> So i guess that is what (None,md) does.
> 
> But I dont understand what "ignored" does in  my method, as it is unused,
> unless it is used by md

Nope, ignored is the client, which you don't need to worry about.

> >def test(self,ignored,md):
> 
> Furthermore I dont understand what md is. Some kind of mapping object
> naturally, but where does it come from?

pDocumentTemplate.py has one implementation of it.

it's a stack of dictionaries, basically... When you do md['key'], it
looks for key in the top dictionary, then in the next one down, then in
the one below that, etc, and only throws a key error if one can't be
found at all...

> Also what is testisDocTemp supposed to do?

This is a bit of ExtensionClass wierdness. Think of it has "give the
test object the 'isDocTemp' attribute".

> If I grep the source a "isDocTemp" shows up but is isn't easy to see what
> this does either.

If some arcane bit of Zope's calling machinery finds this (probably in
BaseRequest.py) it sends different parameters to __call__.

HTH,

Chris

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




Re: [Zope] How to render a HTMLFile in a method in a product

2000-11-06 Thread Chris Withers

Max Møller Rasmussen wrote:
> 
> From: Chris Withers [mailto:[EMAIL PROTECTED]]
> 
> Thanks for the reply
> 
> >testisDocTemp = 1
> 
> >def test(self,ignored,md):
> >" A simple test method "
> >return HTMLFile('skins/' + self.skin, globals())(None,md)
> 
> Is this documented anywhere? 

Not that I know of ;-)

> I have a little trouble using code I don't
> understand. Pretty Please.

I think there are only about two people on the face of the planet who
understand this completely. I'm not one of them :-(

cheers,

Chris

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




Re: [Zope] IIS and Zope share same problem :-S

2000-11-06 Thread Chris Withers

Pierre-Julien Grizel wrote:
> 
> Hum... A possible way to solve this problem is to practice the "you
> can't do ANYTHING but..." policy... And, thus, according proxy roles to
> the methods that must access it, such as index_html.
> I know it's constraining but with a little work we can end up with
> something quite secure & secret.

It's not secret, you can still use /objectIds and /objectValues to find
out about things...
Secure, yes it is that.
But, it's a lot more than a little work.

What I was suggesting was something to do the grunt work of all this
with the same outcome.

oh well...

Chris

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




[Zope] Newbie question

2000-11-06 Thread Brown Fox

Hello,
i want to view a dtml-document, calling it as
a variable.
For example:








where this file is called with this string:
test3

The result i now get is the id, not the content of the
file!

Thanks,
Bruno



__
Do You Yahoo!?
Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it

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




Re: [Zope] how to retrieve variables & values from the URL

2000-11-06 Thread Chris Withers

jacintha menezes wrote:
> 
> Hi,
>In lookup query when i give the input as Emp_no & submit it , following
> url
> comes in the browser address space.
> 
> http://192.168.222.217:8080/project/Admin/looktool_report?Emp_no=4&SUBMIT=Su
> bmit+Query
> 
>  how can i retrieve the variables & values from the URL using dtml tags



cheers,

Chruis

___
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] Swishdot, SiteAccess

2000-11-06 Thread Chris Withers

Anders Eriksson wrote:
> 
> What if I want to combine two of the larger products, The Portal
> ToolKit and the Squishdot. How would one go about to do this?
> 
> I would like to have the membership and the other parts from PTK added
> to the Squishdot (or the other way around - which ever is easiest).

There are plans a foot for this:
http://www.squishdot.org/968089230/index_html

...now if there were just 48hrs in each day ;-)

> I also wonder: Is there someway I can install the PTK or the Squishdot
> in the Zope root folder? 

I wish there was... ideas, anyone?

> This so that I can use the domain URL without
> any subfolders. e.g. www.mydomain.org instead of www.mydomain.org/ptk

Well, you can get around this using SiteAccess and Apache...

cheers,

Chris

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




Re: [Zope] images in directories

2000-11-06 Thread Chris Withers



Pete Prodoehl wrote:
> 
> Is it possible to have an image named "image.gif" or "image.jpg" ? (Are file
> extensions allowed? If so, how  are those objects addresses?)


  


or



cheers,

Chris


> 
> Pete
> 
> > --
> > > "Farrell, Troy" wrote:
> > >
> > > 
> > >   
> > > 
> >
> > This also works:
> >
> > 
> >
> >
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

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




RE: [Zope] Help wanted on Zope ZClasses/DTML please.

2000-11-06 Thread Seb Bacon


> I have worked out thanks to Seb's comments that the problem I
> have with the
> use of manage_delObjects is (I think) that I am passing in the title or id
> of the object to be deleted rather than the object itself.

Not quite... manage_delObjects takes a string which is the id of the object
to be deleted.  Your example



was passing a string 'the_id' to the method.  I might have interpreted what
you were trying to do wrongly, but I believe you actually wanted to pass the
_value_ of the_id.

> I want to put the object into the REQUEST so I can still access it from a
> different namespace - at the point I want to do the deletion, my target
> object is out of scope.

In fact you just have to put the correct string into the REQUEST and then
make sure you have the object you're trying to reference in your current
namespace, e.g. by using .  If you need more help, post the
snippet you're working on again.

seb.


___
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 Book Beta

2000-11-06 Thread Robin Becker

In article <[EMAIL PROTECTED]>, Michel Pelletier
<[EMAIL PROTECTED]> writes
>Robin Becker wrote:
>> 
...
>I belive all reference to xslt methods has been removed.  Python methods
>will be part of the 2.3 release, and Perl methods are mentioned in the
>book as being a component add on that must be installed.
>

well I think I read about them in the recently released beta, not how
they work, but I didn't pluck the name out of thin air.

>> So is there an alpha of this future zope that we could
>> use to check the book?
>
>Check out Zope and Python Methods from CVS.  Perl Methods can be
>downloaded from the Perl wiki on (I believe) dev.zope.org.
>
>-Michel
>

I'm using the CVS checkout of Zope2, where are python methods in the CVS
tree?
-- 
Robin Becker

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