Giter Club home page Giter Club logo

plone.app.contenttypes's Introduction

https://api.travis-ci.org/plone/plone.app.contenttypes.png?branch=master

plone.app.contenttypes provides default content types for Plone based on Dexterity.

It contains the following types:

  • Collection
  • Document
  • Event
  • File
  • Folder
  • Image
  • Link
  • News Item

These types are editable and extendable through-the-web and you can add or remove fields and behaviors using the control-panel "Dexterity Content Types" (/@@dexterity-types).

This package is included in Plone 6 and does not need installation.

Schemata that are defined in XML-files using plone.supermodel allow editing those types' schemata through the web. This is the case for the default File, Image and Link content types. Schemata coming from behaviors, on the other hand, are not editable through the web. The Document, News Item, Folder and Event default types, for example, have no schemata of their own at all, all their fields are provided by behaviors.

You have several options:

  1. Extend the types through-the-web by adding new fields or behaviors in the types-controlpanel /@@dexterity-types.

  2. Extend the types with a custom type-profile that extends the existing profile with behaviors, or fields.

    You will first have to add the type to your [yourpackage]/profiles/default/types.xml.

    <?xml version="1.0"?>
    <object name="portal_types" meta_type="Plone Types Tool">
      <object name="Folder" meta_type="Dexterity FTI" />
    </object>

    Here is an example that enables the image-behavior for Folders in [yourpackage]/profiles/default/types/Folder.xml:

    <?xml version="1.0"?>
    <object name="Folder" meta_type="Dexterity FTI">
     <property name="behaviors" purge="False">
      <element value="plone.app.contenttypes.behaviors.leadimage.ILeadImage"/>
     </property>
    </object>

    By adding a schema-definition to the profile you can add fields.

    <?xml version="1.0"?>
    <object name="Folder" meta_type="Dexterity FTI">
     <property name="model_file">your.package.content:folder.xml</property>
     <property name="behaviors" purge="False">
      <element value="plone.app.contenttypes.behaviors.leadimage.ILeadImage"/>
     </property>
    </object>

    Put the schema-xml in your/package/content/folder.xml (the folder content needs a __init__.py)

    <model xmlns:security="http://namespaces.plone.org/supermodel/security"
           xmlns:marshal="http://namespaces.plone.org/supermodel/marshal"
           xmlns:form="http://namespaces.plone.org/supermodel/form"
           xmlns="http://namespaces.plone.org/supermodel/schema">
      <schema>
        <field name="teaser_title" type="zope.schema.TextLine">
          <description/>
          <required>False</required>
          <title>Teaser title</title>
        </field>
        <field name="teaser_subtitle" type="zope.schema.Text">
          <description/>
          <required>False</required>
          <title>Teaser subtitle</title>
        </field>
        <field name="teaser_details" type="plone.app.textfield.RichText">
          <description/>
          <required>False</required>
          <title>Teaser details</title>
        </field>
      </schema>
    </model>

You could alternatively override the property model_file of the type-definition with a empty string and use the property schema to provide your custom python-schema.

For more complex features you should always consider create custom behaviors and/or write your own content-types since that will most likely give you more flexibility and less problem when you want to upgrade to a newer version in the future.

For more information on custom dexterity-types and custom behaviors please read the dexterity documentation.

If you changed the base-class of existing types (e.g. because you changed them to be folderish) you also need to upgrade the base-class of existing objects. You can use the following form for this: @@base_class_migrator_form.

This form lets you select classes to be updated and shows the number of objects for each class. This form can be used to change the base-class of any dexterity-types instances. The migration will also transform itemish content to folderish content if the new class is folderish. You might want to use the method plone.app.contenttypes.migration.dxmigration.migrate_base_class_to_new_class in your own upgrade-steps.

Contributors please read the document Process for Plone core's development

Sources are at the Plone code repository hosted at Github.

GNU General Public License, version 2

plone.app.contenttypes's People

Contributors

1letter avatar agitator avatar ale-rt avatar cekk avatar csenger avatar datakurre avatar davisagli avatar do3cc avatar ericof avatar esteele avatar fgrcon avatar gbastien avatar gforcada avatar hvelarde avatar jaroel avatar jensens avatar joka avatar kroman0 avatar lentinj avatar mauritsvanrees avatar mmulich avatar pabo3000 avatar pbauer avatar petschki avatar reinhardt avatar saily avatar thet avatar tisto avatar vangheem avatar vincentfretin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plone.app.contenttypes's Issues

