Re: [Zope] FYI: Digital Creations secures $12M round of investment

2000-11-13 Thread Jeff K. Hoffman

Let me be among the first to say, "Congratulations." I know you guys have
worked for this, and I'm glad to see it came through.

--Jeff


___
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] REPOST: README.txt Tab

2000-08-04 Thread Jeff K. Hoffman

On Fri, 4 Aug 2000 [EMAIL PROTECTED] wrote:

 I'll re-ask the question:
 
  How do I get the README tab to appear in a product?
  
  I created a product and it is working great.  However, I would like to add
  the 'README' tab to the product (and if possible to each instance of the
  product).  I looked at other products that have the README tab and looked
  at the Product.py source code.  It appears that I should just be able to
  put a README.txt file in my product subdirectory and the tab should
  automagically appear.  It doesn't.
  
  What do I need to do?

If this is a Python product (NOT a ZClass "open box" product), delete the
product from your Product list and re-start Zope. Voila.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Permissions question.

2000-08-01 Thread Jeff K. Hoffman

On Tue, 1 Aug 2000, Aleksander Salwa wrote:

 Is it Zope 2.2.0 ?  If so, Foo_add should also have proxy role 'Manager'.

I arrived at this on my own about an hour after I posted the message to
the list. I wasn't sure if this was the "correct" way to do it, so I
decided to wait and see what others suggested.

I'll take this as confirmation. :-)

 ololo

Thanks,

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Permissions question.

2000-07-31 Thread Jeff K. Hoffman

Hello,

I am having a permissions problem, and am hoping someone on the list will
see the error in my ways. I have a ZClass, called a FooManager, that
inherits from ObjectManager. It is responsible for creating (and managing)
Foo objects.

In the FooManager ZClass, I created a DTMLMethod called 'addFoo', and a
form called 'fooForm'. Following the "How to Create ZClass Instances
Programmatically" How-To, I modified my 'Foo_add' constructor to avoid
redirecting if the request contains a noRedir parameter.

In my 'addFoo' method, I have:

  dtml-with "manage_addProduct['FooProduct']"
dtml-call "Foo_add(_.None, _, noRedir=1)"
  /dtml-with

and I set it's Proxy role to 'Manager'.

My form, obviously, calls 'addFoo' with:

  form action="addFoo" method="..."

When I submit the form, I get:

  Unauthorized.

  You are not authorized to access FooObject.

'FooObject' is the name of my ZClass.

The traceback is:

  ...
  File /d1/zope/pcalc.ptec.com/lib/python/DocumentTemplate/DT_Util.py,
line 331, in eval
  (Object: FooObject.createInObjectManager(REQUEST['id'], REQUEST))
  (Info: FooObject)
File /d1/zope/pcalc.ptec.com/lib/python/OFS/DTMLMethod.py, line 189,
in validate
  (Object: addFoo)
File
/d1/zope/pcalc.ptec.com/lib/python/AccessControl/SecurityManager.py, line
139, in validate
File
/d1/zope/pcalc.ptec.com/lib/python/AccessControl/ZopeSecurityPolicy.py,
line 209, in validate
  Unauthorized: (see above)

I can fix the problem by going directly to my 'FooManager' instance and
giving Anonymous permission to 'Add a Foo Object'. However, I don't want
to do this on a general basis, nor do I want to have to manually adjust
each instance of 'FooManager'. I ONLY want my 'addFoo' method to be able
to do it. I thought the Proxy role in the ZClass's 'addFoo' method would
do the trick, but it did not.

Sorry if I haven't explained this well. As you can probably tell, ZClass
permissions are not exactly my strong suit in Zope.

Anyone have any ideas?

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Interbase 6.0 Open Source Release

2000-07-25 Thread Jeff K. Hoffman

Hello,

I just wanted to let everyone know that Interbase 6.0 has just been
released as Open Source. Check out:

  http://www.borland.com/interbase/index.html

If you need a high-quality, enterprise class RDBMS for Zope I suggest you
download both Interbase 6.0 and our Zope DA, gvibDA. It is a truly nice
setup.

