Re: [Zope] Going to 3.0

2006-01-09 Thread Fernando Lujan
2006/1/9, Fernando Lujan <[EMAIL PROTECTED]>:
> 2006/1/9, Andreas Jung <[EMAIL PROTECTED]>:

> > Which errors?

Hi Andreas,

Thanks for the reply. :)

This behavior is intriguer since we only use DTML with logic and
stuff... Nothing special as our own products etc... We sure have some
products, but it should not crash the main system.

Oh, and now I tried now Zope 3.2.0.

2006-01-09T17:15:19 WARNING ZODB.FileStorage Ignoring index for
/home/flujan/tmp/zinstance/var/Data.fs
Traceback (most recent call last):
 File "./runzope", line 48, in ?
   run()
 File "./runzope", line 44, in run
   main(["-C", CONFIG_FILE] + sys.argv[1:])
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/twisted/main.py",
line 74, in main
   service = setup(load_options(args))
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/twisted/main.py",
line 143, in setup
   notify(zope.app.appsetup.interfaces.DatabaseOpened(db))
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/event/__init__.py",
line 23, in notify
   subscriber(event)
 File 
"/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/event/dispatching.py",
line 66, in dispatch
   for ignored in subscribers(event, None):
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/component/__init__.py",
line 181, in subscribers
   return sitemanager.subscribers(objects, interface)
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/component/site.py",
line 89, in subscribers
   return self.adapters.subscribers(required, provided)
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/interface/adapter.py",
line 481, in subscribers
   subscribers = [subscription(*objects)
 File 
"/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/appsetup/bootstrap.py",
line 135, in bootStrapSubscriber
   db, connection, root, root_folder = getInformationFromEvent(event)
 File 
"/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/appsetup/bootstrap.py",
line 120, in getInformationFromEvent
   root_folder = root.get(ZopePublication.root_name, None)
AttributeError: 'PersistentMapping' object has no attribute 'get'
___
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] Going to 3.0

2006-01-09 Thread Fernando Lujan
2006/1/9, Andreas Jung <[EMAIL PROTECTED]>:
> > I already install Zope 3.1.0 and try to copy the Data.fs.
> >From where to where?

>From /home/zope/zope2.0/var/Data.fs to /home/zope/zope3.0/var/



> >But it
> > produces a lot of erros. How can I handle this?
>
> Which errors?

Hi Andreas,

Thanks for the reply. :)

This behavior is intriguer since we only use DTML with logic and
stuff... Nothing special as our own products etc... We sure have some
products, but it should not crash the main system.

Oh, and now I tried now Zope 3.2.0.

2006-01-09T17:15:19 WARNING ZODB.FileStorage Ignoring index for
/home/flujan/tmp/zinstance/var/Data.fs
Traceback (most recent call last):
 File "./runzope", line 48, in ?
   run()
 File "./runzope", line 44, in run
   main(["-C", CONFIG_FILE] + sys.argv[1:])
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/twisted/main.py",
line 74, in main
   service = setup(load_options(args))
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/twisted/main.py",
line 143, in setup
   notify(zope.app.appsetup.interfaces.DatabaseOpened(db))
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/event/__init__.py",
line 23, in notify
   subscriber(event)
 File 
"/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/event/dispatching.py",
line 66, in dispatch
   for ignored in subscribers(event, None):
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/component/__init__.py",
line 181, in subscribers
   return sitemanager.subscribers(objects, interface)
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/component/site.py",
line 89, in subscribers
   return self.adapters.subscribers(required, provided)
 File "/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/interface/adapter.py",
line 481, in subscribers
   subscribers = [subscription(*objects)
 File 
"/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/appsetup/bootstrap.py",
line 135, in bootStrapSubscriber
   db, connection, root, root_folder = getInformationFromEvent(event)
 File 
"/home/flujan/tmp/zope/zope3.2.0/lib/python/zope/app/appsetup/bootstrap.py",
line 120, in getInformationFromEvent
   root_folder = root.get(ZopePublication.root_name, None)
AttributeError: 'PersistentMapping' object has no attribute 'get'
___
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 )


[Zope] Going to 3.0