Improve migrations

Migrate Content-Types

[link: migrate all items]

Existing content:

  • ATDocument: 330 link: migrate ATDocuments
  • ATEvent: 120 link: migrate ATEvent
  • (...)

Content extended trough archetypes.schemaextender:

  • some Content

options:

  • migrate references (default: on)
  • migrate content that was extended trough archetypes.schemaextender (You will lose the data in the in the extended Fields)

Some Documentation:

  • Note about LinguaPlone
  • Note about how long it might take
  • Link to Documentation on how to write your own migration for your schema-extended content

Output after running:
Successfully migrated xxx objects
xxx Documeents were migrated
xxx Objects werde not migrated because...

Error-Messages

Form validation error for event type

This can be closed if the event type is scrapped in favour of plone.app.event.

When editing an event (I noticed it for the date fields and the event URL field), I get instances of this error:

2013-01-24 14:14:07 ERROR Zope.SiteErrorLog 1359033247.270.538704078821 http://localhost:8080/procyon/events/kss_z3cform_inline_validation
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module , line 5, in wrapper
Module kss.core.actionwrapper, line 231, in apply
Module plone.app.z3cform.kss.validation, line 60, in validate_input
ValueError: invalid literal for int() with base 10: '#fieldsetlegend-default'

Migration writes out logs with severity ERROR in Products.ZCatalog

The migration runs and on the console log I gets lots (like after each migrated item) of messages like:

ERROR Products.ZCatalog A different document with value '2c9ac6a4e1df4ce6a0f5b6acd19fa612' already exists in the index.'

Afterwards the migration seems to succeed, but I fear I missed something?

The "View" tab does not link to "/view" like AT-content does.

I have never met a use for this. It could be easily changed (by adding '/view' to the url_expr of the action). I just doubt it serves any purpose (with collections it does not work since view is a 'zope.traversing.namespace.view object at ...').

Image Upload button disabled in IE

  1. Using Dexterity.
  2. In IE9 (at least), create new item (such as News or Page).
  3. Click image icon on editor
  4. Attempt to click "Upload" link to upload new image

Expected Result: Form for uploading new image would display to user.

Actual Result: Nothing happens.

upload

in tests: file.html is deleted

I have really no good idea why this happens. But I refactored the tests so plone.namedfile.file.NamedBlobFile gets an open file to consume the data from. The tests are working, except that the file is deleted after NamedFile read from a file thats opened in mode 'r' for read. So running the test a second time will fail. Therefore I added a check at the very end of the test to check if the file exists.

I would be happy if someone with deeper insight on plone.namedfile looks at it, so this is really odd behavior. I fear its only a side effect and the real bug is somehwere else and not in p.a.c - but since it starts here I report here.

I added the scenario to the tests - including a comment - here.

https://github.com/plone/plone.app.contenttypes/blob/master/plone/app/contenttypes/tests/test_indexes.py#L206

Add a "Location" field to match archetypes

The location field is not part at the metadata-behavior in dx. My guess is that was a consious design-decision in dexterity. We could add this to all types (it is only a stringfield) but I'd like to hear from the framework-team if this is really wanted.

Instance refuses to start with Python 2.6

https://github.com/plone/plone.app.contenttypes/blob/master/plone/app/contenttypes/browser/migration.py

uses collections.Counter which was introduced in Python 2.7:

http://docs.python.org/2/library/collections.html

Therefore starting a Plone instance with Python 2.6 fails:

ZopeXMLConfigurationError: File "/srv/www/dkg-staging/krebswegweiser/src/plone.app.contenttypes/plone/app/contenttypes/configure.zcml", line 44.2-44.32
ZopeXMLConfigurationError: File "/srv/www/dkg-staging/krebswegweiser/src/plone.app.contenttypes/plone/app/contenttypes/browser/configure.zcml", line 119.2-125.6
ImportError: cannot import name Counter

does not work with plone4.3x

plone app contenttypes tries to load collective.dexteritytextindexer
however this module does not load under plone4.3

atct_album_view is broken

