[Zope-dev] Persistence ( was Thread Safe Counting )

2001-02-11 Thread Jon Franz

 Morten's product stores the counter's
 value in a file on the filesystem, and so it doesn't cause the
 Data.fs to grow.

Hmmm, well, my counter above wouldn't cause the data.fs to grow all that
much,
since it subclasses Persistent and so gets its own pickle jar.

cheers,

Chris

So subclassing persistent will avoid changes to the object being stored and 
roll-backable in the ZODB?  Nice!  Now, if only we could get this sort of 
store-in-place functionality on a more fine-grained level (like on
individual
properties) - we could avoid a lot of coding to prevent ZODB bloat with
simple
features.. Ie, if I were to make a 'persistent porperty' on a DTML method,
I could store counter information in that property without worry
of ZODB bloat.

Hrm... *Jon staes into the distance wondering how much will break
if he tries to implement a 'persistent' flag for properties*

~Jon


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



[Zope-dev] manage_ methods

2001-02-11 Thread Jon Franz

Nope!  the method calling the manage_* method can have proxy roles setup for
it 
so that it can call manage_* methods for users who do not have the
capability
to call that manage_* method.

Also, any user can be assigned access to the manage_* methods needed on a
particular
document/method/object by giving them the rights do what you need to do,
such as the Change Properties and Add properties rights (might also need the

manage_properties right, but I dont think so) via the security tab inside
Zope...

did this help?


Hi again,

Is it true that you have to have the Manager role to use any methods that
start
with manage_?

If so, that's pretty unhelpful, almost as unhelpful as the DocString
limitation
:-(

cheers,

Chris

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



RE: [Zope-dev] Persistence ( was Thread Safe Counting )

2001-02-11 Thread Jon Franz

Ah! this makes more sense, the idea of persistent properties even 
fits with this idea, though a true write-in-place property might be 
even better for some applications ;)

Next time I'll read the whole thread and not the last post in it!

 -Original Message-
 From: Chris Withers [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, February 11, 2001 1:05 PM
 To: Jon Franz
 Cc: '[EMAIL PROTECTED]'
 Subject: Re: [Zope-dev] Persistence ( was Thread Safe Counting )
 
 
 Jon Franz wrote:
  
  So subclassing persistent will avoid changes to the object 
 being stored and
  roll-backable in the ZODB? 
 
 NO! read the posting again... Subclassing from persistent is 
 HOW you make things
 live in the ZODB. However, objects that subclass Persistent 
 get their own pickle
 jar, and so only make the ZODB grow by the size of themselves 
 and their
 attributes each time they change. In my counter's case, 
 that's not a lot :-)
 
  Now, if only we could get this sort of
  store-in-place functionality on a more fine-grained level (like on
  individual
  properties) - we could avoid a lot of coding to prevent 
 ZODB bloat with
  simple
  features.. Ie, if I were to make a 'persistent porperty' on 
 a DTML method,
  I could store counter information in that property without worry
  of ZODB bloat.
 
 I wouldn't be surprised if something like this happens at 
 some stage ;-)
 
 cheers,
 
 Chris
 

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



RE: Re: [Zope-dev] ZSQL using LIKE operator

2001-02-09 Thread Jon Franz

sqltest just creates the full string of the where clause segment 
for the test using the same kind of 'safe' sql-string logic as 
sqlvar: so you should be able to replace the value to test against 
with any valid python expression, such as the one below where 
the % operators are concatenated onto the variable holding the 
value you want to test against. :)

As for the difference between dtml-sqlvar and dtml-var sqlquote 
(in case anyone is confused), an sqlvar tag requires a 
type value and will not only perform an sqlquote on the value 
being inserted into the statement, but will do any/all type 
conversion/stripping (letters from numeric values, etc) needed 
based upon the requested type.  

If anyone is concerned/puzzled by the security hazards I listed 
below, here is a URL describing problems associated with bad data 
used within queries and a mysql DB:

http://www.mysql.com/doc/G/e/General_security.html

See the bullet point beginning with 'Do not trust any data entered by 
your users.'

Sorry if I seemed harsh in my original post, but security is my
bread and butter, so I may tend to be Loud when I see something
wrong...