2006-01-09 Thread Fernando Lujan
We use a Psycopg connection, and Z SQL Objects... We don't have any
programs written in python that use zope interfaces and so on.

We have a entire site written in DTML in Zope 2.x. Now, after some
discuss here We want to migrate it to Zope3.x. and start to develop
using the zope 3 facilities and OO and ZPT.

I already install Zope 3.1.0 and try to copy the Data.fs. But it
produces a lot of erros. How can I handle this?

Will exist a way to migrate from Zope 2.x to Zope 3.x?

Thanks in advance.

Fernando Lujan
___
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] Python Classes and Zope.

2005-12-01 Thread Fernando Lujan

Andreas Jung wrote:

Sure you can but you shouldn't..you start with one class and at the end 
you have an application with tons of such codeyou can program that 
way but

you shouldn't :-)


I will print and read the Developer Book... ;)

Thanks for all replies.

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


[Zope] Python Classes and Zope.

2005-12-01 Thread Fernando Lujan

There's a way to use a Python class inside zope?

For instance, if I create the class:

class MyClass:
"A simple example class"
i = 12345
def f(self):
return 'hello world'

Can I invoke the following code inside a Python Script?

x = MyClass()
x.f()

I'm using zope 2.7.x series.

Thanks in advance.

Fernando Lujan
___
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: [Spam] Re: [Zope] HTML to PDF.

2005-11-23 Thread Fernando Lujan

Asad Habib wrote:
Fernando. There is a python equivalent of the PHP script HTML_ToPDF.php 
that you can use as well. And it's free as well!


Thanks Asad. I already downloaded it... How can I use it passing a HTML 
file and returning a PDF to the browser? Did you already work with it?


Thanks.

Fernando Lujan
___
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] HTML to PDF.

2005-11-23 Thread Fernando Lujan

Andreas Jung wrote:



--On 23. November 2005 16:45:00 -0200 Fernando Lujan 
<[EMAIL PROTECTED]> wrote:




Yes and I found this product:
http://www.stylusstudio.com/xml_screenshots.html



You should read my former answer carefully. I pointed you to the
tool "CSSTOXSLFO" and the Xinc PDF converter (www.lunasil.com).
Both are Java based applications and can be integrated into Python
and Zope.


Hi Andreas,

Yes... I saw this tool. But the company wants a python solution for 
this... :(


Thanks anyway. :)

Fernando Lujan

___
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] HTML to PDF.

2005-11-23 Thread Fernando Lujan

Andreas Jung wrote:



--On 23. November 2005 16:08:42 -0200 Fernando Lujan 
<[EMAIL PROTECTED]> wrote:



Chris Withers wrote:


A tool to do what, specifically?



A Front-End to design the PDF format. Like Jasper Reports, but one which
works with python and reporlab. :)



Did you look at XSLFO as suggested. It really works


Yes and I found this product: 
http://www.stylusstudio.com/xml_screenshots.html


With this tool, I can create a HTML export to a XML. And with this XML, 
can I generate dinamic PDF files on the fly with the reportlab's software?


Thanks in advance.

Fernando Lujan
___
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] HTML to PDF.

2005-11-23 Thread Fernando Lujan

Chris Withers wrote:

A tool to do what, specifically?


A Front-End to design the PDF format. Like Jasper Reports, but one which 
 works with python and reporlab. :)


Thanks.

Fernando Lujan
___
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] HTML to PDF.

2005-11-18 Thread Fernando Lujan

Chris Withers wrote:


Fernando Lujan wrote:

It's easy to configure and stuff? We currently are working with the 
reportlab, but it's painful to change the document... :(  I need a 
product which generates a PDF file on the fly. 



I'm guessing you're using the open source reportlan library?
Maybe you should think about going up to the RML processor they do, 
which costs money but is pretty amazing.


What sort of budget do you have for this?

A small budget. But my company is really interested in such 
processor/tool/product. Long ago, I sent a e-mail


to the reportlab team. I wanted to know if they provide a tool similar to 
iReport. But I received no answer.

Now, I ask again... is there such tool?

Thanks in advance, 


Fernando Lujan


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


[Zope] HTML to PDF.