Let us know if you find any bugs, or if there are some new features you'd
like to see added. We expect to make a 1.0 release of our DA next week,
once we've had a chance to test against 6.0 final.

Back to our regular programming,

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Python 2.0

2000-07-24 Thread Jeff K. Hoffman

On Mon, 24 Jul 2000, Toby Dickenson wrote:

 On Fri, 21 Jul 2000 16:29:23 +0100, Toby Dickenson
 [EMAIL PROTECTED] wrote:
 
 This problem goes away if I don't compile python with garbage
 collection support. I guess I shouldn't be suprised.

Python 2.0? Garbage collection? Huh? What?

Last I checked, Python 1.5.2 was the newest stable release, with 1.6 being
under development. 1.7 due out by the end of the year, and Python 3000
being a redesign from the ground up.

Is there a 2.0 somewhere that I don't know about?

 Toby Dickenson
 [EMAIL PROTECTED]

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Python 2.0

2000-07-24 Thread Jeff K. Hoffman

On Tue, 25 Jul 2000, Anthony Baxter wrote:

 What was once known as 1.6 is now called 2.0.
 
 There's probably more at the pythonlabs website.
 ah, here we go
 
 http://www.pythonlabs.com/tech/python2.html
 
 
 Note that the release is currently held up for some reasons to do
 with the python team all leaving CNRI and going to BeOpen - sounds
 like some sort of licensing or copyright ugliness.
 
 The python development's moved to sourceforge in the meantime, so you
 can track it in CVS if you feel so inclined.

Ahh hah. I had looked on python.org and found nothing, but this explains
why.

That clears it up. Thanks.

 Anthony

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] default__class_init__

2000-07-19 Thread Jeff K. Hoffman

Hello,

Should I call default__class_init__ on all of my Python products that care
about permissions? Or are there some times when it is not required?

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] The Application object

2000-07-17 Thread Jeff K. Hoffman

Hello,

What is the easiest way for me to get ahold of the Application object at
run-time?

I am writing a Product that needs to access some things in the
Control_Panel, and need the app object to get there.

I know how to do it given a reference to an object in the ZODB
(getPhysicalRoot(), etc.), but need a way to do it given no references. I
need something like:

  import AppSingleton

  app = AppSingleton.Instance()
  app.Control_Panel.blah

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] The Application object

2000-07-17 Thread Jeff K. Hoffman

On Mon, 17 Jul 2000, Chris McDonough wrote:

 I'm not sure I understand.  What is AppSingleton?  What does the
 Instance() method do?

Sorry I wasn't clear enough. The Singleton is a design pattern from the
Gang of Four book that fits this situation well. It is a class that is 
meant to control access to the one and only instance of a global
variable. I was just using that as a frame of reference, though; Zope has
no such class for the Application object, or I wouldn't be writing this
message.

I just need some way of getting at the one and only Application object at
run-time. Something like:

  from Globals import app
  myOb = app.Control_Panel.Products.MyProduct.MyZClass('foo')
  ...

Given a reference to an object in the ZODB, I can do this via:

  app = self.getPhysicalRoot()
  myOb = app.Control_Panel.Products.MyProduct.MyZClass('foo')

But, this does not work from methods like __init__, or __setstate__, where
we do not have a physical location in the ZODB, yet.

I just need a reference to the app object. I know the answer has to be
simple, but I can't find it.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] The Application object

2000-07-17 Thread Jeff K. Hoffman

On Mon, 17 Jul 2000, Shane Hathaway wrote:

 The way to get the root application object is to open a connection to
 the ZODB and get the 'Application' object from the list of root
 objects.  There is an easy shortcut:
 
 import Zope
 app = Zope.app()
 
 app now refers to a *copy* of the root Application object.

Yeehaw, that worked! I was so close. :-)

 When you're done modifying it and its descendants you have to commit or
 abort the transaction.

[snip]

Do I need to commit or abort even if I don't make changes to the
application object? The only thing I need it for is to get to the
Control_Panel; I am instantiating ZClass instances in the constructor of a
Python class, i.e.:

class MyClass:

  def __init__(self, id, title=''):
  import Zope
  app = Zope.app()

  ob = app.Control_Panel.Products.MyProduct.MyZClass('newId')
  ob.id = 'newId'

  self._setObject('newId', ob)

  # Do I need a get_transaction().abort() here? Will that not abort
  # the wrong transaction?

  app._p_jar.close()

  ...

 This gives you all kinds of benefits like undo and elimination of
 threading conflicts.

[snip]

Good stuff. Thanks, Shane.

 Shane

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Accessing the Application (or Control_Panel)

2000-07-14 Thread Jeff K. Hoffman

Hello,

I am working on a Python Product (subclass of ObjectManager) that creates
some instances of a few ZClasses inside itself when constructed.
Currently, I do this as follows:

  CONTROL_PANEL = None

  def manage_addMyClass(self, id, title='', REQUEST=None):
  global CONTROL_PANEL
  if CONTROL_PANEL is None:
  CONTROL_PANEL = self.Control_Panel

  self._setObject(id, MyClass(id, title))

  ...

  class MyClass(...):
  def __init__(self, id, title=''):
  self.id = id
  self.title = title

  ob = CONTROL_PANEL.Products.MyProduct.MyClass('myId')
  ob.id = 'myId'
  self._setObject('myId', ob)

which works fine, until I need to use CONTROL_PANEL from somewhere else
before manage_addMyClass is called (currently, I am trying to upgrade
existing instances in __setstate__). Inside __setstate__,
self.Control_Panel throws an exception, for understandable reasons.

So, I get the feeling I am going about this incorrectly. I grep'd the
source last night, looking for a getApplicationInstance() method, or
something similar, but found nothing. AFAICT, there is no easy way to get
ahold of the one true Application object without having a reference to an
object in the ZODB and calling getPhysicalRoot().

Did I miss something? Is there a better way to do what I am trying to do?

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] ANNOUNCE: Going Virtual Interbase Adapter v0.1

2000-07-11 Thread Jeff K. Hoffman

Going Virtual, LLC is proud to announce the first
release of its Zope Database Adapter for Interbase
v6.0 beta. The only known limitations are those
imposed by Interbase when using Dynamic SQL, and
our limited support for ARRAYs.

The adapter has been tested on Linux and Solaris,
using both Zope 2.1.6 and 2.2 beta. While this is
the first release, it is feature complete and
awaits only community testing before the 1.0 
release.

Please see:

  http://www.zope.org/Members/RETierney/gvibDA

Enjoy!

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Reusing standard_html_header/footer

2000-07-06 Thread Jeff K. Hoffman

On Thu, 6 Jul 2000, Bill Anderson wrote:

 Michael Gutmann wrote:
  
  This is not a question, I think it's more a request for comment.
  
  Problem: I have the following structure of folders. The top folder has
  the global standard_html_header and acquisition has it, that it
  is usable in all the subfolders.
  
  /
standard_html_header
SubFolder1/
   SubFolder2/
  
  Now I have a small modification in my headers from SubFolder1 downwards.
  Well, there are many ways to cope with that problem, I want to do it
  that ways: I want to integrate the old standard_html_header into the
  new one I define in SubFolder1. Ok, that can look like this:
 

 Not quite sure I understand what you are trying to do but

I believe he is trying to do (in Java, because it's easiest for me to
express it, here):

public class StandardHtmlHeader
{
  public String render() {
return "Hello, World."
  }
}

public class SubStandardHtmlHeader extends StandardHtmlHeader
{
  public void render() {
return super() + " Woohoo!"
  }
}

Well, okay, not exactly, since we're talking acquisition not inheritance.
But, the idea is the same. He wants to display the previous
standard_html_header, with some additional stuff added, in his SubFolder's
standard_html_header.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Messing with the namespaces stack [Was: (no subject)]

2000-06-30 Thread Jeff K. Hoffman

On Fri, 30 Jun 2000, Shane Hathaway wrote:

 Also remember you can play tricks with acquisition.  If you have a
 "default" style and a "lowres" style, you can set up your directories
 like this:
 
 /home
   /lowres
   /content
 
 "lowres" and "content" are both children of "home".  The default style
 elements are in home.  When the user browses to
 /home/content/index_html, they get the default style.  When the user
 visits /home/lowres/content/index_html, they get the lowres style.

