List Info

Thread: html_info




html_info
user name
2007-04-25 13:27:37
Where's it documented what replaced the meta html_info
crap?
I don't see 'html_info' anywhere grepping through the
sources.

Re: html_info
user name
2007-04-25 13:43:46
On Apr 25, 2007, at 11:27, Scott Lanning wrote:

> Where's it documented what replaced the meta html_info
crap?
> I don't see 'html_info' anywhere grepping through the
sources.

It's gone. All that stuff was moved into  
Bric::Biz::ElementType::FieldType objects, IIRC. Compare  
Bric::SOAP::Element in 1.8 to Bric::SOAP::ElementType in
1.10.

Best,

David

Re: html_info
user name
2007-04-26 06:14:51
On Wed, 25 Apr 2007, David E. Wheeler wrote:
> On Apr 25, 2007, at 11:27, Scott Lanning wrote:
>> Where's it documented what replaced the meta
html_info crap?
>> I don't see 'html_info' anywhere grepping through
the sources.
>
> It's gone. All that stuff was moved into
Bric::Biz::ElementType::FieldType 
> objects, IIRC. Compare Bric::SOAP::Element in 1.8 to
Bric::SOAP::ElementType 
> in 1.10.

OK, thanks. I was looking in some Callback and it wasn't
making sense;
I imagine the SOAP stuff exercises most of the
functionality.

I'm trying to upgrade our templates... It's just hard
juggling "ok, that was assettype now elementtype and
no more separate element and elementtype and ...."
At least for me. I guess what I need is a mapping
from old to new. As far as I can see:

1.8:
  my $element = Bric::Biz::AssetType->lookup({id =>
$element_id});
1.10:
  my $element = Bric::Biz::ElementType->lookup({id =>
$element_id});

$element->is_active, $element->get_top_level work the
same..
get_output_channels. get_containers.

1.8:
  foreach my $data ($element->get_data) {
      my $meta = $data->get_meta('html_info');
1.10:
  foreach my $data ($element->get_field_types) {

The $data in 1.10 basically encompasses the old $data
plus the old $meta. We have these replacements (otherwise
the same):

1.8                        ===  1.10
type => $meta->      ===  ???
label => $meta->     ===  name =>
$data->get_name
default => $meta->  ===  default_val =>
$data->get_default_val
options => $meta->   ===   =>
$data->get_vals
multiple => $meta-> ===  =>
$data->get_multiple
size => $meta->    ===  length =>
$data->get_length
rows => $meta->      ===   =>
$data->get_rows
cols => $meta->      ===   =>
$data->get_rows


And for setters, it's similar, 1.8 had some things
like $data->set_key_name, $data->set_required,
$data->set_quantifier,
etc., but also the meta crap:
$data->set_attr(html_info => disp =>
$field->);
etc., which led to (I think) Sam's "my eyes are
burning!" comments.

I'll put this in the wiki, probably only for my own
reference. 

Re: html_info
user name
2007-04-26 12:36:52
On Apr 26, 2007, at 04:14, Scott Lanning wrote:

> OK, thanks. I was looking in some Callback and it
wasn't making sense;
> I imagine the SOAP stuff exercises most of the
functionality.

Right.

> I'm trying to upgrade our templates... It's just hard
> juggling "ok, that was assettype now elementtype
and
> no more separate element and elementtype and
...."
> At least for me.

They *should* be largely backward compatible. You shouldn't
have to  
do much to get your templates working, though you likely
could do a  
lot to update them to use the improved API.

> I guess what I need is a mapping
> from old to new. As far as I can see:
>
> 1.8:
>  my $element = Bric::Biz::AssetType->lookup({id
=> $element_id});
> 1.10:
>  my $element = Bric::Biz::ElementType->lookup({id
=> $element_id});

Yes, though you might want to rename the variable.

> $element->is_active, $element->get_top_level work
the same..
> get_output_channels. get_containers.

Yep.

> 1.8:
>  foreach my $data ($element->get_data) {
>      my $meta = $data->get_meta('html_info');
> 1.10:
>  foreach my $data ($element->get_field_types) {

Yes, more or less. Take a look at the bricolage.cc template
that  
generates these:

   http://www.
bricolage.cc/about/doc_models/

Especially if you compare it to earlier versions (avialble
in earlier  
bricolage.cc template tarballs, which are on the downloads
page.

> The $data in 1.10 basically encompasses the old $data
> plus the old $meta. We have these replacements
(otherwise the same):
>
> 1.8                        ===  1.10
> type => $meta->      ===  ???

What that "text" or "textarea" or
whatever? That's now in $field_type- 
 >widget_type.

> label => $meta->     ===  name =>
$data->get_name
> default => $meta->  ===  default_val =>
$data->get_default_val
> options => $meta->   ===   =>
$data->get_vals
> multiple => $meta-> ===  =>
$data->get_multiple
> size => $meta->    ===  length =>
$data->get_length
> rows => $meta->      ===   =>
$data->get_rows
> cols => $meta->      ===   =>
$data->get_rows

Yep, those look right.

> And for setters, it's similar, 1.8 had some things
> like $data->set_key_name, $data->set_required,
$data->set_quantifier,
> etc., but also the meta crap:
> $data->set_attr(html_info => disp =>
$field->);
> etc., which led to (I think) Sam's "my eyes are
burning!" comments.

Yes. No more burning eyes. 

> I'll put this in the wiki, probably only for my own
reference. 

I'm sure others will find it useful, too.

Best,

David

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )