[Zope] Re: Zope 2 and Zope 3

2007-02-14 Thread Geoff Gerrietts

On 2/14/07, Philipp von Weitershausen <[EMAIL PROTECTED]> wrote:


There will definitely be a Zope 2.11 and at this point I see no reason
why there shouldn't be a Zope 2.12. We (the Zope Community, not
necessarily Zope Corporation) will maintain Zope 2 as long as it's
necessary. "Maintaining" in this case also means integrating more Zope 3
technologies with each release. Nowadays (Zope 2.10) you can already
write applications, or at least base libraries, that work on both Zope 3
and Zope 2.


This is very helpful for setting a planning horizon, thank you.


I'm surprised you're experiencing poor scaling. I think Zope can scale
pretty well, or at least it can be *made* to scale pretty well. It all
depends on your setup and, of course, on your application.


I can't swear to the accuracy of what I'm about to say but it is an
operating hypothesis that describes accurately behavior that we are
seeing.

Our application is highly dynamic, by which I mean that satisfying any
given request may require a great deal of database activity. The
database in question is almost always Oracle; I'm not counting the
ZODB accesses, here.

Oracle will handle a great many concurrent requests fairly gracefully,
but its average transaction time is not always excellent, especially
for moderately complicated queries. While most queries are sub-second,
populating a page that requires multiple queries to fill in all its
data fields, or even populating a page with only one or two
complicated queries, can require greater than a single second of
database I/O. This cost is offset by the ability to have other threads
processing while your first thread waits for the database to come
back.

Zope likes to have 4 threads processing requests. This preference is
documented in several places, and experiments have historically borne
out the "4 thread hypothesis". We have been unable to realize
significant performance improvements by increasing the number of
available worker threads, but we are able to realize performance
improvements by pointing two Zope servers against the same database.

Zope isn't using much CPU, and it's not using much memory, but it
peaks out at 4 concurrent requests; everything else goes in a queue
behind them. If those 4 concurrent requests happen to take 4 or 5
seconds each, the queue builds deep behind them, possibly with very
simple one-offs.

Historically, we've addressed this by sticking another Zope out there.
We have plans to run multiple Zope instances on a single machine, like
they do (did?) at plone.org; this still requires configuration
management work and testing. But the feeling is that we have a lot
more hardware than we really should need, to handle the volumes we're
dealing with, and we have that hardware because we need more
"channels" to handle our concurrent traffic load.


As for source control, I figure all of your code (DTML, yuck) is in the
ZODB. This went out of fashion a long time ago, most serious development
happens on the filesystem (in Python packages) which can obviously be
source-controlled very well.


A good deal of the code is in the ZODB, because it's (yuck) DTML
documents, yes. We have another sizable chunk that lives on the
filesystem. The challenge in managing the build/deploy process has
been trying to find a way to keep those two conjoined. I suspect that
any dependency on the ZODB at all is likely to be considered an
impediment, and my quick eyeballing says it's not gone or even really
optional under Zope 3 (but I'm sure we could work something out.)



Regarding "oh you'll hafta start over", it's pretty much true, if you
want to switch to Zope 3. But nobody says you have to. You can do it
incrementally by porting some of your app's functionality to Zope 3
components step by step (as mentioned already, most work in Zope 2). Big
projects like Plone aren't rewriting their whole codebase either, but
new development is completely Zope3-based. Their target platform still
is Zope 2, though.


"You'll hafta start over" is only ever true in degrees, though, and
I'm still trying to figure out what the degrees are. The business
logic will still be the same. Can we hack together a DTML processor
that allows us to export the DTML documents to the filesystem and
publish them from there? Maybe, I don't know. Did someone else already
do that? Don't know that either. How dramatically will our products
need to change? Probably 75% of our Python code is written in a
bastardized form of ExternalMethod; we might be able to leverage that
unfortunate architectural choice to significant advantage during our
porting phase. These are the kinds of questions I have, and I think
the answers probably aren't easy or someone would have offered them
up.

Someone's going to need to learn enough Zope 3 to answer the
questions. I'm not sure it will be me, but maybe. :)

Thanks for all the insight, I'm making plans and pleas and I have a
direction for my research now. :)

