[Zope] PlacelessTranslationService

2010-03-22 Thread Milos Prudek
Hi,

is this the right place to post question about PlacelessTranslationService?


-- 
Milos Prudek
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] declarePublic function

2009-01-28 Thread Milos Prudek
 As the bottom of my email stated, use declareObjectPublic() in this
 case. The rest of the security calls are then somewhat redundant,

Yes, I used your advice and it seems to have resolved the issue.

Thank you!

-- 
Milos Prudek
___
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] declarePublic function

2009-01-27 Thread Milos Prudek
I would like to upgrade my site from Zope 2.7.x to Zope 2.10.x

When I try to run my site under Zope 2.10.x, I get this exception:

  class JMZPTMacros:
  File /home/orl/Zope/Products/JMZPTMacros/JMZPTMacros.py, line 28, in 
JMZPTMacros
security.declarePublic()
TypeError: declarePublic() takes at least 2 arguments (1 given)


I need to use JMZPTMacros. It is an old product that seems to require a patch 
to line 28. I can see that Zope 2.7.x defines declarePublic() as:
def declarePublic(self, *names):

and that Zope 2.10.x defines declarePublic() as:
def declarePublic(self, name, *names):

therefore I understand that one parameter is obligatory. But I cannot guess 
what parameter it should be for JMZPTMacros. I tried to look how 
declarePublic is used inside Zope but it gave me no clue.

Please help.

-- 
Milos Prudek
___
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] declarePublic function

2009-01-27 Thread Milos Prudek
 JMZPTMacros. Most likely, the author meant to protect the method right
 below that line.

 To illustrate, the code probably looks something like:

   security.declarePublic()
   def someMethod(self, REQUEST):

Actually, it does not look like that. It is not followed by method definition. 
Here is all the context:

class JMZPTMacros:
  #All the ZPT Objects will be loaded as attributes of my
  #JMZPTMacros class

  security=ClassSecurityInfo()
  security.declarePublic()

  #Loads my generic manage_add form macros
  security.declarePublic('generic_add')
  generic_add=PageTemplateFile('zpt/generic_add',globals())
  generic_add._owner=None

  #Loads my generic manage_edit form macros
  security.declarePublic('generic_edit')
  generic_edit=PageTemplateFile('zpt/generic_edit',globals())
  generic_edit._owner=None

  #Loads my generic manage_view form macros
  security.declarePublic('generic_view')
  generic_view=PageTemplateFile('zpt/generic_view',globals())
  generic_view._owner=None

  #Loads my generic macros
  security.declarePublic('generic')
  generic=PageTemplateFile('zpt/generic',globals())
  generic._owner=None


So, since there are many correct calls of declarePublic(), what does the 
incorrect (paremeter-less) call near the top of the class do?

-- 
Milos Prudek
___
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] [ANN] TextIndexNG 3.1.10 released

2006-07-03 Thread MIlos Prudek
On Saturday 03 of June 2006 15:28, Andreas Jung wrote:
 I am pleased to announce the release of TextIndexNG V 3.1.10

Hi,

I have just tried TextIndexNG V 3.1.9 in Zope 2.9.3 and it shows in 
Control_Panels/Products as installed... I did compile the modules as required 
by README... but an instance of TextIndexNG cannot be added, because it is 
not among addable types. Is this normal? Does TextIndexNG3 have a web 
interface?
 
-- 
Milos Prudek
___
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: default_zpublisher_encoding not supported

2006-05-05 Thread MIlos Prudek

 The spelling in my 2.8 branch checkout is 'default-zpublisher-encoding'.

Wow, not I see it. Dashes instead of underscores.

Now it works. Thank you.


-- 
Milos Prudek
___
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] default_zpublisher_encoding not supported

2006-05-04 Thread MIlos Prudek
Zope 2.8.6 is supposed to support default_zpublisher_encoding in zope.conf.

But when I uncomment the example in zope.conf, 

default_zpublisher_encoding utf-8

I cannot launch Zope:

