Forum OpenACS Development: while creating a new project in ]project-open[...

In the below code (creating a new project), what 'project:::' means?

set project_id [project::new \
-project_name $project_name \
-project_nr $project_nr \
-project_path $project_path \
-company_id $company_id \
-parent_id $parent_id \
-project_type_id $project_type_id \
-project_status_id $project_status_id]

I have created the tables and functions for the new package "Activity form". The following is the sql code...

select acs_object_type__create_type (
'im_activity', -- object_type
'ARFactivity', -- pretty_name
'ARFActivities', -- pretty_plural
'im_biz_object', -- supertype
'im_activities', -- table_name
'activity_id', -- id_column
'intranet-arf', -- package_name
'f', -- abstract_p
null, -- type_extension_table
'im_activity__name' -- name_method
);

create table im_activities (
activity_id integer
constraint im_activity_pk
primary key
constraint im_activity_fk
references acs_objects,
activity_category varchar(100) not null,
activity_description varchar(4000) not null,
activity_process_desc varchar(5000) not null,
assignee_id integer ,

activity_measurement_proc varchar(5000),
earliest_time_to_measure varchar(500) not null,
start_date timestamptz,
end_date timestamptz,
attachments varchar(500) not null

);

-- ------------------------------------------------------------
-- Project Package
-- ------------------------------------------------------------

create or replace function im_activity__new (
integer, varchar, timestamptz, integer, varchar, integer,
varchar, varchar, varchar, integer, varchar, varchar, timestamptz, timestamptz, varchar
) returns integer as '
DECLARE
p_activity_id alias for $1;
p_object_type alias for $2;
p_creation_date alias for $3;
p_creation_user alias for $4;
p_creation_ip alias for $5;
p_context_id alias for $6;

p_activity_category alias for $7;
p_activity_description alias for $8;

p_activity_process_desc alias for $9;
p_assignee_id alias for $10;
p_activity_measurement_proc alias for $11;
p_earliest_time_to_measure alias for $12;
p_start_date alias for $13;
p_end_date alias for $14;
p_attachments alias for $15;

v_activity_id integer;
BEGIN
v_activity_id := acs_object__new (
p_activity_id,
p_object_type,
p_creation_date,
p_creation_user,
p_creation_ip,
p_context_id
);

insert into im_activities (
activity_id, activity_category, activity_description,
activity_process_desc, assignee_id, activity_measurement_proc, earliest_time_to_measure,
start_date, end_date, attachments
) values (
v_activity_id, p_activity_category, p_activity_description,
p_activity_process_desc, p_assignee_id, p_activity_measurement_proc, p_earliest_time_to_measure,
p_start_date, p_end_date, p_attachments
);
return v_activity_id;
end;' language 'plpgsql';

create or replace function im_activity__delete (integer) returns integer as '
DECLARE
v_activity_id alias for $1;
BEGIN
-- Erase the im_activities item associated with the id
delete from im_activities
where activity_id = v_activity_id;

-- Erase all the priviledges
delete from acs_permissions
where object_id = v_activity_id;

PERFORM acs_object__delete(v_activity_id);

return 0;
end;' language 'plpgsql';

create or replace function im_activity__name (integer) returns varchar as '
DECLARE
v_activity_id alias for $1;
v_name varchar;
BEGIN
select activity_name
into v_name
from im_activities
where activity_id = v_activity_id;

return v_name;
end;' language 'plpgsql';

And copy pasted the project creation coding, which i mentioned in the beginning and made some changes which is given below,

set activity_id [activity::new \
-activity_category $arf_category \
-activity_description $arf_description \
-activity_process_desc $arf_process_desc \
-assignee_id $arf_assignee \
-activity_measurement_proc $arf_measurement_proc \
-earliest_time_to_measure $arf_time_to_measure \
-start_date $arf_request_date \
-end_date $arf_delivery_date \
-attachments $arf_attachments]

I got the below error message, while trying to execute the above code,

invalid command name "activity::new"
while executing
"activity::new -activity_category $arf_category -activity_description $arf_description -activity_process_desc $arf_process_desc -assignee_id $arf..."
invoked from within
"set activity_id [activity::new -activity_category $arf_category -activity_description
.....

Could anyone pls help me ?

Collapse
Posted by Brian Fenton on
Hello Prabu,

I don't much about Project Open but you could try asking your question on their forum. However, the error you are seeing looks quite straightforward - you're trying to run a proc called activity::new but you haven't created it first. The 'project::new' refers to a namespace called project which contains a proc called new. So similarly, you will need a namespace called 'activity'.

hope this helps
Brian

Collapse
Posted by Prabu Thirumeni on
Created proc activity.. But still i have some problem in creating activity...

Could you please send me any official forums for ]Project-Open[ ?

Thanks Brian