Thanks,
--G.

[Zope] Zope 2 and Zope 3

2007-02-14 Thread Geoff Gerrietts

I have a couple questions about the current game plan for Zope development
that I was unable to answer for myself by searching through mailing list
archives and the zope.org website. I hope my inability to answer them is not
merely a symptom of poor search term choices, and I hope someone can answer
them for me.

I've posted a couple times before (a long time ago) about the large web
application I work on; it's many hundreds of KLOC and an unfortunately large
percentage of it is DTML. It's still more or less in that state; the
realities of being a for-profit business in a rapidly evolving marketplace
permit very little time for maintenance or aggressive refactoring of the
application. That's the background for my questions; I'm trying to figure
out how loudly I can shout "Impending doom!" to upper management without
endangering my credibility.

1. Last time I talked to anyone from Zope Corp, the plan was to quiesce Zope
2 in favor of Zope 3. At that time, I think I remember people saying
2.9would be the last in the Zope 2 series. Now there's a
2.10, so clearly it wasn't. How long does a business like mine have before
there is no clear upgrade path in the Zope 2 series? Is 2.10 now the final
Zope 2 release, or will there be a 2.11 and 2.12?

2. Whenever someone asks about moving an existing application from Zope 2 to
Zope 3, there's a round of flip "oh you'll hafta start over" responses. I
understand that the two architectures are fundamentally different, and that
I'll need to rebuild my object database, etcetera. Am I also correct in
believing that all products must be completely rewritten, and that DTML is
no longer a supported templating language? Has the users/roles/permissions
security structure disappeared or been supplanted? I am trying to ascertain
at a glance how much we will need to rebuild for ourselves; if it's enough
then the problems we have had with Zope (poor scaling, poor integration with
source control) may outweigh the advantages of remaining on the platform.

Thanks,
--G.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 1:39 PM, Max Møller Rasmussen at [EMAIL PROTECTED] wrote:

Thanks. That's great; but you do need to know the objects immediate
container right? I have one situation where the container could be one of
many.


Geoff

> From: Geoff Armstrong [mailto:[EMAIL PROTECTED]]
> 
>> In DTML there doesn't seem to be a way of saying, "I have this string with
>> the name of an object, now fetch me the object."
> 
> Shure there is:
> 
> 
> 
> As far as I remember.
> 
> regards Max M
> 
> A snippet I use somewhere:
> 
> 
> 
> 
> 


___
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] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 1:20 PM, Ivan Cornell at [EMAIL PROTECTED] wrote:


Hi Ivan,

Thanks. The "_.getitem(myId)" works well. I've made a note of the "hasattr"
trick as well for future reference.


Geoff
> Geoff Armstrong wrote:
> 
>> What I'm trying to do here is avoid using > put the object in the namespace it has to iterate over all of them (there
>> could be any number).
>> 
>> All I have at the beginning is the name of the object in the REQUEST part of
>> the namespace as picked up from a form. My method is the action to that
>> form.
>> 
>> In DTML there doesn't seem to be a way of saying, "I have this string with
>> the name of an object, now fetch me the object."
>> 
> 
> Hi Geoff,
> 
> Try using _.getitem(), as in:
> 
> ...  ...
> 
> or probably:
> 
> 
> If you aren't sure of the existance of the object, wrap the above in:
> 
> 
> 
> Ivan
> 
> 
> ___
> 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] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 1:12 PM, Erik Enge at [EMAIL PROTECTED] wrote:

Thanks; but being new to this could you help me a bit more by providing an
example of how to use 'getOb' within  [[EMAIL PROTECTED]]
> 
> | Is there a Zope API method that will allow me to get an object from
> | it's id, or can I write a simple Python method to do it, or am I
> | missing something even more obvious?
> 
> Well, sometimes objectItems or objectValues can be the right ones to
> use.  Other times, (in Python Products at least) you use _getOb() to
> fetch the object for you.
> 
> Let's say you have this object structure:
> 
> /Folder1
> /Folder2
> 
> If you (in Python code) have Folder1 in the namespace, as self for
> example, you can say object=self._getOb('Folder2'), and vòila. :)
> Don't know how you would do that in DTML, though.
> 
> ___
> 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] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 12:34 PM, Oleg Broytmann at [EMAIL PROTECTED] wrote:

> On Tue, 23 Jan 2001, Gale wrote:
>> 
>> 

What I'm trying to do here is avoid using  
> You don't need to "get" the object, as the object is already on top of
> the namespace stack (dtml-in put the object there on every iteration). Just
> use the object's attributes (id, after all, is just yet another attribute).
> 
> Oleg.
> 
> Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
> Programmers don't die, they just GOSUB without RETURN.


___
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] Container Class questions

2000-10-05 Thread geoff


A hopefully simple Zope question from a relative newbie:

This is for a project desiged to demonstrate the power of Zopish 
content management to potential customer, and right now I'm trying to 
create a simple product with a few attributes and that can contain (or 
be associated with) an image.  Not all products will have associated 
images.

The general idea is to create a catalog of items that potential 
customers can manipulate as if it was thiers.

I can easily create a product like the CD class demonstrated in the 
Zope documentation.  I can iterate over all of my catalog items and  
display all the attributes I give them.  But I'm at a bit of a loss about 
how to associate an image with my sample catalog objects.

Should I create a product that can contain said images?  If so, how do 
I do this?  Should I simply force a naming conventions for the images 
and tie them together with the sample catalog items that way?

Can anyone out there point me towards a good source of 
documentation for this sort of thing?


Many thanks for any help,


//glw


___
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] Container Class questions

2000-10-05 Thread geoff


A hopefully simple Zope question from a relative newbie:

This is for a project desiged to demonstrate the power of Zopish 
content management to potential customer, and right now I'm trying to 
create a simple product with a few attributes and that can contain (or 
be associated with) an image.  Not all products will have associated 
images.

The general idea is to create a catalog of items that potential 
customers can manipulate as if it was thiers.

I can easily create a product like the CD class demonstrated in the 
Zope documentation.  I can iterate over all of my catalog items and  
display all the attributes I give them.  But I'm at a bit of a loss about 
how to associate an image with my sample catalog objects.

Should I create a product that can contain said images?  If so, how do 
I do this?  Should I simply force a naming conventions for the images 
and tie them together with the sample catalog items that way?

Can anyone out there point me towards a good source of 
documentation for this sort of thing?


Many thanks for any help,


//glw


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




RE: [Zope] zwiki mailing list ? RFC

2000-07-27 Thread Geoff Gardiner

Even if ZWiki and WikiNG are to converge (are they? I'm still not sure of
intentions here), we would need keep updates to ZWiki and the new
engineering of WikiNG separate in everyone's minds - but not so separate as
to seem confusingly competitive.

Could this be done by moving joyful/zwiki to zope.org? If so, we could use
the same (zope@ and zope-dev@ + wiki) mechanisms so long as there is clarity
between the aims of ZWiki and WikiNG (clearly posted on both wikis).

Trying to keep abreast of an active sourceforge/zwiki as well as
joyful/zwiki, zope/WikiNG, zope@ and zope-dev@ at the same time would be
even more of a trial than I find it now.

Geoff

-Original Message-
From: Simon Michael [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 26, 2000 6:59 PM
To: [EMAIL PROTECTED]
Subject: [Zope] zwiki mailing list ? RFC
...
I'm thinking of activating the zwiki mailing list at sourceforge, as a
repository for the above and perhaps a testbed for
mailing-list/zwikiweb integration.

On the other hand I'm against too much fragmentation of our
discussions - things are bad enough already! - and I like to use the
zope list where possible.

If you have any thoughts either way, I'd like to hear 'em.
...


___
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] Wiki apps other than ZWiki 0.6.1

2000-07-21 Thread Geoff Gardiner

I've been happily adding ManagedMode functionality to ZWiki 0.6.1 but wonder
what other Wiki-on/in-Zope technologies there are that I should consider
working with. I'm looking for cataloging, graphics upload, differencing,
rename and delete and don't really want to have to work on them myself if
these have been done or are soon to be done.

Searching on 'Wiki' appears to be useless, since the word crops up in so
many contexts, hence my appeal for information.

Thank you,
Geoff Gardiner


___
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] Washington DC area company looking for help with zope online database...

2000-07-12 Thread Geoff Williams



My company, E.J. Krause & Associates, Inc., is 
looking for a company with expertise in Zope, Python and PostreSQL to help us 
maintain an Online Database Project.   We currently have our site, The 
Sports Business Directory Online, up and running at http://directory.sportsummit.com.   
This site is a subscription based online search engine of our sports business 
directory database.   Subscribers can login to the site and use our 
search engine to find companies in our online database, which we update and 
upload to the site daily in .dbf file formats.  There is also a sample database at the site so that you can see examples 
of how the search engine operates without subscribing.
 
We also sell subscriptions to our database in a 
simple SSL online store where a purchaser enters some credit card information 
into our order form, a secure email is sent to my inbox, we process the card 
internally in our accounting department, and then reply with a login and 
password the next business day.   We are looking to move this part of 
the site towards a real-time e-commerce store using CyberCash 
technology.
 
Our current needs for this project begin with 
finding a company who begin the relationship by hosting the site and keeping it 
up and running in its current state.   After the site is stabilized, 
we would be ready to start making minor fixes to the current data functionality, 
and then would like to move into creating a real-time e-commerce structure 
and improving the site's overall look and feel.
 
If your company can help us with this endeavor, 
please contact me by replying to this email, or by calling me at (301) 493-5500 
x3374.   This is a very time sensitive matter as we believe that our 
site will go offline at the end of July unless an alternative solution is 
found.   We look forward to hearing from you soon.
 
With warmest regards,
 
Geoff WilliamsManaging EditorThe Sport 
Summit Sports Business DirectoryE.J. Krause & Associates, Sports 
Divisionwww.sportsummit.com[EMAIL PROTECTED]


[Zope] ZWiki with RemoteWikiLink - minor fix and remaining question

2000-07-06 Thread Geoff Gardiner

I needed to create 'proper' URLs with a remote wiki link, but ZWiki 0.6.1
only allowed things of the form ZWikiName:name-with-characters-only. I
suppose my locale setting translates too many things to whitespace, but I'm
not sure.

A simple fix in the ZWikiPage.py file (sorry no diff here):
 find line
interwikilink= r'!?((?P%s):(?P[\w]+))' % (wikilink)
 replace string
[\w] by [A-Za-z0-9/:@_~#=\.\-\?]

(note I couldn't include the % char because it seems to provoke the need for
another string).

Remaining question. Does anyone have a fix for the incorrect rendering of
[notzwikiname] to nested URL
  notzwikiname
or do I have to fix that for myself? This also fails to work as a remote
wiki link, and I thought a fix for one might be a fix for the other also.

Thanks.

Geoff Gardiner


___
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: SiteAccess & 2.1.6

2000-06-22 Thread Wright, Geoff

Oleg Broytmann writes:

> > I am using SiteAccess and 2.1.6 at iMeme, and they play 
> > fine together.
> 
> This is one success story among millions failures. I 
> certainly would not upgrade to 2.1.6.

I am running SiteAccess on two 2.1.6 installs -- one on a RedHat 6.1 box and
the other on a RH6.2 box.  Both work like a champ.

These were both fresh 2.1.6 installs.  Does the problem typically occur
w/upgrades or did I just get lucky twice?  I ask because I have a 2.1.4
install that I've been planning to upgrade -- and it serves several domains
and depends heavily upon SiteAccess.

> Oleg.(All opinions are mine and not of my employer)
>  
> Oleg Broytmann  Foundation for Effective Policies 
>  [EMAIL PROTECTED]
>Programmers don't die, they just GOSUB without RETURN.

-glw

___
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] getUsers cf. get_valid_userids question

2000-06-15 Thread Geoff Gardiner

Thank you. Adapting your code, I also added getUserIdsWithPermission.

Geoff


from App.Common import aq_base

def getUserIdsWithPermission(self, permission):
  "Get all userids having a permission."
  item=self
  dict={}
  while 1:
if hasattr(aq_base(item), 'acl_users') and hasattr(item.acl_users,
'user_names'):
  for user in item.acl_users.getUsers():
if user.has_permission(permission, object=self):
  dict[user.getUserName()]=1
if not hasattr(item, 'aq_parent'):
  break
item=item.aq_parent
  keys=dict.keys()
  keys.sort()
  return keys

-Original Message-
From: Shalabh Chaturvedi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 15, 2000 5:43 AM
To: Geoff Gardiner; Zope Mailing List
Subject: Re: [Zope] getUsers cf. get_valid_userids question


Hi:

In an attempt to solve the very same problem (Get a list of all users with
certain role) I created an external method. It walks up the acquisition
path,
at each level checking the existing acl_users (if it exists) for all users
with
the role.



___
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] getUsers cf. get_valid_userids question

2000-06-14 Thread Geoff Gardiner

I want to show all users who have certain roles / and or permissions (Zope
2.1.6). I can't see how to do this directly, because I can't see how to get
hold of user objects, which I need to carry out has_permission, etc.,
methods.

I can show the userids of all valid users:


  

  


but I can't get all actual user objects because getUsers is a method valid
only for an identified User folder, and doesn't have acquisition.

Should I just go in and code a new get_valid_users in the style of
get_valid_userids, or is there another way? Perhaps there would be a
security implication (I can't think what) but that's not a major issue for
me at the moment.

Thank you,
Geoff


___
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

2000-05-26 Thread Wright, Geoff

> -Original Message-
> From: Bill Anderson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 26, 2000 11:21 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [Zope] HTML EDITORS
> 
> 
> Luis Cortes wrote:
> > 
> > Hello,
> > 
> > Has anyone found a really good HTML EDITOR that plays nice 
> with dtml tags?
> > 
> > Do anybody have anything they can really recommend?
> 
> GVIM

I'll second that.

And it works just as nicely on Windoze as it does on *NIX.  If you you're
interested in using it, I'll send you my vimrc.  It's well simple and
well-commented.  I don't have any special syntax stuff for dtml, but find
that
the standard html highting works just fine.

If you haven't dealt with vi before, you'll find the learing curve a bit
steep, but you'll _love_ it when you get the hang of it.  And if you come
from a GUI world, gvim gives you all the little niceites you're used to,
like cut & paste, scroll bars, mouse-based highlighting and that sort of
thing.  Of couse, once you get used to gvim, you can just hide your mouse
under you desk form most of the day  :)

___
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] Zope 2.1.6 / ZWiki 0.6.1 AUTHENTICATED_USER has dual personality

2000-05-26 Thread Geoff Gardiner

I have some problem with AUTHENTICATED_USER being two people when using DTML
Methods - sometimes. I have now characterized the situation. So that I don't
overload the list I've written details (for as long as they remain) at:

  http://www.joyful.com/zwiki/ZWikiProblems#authuser

Zope 2.1.6, ZWiki 0.6.1.

Geoff Gardiner


___
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] AUTHENTICATED_USER.getUserName() not always truthful in ZWiki

2000-05-25 Thread Geoff Gardiner

I am using ZWiki and have modified a footer to show the current
AUTHENTICATED_USER. It lies - occasionally but consistently.

I am logged in as TestUser, and have a page footer that shows me as
TestUser. I create a new ZWiki page by editing the current page and adding
NewPage, then navigating to the new NewPage. This now shows me as Anonymous
User.

