NAME

Bric::Biz::element::Parts::Data - The place where fields with in an element are registered with rules to their usage

VERSION

$Revision: 1.8 $

DATE

$Date: 2002/02/19 23:53:43 $

SYNOPSIS

$field = Bric::Biz::element::Parts::Data->new( $initial_state )

$field = Bric::Biz::element::Parts::Data->lookup( { id => $id } )

($field_list || @fields) = Bric::Biz::element::Parts::Data->list($criteria)

($ids || @ids) = Bric::Biz::element::Parts::Data->list_ids($criteria)


$id    = $field->get_id()

# Get/Set the name of this field. 
$field = $field->set_name($name)
$name  = $field->get_name()

# Get/set the description for this field.
$field = $field->set_description($description)
$desc  = $field->get_description()

# Get/Set the publishable status of this field.
$field       = $field->set_publishable(undef || 1)
(undef || 1) = $field->is_publishable()

# Get/Set the maximum length for the data in this field.
$field = $field->set_max_length($max_length)
$max   = $field->get_max_length()

# Get/Set whether this field is required or not.
$field       = $field->set_required(1 || undef)
(1 || undef) = $field->get_required()

# Get/Set the quantifier flag.
$field      = $field->set_quantifier( $quantifier )
$quantifier = $field->get_quantifier()

# Get/Set the data type (or SQL type) of this field.
$field    = $field->set_sql_type();
$sql_type = $field->get_sql_type()

# Set the active flag for this field.
$field       = $field->activate()
$field       = $field->deactivate()
(undef || 1) = $field->is_active()

(undef || $self) = $field->remove()

$field = $field->save()

DESCRIPTION

This class holds the data about data that will eventualy populate Published Assets. The name and description fields can be set as can a number of rules.

The max length field. This will allow someone to set the max length allowed for their field. It will have a rule set upon it so that the max length will not be greater than any available storage. The field length will map to what ever storarge is available for a field just larger than the one listed ( Thought needs to be given how to handle those that change their length after data has been entered as it might switch storage catagories)

The quantifier field will state whether the field may be repeated indeffinatly, zero or more times, zero or one, one, or an arbritiary number of times.

the sql type will map to a type in the DB ( varchar or date )

INTERFACE

Constructors

$field = Bric::Biz::element::Parts::Data->new( $initial_state )

creates a new element Field Part with the values associated with the initial state

Supported Keys:

Throws: NONE

Side Effects: NONE

Notes: NONE

$field = $field->copy($at_id);

Makes a copy of itself and passes back a new object. The only argument is an asset type ID. This needs to be passed since a field of one name cannot be inserted twice into the same asset type.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = Bric::Biz::element::Parts::Data->lookup( { id => $id } )

Returns an existing Asset type field object that has the id that was given as an argument

Throws: NONE

Side Effects: NONE

Notes: NONE

($parts || @parts) = Bric::Biz::element::Parts::Data->list($param)

Returns a list (or list ref) of field objects that match the criteria listed

Supported Keys:

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($ids || @ids) = Bric::Biz::element::Parts::Field->list_ids($param)
Returns the ids of the field objects that match the given criteria

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Destructors

$self->DESTROY

Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.

Public Class Methods

NONE

Public Instance Methods

$field = $field->set_publishable( 1 || undef)

Sets the flag for if this is a publishable field

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(undef || 1) = $field->get_publishable()

Returns if this is a publishable field

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->set_name( $name )

Sets the human readable field name

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$name = $field->get_name()

Returns the human readable field name

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->set_description($description)

Sets the human readable descripton for this field

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$description = $field->get_description()

Return the human readable description field

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->set_max_length( $max_length)

Set the max length in chars for this field

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$max_length $field->get_max_length()

Return the max length that has been registered

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->set_required(1 || undef)

Set the flag to make this field required ( default is not)

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(1 || undef) = $field->get_required()

Return the required flag for this field

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->set_quantifier( $reperatable )

Set the repeatability of this field options are (*, +, (0 || 1), 1). Might want to make this more friendly

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$quantifier = $field->get_quantifier()

Return the repeatablity flag

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->set_data_type()

Returns the database datatype

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$data_type = $field->set_data_type()

Returns the database datatype

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$id = $field->get_id()

Returns the database id of the field object

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$val = $element->set_attr($name, $value);
$val = $element->get_attr($name);

Get/Set attributes on this asset type.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$val = $element->set_meta($name, $field, $value);
$val = $element->get_meta($name, $field);
$val = $element->get_meta($name);

Get/Set attribute metadata on this asset type. Calling the 'get_meta' method without '$field' returns all metadata names and values as a hash.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->activate()

Makes the field object active

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->deactivate()

Makes the object inactive

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(undef || 1) = $field->is_active()

Returns 1 if active or undef otherwise

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(undef || $self) = $field->remove()

Removes this object completely from the DB. Returns 1 if active or undef otherwise

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$field = $field->save()

Saves the changes made to the database

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

PRIVATE

Private Class Methods

_do_list

called by list and list ids this does the brunt of their work

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Private Instance Methods

NONE

_select_data

Select rows from the element_data table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

_update_data

Update the element_data table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

_insert_data

Insert rows into the element_data table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Private Functions

NONE

NOTES

NONE

AUTHOR

michael soderstrom ( miraso@pacbell.net )

SEE ALSO

perl,Bric,Bric::Biz::Asset::Business::Story,Bric::Biz::AssetType,

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 456:

You forgot a '=back' before '=head2'

Around line 458:

'=item' outside of any '=over'

Around line 471:

You forgot a '=back' before '=head2'

Around line 485:

'=item' outside of any '=over'

Around line 1058:

You forgot a '=back' before '=head1'

Around line 1070:

'=item' outside of any '=over'

Around line 1183:

You forgot a '=back' before '=head2'

Around line 1229:

'=item' outside of any '=over'

Around line 1337:

You forgot a '=back' before '=head2'

Around line 1347:

=back without =over