[Zope] Editing images

2000-11-12 Thread Michael Blewett

Why not just ftp them out? Zope has built-in ftp. For more information look at:

http://www.zope.org/Members/mblewett/ZopeFTP

Hope this helps...


  - Michael






Message: 14
Date: Sun, 12 Nov 2000 21:00:48 +0100
From: Anders Eriksson [EMAIL PROTECTED]
Reply-To: Anders Eriksson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Zope] Editing images
Hello zopistas,
I have some images in an image folder within Zope. Now I need to edit
these images but I can't figure out how?
I guess that the images are withing the Data.fs but how to get them
out? If I do an export they wind up in a .zexp which I don't now how
to expand outside of Zope...
Please help!!
--
Best regards,
Anders mailto:[EMAIL PROTECTED]
Science is everything we understand well enough to explain to a computer. 
Art is everything else. - David Knuth





~~~
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] LDAP variable problem 'title'

2000-11-11 Thread Michael Blewett

Hi Zopistas,

Firstly, a big thank you to all thos epeople who helped me with KeyError 
problem when accessing LDAP entries.
Just so the solution makes it onto the mailing list archive (for the next 
bunny who has the same problem) the solution was to add the following to 
each of your variables

missing=nbsp;

...so that when Zope came across entries without that attribute it didn't barf.

I now have one last problem. I can now access all entries from the LDAP 
directory using the notation dtml-var sn missing = nbsp;- all except one 
- the "title" attibute .

I am guessing that it is because Zope uses "title" to reference the title 
of the object in the zope database, and therefore won't let you get at the 
ldap variable using the normal:
dtml-var title notation.

Is there any way I can pinpoint the LDAP variable instead of the object 
title in zope? I have no control over the ldap server and attributes name, 
so I can't change it at that end.

When I test the LDAP filter method I can see the variable (it lists all of 
the attributes of the LDAP record), but I can't reference it in DTML.
My filter method is called 'Academics' and just extracts a list of 
academics in the biology department here at Monash University. I'm sure 
there must be a way using python notation, but not being a python expert 
(yet!), I could do with a few clues...


Any ideas?

Thanks again...

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

dtml-var standard_html_header
h2dtml-var title_or_id/h2
p

dtml-in Academics
Surname:   dtml-var snBR
Given Name: dtml-var givennameBR
Initials: dtml-var initialsBR
Gender:  dtml-var genderBR
Phone: dtml-var phonenumberBRBR
/dtml-in Academics

/p
dtml-var standard_html_footer


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

snip

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] RE:How do I merge form URL vars into sql easily

2000-07-06 Thread Michael Blewett

Hi Jake,
I originally had trouble coming to grips with the concept of variables and 
forms and passing them from one object to the next. After much testing, 
trial and error (and guidance from this list), I came up with these 
conclusions (which I'm sure someone will shoot down if I am wrong):
1) The request object you are setting with your REQUEST.set command is like 
a big bucket that gets passed between one web page and the next when you 
call it in your DTML. The best thing someone ever showed me was how to view 
in the called document ie.

  insert the line:

dtml-var REQUEST

into the dtml/method you are trying to call.

