Hi.
 
I found out what my problem is.
in my code I please baseclass Item before Folder
 class ShpProjectClass(Item, Folder, Persistent, Implicit, CatalogAware):
when I change the order, it worked normally
 class ShpProjectClass(Folder, Item, Persistent, Implicit, CatalogAware):
but I don't understand why? could someone explain this to me?

----- Original Message ----
From: Allen Huang <swapp0@yahoo.com>
To: Zope <zope@zope.org>
Sent: Monday, March 12, 2007 10:31:27 AM
Subject: Re: [Zope] have problem with managing objects within a external product

Dear AJ,
 
Thanks, but I still have some problems with creating a Folderish Object product
 
I imported Folder from OFS.Folder but I wasn't able to add any products like File, Folder, Image with in my folderish object.
 
my code looks like this-->
 
class ShpProjectClass(Item, Folder, Persistent, Implicit, CatalogAware):
    id = 'ShpProject'
    meta_type = 'ShpProject'
    manage_options = (
        {'label':'Contents', 'action':'manage_main'},
        {'label':'Properties', 'action':'manage_editShpProjectForm'},
        {'label':'View', 'action':'index_html'},
        ) + Item.manage_options
   
    def __init__(self, id, projectDesc = 'Test Project'):
        """ Initialize a ShpProject Object """
        self.id = id
        self.projectDesc = projectDe
sc
 
    def getProjectInfo(self):
        """ print a ShpProject Object Info """
        return 'This project is called: ' + self.id + '. This project is about ' + self.projectName + '.'
 
    def edit(self, projectDesc, REQUEST=None):
        """ edit a ShpProject Object """
        self.projectDesc = projectDesc
        if REQUEST is not None:
            return self.index_html(self, REQUEST)
 
    ##Web Methods
    index_html = HTMLFile('DTML/index_html', globals())
    manage_editShpProjectForm = HTMLFile('DTML/manage_editShpProjectForm', globals())
 
InitializeClass(ShpProjectClass)

what else am I missing? and is using ObjectManager unsave in anyway?
 
 
----- Original Message ----
From: Andreas Jung <lists@zopyx.com>
To: Allen Huang <swapp0@yahoo.com>; Zope <zope@zope.org>
Sent: Friday, March 9, 2007 4:05:16 PM
Subject: Re: [Zope] have problem with managing objects within a external product

--On 9. März 2007 00:01:50 -0800 Allen Huang <swapp0@yahoo.com> wrote:

> I made a simple product using python that stores some varibles, but I
> couldn't make it acts like a folderish, stores objects, and have a
> content tab page using manage_main like when I use to have when I use
> internal product.
>
> I reviewed the tutorials on how to make internal products and I found the
> base class modules ObjectManager and PropertySheets under OFS folder but
> I really ahve no idea how to use them.
>
> So it I want my product to act like an internally made product with
> baseclass ObjectManager, CatalogAware, and use propertysheets to manage
> my attributes and control what object type I want to store,
>
> would importing ObjectManager, PropertySheets, CatalogAware baseclass be
> enough?

For folderish content you derive from ObjectManager or for being on the
safe side from OFS.Folder

from OFS.Folder import Folder

class MyType(Folder):

  meta_type= 'MyType'



.....

IntiializeClass(MyType)

-aj



Never miss an email again!
Yahoo! Toolbar
alerts you the instant new Mail arrives. Check it out.
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )



The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.