Re: [Zope-dev] New Help System in 2.2

2000-06-07 Thread Itamar Shtull-Trauring

"Dan L. Pierson" wrote:

 You might want to take a look at the bottom of http://www.lfw.org/python/...

He finally released it!  I've been waiting for this since IPC8.

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
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] Containers in ZODB

2000-06-07 Thread Petr Knapek

Hi Zopists,
I would like to use ZODB3 as an object DB to store my own objects. At
the beginning, I will make any text UI but later I want to put my
objects into a ZOPE Folder and store them inside ZOPE ZODB (Zope will
serve as GUI). Generaly I have 2 types of objects:

Container - object with some attributes and methods which can collect
other objects (also Containers)
Item - an object with some attributes and methods which can not collect
any other objects but can be contained in Container

My questions are:

1. Does anybody know what the essential Zope classes from which I have
to inherit are? Of course I know the Persistent is essential for both of
them but don't know whether it is sufficient for future import of my own
ZODB as a part of Zope ZODB.

2. Does anybody know how to import my own ZODB (*.fs file) into Zope
   ZODB?

I don't need to have any tabs in the web browser connected with my
objects I only need possibility to store these objects inside Zope and
call their methods. 
Please can anybody react on this it is very important to me, it is my
project and I want to use ZODB. 

WBR, Petr
-- 
Petr Knpek
NEXTRA Czech Republic, s.r.o., Veve 102, 659 10 Brno, Czech Republic
e-mail: mailto:[EMAIL PROTECTED]
tel:+420-5-41 558 394
FAX:+420-5-41 558 390

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

___
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] Containers in ZODB

2000-06-07 Thread Itamar Shtull-Trauring

Petr Knapek wrote:

 Container - object with some attributes and methods which can collect
 other objects (also Containers)

For these you should inherit from OFS.ObjectManager.ObjectManager.

 Item - an object with some attributes and methods which can not collect
 any other objects but can be contained in Container

For these you should inherit from OFS.SimpleItem.Item.

All you really need is to inherit from Persistent, if you're making your own
objects, but inheriting from the above will allow you to use them later in
an easier fashion.

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
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] LM and user objects

2000-06-07 Thread Dan L. Pierson

Bill Anderson writes:
  "Phillip J. Eby" wrote:
   
   At 04:03 PM 6/6/00 -0600, Bill Anderson wrote:
   
   I am using the deafult UserSource that comes with LM for the moment (one
   step at a time ;)
   
   LM or PTK?
  
  LM
  
  (Waiting for Dan's changes before trying _any_ LM with PTK ;)

I posted the patch about two weeks ago, have you tried it?  I just got 
back from vacation yesterday afternoon.  It looks like Steve Alexander 
tried it and it worked OK (once he tracked down a bug in his manual
patch application that took me about a day to find when I created the
patch -- missing imports whose only references are wrapped in a
try/except can be hard to find :-().

I plan to check this in later today, either directly or on a branch.
Any preferences?

___
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] Request for comments: Directory storage

2000-06-07 Thread Petru Paler

  Hello all,

   You probably saw my yesterday post with the first alpha of
ReiserStorage. One of the questions that people tend to ask about it is
wheter they can use it without reiserfs.
   There are two problems with not using reiserfs:

1. ReiserStorage (now renamed to DirectoryStorage) stores each object in a
separate file and *all* the files in a single directory. This was done in
order to let the filesystem what it was meant to do: store and retrieve
files quickly. While reiserfs is *extremely* good at this (it uses a btree
to store directory entries), most other filesystems do linear searches
when finding a file so performance is very bad when you have many files in
a single directory.
   This problem can be solved by splitting files into multiple directories
when not using reiserfs. This would add a little overhead but it is
tolerable.

2. Waste of space. Typical block-allocation filesystems like ext2 and FAT
will waste alot of space in the usage pattern of DirectoryStorage.
ReiserFS packs small files together in the btree, so it solves the
problem, but I have no ideea how this could be fixed easyly on the other
fs's.

Comments ? Suggestions ?

PS: a new DirectoryStorage release will be done today, with bugfixes and
new features.

-Petru



___
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] Getting to container from a method called by the factory

2000-06-07 Thread Kevin Dangoor

- Original Message -
From: "Itamar Shtull-Trauring" [EMAIL PROTECTED]
To: "Kevin Dangoor" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, June 07, 2000 3:44 AM
Subject: Re: [Zope-dev] Getting to container from a method called by the
factory


 Kevin Dangoor wrote:
  I'm trying to check if the container from which the user selected a
  product from the add menu has an "acl_users" folder. When the user
selects
  the option from the add menu, they get a form. When they submit the
form,
  the method (a PythonMethod) does this:
 
  folder=self.Destination()
  if hasattr(folder, 'acl_users'):
...do something...
  else:
...complain...
 
  Even though I know the folder has an acl_users (and having this function
  return folder.objectIds() proves it), the above code will always
complain.
  Is there a problem with using hasattr in this context?

 Well, first of all, because of acquisition, if there's a acl_users at the
 top level this will always return true.

I didn't think hasattr() used acquisition... I thought hasattr would tell
you if something is within that object itself.

  Next, PythonMethods have trouble
 with hasattr AFAIK - so instead do:

I didn't realize this.


 folder=self.Destination()
 if 'acl_users' in folder.objectIds():
...do something...
 else:
...complain...

Yep. I thought of that one, too. I figured hasattr might be more efficient
in large folders. In this particular context, that little bit of efficiency
is not important and your example would work fine.

Thanks for the tip.

Kevin


___
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] Recursively adding ZClasses (continued)

2000-06-07 Thread Kevin Dangoor

- Original Message -
From: "Rik Hoekstra" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 07, 2000 4:28 AM
Subject: [Zope-dev] Recursively adding ZClasses (continued)


 First I had a problem with nested ZClasses, which got me into trouble
 when I wanted to add ZClasses to each other. So I followed the 'common
 wisdom' of adding all ZClasses at the top level of the product. THis
 generally works OK, and you can add ZClass instances to each other from
 the management interface. So far so good. WHere things go wrong is by
 recursively adding ZClasses, as in:

 the following pseudo code for ParticularZClass with some NestedZClasses
 inside:

 (Particular ZClass constructor has the following action sequence):
 create ParticularZClass instance
 set some properties
 in somelist
set some other properties into REQUEST
create NestedZClass instances
 whatever

 reading and following every piece of documentation I could get on this
 (not much), I never got any further than adding the NestedZClasses
 instances on the _same_ level as the ParticularZClass. No dtml-with
 "manage_addProduct['whatever']" (which contrary to documentation should
 have the containing product and not the ZClass as the 'whatever'
 argument) could help me out.

I'm using nested ZClasses in KM|Net News. Take a look at the AddArticle
method. In KMNN, these ZClasses are set up as nested ZClasses, so that may
change things somewhat. However, it may still work. Rather than doing
manage_addProduct[], you *might* be able to just directly call
ZClass_add(_.None, _), because it could be in your acquisition path at the
top of the product. In KMNN, that's all I had to do, but in that case the
ZClass_add method was located within the ZClass that was to contain it.

That sounded kind of rambling, so I hope it makes sense...

Kevin


___
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] Request for comments: Directory storage

2000-06-07 Thread Jason Spisak

Petru Paler:

This is the embodiment of my MutliFileStorage thingy on Jim's ZODB Wiki.  I
droped it (Never picked it up) when Mountable Storage was announced.  I'll
create a ReierFS partition some time this week and try it out.  Excellent!

   Hello all,
 
You probably saw my yesterday post with the first alpha of
 ReiserStorage. One of the questions that people tend to ask about it is
 wheter they can use it without reiserfs.
There are two problems with not using reiserfs:
 
 1. ReiserStorage (now renamed to DirectoryStorage) stores each object in a
 separate file and *all* the files in a single directory. This was done in
 order to let the filesystem what it was meant to do: store and retrieve
 files quickly. While reiserfs is *extremely* good at this (it uses a btree
 to store directory entries), most other filesystems do linear searches
 when finding a file so performance is very bad when you have many files in
 a single directory.
This problem can be solved by splitting files into multiple directories
 when not using reiserfs. This would add a little overhead but it is
 tolerable.
 
 2. Waste of space. Typical block-allocation filesystems like ext2 and FAT
 will waste alot of space in the usage pattern of DirectoryStorage.
 ReiserFS packs small files together in the btree, so it solves the
 problem, but I have no ideea how this could be fixed easyly on the other
 fs's.
 
 Comments ? Suggestions ?
 
 PS: a new DirectoryStorage release will be done today, with bugfixes and
 new features.
 
 -Petru
 
 
 
 ___
 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 )
 


Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

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

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




Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Rik Hoekstra

snip

Thanks for replying Kevin, but it won't work ;-( I tried it ALL, and it
_will_not_work_. The nested ZClasses will apparently solve it (I used it
elsewhere), but it will get you into trouble in other situations - if
you want to add an instance of the nested zclass to an existing instance
of that same nested zclass. I had to change my product before because of
that.

 
 I'm using nested ZClasses in KM|Net News. Take a look at the AddArticle
 method. In KMNN, these ZClasses are set up as nested ZClasses, so that may
 change things somewhat. However, it may still work. Rather than doing
 manage_addProduct[], you *might* be able to just directly call
 ZClass_add(_.None, _), because it could be in your acquisition path at the
 top of the product. In KMNN, that's all I had to do, but in that case the
 ZClass_add method was located within the ZClass that was to contain it.
 
 That sounded kind of rambling, so I hope it makes sense...

