Re: [Zope-dev] Structured Text Plus

2001-06-12 Thread Michel Pelletier

On Tue, 12 Jun 2001, Ian Clatworthy wrote:

 Andreas Jung wrote:
 
  - Original Message -
  From: Ian Clatworthy [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Sunday, June 10, 2001 9:52 PM
  Subject: [Zope-dev] Structured Text Plus
 
   I've put together the design for an extended version of
   Structured Text which I'd like some feedback on before
   I go too much further. At this stage, the design is
   explained via a series of user-level How-To's, e.g.
   Writing Documents Using Structured Text Plus.
 
  Could you please summarize the benefits compared to
  STXNG ?

 As I understand things from reading the STXNG Wiki stuff,
 it's largely an internal rewrite which adds 2 or 3 new
 features, namely images and tables.

This is only a small feature compared to what STXNG really adds to
structured text.  STXNG turns structured text into cross-format Document
Object Model (DOM) in two stages and then into a final format.  The first
stage turns it into a simple DOM that reflects the paragraph structure,
but not the markup (italics, bold, links, etc.).

The second stage uses the first stage DOM to create an even more elaborate
DOM based on markup or colorized text found in the first DOM's
paragraphs.

The second stage DOM can then be fed to a final outputter stage that
renders the DOM in any format you want, currently we support HTML,
DocBook, and MML (Framemaker or something like that) and it would be easy
to add any other XML format or PDF.  Here's an example that will work for
you:

 print text
Title

  o *one*

  o **two**

  o 'three'

#
# Create the basic DOM structure

 Basic(text)
StructuredTextDocument([
StructuredTextParagraph(Title, [
 StructuredTextParagraph(  o *one*, [
 ])
 StructuredTextParagraph(  o **two**, [
 ])
 StructuredTextParagraph(  o 'three', [
 ])
]),
])

#
# Create the Colorized DOM structure

 Document(Basic(text))
StructuredTextDocument([
StructuredTextSection(StructuredTextSectionTitle(Title, [
]), [
 StructuredTextBullet(StructuredTextEmphasis('one'), [
 ])
 StructuredTextBullet(StructuredTextStrong('two'), [
 ])
 StructuredTextBullet(StructuredTextLiteral('three'), [
 ])
]),
])

#
# Generate HTML from the DOM

 print HTML(Document(Basic(text)))
html
head
titleTitle/title
/head
body
h0Title/h0

ul
liemone/em/li
listrongtwo/strong/li
licodethree/code/li

/ul
/body
/html

#
# Generate DocBook from the DOM

 print DocBookChapter(Document(Basic(text)))
chapter
titleTitle/title
itemizedlist
listitemparaemphasisone/emphasis /para/listitem
listitemparaemphasistwo/emphasis/para/listitem
listitemparaliteralthree/literal/para/listitem
/itemizedlist
/chapter



You should really work from STXNG because we designed it to be extended,
just like you want to do.  You can subclass and customize the colorizer
in the second stage to recognize your own customized markup and do what
you will with it.  Amos and I did this to support images in the book.
You can also customize outputers as I explained.

  You are targeting also the single-source approach
  for documents with STPlus - what are the benefits
  compared to working solution like Docbook ?

 Upwards compatibility with STX, i.e. something more
 readable than XML.

Amen to that!

-Michel


___
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] Structured Text Plus

2001-06-12 Thread Ian Clatworthy



Michel Pelletier wrote:

  As I understand things from reading the STXNG Wiki stuff,
  it's largely an internal rewrite which adds 2 or 3 new
  features, namely images and tables.
 
 This is only a small feature compared to what STXNG really adds to
 structured text.  STXNG turns structured text into cross-format Document
 Object Model (DOM) in two stages and then into a final format.  The first
 stage turns it into a simple DOM that reflects the paragraph structure,
 but not the markup (italics, bold, links, etc.).

Yes, the new processing architecture is great and I fully intend
to leverage it as much as possible. I'm not sure if I'll
need to make some additional changes to the core classes as well?
If I do, I don't expect them to be large.

