1 package SL::Clipboard::RequirementSpecPicture;
 
   5 use parent qw(SL::Clipboard::Base);
 
   8 use SL::Locale::String;
 
  12   my ($self, $object) = @_;
 
  14   $self->reload_object($object);
 
  16   my $tree    = $self->as_tree($object, exclude => sub { ref($_[0]) !~ m/::RequirementSpecPicture$/ });
 
  17   $tree->{$_} = encode_base64($tree->{$_}, '') for $self->_binary_column_names('SL::DB::RequirementSpecPicture');
 
  25   return t8('Requirement spec picture "#1"', $self->content->{description} ? $self->content->{description} . ' (' . $self->content->{picture_file_name} . ')' : $self->content->{picture_file_name});
 
  29   my ($self, $object) = @_;
 
  31   $object->$_(undef) for qw(number);
 
  32   $object->$_(decode_base64($object->$_)) for $self->_binary_column_names('SL::DB::RequirementSpecPicture');
 
  46 SL::Clipboard::RequirementSpecPicture - Clipboard specialization for
 
  47 SL::DB::RequirementSpecPicture
 
  51 The underlying RDBO model contains binary columns, but binary data
 
  52 cannot be dumped as YAML. Therefore the binary content is encoded in
 
  53 Base64 in L</dump> and decoded back to binary form in L</_fix_object>.
 
  61 Returns a human-readable description including the title and an
 
  62 excerpt of its content.
 
  66 This specialization reloads C<$object> from the database, and dumps
 
  67 it. Binary columns are dumped encoded in Base64.
 
  69 =item C<_fix_object $object>
 
  71 Fixes C<$object> by clearing certain columns like the number. Also
 
  72 decodes binary columns from Base64 back to binary.
 
  82 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>