PS: In order to increase the safety of ZSQLMethods, maybe the basic
dtml-var tag should be made illegal inside it?  (forced usage
of the safe form would break some existent code, possibly, but 
would avoid confusion such as this in general - and thus be safer)

 -Original Message-
 From: Schmidt, Allen J. [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 09, 2001 7:01 AM
 To: 'Jon Franz'; '[EMAIL PROTECTED]'
 Subject: Bad: Re: [Zope-dev] ZSQL using LIKE operator
 
 
 Got it. Making the change now. Thanks for keeping an eye on 
 this thread. 
 What about the sqltest suggestion on posted on this thread? 
 Or do sqltest
 and sqlvar handle DB calls in a similar fashion?
 Thanks
 
 -Original Message-
 From: Jon Franz [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 08, 2001 3:54 PM
 To: '[EMAIL PROTECTED]'
 Subject: Bad: Re: [Zope-dev] ZSQL using LIKE operator
 
 
 No, this is bad!! Do NOT do this - it will allow Bad 
SNIP

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



Bad: Re: [Zope-dev] ZSQL using LIKE operator

2001-02-08 Thread Jon Franz

No, this is bad!! Do NOT do this - it will allow Bad characters in your SQL
query that could allow mischievous people to tamper with your Db and
possibly hack your box
(depending upon what DB you are using, how it is configured, what user it
runs as, etc)
This is the whole reason the dtml-sqlvar tag exists - _Safe_ conversion to
formats usable by 
your DB, including escaping of bad characters.

instead, do This:

SELECT * FROM table WHERE keywords LIKE dtml-sqlvar "'%' + my_var + '%'"
type=string

the expression inside the quotes will handle adding the %'s to the beginning
and end of your string.

Sorry about the correction, but this Can be a big security hazard...

~Jon Franz/'Coventry': http://www.zope.org/Members/Coventry

Message: 9
Date: Thu, 08 Feb 2001 07:32:48 -0500
Subject: Re: [Zope-dev] ZSQL using LIKE operator
From: Jens Vagelpohl [EMAIL PROTECTED]
To: "Schmidt, Allen J." [EMAIL PROTECTED], [EMAIL PROTECTED]

just write it out like:

SELECT * FROM table WHERE keywords LIKE '%dtml-var name="my_var"%'

jens


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



[Zope-dev] Re: Zope server dies with Netscape's FTP

2001-02-04 Thread Jon Franz

I think this may be a problem with passive/active FTP sessions and
(possibly) proxies settign between you and the Zope instance.  I've had the
same problem with other FTP clients when I try to FTP into a Zope server: at
one client's office they do NAT, which acts as a proxy - around 60% of the
time my FTP session will lock up on a PUT, and the WHOLE zope instance dies.
I had written it off as somethign to do with the clien'ts network - but if
its happening to others out there too, then maybe its time we launched an
investigation into this?  The problem I noticed when I looked at it
previously is that no error was ever logged, even with the debug option
turned on - the zope instance just died mysteriously.   
Anyone know of a way off-hand to force zope to do a stack traceback to the
error log when an FTP error (or some other unknown error) takes it down?
Once we track down the problem we could at the least prevent it from killing
anything but it's own thread, if not fix it completely...

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



[Zope] Updated Quickstart for Zope 2.3.0

2001-01-27 Thread Jon Franz


I noticed that 2.3 didn't update the quickstart materials, and that the
quickstart materials still used the old server-side-include syntax
internally and in their examples.  To make matters worse, the ZSQL method
examples didn't use sqlvar - thus were unsafe.  I updated the complete
quickstart to fix these problems and have sent a copy to Brian Lloyd for
future use.  Attached is the updated quickstart for your use in a win32
winzip archive - sorry, I don't have access to any other archive tools at
the moment.  Enjoy!


 QuickStart.zip


Re: [Zope-dev] Passing arguments to DTML Methods

2001-01-26 Thread Jon Franz

This is an undocumented (afaik) feature of DTML methods/documents - due to
the way python
argument mapping works, you can pass any value into a 'local' variable in a
DTML method like thus:

dtml-var "myDTMLmethod(foo=5,greg=Sally)"

this the above case, Sally could be a legal variable value that will be put
into the new local greg
in your DTML method, and one named foo with the value of 5.  AFAIK this is
pass-by-value, so modifying greg in your called method will not change
sally, but I could be wrong...
I use this sort of thing quite often in one of my ongoing projects where I
need to reformat
dates strings from their mysql format to how the client wants to view
them... I have a method named
undb_dateout that uses a variable called 'dbdate' and does some string
splitting and formatting to output it.
Originally, I would do things like this with the method:

dtml-call "REQUEST.set('dbdate', currentdatevar)"
dtml-var undb_dateout

Then, on a whim I changed this to:
dtml-var "undb_dateout(dbdate=currentdatevar)"

And it worked...
Someone should add this to the DTML documentation, or at least make it stand
out more - it is VERY
useful... If no one else does I'll write-up a how-to on it.


Message: 7
Date: Thu, 25 Jan 2001 19:13:59 + (GMT)
From: Espen Sorbye Frederiksen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Message: 7
Date: Thu, 25 Jan 2001 19:13:59 + (GMT)
From: Espen Sorbye Frederiksen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Zope-dev] Passing arguments to DTML Methods

Sorry this, possibly, very trivial question:

How do you pass on variables to a DTML Method.
If I would use a python method I would use dtml-call "pythonmethod(var1,
var2)". This does not work with DTML Methods. First of all why? Secondly
how is it possible to get around the problem?