2005-11-16 Thread Fernando Lujan

Does Anyone has this product in a production environment?

It's easy to configure and stuff? We currently are working with the 
reportlab, but it's painful to change the document... :(  I need a 
product which generates a PDF file on the fly. Any other application or 
suggestion will be welcome. 


Thanks,

Fernando Lujan


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


[Zope] DateTime again.

2005-10-17 Thread Fernando Lujan
Is it possible to informe the DateTime module about the date format
without changing the zope.conf file?

Format: dd/mm/

When I try the  it returns 2005/12/11
instead of 2005/11/12.

Thanks in Advance.

Fernando Lujan
___
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] Zope scalability / efficiency question

2005-09-21 Thread Fernando Lujan
On 9/20/05, Andrew Sawyers <[EMAIL PROTECTED]> wrote:
> I did some tests a few years back, basically that came out such that you run
> the number of zope instances as you have CPUs.  I was able to get double the
> performance of a single instance on a dual cpu server when adding a second
> instance.  On a single CPU server, I found that the number of requests the
> server was able to render was cut by nearly 50% +/- when adding a second
> instance.
>
> My rule for building out ZEO Client servers is:
> Single CPU - Single Zope instance
> Multiple Processors - # CPUs == # of Zope instances

Hi Andrew,

And how can I distribute the load over these Instances, running on the
same machine?

Thanks in advance.

Fernando Lujan
___
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] Re: OOP and Zope.

2005-08-26 Thread Fernando Lujan
On 8/22/05, Lennart Regebro <[EMAIL PROTECTED]> wrote:
> For Zope3, a good start is "Web Component Development with Zope 3":
> http://www.amazon.com/exec/obidos/tg/detail/-/3540223592/002-4460899-6725627?v=glance


I bought the book... But while it don't arrive, let me ask a last question... 

Is there a tutorial which allows me to work with pages in the .py
format? Then, I could only use python to generate the content... :D
I've seen a lot of pages in this format... Does Zope works with it?

Fernando Lujan
___
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] Re: OOP and Zope.

2005-08-22 Thread Fernando Lujan
On 8/22/05, Josef Meile <[EMAIL PROTECTED]> wrote:
> Yes, some people wants to drop them, but that is just a part of the
> problem. Their bugs aren't a priority know, so, if I were the OP, I
> wouldn't use them for a new development. I would use python based
> products, which are also OO.

I have a good knowledge of using python, there's some tutorial about
using it inside Zope with  a OO design?

Thanks.

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


[Zope] OOP and Zope.

2005-08-19 Thread Fernando Lujan
Hi,

I try to find information about programming in Zope with the OO
paradigm. I didn't find many documentation...

For instance, how can I define classes and instances once I just work
with dtml-methods and dtml-documents?

Thanks.

Fernando Lujan
___
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] Help need for a Zope presentation to java lovers...

2005-08-18 Thread Fernando Lujan
On 8/17/05, Chris McDonough <[EMAIL PROTECTED]> wrote:
> > I only meant that it would get dynamic data using XML-RPC queries, but I
> > already have an efficient product for this, so it's not an issue.
> >
> > So what they want is a Web Management Framework and CMS system.
> > And they wonder if Zope is better than a JSP/Struts/Velocity solution.


Please, give us a feedback about your presentation. ;) It's a very
interesting topic to discuss.

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


[Zope] Showing the results per pages.

2005-08-01 Thread Fernando Lujan
HI,

I have a sql-method which returns a dinamic number of tuples. How can
I split it and show the result using a per page separation?

Something like Google's results when we have a huge number of results... ;)

Thanks.

-- 
Fernando Lujan
___
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] ZPsycopg - Losing Connections

2005-07-27 Thread Fernando Lujan
On 7/27/05, Peter Bengtsson <[EMAIL PROTECTED]> wrote:
> On 7/27/05, Fernando Lujan <[EMAIL PROTECTED]> wrote:
> > On 7/27/05, David <[EMAIL PROTECTED]> wrote:
> > > Python 2.3.5 - Zope 2.7.5 - PostgreSQL 7.3.4 - Psycopg 1.1.18 -
> > > Solaris 8 (Intel)
> > The Psycopg version 1.1.19 solves this problem. :)
> The 1.1.19 version isn't in debian yet.
> $ apt-get show python-psycopg
> shows only 1.1.18 :(

So, use the source... ;)

