Re: [Zope-CMF] Accessing the "context"

2007-10-30 Thread robert rottermann
Wichert Akkerman schrieb:
> Previously Charlie Clark wrote:
>> Am 30.10.2007 um 17:04 schrieb Andrew Sawyers:
>>
>>> If it's in a content type's class, why not:
>>> id = getattr(self, 'da_id', None)
>>> Just using self as the context should be fine.
>>> -- that of course presumes that the type is wrapped properly when  
>>> you call that within your method.
>> mm, currently getting None back so I guess I'm not wrapping things  
>> properly.
>>
>> This is a skeleton bit of code:
>>
>> class ContentType(PortalContent):
>> """A content type with access to an external database"""
>>
>> def __init__(self, id):
>>  self.id = id
>> DA = getattr(self, 'MyDA', None)
>>  #self.conn = DA() # not working at the moment because DA is None
>>
>> Is it wrong to try and do this in my __init__ ? Regarding your other  
>> suggestion: yes, I probably will factor this out into a utility once  
>> I've worked out how to access the DA!!!
> 
> __init__ is indeed the wrong place: when the instance is created it is
> not placed in an acquisition context yet.

there are two places where you can put your code, in both cases
acquisition is fully functional.
if it is ATContentTyoe based you can add a method:

#
# AT specific, called after creation of the final
# instance
#
security.declarePrivate('at_post_create_script')
def at_post_create_script(self, member_id=None):
da = getattr(self, 'MyDA', None)

or if it is a "mere" CMF content type:

def manage_afterAdd(self, item, container):
"""
Add self to the catalog.
(Called when the object is created or moved.)
"""
da = getattr(self, 'MyDA', None)


robert
begin:vcard
fn:Robert  Rottermann
n:Rottermann;Robert
tel;work:++41 31 333 10 20
tel;fax:++41 31 333 10 23
tel;home:++41 31 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Accessing the "context"

2007-10-30 Thread robert rottermann
Charlie Clark schrieb:
> Dear all,
> 
> a simple question with hopefully a simple answer! How do I access
> objects from an object's context or hierarchy? Specifically I'd like to
> be able to access a ZopeDA connection for a site. 

I
>
if you know the id of the object you are looking for beforehand you can
get it by just requesting it from the context like:

da = getattr('my_da_or_what_ever', context, None)
if da:
  ...

s it correct that I
> have to register this somewhere to be able to access it from a portal
> object?
>
no

hth
robert
begin:vcard
fn:Robert  Rottermann
n:Rottermann;Robert
tel;work:++41 31 333 10 20
tel;fax:++41 31 333 10 23
tel;home:++41 31 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] regarding REQUEST

2007-09-11 Thread robert rottermann
mrajasekhar schrieb:
> def fun1(self):
>  REQUEST=self.REQUEST
>  fun2=self.veiws.fun3
>  return fun2(self,REQUEST=REQUEST)
> 
> what is the meaning of REQUEST=self.REQUEST in the above function.what 
> is it doing and iam returning fun2 to the browser
> please explain me in detail
> ___
> Zope-CMF maillist  -  Zope-CMF@lists.zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See http://collector.zope.org/CMF for bug reports and feature requests
> 
this is such a basic question, that I higly recommend that you look at
http://www.plope.com/Books/2_7Edition

in short: the request is a dictionary like object that gives access to
all data pertaining to the communication between the client and the server.

you can easily have a detailed look at it with a page template like the
following:


  



  


hth
robert
begin:vcard
fn:Robert  Rottermann
n: Rottermann;Robert
email;internet:[EMAIL PROTECTED]
tel;work:++41 31 333 10 20
tel;fax:++41 31 333 10 23
tel;home:++41 31 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] ActionInfo doku?

2006-12-04 Thread robert rottermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

hi there,
I would like (for a long time actually) understand the
ActionInfo set of tools and classes.

is there some doku somewhere.

thanks
robert