Hope someone kindly could answer my question,

Espen





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




[Zope-dev] Re: DTML block parsing - better then C/C++

2001-01-24 Thread Jon Franz

This allowance for nested comments, as long as they are properly nested,
is more then many laguages, such as C/C++, give you in the way of allowing
nested comments - So I think its more then acceptable in its current form -
good job!

OK, I have developed a new patch that almost completely fixes this
issue. In fact I am happier with it in general than my first patch.
There is only one flaw, although you can nest comments inside of one
another, and you can have any manner of broken dtml inside, if you open
another comment tag inside it, it must be properly balanced or you will
get a parse error. Here are some examples:

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




[Zope] Odd SQL errors- HELP

2000-10-09 Thread Jon Franz

Hello, I have Zope 2.2.2 running with a MySQL database, and 
everything _was_ working fine until I started to play with 
the new database structure our dba came up with for tracking
our recruiting process...
anyway, i have a db named recruit, with a MySQLDA connection
object to it that works, but on mnay of the tables I get an error
such as the one pasted below when I attempt to do a simple query...
Now, the state table does not return this error and has this 
structure: (as cut-n-pasted from the mysql monitor)
+---+-+--+-+-+---+
| Field | Type| Null | Key | Default | Extra |
+---+-+--+-+-+---+
| state | char(2) |  | PRI | |   |
+---+-+--+-+-+---+

meanwhile any of our tables with 'id' fields choke with
the keyerror: unhandled, heres an example table struct:
+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra  |
+---+--+--+-+-++
| id| mediumint(8) |  | PRI | 0   | auto_increment |
| value | varchar(32)  |  | | ||
+---+--+--+-+-++

Now, at first i thought it was the field name of 'id' causing 
the problem, but now I've tried renaming the field and its still a no-go.
I can do queries such as 'select value from reason' fine, but if i select
* or the id field, it chokes... Looking through the mailinglist archives,
I think its a 'mapping error' where the ZmySQLDA doesn't properly map
this type of field for some reason... can someone help me solve this
problem?
Yes, I can change the db, but thats really not an acceptable option, since
the dba will then just go 'Well, if zope cant handle a simple db structure
without changing field name and/or types, then i refuse to sign off on
using zope as a development tool!'




Zope Error

Zope has encountered an error while publishing this resource.

Error Type: KeyError
Error Value: unhandled

Troubleshooting Suggestions
This resource may be trying to reference a nonexistent object or variable
unhandled.
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/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /usr/local/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /usr/local/zope/2.2.0/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: RoleManager)
  File /usr/local/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /usr/local/zope/2.2.0/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: manage_test)
  File /usr/local/zope/2.2.0/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: manage_test)
  File /usr/local/zope/2.2.0/lib/python/Shared/DC/ZRDB/Connection.py, line
180, in manage_test
(Object: RoleManager)
  File lib/python/Products/ZMySQLDA/db.py, line 191, in query
KeyError: (see above)

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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] ZMysqlDA error, and a workaround

2000-10-09 Thread Jon Franz

This is additional info for the error mentioned in my last email.
If I alter the column definitions to use 'int' as opposed to 'mediumint',
then everything works fine!  So, its the 'mediumint' type that isnt mapping
properly...
where would i fix this?

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