Error: 'default_zpublisher_encoding' is not a known key name
(line 863 in file:///home/makina/bili/etc/zope.conf)

-- 
Milos Prudek
___
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: default_zpublisher_encoding not supported

2006-05-04 Thread MIlos Prudek
 Known bug:  the directive is actually spelled (for reasons I didn't
 agree with when the decision happened, and can't remember now)
 'default-publisher-encoding';  the example is wrong (and I think should

Thank you for your suggestion. I tried 'default-publisher-encoding' and the 
error is the same as before.

-- 
Milos Prudek
___
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] unicode error in standard ZPT form

2006-03-29 Thread MIlos Prudek
On Tuesday 28 of March 2006 23:48, MIlos Prudek wrote:
 I have a typical ZPT form that redisplays entered data if invalid data is
 entered:

 input type=text size=30 name=name  tal:attributes=value
 request/name| nothing

 Unfortunately it throws a Unicode exception if a Czech accented character
 is entered. Such as s with a hacek. Or c with a hacek. Possibly applies

Resolved. 

Problem caused by Czech characters in the Page Template.  Problem solved by 
replacing all Czech text with English text, and moving Czech translation to 
a .po file.

i.e.

h2Accented Czech/h2

was replaced with

h2 i18n:domain=mydomain i18:translate=English text/h2

-- 
Milos Prudek
___
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] unicode error in standard ZPT form

2006-03-28 Thread MIlos Prudek
I have a typical ZPT form that redisplays entered data if invalid data is 
entered:

input type=text size=30 name=name  tal:attributes=value request/name|
nothing

Unfortunately it throws a Unicode exception if a Czech accented character is 
entered. Such as s with a hacek. Or c with a hacek. Possibly applies to 
many other languages as well. Is there a workaround?

Zope 2.8.5, Plone 2.1.2, Python 2.3.5, Linux 2.6.12

UnicodeDecodeError
'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)

Full error log:
*  Module ZPublisher.Publish, line 113, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 40, in call_object
* Module Shared.DC.Scripts.Bindings, line 311, in __call__
* Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
* Module Products.PythonScripts.PythonScript, line 323, in _exec
* Module None, line 14, in demand
  PythonScript at /foto/demand used for /foto/fotogalerie/svatebni-foto
  Line 14
* Module Shared.DC.Scripts.Bindings, line 311, in __call__
* Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
* Module Products.PageTemplates.ZopePageTemplate, line 256, in _exec
* Module Products.PageTemplates.PageTemplate, line 104, in pt_render
  ZopePageTemplate at /foto/demand_form used 
for /foto/fotogalerie/svatebni-foto
* Module TAL.TALInterpreter, line 206, in __call__
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 711, in do_useMacro
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 426, in do_optTag_tal
* Module TAL.TALInterpreter, line 411, in do_optTag
* Module TAL.TALInterpreter, line 406, in no_tag
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 742, in do_defineSlot
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 426, in do_optTag_tal
* Module TAL.TALInterpreter, line 411, in do_optTag
* Module TAL.TALInterpreter, line 406, in no_tag
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 690, in do_defineMacro
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 734, in do_defineSlot
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 426, in do_optTag_tal
* Module TAL.TALInterpreter, line 411, in do_optTag
* Module TAL.TALInterpreter, line 406, in no_tag
* Module TAL.TALInterpreter, line 250, in interpret
* Module TAL.TALInterpreter, line 308, in do_startTag
* Module TAL.TALInterpreter, line 396, in attrAction_tal

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: 
ordinal not in range(128)

-- 
Milos Prudek
___
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] change ATImage metadata

2006-02-24 Thread MIlos Prudek
 The language attribute is a standard Archetypes field, and as such youcan 
ask such fields what it's accesor and mutator are:

Cool, now I know how to do it for any other attribute. Thank you.

-- 
Milos Prudek
___
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] change ATImage metadata

2006-02-22 Thread MIlos Prudek
Hi,

how can I programatically change the Language attribute in Standard Resource 
Metadata of ATImage?

I tried:

for item in context.objectValues('ATImage'):
  print item.Language()

This works perfectly. How do I assign value to Language?

-- 
Milos Prudek
___
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] security for ZPT-based Product

2005-07-28 Thread Milos Prudek

Right, checked an old (wrong) file in my product. Sorry for the mistake.


Yes, it works. Problems solved. Thank you Andreas and Jens.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] security for ZPT-based Product

2005-07-11 Thread Milos Prudek



How can I manage permissions for imported ZPT files?

Relevant lines from my Product:

from AccessControl import ClassSecurityInfo
class MyClass():
 security=ClassSecurityInfo()
 comment_add_form=PageTemplateFile('zpt/comment_add_form',globals())

My goal is to limit access to comment_add_form to the Authenticated role 
only. comment_add_form is on the filesystem, in my Product's zpt directory.


How can I achieve this? I understand zilch about ClassSecurityInfo...

(My Product is based on JMBoring template)

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] code completion for ZPT

2005-05-18 Thread Milos Prudek
Hi,
is there an editor that would support code completion for Page Templates 
and maybe even code completion for Zope3 new technologies?

Currently I use ViM on Linux - but a lot of typing is required, like 
tal:attributes - 14 keystrokes.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] container and context for folderish objects

2005-05-11 Thread Milos Prudek
Milos Prudek wrote:
I created a very simple folderish product. Everything works fine. But I 
 was surprised that context and container seem to behave differently 
for folderish object than for normal Folder.
To answer my own question: I misunderstood what container does. Desired 
behaviour can be obtained via

pli tal:repeat=item python:here.aq_parent.objectIds() 
tal:content=item/p

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] container and context for folderish objects

2005-05-10 Thread Milos Prudek
I created a very simple folderish product. Everything works fine. But I 
 was surprised that context and container seem to behave 
differently for folderish object than for normal Folder.

Here's the problem: my product's instance a contains a DTML Document 
doc and some photos img1, img2. A simple ZPT lst queries object ids:

pli tal:repeat=item python:here.objectIds() tal:content=item/p
pli tal:repeat=item python:container.objectIds() 
tal:content=item/p

I need to call this ZPT as follows:
/a/doc/lst
and I expect to get a list of objects contained in a. The problem is 
that lst does not provide that. The first line shows nothing, and the 
second line shows content of the parent Folder! I would have expected 
that container is the a, the folderish object. Why does it not work?

I \know that I can  get my list by calling /a/lst, but unfortunately I 
cannot do that.

--
Milos Prudek
___
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] ZCatalog and custom Product

2005-04-20 Thread Milos Prudek
Hi,
I need to convert a ZClass cataloged in multiple ZCatalogs into a 
Product. I know how to create a Product. But I have trouble 
understanding how to create a proper ZCatalog and manage it in a Product.

When I change my ZClass instance, it reindexes itself in multiple 
ZCatalogs. I have the following DTML method edit in my ZClass (stored 
in ZODB) that takes care of this:

dtml-call manage_editCataloger('Catalog_A')
dtml-call reindex_object
dtml-call manage_editCataloger('Catalog_B')
dtml-call reindex_object
How should this be programmed in Products?
- Should I first create a ZCatalog instance in ZODB, and then bind this 
instance to my Product? That would make my Product not self-contained.

- or should the Product rather create ZCatalog instance during its 
initialization? That would mean that upon Zope restart, ZCatalog 
instance would be removed and re-created and all Product instances would 
have to be recataloged.

In my new Product (that is to replace my ZClass), I put this line:
from Products.ZCatalog.ZCatalog import ZCatalog
and I added ZCatalog to the list of subclassed classes:
class ArtBase(ZCatalog, ObjectManager, SimpleItem, PropertyManager, 
JMZPTMacros):

but I have no idea what to do next. In this mailing list's archive, 
Chris Withers wrote that ZCatalog should be an attribute of a product's 
instance so that I can open the ZCatalog management interface by calling 
my_prod_instance/catalog_name/manage. I understand that, but I have no 
idea how to achieve it.

Should I add a line to my class __init__ ? Something like:
  def __init__(self,id,title=''):
Contructor method to initialize the properties of our class
#Create and initilize the class attributes
self.id=id
self.title=title
self.catalog=manage_addZCatalog(id=catalog, title=title)
but the above looks fishy because I would have an isolated catalog for 
each new instance of my class...

To support manage_editCataloger and reindex_object, do I need to import 
both ZCatalog from Products.ZCatalog and CatalogAware from 
Products.ZCatalog.CatalogAwareness ?

--
Milos Prudek
___
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] ZCatalog and custom Product

2005-04-20 Thread Milos Prudek
Milos Prudek wrote:
 Hi,

 I need to convert a ZClass cataloged in multiple ZCatalogs into a
 Product. I know how to create a Product. But I have trouble
 understanding how to create a proper ZCatalog and manage it in a Product.
