- Timestamp:
- 2010-03-17T12:33:06+13:00 (14 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm
r20791 r21800 75 75 'type' => "string", 76 76 'deft' => "Title" }, 77 { 'name' => "metadata_field_separator", 78 'desc' => "{HTMLPlugin.metadata_field_separator}", 79 'type' => "string", 80 'deft' => "" }, 77 81 { 'name' => "hunt_creator_metadata", 78 82 'desc' => "{HTMLPlugin.hunt_creator_metadata}", … … 923 927 return if (!defined $self->{'metadata_fields'}); 924 928 929 my $separator = $self->{'metadata_field_separator'}; 930 if ($separator eq "") { 931 undef $separator; 932 } 933 925 934 # metadata fields to extract/save. 'key' is the (lowercase) name of the 926 935 # html meta, 'value' is the metadata name for greenstone to use … … 1036 1045 # $tag = lc($tag); 1037 1046 #} 1038 1039 $doc_obj->add_utf8_metadata($section, $tag, $value); 1040 1047 if (defined $separator) { 1048 my @values = split($separator, $value); 1049 foreach my $v (@values) { 1050 $doc_obj->add_utf8_metadata($section, $tag, $v) if $v =~ /\S/; 1051 } 1052 } 1053 else { 1054 $doc_obj->add_utf8_metadata($section, $tag, $value); 1055 } 1041 1056 } 1042 1057 -
main/trunk/greenstone2/perllib/plugins/PDFPlugin.pm
r20790 r21800 72 72 'type' => "string", 73 73 'deft' => "" }, 74 { 'name' => "metadata_field_separator", 75 'desc' => "{HTMLPlugin.metadata_field_separator}", 76 'type' => "string", 77 'deft' => "" }, 74 78 { 'name' => "noimages", 75 79 'desc' => "{PDFPlugin.noimages}", … … 174 178 push(@$html_options,"-metadata_fields","Title,GENERATOR,date,author<Creator>"); 175 179 } 176 #push(@$html_options,"-metadata_fields","Title,GENERATOR,date,author<Creator>"); 180 if (defined $self->{'metadata_field_separator'} && $self->{'metadata_field_separator'} =~ /\S/) { 181 push(@$html_options,"-metadata_field_separator",$self->{'metadata_field_separator'}); 182 } 177 183 178 184 if ($self->{'use_sections'} || $self->{'description_tags'}) { -
main/trunk/greenstone2/perllib/strings.properties
r21765 r21800 923 923 HTMLPlugin.metadata_fields:Comma separated list of metadata fields to attempt to extract. Capitalise this as you want the metadata capitalised in Greenstone, since the tag extraction is case insensitive. e.g. Title,Date. Use 'tag<tagname>' to have the contents of the first <tag> pair put in a metadata element called 'tagname'. e.g. Title,Date,Author<Creator> 924 924 925 HTMLPlugin.metadata_field_separator:Separator character used in multi-valued metadata. Will split a metadata field value on this character, and add each item as individual metadata. 926 925 927 HTMLPlugin.no_metadata:Don't attempt to extract any metadata from files. 926 928
Note:
See TracChangeset
for help on using the changeset viewer.