RE: [Zope] ZMysqlDA error, and a workaround

2000-10-09 Thread Jon Franz

Wow, that looks very diffrent from my ZMySQLDA, what version are you
running?
I just got mine to work, I had to mod the def section in the db.py and some
of the code in the MySQLmodule.c file - I want to make it available for
download
and whatnot, but I need to look through the setup script (since it generated
the 
.c file, I think, or at least  moded it) and make sure what I did it
integrated
into the source at that stage...

-Original Message-
From: Steve Spicklemire [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 09, 2000 7:00 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [Zope] ZMysqlDA error, and a workaround



I'm guessing it's in db.py in ZMySQLDA, I had to do the same
thing with DECMIAL as shown here, I didn't post that since I'm
not sure most folks would want this behavior but you should 
be able to do the same with MEDIUMINT:

class DB:

defs={
FIELD_TYPE.CHAR: "i", FIELD_TYPE.DATE: "d",
FIELD_TYPE.DATETIME: "d", FIELD_TYPE.DECIMAL: "n",
FIELD_TYPE.DOUBLE: "n", FIELD_TYPE.FLOAT: "n", FIELD_TYPE.INT24:
"i",
FIELD_TYPE.LONG: "i", FIELD_TYPE.LONGLONG: "l",
FIELD_TYPE.SHORT: "i", FIELD_TYPE.TIMESTAMP: "d",
FIELD_TYPE.TINY: "i", FIELD_TYPE.YEAR: "i",
}

conv={
FIELD_TYPE.TINY: int,
FIELD_TYPE.SHORT: int,
FIELD_TYPE.LONG: int,
FIELD_TYPE.FLOAT: float,
FIELD_TYPE.DOUBLE: float,
FIELD_TYPE.LONGLONG: long,
FIELD_TYPE.INT24: int,
FIELD_TYPE.DECIMAL: float,
FIELD_TYPE.YEAR: int
}


-steve

 "Jon" == Jon Franz [EMAIL PROTECTED] writes:

Jon This is additional info for the error mentioned in my last
Jon email.  If I alter the column definitions to use 'int' as
Jon opposed to 'mediumint', then everything works fine!  So, its
Jon the 'mediumint' type that isnt mapping properly...  where
Jon would i fix this?

Jon ___ Zope maillist
Jon - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope
Jon ** No cross posts or HTML encoding!  ** (Related lists -
Jon http://lists.zope.org/mailman/listinfo/zope-announce
Jon 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] ZMysqlDA error, and a workaround

2000-10-09 Thread Jon Franz

doh, I was the one running the odd version - 1.1.3 as opposed to the newer
1.2 - I guess I never updated this when I updated the full zope install.
The new version looks like it would of been much easier to fix, if it had 
the problem in the first place!

-Original Message-
From: Jon Franz 
Sent: Monday, October 09, 2000 7:07 PM
To: '[EMAIL PROTECTED]'; Jon Franz
Cc: [EMAIL PROTECTED]
Subject: RE: [Zope] ZMysqlDA error, and a workaround


Wow, that looks very diffrent from my ZMySQLDA, what version are you
running?
I just got mine to work, I had to mod the def section in the db.py and some
of the code in the MySQLmodule.c file - I want to make it available for
download
and whatnot, but I need to look through the setup script (since it generated
the 
.c file, I think, or at least  moded it) and make sure what I did it
integrated
into the source at that stage...

-Original Message-
From: Steve Spicklemire [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 09, 2000 7:00 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [Zope] ZMysqlDA error, and a workaround



I'm guessing it's in db.py in ZMySQLDA, I had to do the same
thing with DECMIAL as shown here, I didn't post that since I'm
not sure most folks would want this behavior but you should 
be able to do the same with MEDIUMINT:

class DB:

defs={
FIELD_TYPE.CHAR: "i", FIELD_TYPE.DATE: "d",
FIELD_TYPE.DATETIME: "d", FIELD_TYPE.DECIMAL: "n",
FIELD_TYPE.DOUBLE: "n", FIELD_TYPE.FLOAT: "n", FIELD_TYPE.INT24:
"i",
FIELD_TYPE.LONG: "i", FIELD_TYPE.LONGLONG: "l",
FIELD_TYPE.SHORT: "i", FIELD_TYPE.TIMESTAMP: "d",
FIELD_TYPE.TINY: "i", FIELD_TYPE.YEAR: "i",
}

conv={
FIELD_TYPE.TINY: int,
FIELD_TYPE.SHORT: int,
FIELD_TYPE.LONG: int,
FIELD_TYPE.FLOAT: float,
FIELD_TYPE.DOUBLE: float,
FIELD_TYPE.LONGLONG: long,
FIELD_TYPE.INT24: int,
FIELD_TYPE.DECIMAL: float,
FIELD_TYPE.YEAR: int
}


-steve

 "Jon" == Jon Franz [EMAIL PROTECTED] writes:

Jon This is additional info for the error mentioned in my last
Jon email.  If I alter the column definitions to use 'int' as
Jon opposed to 'mediumint', then everything works fine!  So, its
Jon the 'mediumint' type that isnt mapping properly...  where
Jon would i fix this?

Jon ___ Zope maillist
Jon - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope
Jon ** No cross posts or HTML encoding!  ** (Related lists -
Jon http://lists.zope.org/mailman/listinfo/zope-announce
Jon 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] Re: Adding a new property over http

2000-09-15 Thread Jon Franz

Heres a snip of DTML that adds a property to the parent if the property
doesn't exist.
If you create a ZClass with this, it will modify the parent folder when
called from
within a DTML document, if you do it as a DTML Method, it will modify the
parent document.


dtml-if "hasProperty('z_count')"
   dtml-call "REQUEST.set('z_count', z_count + 1)"
   dtml-call "manage_changeProperties(REQUEST)"
dtml-else
   dtml-call "manage_addProperty('z_count', 1, 'int' )"
/dtml-if


Now, if you wanted to Take a variable in a form (or link), and make it a
property like in your example, you're method would look like this, Assuming
the form had fields to pass the values as 'NewName:string' and
'NewValue:tokens', or your calling link ends with
?NewName:string=fooNewValue:tokens=mytokens


dtml-if "hasProperty(NewName)"
   dtml-call "REQUEST.set(NewName, NewValue)"
   dtml-call "manage_changePRoperties(REQUEST)"
dtml-else
   dtml-call "manage_addProperty(NewName, NewValue)"
/dtml-if


I hope this helps!  Now if only someone could answer why the behaivor
changes between having it as a DTML method and a ZClass! (And how to fix
it!)

Message: 5
From: "Jason Cunliffe" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Zope] Adding a new property over http
Date: Thu, 14 Sep 2000 15:00:41 -0400
charset="iso-8859-1"

Hello

I asked this in longer form before, but it fell by the way I think..

How to add a property to a containing folder.
Looking for DTML or External Method way to do this.

We need a Method to to add a new folder property assigning an 'Id' =
somename adn 'type' = 'tokens'.
We need to be able to do this by passing the variable somename over
http.

thanks
- Jason

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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] (Correction) Re: Adding a new property over http

2000-09-15 Thread Jon Franz

In the previous email, this line:
   dtml-call "manage_addProperty(NewName, NewValue)"
Should have been:
   dtml-call "manage_addProperty(NewName, NewValue, 'tokens')"

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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-dev] FW: ZClass, acquisition, dtml confusion

2000-09-10 Thread Jon Franz

Since no one on general could answer this, I'm sending it to Dev 
now: sorry for cross posting.

-Original Message-
From: Jon Franz 
Sent: Friday, September 08, 2000 1:24 PM
To: '[EMAIL PROTECTED]'
Subject: ZClass, acquisition, dtml confusion


Hello,
Previously I made a DTML method that when used within a 
DTML Document would modify properties on that document.  
Having this floating around in root made it visible to the 
whole site, but seemed 'unclean'.  So, I attempted to make 
the DTML method into a ZClass, and making the index_html 
method in the ZClass contain the exact same DTML as the 
method... But it doesn't work.  So, I tried again - this 
time with as simple a method as possible, a very basic 
counter.  The DTML method I made in root increments and 
displays the 'z_count' property on the page that calls it, 
and creates the property if it doesn't exist, so using it 
is as simple as:

dtml-var mycount

However, I place the DTML into a new class, and then make 
a new instance of the class, and it wont work as above.  
I now have to do this:

dtml-with MyZCCount
dtml-var MyZCCount
/dtml-with

And, instead of modifying the property of the calling document, 
it modifies the parent folder's properties.  Below is the DTML, 
can someone please explain what I need to do to get this to 
work on the calling DTML document instead?  If I can't get 
this simple counter to work I'm going to go mad, since changing 
properties is something I need to be able to do from many of my 
planned ZClasses... Thanks in advance!

dtml-if "hasProperty('z_count')"
  dtml-var "'%06d' % (z_count + 1)"
  dtml-call "REQUEST.set('z_count', z_count + 1)"
  dtml-call "manage_changeProperties(REQUEST)"
dtml-else
  dtml-call "manage_addProperty('z_count', 1, 'int' )"
  01
dtml-if

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




[Zope] ZClass, acquisition, dtml confusion

2000-09-08 Thread Jon Franz

Hello,
Previously I made a DTML method that when used within a 
DTML Document would modify properties on that document.  
Having this floating around in root made it visible to the 
whole site, but seemed 'unclean'.  So, I attempted to make 
the DTML method into a ZClass, and making the index_html 
method in the ZClass contain the exact same DTML as the 
method... But it doesn't work.  So, I tried again - this 
time with as simple a method as possible, a very basic 
counter.  The DTML method I made in root increments and 
displays the 'z_count' property on the page that calls it, 
and creates the property if it doesn't exist, so using it 
is as simple as:

dtml-var mycount

However, I place the DTML into a new class, and then make 
a new instance of the class, and it wont work as above.  
I now have to do this:

dtml-with MyZCCount
dtml-var MyZCCount
/dtml-with

And, instead of modifying the property of the calling document, 
it modifies the parent folder's properties.  Below is the DTML, 
can someone please explain what I need to do to get this to 
work on the calling DTML document instead?  If I can't get 
this simple counter to work I'm going to go mad, since changing 
properties is something I need to be able to do from many of my 
planned ZClasses... Thanks in advance!

dtml-if "hasProperty('z_count')"
  dtml-var "'%06d' % (z_count + 1)"
  dtml-call "REQUEST.set('z_count', z_count + 1)"
  dtml-call "manage_changeProperties(REQUEST)"
dtml-else
  dtml-call "manage_addProperty('z_count', 1, 'int' )"
  01
dtml-if

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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-dev] RE: Voting for patches?

2000-08-24 Thread Jon Franz

This is already being setup as part of the patch and small change
integration page...
more details once it's up this weekend ;P
you will like.


Message: 9
Date: Thu, 24 Aug 2000 15:09:32 +0100
From: Chris Withers [EMAIL PROTECTED]
Organization: New Information Paradigms
To: Adam Karpierz [EMAIL PROTECTED]
CC: "[EMAIL PROTECTED]" [EMAIL PROTECTED]
Subject: [Zope-dev] Voting for Patches?

Adam Karpierz wrote:
 There is a patch for it:
 http://classic.zope.org:8080/Collector/1540/view

I wonder whether it'd be worth enabling people to vote on what patches
they'd like integreated and what bugs they'd like solved in the
collector?

The one for me is the ability, in effect, to shout 'Me too!' when I see
a bug that I've experienced too. Maybe this would help filter down the
collector or at least give anotehr way that it could be prioritised?

cheers,

Chris


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




Re: [Zope-dev] patch for dtml-foo:bar:baz;

2000-08-18 Thread Jon Franz

This may, or may not, break the alternate syntax patch/download @
http://www.zope.org/Members/Coventry/dtml_shortcut
I'll investigate and find out, and release a new dtml_shortcut if needbe.
(I specifically used a colon since it is valid xml) What about using a colon
as the separator, but explicitly give the tag the name dtml-root?
dtml-root foo:bar:childofbar

having a whole tag of type ':' seems weird (in addition to possibly breaking
current patches and such ;)

if we didn't want the root to be the default we could use something like
dtml-trans [path]:[path] with something like _root or __root being set
aside as a special name for starting at the root (otherwise it would start
in the current directory)...?



This patch changes lib/python/DocumentTemplate/DT_HTML.py so that you
can use paths for traversal in DTML entity syntax. The delimiter is ':',
as it is valid as part of an XML entity, but not valid as part of a Zope
object id.

You can use dtml-:foo:bar; to ensure that traversal occurs from the
root object.

This patch is against Zope 2.2.1b1. It relies on the
restrictedTraverse() api.

A 2.1.x version would be possible, but would be rather messy.


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




[Zope] ANN: Border Aware Image Update for Zope 2.2.0

2000-07-25 Thread Jon Franz

The Border Aware Image add-on has been updated for Zope 
2.2.0 - installation has been heavily updated and is now 
much easier.

see:
http://www.zope.org/Members/Coventry/Border_aware_image

Also, the alternate syntax patch/add-on has been tested 
with Zope 2.2.0 now, and no changes were needed.  The 
new documentation reflects this at:

http://www.zope.org/Members/Coventry/dtml_shortcut


Also:
I will be submitting a proposal soon to dev.zope.org: the 
project would handle evaluating and integrating small 
add-ons such as these and others into the Zope core, 
please email me if you would be interested in participating.

~  Jonathan M. Franz ~ Senior Developer/Technical Leader  ~
~ SW-Dev Division, Springdale, Ohio Office ~ 513.618.2248 ~ 
~ OneNet Communications (A USNet/MDM Company) www.one.net ~

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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] two stupid, non-technical questions.

2000-07-05 Thread Jon Franz

Please excuse these questions, they are not my average question fodder...

A) Are there Zope t-shirts available, or downloadable artwork to make your
own Zope t-shirts?
- this question was actually posed by a co-worker who seems to get his
entire wardrobe from
copyleft and software companies promoting their products...  would a
copyleft shirt be appropo?

B) Has anyone modified their apache installation (if using the apache pass
through to Zope) to
return the server as being a Zope server?  I ask because if we do not do
this, then we (the Zope
community) will only appear in the netcraft server surveys when using the
stand-alone ZServer...


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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-dev] New for download: Image.py that is border-aware

2000-07-03 Thread Jon Franz

The subject says it all... no more dtml-var "foo.tag(border=0)" type
schtuff...

http://www.zope.org/Members/Coventry/Border_aware_image

Note: this was created, and tested, on Zope 2.1.6 - newer installations, or
those with modifications to thier Image.py file in
zope-home/lib/python/OSF should Not use the new file - they should compare
the file and apply the changes by hand to thier Image.py to avoid version
troubles.

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




[Zope] New for download: Image.py that is border-aware

2000-07-03 Thread Jon Franz

The subject says it all... no more dtml-var "foo.tag(border=0)" type
schtuff...

http://www.zope.org/Members/Coventry/Border_aware_image

Note: this was created, and tested, on Zope 2.1.6 - newer installations, or
those with modifications to thier Image.py file in
zope-home/lib/python/OSF should Not use the new file - they should compare
the file and apply the changes by hand to thier Image.py to avoid version
troubles.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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] Single content tree, 3 'look-n-feel's...

2000-07-02 Thread Jon Franz

Hello,
I'm currently preparing to build a large corporate website with
Zope.  the corporation in question ants a dell-ish sort of interface and
content tree in which users will choose on the opening pages what Sort of
user they are (home-user, small business, or corporate) - after choosing the
type of user they are, the look-n-feel of the site will be geared towards
their specific type, but, the content will be shared across all of the
different styles.  that is to say, I might have a products dtml document,
but it will need to look different for each type of user.  I know this can
be done easily with some simple session variables and some logic in my
standard_html_header and footer, but I was wondering if there was an easier
(to manage - different people will be in charge of each look-in-feel)
way...?  I saw an announcement on "transparent" folders - would that be of
any use in this situation?


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   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 Editors that recognize DTML (was bastardized formofXML)

2000-06-28 Thread Jon Franz

This looks very cool - the HTMl jive, that is.  I'm going to mod it some,
and get permission from the author to incorporate it into Zope... I'll add
some features like search and replace also...


-Original Message-
From: Gidon Friedman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 28, 2000 6:12 AM
To: Jon Franz
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope] HTML Editors that recognize DTML (was bastardized
formofXML)


 Does anyone know of a good (free!) java applet based text editor?
Something
 with basic color tagging abilities and maybe even (gasp) a spell checker,
 search/replace, etc?  If there is one, we could mod it to spit its output
as
 a form post, and hus have a great built-in editor for most browsers...

that would be nice, but you would have to build one yourself. Java Swing
has an HTMLEditorKit, but i never tried to use it. have a look at:
http://www.mokabyte.it/1999/12/htmleditor.htm
it explains in italian how to do it (untested).