To answer myself, simply follow Garito's advice of 10.6.2004 in mailing 
list archive.

Now the only problem is multiple catalogs. I need to catalog my class 
into Catalog_A, Catalog_B and Catalog_C upon instantiation.

class MyClass(CatalogPathAware):
  def __init__():
self.manage_editCataloger(Catalog_A)
self.index_object()
The above code catalogs the instance into Catalog_A. Okay, but
self.manage_editCataloger(Catalog_A)
self.index_object()
self.manage_editCataloger(Catalog_B)
self.index_object()
self.manage_editCataloger(Catalog_C)
self.index_object()
... the above code catalogs the instance into Catalog_C, but not into 
Catalog_A and not into Catalog_B. Does anyone know why Catalog_A and 
Catalog_B are ignored?

--
Milos Prudek
___
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] Organisational vs. Functional hierarchies

2005-04-20 Thread Milos Prudek
Ta. I'll check it out, although I suspect a ZClass may be more what I
want... need to do some more reading up.
Don't use ZClasses. They have been deprecated for more than a year and 
they are poorly supported.

--
Milos Prudek
___
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] Restart button in Control Panel

2005-04-19 Thread Milos Prudek
I don't think that debug mode has anything to do with it. Rather, if 
Correct. i have debug mode off, no Restart button.
you're using runzope it's not running in daemon mode, and so cannot 
restart. Run it as a service with 'zopectl start' and you'll have a 
Restart button.
Correct again. Thank you JCC.
--
Milos Prudek
___
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] Writing products (was: Organisational vs. Functional hierarchies)

2005-04-19 Thread Milos Prudek

Meh. Can you point me at any good tutorial documentations?
I just learned how to write products in about four hours by reading the 
following tutorials:

Start with the minimal Product
http://www.zope.org/Members/maxm/HowTo/minimal_01/
Then read about Boring product
http://www.zope.org/Members/gtk/Boring
and finish with JMBoring
http://www.zope.org/Members/jmeile/JMBoring
You then do not need to write your product from scratch. You can easily 
modify JMBoring.

Thanks to Paul Winkler and Cliff Ford who pointed these excellent docs 
to me.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] Restart button in Control Panel

2005-04-18 Thread Milos Prudek
Is it possible to have the Restart button in ZMI Control Panel? I only 
have Shutdown. What controls this? I start my Zope instance with 
instance/bin/runzope .

I use Zope 2.7.4.
--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] non-undoable storage

2005-04-18 Thread Milos Prudek
I have a couple hundred Articles (class instances) in my ZODB. Most 
instances are 200 kB, some are much larger. One of the Article 
properties is Number of times the article was read. Any increment causes 
ZODB to grow by the size of the given instance, due to the fact that 
ZODB will append a new version of the whole 200 kB or 2MB instance just 
because a single byte was changed.

Consequently ZODB grows several hundred MB in a single day even if no 
new article is added.

This calls for some form of non-undoable storage.
One possibility is to move the NumberOfReaders attribute from ZODB to 
my SQL server. Not a problem, but I'm not sure what is the best way to 
maintain connection between ZODB instance (it can appear at different 
places in ZODB directory structure and it can be moved from place to 
place with Cut and Paste in ZMI) and SQL table. Connection means SQL key 
column. Instance ids cannot be used as a SQL key, because they are 
nonunique - each folder has a sequence of instances numbered 1...x. So 
there are over ten instances named 1. Instance addresses = URLs could 
be used but I would have to write my own methods / interfaces for moving 
Articles in the directory structure to maintain the connection between 
ZODB and SQL table.

Is there an obvious elegant solution that I am missing?
--
Milos Prudek
___
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] non-undoable storage

2005-04-18 Thread Milos Prudek
from ZODB import PersistentList
Interesting. I'll look at this idea. I never heard of this class.
You could then have NumberOfProperties become a ComputedAttribute

But AFAIK, ComputedAttributes don't support write methods.
Um, are you saying that the solution would actually not work for my use 
case?

So client code can't write someArticle.NumberOfReaders += 1.
But then, you wouldn't be able to do that with a SQL-based
solution either.
Why not? It's easy to write ZSQL method to update data. Probably we do 
not understand each other.