ps:the reason I am trying to grasp the FTI just now, is that I get
an unicode error in a security check, and I just do not find where/why
it happens.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFFdGD0GaryJ0T9kUYRAqTBAJ4rTmj+ta2F6FFHFqVNpKcgVLWnewCcCbRQ
gkniAypeTgHw2Q3tdVluny8=
=9do9
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Re: Five: question on zcml

2006-03-29 Thread robert rottermann

Tres,
thanks for your answer,

the solution was more subtle (or blunt ??).

There was an acitons.ActionsToolXMLAdapter defined.
However the loading of the module failed due to bad imports.

thanks again
robert

Tres Seaver wrote:

The factory for the adapter is identified using a "relative" lookup when
its dotted name starts with a period.  You have a module,
Products.RedPick.exportimport.actions, but it doesn't have that class.
Products.CMFCore.exportimport.actions *does* have it.  You need to either:

  - Point to the one in CMFCore, e.g.:
factory="Products.CMFCore.exportimport.acitons.ActionsToolXMLAdapter

  - Import it or override it in your local actions module.

Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEKp0W+gerLs4ltQ4RAoRTAKDZ8974r3lqGuWqla5EWukE7zMgqACbBHcz
8QIkWjWQIdUo75CXv32eLKw=
=cu9G
-END PGP SIGNATURE-

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

  


begin:vcard
fn:robert  rottermann
n:rottermann;robert 
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Five: question on zcml

2006-03-28 Thread robert rottermann

Hi there,

I'd like to use GenericSetup in one of our tools.
In this tool I have a directory exportimpot with a config.zcml and 
actions.py

(everithing copied from CMFCore actually)

ther is a class declaration for ActionsToolXMLAdapter in
importexport.actions.py

Why do I get the traceback at the end of this email?

thanks for pointers
Robert


config.zcml:

*http://namespaces.zope.org/zope";
   xmlns:five="http://namespaces.zope.org/five";
   *>*

  **

**

exportimport.config.zcml
http://namespaces.zope.org/zope";
   >

 
...
when I start Zope I get the following error:
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File 
"/home/zope/instances/fifve/Products/Five/skel/site.zcml", line 13.2-13.23
   ZopeXMLConfigurationError: File 
"/home/zope/instances/fifve/Products/RedPick/configure.zcml", line 
10.2-10.36
   ZopeXMLConfigurationError: File 
"/home/zope/instances/fifve/Products/RedPick/exportimport/configure.zcml", 
line 5.2-10.8
   ConfigurationError: ('Invalid value for', 'factory', 'Module 
Products.RedPick.exportimport.actions has no global 
ActionsToolXMLAdapter in .actions.ActionsToolXMLAdapter')




begin:vcard
fn:robert  rottermann
n:rottermann;robert 
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Re: GenericSetup and Zope 2.8.5

2006-03-26 Thread robert rottermann



You need to register the IBody adapter for your content object.  For
example, see the GenericSetup/PythonScripts/configure.zcml, which has:

 http://namespaces.zope.org/zope";
xmlns:five="http://namespaces.zope.org/five";
>

  

   ...

Tres.
- --
  

thanks a lot
I see I have to dig into Five first.

How does Five know, that it should read my config file ?

robert
begin:vcard
fn:robert  rottermann
n:rottermann;robert 
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] GenericSetup and Zope 2.8.5

2006-03-26 Thread robert rottermann

Hi there,
I started to look into GenerigSetup.
Wat I would like to to is to replace  functionalities we have in a 
similar product of our own (RedPick)

with GernericSetup.

Now my first question:
Does GenericSetup work with Zope 2.8.5 at all?

If yes:
in an instance of  class of which the the relevant part is attach at the 
end of this email

I call XX.exportSiteToFile(..)
It works insofar as I can call it from our tool (in a Plone 2.1.2 Site) 
and it

does not generate any errors. However it does not produce any output.

