Jardar Maatje | 7 Oct 15:40
Favicon

Trouble with .docx files in uploads

When I upload files with QuickUpload my docx files looses their extension and I get no icon for them. When I select the file I get an error and is unable to view or download the file. (The Traceback can be found below). I just want to be able to download the file. It seems that error comes from a bug described here: http://dev.plone.org/plone/ticket/12061

 

I also looked at the mime types in ZOPE manager interface : http://myhost.mydomain/nortek/mimetypes_registry/manage_main. I got an entry for extension: docx as follows:

Name : application/vnd.openxmlformats-officedocument.wordprocessingml.document

Icon path : application.png

Binary : yes

Mime-types: application/vnd.openxmlformats-officedocument.wordprocessingml.document

Extensions: docx

Globx :

 

So my question. What can I do to solve this problem?

 

Jardar

 

 

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 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 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 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 583, in do_setLocal_tal

Module zope.tales.tales, line 696, in evaluate
URL: file:c:\plone\eggs\products.archetypes-1.6.5-py2.6.egg\Products\Archetypes\skins\archetypes\widgets\file.pt
Line 17, Column 8
Expression: <PathExpr standard:u'unit/getBestIcon | nothing'>
Names:

{'container': <PloneSite at /nortek>,

 'context': <ATFile at /nortek/innhold/transfer/finished-change-orders/changeorderct.2011-09-27.8194493135/old-ss-screens.docx>,

 'default': <object object at 0x00481748>,

 'here': <ATFile at /nortek/innhold/transfer/finished-change-orders/changeorderct.2011-09-27.8194493135/old-ss-screens.docx>,

 'loop': {},

 'nothing': None,

 'options': {'args': ()},

 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x07CF2030>,

 'request': <HTTPRequest, URL=http://wiki.nortek.no:8080/nortek/innhold/transfer/finished-change-orders/changeorderct.2011-09-27.8194493135/old-ss-screens.docx/file_view>,

 'root': <Application at >,

 'template': <FSPageTemplate at /nortek/file_view used for /nortek/innhold/transfer/finished-change-orders/changeorderct.2011-09-27.8194493135/old-ss-screens.docx>,

 'traverse_subpath': [],

'user': <PloneUser 'jardarm'>}

Module zope.tales.expressions, line 217, in __call__

Module Products.PageTemplates.Expressions, line 157, in _eval

Module Products.PageTemplates.Expressions, line 107, in render

Module Products.PageTemplates.ZRPythonExpr, line 81, in call_with_ns

Module Products.CMFCore.FSPythonScript, line 125, in __render_with_namespace__

Module Shared.DC.Scripts.Bindings, line 338, in __render_with_namespace__

Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec

Module Products.PythonScripts.PythonScript, line 344, in _exec

Module script, line 7, in getBestIcon
<FSPythonScript at /nortek/getBestIcon used for /nortek/innhold/transfer/finished-change-orders/changeorderct.2011-09-27.8194493135/old-ss-screens.docx>
Line 7

Module Products.MimetypesRegistry.MimeTypesRegistry, line 220, in lookup
__traceback_info__: ("'None'", 'None')

Module Products.MimetypesRegistry.MimeTypesRegistry, line 457, in split

MimeTypeException: Malformed MIME type (None)

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Archetypes-users mailing list
Archetypes-users@...
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Fabio | 19 Oct 23:56
Picon

Re: Manage portlets not showing up with custom content types

Do you solve this problem, I´m facing the same.
Thanks,
Fabio Cordeiro

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning <at> Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Archetypes-users mailing list
Archetypes-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Ian F. Hood | 20 Oct 15:25
Picon
Gravatar

Re: Manage portlets not showing up with custom content types

Fabio:


You need to realize the ILocalPortletAssignable. In Plone 3 it was:

from plone.portlets.interfaces import ILocalPortletAssignable

then

implements(interfaces.IMyNewClass, ILocalPortletAssignable)




~ Ian

Ian F. Hood
Office: 1 (360) 450-5900 (US)
Twitter, Skype & FB as: IanFHood
Google+ 103220441876580461422




On Wed, Oct 19, 2011 at 2:56 PM, Fabio <fcordeiro-BzaPB/T/r/+RykFJcn4EYQ@public.gmane.org> wrote:
Do you solve this problem, I´m facing the same.
Thanks,
Fabio Cordeiro




------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning <at> Ciosco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Archetypes-users mailing list
Archetypes-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/archetypes-users

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning <at> Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Archetypes-users mailing list
Archetypes-users@...
https://lists.sourceforge.net/lists/listinfo/archetypes-users
Joe Bigler | 21 Oct 15:33
Picon

Re: Manage portlets not showing up with custom content types

Yes we did.  Here are my notes and an example.  HTH

A problem with the conversion to Plone 4 is, the manage portlets and manage
viewlets did not show up in the Education Assessment content types.  They do
show up in the default Plone content types, such as folder.

It looks like the solution is to change some code in the python class
folders.  Here is the example in the CoursesFolder.py:
 
Original:
# -*- coding: utf-8 -*-
#
# File: CoursesFolder.py
#
# Copyright (c) 2010 by unknown <unknown>
# Generator: ArchGenXML Version 2.5
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """unknown <unknown>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.EducationAssessment.config import *
from Products.CMFCore.permissions import View
from Products.CMFCore.permissions import ModifyPortalContent
from Products.ATContentTypes.content.base import ATCTContent
from Products.ATContentTypes.content.schemata import ATContentTypeSchema,
finalizeATCTSchema
# from Products.CMFCore import CMFCorePermissions

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

##CoursesFolder_schema = OrderedBaseFolderSchema.copy() + \
##    schema.copy()

CoursesFolder_schema = ATContentTypeSchema.copy() + BaseFolderSchema.copy()
finalizeATCTSchema(CoursesFolder_schema, folderish=True)

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class CoursesFolder(OrderedBaseFolder, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(OrderedBaseFolder,'__implements__',()),)

    implements(interfaces.ICoursesFolder)
    # This name appears in the 'add' box
    archetype_name = 'Courses Folder'

    meta_type = 'CoursesFolder'
    portal_type = 'CoursesFolder'
    allowed_content_types = ['Course']
    filter_content_types = 1
    global_allow = 1
    #content_icon = 'Course.gif'
    immediate_view = 'courses_folder_listing'
    default_view = 'courses_folder_listing'
    suppl_views = ()
    typeDescription = "A folder that can contain courses."
    typeDescMsgId = 'description_edit_coursefolder'
    _at_rename_after_creation = True

    schema = CoursesFolder_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods

registerType(CoursesFolder, PROJECTNAME)
# end of class CoursesFolder

##code-section module-footer #fill in your manual code here
##/code-section module-footer
 
New:
# -*- coding: utf-8 -*-
#
# File: CoursesFolder.py
#
# Copyright (c) 2010 by unknown <unknown>
# Generator: ArchGenXML Version 2.5
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """unknown <unknown>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.EducationAssessment.config import *
from plone.portlets.interfaces import ILocalPortletAssignable

from Products.CMFCore.permissions import View
from Products.CMFCore.permissions import ModifyPortalContent
from Products.ATContentTypes.content.base import ATCTContent
from Products.ATContentTypes.content.schemata import ATContentTypeSchema,
finalizeATCTSchema
# from Products.CMFCore import CMFCorePermissions

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

##CoursesFolder_schema = OrderedBaseFolderSchema.copy() + \
##    schema.copy()

CoursesFolder_schema = ATContentTypeSchema.copy() + BaseFolderSchema.copy()
finalizeATCTSchema(CoursesFolder_schema, folderish=True)

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class CoursesFolder(OrderedBaseFolder, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(OrderedBaseFolder,'__implements__',()),)

    implements(interfaces.ICoursesFolder, ILocalPortletAssignable)

    # This name appears in the 'add' box
    archetype_name = 'Courses Folder'

    meta_type = 'CoursesFolder'
    portal_type = 'CoursesFolder'
    allowed_content_types = ['Course']
    filter_content_types = 1
    global_allow = 1
    #content_icon = 'Course.gif'
    immediate_view = 'courses_folder_listing'
    default_view = 'courses_folder_listing'
    suppl_views = ()
    typeDescription = "A folder that can contain courses."
    typeDescMsgId = 'description_edit_coursefolder'
    _at_rename_after_creation = True

    schema = CoursesFolder_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods

registerType(CoursesFolder, PROJECTNAME)
# end of class CoursesFolder

##code-section module-footer #fill in your manual code here
##/code-section module-footer
 
Here are the changes:
Under this line:
from Products.EducationAssessment.config import *

Add:
from plone.portlets.interfaces import ILocalPortletAssignable

Change this line:
implements(interfaces.ICoursesFolder)
To:
implements(interfaces.ICoursesFolder, ILocalPortletAssignable)
You can do the same thing to:
AccreditationBody.py
AssessmentActivity.py
Course.py
CoursesFolder.py
Sample.py
Standard.py
Section.py
 

--
View this message in context: http://plone.293351.n2.nabble.com/Manage-portlets-not-showing-up-with-custom-content-types-tp6018799p6916926.html
Sent from the Archetypes mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning <at> Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Archetypes-users mailing list
Archetypes-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/archetypes-users

Gmane