Hi, I am trying to build a specialist which gives me access to a facade ZClass in front of a XML file. As the XML is already stored, I do not want to store the facade ZClass. Actually, I would like it to be a base on which the skinscript of the specialist's rack can add attributes. So I created a ZClass (HumanClass) with no properties inheriting from ZObject and _ZClass_for_DataSkin. I create a specialist in which the default rack has the following properties : data plug-in : a skinscript computing attributes based on an id and the xml. storage : Class to use for stored items: HumanClass Objects are: loaded by accessing attribute nom (which is defined in the skinscript) Store 'persistent' data: Directly in this object I store no HumanClass instance and try to get an instance : specialist.getItem(anId) I always get None. Am I trying to do something impossible because of lack of understanding or am I just wrong in one property of ZClass, Specialist, Rack ? Thanks a lot -- Godefroid Chapelle BubbleNet sprl rue Victor Horta, 30 1348 Louvain-la-Neuve Belgium Tel 010 457490 Mob 0477 363942 TVA 467 093 008 RC Niv 49849
Godefroid Chapelle wrote:
data plug-in : a skinscript computing attributes based on an id and the xml.
storage : Class to use for stored items: HumanClass Objects are: loaded by accessing attribute nom (which is defined in the skinscript)
Store 'persistent' data: Directly in this object
I store no HumanClass instance and try to get an instance :
specialist.getItem(anId)
I always get None.
Am I trying to do something impossible because of lack of understanding or am I just wrong in one property of ZClass, Specialist, Rack ?
What you're doing sounds about right. What does your SkinScript look like? In the ScinScript, you need to determine what data to use based on self.id. Here's the SkinScript I use for a similar function; I'm creating "virtual" instances of one ZClass, based on instances of a different ZClass from another Specialist. In this case, the other specialist is "Responses". WITH Responses.get_data_for_code(code=self.id) COMPUTE subject_name, rater_name, relationship_name, response_code, process_step -- Steve Alexander Software Engineer Cat-Box limited
Steve Alexander wrote:
In the ScinScript, you need to determine what data to use based on self.id. Here's the SkinScript I use for a similar function; I'm creating "virtual" instances of one ZClass, based on instances of a different ZClass from another Specialist. In this case, the other specialist is "Responses".
WITH Responses.get_data_for_code(code=self.id) COMPUTE subject_name, rater_name, relationship_name, response_code, process_step
Steve, Is it possible to have a Specialist that is entirely 'virtual'? Can a Specialist be set up to use a generic DataSkin that stores attributes persistently, without having to define a ZClass at all? If so, can you describe a procedure for accomplishing this? TIA, Michael Bernstein
Steve Alexander a écrit :
Godefroid Chapelle wrote:
data plug-in : a skinscript computing attributes based on an id and the xml.
I just want to stress that I deleted every prebuilt other data plugins... My ZClass has only an empty dataskin property sheet.
storage : Class to use for stored items: HumanClass Objects are: loaded by accessing attribute nom (which is defined in the skinscript)
I have changed the load attribute to id. This helps a little : with <dtml-var "getItem(REQUEST.id)"> in the specialist, I get a <HumanClass Instance at xxx> in the HTML code. But when trying to access any attribute of the instance I get an authorization error. I remembered having seen somewhere to put a proxy role on the skinscript so I tried. With manager, I keep the same authorization error... With owner or anonymous, I get a NameError on the first name mentioned in the skinscript...
Store 'persistent' data: Directly in this object
I store no HumanClass instance and try to get an instance :
specialist.getItem(anId)
I always get None.
Am I trying to do something impossible because of lack of understanding or am I just wrong in one property of ZClass, Specialist, Rack ?
What you're doing sounds about right.
What does your SkinScript look like?
In the ScinScript, you need to determine what data to use based on self.id. Here's the SkinScript I use for a similar function; I'm creating "virtual" instances of one ZClass, based on instances of a different ZClass from another Specialist. In this case, the other specialist is "Responses".
WITH Responses.get_data_for_code(code=self.id) COMPUTE subject_name, rater_name, relationship_name, response_code, process_step
-- Steve Alexander Software Engineer Cat-Box limited
BTW Has there been a patch for an error I get when using copy or cut buttons in ZPatterns containers : Zope Error Zope has encountered an error while publishing this resource. Error Type: KeyError Error Value: manage_tabs -- Godefroid Chapelle BubbleNet sprl rue Victor Horta, 30 1348 Louvain-la-Neuve Belgium Tel 010 457490 Mob 0477 363942 TVA 467 093 008 RC Niv 49849
participants (3)
-
Godefroid Chapelle -
Michael R. Bernstein -
Steve Alexander