steps to reproduce:

  1. create new site
  2. add folder
  3. add image to folder
  4. switch to view "Album"
Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
  Module ZPublisher.Publish, line 46, in call_object
  Module Products.Five.browser.metaconfigure, line 476, in __call__
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
   - Warning: Macro expansion failed
   - Warning: <type 'exceptions.KeyError'>: 'atct_topic_view'
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 954, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 946, in do_defineSlot
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
  Module zope.tales.tales, line 696, in evaluate
   - URL: /Users/philip/workspace/plone.app.contenttypes/plone/app/contenttypes/browser/templates/atct_album_view.pt
   - Line 9, Column 0
   - Expression: <PythonExpr (here.atctListAlbum(images=1, folders=1, subimages=0, others=1))>
   - Names:
      {'args': (),
       'container': <Folder at /Plone/asd>,
       'context': <Folder at /Plone/asd>,
       'default': <object object at 0x10403db70>,
       'here': <Folder at /Plone/asd>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x1091753c0>,
       'request': <HTTPRequest, URL=http://localhost:8080/Plone/asd/atct_album_view>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x107a67750>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /Users/philip/workspace/plone.app.contenttypes/plone/app/contenttypes/browser/templates/atct_album_view.pt object at 0x109c2e6d0>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x1090baa50>}
  Module zope.tales.pythonexpr, line 59, in __call__
   - __traceback_info__: (here.atctListAlbum(images=1, folders=1, subimages=0, others=1))
  Module <string>, line 1, in <module>
AttributeError: atctListAlbum

Should not depend on Archetypes

plone.app.contenttypes currently has a transitive dependency on Archetypes, via plone.app.referenceablebehavior. This behavior is currently only used for Folders. Who can tell me why it was decided to enable it for Folders? We should get rid of that if possible so that plone.app.contenttypes can be the default content type set for Plone 5 without pulling in Archetypes.

Missing tests for image-migration

migrations are there but I'm having a problem with the tests. I did not manage to create a real ATBlobFile object to test the migration on.

at_blobfile = self.createATCTobject(ATBlob, 'file')

was not enough.

making everything folderish?

Since this will be a major upgrade, what does everyone think about making all types folderish? Or at the very least, making the page type folderish? We could then get rid of the Folder type too.

This is going to be part of a major plone upgrade so IMO it's fine to change the behavior. Then we could finally stop training people on how to create a folder and then set a page inside the folder as the default view of the folder.

unify collection schema to xml, so its all the same for all types

Currently at https://github.com/plone/plone.app.contenttypes/blob/master/plone/app/contenttypes/content.py#L24 the collection schema is defined, while all other schemas are xml based in https://github.com/plone/plone.app.contenttypes/tree/master/plone/app/contenttypes/schema

I think we should unify this an make the collection schema also xml based.

This reduces confusion and makes p.a.ct easier to understand for other developers.

Sharing tab is no longer working after migration

After migration the sharing tab fails with traceback if there where locals roles set on the item:

Traceback (innermost last):

Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module plone.app.workflow.browser.sharing, line 59, in __call__
Module Products.Five.browser.pagetemplatefile, line 125, in __call__
Module Products.Five.browser.pagetemplatefile, line 59, in __call__
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module zope.pagetemplate.pagetemplate, line 240, in __call__
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 946, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
Module zope.tales.tales, line 696, in evaluate
URL: /opt/eca/RC/eggs/plone.app.workflow-2.1.5-py2.7.egg/plone/app/workflow/browser/sharing.pt
Line 67, Column 8
Expression: <PathExpr standard:u'view/role_settings'>
Names:

{'args': (),
 'container': <Collage at /Plone/mitarbeiter/startseite>,
 'context': <Collage at /Plone/mitarbeiter/startseite>,
 'default': <object object at 0xb7531818>,
 'here': <Collage at /Plone/mitarbeiter/startseite>,
 'loop': {},
 'nothing': None,
 'options': {},
 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x1132bbe4>,
 'request': <HTTPRequest, URL=https://root.rc.eca1.zoplo.com/Plone/mitarbeiter/startseite/@@sharing>,
 'root': <Application at >,
 'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x122873ac>,
 'traverse_subpath': [],
 'user': <PropertiedUser 'admin'>,
 'view': <Products.Five.metaclass.SharingView object at 0x122871ac>,
 'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x1183130c>}

Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 155, in _eval
Module Products.PageTemplates.Expressions, line 117, in render
Module plone.memoize.instance, line 51, in memogetter
Module plone.app.workflow.browser.sharing, line 157, in role_settings
Module plone.memoize.instance, line 51, in memogetter
Module plone.app.workflow.browser.sharing, line 223, in existing_role_settings

TypeError: can only concatenate list (not "tuple") to list

EtagSupport for files

While writing the migration I saw that AT FileFields store etags:

(Pdb) pp self.old.getField('file').get(self.old).__dict__
{'_EtagSupport__etag': 'ts59196707.53',
 '__name__': 'file',
 'content_type': 'text/plain',
 'data': 'dummydata',
 'filename': 'third',
 'precondition': '',
 'size': 9,
 'title': ''}

No idea if we need that to support something like webdav or caching.

AttributeError: 'NoneType' object has no attribute '_getReferenceAnnotations during migration

2013-04-09 16:36:20 ERROR OFS.subscribers _delObject() threw
Traceback (most recent call last):
  File "/Users/philip/.cache/buildout/eggs/Zope2-2.13.19-py2.7.egg/OFS/subscribers.py", line 155, in callManageBeforeDelete
    ob.manage_beforeDelete(item, container)
  File "/Users/philip/.cache/buildout/eggs/Products.Archetypes-1.8.7-py2.7.egg/Products/Archetypes/BaseContent.py", line 51, in manage_beforeDelete
    BaseObject.manage_beforeDelete(self, item, container)
  File "/Users/philip/.cache/buildout/eggs/Products.Archetypes-1.8.7-py2.7.egg/Products/Archetypes/BaseObject.py", line 170, in manage_beforeDelete
    Referenceable.manage_beforeDelete(self, item, container)
  File "/Users/philip/.cache/buildout/eggs/Products.Archetypes-1.8.7-py2.7.egg/Products/Archetypes/Referenceable.py", line 295, in manage_beforeDelete
    self.deleteReferences()
  File "/Users/philip/.cache/buildout/eggs/Products.Archetypes-1.8.7-py2.7.egg/Products/Archetypes/Referenceable.py", line 63, in deleteReferences
    return tool.deleteReferences(self, relationship)
  File "/Users/philip/.cache/buildout/eggs/Products.Archetypes-1.8.7-py2.7.egg/Products/Archetypes/ReferenceEngine.py", line 354, in deleteReferences
    self._deleteReference(b)
  File "/Users/philip/.cache/buildout/eggs/Products.Archetypes-1.8.7-py2.7.egg/Products/Archetypes/ReferenceEngine.py", line 564, in _deleteReference
    annotation = sobj._getReferenceAnnotations()
AttributeError: 'NoneType' object has no attribute '_getReferenceAnnotations'

Image-migration not working

The migration is not happening. The images are still plone.app.blob.interfaces.IATBlob and Products.ATContentTypes.interfaces.interfaces.IATContentType

Can't start instance when using master of p.a.contenttypes.

Just wanted to put it somewhere, will do some more research and complete the issue.

Got following traceback:

2013-04-08 07:22:51 INFO ZServer HTTP server started at Mon Apr  8 07:22:51 2013
    Hostname: 0.0.0.0
    Port: 8080
Traceback (most recent call last):
  File "/Users/daniel/Workspace/my.package/parts/instance/bin/interpreter", line 337, in <module>
    exec(compile(__file__f.read(), __file__, "exec"))
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
    run()
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/run.py", line 22, in run
    starter.prepare()
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/__init__.py", line 86, in prepare
    self.startZope()
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/Startup/__init__.py", line 262, in startZope
    Zope2.startup()
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/startup.py", line 118, in startup
    load_zcml()
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/startup.py", line 52, in load_zcml
    load_site()
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/Zope2/App/zcml.py", line 46, in load_site
    _context = xmlconfig.file(site_zcml)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 649, in file
    include(context, name, package)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/Users/daniel/Workspace/.buildout/eggs/Zope2-2.13.19-py2.7.egg/OFS/metaconfigure.py", line 46, in loadProducts
    xmlconfig.include(_context, zcml, package=product)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/Users/daniel/Workspace/.buildout/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 104, in includePluginsDirective
    includeZCMLGroup(_context, info, filename)
  File "/Users/daniel/Workspace/.buildout/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
    include(_context, filename, includable_package)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/Users/daniel/Workspace/.buildout/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 54, in includeDependenciesDirective
    includeZCMLGroup(_context, info, 'configure.zcml')
  File "/Users/daniel/Workspace/.buildout/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
    include(_context, filename, includable_package)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/daniel/Workspace/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/Users/daniel/Workspace/.buildout/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/zcml.py", line 51, in includeDependenciesDirective
    info = DependencyFinder(dist).includableInfo(['configure.zcml', 'meta.zcml'])
  File "/Users/daniel/Workspace/.buildout/eggs/z3c.autoinclude-0.3.4-py2.7.egg/z3c/autoinclude/dependency.py", line 24, in includableInfo
    module = resolve(dotted_name)
  File "/Users/daniel/Workspace/.buildout/eggs/zope.dottedname-3.4.6-py2.7.egg/zope/dottedname/resolve.py", line 38, in resolve
    __import__(used)
  File "/Users/daniel/Workspace/.buildout/eggs/collective.dexteritydiff-0.1b4-py2.7.egg/collective/dexteritydiff/__init__.py", line 2, in <module>
    from .compounddiff import DexterityCompoundDiff
  File "/Users/daniel/Workspace/.buildout/eggs/collective.dexteritydiff-0.1b4-py2.7.egg/collective/dexteritydiff/compounddiff.py", line 2, in <module>
    from .binarydiff import DexterityBinaryDiff
  File "/Users/daniel/Workspace/.buildout/eggs/collective.dexteritydiff-0.1b4-py2.7.egg/collective/dexteritydiff/binarydiff.py", line 3, in <module>
    from .filefields import named_file_as_str, is_same
  File "/Users/daniel/Workspace/.buildout/eggs/collective.dexteritydiff-0.1b4-py2.7.egg/collective/dexteritydiff/filefields.py", line 9, in <module>
    if field.HAVE_BLOBS:
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/daniel/Workspace/my.package/parts/instance/etc/site.zcml", line 16.2-16.23
    ZopeXMLConfigurationError: File "/Users/daniel/Workspace/.buildout/eggs/Products.CMFPlone-4.3rc1-py2.7.egg/Products/CMFPlone/configure.zcml", line 98.4-102.10
    ZopeXMLConfigurationError: File "/Users/daniel/Workspace/my.package/src/my/package/configure.zcml", line 8.4-8.39
    ZopeXMLConfigurationError: File "/Users/daniel/Workspace/my.package/devsrc/plone.app.contenttypes/plone/app/contenttypes/configure.zcml", line 10.2-10.37
    AttributeError: 'module' object has no attribute 'HAVE_BLOBS'

plone-content installation step broken

Breaks when default site language includes a territory.

Traceback:

2012-08-28 15:28:43 ERROR Zope.SiteErrorLog 1346160523.880.0856174562525 http://localhost:8080/i18ntest/portal_setup/manage_importAllSteps
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
Module ZPublisher.Publish, line 46, in call_object
Module Products.GenericSetup.tool, line 549, in manage_importAllSteps
Module Products.GenericSetup.tool, line 353, in runAllImportStepsFromProfile

  • traceback_info: profile-plone.app.contenttypes:plone-content
    Module Products.GenericSetup.tool, line 1123, in _runImportStepsFromContext
    Module Products.GenericSetup.tool, line 1036, in _doRunImportStep
  • traceback_info: plone.app.contenttypes--plone-content
    Module plone.app.contenttypes.setuphandlers, line 130, in importContent
    Module plone.app.contenttypes.setuphandlers, line 79, in _get_locales_info
    UnboundLocalError: local variable 'target_language' referenced before assignment

document view dies in 4.2 & 4.3 if context is not a dexterity type

The condition marked below with <----------- needs a |nothing added

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      metal:use-macro="context/main_template/macros/master"
      i18n:domain="plone">
<body>

<metal:content-core fill-slot="content-core">
    <metal:content-core define-macro="content-core">
        <tal:comment replace="nothing">
          This is fixed in dexterity trunk 
          http://code.google.com/p/dexterity/issues/detail?id=200 and 
          tal:condition="context/text" should be removed after the next release of dexterity.
        </tal:comment>
        <div id="parent-fieldname-text"
             tal:condition="context/text|nothing" <------------------------
             tal:content="structure context/text/output" />
    </metal:content-core>
</metal:content-core>

</body>
</html>

Traceback (innermost last):

Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 237, in _exec
Module Products.CMFCore.FSPageTemplate, line 177, in pt_render
Module Products.PageTemplates.PageTemplate, line 79, in pt_render
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 946, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 851, in do_condition
Module Products.PageTemplates.Expressions, line 205, in evaluateBoolean
Module zope.tales.tales, line 696, in evaluate
URL: file:/home/zope/energieclusterR5/src/plone.app.contenttypes/plone/app/contenttypes/skins/templates/document_view.pt
Line 17, Column 8
Expression: <PathExpr standard:u'context/text'>
Names:

{'container': <ATDocument at /ecweb/ecweb5/front-page>,
 'context': <ATDocument at /ecweb/ecweb5/front-page>,
 'default': <object object at 0x7f4430dda4e0>,
 'here': <ATDocument at /ecweb/ecweb5/front-page>,
 'loop': {},
 'nothing': None,
 'options': {'args': ()},
 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xa7030a8>,
 'request': <HTTPRequest, URL=http://ecweb5.energie-cluster.ch/front-page/document_view>,
 'root': <Application at >,
 'template': <FSPageTemplate at /ecweb/ecweb5/front-page/document_view>,
 'traverse_subpath': [],
 'user': <SpecialUser 'Anonymous User'>}

Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 147, in _eval
Module zope.tales.expressions, line 124, in _eval
Module Products.PageTemplates.Expressions, line 74, in boboAwareZopeTraverse
Module OFS.Traversable, line 317, in restrictedTraverse
Module OFS.Traversable, line 285, in unrestrictedTraverse
__traceback_info__: ([], 'text')

AttributeError: text

Error in NewsItemIntegrationTest

When running the test cases from plone.app.contentypes the NewsItemIntegrationTest throws an error:

Error in test test_view (plone.app.contenttypes.tests.test_news_item.NewsItemIntegrationTest)
Traceback (most recent call last):
  File "/home/plone/plone.app.contenttypes/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/home/plone/plone.app.contenttypes/plone/app/contenttypes/tests/test_news_item.py", line 88, in test_view
    self.assertTrue(view())
  File "/home/plone/plone.app.contenttypes/eggs/plone.autoform-1.3-py2.7.egg/plone/autoform/view.py", line 46, in __call__
    self._update()
  File "/home/plone/plone.app.contenttypes/eggs/plone.autoform-1.3-py2.7.egg/plone/autoform/view.py", line 56, in _update
    self.updateWidgets()
  File "/home/plone/plone.app.contenttypes/eggs/z3c.form-2.8.2-py2.7.egg/z3c/form/form.py", line 135, in updateWidgets
    self.widgets.update()
  File "/home/plone/plone.app.contenttypes/eggs/z3c.form-2.8.2-py2.7.egg/z3c/form/field.py", line 243, in update
    if not dm.canWrite():
  File "/home/plone/plone.app.contenttypes/eggs/z3c.form-2.8.2-py2.7.egg/z3c/form/datamanager.py", line 95, in canWrite
    context = self.adapted_context
  File "/home/plone/plone.app.contenttypes/eggs/z3c.form-2.8.2-py2.7.egg/z3c/form/datamanager.py", line 59, in adapted_context
    context = self.field.interface(context)
TypeError: ('Could not adapt', <NewsItem at /plone/news_item>, <InterfaceClass plone.dexterity.schema.generated.plone_0_News_1_Item>)


  Ran 71 tests with 0 failures and 1 errors in 8.332 seconds.

Translate everything

Most of the strings used in the schemata already exist in the i18n-domain 'atcontenttypes'. The corresponding po-file holds 176 different values. Should we use this domain, create a new domain and copy the neccessary translations or use 'plone' like the skin-templates in CMFPlone do?

Fix Flake8/McCabe code violations

Flake8/McCabe currently complains about three methods:

Flake8. [ FAILURE ]
/home/timo/workspace/plone/plone.app.contenttypes/plone/app/contenttypes/setuphandlers.py:165:1: C901 'importContent' is too complex (14)
/home/timo/workspace/plone/plone.app.contenttypes/plone/app/contenttypes/migration/browser.py:89:1: C901 'MigrateFromATContentTypes.call' is too complex (10)
/home/timo/workspace/plone/plone.app.contenttypes/plone/app/contenttypes/migration/migration.py:34:1: C901 'restoreReferences' is too complex (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.