--
Milos Prudek
___
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] non-undoable storage

2005-04-18 Thread Milos Prudek
A better candidate, rather than PersistentList, would be a BTrees.Length.
Never heard about this. Why is it better? What does it do? Where can I 
find more info about it?

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] non-undoable storage

2005-04-18 Thread Milos Prudek
Probably not. If you had an SQL solution, and some client code
said someArticle.NumberOfReaders += 1, how would you get that
assignment to fire off your SQL code?
I would have to calculate the key, so simple assignment would not 
work, that's true.


--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] non-undoable storage

2005-04-18 Thread Milos Prudek
It's designed to be a counter and does automatic conflict resolution. It
was mentionned a number of times in the past on the zope and zodb-dev
lists.
Thank you. I found detailed info in the mailing list archive, just like 
you said.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] developer docs

2005-04-12 Thread Milos Prudek
What are the best documents for creating Zope products?
I know Zope Book very well and I write TTW scripts. I need to convert a 
bunch of ZClasses into Products.

ZDG seems very outdated. Should I start with mxmEasyProduct and then 
read ZDG? Is there a book available in bookshops that is better than ZDG 
and contains all required information for building products?

--
Milos Prudek
___
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] developer docs

2005-04-12 Thread Milos Prudek
 Why is it out-dated? Most things are still valid. If not, point them out
 to be
 corrected or even better: help producing a never version of the ZDG.
Hello Andreas,
This kind of response is so common that it deserves a shortcut of its 
own. Such as RTFM. You essentially told me to f*k off. But I did not 
attack ZDG.

ZDG has some outdated parts. You admit that. By following it, I will 
create incorrect code or use obsolete constructs. At least that is what 
reader comments say in ZDG. Well, I do not want to create obsolete 
constructs.

I am looking for a book that will help me. That is all.
--
Milos Prudek
___
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] developer docs

2005-04-12 Thread Milos Prudek
 It is your good right to expect documentation but documentation has to
 be written
I've written about 50 pages of rather detailed documentation for Zope 
Page Templates and it is available online at www.root.cz. But not in 
English. So I know, understand and follow the concept you mentioned.

I do not feel I can contribute to ZDG at this time. Is there any other 
resource you can recommend, please?

--
Milos Prudek
___
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] developer docs

2005-04-12 Thread Milos Prudek

I'll note that we *try* to answer questions on the zope3-users mailing list in 
a timely fashion. If noone response to your question there, it is usually 
because it is a harder problem. ;-)
I found out that you wrote a book about Zope 3 that gather raving 
reviews on Amazon. Does the book contain all info required to develop 
products (or whatever are they called in Zope 3) for Zope 3?

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] developer docs

2005-04-12 Thread Milos Prudek
I don't know about best documents! There is a minimal Product How To:
http://www.zope.org/Members/maxm/HowTo/minimal_01/
That's exactly what I was looking for. Thanks!
--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] developer docs

2005-04-12 Thread Milos Prudek
Yes. In Zope X3.0 you can only develop filesystem-based Python packages, so in 
Well, then your book debuted at number 1 on my book shopping list.
--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] developer docs

2005-04-12 Thread Milos Prudek
Rather, I would look at the venerable old Boring and Minimal 
example products.  (But be aware that Boring (last time I looked)
Oh yes, I will look at those. Thanks for the supporting documentation in 
your post.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
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] best practices Zope filesystem development

2005-04-08 Thread Milos Prudek
Hi,
What are the best, most effective practices in leveraging filesystem 
when developing in Zope?

I'm looking for an approach that would let me use keyboard and leave the 
mouse alone as much as possible. In other words, minimum use of ZMI even 
if TTW Python Scripts are used extensively. Instead of ZMI/External 
editor I need vim, grep, mv and cp to manipulate Zope ZODB.

--
Milos Prudek
___
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-dev] Placeless Translation Service

2004-06-02 Thread Milos Prudek
where can I discuss Placeless Translation Service development?
The original author Lalo Martins does not respond to emails - current 
PTS bears a fork suffix - who's in charge now?

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


Re: [Zope-dev] Re: PlacelessTranslationService syntax

