RE: [Zope] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Sinang, Danny
 Because '/' is a reserved character since it is used in URLs as path
separator.

Any workarounds ? 

Is there a way to refer to the said objects without using the '/' ?
___
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] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Andreas Jung



--On 10. August 2006 13:59:55 +0800 Sinang, Danny [EMAIL PROTECTED] 
wrote:



Because '/' is a reserved character since it is used in URLs as path

separator.

Any workarounds ?

Is there a way to refer to the said objects without using the '/' ?



Huh? Usually you have  no chance to create a Zope object with such an id.
So there is no need to rename something that can't exist be definition :-)

-aj

pgpWqLOAse55E.pgp
Description: PGP signature
___
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] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Sinang, Danny
 
 Huh? Usually you have  no chance to create a Zope object with such an
id.
 So there is no need to rename something that can't exist be definition
:-)

Exactly. 

The said object, s5/Begin, is the Begin activity of the s5 process
found in the GeneralWorkflow workflow - which is an OpenFlow (
www.openflow.it ) object.

I was able to rename my processes (S5, S100, S200) to their lowercase
counterparts since all I had to do was do :

///

wf = container.GeneralWorkflow
catalog = wf.Catalog

processes = catalog.ZopeFind(wf, obj_metatypes=['Process'],
search_sub=1)

for p in processes:
wf.manage_renameObject(p[0], p[0].lower())  

///


When I try to rename the activities found in those processes, I try to
do likewise, but the ZopeFind results come out like this :

('S100/Begin', activity at /dev/danny/wms/GeneralWorkflow/S100/Begin)
('S100/RECEIPT_OF_SOURCE_DOCUMENTS', activity at
/dev/danny/wms/GeneralWorkflow/S100/RECEIPT_OF_SOURCE_DOCUMENTS)
('S100/CHECK_MS_BATCHING', activity at
/dev/danny/wms/GeneralWorkflow/S100/CHECK_MS_BATCHING)

To call manage_renameObject (), I have to supply it with the object
name.

If I use result[0], I get the illegal characters in URL error. 

And if I use result[1].id, I get :

Error Type: AttributeError
Error Value: Begin

This is probably because there is no Begin object under the wf
container from which I'm calling manage_renameObject().

So my question is, how do I refer to the Begin object found in the
S100 workflow ?

Regards,
Danny

___
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] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Andreas Jung



--On 10. August 2006 14:19:40 +0800 Sinang, Danny [EMAIL PROTECTED] 
wrote:





Huh? Usually you have  no chance to create a Zope object with such an

id.

So there is no need to rename something that can't exist be definition

:-)

Exactly.

The said object, s5/Begin, is the Begin activity of the s5 process
found in the GeneralWorkflow workflow - which is an OpenFlow (
www.openflow.it ) object.



You can't have some an object. If you have one, kick the related product 
since it appears that is bypasses the related checks. And of course for 
such objects the standard APIs might not work because they don't expect 
that an object have '/' inside their IDs and likely treat them as a path 
and not as an object ID. So your issue is basically unsupported. You might 
kick the authors of the related product or patch the related methods in 
OFS/*.py


-aj

pgpW0PHrwUCNB.pgp
Description: PGP signature
___
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] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Gabriel Genellina

At Thursday 10/8/2006 03:19, Sinang, Danny wrote:


I was able to rename my processes (S5, S100, S200) to their lowercase
counterparts since all I had to do was do :

When I try to rename the activities found in those processes, I try to
do likewise, but the ZopeFind results come out like this :

('S100/Begin', activity at /dev/danny/wms/GeneralWorkflow/S100/Begin)
('S100/RECEIPT_OF_SOURCE_DOCUMENTS', activity at
/dev/danny/wms/GeneralWorkflow/S100/RECEIPT_OF_SOURCE_DOCUMENTS)
('S100/CHECK_MS_BATCHING', activity at
/dev/danny/wms/GeneralWorkflow/S100/CHECK_MS_BATCHING)

To call manage_renameObject (), I have to supply it with the object
name.


You must call manage_renameObject on the object *container*, passing 
the old name and the new name. Something like this:


  object = result[1]
  container = object.aq_parent
  container.manage_renameObject(object.id, object.id.lower())



Gabriel Genellina
Softlab SRL 






__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas


___
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] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Sinang, Danny

 You must call manage_renameObject on the object *container*, passing
the old name and the new name. Something like this:

   object = result[1]
   container = object.aq_parent
   container.manage_renameObject(object.id, object.id.lower())

Thanks Gabriel.

I did exactly as you suggested, but ran into this error :

/
The id begin is invalid - it is already in use.
/

Begin is the first activity. It could be some reserved word within
OpenFlow or Zope - not really sure. 

In any case, I tried skipping it, but ran into another error message
saying :

///
The object RECEIPT_OF_SOURCE_DOCUMENTS does not support this operation.
///

My code looks like this :


/

wf = container.GeneralWorkflow
catalog = wf.Catalog

results = catalog.ZopeFind(wf, obj_metatypes=['Activity'], search_sub=1)


for result in results:
print result[1].id
if result[1].id  'Begin':
   object = result[1]
   container = object.aq_parent
   container.manage_renameObject(object.id, object.id.lower())

return printed 


/


Regards,
Danny

___
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] The id s5/begin contains characters illegal in URLs

2006-08-10 Thread Gabriel Genellina

At Thursday 10/8/2006 04:01, Sinang, Danny wrote:


The object RECEIPT_OF_SOURCE_DOCUMENTS does not support this operation.


You should then ask the OpenFlow guys how to rename an item.



Gabriel Genellina
Softlab SRL 






__
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas


___
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] The id s5/begin contains characters illegal in URLs

2006-08-09 Thread Andreas Jung



--On 10. August 2006 13:47:32 +0800 Sinang, Danny [EMAIL PROTECTED] 
wrote:



Hello,

I'm trying to rename an object called s5/Begin to its lower case
counterpart s5/begin by using the manage_renameObject () method, but
I'm getting the message

The id s5/begin contains characters illegal in URLs .



Because '/' is a reserved character since it is used in URLs as path 
separator.


-aj 

pgpqEk5ieyOMu.pgp
Description: PGP signature
___
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 )