[Product-Developers] How to add permissions and create Zope SQL

cvielma cvielma+nable at gmail.com
Wed May 13 18:28:01 UTC 2009


I don't know where is the Extension/install.py file :S i only find it in old
products.

I inittialy had that code in the setuphandlers.py but it didn't work. I made
some changes and still doesn't work.

I have the following product "schema":

- browser/ (this work so i avoid further explanation)
- profiles/
     - default/
            - rolemap.xml (showed before)
            - import-steps.xml:
                         <?xml version="1.0"?>
                         <import-steps>
                          <import-step id="goldmine-permisos"
version="20090512-01"
                                       
handler="acmkms.goldmine.setuphandlers.createPermission"
                                        title="Crear permiso nuevo para
conexion con Goldmine">
                          </import-step>
                          <import-step id="goldmine-connect"
version="20090512-01"
                                       
handler="acmkms.goldmine.setuphandlers.createDBConnection"
                                        title="Crear conexion de base de
datos">
                          </import-step>
                         </import-steps>
- tests/
- zsql/
        - configure.zcml (just have the defult)
                          <configure
                              xmlns="http://namespaces.zope.org/zope"
                             
xmlns:browser="http://namespaces.zope.org/browser"
                              i18n_domain="acmkms.goldmine">
                          </configure>
        - goldmine_search.zsql (it's not worth to tell what's in here)
        - __init__.py (empty)
- configure.zcml:
                          <configure
                         xmlns="http://namespaces.zope.org/zope"
                         xmlns:five="http://namespaces.zope.org/five"
                        
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
                         i18n_domain="acmkms.goldmine">
                         	<!-- Include the sub-packages that use their own
configure.zcml files. -->
                             <include package=".browser" />
                             <include package=".zsql" />
                             <!-- Register the installation GenericSetup
extension profile -->
                             <genericsetup:registerProfile
                               name="default"
                               title="Goldmine"
                               directory="profiles/default"
                               description="Provee interfaces y los
requerimientos para realizar consultas a Goldmine desde ACMKMS."
                              
provides="Products.GenericSetup.interfaces.EXTENSION"
                               />
                         </configure>
- __init__.py (empty)
- setuphandlers.py
                          from Products.CMFCore.permissions import
setDefaultRoles
                          def createPermission(portal):    
                              setDefaultRoles('Goldmine: Consultar', ())
                          def createDBConnection(portal):
             
portal.manage_addProduct['ZMySQLDA'].manage_addZMySQLConnection('goldmineConect','Conexion
MySQL Goldmine', 'bd user password', 'YES')

It still tells me ValueError: The permission <em>Goldmine: Consultar</em> is
invalid.

Thanks for your quick help. What have i wrong or what did i forgot to do?

Greetings,


Andreas Jung-5 wrote:
> 
> On 13.05.09 19:59, cvielma wrote:
>> No no no. That's not what i meant.
>>
>> I mean, i have 2 problems:
>> - One: i want to create a Zope Database Connection. I do in the
>> __init__.py:
>>
>> def initialize(context):
>>
>> context.manage_addProduct['ZMySQLDA'].manage_addZMySQLConnection('goldmineConect','Conexion
>> MySQL Goldmine', 'goldmine root pacm,Io09', 'YES')
>>   
> 
> This makes no sense. Such code belongs into Extensions/Install.py or
> within
> setuphandlers.py as part of the Generic Setup profile of your plone
> product.
> 
> 
> -aj
> 
> begin:vcard
> fn:Andreas Jung
> n:Jung;Andreas
> org:ZOPYX Ltd. & Co. KG
> adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
> email;internet:info at zopyx.com
> title:CEO
> tel;work:+49-7071-793376
> tel;fax:+49-7071-7936840
> tel;home:+49-7071-793257
> x-mozilla-html:FALSE
> url:www.zopyx.com
> version:2.1
> end:vcard
> 
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
> 
> 

-- 
View this message in context: http://n2.nabble.com/How-to-add-permissions-and-create-Zope-SQL-tp2885223p2885715.html
Sent from the Product Developers mailing list archive at Nabble.com.





More information about the Product-Developers mailing list