If you do that you can see all of the variables that get passed normally as 
part of your REQUEST variable, as well as any that get added to it by your 
form in the act of your POST command in the form. Be prepared  - it is a 
long list! You should be able to see all your form variables in there. If 
you don't then you haven't been doing your form correctly (been there done 
that too!).
The only real 'nasty' I have come across so far id the checkbox - if it is 
unchecked it doesn't post anything to the REQUEST object, and then you need 
to check for it and set it,  if you are using it  to update an SQL database 
(this is the only time I use the dtml-call 
"REQUEST.set['argument','value']"command. This is normal behaviour with 
forms and is not the fault of Zope.


Hope this helps...

  - Michael




   -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
  [EMAIL PROTECTED]
  Sent: Wednesday, July 05, 2000 5:32 PM
  To: [EMAIL PROTECTED]
  Subject: [Zope] How do I merge form  URL vars into sql easily
 
 
  I am a new user to Zope and I'm trying to pass data that has been
  entered into a form (either through GET or POST) into another
  object.  This object calls a z sql method to insert the form data into
  the database.  So far, the only way I've found to pass data to the
  sql is to define arguments for it and then, in the dtml-document (or
  method) use:
  dtml-call "REQUEST.set['argument','value']"
  (and it took me long enough to figure THAT out, let me tell you)
  The problem is that sucks when there are 30 form varibles that
  need to be inserted into the database.
   I would think that there is some way to let the sql method see
  these varibles that are defined within my document.  Or loop
  through all URL or form varibles defined and sets all the vars in
  request. Something to keep from having to write the above dtml 30
  times.  Thanks.
 
  Jake Feasel
 
~~~~~~~
Michael Blewett
Computer Support Mgr - Biological Sciences
Monash University (Clayton Campus)
Victoria Australia 3168

" Can I trade this job for what's behind door #2? "


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




Re: [Zope] RE:How do I merge form URL vars into sql easily

2000-07-06 Thread Michael Blewett

At 20:39 6/07/2000 -0400, R. David Murray wrote:
snip


Once you generate an output page, the user views it, and then clicks
again, you have a brand new REQUEST object that can only get values
from the *new* web page.  Others have been tripped by this, expecting
the REQUEST fields to automatically carry over from one form to
the next.  They don't, unless you explicitly put hidden fields into
your form to store the variables values for the next REQUEST.
But as long as you are still server side and making DTML calls,
REQUEST is there.

Maybe I should have mentioned that my bucket gets emptied after each new 
page is requested...just to keep the analogy going...

Thanks for clarifying that - always happy to be corrected, especially if it 
makes things clearer.

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

" Can I trade this job for what's behind door #2? "


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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] MySQL Select Statements

2000-06-29 Thread Michael Blewett

Hi Everyone,
Just need someone to put me straight here. When I use Select statements in 
an SQL Method I cannot simply :

Select Column1, Column2 etc
from TableA.

Instead I must use the AS statement ie

Select Column1 AS Column1, Column2 AS Column2
from TableA.

Is this just an oddity with the MySQLDA/Db adapters or am I overlooking 
something blatantly obvious here? All the examples on zope.org don't have 
the extra "AS Column1" additions on them and I was wondering if this is a 
Zope/mySQL-unique thing.

I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database 
Adapter (ZMySQLDA) 2.0.0a1 and
MySQLdb module release: 0.2.2 .

Could someone please let me know as I don't want to have to type the extra 
bits on all my SQL statements from here on in if I don't need to (I am the 
world's worst and laziest typist). If it is the case that it's a necessary 
evil, then I want to put a HowTo or Tip up on zope.org because it took me a 
while to figure out what I was doing wrong, and if I can save someone else 
that same wasted time then I would like to. However I wanted to get my 
facts straight (via all you experts) first.

Thanks for any help...

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

" Can I trade this job for what's behind door #2? "


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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] MySQL Select Statements

2000-06-29 Thread Michael Blewett

Hi Ron,
If I don't specify my Selects using "AS", I then get the following error 
message:

Error Type: KeyError
Error Value: SubjectName

Traceback (innermost last):
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 214, in publish_module
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 179, in publish
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/Zope/__init__.py, line 
202, in zpublisher_exception_hook
 (Object: ElementWithAttributes)
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 165, in publish
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/mapply.py, 
line 160, in mapply
 (Object: dtTestList)
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 102, in call_object
 (Object: dtTestList)
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/OFS/DTMLDocument.py, 
line 166, in __call__
 (Object: dtTestList)
   File 
/usr/local/Zope-2.1.6-linux2-x86/lib/python/DocumentTemplate/DT_String.py, 
line 502, in __call__
 (Object: dtTestList)
   File 
/usr/local/Zope-2.1.6-linux2-x86/lib/python/DocumentTemplate/DT_In.py, line 
691, in renderwob
 (Object: sqlRetrieveTestList)
KeyError: (see above)


(Where Subjectname was the first field referenced in the DTML document).
Whereas, If I put the SQL as
Select Subjectname AS Subjectname,  etc, then it all works fine.

