line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Document::TriPart::Cabinet; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
84329
|
$Document::TriPart::Cabinet::VERSION = '0.011'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Document::TriPart::Cabinet |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
8
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
1643
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use Document::TriPart::Cabinet::Document; |
13
|
|
|
|
|
|
|
use Document::TriPart::Cabinet::UUID; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Carp::Clan; |
16
|
|
|
|
|
|
|
use Path::Abstract; |
17
|
|
|
|
|
|
|
use DateTimeX::Easy; |
18
|
|
|
|
|
|
|
use File::Temp; |
19
|
|
|
|
|
|
|
use Path::Class; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has storage => qw/is ro required 1/; |
22
|
|
|
|
|
|
|
has document_class => qw/is rw required 1/, default => 'Document::TriPart::Cabinet::Document'; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub create { |
25
|
|
|
|
|
|
|
my $self = shift; |
26
|
|
|
|
|
|
|
return $self->inflate_document( uuid => Document::TriPart::Cabinet::UUID->make, @_ ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub inflate_document { |
30
|
|
|
|
|
|
|
my $self = shift; |
31
|
|
|
|
|
|
|
return $self->document_class->new( cabinet => $self, @_ ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub load { |
35
|
|
|
|
|
|
|
my $self = shift; |
36
|
|
|
|
|
|
|
my $uuid = shift; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$uuid = Document::TriPart::Cabinet::UUID->normalize( $uuid ); |
39
|
|
|
|
|
|
|
my $document = $self->inflate_document( uuid => $uuid ); |
40
|
|
|
|
|
|
|
$document->load(); |
41
|
|
|
|
|
|
|
return $document; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub edit { |
45
|
|
|
|
|
|
|
my $self = shift; |
46
|
|
|
|
|
|
|
my $uuid = shift; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
$uuid = Document::TriPart::Cabinet::UUID->normalize( $uuid ); |
49
|
|
|
|
|
|
|
my $document = $self->load( $uuid ); |
50
|
|
|
|
|
|
|
$document->edit(); |
51
|
|
|
|
|
|
|
return $document; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |
57
|
|
|
|
|
|
|
=pod |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 NAME |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Document::TriPart::Cabinet - Document::TriPart::Cabinet |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 VERSION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
version 0.011 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Robert Krimen <robertkrimen@gmail.com> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This software is copyright (c) 2011 by Robert Krimen. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
76
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|