This is, actually, not quite right.

Given the following hierarchy:

  /home
header
footer
/content
  index_html
/lowres
  header
  footer

and a request of /home/content/index_html, we have the following
acquisition path (assuming index_html is a DTML Method):

  /home/content= (content of home)
  /home/content/index_html = (index_html of (content of home))

Assuming index_html contains:

  dtml-var header
  Content.
  dtml-var footer

when index_html asks for header, the acquisition path is searched
from left to right; the content folder is searched first, followed by the
home folder, where header is found.

Now, with a request of /home/lowres/content/index_html, we have:

  /home/lowres= (lowres of home)
  /home/lowres/content= ((content of home)
 of (lowres of home))
  /home/lowres/content/index_html = (index_html of ((content of home)
of (lowres of home)))

Therefore, when index_html looks for header, the content folder is
searched, then the home folder, then the lowres folder, then the home
folder. Unfortunately, for our example, the header is found in the search
of the home folder, and we never make it to the lowres folder.

If, instead, we structure the request as /home/content/lowres/index_html,
we have:

  /home/content   = (content of home)
  /home/content/lowres= ((lowres of home) 
 of (content of home))
  /home/content/lowres/index_html = (index_html of ((lowres of home)
of (content of home)))

When index_html looks for header, we search lowres, then home, then
content, then home. The header is picked up from lowres, which is what we
want.

Hope this makes sense. Acquisition is not one of the things I have become
good at explaining, yet. The slides from Jim's Acquisition Algebra talk is
about the best source of information on this subject.

 Shane

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] adding attributes to a python product

2000-06-29 Thread Jeff K. Hoffman

On Thu, 29 Jun 2000, Steve Alexander wrote:

 Hi folks,
 
 Is there any way of interacting with the ZODB persistence machinery to
 add the default attribute to all instances as they are brought out of
 persistent storage -- so that I can just restart Zope, and have all of
 my instances updated as I use them ?

In addition to the method Bryan detailed, you should look into the
__setstate__() method.

From http://www.zope.org/Members/michel/HowTos/ZODB-How-To:

  "When an object is activated by the object database and brought into
   memory, it's __setstate__() method is called. A Persistent class can
   override this method to initialize the object every time it is brought
   into memory.

   __setstate__() is also useful to upgrade an object from one version to
   another. If you add instance attributes to your product, older versions
   of the instances of that product will not have the new attribute.
   __setstate__ can check for the existance of new attributes, and create
   them with sane defaults in older versions of the instance."

 Thanks for any help.

Hope this helps.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Win2000

2000-06-29 Thread Jeff K. Hoffman

On Wed, 28 Jun 2000, Robin Becker wrote:

 The boss says he couldn't install Zope on our Win2000 box. He tried 3
 times. Anybody else have a problem with M$'s latest?

Nope. 2.1.6, and the 2.2 betas, including the newest 2.2b3, work fine on
my Win2000 Professional box at home. It's running as a service on port 80.
Haven't had a single problem, yet.

 Robin Becker

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Backing Up Zope (was: Re: [Zope] Data.fs.lock?)

2000-06-29 Thread Jeff K. Hoffman

On Thu, 29 Jun 2000, Wilkinson Charlie E wrote:

 Another random thought is that if ZODB transactions and
 writes are atomic, than none of this should be an issue.
 Anyone know the answer to that one?

It is my understanding that the ZODB on disk is always in a consistent
state; Jim has said, in the past, that you can simply make a copy of
Data.fs, even while Zope is running, without problems.

Based on that, I think the answer to the above is yes.

 -cw-

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Backing Up Zope (was: Re: [Zope] Data.fs.lock?)

2000-06-29 Thread Jeff K. Hoffman

On Thu, 29 Jun 2000, Erik Enge wrote:

 On Thu, 29 Jun 2000, Jeff K. Hoffman wrote:
 
  It is my understanding that the ZODB on disk is always in a consistent
  state; Jim has said, in the past, that you can simply make a copy of
  Data.fs, even while Zope is running, without problems.
 
 But the Data.fs has to be updated sometimes.  And if you read from a file
 that is changing, the integrity of your data isn't.  How can you make sure
 that the file is not written to during a certain period of time?  You
 can't?