Ian C.


-- 
This transmission is  for the intended  addressee only and is confidential
information.  If you  have  received  this  transmission in error,  please 
delete  it and  notify  the sender.  The contents of this  e-mail are  the 
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.

___
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] Non-undoable storage

2001-06-12 Thread Morten W. Petersen

Hia guys,

during testing of a mail product I've discovered that the Data.fs file may
bloat considerably after storing 50 messages.  Packing the database will
reduce the Data.fs file to 20 MB (from 40 MB).  Another thing is that
storing 50 messages takes a *long time* on a 600Mhz 256 MB RAM system.

The thing that struck me was that transactions may cause a lot of
overhead, both in database size and for execution speed, so, the thing I'm
wondering about is if there exists a non-undoable storage, or something
similar that doesn't support transactions..

Another thing I noticed BTW, is that retrieving 500 messages and packing
the database on every 50th message (all messages retrieved during one
request) would lead to off the charts memory usage, the process ended up
using 700 MB of RAM (had to add swap files as the footprint grew!)

Cheers,

Morten




___
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] Non-undoable storage

2001-06-12 Thread Shane Hathaway

Morten W. Petersen wrote:
 during testing of a mail product I've discovered that the Data.fs file may
 bloat considerably after storing 50 messages.  Packing the database will
 reduce the Data.fs file to 20 MB (from 40 MB).  Another thing is that
 storing 50 messages takes a *long time* on a 600Mhz 256 MB RAM system.

Did you catalog each message?  What version of Zope?

 The thing that struck me was that transactions may cause a lot of
 overhead, both in database size and for execution speed, so, the thing I'm
 wondering about is if there exists a non-undoable storage, or something
 similar that doesn't support transactions..

Yep, see BerkeleyStorage.

 Another thing I noticed BTW, is that retrieving 500 messages and packing
 the database on every 50th message (all messages retrieved during one
 request) would lead to off the charts memory usage, the process ended up
 using 700 MB of RAM (had to add swap files as the footprint grew!)

You could either:

1) Import messages in a single transaction with subtransactions.  This
would take less time and incur less memory consumption and database
bloat.  We at DC have experimented with bulk-loading mail into Zope and
this is what works the best.

2) Change the database cache parameters to keep the RAM cache as low as
possible (set the timeout to 3 seconds and the target size to 10).

3) Manually zap the caches periodically, which is a capability of Zope
2.4.x.

Shane

___
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] Non-undoable storage

2001-06-12 Thread Chris McDonough

Shane Hathaway wrote:
 
 Morten W. Petersen wrote:
  during testing of a mail product I've discovered that the Data.fs file may
  bloat considerably after storing 50 messages.  Packing the database will
  reduce the Data.fs file to 20 MB (from 40 MB).  Another thing is that
  storing 50 messages takes a *long time* on a 600Mhz 256 MB RAM system.
 
 Did you catalog each message?  What version of Zope?

Hold your tongue, Shane!  ;-)
 
  The thing that struck me was that transactions may cause a lot of
  overhead, both in database size and for execution speed, so, the thing I'm
  wondering about is if there exists a non-undoable storage, or something
  similar that doesn't support transactions..
 
 Yep, see BerkeleyStorage.
 
  Another thing I noticed BTW, is that retrieving 500 messages and packing
  the database on every 50th message (all messages retrieved during one
  request) would lead to off the charts memory usage, the process ended up
  using 700 MB of RAM (had to add swap files as the footprint grew!)
 
 You could either:
 
 1) Import messages in a single transaction with subtransactions.  This
 would take less time and incur less memory consumption and database
 bloat.  We at DC have experimented with bulk-loading mail into Zope and
 this is what works the best.

See ZCatalog's ZCatalog.py/catalog_object method for an example of using
subtransactions.  Note that the cacheFullSweep call in there is
necessary to see any RAM savings.

 
 2) Change the database cache parameters to keep the RAM cache as low as
 possible (set the timeout to 3 seconds and the target size to 10).
 
 3) Manually zap the caches periodically, which is a capability of Zope
 2.4.x.



 
 Shane
 
 ___
 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 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] Non-undoable storage

