Forum OpenACS Development: Re: email-image problem installing on oracel

Collapse
Posted by Miguel Marin on
OK, More information on the problem:

First I’m using the rel_types::new in an apm-callback.tcl like this:
rel_types::new email_image_rel "Email Image" "Email Images" user 0 1 content_item 0 1

in acs-subsite to create the relation when the package is installed, but when openacs is installed it shows an error with the message that acs-subsite could not be installed. The problem is that creates an autogenerated package with some duplicated parameters, so the package is created with compilation errors. If I create the relation this way (as is done with user portraits):

create table email_images (
user_id constraint email_image_fk
references users
constraint email_image_pk
primary key
);

begin
acs_rel_type.create_role('email_image', 'Email Image', 'Email Images');
acs_rel_type.create_type (
rel_type => 'email_image_rel',
pretty_name => 'Email Image',
pretty_plural => 'Email Images',
object_type_one => 'user',
role_one => 'user',
table_name => 'email_images',
id_column => 'user_id',
package_name => 'email_image_rel',
min_n_rels_one => 1,
max_n_rels_one => 1,
object_type_two => 'content_item',
min_n_rels_two => 0,
max_n_rels_two => 1
);

commit;
end;
/
show errors

the installation finish correctly but then when I user content::item::new then this function fails (It works fine in postgres). I calle content::item::new like this:

set item_id [content::item::new -name $image_name -parent_id $folder_id -content_type "email_image" -storage_type "lob" -creation_ip $creation_ip]