Re: Vorhande ID's überschreiben

"Maik Derstappen, Derstappen IT" <[email protected]>
Newsgroups gmane.comp.web.zope.german
Organization Derstappen IT Consulting
Message-ID <[email protected]>
Michael Kiberu schrieb:
> Hallo,
>
> Ich hatte 300 Word Dokumente die ich nach HTML umwandeln lies. Diese
> habe ich dann über webdav als News Objekte ins Plone 3.3 geschoben und
> habe nun unpassende "short-names". Diese sind mit Leerzeichen und zum
> Teil mit Sonderzeichen. Auch die Titeln sind nicht immer optimal.
>
> Wie bringe ich plone/zope dazu, die Kurznamen für die News Artikeln
> neu zu generieren?
>
mit einem Python Script über alle Objekte laufen und die id's durch den
normalizer jagen:

schau mal hier rein: plone.i18n.normalizer
was auch interessant aussieht ist folgendes aus dem package:
plone.app.content

Title-based name chooser
------------------------

An object can also gain a name based on its title. To do so, the object
must implement or be adaptable to INameFromTitle.

    >>> from plone.app.content.interfaces import INameFromTitle

    >>> class TitleAdapter(object):
    ...     implements(INameFromTitle)
    ...     adapts(IMyType)
    ...     def __init__(self, context):
    ...         self.context = context
    ...     @property
    ...     def title(self):
    ...         return self.context.title
    >>> provideAdapter(TitleAdapter)


    >>> item = MyType("some-id")
    >>> item.title = u"My funky item"
    >>> chooser.chooseName(None, item)
    'my-funky-item'

Gruß Maik

-- 
========================================================================

Derstappen    I T  Consulting   Tel:         +49 ( 341 )   600  13  0 31
Zope/E-Mail/Backup/Monitoring   Mobil:       +49 ( 178 )   861  2    833
M a i k   D e r s t a p p e n   Fax:         +49 ( 180 ) 5 021 121 90 56
H e r l o ß s o h n s t r  12   Email:  [email protected]
0 4 1 5 5       L e i p z i g   Internet:    http://www.derstappen-it.de

========================================================================



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
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.