Now that I'm in the spotlight I can't seem to find the message I was
referring to in the archives; I sure hope I didn't misquote anyone (i.e.
Jim).

Unfortunately, I don't have an answer to your question. I still believe I
am correct, but cannot tell you, technically, why. I have some theories,
but I don't want to cloud the issue anymore with my hypotheses.

Let's hope someone who does know chimes in.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] parsing strings in DTML

2000-06-26 Thread Jeff K. Hoffman

On Mon, 26 Jun 2000, Timothy Wilson wrote:

 On Mon, 26 Jun 2000, Rik Hoekstra wrote:
 
  try something like (untested):
  
  dtml-call "REQUEST.set('parse_address', _string.split(old_address, '$')"
  
  for parsing the string
 
 But what if "parse_address" comes from a SQL query? Like this:
 
 dtml-in qry_contactInfo
   dtml-call "REQUEST.set(dtml-var parse_address, ... etc.
 
 Don't I run into trouble with nested DTML here?

You should never "nest" DTML like you are suggesting. It won't work.

Variables set through REQUEST.set are immediately accessable in DTML
expressions after it, i.e.:

  dtml-call expr="REQUEST.set('i', 0)"
  dtml-var i
  dtml-call expr="REQUEST.set('i', i + 1)"
  dtml-var i

Notice all I did was "i + 1", not "dtml-var i + 1". You simply reference
it, as you would in python.

 -Tim

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Reversing acquisition?

2000-06-22 Thread Jeff K. Hoffman

On Thu, 22 Jun 2000, Patrick Lewis wrote:

 Try changing /index_html as follows:
 
 dtml-var standard_html_header
 table
 trtddtml-var "PARENTS[0].text_object_1" fmt=structured-text
 /td/tr
 trtddtml-var "PARENTS[0].text_object_2" fmt=structured-text
 /td/tr
 /table
 dtml-var standard_html_footer
 
 Basically force Zope to look in the current folder first.

Additionally:

Is your root index_html a DTML Method or a DTML Document?

If it's a DTML Method, it should work as you desire; DTML Methods are the 
odd bird, and acquire differently than everyone else. DTML Methods
acquire other objects from the context in which they are called. This is
how standard_html_header and standard_html_footer work.

DTML Documents, however, acquire like every other Zope object, and will
behave as you have described: acquire text_object_1 and text_object_2
from the actual location of the DTML Document.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] ZPatterns, Hello, world.

2000-06-19 Thread Jeff K. Hoffman

Hello,

I am trying to wrap my head around ZPatterns--I am hoping to use it in a
project I am currently working on. Unfortunately, I'm not doing too well.
:-)

Is there a, "Hello ZPatterns World." example out there, anywhere, that
shows the simplest usage of the framework? It would do me tremendous good
to see a working example.

Thanks,

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] ZPatterns DynPersist module for Win32

2000-06-19 Thread Jeff K. Hoffman

Hello,

I just wanted to note that I have built the ZPatterns (0.4.0a1) DynPersist
module for Win32 using MSVC.

If anyone would like a copy, just e-mail me and I'll be happy to pass it
along.

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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] Products vs. ZClasses- Design Question

2000-06-16 Thread Jeff K. Hoffman

On Fri, 16 Jun 2000, Garrin Kimmell wrote:

 Hello,
 

[snip]

 I've thought of three ways to develop the class:
 
 1. Develop the entire class as a Zope product in Python.
 
 The advantage I see here is that developing the application logic is
 fairly straightforward with Python. I see problems, though, with the
 user interface, especially if I want to make changes to it after
 instantiating a few objects. It is my understanding that objects created
 from a Product are not automatically updated when changes are made to
 the class methods (as opposed to ZClasses, where they are). Am I correct
 here?

The user interface for a Python Product is generally specified in .dtml
files distributed with the Product. If you change one of these .dtml
files, all you have to do is restart Zope and you will see the changes.
Whether you have created one instance, or one hundred instances, they will
all change their interface.

