58 |
my $self = {@_}; |
my $self = {@_}; |
59 |
bless($self, $class); |
bless($self, $class); |
60 |
|
|
61 |
|
$self->{id} = -1; |
62 |
|
|
63 |
$self ? return $self : return undef; |
$self ? return $self : return undef; |
64 |
} |
} |
65 |
|
|
66 |
|
|
67 |
=head2 add_attr |
=head2 add_attr |
68 |
|
|
69 |
|
Add an attribute. |
70 |
|
|
71 |
$doc->add_attr( name => 'value' ); |
$doc->add_attr( name => 'value' ); |
72 |
|
|
73 |
B<FIXME>: delete attribute using |
B<FIXME>: delete attribute using |
88 |
|
|
89 |
=head2 add_text |
=head2 add_text |
90 |
|
|
91 |
|
Add a sentence of text. |
92 |
|
|
93 |
$doc->add_text('this is example text to display'); |
$doc->add_text('this is example text to display'); |
94 |
|
|
95 |
=cut |
=cut |
105 |
|
|
106 |
=head2 add_hidden_text |
=head2 add_hidden_text |
107 |
|
|
108 |
|
Add a hidden sentence. |
109 |
|
|
110 |
$doc->add_hidden_text('this is example text just for search'); |
$doc->add_hidden_text('this is example text just for search'); |
111 |
|
|
112 |
=cut |
=cut |
119 |
push @{ $self->{htexts} }, _s($text); |
push @{ $self->{htexts} }, _s($text); |
120 |
} |
} |
121 |
|
|
122 |
|
=head2 id |
123 |
|
|
124 |
|
Get the ID number of document. If the object has never been registred, C<-1> is returned. |
125 |
|
|
126 |
|
print $doc->id; |
127 |
|
|
128 |
|
=cut |
129 |
|
|
130 |
|
sub id { |
131 |
|
my $self = shift; |
132 |
|
return $self->{id}; |
133 |
|
} |
134 |
|
|
135 |
=head2 dump_draft |
=head2 dump_draft |
136 |
|
|
137 |
print $doc->dump_draft; |
print $doc->dump_draft; |