How to use the Attributes table?

In the RT 3.2.2 release notes, it says:

* RT now provides an 'Attributes' table, which allows local

developers
to easily extend all of RT’s database tables with new read/write
attributes without needing to modify RT’s core schema

But I can’t seem to find any documentation on the Wiki site specifying
how to use this table. Can someone please direct me to the appropriate
document?

Thanks.

In the RT 3.2.2 release notes, it says:

* RT now provides an 'Attributes' table, which allows local

developers
to easily extend all of RT’s database tables with new read/write
attributes without needing to modify RT’s core schema

But I can’t seem to find any documentation on the Wiki site specifying
how to use this table. Can someone please direct me to the appropriate
document?

perldoc <RT_DIR>/lib/RT/Attributes.pm

(and Attributes_Overlay.pm, Attribute.pm, Attribute_Overlay.pm)

Andy Harrison

At Tuesday 12/14/2004 03:15 PM, Kumar, Vasanth wrote:

In the RT 3.2.2 release notes, it says:

* RT now provides an 'Attributes' table, which allows local

developers
to easily extend all of RT’s database tables with new read/write
attributes without needing to modify RT’s core schema

But I can’t seem to find any documentation on the Wiki site specifying
how to use this table. Can someone please direct me to the appropriate
document?

Thanks.

An example - I’ve used attributes to store additional user preferences:

my $attr = new RT::Attribute($session{‘CurrentUser’});
my @results = $attr->Create (Name => $Name, # Name of the atribute
Content =>
$Value, # Value you want to store
ContentType => $ValueType, # I
used "String"
Object =>
$Object); # Object you want to attach the
attribute to (in
my case a RT::User object)

To retrieve the attribute(s):

my @attrs = $Object->Attributes->Named($Name);

Where $Object is the user’s RT::User object and $Name is the attribute name.

Steve

Don’t you need to associate the attribute with an ObjectId?On Thu, Dec 16, 2004 at 10:12:41AM -0500, Stephen Turner wrote:

At Tuesday 12/14/2004 03:15 PM, Kumar, Vasanth wrote:

In the RT 3.2.2 release notes, it says:

  • RT now provides an ‘Attributes’ table, which allows local
    developers
    to easily extend all of RT’s database tables with new read/write
    attributes without needing to modify RT’s core schema

But I can’t seem to find any documentation on the Wiki site specifying
how to use this table. Can someone please direct me to the appropriate
document?

Thanks.

An example - I’ve used attributes to store additional user preferences:

my $attr = new RT::Attribute($session{‘CurrentUser’});
my @results = $attr->Create (Name => $Name, # Name of the
atribute
Content =>
$Value, # Value you want to store
ContentType => $ValueType, # I
used "String"
Object =>
$Object); # Object you want to attach the
attribute to (in
# my case a RT::User object)

To retrieve the attribute(s):

my @attrs = $Object->Attributes->Named($Name);

Where $Object is the user’s RT::User object and $Name is the attribute name.

Steve


Rt-devel mailing list
Rt-devel@lists.bestpractical.com
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

At Thursday 12/16/2004 09:42 AM, Todd Chapman wrote:

Don’t you need to associate the attribute with an ObjectId?

my $attr = new RT::Attribute($session{‘CurrentUser’});
my @results = $attr->Create (Name => $Name, # Name of the
atribute
Content
=> $Value, # Value you want to store
ContentType => $ValueType, #
I used "String"
Object => $Object); #
Object you want to attach the
attribute to (in my case a RT::User object)

Well, with an object, strictly speaking - in my case I was attaching the
attribute to a user, so I passed in the RT::User object to the attribute’s
Create method. Alternatively you could pass Object ID & Object Type to the
Create method.

Steve