Monthly Archives: October 2007

Understanding the ]po[ Data modell: Links / Menus

Table “public.im_menus” Description: Contains all menu items Open questions: Table “public.im_menus” Column | Type | Modifiers —————-+————————-+——————— menu_id | integer | not null package_name | character varying(200) | not null label | character varying(200) | not null name | character varying(200) | not null url | character varying(200) | not null sort_order | integer | [...]

Basics Programming: ]po[ Plugins

What is a ]po[ Plugin? Plugins are components that can be included in nearly all ]po[ page. They provide information (such as lists) or functionality related to information. How are permissions managed? tbc. How are they included in pages? Where are they located in the data modell? Plugins are stored in the table ‘im_component_plugins’: Table [...]

Understanding Permissions: Objects, Parties, Privileges

What are ]po[ privileges? Privileges allow a user to perform a certain operation in the system. Find more information about privileges in the po-dev-openacs-developersguide.061201a.doc or in OpenACS Permissions Tediously Explained. Sample:Setting privileges on a component -- ----------------------------------------------------- -- Add privileges for freelance_skills -- create or replace function inline_0 () returns integer as ' declare v_count [...]

Understanding the ]po[ Data Modell: Permissons

Groups: CREATE TABLE groups ( group_id int4 NOT NULL, group_name varchar(1000) NOT NULL, join_policy varchar(30) NOT NULL DEFAULT ‘open’::character varying, CONSTRAINT groups_pk PRIMARY KEY (group_id), CONSTRAINT groups_group_id_fk FOREIGN KEY (group_id) REFERENCES parties (party_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT groups_join_policy_ck CHECK (join_policy::text = ‘open’::text OR join_policy::text = ‘needs approval’::text OR [...]

Basics Programming: The page contract

ad_page_contract { Add or remove “Menu” permissions (permissions for members of one group to manage the members of another group). @author Frank Bergmann (frank.bergmann@project-open.com) @author Juanjo Ruiz (juanjoruizx@yahoo.es) } { horiz_group_id:integer object_id:integer action { return_url “index”} }

Basics Programming: How to create a plugin?

create or replace function inline_0 () returns integer as ‘ declare v_count integer; begin select count(*) into v_count from im_component_plugins where lower(plugin_name) = lower(”Task Members”); IF 0 != v_count THEN return 0; END IF; PERFORM im_component_plugin__new ( null, — plugin_id ”acs_object”, — object_type now(), — creation_date null, — creation_user null, — creation_ip null, — context_id [...]

Basics Programming: How to delete a plugin?

create or replace function im_component_plugin__del_module (varchar) returns integer as ‘ DECLARE p_module_name alias for $1; row RECORD; BEGIN for row in select plugin_id from im_component_plugins where package_name = p_module_name loop delete from im_component_plugin_user_map where plugin_id = row.plugin_id; PERFORM im_component_plugin__delete(row.plugin_id); end loop; return 0; end;’ language ‘plpgsql’;

]po[ Object Modell – Costs

insert into acs_object_type_tables (object_type,table_name,id_column) values (‘im_invoice’, ‘im_invoices’, ‘invoice_id’); – upgrade-3.2.3.0.0-3.2.4.0.0.sql – Add a new column “cost_id” to im_hours, in order – to store the associated cost item: alter table im_hours add cost_id integer; alter table im_hours add constraint im_hours_cost_fk foreign key (cost_id) references im_costs; – Set the “cause_object_id” of all existing timesheet – cost items [...]