-- 
Fernando Lujan
___
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] ZPsycopg - Losing Connections

2005-07-27 Thread Fernando Lujan
On 7/27/05, David <[EMAIL PROTECTED]> wrote:
> Python 2.3.5 - Zope 2.7.5 - PostgreSQL 7.3.4 - Psycopg 1.1.18 -
> Solaris 8 (Intel)


The Psycopg version 1.1.19 solves this problem. :)

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


[Zope] WebDav or Calendar.

2005-06-01 Thread Fernando Lujan
Hi,

I need a Calendar or WebDav product wich runs with Zope, allow me to
share my calendar with others users using mozilla Calendar, Sunbird.
evolution, outlook and so on...Something like OpenGroupware. Do
someone have a good suggestion? :)

Thanks and regards.

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


[Zope] Visual Reporting tool.

2005-06-01 Thread Fernando Lujan
Hi,

I want to know, if is there a visual reporting tool? Like
JasperReport, for example, wich works with reportlab's libraries and
generate a .py.

Thanks and regards, 
 
Fernando Lujan
___
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] Create a list using DTML.

2005-05-27 Thread Fernando Lujan
On 24/05/05, J Cameron Cooper <[EMAIL PROTECTED]> wrote:

> Personally, I'd probably just do something like::
>   "{1,2,3}"[1:-1].split(',')
 
This code works as expected... Thanks! :)

--
Fernando Lujan
___
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] Create a list using DTML.

2005-05-24 Thread Fernando Lujan
On 24/05/05, David H <[EMAIL PROTECTED]> wrote:
> >I have a array data type in my DB wich have the following format :
> >{1,2,3} ( ids_test ).  Now in my web application, I have a multiple
> >select wich options must be marked as selected if the number is in the
> >array described above. How can I make the above format be converted to
> >a list of elements?
> >
> >For instance:
> >
> >
> >
> >
> >
> >
> >
> >
> > 
> >   >ids_test> selected="true">
> > 
> >
> >
> >
> >

> I think you are close.  Change  to
>  ?

It's working like IN over a string, e.g. the [5,61] will make selected
the number 5,6 and 61.



Where id_test is the result of the database query wich return in this
format: {1,2,3}. I modify it to a  (1,2,3) and finally I try the


Following this api: 

list (sequence)
Return a list whose items are the same and in the same order as
sequence's items. If sequence is already a list, a copy is made and
returned, similar to sequence[:]. For instance, list('abc') returns
returns ['a', 'b', 'c'] and list( (1, 2, 3) ) returns [1, 2, 3].

I need a integer-list, is it possible?

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


[Zope] Create a list using DTML.

2005-05-24 Thread Fernando Lujan
Hi,

I have a array data type in my DB wich have the following format :
{1,2,3} ( ids_test ).  Now in my web application, I have a multiple
select wich options must be marked as selected if the number is in the
array described above. How can I make the above format be converted to
a list of elements?

For instance:








 
   selected="true">
 





Thanks.

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


[Zope] Generatiing Lists with DTML.

2005-05-24 Thread Fernando Lujan
Hi,

I have a array data type in my DB wich have the following format :
{1,2,3} ( ids_test ).  Now in my web application, I have a multiple
select wich options must be marked as selected if the number is in the
array described above. How can I make the above format be converted to
a list of elements?

For instance:







 
  
selected="true">
  
 




Thanks.

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


[Zope] Answer's Time

2005-05-19 Thread Fernando Lujan
I'm having the following problem and wanna know whether it can be
associated with Zope.

I have a page in my system with various links, and when I click in a
link, for instance link 1.

The cursor starts being busy, the browser appear to send the request
but there is no response. When it happens, if I open another window
and click in the same link, I have the response immediately.

It's tuly very weird... How can I debug it? I'm using Zope 2.74 with
python 2.3.4.

Suggestions will be welcome. Thanks and regards.

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


