# Create with a random id newId = context.generateUniqueId('Folder') # Create an object of type Folder context.invokeFactory(id=newId, type_name='Folder') newFolder = getattr(context,newId) # create a new Document type newFolder.invokeFactory(id='index.html', type_name='Document') # get the new page newPage = getattr(newFolder, 'index.html') newPage.edit('html', '
This is the default page.
') # return something back to the calling script return "Done"