Forum OpenACS Q&A: Problem adding groups.
I've just started to look into the whole permissions/groups part of the openacs, so I'm kinda new to it.
The following may be a bug, but it may just be something I've set up on my site causing a problem.
I went to Main Site Administration, and defined a new group type. Then I tried to create a group under that. I got the following error:
ora8.c:3568:ora_tcl_command: error in `OCIStmtExecute ()': ORA- 06550: line 4, column 13:
PLS-00306: wrong number or types of arguments in call to 'NEW' ORA-06550: line 4, column 7:
PL/SQL: Statement ignored
SQL:
BEGIN
:1 := project.new(context_id => :context_id,
group_id => :group_id,
creation_user => :creation_user,
creation_ip => :creation_ip,
group_name => :group_name
);
END;
Where project is the name of the group type I defined.
When I looked at the package definition for that group type, I saw that there is a column in the function new() like so:
DN IN LDAP_ATTRIBUTES.DN%TYPE,
which isn't passed in when creating a group of that type.
I started to go through all of the code in group_type:new, and I noticed that when the package body is being created for that group type, the following tcl proc gets executed:
package_generate_body
which calls:
package_create_attribute_list
which does a SQL select:
select upper(nvl(attr.table_name,t.table_name)) as attr_table_name,
upper(nvl(attr.column_name, attr.attribute_name)) as attr_column_name,
attr.ancestor_type, attr.min_n_values, attr.default_value
from acs_object_type_attributes attr,
(select t.object_type, t.table_name, level as type_level
from acs_object_types t
start with t.object_type = :object_type
connect by prior t.supertype = t.object_type) t
where attr.ancestor_type = t.object_type
and attr.object_type = :object_type
order by t.type_level
and sure enough, this returns the DN column as an attribute for the package.
I've tried to find out what happens before this to set the values in the acs_attributes table which links the LDAP DN column as an attribute of the generated group type.
The acs_object gets created in the group_type::new but I can't seem to see where.
Anyone any idea or pointers as to why this LDAP column is getting put in with my group_type object, or as to where I the object gets created so I can find out?
Cheers,
Kevin
1.I get this error when trying to create a new group for a Group Type "Application Groups"
2. I get this error when trying to create a new group for a Group Type which I created.
3. This error does not occure when creating a new group for "Groups" Group Type.
Error log
ora8.c:3568:ora_tcl_command: error in `OCIStmtExecute ()': ORA-06550: line 4, column 13:
PLS-00306: wrong number or types of arguments in call to 'NEW'
ORA-06550: line 4, column 7:
PL/SQL: Statement ignored
SQL:
BEGIN
:1 := mygrptype.new(context_id => :context_id,
group_id => :group_id,
creation_user => :creation_user,
creation_ip => :creation_ip,
group_name => :group_name
);
END;
while executing
"ns_ora exec_plsql_bind nsdb0 {
BEGIN
:1 := mygrptype.new(context_id => :context_id,
group..."
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_ora $type $db $sql] $args"
Hi Janus,
Here are two ways that I got rid of this problem.
1. Re-install OACS, install only the packages that you need. It only appeared the first time I installed, as I did an install and mount of every package on the system.
2. When a group type is created, a table called (what_you_named_it)_EXT and a package with a new and a delete procedure get created. If you look at the new() procedure, you will notice that it is expecting a parameter for LDAP.
If you use something like toad to change your package, you can remove the parameter for LDAP.
Here is an example of what the package looks like(You need to change MY_GROUP to whatever your group_type name is). You should be able to save this to a .sql file and run sqlplus dbpass/dbpass < .sqlfile
**Note** Try to save the origional package if you can. This will overwrite it.
package my_group as --/** THIS IS AN AUTO GENERATED PACKAGE. Kevin Crosbie was the -- user who created it -- -- @creation-date 2002-04-02 --*/ function new ( GROUP_ID IN MY_GROUP_EXT.GROUP_ID%TYPE DEFAULT NULL, GROUP_NAME IN GROUPS.GROUP_NAME%TYPE, EMAIL IN PARTIES.EMAIL%TYPE DEFAULT NULL, URL IN PARTIES.URL%TYPE DEFAULT NULL, OBJECT_TYPE IN ACS_OBJECTS.OBJECT_TYPE%TYPE DEFAULT 'my_group', CREATION_DATE IN ACS_OBJECTS.CREATION_DATE%TYPE DEFAULT sysdate, CREATION_IP IN ACS_OBJECTS.CREATION_IP%TYPE DEFAULT NULL, LAST_MODIFIED IN ACS_OBJECTS.LAST_MODIFIED%TYPE DEFAULT sysdate, MODIFYING_IP IN ACS_OBJECTS.MODIFYING_IP%TYPE DEFAULT NULL, CREATION_USER IN ACS_OBJECTS.CREATION_USER%TYPE DEFAULT NULL, CONTEXT_ID IN ACS_OBJECTS.CONTEXT_ID%TYPE DEFAULT NULL, JOIN_POLICY IN GROUPS.JOIN_POLICY%TYPE DEFAULT NULL ) return MY_GROUP_EXT.GROUP_ID%TYPE; procedure delete ( GROUP_ID in MY_GROUP_EXT.GROUP_ID%TYPE ); END my_group; package body my_group as --/** THIS IS AN AUTO GENERATED PACKAGE. Kevin Crosbie was the -- user who created it -- -- @creation-date 2002-04-02 --*/ function new ( GROUP_ID IN MY_GROUP_EXT.GROUP_ID%TYPE DEFAULT NULL, GROUP_NAME IN GROUPS.GROUP_NAME%TYPE, EMAIL IN PARTIES.EMAIL%TYPE DEFAULT NULL, URL IN PARTIES.URL%TYPE DEFAULT NULL, OBJECT_TYPE IN ACS_OBJECTS.OBJECT_TYPE%TYPE DEFAULT 'my_group', CREATION_DATE IN ACS_OBJECTS.CREATION_DATE%TYPE DEFAULT sysdate, CREATION_IP IN ACS_OBJECTS.CREATION_IP%TYPE DEFAULT NULL, LAST_MODIFIED IN ACS_OBJECTS.LAST_MODIFIED%TYPE DEFAULT sysdate, MODIFYING_IP IN ACS_OBJECTS.MODIFYING_IP%TYPE DEFAULT NULL, CREATION_USER IN ACS_OBJECTS.CREATION_USER%TYPE DEFAULT NULL, CONTEXT_ID IN ACS_OBJECTS.CONTEXT_ID%TYPE DEFAULT NULL, JOIN_POLICY IN GROUPS.JOIN_POLICY%TYPE DEFAULT NULL ) return MY_GROUP_EXT.GROUP_ID%TYPE is v_GROUP_ID MY_GROUP_EXT.GROUP_ID%TYPE; begin v_GROUP_ID := acs_group.new ( group_id => new.GROUP_ID, GROUP_NAME => new.GROUP_NAME, EMAIL => new.EMAIL, URL => new.URL, OBJECT_TYPE => new.OBJECT_TYPE, CREATION_DATE => new.CREATION_DATE, CREATION_IP => new.CREATION_IP, CREATION_USER => new.CREATION_USER, CONTEXT_ID => new.CONTEXT_ID, JOIN_POLICY => new.JOIN_POLICY ); insert into MY_GROUP_EXT (GROUP_ID) values (v_GROUP_ID); return v_GROUP_ID; end new; procedure delete ( GROUP_ID in MY_GROUP_EXT.GROUP_ID%TYPE ) is begin acs_group.delete( my_group.delete.GROUP_ID ); end delete; end my_group;