[Plone-IT] Re: Digest di Plone-IT, Volume 28, Numero 29
Marco Giuliacci
emmegiuliacci a gmail.com
Mar 21 Lug 2009 10:14:52 UTC
grazie mille ragazzi mi siete stati davvero utili, controllo mysql
2009/7/21 <plone-it-request a lists.plone.org>
> Send Plone-IT mailing list submissions to
> plone-it a lists.plone.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.plone.org/mailman/listinfo/plone-it
> or, via email, send a message with subject or body 'help' to
> plone-it-request a lists.plone.org
>
> You can reach the person managing the list at
> plone-it-owner a lists.plone.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Plone-IT digest..."
>
>
> Argomenti del Giorno:
>
> 1. Voce di secondo livello selezionata (Diego Purpo)
> 2. connessione MySql (Marco Giuliacci)
> 3. Re: connessione MySql (Francesco Benincasa)
> 4. Re: connessione MySql (Vito Falco)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 20 Jul 2009 19:15:46 +0200
> From: Diego Purpo <diego.purpo a infocube.it>
> Subject: [Plone-IT] Voce di secondo livello selezionata
> To: "La lista degli italiani appassionati di Plone."
> <plone-it a lists.plone.org>
> Message-ID: <4A64A642.6080003 a infocube.it>
> Content-Type: text/plain; charset="iso-8859-15"
>
> Ciao a tutti.
> Girando in rete ho trovato una soluzione per separare il menù di secondo
> livello dal menù principale / tabs.
> Ora, vorrei riuscire ad identificare la voce di secondo livello
> selezionata per passarla alla viewlet in modo da poterla evidenziare.
>
> Questo è il codice che ho scritto. Come sempre grazie
>
> from zope.interface import implements, alsoProvides
> from zope.component import getMultiAdapter
> from zope.viewlet.interfaces import IViewlet
> from zope.deprecation.deprecation import deprecate
>
> from plone.app.layout.navigation.root import getNavigationRoot
> from plone.app.layout.globals.interfaces import IViewView
> from plone.app.layout.viewlets.common import ViewletBase
>
> from AccessControl import getSecurityManager
> from Acquisition import aq_base, aq_inner
> from Products.CMFPlone.utils import safe_unicode
> from Products.CMFPlone import utils
> from Products.CMFPlone.browser.navigation import get_url
> from Products.CMFPlone.browser.navigation import get_id
> from Products.CMFPlone.browser.navigation import get_view_url
> from Products.Five.browser import BrowserView
> from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
> from Products.CMFCore.utils import getToolByName
> from cgi import escape
> from urllib import quote_plus
>
>
> class MySubMenuViewlet(ViewletBase):
> index = ViewPageTemplateFile('submenu.pt')
>
> def update(self):
> context_state = getMultiAdapter((self.context, self.request),
> name=u'plone_context_state')
> actions = context_state.actions()
> portal_tabs_view = getMultiAdapter((self.context, self.request),
> name='portal_tabs_view')
> self.portal_tabs = portal_tabs_view.topLevelTabs(actions=actions)
>
> selectedTabs = self.context.restrictedTraverse('selectedTabs')
> self.selected_tabs = selectedTabs('index_html',
> self.context,
> self.portal_tabs)
> self.selected_portal_tab = self.selected_tabs['portal']
>
> self.context.plone_log(self.selected_portal_tab)
>
> # Ciclo su voci di primo livello
> for tab in self.portal_tabs:
>
> # Se i-esimo tab e' quello selezionato
> if tab['id']==self.selected_portal_tab:
>
> # Catturo sottomenu'
> self.portal_subtabs = self.getsubtab(self.context,tab)
>
> def getsubtab(self,context,tab):
> query={}
> result=[]
> portal_properties = getToolByName(context, 'portal_properties')
> portal_catalog = getToolByName(context, 'portal_catalog')
> navtree_properties = getattr(portal_properties,
> 'navtree_properties')
> site_properties = getattr(portal_properties, 'site_properties')
>
> rootPath = getNavigationRoot(context)
> dpath='/'.join([rootPath,tab['id']])
> query['path'] = {'query' : dpath, 'depth' : 1}
>
> query['portal_type'] = utils.typesToList(context)
>
> sortAttribute = navtree_properties.getProperty('sortAttribute',
> None)
> if sortAttribute is not None:
> query['sort_on'] = sortAttribute
>
> sortOrder = navtree_properties.getProperty('sortOrder', None)
> if sortOrder is not None:
> query['sort_order'] = sortOrder
>
> if navtree_properties.getProperty('enable_wf_state_filtering',
> False):
> query['review_state'] =
> navtree_properties.getProperty('wf_states_to_show', [])
>
> query['is_default_page'] = False
>
> if site_properties.getProperty('disable_nonfolderish_sections',
> False):
> query['is_folderish'] = True
>
> # Get ids not to list and make a dict to make the search fast
> idsNotToList = navtree_properties.getProperty('idsNotToList', ())
> excludedIds = {}
> for id in idsNotToList:
> excludedIds[id]=1
>
> rawresult = portal_catalog.searchResults(**query)
>
> # now add the content to results
> for item in rawresult:
> if not (excludedIds.has_key(item.getId) or
> item.exclude_from_nav):
> id, item_url = get_view_url(item)
> data = {'name' : utils.pretty_title_or_id(context,
> item),
> 'id' : item.getId,
> 'url' : item_url,
> 'description': item.Description}
> result.append(data)
> return result
> -------------- parte successiva --------------
> Un allegato HTML è stato rimosso...
> URL:
> http://lists.plone.org/pipermail/plone-it/attachments/20090720/529cef5e/attachment-0001.htm
>
> ------------------------------
>
> Message: 2
> Date: Tue, 21 Jul 2009 11:28:36 +0200
> From: Marco Giuliacci <emmegiuliacci a gmail.com>
> Subject: [Plone-IT] connessione MySql
> To: plone-it a lists.plone.org
> Message-ID:
> <24759c490907210228v4a02ffdeq3a47be63035d24ac a mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Devo creare una connessione MySql, carico dalla ZMI Add Z MySQL Database
> Connection ed inserisco le credenziali.
> Premetto che questa istanza di Plone gira su una virtual Mach... con OS
> CentOs il db è sulla macchina che ospita la virtual machine e mi da questo
> errore:
>
> Time 2009/07/21 11:28:31.935 GMT+2 User Name (User Id) admin (admin)
> Request
> URL http://172.16.17.129:7321/lazio/manage_addZMySQLConnection Exception
> Type OperationalError Exception Value (2003, "Can't connect to MySQL
> server
> on '172.18.13.11' (111)")
>
> Traceback (innermost last):
>
> - Module ZPublisher.Publish, line 119, in publish
> - Module ZPublisher.mapply, line 88, in mapply
> - Module ZPublisher.Publish, line 42, in call_object
> - Module Products.ZMySQLDA.DA, line 105, in manage_addZMySQLConnection
> - Module Shared.DC.ZRDB.Connection, line 67, in __init__
> - Module Shared.DC.ZRDB.Connection, line 98, in edit
> - Module Products.ZMySQLDA.DA, line 125, in connect
> - Module Products.ZMySQLDA.db, line 153, in __init__
>
> OperationalError: (2003, "Can't connect to MySQL server on '172.18.13.11'
> (111)").
>
> Vorrei sapere dove il mmio errore grazie mille...
>
> --
>
> --mArK
> _____________________________________________________
> Giuliacci Marco
> Freelancer Projects & Developer Web Applications PHP5;
> contact-email: emmegiuliacci a gmail.com
> contact-skype: markgiul77;
> -------------- parte successiva --------------
> Un allegato HTML è stato rimosso...
> URL:
> http://lists.plone.org/pipermail/plone-it/attachments/20090721/687cb5d0/attachment-0001.htm
>
> ------------------------------
>
> Message: 3
> Date: Tue, 21 Jul 2009 11:45:55 +0200
> From: Francesco Benincasa <ciccio2000 a users.sf.net>
> Subject: Re: [Plone-IT] connessione MySql
> To: plone-it a lists.plone.org
> Message-ID: <20090721094555.GC5937 a artband>
> Content-Type: text/plain; charset=us-ascii
>
> * Tuesday 21 July 2009, alle 11:28, Marco Giuliacci scrive:
> > OperationalError: (2003, "Can't connect to MySQL server on '172.18.13.11'
> > (111)").
> >
> > Vorrei sapere dove il mmio errore grazie mille...
>
> Ad occhio non sembra dipendere da Plone ma dalla configurazione di mysql o
> tutt'al piu' di rete.
>
> Semplicemente potrebbe non esser corretta la porta indicata (o mysql
> spento?).
>
> Oppure, gli altri motivi che mi vengono in mente, se plone e mysql sono su
> due
> macchine diverse:
>
> - mysql e' configurato per non accettare connessioni da IP diversi dal
> locale
> - c'e' qualche firewall di mezzo
>
> Spero di esser stato d'aiuto.
>
> --
> | Francesco Benincasa - http://ciccio2000.altervista.org/
> | EcoSCIENZE Societa' Cooperativa - http://www.ecoscienze.org/
> | Ingegneria Senza Frontiere Bologna - http://isf.ing.unibo.it/
> | Bologna Free Software Forum - http://www.bfsf.it/
> ****
> Extreme fear can neither fight nor fly.
> -- William Shakespeare, "The Rape of Lucrece"
>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 21 Jul 2009 11:47:17 +0200
> From: Vito Falco <vitofalco a gmail.com>
> Subject: Re: [Plone-IT] connessione MySql
> To: "La lista degli italiani appassionati di Plone."
> <plone-it a lists.plone.org>
> Message-ID:
> <b6636c00907210247w85c631cya35878e2b7dac747 a mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Ciao,
> se fossi in te la prima cosa che farei sarebbe controllare:
> - il firewall della distribuzione
> - il firewall del mio mac (che riserva sempre sorprese)
> - le regole di accesso al DB di MySQL stesso (di default credo accetti solo
> chiamate via localhost)
>
> Vito
>
> 2009/7/21 Marco Giuliacci <emmegiuliacci a gmail.com>
>
> > Devo creare una connessione MySql, carico dalla ZMI Add Z MySQL Database
> > Connection ed inserisco le credenziali.
> > Premetto che questa istanza di Plone gira su una virtual Mach... con OS
> > CentOs il db è sulla macchina che ospita la virtual machine e mi da
> questo
> > errore:
> >
> > Time 2009/07/21 11:28:31.935 GMT+2 User Name (User Id) admin (admin)
> Request
> > URL http://172.16.17.129:7321/lazio/manage_addZMySQLConnection Exception
> > Type OperationalError Exception Value (2003, "Can't connect to MySQL
> > server on '172.18.13.11' (111)")
> >
> > Traceback (innermost last):
> >
> > - Module ZPublisher.Publish, line 119, in publish
> > - Module ZPublisher.mapply, line 88, in mapply
> > - Module ZPublisher.Publish, line 42, in call_object
> > - Module Products.ZMySQLDA.DA, line 105, in manage_addZMySQLConnection
> > - Module Shared.DC.ZRDB.Connection, line 67, in __init__
> > - Module Shared.DC.ZRDB.Connection, line 98, in edit
> > - Module Products.ZMySQLDA.DA, line 125, in connect
> > - Module Products.ZMySQLDA.db, line 153, in __init__
> >
> > OperationalError: (2003, "Can't connect to MySQL server on '172.18.13.11'
> > (111)").
> >
> > Vorrei sapere dove il mmio errore grazie mille...
> >
> > --
> >
> > --mArK
> > _____________________________________________________
> > Giuliacci Marco
> > Freelancer Projects & Developer Web Applications PHP5;
> > contact-email: emmegiuliacci a gmail.com
> > contact-skype: markgiul77;
> >
> > _______________________________________________
> > Plone-IT mailing list
> > Plone-IT a lists.plone.org
> > http://lists.plone.org/mailman/listinfo/plone-it
> > http://www.nabble.com/Plone---Italy-f21728.html
> >
>
>
>
> --
> "Design is the method of putting form and content together. Design, just as
> art, has multiple definitions; there is no single definition. Design can be
> art. Design can be aesthetics. Design is so simple, that's why it is so
> complicated." by Paul Rand
> -------------- parte successiva --------------
> Un allegato HTML è stato rimosso...
> URL:
> http://lists.plone.org/pipermail/plone-it/attachments/20090721/d61907ea/attachment.htm
>
> ------------------------------
>
> _______________________________________________
> Plone-IT mailing list
> Plone-IT a lists.plone.org
> http://lists.plone.org/mailman/listinfo/plone-it
>
>
> Fine di Digest di Plone-IT, Volume 28, Numero 29
> ************************************************
>
--
--mArK
_____________________________________________________
Giuliacci Marco
Freelancer Projects & Developer Web Applications PHP5;
contact-email: emmegiuliacci a gmail.com
contact-skype: markgiul77;
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.plone.org/pipermail/plone-plone-it/attachments/20090721/3103690a/attachment.html>
Maggiori informazioni sulla lista
Plone-IT