Forum OpenACS Development: Extending User Properties

Collapse
Posted by Randy O'Meara on
What is the best, most elegant, way to extend user information? I would like to associate multiple additional properties with a user (a person). For example, I want to associate pager and wireless device identifiers and access methods. There may be multiple pagers, multiple cell phones, PDAs, etc and each of these may be a phone number, email address, etc. Possibly even multiple identifiers with associated access methods for each device.

Thanks,

Randy

Collapse
Posted by Talli Somekh on
I was actually just thinking about this question in terms of OACS.org. I think we should add items to the default "your workspace" like instant message IDs. The items that Randy mentions should be added as well.

talli

Collapse
Posted by Robert Locke on
Hi Randy,

It's certainly not the most elegant solution, but we add an extra table which we link to the user table.

I think the idea with the most promise is to use the acs_attributes system to manage attributes and automagically generate forms, etc.  This would require alot of work, but I hope it will find its way into a future OACS release.  Please see this thread for further info:

https://openacs.org/forums/message-view?message_id=28086

Collapse
Posted by Iuri Sampaio on
Does the latest OACS release have support to new user properties ?

What would be the best solution to extend users info?
Would plsql acs_attribute__create_attribute be useful in this case?

Best wishes,
I

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

Collapse
Posted by Gustaf Neumann on
There are several approaches for this
- ams: https://openacs.org/xowiki/ams
- dynamic types: https://openacs.org/xowiki/dynamic-types
- dynfields (in PO)
- xo dynfields https://gitlab.com/sussdorff/intranet-xotcl-dynfield

i have not used any of these, so i can't say, what's the best for your situation.

Collapse
Posted by Michael Aram on
In addition to that, you might also want to have a look at ACS Object Management. I have had a look at ams and acs-object-management some months ago. What I remember is, that I wondered why acs-object-management never made it into the core, as its approach seemed to be relatively "OpenACS-native".

Note as well, that XOTcl Core provides automatically created procs for db functions, e.g. ::xo::db::sql::acs_attribute proc create_attribute...

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