Re: Help needed for Plone 5

Timo Stollenwerk <tisto-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
Am 16.12.2014 um 15:40 schrieb espen:
> Hi...
> 15. des. 2014 kl. 09:10 skrev Timo Stollenwerk-2 [via Plone] <[hidden
> email] </user/SendEmail.jtp?type=node&node=7573039&i=0>>:
> 
>> Am 15.12.2014 um 08:40 schrieb Yuri:
>>
>> > Il 13/12/2014 09:07, Timo Stollenwerk ha scritto:
>> >> Hi,
>> >>
>> >> do you want to help making Plone 5 ready for a beta release by working
>> >> on some easy tasks? You will also learn some things about how Plone
>> 5 works!
>> >>
>> >> Here is how it goes:
>> >>
>> >> The mail control panel has been moved from storing its settings in the
>> >> mailhost and portal object to storing the settings in
>> plone.app.registry.
>> >>
>> >> The old way of setting/getting the mailhost settings was:
>> >>
>> >>     from Products.CMFCore.utils import getToolByName
>> >>     from zope.component.hooks import getSite
>> >>
>> >>     portal = getSite()
>> >>     mailhost = getToolByName(portal, 'MailHost')
>> >>     mailhost.smtp_host = 'localhost'
>> >>     mailhost.smtp_port = 25
>> >>     mailhost.smtp_user_id = '<a
>> href="x-msg://41/user/SendEmail.jtp?type=node&amp;node=7573035&amp;i=0" target="_top"
>> rel="nofollow" link="external">[hidden email]'
>> >>     mailhost.smtp_pass = 'secret'
>> >>
>> >>     portal.email_from_address = '<a
>> href="x-msg://41/user/SendEmail.jtp?type=node&amp;node=7573035&amp;i=1" target="_top"
>> rel="nofollow" link="external">[hidden email]'
>> >>     portal.email_from_name = 'me'
>> >>
>> >> The new way is:
>> >>
>> >>     from Products.CMFPlone.interfaces import IMailSchema
>> >>     from plone.registry.interfaces import IRegistry
>> >>     from zope.component import getUtility
>> >>
>> >>     registry = getUtility(IRegistry)
>> >>     mail_settings = registry.forInterface(IMailSchema, prefix='plone')
>> >>     mail_settings.smtp_host = u'localhost'
>> >>     mail_settings.smtp_port = 25
>> >>     mail_settings.smtp_user_id = u'<a
>> href="x-msg://41/user/SendEmail.jtp?type=node&amp;node=7573035&amp;i=2" target="_top"
>> rel="nofollow" link="external">[hidden email]'
>> >>     mail_settings.smtp_pass = u'secret'
>> >>     mail_settings.email_from_address = '<a
>> href="x-msg://41/user/SendEmail.jtp?type=node&amp;node=7573035&amp;i=3" target="_top"
>> rel="nofollow" link="external">[hidden email]'
>> >>     mail_settings.email_from_name = u'plone@rulez' 
> 
> Is this better than using plone.api ?
> I tcould be done like this:
> 
> from plone import api
> someThing = api.portal.get_registry_record(‘ISomeSchema.somefield')

We will use the plone.api lookup as the recommended way for 3rd party
products.

BTW: The intention of my post was to ask for help, not to start a
discussion or ask for opinions. This all has been discussed and decided
in the FWT long time ago.

Timo

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.