def add_configure_file(self,path,project_name,param1='IPortalHeader',param2='IProdamPortal',param3='prodam.gerenciador.cet'): ''' This is a docstring. The following 3 lines are a doctest: >>> request.vars.name='Max' >>> index() {'name': 'Max'} ''' try: #seta nó para configuração dos namespaces configure = tree_element_first.Element('configure') configure.set('xmlns','http://namespaces.zope.org/zope') configure.set('xmlns:browser','http://namespaces.zope.org/browser') configure.set('i18n_domain','prodam.portal') #seta nó para configuração das Viewlets do Plone browser = tree_element_first.SubElement(configure,"browser:viewlet") browser.set("name",param3) browser.set("manager","plone.app.layout.viewlets.interfaces."+param1) browser.set("class",".logo.LogoViewlet") browser.set("permission","zope2.View") browser.set("layer",project_name+".interfaces."+param2) tree = tree_element_first.ElementTree(configure) configure_name = "/configure.zcml" xml_ident(configure) tree.write('sites/'+path+configure_name,encoding="utf-8") except ParseError, e: raise HTTP(500,e)
def add_profile_file(self,path): ''' This is a docstring. The following 3 lines are a doctest: >>> request.vars.name='Max' >>> index() {'name': 'Max'} ''' #seta nó para configuração dos namespaces xml_object = tree_element_first.Element('object') tree = tree_element_first.ElementTree(xml_object) configure_name = "/profiles/default/viewlets.xml" xml_ident(xml_object) tree.write('sites/'+path+configure_name,encoding="utf-8")