1 package SL::Clipboard::RequirementSpecTextBlock;
5 use parent qw(SL::Clipboard::Base);
7 use SL::Clipboard::RequirementSpecPicture;
9 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/::RequirementSpecTextBlock$/ });
17 $tree->{pictures} = [ map { SL::Clipboard::RequirementSpecPicture->new->dump($_) } @{ $object->pictures } ];
25 return t8('Requirement spec text block "#1"; content: "#2"', $self->content->{title}, Common::truncate($self->content->{text}, strip => 'full'));
29 my ($self, $object) = @_;
31 $object->$_(undef) for qw(output_position position requirement_spec_id);
33 SL::Clipboard::RequirementSpecPicture->new->_fix_object($_) for @{ $object->pictures || [] };
47 SL::Clipboard::RequirementSpecTextBlock - Clipboard specialization for
48 SL::DB::RequirementSpecTextBlock
56 Returns a human-readable description including the title and an
57 excerpt of its content.
61 This specialization reloads C<$object> from the database, loads all of
62 its pictures and dumps it. The pictures are dumped using the clipboard
63 specialization for it, L<SL::Clipboard::RequirementSpecPicture/dump>.
65 =item C<_fix_object $object>
67 Fixes C<$object> by clearing certain columns like the position. Lets
68 pictures be fixed by the clipboard specialization for it,
69 L<SL::Clipboard::RequirementSpecPicture/_fix_object>.
79 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>