Posted on 2008-06-24 00:15:51-07 by pjscott
enum customlist
Hullo. FYI, I tried to send this to maint@arsperl.org and it was rejected by the SMTP server with an access denied... I have a customer with the Remedy HelpDesk schema who is having trouble parsing it with 1.91 because it has enum types with a customList of limits rather than the expected regularList (relevant code form ARSOOform.pm below). Are there any plans to deal with that or a suggested workaround? Thanks.
if ($fv->{'dataType'} eq "enum") { if (ref($fv->{'limit'}->{'enumLimits'}) eq "ARRAY") { $enums{$_} = [@{$fv->{'limit'}->{'enumLimits'}}]; } elsif (exists $fv->{'limit'}->{'enumLimits'}->{'regularList'}) { $enums{$_} = [@{$fv->{'limit'}->{'enumLimits'}->{'regularList'}}]; } else { print "Sorry. I'm not sure what to do with non-regularLists of enums.\n"; print "(this enum is type \"", keys %{$fv->{'limit'}->{'enumLimits'}}, "\")\n"; print "listStyle = ", $fv->{'limit'}->{'enumLimits'}->{'listStyle'}, "\n"; die; } } }
Direct Responses: 10098 | Write a response
Posted on 2009-03-02 09:24:50-08 by mbeijen in response to 8133
Re: enum customlist

For customlists, the data structure is a bit different: You will find your data under customList.

The email list arsperl-users@arsperl.org is probably the best place to ask (or search) for answers.

Kind regards,

Michiel

sub enum_values ($) { my $limit = $_[0]->{'limit'}; my @values; if (ref($limit) eq 'HASH') { my $h = $limit->{'enumLimits'}; if (ref($h) eq 'HASH') { if (defined($h->{'regularList'} )){ my $z = $h->{'regularList'}; @values = @$z; } elsif (defined($h->{'customList'} )){ foreach my $item (@{$h->{'customList'}}){ $values[$item->{'itemNumber'}] = $item->{'itemName'}; } } } else { @values = @$h; } } else { @values = @$limit; } return @values; }
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.