No matter if you use ZClass_add directly or in  dtml-with. No matter if
you close the first dtml-with and open another. No matter if you
redirect to get out of namespace problems (that will _really_ give
strange errors). Believe me, it was a _very_ frustrating experience (and
I really wanted to refrain from ranting -just couldn't help myself)

thanks again for replying

Rik

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




RE: [Zope-dev] LM and user objects

2000-06-07 Thread Dan L. Pierson

Chip Vanek writes:
  Hi,
  
  I also tried to get the patch working with 2.2CVS PTK CVS and had little luck.
  I also needed to manually apply the patch and worked through the errors until
  I got a security violation with the PTK.  I was no longer in any way able to
  access any of my test portals using the management interface.  I needed to
  back the patch out and get to plain 2.21a and PTK cvs to even get a ZODB
  portal working.

Interesting.  I've been avoiding 2.2 until the new security model gets 
some more bugs worked out.  Unfortunately, this means I'm not
surprised that you had problems...

  With all the problems with the standard PTK way of handling users access, I
  think that the best long term solution is to fully make the leap into the use
  of LoginManager and Racks as the standard mechenism for the PTK.  

We seem to have consensus on this.  Looks like Kevin's taken over the
lead on getting to the next step which is a coherent interface for PTK 
Membership to use to specify how to set up its LoginManager (e.g. how
do I create a Membership instance using a Postgressql based UserSource 
here, and another Membership instance using NT domain logins there).

  I also think
  that the standard authentication algorithm should support user login screens
  before basic auth for those folders that have a login_form in the aquisition
  path.

That would certainly help.

  So my vote is to check your patch into the main stream and harden
  it.

That's three in favor and none opposed so far.  I'll do it after
fighting a higher priority fire this afternoon.

___
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] Recursively adding ZClasses (continued)

2000-06-07 Thread Jason Spisak

Rik Hoekstra writes:

This currently adds recursive ZClasses for me.  All ZClasses are on the top
level of the Product, no nesting:

cut out untested

dtml-with "PermanentJobClass.createInObjectManager(REQUEST['id'],
REQUEST)"
 dtml-call "propertysheets.PermanentJob.manage_editProperties(REQUEST)"
 dtml-call "propertysheets.Job.manage_editProperties(REQUEST)"
 dtml-call "propertysheets.Searchable.manage_editProperties(REQUEST)"
 dtml-with "manage_addProduct['ZGL']"
  dtml-with "ServiceClass.createInObjectManager(_.getitem('unique_id', 1),
REQUEST)"
   dtml-call "propertysheets.Service.manage_changeProperties(REQUEST)"
   dtml-with "manage_addProduct['ZGL']"
dtml-with "ItemClass.createInObjectManager(_.getitem('unique_id', 1),
REQUEST)"
 dtml-call "propertysheets.Item.manage_changeProperties(
price=REQUEST['price'],
description='Placement Fee',
)"
 dtml-with "manage_addProduct['ZGL']"
  dtml-with
"ComponentClass.createInObjectManager(_.getitem('unique_id', 1), REQUEST)"
/dtml-in default_overrides
   /dtml-with
  dtml-call reindex_object
  /dtml-with
 /dtml-with
 dtml-call reindex_object
/dtml-with
   /dtml-with
   dtml-call reindex_object
  /dtml-with
 /dtml-with
 dtml-call reindex_object
/dtml-with
/dtml-with
dtml-call "RESPONSE.redirect(URL1 + '/' + REQUEST['id'])"

/cut out untsted
I cut a few things out that didn't have to do with the recursing, but you
bet the general picture.

All my best,


 snip
 
 Thanks for replying Kevin, but it won't work ;-( I tried it ALL, and it
 _will_not_work_. The nested ZClasses will apparently solve it (I used it
 elsewhere), but it will get you into trouble in other situations - if
 you want to add an instance of the nested zclass to an existing instance
 of that same nested zclass. I had to change my product before because of
 that.
 
  
  I'm using nested ZClasses in KM|Net News. Take a look at the AddArticle
  method. In KMNN, these ZClasses are set up as nested ZClasses, so that may
  change things somewhat. However, it may still work. Rather than doing
  manage_addProduct[], you *might* be able to just directly call
  ZClass_add(_.None, _), because it could be in your acquisition path at the
  top of the product. In KMNN, that's all I had to do, but in that case the
  ZClass_add method was located within the ZClass that was to contain it.
  
  That sounded kind of rambling, so I hope it makes sense...
 
 No matter if you use ZClass_add directly or in  dtml-with. No matter if
 you close the first dtml-with and open another. No matter if you
 redirect to get out of namespace problems (that will _really_ give
 strange errors). Believe me, it was a _very_ frustrating experience (and
 I really wanted to refrain from ranting -just couldn't help myself)
 
 thanks again for replying
 
 Rik
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )
 


Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

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

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