When I press the edit button I am still Anonymous User. When I save I am
still Anonymous User.

When I press the edit button it shows me as TestUser again.  When I save I
am back to Anonymous User.

How can I be both TestUser and Anonymous User in the same session? Something
to do with namespaces, no doubt, but what's going on?

Anyone, please?

Geoff Gardiner


___
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] Zwiki extension work - stuck changing new properties

2000-05-17 Thread Geoff Gardiner

Sorry for a slightly lengthy post - hope this is the right list.

I'm trying to extend Zwiki functionality, and have got quite a long way with
what I want - basically restricting some users to append-only in certain
circumstances.

However, although I can create the new properties, I'm not able to access
them in the edit method and I don't see what I should be doing. Other
properties seem to be accessible, but not my new ones (although they are
visible in the properties tab, and can be read Ok). I have tried appending
'self.' but this just comes up with an error telling me that they don't
exist.

The fragments below are all that I have added to the Zwiki product (see the
geoffg comments below for what I've done), but I've got some additions to
zwiki.zexp as well to provide forms input.

Thank you again for any and all help,
Geoff Gardiner


In ZwikiPage.py 


class ZWikiPage(DTMLDocument): #, CatalogAware):
"""A ZWikiPage is a DTML Document which knows how to render itself in
   various wiki styles, and provides some utility methods to support
   wiki-building.
"""
meta_type="ZWiki Page"
icon ="misc_/ZWiki/ZWikiPage_icon"
page_type=DEFAULT_PAGE_TYPE

# how would you append to the superclass' _properties here ??  #'
_properties=({'id':'title', 'type': 'string', 'mode':'w'},
 {'id':'page_type', 'type': 'string', 'mode': 'w'},
 # ken's parenting code:
 {'id':'parents', 'type': 'lines', 'mode': 'w'},
 # ^^^ ken's parenting code
 # VVV --- geoffg's managed_mode code --- Tested
 {'id':'managed_mode', 'type': 'boolean', 'mode': 'w'},
 {'id':'page_owner', 'type': 'string', 'mode': 'w'}
 # ^^^ end geoffg's managed_mode code ---
 )

__ac_permissions__=(
# 'manage_edit','manage_upload' already part of Change DTML Doc
permission - ok here ??
('Change ZWiki Pages',
('edit','PUT','manage_edit','manage_upload')),
# VVV --- geoffg's managed_mode code --- Tested
('Manage ZWiki Pages',
('edit','PUT','manage_edit','manage_upload')),
# ^^^ end geoffg's managed_mode code ---
# add a View permission here ??
# useful to define default roles ??
)

# ken's parenting code:
parents = None
# ^^^ ken's parenting code
# VVV --- geoffg's managed_mode code --- Tested
managed_mode = 0
page_owner = ''
# ^^^ end geoffg's managed_mode code ---



def edit(self, text=None, REQUEST=None, submit=None, type=None,
 timeStamp=None):
"""change a ZWikiPage's content and/or markup type
"""
self._validateProxy(REQUEST)# correct ??

self.checkEditTimeStamp(timeStamp)

if type is not None:
self.page_type = type

# VVV --- geoffg's managed_mode additions ---
# Testing - logic Ok but can't access properties - why not?
# edit form has hidden fields:
#   'check_managed_mode' - look for existence of 'new_managed_mode'
checkbox
#   'check_page_owner' - look for existence of 'clear_page_owner'
checkbox
if REQUEST is not None:
  if REQUEST.has_key('check_managed_mode'):
if REQUEST.has_key('new_managed_mode'):
  managed_mode=1
else:
  managed_mode=0
  if managed_mode:
if REQUEST.has_key('check_page_owner'):
  if REQUEST.has_key('clear_page_owner'):
page_owner=''
  else:
page_owner=REQUEST['AUTHENTICATED_USER']
  else:
page_owner=''
# ^^^ end geoffg's managed_mode additions

if text is not None:



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