or you could use javascript:
 http://www.cris.com/~raydaly/htmljive.html

Gidon


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

2000-06-27 Thread Jon Franz

Hrm, I'm using hot-fixed and updated 2.1.6, and cant seem to find this
anywhere on my box - and Zope throws up the error 'Invalid attribute' 
with an id of 'reg' When I try to use (unfixed) Confera with newlines 
in the body of a message... 

I'm not advocating removing or ignoring ts_regex, I just
can't find it and figured if I ran into this problem, so would others...
the code change to Confera.py was _very_ trivial, so I don't see any big 
benefit or requiring ts_regex, though...


-Original Message-
From: Pavlos Christoforou [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 27, 2000 6:19 PM
To: Jon Franz
Cc: '[EMAIL PROTECTED]'
Subject: Re: [Zope-dev] Confera fix


On Tue, 27 Jun 2000, Jon Franz wrote:

 Attached is a slightly modified Confera.py that does not require the
 ts_regex
 python package (something I do not have on my system and cant seem to 
 find - and yet something Confera will choke on during message posting if 
 it doesn't exist)
 

I have not been follwoing the email list so ignore my comments if not
applicable. ts_regex used to be part of the Zope distribution. I am not
sure what happened with the newer versions ...


Pavlos


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




[Zope] possible security flaw? - and, request for a phone conference.

2000-06-07 Thread Jon Franz

Hello, 
First off, sorry for the cross-posting of this message to admin and
to
development.
   I'm a software developer for a major ISP in the Midwest region of the
USA.
Recently we began evaluating Zope for use in our web application
development,
internally and for our clients, and have been quite pleased with the wealth
of features and add-ons available*;  However, I need two points addressed if

possible:

1)  We are running Zope 2.1.4 mapped to the root of the apache install
on a Linux (mandrake 7.0) box, and have found a rather nasty security -
or at least, its what I'll call a nasty problem - because if you don't know
about it, it could really bite you in the butt.
Basically, if a user with manager privileges to a folder changes
their
password to be empty, then anyone (from permitted domains) can access the
management screen for that folder Without Logging On... Zope assumes that
you are the user without the password and treats you as if you have those
rights.
I found this problem when one day the welcome Zope page (default
from install) didn't prompt me for a password when I clicked to enter
the management screen.  I did not realize what had happened until I went
under the 'undo' tab and saw that all of my actions while I was snooping
around for the problem were being listed as being done by one of the
other developers... I went into the acl_users and fixed their password
and everything is back to normal.  I've tested this by setting my own
password to an empty string, and it lets me log in...
From a security standpoint, It should probably prompt for a user
name and password, and simply accept a empty field for the password
As the password for that user...
Anyway, my point is to either inform the community of the bug,
if it isn't known, or to find out if it is known and has been fixed
in the newest release...  If it has not been fixed in the newest release,
I will be glad to create and provide a patch...

2)  As an experienced web developer, I'm very keen on new technologies
that can be reused and make my life easier - thus Zope is a godsend.
However, my management is hesitant to start using Zope on a regular
basis for our projects - they feel it is unproven and possibly unstable:
Now, I realize, and have informed them of the facts, that Digital Creations
makes their living off of Zope, and that new businesses are springing up
almost everyday that are Zope-centric, and that many contracting/development
firms are embracing it whole heartedly... But, my management is still
kind of hesitant.  
Is there anyone among you in the community who would be willing to 
write about your experience with Zope in the professional development 
arena, to address their concerns?  Even better, Would anyone be willing to 
participate in a conference call q  A session on Zope's suitability for 
use in professional web development?  I cannot offer money for these, but 
I can promise my undying gratitude, and, I can promise that any and all 
add-ons and patches we create for Zope would be released back to the 
community at large... As a large website app dev firm, our contributions 
could be significant...
Please email me privately if you wish to possibly participate in 
the phone conference.  
Thank you for your time and attention!

* I have already made two modifications to the Zope source, one dealing with
making 'border' a built in property (and used during tag output) of the 
image object.  and another, simple hack to the basic dtml parsing routines
that makes your dtml development a little faster by requiring less typing.
Both of these will be available under my member area on Zope.org.  Hopefully
these will be the first of many patches and add-ons I get to contribute.

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