2001-06-12 Thread Morten W. Petersen

On Tue, 12 Jun 2001, Shane Hathaway wrote:

 Did you catalog each message?  What version of Zope?

Yes, every message was cataloged.  Zope version 2.3.2

 3) Manually zap the caches periodically, which is a capability of Zope
 2.4.x.

Okay, this is interesting.  Any examples on how to implement cache 
zapping? 

Cheers,

Morten


___
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] Non-undoable storage

2001-06-12 Thread Chris Withers

Chris McDonough wrote:
 
 Shane Hathaway wrote:
 
  Morten W. Petersen wrote:
   during testing of a mail product I've discovered that the Data.fs file may
   bloat considerably after storing 50 messages.  Packing the database will
   reduce the Data.fs file to 20 MB (from 40 MB).  Another thing is that
   storing 50 messages takes a *long time* on a 600Mhz 256 MB RAM system.
 
  Did you catalog each message?  What version of Zope?
 
 Hold your tongue, Shane!  ;-)

Eh?

confusedly...

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] Non-undoable storage

2001-06-12 Thread Chris McDonough

Morten W. Petersen wrote:
 
 On Tue, 12 Jun 2001, Shane Hathaway wrote:
 
  Did you catalog each message?  What version of Zope?
 
 Yes, every message was cataloged.  Zope version 2.3.2

Were subtransactions in the Catalog turned on (see the Advanced page)?

___
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] Non-undoable storage

2001-06-12 Thread Morten W. Petersen

On Tue, 12 Jun 2001, Chris McDonough wrote:

 Morten W. Petersen wrote:

  Yes, every message was cataloged.  Zope version 2.3.2
 
 Were subtransactions in the Catalog turned on (see the Advanced page)?

Yes, and the threshold was at 1.

-Morten


___
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] Non-undoable storage

2001-06-12 Thread Shane Hathaway

On Tue, 12 Jun 2001, Morten W. Petersen wrote:

 On Tue, 12 Jun 2001, Shane Hathaway wrote:

  Did you catalog each message?  What version of Zope?

 Yes, every message was cataloged.  Zope version 2.3.2

  3) Manually zap the caches periodically, which is a capability of Zope
  2.4.x.

 Okay, this is interesting.  Any examples on how to implement cache
 zapping?

self._p_jar._resetCache() is how you do it.  It doesn't break circular
references within the database, but normally there shouldn't be any
circular references.

Be careful with _resetCache().  It should only be called when you know
there aren't any objects waiting to be written (within the thread), such
as just after a call to get_transaction().commit(1).

Shane


___
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] Pluggable Index How-To Questions

2001-06-12 Thread Chris Withers

Andreas Jung wrote:
 
 There is a new How-To for PlugginIndexes:
 
 http://www.zope.org/Members/ajung/howto/PluginIndexes/index_html

Looks great :-)

Coupla Questions:

Is there anything you can do in the index_object method to re-use ZCatalog's
get all attributes and call them if they're callable?

In uniqueValues, what do the lengths that withLengths returns actually mean?

In _apply_index, are ResultSet objects and how to build them documented
anywhere? What is cid used for?

I take it query_options is better understood by looking at the PathIndex
example?

And finally, has anyone considered writing a Pluggable Index that uses an SQL
index or tabel of some sort to do its indexing?
How abotu a 'Generic Pluggable Index' that lets you implement the interface
using Python Scripts, ZSQL methods, etc?

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] Pluggable Index How-To Questions

2001-06-12 Thread Andreas Jung


- Original Message -
From: Chris Withers [EMAIL PROTECTED]
To: Andreas Jung [EMAIL PROTECTED]
Cc: Matt Hamilton [EMAIL PROTECTED]; zope-dev [EMAIL PROTECTED]
Sent: Tuesday, June 12, 2001 9:41 AM
Subject: [Zope-dev] Pluggable Index How-To Questions


 Andreas Jung wrote:
 
  There is a new How-To for PlugginIndexes:
 
  http://www.zope.org/Members/ajung/howto/PluginIndexes/index_html

 Looks great :-)

 Coupla Questions:

 Is there anything you can do in the index_object method to re-use
ZCatalog's
 get all attributes and call them if they're callable?

Don't understand the question...maybe I don't know this ZCatalog feature.


 In uniqueValues, what do the lengths that withLengths returns actually
mean?

Good question  - I think uniqueValues is only used for FieldIndex. I think
you usually must not implement it - I must check this...

 In _apply_index, are ResultSet objects and how to build them documented
 anywhere? What is cid used for?

Best way is to take a look in PathIndex.py..


 I take it query_options is better understood by looking at the PathIndex
 example?

There is a new API for passing parameters to the searchResults() of the
ZCatalog
(see ZCatalog/help/ZCatalog_Parameters.stx and doc/changenotes). The
query_options
 is a list of options that the index is interested when it gets a search
request.


 And finally, has anyone considered writing a Pluggable Index that uses an
SQL
 index or tabel of some sort to do its indexing?

never heard of it.

 How abotu a 'Generic Pluggable Index' that lets you implement the
interface
 using Python Scripts, ZSQL methods, etc?

uuuh.I think you can write that as a Product. But I
don't think
we will write this. And I don't like the idea...I prefer to write such a
package
with VI and store it in the filesystem :-)

Andreas


___
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 a Pluggin Index (NameIndex)

2001-06-12 Thread Chris Withers

Matt Hamilton wrote:
 
 On Mon, 11 Jun 2001, Chris Withers wrote:
 
  Wow Matt, you seem to know what you're talking about :-)
 
 My final year University project was to create an Open Source mailing list
 archive :)  I did quite a bit of reading into information retrieval and
 assorted algorithms and data structures.  

Ah, okay :-)

 Once I get a spare minute I am going to try and re-implement it in Python
 and using ZODB (with BerkeleyDB storage) I might try and port some of the
 code over to work as a PluggableIndex too.

Cool...

 One of the main tasks is to write a python wrapper around my compression
 code.  I will have to look more closely at how to write Python modules in
 C, as it does lots of bit twiddling which is in a very tight loop.  The
 object will basically be a compressed list to which you can append
 ascending integers and will allow various fast union/intersection
 operations with other similar objects.  This in itself may be sufficent to
 use in a PlugginIndex.

Yeah, I'd love to see it...

 Unfortunately I don't have the time.  Unless I can use it myself directly
 in a project we have funding for (or unless anyone wants to fund my time
 to develop it) I will have to wait until I have some more time on my
 hands.

No worries...

cheers,

Chris

  PS: Whereabouts in the UK are you?
 
 Bristol.

hehe... will be out celebrating my birthday there this Wednesday evening :-) If
you see me lying in a gutter on Thursday morning, please don't kick me too hard
;-)

___
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] Acquisition Filtered Folder stuff

2001-06-12 Thread Chris Withers

Dieter Maurer wrote:
 
 Chris Withers writes:
   Dieter Maurer wrote:
   
What you probably need:
   
  derive a new ObjectManager from Acquisition.Explicit and
  the current ObjectManager.
   
  provide an interface to manage the attributes that should
  be acquired implicitly.
  
   Well, I had a go at this, but not quite in the way you describe.
  
   I subclassed Folder and overrode __getattr_ with:
 This does not work because Python calls __getattr__ only,
 if it can not find the attribute through normal means.
 Due to the implementation of Acquisition, acquired attributes
 are found by normal means bypassing __getattr__.

Ah, that makes sense :-)

 You may be successful, if you override __of__.
 It is this method that (usually) builds the acquisition wrapper.

When does it not build the wrapper?

 You can try to build an explicit rather than implicit acquisition
 wrapper.

Yeah, I'll give it a go, once the problems below have been worked out...

 The easiest way, of course, is to derive the class from
 Acquisition.Explicit with higher priority (more to the left)
 than from Acquisition.Implicit.

Hmmm... then maybe use the acquire() method to get hold of names that can be
acquired, in the __getattr__ method?

There is a more fundamental problem here though; If you limit acquisition to a
specified list of names, what do you do about all the stuff Zope normally
silently acquires, like the security context, the REQUEST, etc?

It would be great if you could make it work along the lines of acquire all the
Zope internal stuff, but beyond that, only acquire if the name is in this list.
But how would we define all the Zope internal stuff and how would we implement
the logic? 

Hurm... this sounds like a problem of Fultonesque proportions :-S

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] Pluggable Index How-To Questions

2001-06-12 Thread Chris Withers

Andreas Jung wrote:
 
  Is there anything you can do in the index_object method to re-use
 ZCatalog's
  get all attributes and call them if they're callable?
 
 Don't understand the question...maybe I don't know this ZCatalog feature.

My perception is that the 'classic' ZCatalog Indexes have a method something
like:

def getValue(self,obj):
  try:
value = getattr(obj,self.id) # self.id is the name of the index. 
 # The interface doesn't specify how to 
 # get hold of this :-S
if callable(value):
  value=value()
  except AttributeError,TypeError:
  value=None
  return value

...which gets the value to index. I was wondering if that function is available
anywhere rather than having to re-implement it each time you write a new
pluggable index. That said, I guess the 'classic' indexes have been
re-implemented as PluggableIndexes?

  In uniqueValues, what do the lengths that withLengths returns actually
 mean?
 
 Good question  - I think uniqueValues is only used for FieldIndex. I think
 you usually must not implement it - I must check this...

Well, IMHO, uniqueValues shouldn't be part of the interface. AFAIK, it only
makes sense with certain types of index: KeywordIdnexes and possibly
FieldIndexes. Is that the case?

  In _apply_index, are ResultSet objects and how to build them documented
  anywhere? What is cid used for?
 
 Best way is to take a look in PathIndex.py..

OK :-)

 There is a new API for passing parameters to the searchResults() of the
 ZCatalog
 (see ZCatalog/help/ZCatalog_Parameters.stx and doc/changenotes). The
 query_options
  is a list of options that the index is interested when it gets a search
 request.

OK...

  How abotu a 'Generic Pluggable Index' that lets you implement the
 interface
  using Python Scripts, ZSQL methods, etc?
 
 uuuh.I think you can write that as a Product.

hehe... cool :-)

 But I
 don't think
 we will write this. And I don't like the idea...I prefer to write such a
 package
 with VI and store it in the filesystem :-)

I agree, but when you're exploring what you want to do and don't have access to
the filesystem, it could be really useful.

thanks for the answers,

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] multiple servers!

2001-06-12 Thread Tim McLaughlin

Stian,
It's probably nicer to use the -P option for z2.py which allows you to
specify a port offset for all ZServer services.

ie. -P 8001 puts http on 8081 and ftp on 8022
or  -P 8002 puts http on 8082 and ftp on 8023

--Tim

PS.  sorry all for the Base64 encoding on the previous message.

_
Tim McLaughlin
Iteration Zero - www.iterationzero.com
703-481-2233


Message: 8
Date: Mon, 11 Jun 2001 12:04:31 +0200 (CEST)
From: Erik Enge [EMAIL PROTECTED]
To: Stian Jenssen [EMAIL PROTECTED]
cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Re: [Zope-dev] multiple servers!

On Mon, 11 Jun 2001, Stian Jenssen wrote:

 I wan't to run two webservers on the same machine one, zope/apache an
 one apache.  Can I set it up with 2 ports eg. 8080 and 80 but how do I
 do it?

Edit the z2.py file in your zope/ directory, look for HTTP_PORT and adjust
that to your needs.


___
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] How to return downloadable content from Python Method

2001-06-12 Thread Casey Duncan

 Blandford, Simon [BSS Audio UK] wrote:
 
 I am compressing files which need to be uncompressed inline before
 download. The DTML href=... calles a python method in the product
 which returns the uncompressed file data. Say this file is an MSWord
 document, how do I return this as a file to download? Presently, the
 browser just tries to display the binary file and makes a mess of it.
 
 Regards,
 Simon B.

