[Zope] mxm Product
Heimo Laukkanen
huima@fountainpark.org
Thu, 14 Feb 2002 16:38:36 +0200
Hi,
I stubled into a strange problem, when I tried to start use the
mxm-Product, which is created to help the creation of new Python-based
products. I followed the example on
http://www.zope.org/Members/maxm/HowTo/easyProduct/ and created mxmItem.
It worked -- execpt that my own index_html or summary files are never
used. Meaning the output of view is allways the standard output that
mxm-product provides.
Below is my the code I have. In www-directory I have the index_html.dtml
and summary.dtml-files.
Zope 2.4.3 and Python 2.1.1. Any help or ideas where could the problem
be? Untill then I better start my product from scratch ,-(
-huima
--- mxmItem ---
from Products.mxm import mxmSimpleItem
from Globals import HTMLFile
class mxmItem(mxmSimpleItem.mxmSimpleItem):
meta_type = 'mxmItem'
_properties = (
{'id':'title', 'type':'string', 'mode':'w'},
{'id':'Summary', 'type':'text', 'mode':'w'},
{'id':'content', 'type':'text', 'mode':'w'},
{'id':'author', 'type':'string', 'mode':'w'},
)
__ac_permissions__ = mxmSimpleItem.mxmSimpleItem.__ac_permissions__ + (
# label
('View',
# methods
('summary',),
# roles
('Anonymous', 'Manager'),
),
)
# Used to view content of the object
index_html = HTMLFile('www/index_html', globals())
# Used to view content of the object
summary = HTMLFile('www/summary', globals())
#####################################################
# Constructor functions, only used when adding class
# to objectManager
def manage_addAction(self, id=None, REQUEST=None):
"Add instance to parent ObjectManager"
mxmSimpleItem.addClass(self, id, mxmItem, REQUEST)
constructors = (mxmSimpleItem.manage_addForm, manage_addAction)