I debugged it as far as
   GenericSetup.utils.exportObjects
  ..
  exporter = zapi.queryMultiAdapter((obj, context), IBody)
  ..
  body = exporter.body

body is None therefor nothing happens.

Now my question:
   what do I have to do to get an exporter with a body?


thanks
robert

Here the class definition:

has_setup_tool = 0
*try*:
   from Products import GenericSetup
   *try*:
   from Products.CMCore.exportimport import actions
   from Products.CMCore.exportimport import typeinfo
   has_setup_tool = 1
   *except*:
   /# verbatim copy of exportimport from/
   /# Plone.2.5 CMFCore /
   *try*:
   from Products.RedPick.exportimport import actions
   from Products.RedPick.exportimport import typeinfo
   has_setup_tool = 1
   *except*:
   *pass*
*except*:
   *pass*


*class* handle_action_properties( handle_base ):
   "RedPick handler for action properties."

   /# interface to CMFSetup/
   *def* exportSiteToFile( self, **kwargs ):
   "Export current site information to external file."
   /#return self.writeToFile( self.getFromSite( **kwargs ) )/
   *if* has_setup_tool:
   context = 
GenericSetup.context.DirectoryExportContext(self.portal.red_pick_tool, 
os.path.split(self.filename)[0])
   actions.exportActionProviders(context)


  ...

begin:vcard
fn:robert  rottermann
n:rottermann;robert 
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] RFC: PAS and the (non?) future of members

2006-02-03 Thread robert rottermann

Rob,

we are in the midst off creating a Zope/Plone structure for a cluster of 
Universities here in Switzerland.
I have been using CMF-Member in a number of sites and have never been 
happy with it. This stems mainly from the fact that I used a very early 
version for which no clean upgrade path ever existed.


I really would like to propose to use membrane for this project (and its 
many subprojects).


The target release date for the sites is mid 2006. Now my question:

Do you expect membrane to be in a solid state by then?
We would of course be contributing as much as we can and the project 
would be a perfect testbed.


However I need a strategy how we could go live in mid 2006 without using 
membrane . (and without redoing to much).


We (probably) will be using Zope 2.9x and Plone 2.1x.
There will be a cluster of Zope sites/subsites but all of them should be 
using a shared user management system.


I really would like to hear your oppinion.

Robert

PS:And we are also redoing one of the sites using CMFMember and I am 
looking for an exit strategy for that as well (however no migration of 
existing user data is planned)




Rob Miller wrote:

hi all,

i'm wondering if it's not time to rethink the entire idea of members as
they currently exist in CMF.  members were originally a necessary evil,
because the user folder implementation of users didn't allow for enough
flexibility to support CMF's needs.  now, however, PAS makes it possible
to encapsulate all of the necessary behaviour in the user objects
themselves, and it should be possible to eliminate the complexity of
wrapping the user object altogether.

over the last few days at the snow sprint here in austria i've been
working on a Plone-based product called Membrane.  Membrane implements PAS
plugins which allow portal content to be used as the authentication,
property, group, role, etc. providers for users.  it's quite nice, i
think, very flexible and powerful, and i think it contains ideas that
might do well in CMF itself.

even if the content-based plug-ins are not desireable, i think it's still
worth investigating the use of PAS and the idea of deprecating the
member/user duality altogether.  anyone else interested in this approach?

-r


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

  


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Re: Re: Re: RFC: PAS and the (non?) future of members

2006-02-02 Thread robert rottermann

Rob Miller wrote:

On Fri, 03 Feb 2006 00:38:07 +, Jens Vagelpohl wrote:
  

On 3 Feb 2006, at 00:31, Rob Miller wrote:


I mean sticking Plone-only stuff onto something that's a simple user
folder and should be completely agnostic of how it is used.


oh, i see.  did i imply that Plone-only behaviour should be dropped into
the CMF?  i'm not detecting some prejudice that might possibly be
causing certain readers to jump to conclusions about my proposal, am i? 
;-)
  