It probably is not setting the content-type header. Add something like
this to the method that returns the data:

RESPONSE.setHeader('Content-Type', self.content_type)

Where content_type is set to the MIME type of the data, which for MSWord
is 'application/msword'
-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

___
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] DCOracle2 Beta 3

2001-06-12 Thread Matthew T. Kromer

For all of you (or at least, BOTH of yousmirk) Oracle users out there, 
I packed up DCOracle2 Beta 3 this morning, including Z Oracle Stored 
Procedures as part of ZOracleDA.  

It can be found in the usual place,

http://www.zope.org/Members/matt/dco2

This isn't much different from Beta 2 except for some SP tweaks and the 
Z Oracle Stored Procedures, except that the NT builds are release 
versions with Oracle 8i (e.g. SP discovery code) features enabled -- 
when I built Beta 2 I goofed the build and packaged a debug release 
without the 8i specific features on.

I'll confess that I'm not a heavy user of Stored Procedures, so your 
mileage may vary; particulary when using IN/OUT binds where type 
conversions need to take place from unweildy Oracle native types (like 
SQLT_NUM.)

If you play with the stored procedure objects in Zope, it's probably 
worth pointing out that the default permissions won't include execute 
permission -- you have to specifically enable that for non-manager roles.

On the far-out front, a few people have asked how you might do 
user-specific connections to the database (ie instead of pooling by a 
common connection, you individually authenticate to Oracle with your own 
password).  Clearly, cloning the base Connection object would be fairly 
straighforward, but authenticating it to Oracle would not be, as the 
user password wouldn't be available.  If anyone feels strongly about 
that (ie you have a notion on how you would make it work and/or you need 
it), feel free to write me.  From a performance standpoint it would be 
terrible, but security auditors would love it.


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



OracleStorage? Re: [Zope-dev] DCOracle2 Beta 3

2001-06-12 Thread John D . Heintz

Are there any plans to port OracleStorage over to use DCOracle2?

John


On Tuesday 12 June 2001 10:46, Matthew T. Kromer wrote:
 For all of you (or at least, BOTH of yousmirk) Oracle users out there,
 I packed up DCOracle2 Beta 3 this morning, including Z Oracle Stored
 Procedures as part of ZOracleDA.

 It can be found in the usual place,

 http://www.zope.org/Members/matt/dco2

 This isn't much different from Beta 2 except for some SP tweaks and the
 Z Oracle Stored Procedures, except that the NT builds are release
 versions with Oracle 8i (e.g. SP discovery code) features enabled --
 when I built Beta 2 I goofed the build and packaged a debug release
 without the 8i specific features on.

 I'll confess that I'm not a heavy user of Stored Procedures, so your
 mileage may vary; particulary when using IN/OUT binds where type
 conversions need to take place from unweildy Oracle native types (like
 SQLT_NUM.)

 If you play with the stored procedure objects in Zope, it's probably
 worth pointing out that the default permissions won't include execute
 permission -- you have to specifically enable that for non-manager roles.

 On the far-out front, a few people have asked how you might do
 user-specific connections to the database (ie instead of pooling by a
 common connection, you individually authenticate to Oracle with your own
 password).  Clearly, cloning the base Connection object would be fairly
 straighforward, but authenticating it to Oracle would not be, as the
 user password wouldn't be available.  If anyone feels strongly about
 that (ie you have a notion on how you would make it work and/or you need
 it), feel free to write me.  From a performance standpoint it would be
 terrible, but security auditors would love it.


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

-- 
. . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | [EMAIL PROTECTED]

w w w . d a t a c h a n n e l . c o m

___
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] Acquisition Filtered Folder stuff

2001-06-12 Thread Dieter Maurer

Chris Withers writes:
  Dieter Maurer wrote:
   You may be successful, if you override __of__.
   It is this method that (usually) builds the acquisition wrapper.
  
  When does it not build the wrapper?
If it is not the __of__ defined by Acquisition.{Im,Ex}plicit,
it may not build acquisition wrappers.
E.g. the __of__ of ComputedAttribute does not.

   The easiest way, of course, is to derive the class from
   Acquisition.Explicit with higher priority (more to the left)
   than from Acquisition.Implicit.
  
  Hmmm... then maybe use the acquire() method to get hold of names that can be
  acquired, in the __getattr__ method?
Read the Acquisition documentation:

   With explicit acquisition, you can declare that some attributes
   should be acquired implicitly.

Of course, you can do it in __getattr__, too.

  There is a more fundamental problem here though; If you limit acquisition to a
  specified list of names, what do you do about all the stuff Zope normally
  silently acquires, like the security context, the REQUEST, etc?
I expect, that the security context is explicitly acquired
(not sure).

For REQUEST and some essential other objects, you can declare
them to be implicitly acquired.

  It would be great if you could make it work along the lines of acquire all the
  Zope internal stuff, but beyond that, only acquire if the name is in this list.
  But how would we define all the Zope internal stuff and how would we implement
  the logic? 
The first question may have some surprises. The second should not be too
difficult.

  Hurm... this sounds like a problem of Fultonesque proportions :-S
Maybe, we wait a bit. As I heard, DC is thinking about making
acquisition explicit rathen than implicit.


Dieter

___
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: AW: jcNTUserFolder

2001-06-12 Thread Jephte Clain

 Thank you for the tip with the access file.
 The remote user mode with challenge\response works
 perfect if I delete the Password of the access file.

 But, if I delete the Password of the access file I get a
Zope Error
 when I am not using the challenge\response mode.

that is the point :-)

As far as I know, it is not possible for Zope to run in
remote user mode and normal mode together (they are mutually
exclusive)

I think that the solution is to run two Zope instances in a
ZEO cluster (on the same machine), one which talks with PCGI
(and so is in remote user mode) and one which serves
directly the requests (and is not in remote user mode)

perhaps someone on the list can give his opinion (note that
i am not on the zope-dev list, so cc: any answer)

 The error gets raised in your NTUserFolder.py in line 79 (
return
 string.lower(login) )
 when login is None. (Anonymous login)

 I changed it to

 def _normalize(self, login):
 normalize a login name.
 Currently, it is made lowercase
 
 if login is None: #
modification
   login = 'Anonymous User' #
modification
 return string.lower(login)

 This is a very ugly hack, but it works.
You normally cannot login directly with Zope if it is
running in remote user mode. At least, with your patch, one
can browse the site anonymously

regards,
[EMAIL PROTECTED]

 -Ursprüngliche Nachricht-
 Von: Jephte Clain [mailto:[EMAIL PROTECTED]]
 Gesendet: Freitag, 8. Juni 2001 14:25
 An: Roesch, Alexander
 Betreff: Re: jcNTUserFolder


  we are using your product jcNTUserFolder in
 challenge/response mode
  together with IIS on NT4 with Zope 2.2.2.
  It works perfect.
 what version? is it 0.0.8 or 0.1.0?

  Because of bugs in Zope 2.2.2 we want to migrate to Zope
 2.3 and
  jcNTUserFolder 0.1.0
 note that 0.1.1 have been released

  I managed to set up the the NT User Folder as acl_user
 folder in the root
  level.
  Now I still have the problem that the users don't get
 recognized by zope.
  They always get prompted for Username / Password /
domain.
 And even if they
  apply the correct Username / Pwd / domain they get
 rejected.
 
  Could you give me a tip what is going wrong?
 I need your answer to above questions. if migrating from
 0.0.x to 0.1.x, you have to follow the instructions given
on

http://www.zope.org/Members/jephte/jcNTUserFolder/installation

 note: for remote user mode to work with zope 2.3.x, you
 *must* have the access file. it is not installed by
default
 for Zope 2.3.x

 regards,
 [EMAIL PROTECTED]

__
Boîte aux lettres - Caramail - http://www.caramail.com