2004-04-14 Thread Milos Prudek
b i18n:translate= i18n:domain=ibc i18n:target=string:czGood 
morning/b
Is my syntax wrong?
Maybe. Get i18ndude (google) and search for i18n docs for ZPT (google, 
too) :)
Believe me, I googled before I wrote my original post. The syntax I used 
is derived from documentation at 
http://dev.zope.org/Members/lalo/PlacelessTranslationService and 
http://dev.zope.org/Members/efge/TranslationService. And it does not 
work. That's why I ask here.

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


Re: [Zope-dev] Re: PlacelessTranslationService syntax

2004-04-14 Thread Milos Prudek
I realize that my original post implied that I failed to do the 
homework. Here's the info:

My .po file is OK. Zope 2.7 reads it correctly, as shown in startup log. 
When I test the translation in 
/Control_Panel/TranslationService/manage_main, it translates the message 
'Good morning' correctly.

I've read all docs that I could find.

I need this for straight Zope (no CMF, no Plone).

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


[Zope-dev] PlacelessTranslationService syntax

2004-04-13 Thread Milos Prudek
What's the correct ZPT syntax for PlacelessTranslationService?

I tried this:

b i18n:translate= i18n:domain=ibc i18n:target=string:czGood 
morning/b

This gets rendered into:  bGood morning/b

No translation, although I do have an entry for 'Good morning' in my .po 
file under an 'ibc' domain.

Is my syntax wrong?

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


[Zope-dev] Localizer and UnicodeError

2003-12-16 Thread Milos Prudek
I want to move my Localizer LocalContent instances from Localizer
0.8.1 to Localizer 1.0.1
My Zope 2.5.1 was updated with all necessary unicode patches.

The problem: After converting LocalContent instances in one folder to
Unicode, I cannot access the management screen. The error message is:
Error Type: UnicodeError
Error Value: ASCII encoding error: ordinal not in range(128)
The same error is triggered when displaying the titles in that folder:

script_1:

for x in context.objectValues('LocalContent'):
print x.id, : x.title
return printed
... and is not trigered if I only list the ids.

I believe that this kind of error appears when Zope is trying to display
Unicode characters and legacy-encoded characters (such as ISO-8859-2 or
Win1250) at the same time.
The title attribute of LocalContent objects is displayed in the ZMI. Of
course, the title attribute of LocalContent objects has many language
versions, and Zope (I presume) displays in the ZMI the language version
according to my browser's language setting.
I do not understand why script_1 triggers it.

But most importantly I do not know how to get out of this mess.

This is the External script used to do the conversion to Unicode:
def cvt(objVal):
# for x in context.objectValues('LocalContent'):
log = []
for x in objVal:
log_line = x.id + ': '
local_properties = {}
for id, v in x._local_properties.items():
log_line += '  ' + id
local_properties[id] = {}
for lang, v in v.items():
local_properties[id][lang] = unicode(v, 'cp1250')
x._local_properties = local_properties
log.append(log_line)
return log
--
Milos Prudek




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


[Zope] Zope Book: UniqueValuesFor

2000-12-21 Thread Milos Prudek

Regarding the upcoming Zope Book:

There are some examples for UniqueValuesFor method and "_usage" syntax
(it looks that only values "range:min", "range:max" and "range:min:max"
are possible), but these are not mentioned in the DTML reference or API
reference. Maybe Zope Book needs a ZCatalog reference, if there are
methods like UniqueValuesFor...

I would recommend that since the current Zope Book is a giant leap
forward, these and any other language tricks that are scattered in the
Zope Book chapters should be briefly mentioned in the ZopeBook DTML and
API references.

IMHO there are many people like me who:

- are trying to start using Zope BECAUSE OF the final availability of
Zope Book
- for various reasons are not very comfortable with hunting information
around zope.org and in Zope sources (no permanent internet connection is
a strong reason)
- consequently expect to find all basic information in coherent form in
Zope Book

Obviously, Zope Book can't contain everything. I like the sentence "this
is an advanced topic and it's outside the scope of this book". Authors
have put limits to what they want to achieve. I wish that the ZB is
coherent in the "explanation - example - reference" trio.


--
Milos Prudek



___
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] Stupid Newbie: Define permissions

2000-12-21 Thread Milos Prudek