Did I say CMF? No, I did not. I said PAS.



whatever.  i still don't think that justifies a back-handed insult when
there was nothing in my proposal that implied that i wanted to move
  

rob,
we German native speakers are used to word our opinions much more 
directly that Americans.
I believe for a German speaker there is not a trace of insult in what 
jens expressed.


just trying to bridge a cultural gap
robert

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Help with Frostbite

2005-10-17 Thread robert rottermann

sureshvv wrote:
I installed Frostbite managed to complete most of the Installation 
steps from the README.txt file.


I am stuck on step 7.

> 7. Add an instance of your generated product's class to the skins 
tool of your >site.


The skins tool (portal_skins folder, i assumed) has only 2 items  in 
the dropdown:


1. Filesystem directory view
2. Skin custom folder

So how do I add an instance of my generated product's class?

Any and all help appreciated.

Suresh

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


do you have SpeedPack installed?
then you can not add any elements but the two types you mentioned.

I had the same situation,  and helped myself by adding the frostbyte 
stuff to a directory in custom.

You the have to adjust skinpath properties.

robert
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] How to take advantage of the CachingPolicyManager improvements

2005-09-27 Thread robert rottermann

What version of squid do I need?
2.4x or 3.x
thanks
Robert

Geoff Davis wrote:

I have some fairly extensive documentation and some demonstration code
that shows how to make good use of the recent improvements to the CMF's
CachingPolicyManager.  The documentation and code target Plone, but I
believe that most, if not all, of the code should run on CMF as-is.  The
docs talk a lot about squid, but there is much to be gained by setting up
good caching policies even if you don't use squid.

 ---

CacheFu is a how-to and collection of products that will let you
dramatically speed up your site.  CacheFu shows you how to configure squid
and your site in such a way that (1) the load on Zope is minimized, and
(2) overall bandwidth is reduced, (3) users do not receive stale pages
when your site's content changes.

The how-to tells how to make the most of the caching policy features
recently incorporated into the CMF and how to configure squid effectively
for your site (no more dual-urls a la www.plone.org / members.plone.org!)
The package contains sample squid configurations for 2 different setups,
an improved version of CMFSquidTool, and a refactored version of
ETagCacheManager (now called PageCacheManager).

CacheFu is still beta quality code, but most of its elements are
running on a production site with no problems.  The how-to contains
extensive information on testing the components of the suite.  Bug fixes
are welcome!

CacheFu is in the collective:

svn co http://svn.plone.org/svn/collective/CacheFu/trunk/CacheFu

The system is complex, but well-documented.  READ THE ENTIRE README.TXT
BEFORE YOU ASK ANY QUESTIONS.

Enjoy

Geoff


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

 


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] CPSWorkflow documentation

2005-06-17 Thread robert rottermann

thanks very much,
I read the documentation and it sounds *VERY* good.

We created several "collaborative" workflows and would have dearly loved 
the feature set offered by

CPSWorkFlow.

Now a question: What is NOT available of the features described in the 
document when a CMF/Plone site is used ?


Robert

Anahide Tchertchian wrote:

Hi,

A documentation for the CPSWorkflow product is now available.
You can find it at the following URL:
http://www.cps-project.org/sections/documentation/developers/cpsworkflow/switchLanguage/en 


A Zope product comes with this documentation, as it is constructed as a
tutorial. Here is the introduction:

The purpose of this documentation is to explain how to setup workflows
using CPSWorkflow.
CPSWorkflow is an extension of the DCWorkflow product, providing some
additional features that will be explained in this document. CPSWorkflow
is a CPS core component that can be used as well within a CMF or
CMFPlone instance, even if some features are not available outside of 
CPS.

Concepts and terms used about workflows will be presented in the first
chapter, and a sample workflow will be detailed in the second chapter.
The appendix gives additional technical information about workflows
implementation.

Any kind of feedback is very welcome.

Regards,



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests