cvs file import errors and doclink problems

Help
hugojoe
2010-10-13
2013-04-25
  • hugojoe
    hugojoe
    2010-10-13

    Plomino 1.7.5 svn 
    Plone4

    1. cvs with chinese contents(created in excel 2003).  Nothing imported.  Error as below:
    Traceback (innermost last):
    • Module ZPublisher.Publish, line 127, in publish
    • Module ZPublisher.mapply, line 77, in mapply
    • Module ZPublisher.Publish, line 47, in call_object
    • Module Products.CMFPlomino.PlominoReplicationManager, line 843, in manage_importation
    • Module Products.CMFPlomino.PlominoReplicationManager, line 905, in processImport
    • Module Products.CMFPlomino.PlominoReplicationManager, line 977, in parseFile
    • Module encodings.utf_8, line 16, in decode
    UnicodeDecodeError: 'utf8' codec can't decode bytes in position 3-4: invalid data

    2.1   cvs with english contents.  Import succeed.   But error as below:
    Traceback (innermost last):
    • Module ZPublisher.Publish, line 127, in publish
    • Module ZPublisher.mapply, line 77, in mapply
    • Module ZPublisher.Publish, line 47, in call_object
    • Module Products.CMFPlomino.PlominoReplicationManager, line 855, in manage_importation
    • Module Products.CMFPlomino.PlominoDesignManager, line 468, in writeMessageOnPage
    • Module Products.CMFPlone.PloneTool, line 746, in addPortalMessage
    • Module Products.statusmessages.adapter, line 34, in add
    • Module zope.i18n, line 109, in translate
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)

    2.2  I have three forms in one database(Person ,Schools and Projects. Schools and Projects have document imported through csv files.). I edit view of Schools and Projects then use them as doclinks(selection list) in view of Person.  I‘d hope to select related school and project when I  add a person. But there always be many empty documents(rows) added in the view of Person; Number of three views keeps equal always.  How can I resolve  it?

    Thanks for your patience :)

     
  • hugojoe
    hugojoe
    2010-10-14

    1. Sorry, it is csv file import errors.
    Benky52 told me to edit /plone4 path/Python-2.6/lib/python2.6/site.py (form encoding=“ascii" to encoding="utf-8" .  I will try it latter.

    2. I have three forms in one database(Person ,Schools and Projects. Schools and Projects have document imported through csv files.). I edit view of Schools and Projects then use them as doclinks(selection list) in view of Person.  I‘d hope to select related school and project when I  add a person. But there always be many empty documents(rows) added in the view of Person; Number of three views keeps equal always.  How can I resolve  it?

     
  • hugojoe
    hugojoe
    2010-10-16

    1. I open the cvs file with Ultraedit and save it using utf8.  Then It can be imported into form.  The problem is that the first column is empty. 

    2. I quit the doclink. 
    3. I am trying search form and configure document.  When I save them, they give me almost the same errors:
    **********When saving search form:***************
    Traceback (innermost last):

    Module ZPublisher.Publish, line 127, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 47, in call_object
    Module Shared.DC.Scripts.Bindings, line 324, in __call__
    Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
    Module Products.CMFCore.FSPageTemplate, line 240, in _exec
    Module Products.CMFCore.FSPageTemplate, line 180, in pt_render
    Module Products.PageTemplates.PageTemplate, line 80, in pt_render
    Module zope.pagetemplate.pagetemplate, line 115, 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 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 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 852, in do_condition
    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 852, in do_condition
    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 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 583, in do_setLocal_tal
    Module zope.tales.tales, line 696, in evaluate
    URL: file:/var/plonea/zeocluster/src/Plomino/Products/CMFPlomino/skins/cmfplomino_templates/OpenForm.pt
    Line 128, Column 24
    Expression: <PythonExpr searchviewobj.getColumns()>
    Names:
    {'container': <PloneSite at /tongji>,
    'context': <PlominoForm at /tongji/database/test-database/search>,
    'default': <object object at 0x7fb2a8be7ad0>,
    'here': <PlominoForm at /tongji/database/test-database/search>,
    'loop': {},
    'nothing': None,
    'options': {'args': ()},
    'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xc4cf310>,
    'request': <HTTPRequest, URL=http://121.8.98.85:8080/tongji/database/test-database/search/OpenForm>,
    'root': <Application at >,
    'template': <FSPageTemplate at /tongji/OpenForm used for /tongji/database/test-database/search>,
    'traverse_subpath': ,
    'user': <PropertiedUser 'admin'>}
    Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
    __traceback_info__: searchviewobj.getColumns()
    Module PythonExpr, line 1, in <expression>
    AttributeError: 'NoneType' object has no attribute 'getColumns'

    ******************When saving configure document*********************
    Traceback (innermost last):

    Module ZPublisher.Publish, line 127, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 47, in call_object
    Module Products.CMFPlomino.PlominoDocument, line 97, in checkBeforeOpenDocument
    Module Shared.DC.Scripts.Bindings, line 324, in __call__
    Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
    Module Products.CMFCore.FSPageTemplate, line 240, in _exec
    Module Products.CMFCore.FSPageTemplate, line 180, in pt_render
    Module Products.PageTemplates.PageTemplate, line 80, in pt_render
    Module zope.pagetemplate.pagetemplate, line 115, 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 852, in do_condition
    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 851, in do_condition
    Module Products.PageTemplates.Expressions, line 207, in evaluateBoolean
    Module zope.tales.tales, line 696, in evaluate
    URL: file:/var/plonea/zeocluster/src/Plomino/Products/CMFPlomino/skins/cmfplomino_templates/OpenDocument.pt
    Line 11, Column 4
    Expression: <PythonExpr here.getForm().hasGoogleVisualizationField()>
    Names:
    {'container': <PloneSite at /tongji>,
    'context': <PlominoDocument at /tongji/database/test-database/lista-1>,
    'default': <object object at 0x7fb2a8be7ad0>,
    'here': <PlominoDocument at /tongji/database/test-database/lista-1>,
    'loop': {},
    'nothing': None,
    'options': {'args': ()},
    'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x5cc15d0>,
    'request': <HTTPRequest, URL=http://121.8.98.85:8080/tongji/database/test-database/lista-1/checkBeforeOpenDocument>,
    'root': <Application at >,
    'template': <FSPageTemplate at /tongji/OpenDocument used for /tongji/database/test-database/lista-1>,
    'traverse_subpath': ,
    'user': <PropertiedUser 'admin'>}
    Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
    __traceback_info__: here.getForm().hasGoogleVisualizationField()
    Module PythonExpr, line 1, in <expression>
    AttributeError: 'NoneType' object has no attribute 'hasGoogleVisualizationField'

     
  • hugojoe
    hugojoe
    2010-10-16

    When saving configure document: I means just Add PlominoDocument.