[Zope] Managing Users with Postgresql.

2005-05-13 Thread Fernando Lujan
Hi,
First let me describe my environment.
I have a Postgresql database that stores all users, and booleans which 
describe permissions. The users log on in my application using a 
WebForm, I run a ZSQL Method and set all permissions in the Session.

I manage the security using Session calls, checking each permission and 
then allow or deny access to the object.

I know that it isn't the best solution, and now I want to change it! :)
Which is the best solution to solve my problem? I found pgUserFolder. 
But I'm not so sure if this will be the best solution.

Thanks...
Fernando Lujan
___
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] Generating and Downloading PDF[Solved]

2005-05-13 Thread Fernando Lujan
Chris Withers wrote:
Um? What else is that method returning?
I'd suggest you call getrarTCE directly by URL, check you're setting 
the correct content-type and maybe set a content disposition too...

Solved. :) I create a External Method that returns the code.
I'm calling the external method using:
  
And I put the following lines at the end of the code:
fname stands for the filename
def generatePDF(page):
os.rename(_fname, "tces/"+_fname)
file = open("tces/"+_fname).read()
os.remove("tces/"+_fname)
page.setHeader('content-type', 'x-application/pdf')
page.setHeader('content-length', str(len(file)))
page.write(file)
This was the best solution that I could thought, once reportlab didn't create PDF 
"on the fly", without writing in the filesystem.
___
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] Re: ZEO and session variables.

2005-05-04 Thread Fernando Lujan
Dennis Allison wrote:
Hi Paul, Thank you.  And, yes, I saw Chris' posting, but I don't think
that's the right solution for us.  A fast shared session variable store
seems to me to be a better way to go and a whole lot more fail safe.
Hi Dennis,
I posted a solution some time ago. Search the history, maybe it could 
help you. :) I haven't had time to write a "how-to". :(

Fernando Lujan
___
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] Generating and Downloading PDF.

2005-04-28 Thread Fernando Lujan
J Cameron Cooper wrote:
 > It's easier to guess when you say what the problem is.
I do see some funny indentation down at the bottom.
OK, it's happen because I paste the code inside a html message, than 
it's happen.

The following code is working. But I still have a problem. The browser ( 
firefox ) don't reconize the generated document as a PDF.

I'm calling this external method through a  
tag, inside a DTML DOCUMENT.

def gerarTCE(self):
from reportlab.pdfgen import canvas
import string
import os   
c = canvas.Canvas("hello.pdf")
c.drawString(100,100,"Hello World")
c.showPage()
c.save()

arquivo = open("hello.pdf").read()
R = self.REQUEST.RESPONSE
R.setHeader('content-type', 'application/pdf')
R.setHeader('content-length', str(len(arquivo)))
R.write(arquivo)
Thanks for helping... :)
Fernando Lujan
___
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] Generating and Downloading PDF.

2005-04-27 Thread Fernando Lujan
J Cameron Cooper wrote:
Fernando Lujan wrote:
J Cameron Cooper wrote:
The method that contains your code must have at least the first 
parameter 'self'::

  def pdfwrite(self):
R = self.REQUEST.RESPONSE
R.setHeader('content-type', 'application/rtf')
R.setHeader('content-length', str(len(data)))
R.write(data)
It's a way of getting access to context.

OK, thanks. But how can I pass the self parameter using the dtml-call 
tag?  is correct? Because I'm using this 
and works fine.

It's Python magic. When you call a function/method on an object, the 
object is provided as the first parameter of the method. This is 
implicit, I believe, in DTML calls, either expression or name. It's 
explicit in TALES and Python::

   context/pdfwrite
   context.pdfwrite()

