[Archetypes-users] Manage portlets not showing up with custom content types

4 views
Skip to first unread message

Joe Bigler

unread,
Feb 12, 2011, 9:19:28 AM2/12/11
to archetyp...@lists.sourceforge.net

I have a product I am migrating from Plone 2.5 to Plone 4. It contains
several custom content types, some folderish, some not. I recreated the
product in Plone 4 using Archgenxml 2.5. Everything seems to work okay, but
I don't see Manage portlets showing up with the custom content types. It
does show up for the standard Plone types, such as folder.
@@manage-portlets doesn't work either. I get this error if I try to use it
on a custom content type:

Traceback (innermost last):
Module ZPublisher.Publish, line 116, in publish
Module ZPublisher.BaseRequest, line 513, in traverse
Module ZPublisher.HTTPResponse, line 691, in debugError
NotFound: <h2>Site Error</h2>
<p>An error was encountered while publishing this resource.
</p>
<p><strong>Debugging Notice</strong></p>

Zope has encountered a problem publishing your object.<p>
Cannot locate object at:
http://localhost:8080/Plone/educational-assessment/accreditation-bodies/council-for-accreditation-of-counseling-and-related-educational-programs/School%20Counseling/@@manage-portlets</p>
<hr noshade="noshade"/>

<p>Troubleshooting Suggestions</p>

<ul>
<li>The URL may be incorrect.</li>
<li>The parameters passed to this resource may be incorrect.</li>
<li>A resource that this resource relies on may be
encountering an error.</li>
</ul>

<p>For more detailed information about the error, please
refer to the error log.
</p>

<p>If the error persists please contact the site maintainer.
Thank you for your patience.
</p>

I am logged in as a manager. The naviagtion portlet I set up in the root
appears next to each content type, but I can't modify it or add any new
portlets. Any suggesstions are greatly appreciated.
--
View this message in context: http://plone.293351.n2.nabble.com/Manage-portlets-not-showing-up-with-custom-content-types-tp6018799p6018799.html
Sent from the Archetypes mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Archetypes-users mailing list
Archetyp...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/archetypes-users

Fabio

unread,
Oct 19, 2011, 5:56:42 PM10/19/11
to archetyp...@lists.sourceforge.net
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@Ciosco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev

Ian F. Hood

unread,
Oct 20, 2011, 9:25:13 AM10/20/11
to Fabio, archetyp...@lists.sourceforge.net
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

Joe Bigler

unread,
Oct 21, 2011, 9:33:30 AM10/21/11
to archetyp...@lists.sourceforge.net
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@Cisco Self-Assessment and learn

Reply all
Reply to author
Forward
0 new messages