Forum OpenACS Development: Re: Extending User Properties

Collapse
Posted by Iuri Sampaio on
Thanks.

I resusciated this thread wondering if there would be a similar and neat solution as cr_item's.

function content_type__create_attribute

After a quick search in the api-doc, I found
api-doc/plsql-subprogram-one?name=acs_attribute__create_attribute&type=FUNCTION

That got me wonder if there would be any acs_object_type__create_attribute ... :)

Thanks Gustaf, for the references of the packages. im_dynfields is indeed a nice and potential solution to my case. It needs a bit testing to get only intranet-core and intranet-dynfields only. I don't want to fork too much of OACS core.

Best wishes,
I

Collapse
Posted by Dave Bauer on
Actually acs_attribute__create_attribute does do what you expect. It is a lower level api, and acs-object-management was partially created as a Tcl API to those lower level functions. It also allows you to manage forms associated with groupings of attributes.
Collapse
Posted by Iuri Sampaio on
Hi Dave,

If it does the expected, the new column in the table user_preferences should be created, shouldn't it?

I explicity added the argument in the plsql function,

Example:
select acs_attribute__create_attribute(
'user',
'purchased_plan',
'text',
'Purchased Plan',
'Purchased Plans',
'user_preferences',
'purchased_plan',
null,
1,
1,
null,
null,
'f'
);

Collapse
Posted by Iuri Sampaio on
I know it wasn't designed to do so. That has been clearly written in the plsql implementation.

https://openacs.org/api-doc/plsql-subprogram-one?name=acs_attribute__create_attribute&type=FUNCTION

But why not?

Collapse
Posted by Dave Bauer on
I believe this is a bug or design oversight from back in the ACS 4.2 days.

The pl/sql functions accept a table_name parameter, but it clearly throws an error if table_name is not null. That does not make sense.

I have a set of changes that allow passing in table name to the function to allow passing in the table name. I can find those and make them available somewhere, if anyone in interested in trying to add that back into OpenACS core.

Collapse
Posted by Iuri Sampaio on
Hi Dave,
I'm interested in trying to add them. Let me know where they are available, so I'll grab those.
Best wishes,
I