Dieter Maurer wrote:
 
 Milos Prudek writes:
   ... "Define permissions" tab for ZClasses ...
 I found that the respective description in the upcoming Zope book
 was not bad.

Thanks, that's true. The explanation is brief, but much easier to
understand.

--
Milos Prudek



___
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] Re: [Zope]Newbie: manage_changeProperties and wrong permission

2000-12-20 Thread Milos Prudek

Sven Hohage wrote:
 
 Hallo Milos,
 I'm not sure if I understand your problem right.
 First of all what do you mean with 'Fir-class'?Is it a ZClass or a
 usual Zope-Folder.I suppose a Zope-Folder!.

Oh no. "Fir" is a Product, with a single Z Class "Fir". Within Fir there
are two folders and three methods:

Products
+-- Fir   (product)
+Fir  (Z Class)
+--cz (folder)
+lst_name (property of cz folder)
+lst_text (property of cz folder)
+--en (folder)
+lst_name (property of cz folder)
+lst_text (property of cz folder)
+--changeLST_form (method)
+--changeLST  (method)
+--display(method)

 You have to call the method "manage_changeProperties" on an Object.

An object in my case is a property "lst_name" in "cz" folder.

After creating an instance called AAA of Fir ZClass, I can access the
"display" method:

http://.AAA/cz/display

The "display" method simply contains just dtml-var lst_name. Depending
on the URL, it displays the "cz/lst_name" or "en/lst_name".

Using the same acquisition thinking, the "changeLST" method contains 
dtml-call
expr="manage_changeProperties(lst_name=REQUEST['lst_name_new'])"
where "lst_name_new" is obtained from a trivial form. I thought that
"changeLST" would change the "cz/lst_name" property when called with
http://.AAA/cz/changeLST.


 This should work: dtml- call 
expr="cz.manage_changeProperties({'lst_name':lst_name_new})"

Unfortunately this would require to write many almost identical
changeLST methods: one with cz.manage_changeProperties, one with
en.manage_changeProperties, and there are many more language versions.

As you may have guessed this is a database where every record contains
many identical fields (name, text, etc.) for many languages. Like this:

+--cz
+lst_name
+lst_text
+--en
+lst_name
+lst_text
+--de
+lst_name
+lst_text
+--ru
+lst_name
+lst_text

The idea is that once a new user selects her preferred language (and a
Cookie is set for her), she is transferred to a starting url
"http://www.website.org/de/start.htm" and from there she can access the
database in her language by simple acquisition, without the need for
having each method in many "language" versions, like I said above.

I may figured it wrong. Is there a more clever way to do this?

--
Milos Prudek

___
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] Newbie: manage_changeProperties and wrong permission

2000-12-20 Thread Milos Prudek

 --the point is to adress the propertysheet of the ZClass you are
 adressing--
   dtml- call
 
expr="propertysheets.Name_of_the_propertysheet.manage_changeProperties({'lstName':newlstName})"

But the lstName is not part of propertysheet of Fir ZClass. It is a
simple property of 'cz' subfolder of Fir ZClass.

If lstName were inside a property sheet of Fir ZClass, there could not
exist multiple 'lstName' properties in different property sheets,
because all property sheets have common namespace. Therefore I have my
properties in subfolders "cz", "en", "de"...

--
Milos Prudek

___
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] Stupid Newbie: Define permissions

2000-12-20 Thread Milos Prudek

Hi all,

I understand permissions and proxying, but I feel like mentally
challenged when trying to understand the following Define permissions
tab in ZClass:

*
This interface is used to define how the operations of this object (or
objects that acquire permission settings from this
object) correspond to the operations defined by your product or ZClass.

The table below has two columns. The first column lists the permissions
for this object. The second column specifies the
permissions that should have this permission in this product or ZClass.
For ZClass methods, only permissions that are
defined for the ZClass are permitted.

In general, any permissions that include operations that change (mutate)
an object should be disabled.

The listing below shows the current permission mappings for this item.
*

I've read the online help but it still makes no sense. Could someone
rephrase it in plain English? Or perhaps give an example or two?

Zope blocks all my attempts of calling manage_changeProperties because
of insufficient permissions. The property belongs to a subfolder
contained in a Z Class contained in a Product. The
manage_changeProperties is called from a method "changeLST" belonging to
the Z Class.

