Creating content type dynamically

Alain Hernandez Lopez ahernandezlop at estudiantes.uci.cu
Sun May 27 18:26:42 UTC 2007


Hello 

I'm trying to create content types dynamically,using the next two methods,   

    security.declarePublic('execute')
    def execute(self):
           
        contentList=[["url1","text1"],["url2","text2"]]
        self._saveDocument(contentList)

    
    security.declarePrivate('_saveDocument')
    def _saveDocument(self,downloadedDocumentList):
        """
         Para guardar el documento en la base de datos de Zope
        """             
        # se crean los contenidos descargados.
        for url, html in downloadedDocumentList:
            #crear el contenido
            id=self._generateUniqueId("DownloadedDocument")
            self.invokeFactory(type_name="DownloadedDocument", id=id)
            self[id].edit(title=url, text=html)

but when I run my product it gives to me the next bug

raise AccessControl_Unauthorized('Cannot create %s' % self.getId())
AccessControl.unauthorized.Unauthorized: Cannot create DownloadedDocument

I don't know what I have to do to resolve this error, please if anyone can help me!!!  

Saludos Alain




More information about the Product-Developers mailing list