[Zope-dev] ZPatterns: Remapping object from on to another specialist

jimbo jimbo@tacomaplace.com
Mon, 13 Nov 2000 14:18:45 -0800


Now that the subject is on object remapping with Zpatterns. I'm not getting anywhere mapping between objects.
I have a product folder
EmployZ-Folder
 EmployZManager-Specialist
 WhoZ-Specialist
   Data Plug-ins
     myssMethod
 EmployZ-Zclass

The EmployZManager just keeps a database of employee name, ID and salary.
The WhoZ specialist keeps track of employee status like an in/out board.
 The Zclass for it is in another product.
I'm trying to get the employee name from EmployZManagerto display in my WhoZ specialist.
So I placed this skinscript in my WhoZ specialist data plugin tab.
btw description and name is a WhoZ dataskin property

myssMethod
INITIALIZE OBJECT WITH original_object=EmployZManager.newItem(self.id)

WITH EmployZManager.getItem(self.id) COMPUTE original_object=RESULT

WITH self.original_object COMPUTE name=emp_id, description=first

WHEN OBJECT ADDED,CHANGED STORE name, first USING
   self.original_object.manage_changeProperties(
   emp_id=self.name, first=self.description)

WHEN OBJECT DELETED CALL self.original_object.manage_delete()

Thanks
-Jimbo