So, I put the code here. Please, what I'm missing? :)
def gerarTCE(self, id_tce, cnpj_escola='', matricula=''):
   from reportlab.lib.colors import Color
   from reportlab.lib.pagesizes import letter
   from reportlab.platypus import Paragraph, SimpleDocTemplate, XBox
   from reportlab.lib.styles import ParagraphStyle
   from reportlab.pdfgen import canvas
   import os
   import urllib
   from reportlab.lib.units import inch, cm
   import time
   import string
   _linha = cm / 2.25
   _fname = "tce"+id_tce+".pdf"
   _c = canvas.Canvas(_fname, pagesize=letter)
   _width, _height = letter
   _aW = _width - 2 * cm
   _aH = 750
   _c.bookmarkPage("TCE")
   _c.bookmarkPage("pagina1")
   _c.addOutlineEntry("TCE", "TCE")
   _c.addOutlineEntry("Pagina 1", "pagina1", 1)
   _c.showOutline()
   _c.setAuthor("NUBE - Núcleo Brasileiro de Estágios")
   _c.scale(1, 0.9)
   _c.setFont("Times-Bold", 16)
   _c.drawCentredString(_width / 2, 735, "TERMO ADITIVO")
   _c.setFont("Times-Roman", 9)
   _c.drawCentredString( _width / 2, 735, "(determinações legais 
estabelecidas no art. 5º e o §1º do art. 6º do Decreto 87.497/82 que 
regulamentou a Lei 6.494/77)")
 _c.drawCentredString( _width / 2, 725, "(Atualizada pela Medida 
Provisória N.º  1952-22 de 30/03/2000)")
  
   _c.showPage()
   _c.save()
  
   R = self.REQUEST.RESPONSE
   R.setHeader('content-type', 'application/pdf')
R.Header('content-length', str(len(_fname)))
   R.write(_fname)

___
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] Generating and Downloading PDF.

2005-04-27 Thread Fernando Lujan
J Cameron Cooper wrote:
The method that contains your code must have at least the first 
parameter 'self'::

  def pdfwrite(self):
R = self.REQUEST.RESPONSE
R.setHeader('content-type', 'application/rtf')
R.setHeader('content-length', str(len(data)))
R.write(data)
It's a way of getting access to context.

OK, thanks. But how can I pass the self parameter using the dtml-call 
tag?  is correct? Because I'm using this and 
works fine.

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


[Zope] Generating and Downloading PDF.

2005-04-27 Thread Fernando Lujan
Hi guys,
I'm creating a pdf using reportlab, after the canvas.close()
I put the following code inside a External Method:
R = self.REQUEST.RESPONSE
R.setHeader('content-type', 'application/rtf')
R.setHeader('content-length', str(len(data)))
R.write(data)
But I receive the following error:
*Error Type: NameError*
*Error Value: global name 'self' is not defined
Is there some import wich I have been missing?
Fernando Lujan
___
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] Zeo

2005-04-26 Thread Fernando Lujan
ken wood wrote:
I have noticed that most documentation on ZEO is a bit dated (2003). 
Where can I get newer documentation or HowTo on ZEO?
The good and old Zope Book still rules... :)
http://www.plope.com/Books/2_7Edition/ZEO.stx
I recently used this chapter, it's self explanatory.  Take a look at the 
zope.conf file too. It already have a example of ZEO.

Fernando Lujan
___
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] ZEO and Sessions.

2005-04-12 Thread Fernando Lujan
Chris McDonough wrote:
Yes.
All the information in that article is geared for Zope 2.5 which had no
facility for using mounted databases from a config file... everything up
until "At this time you should be able to navigate to the
/session_storage folder..." in that article can be done by reconfiguring
ZEO using zeo.conf to serve a new storage, changing your ZEO clients'
zope.conf files to recognize the new storage and adding a "ZODB Mount
Point" from within the ZMI from one of the appservers.  The rest of it
is pretty simple. ;-)
 

Please, take a look in what I've done! Is that right? It works pretty 
fine here! :-)

If this is right, are there a desire for a how-to? I think I can write 
one, once it's pretty simple as you said.

zope.conf

 mount-point /temp_folder
 container-class Products.TemporaryFolder.TemporaryContainer
 # ZODB cache, in number of objects
 cache-size 5000
 
   server localhost:8100
  storage 1
   name zeostorage
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 


 mount-point /
 # ZODB cache, in number of objects
 cache-size 5000
 
   server localhost:8100
  storage 2
   name zeotemporary
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 