It's funny that you say 0.2.2 is broken. Apart from this one glitch, it 
works fine for me (although from memory I think we had to do a little bit 
of fiddling at install time to get it to work).


  - Michael


At 00:12 30/06/2000 -0400, Ron Bickers wrote:
Why do you say you "must" use the AS statement?  Do you get an error
otherwise?

MySQLdb 0.2.2 is broken when used with ZMySQLDA.  But 0.2.1 works okay for
me.  Andy Dustman (author of the MySQLdb) said he will fix it and hinted
that one should use the ZMySQLDA that is on Zope.org (v1.2.0 now I believe).
Since that one now uses his MySQLdb, he will likely kill off his own DA.

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
  Michael Blewett
  Sent: Thursday, June 29, 2000 10:53 PM
  To: [EMAIL PROTECTED]
  Subject: [Zope] MySQL Select Statements
 
 
  Hi Everyone,
  Just need someone to put me straight here. When I use Select
  statements in
  an SQL Method I cannot simply :
 
  Select Column1, Column2 etc
  from TableA.
 
  Instead I must use the AS statement ie
 
  Select Column1 AS Column1, Column2 AS Column2
  from TableA.
 
  Is this just an oddity with the MySQLDA/Db adapters or am I overlooking
  something blatantly obvious here? All the examples on zope.org don't have
  the extra "AS Column1" additions on them and I was wondering if this is a
  Zope/mySQL-unique thing.
 
  I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database
  Adapter (ZMySQLDA) 2.0.0a1 and
  MySQLdb module release: 0.2.2 .
 
  Could someone please let me know as I don't want to have to type
  the extra
  bits on all my SQL statements from here on in if I don't need to
  (I am the
  world's worst and laziest typist). If it is the case that it's a
  necessary
  evil, then I want to put a HowTo or Tip up on zope.org because it
  took me a
  while to figure out what I was doing wrong, and if I can save
  someone else
  that same wasted time then I would like to. However I wanted to get my
  facts straight (via all you experts) first.
 
  Thanks for any help...
 
- Michael
  ~~~~~~~
  Michael Blewett
  Computer Support Mgr - Biological Sciences
  Monash University (Clayton Campus)
  Victoria Australia 3168
 
  " Can I trade this job for what's behind door #2? "
 
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )
 
 

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

" Can I trade this job for what's behind door #2? "


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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] MySQL Select Statements

2000-06-29 Thread Michael Blewett

At 14:08 30/06/2000 +1000, Curtis Maloney wrote:
snip
  Is this just an oddity with the MySQLDA/Db adapters or am I overlooking
  something blatantly obvious here? All the examples on zope.org don't have
  the extra "AS Column1" additions on them and I was wondering if this is a
  Zope/mySQL-unique thing.

Can you try to construct the simplest example of a query that doesn't work?
Sure. Here tis:

select Subject,
Subjectname

from test
order by Subject

 
  I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database
  Adapter (ZMySQLDA) 2.0.0a1 and
  MySQLdb module release: 0.2.2 .

Hmm.. I am using the same, except for ZMySQLda 1.1.3, and MySQLdb 0.1.2.  So,
perhaps it's new in ZMySQLda 2.0.

Quite possibly. I've sent a cc to Andy Dustman, just in case he's interested.

  Could someone please let me know as I don't want to have to type the extra
  bits on all my SQL statements from here on in if I don't need to (I am the
  world's worst and laziest typist). If it is the case that it's a necessary

What, you've never heard of cut'n'paste? (o8

With two fields it's OK, but if you've got 30 fields in a table it gets 
pretty tiresome (even using cut  paste)   :o)


  evil, then I want to put a HowTo or Tip up on zope.org because it took me a
  while to figure out what I was doing wrong, and if I can save someone else
  that same wasted time then I would like to. However I wanted to get my
  facts straight (via all you experts) first.

A wise move, and a wonderful gesture.

That's how 'collaborative' software should work IMHO.

Have a better one,
No - *you* have an even better one,
Thanks for the reply...

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

" Can I trade this job for what's behind door #2? "


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