Changeset 10499


Ignore:
Timestamp:
2005-08-12T11:41:08+12:00 (19 years ago)
Author:
mdewsnip
Message:

Changed the way values in arguments are separated :-)

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/classify/GenericList.pm

    r10498 r10499  
    7171    'desc' => "{GenericList.sort_leaf_nodes_using}",
    7272    'type' => "metadata",
    73     'deft' => "Title" } ];
     73    'deft' => "Title" },
     74      { 'name' => "use_hlist_for",
     75    'desc' => "{GenericList.use_hlist_for}",
     76    'type' => "string" } ];
    7477
    7578my $options = { 'name'     => "GenericList",
     
    101104    my $partition_size_within_level = $self->{'partition_size_within_level'};
    102105    my $sort_leaf_nodes_using = $self->{'sort_leaf_nodes_using'};
     106    my $use_hlist_for = $self->{'use_hlist_for'};
    103107
    104108    # The metadata elements to use (required)
     
    113117    if (!$buttonname) {
    114118    # Default: the first metadata element specified
    115     my $firstmetagroupfirstelem = (split(/\,/, $metalist[0]))[0];
     119    my $firstmetagroupfirstelem = (split(/\;/, $metalist[0]))[0];
    116120    $buttonname = $self->generate_title_from_metadata($firstmetagroupfirstelem);
    117121    }
     
    128132    }
    129133
    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
    131143    if (!$partition_type_within_level) {
    132144    # Default: none
     
    135147    $self->{"partition_type_within_level"} = $partition_type_within_level;
    136148
    137     # The number of items in each group
     149    # The number of items in each partition
    138150    if (!$partition_size_within_level) {
    139151    # Default: 20
     
    160172    my @sort_leaf_nodes_usingmetalist = ( "Title" );
    161173    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);
    163175    }
    164176    $self->{'sort_leaf_nodes_usingmetalist'} = \@sort_leaf_nodes_usingmetalist;
     
    204216
    205217    # 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])) {
    207219    my $firstmetagroupelemvalue = $doc_obj->get_metadata_element($section, $firstmetagroupelem);
    208220    if (defined($firstmetagroupelemvalue) && $firstmetagroupelemvalue ne "") {
     
    214226        # Take care not to do a metadata group more than once
    215227        unless ($metagroupsdone{$metagroup}) {
    216             foreach my $metaelem (split(/\,/, $metagroup)) {
     228            foreach my $metaelem (split(/\;/, $metagroup)) {
    217229            my @metavalues = @{$doc_obj->get_metadata($section, $metaelem)};
    218230            foreach my $metavalue (@metavalues) {
     
    241253    # The metadata elements to classify by
    242254    my @metalist = @{$self->{'metalist'}};
     255    my $firstmetagroup = $metalist[0];
    243256
    244257    # The OID values of the documents to include in the classification
     
    246259
    247260    # The root node of the classification hierarchy
     261    my $childtype = (($self->{$firstmetagroup . ".use_hlist"} eq "t") ? "HList" : "VList");
    248262    my %classifyinfo = ( 'thistype' => "Invisible",
     263             'childtype' => $childtype,
    249264             'Title' => $self->{'title'},
    250265             'contains' => [] );
     
    449464        # If there are metadata elements remaining, recursively apply the process
    450465        if (@metalist > 0) {
     466        my $nextmetagroup = $metalist[0];
     467        my $childtype = (($self->{$nextmetagroup . ".use_hlist"} eq "t") ? "HList" : "VList");
     468        $subclassifyinfo{'childtype'} = $childtype;
    451469        &add_az_list($self, \@metalist, \@OIDlist, \%subclassifyinfo);
    452470        }
  • trunk/gsdl/perllib/strings.rb

    r10498 r10499  
    437437GenericList.classify_sections:Classify sections instead of documents.
    438438GenericList.desc:A general and flexible list classifier with most of the abilities of AZCompactList, but with better Unicode, metadata and sorting capabilities.
     439GenericList.metadata:Metadata fields used for classification. Use '/' to separate the levels in the hierarchy and ';' to separate metadata fields within each level.
    439440GenericList.partition_size_within_level:The number of items in each partition (only applies when partition_type_within_level is set to 'constant_size').
    440441GenericList.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.
     442GenericList.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.
     443GenericList.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.
    443444
    444445HFileHierarchy.desc:Classifier plugin for generating hierarchical classifications based on a supplementary structure file.
Note: See TracChangeset for help on using the changeset viewer.