Changeset 10499
- Timestamp:
- 2005-08-12T11:41:08+12:00 (19 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/GenericList.pm
r10498 r10499 71 71 'desc' => "{GenericList.sort_leaf_nodes_using}", 72 72 'type' => "metadata", 73 'deft' => "Title" } ]; 73 'deft' => "Title" }, 74 { 'name' => "use_hlist_for", 75 'desc' => "{GenericList.use_hlist_for}", 76 'type' => "string" } ]; 74 77 75 78 my $options = { 'name' => "GenericList", … … 101 104 my $partition_size_within_level = $self->{'partition_size_within_level'}; 102 105 my $sort_leaf_nodes_using = $self->{'sort_leaf_nodes_using'}; 106 my $use_hlist_for = $self->{'use_hlist_for'}; 103 107 104 108 # The metadata elements to use (required) … … 113 117 if (!$buttonname) { 114 118 # Default: the first metadata element specified 115 my $firstmetagroupfirstelem = (split(/\ ,/, $metalist[0]))[0];119 my $firstmetagroupfirstelem = (split(/\;/, $metalist[0]))[0]; 116 120 $buttonname = $self->generate_title_from_metadata($firstmetagroupfirstelem); 117 121 } … … 128 132 } 129 133 130 # How the items are grouped into hlists 134 # Whether to use an hlist or a vlist for each level in the hierarchy 135 foreach my $metagroup (@metalist) { 136 $self->{$metagroup . ".use_hlist"} = "f"; 137 } 138 foreach my $metagroup (split(/\,/, $use_hlist_for)) { 139 $self->{$metagroup . ".use_hlist"} = "t"; 140 } 141 142 # How the items are grouped into partitions 131 143 if (!$partition_type_within_level) { 132 144 # Default: none … … 135 147 $self->{"partition_type_within_level"} = $partition_type_within_level; 136 148 137 # The number of items in each group149 # The number of items in each partition 138 150 if (!$partition_size_within_level) { 139 151 # Default: 20 … … 160 172 my @sort_leaf_nodes_usingmetalist = ( "Title" ); 161 173 if ($sort_leaf_nodes_using) { 162 @sort_leaf_nodes_usingmetalist = split(/\ ;/, $sort_leaf_nodes_using);174 @sort_leaf_nodes_usingmetalist = split(/\|/, $sort_leaf_nodes_using); 163 175 } 164 176 $self->{'sort_leaf_nodes_usingmetalist'} = \@sort_leaf_nodes_usingmetalist; … … 204 216 205 217 # Only classify the document if it has a value for one of the metadata elements in the first group 206 foreach my $firstmetagroupelem (split(/\ ,/, $metalist[0])) {218 foreach my $firstmetagroupelem (split(/\;/, $metalist[0])) { 207 219 my $firstmetagroupelemvalue = $doc_obj->get_metadata_element($section, $firstmetagroupelem); 208 220 if (defined($firstmetagroupelemvalue) && $firstmetagroupelemvalue ne "") { … … 214 226 # Take care not to do a metadata group more than once 215 227 unless ($metagroupsdone{$metagroup}) { 216 foreach my $metaelem (split(/\ ,/, $metagroup)) {228 foreach my $metaelem (split(/\;/, $metagroup)) { 217 229 my @metavalues = @{$doc_obj->get_metadata($section, $metaelem)}; 218 230 foreach my $metavalue (@metavalues) { … … 241 253 # The metadata elements to classify by 242 254 my @metalist = @{$self->{'metalist'}}; 255 my $firstmetagroup = $metalist[0]; 243 256 244 257 # The OID values of the documents to include in the classification … … 246 259 247 260 # The root node of the classification hierarchy 261 my $childtype = (($self->{$firstmetagroup . ".use_hlist"} eq "t") ? "HList" : "VList"); 248 262 my %classifyinfo = ( 'thistype' => "Invisible", 263 'childtype' => $childtype, 249 264 'Title' => $self->{'title'}, 250 265 'contains' => [] ); … … 449 464 # If there are metadata elements remaining, recursively apply the process 450 465 if (@metalist > 0) { 466 my $nextmetagroup = $metalist[0]; 467 my $childtype = (($self->{$nextmetagroup . ".use_hlist"} eq "t") ? "HList" : "VList"); 468 $subclassifyinfo{'childtype'} = $childtype; 451 469 &add_az_list($self, \@metalist, \@OIDlist, \%subclassifyinfo); 452 470 } -
trunk/gsdl/perllib/strings.rb
r10498 r10499 437 437 GenericList.classify_sections:Classify sections instead of documents. 438 438 GenericList.desc:A general and flexible list classifier with most of the abilities of AZCompactList, but with better Unicode, metadata and sorting capabilities. 439 GenericList.metadata:Metadata fields used for classification. Use '/' to separate the levels in the hierarchy and ';' to separate metadata fields within each level. 439 440 GenericList.partition_size_within_level:The number of items in each partition (only applies when partition_type_within_level is set to 'constant_size'). 440 441 GenericList.partition_type_within_level:The type of partitioning done: either 'per_letter', 'constant_size', or 'none'. 441 GenericList.sort_leaf_nodes_using:Metadata fields used for sorting the leaf nodes. Use ' ;' to separate the metadata groups to stable sort and ',' to separate metadata fields within each group.442 GenericList. metadata:Metadata fields used for classification. Use '/' to separate the levels in the hierarchy and ',' to separate metadata fields within each level.442 GenericList.sort_leaf_nodes_using:Metadata fields used for sorting the leaf nodes. Use '|' to separate the metadata groups to stable sort and ';' to separate metadata fields within each group. 443 GenericList.use_hlist_for:Metadata fields to use a hlist rather than a vlist. Use ',' to separate the metadata groups and ';' to separate the metadata fields within each group. 443 444 444 445 HFileHierarchy.desc:Classifier plugin for generating hierarchical classifications based on a supplementary structure file.
Note:
See TracChangeset
for help on using the changeset viewer.