[Bese-devel] Re: Adding a new slot-presentation

Marco Baringer mb at bese.it
Wed Feb 1 12:35:55 UTC 2006


Aycan iRiCAN wrote:
> Hi,
> 
> I wanted to make a textarea with a javascript wysiwyg editor (tinymce) for a simple
> content editing task. 
> 
> (ucw::defslot-presentation text-content-slot-presentation ()
>   ((cols :accessor cols :initarg :cols :initform 40)
>    (rows :accessor rows :initarg :rows :initform 20))
>   (:type-name text-content))

this looks good.

> Execution of a form compiled with errors. 
> Form: 
> (SLOT-PRESENTATIONS 
>  (STRING LABEL Title SLOT-NAME 'TITLE MAX-LENGTH 30 EDITABLEP NIL) 
>  (TEXT-CONTENT LABEL Content SLOT-NAME 'DATA EDITABLEP NIL)) 
> 
> Compile-time-error: 
> (in macroexpansion of (SLOT-PRESENTATIONS # #)) 
> (hint: For more precise location, try *BREAK-ON-SIGNALS*.) Unknown
> slot type TEXT-CONTENT.

the "Unknown slot type TEXT-CONTENT" error is given when we don't find
the mapping your-package::text-content in ucw::*slot-type-mapping*. if,
after executing the defslot-presentation-form, the
ucw::*slot-type-mapping* variable (a hash table), doesn't cantain an
entry for text-content then you've triggered a bug in ucw. not however
that ucw::*slot-type-mapping* is read at compile and not run time.

> This is probably because text-content is defined in ucw
> package. What is the proper way to add new slot-presentations?

text-content is not, unless you explicity add ucw:: in your code,
defined in the ucw package (even though it's held in a hash table bound
to a name in the ucw package) and you are, theoreticaly, doing the right
thing. could you quickly test and look at ucw::*slot-type-mapping* after
executing the defslot-presentation form?

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen




More information about the bese-devel mailing list