zeo.conf
# ZEO configuration file
%define INSTANCE /home/flujan/tmp/zeo

 address 8100
 read-only false
 invalidation-queue-size 100
 # monitor-address PORT
 # transaction-timeout SECONDS


 path $INSTANCE/var/Data.fs


 path $INSTANCE/var/SessionData.fs


 level info
 
   path $INSTANCE/log/zeo.log
 


 program $INSTANCE/bin/runzeo
 socket-name $INSTANCE/etc/zeo.zdsock
 daemon true
 forever false
 backoff-limit 10
 exit-codes 0, 2
 directory $INSTANCE
 default-to-interactive true
 # user zope
 python /usr/bin/python2.3
 zdrun /usr/local/zope-2.7.5/lib/python/zdaemon/zdrun.py
 # This logfile should match the one in the zeo.conf file.
 # It is used by zdctl's logtail command, zdrun/zdctl doesn't write it.
 logfile $INSTANCE/log/zeo.log

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


[Zope] ZEO and Sessions.

2005-04-12 Thread Fernando Lujan
Hi again people,
I've just read the article about SESSIONS in the upcoming ZOPE Book 2.7.
Here, we have ZEO running, and I need to use SESSION and ZEO. I read the 
article http://www.zope.org/Members/randy/ZEO-Sessions.

Isn't there a easy way to do this? I was wondering if I couldn just 
createa new filestorage entry in the zeo.conf, and add some lines in my 
zope.conf file.

Thanks.
Fernando Lujan
___
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] Session without cookies.

2005-04-12 Thread Fernando Lujan
Jens Vagelpohl wrote:
On Apr 12, 2005, at 1:02, Fernando Lujan wrote:
The URL "test1" in the form tag is obviously *not* generated by 
Zope. You put it in there manually. So it cannot work as you expect.

Hum, I see. Just web pages that aren't dinamically generated by Zope. 
For instance, other DTML document will not keep the Session. Is this 
correct?

No, you misunderstand what Chris said earlier. You need to let Zope 
generate the URL. In this case, instead of just saying...


you could do
">
of course that's ugly because it looks like putting a tag inside a 
tag, ZPT is much nicer that way:



Thanks, jens... Now I acquire my goal! ;)
Fernando Lujan

___
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] Session without cookies.

2005-04-11 Thread Fernando Lujan
Jens Vagelpohl wrote:
1)test





It's a simple code. I create two dtml documents with the following code.
The URL "test1" in the form tag is obviously *not* generated by Zope. 
You put it in there manually. So it cannot work as you expect.

jens
Hum, I see. Just web pages that aren't dinamically generated by Zope. 
For instance, other DTML document will not keep the Session. Is this 
correct?

I need to keep a SESSION through the entire site without cookies. Is 
that possible?

Sorry if I made myself incomprehensible.
Fernando Lujan
___
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] Session without cookies.

2005-04-11 Thread Fernando Lujan
Chris McDonough wrote:
On Mon, 2005-04-11 at 16:35, Fernando Lujan wrote:
 

I already changed the browser_id_manager and unchecked the cookies and 
checked the "Automatically Encode Zope-Generated URLs With A Browser Id" 
option. But it's just stops working. :(
   

Note that it says "Zope-generated" URLs.  URLs that are not generated by
Zope will not be encoded.
 

The URL is generated by Zope.
It's a simple code. I create two dtml documents with the following code.
1)test





2) teste1

The teste1 displays None, I expected it to display the number 2. :(
In addition, where could I get the Examples? The Zope book has a mention 
of it, but I couldn't find the URL to download the Examples.
   

Examples are available from the "Quick Start" page, which is available
from the default index_html of your Zope root.
 

I didn't have the Examples directory under my Zope instance... :(
___
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 )


[Zope] Session without cookies.

2005-04-11 Thread Fernando Lujan
Hi everyone,
Is there possible to use a Session control without cookies?
I already changed the browser_id_manager and unchecked the cookies and 
checked the "Automatically Encode Zope-Generated URLs With A Browser Id" 
option. But it's just stops working. :(

In addition, where could I get the Examples? The Zope book has a mention 
of it, but I couldn't find the URL to download the Examples.

Thanks!
Fernando Lujan
___
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 )