What will *not* change (without a little help from you, described below)
are the attributes that have been added or removed from the class. In this
case, new instances will be configured with the new attributes, while old,
previously instantiated instances will retain their old attribute
configuration.

To migrate your existing instances to the new configuration, you need to
write a __setstate__() method in your class, for example (untested):

class MyPersistentClass(Persistent):

  def __setstate__(self):
  Persistent.__setstate__(self, state)
  if not hasattr(self, 'newAttr'):
  self.newAttr = newValue
  if hasattr(self, 'deprecatedAttr'):
  del self.deprecatedAttr

Each time the object's state is loaded from the ZODB, this method will be
invoked. If a previously instantiated instance of your object is loaded,
and does not contain an attribute called newAttr, it will be created.
Likewise, if it contains an attribute called deprecatedAttr, it will be
removed.

ZClasses provide no such facility. You cannot upgrade ZClass instance
attributes automatically, as far as I know. You'd have to write a script
to go through your ZODB and upgrade the old instances manually. Boo.

 2. Develop the entire class as a ZClass
 
 The principal advantage I see is that changes to the class
 methods are dynamically updated in all instances of that ZClass. The
 problem is that DTML is (for me, at least) a pain in the ass to write any
 complicated application logic with.

As explained above, this advantage is shared by Python Products also. You
do *not* want to write application logic with DTML. At a minimum, use
Python Methods. Otherwise, use Python.

 3. Develop the application logic as a Product in Python, then use that
 class as a mix-in class for a ZClass that implements UI logic with dtml
 methods. 
 
 This seems to be the best solution (even if it is the most work). I should
 get the advantage of having ZClass instances automatically update changes
 to ZClass methods, while having the programability of Python for 
 application logic in the Product. If I do take this route, are there any
 quirks I should be aware of when inheriting a ZClass from a product?

This is a good way to go, and provides a nice advantage over vanilla
Python Products: You do not have to restart Zope to see changes to your
UI.

However, you cannot reparent a ZClass after it has been created. Well, you
can, but no one is very happy with the ways you have to do it. So, if you
are a fly by the seat of your pants kind of coder, don't do it. If you do
all of your analysis up front, and will know in advance exactly which
classes your ZClass will inherit from, go for it. But, should you miss
something in your analysis, you will have to reparent your ZClass and
endure the pain involved with that process.

 I am new to Zope and would appreciate any insight into the tradeoffs
 among these three strategies. 

In summation, Python Products are, by far, the most flexible solution. You
can upgrade them. You can write all of your logic in Python. You write 
your UI in DTML. You can manage all of this using CVS (or the version
control system of your choice). Good stuff.

Using ZClasses for your UI can allow you to see updates to your UI in
realtime without having to restart Zope. In addition, ZClasses make your
UI accessible to people who do not have access to the filesystem of your
Zope server. You cannot easily use CVS with ZClasses, since they are
stored in the ZODB and not the filesystem.

Hope this helps!

 Thank you,
 Garrin

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


___
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

Re: [Zope] Weird interaction between int() and DateTime.timeTime

2000-05-25 Thread Jeff K. Hoffman

On Thu, 25 May 2000, Chris Withers wrote:

 "Jeff K. Hoffman" wrote:
Python 1.5.2 (#3, Mar  8 2000, 16:34:52) [C] on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam

 f = 1.
 f
2.0
 int(f)
1

 
  the int() function takes a different code path and returns 1, correctly.
 
 Forgive my ignorance, but in what way is 1 correct here? Surely 2 is the
 what should be returned?!

int() disregards everything after the decimal.

   int(1.25)
  1
   int(1.5)
  1
   int(1.75)
  1
   int(1.)
  1
   int(2)
  2

The problem comes in when you consider that the string representation
functions (and thus, print) do not behave in the same way.

   print 1.25
  1.25
   print 1.5
  1.5
   print 1.75
  1.75
   print 1.9
  1.9
   print 1.999
  1.999
   print 1.9
  1.9
   print 1.999
  1.999
   print 1.9
  1.9
   print 1.999
  1.999
   print 1.9
  2.0

 Chris

--Jeff

---
Jeff K. Hoffman   704.849.0731 x108
Chief Technology Officer  mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C. http://www.goingv.com/


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