Zope also blocks attempts to display the property using simple
dtml-var from a method "display" belonging to the Z Class.

1. If I map "Manage properties" permission from (disabled) to "View"
permission, does that mean that anyone who has "View" permission (i.e.
even anonymous users) can manage properties here?

2. Is the Define permissions the right place to solve this? Which one?
  A. the Define permissions tab of the containing Product?|
  B. Permission tab of ZClass? (the Manage properties is already listed
as "inherited")
  C. the Define permissions tab of ZClass (Manage properties is mapped
to (disabled))
  D. the Define permissions tab of the subfolder (this tab actually
displays ../propertysheets/methods/subfolder, and Manage properties is
mapped to (disabled))
  E. the Define permissions tab of "changeLST" method.

After a few experiments, it looks like:

- to allow anyone run the "display" method, D is right. ("Access
contents information" assign to "View")

- to allow anyone run the changeLST method, E is right ("Manage
properties" assign to "View")

To sum it up, the Define permission says "what right (in the second
column) must user possess in order to be able to do the thing specified
in the first column". And also: "If the second column does not have a
specific permission you need, you have to go to the containing Z Class,
click on Permissions and add the desired permission in the 'Class
permissions' list box."

Frankly, the sentence "The second column specifies the permissions that
should have this permission in this product or ZClass." from the online
help still makes no sense to me. Is my translation to plain English
correct? I'm very, very confused :-)

--
Milos Prudek

___
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] Newbie: manage_changeProperties and wrong permission

2000-12-19 Thread Milos Prudek


I need to call manage_changeProperties but Zope refuses to accept my
authentication.

There's a "Fir" class with two subfolders ("cz" and "en"). The
subfolders contain identically named properties: lst_name and lst_text.
These properties are then displayed using simple acquisition:
http://...instance/cz/display and http://...instance/cz/display, where
"display" is a method of Fir class that calls dtml-var lst_name.
Simple.

To change the lst_name and lst_text properties thru the web, I created
simple form and a method within the Fir class. This is the
changeLST_form:

dtml-if expr="REQUEST.has_key('lst_name_new')"
  dtml-call
expr="manage_changeProperties(lst_name=REQUEST['lst_name_new'])"
  h1The property 'lst_name' has changed/h1
dtml-else
  h1No properties were changed/h1
/dtml-if

dtml-if expr="REQUEST.has_key('lst_text_new')"
  dtml-call
expr="manage_changeProperties(lst_text=REQUEST['lst_text_new'])"
  h1The property 'lst_text' has changed/h1
dtml-else
  h1No properties were changed/h1
/dtml-if

Unfortunately, authorization fails when this script is supposed to run:
"You are not authorized to access manage_changeProperties."

I'm running this script as a "manager" defined at Zope root, in other
words with the default setup. Normally I can do anything in Zope with
this authorization.

--
Milos Prudek

___
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] tree traversing publishing

2000-11-28 Thread Milos Prudek

I do not quite understand how Zope traverses a tree. 

I created "ZooExhibit" Z Class within ZooExhibit factory, and
"ExhibitProperties" prop.sheet within that class, with an "animal"
property. I made association between "Edit" name and
propertysheets/ExhibitProperties/manage. I made an instance of the Z
Class called "Rabbit" within Zoo folder. But when I access
http://Zoo/Rabbit/propertysheets/ExhibitProperties/animal, I get an
error "Missing doc string".

Perhaps a similar problem: I created "BWE" product/Z Class, and on the
Methods tab I created "pop" folder with a default "index_html". I
created an instance of that Z Class called "BWE_inst" within a "BWE"
folder. I can access "http://BWE/BWE_inst", but when I try
"http://BWE/BWE_inst/pop", browser gives me Authorization failed.


--
Milos

___
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] How to checkout PythonMethod from CVS

2000-11-24 Thread Milos Prudek

How can I checkout PythonMethod from cvs? I tried to modify the "Zope2"
in the following command:

cvs -z7 -d :pserver:[EMAIL PROTECTED]:/cvs-repository checkout
Zope2

(Zope2/PythonMethod, Zope/PythonMethod, Zope/DC/PythonMethod,
Zope/Products/PythonMethod and countless other combinations)

--
Milos Prudek

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