DemofaFC.pm

From DLXS Documentation

Revision as of 18:46, 24 July 2008 by Tburtonw (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

$DLXSROOT/cgi/f/findaid/DemofaFC.pm version 1.2



package DemofaFC;

BEGIN
{
    # enable strict under development
    if ( $ENV{'DLPS_DEV'} )
    {
        require "strict.pm";
        strict::import();
# CALLED BY : new
# CALLS     :
# INPUT     : see new
# RETURNS   :
# NOTES     :
# ----------------------------------------------------------------------

sub _initialize
{
    my $self = shift;

    my ( $collid, $cio, $optionalArgsHashRef ) = @_;

    $self->SUPER::_initialize( @_ );

    # Not necessary to subclass this item unless there are other outline
    # heads that are desired
    $self->SetSelfKeyInfo( 'tocheads' =>
                           {
                            # This provides a default heading if there is no <head> element in the <biogh
ist>
                            # it replaces the Bentley-specific code
                            'bioghist-t'      => qq{Biographical/Historical Note },
             #               'controlaccess-t' => qq{Subject Terms},
                            'controlaccess-t' => qq{Subjects},
                            'frontmatter-t'   => qq{Title Page},
                            'arrangement-t'   => qq{Arrangement},
                            'scopecontent-t'  => qq{Collection Scope and Content Note},
 #                           'summaryinfo-t'   => qq{Summary Information},
                           'summaryinfo-t'   => qq{Abstract},
                            'contentslist-t'  => qq{Contents List},
#                            'admininfo-t'     => qq{Access and Use},
                            'admininfo-t'     => qq{Administrative Information},
#                            'add-t'           => qq{Additional Descriptive Data},
                            'sepmaterial-t'           => qq{Separated Material},
                            'relmaterial-t'           => qq{Related Material},
                           }
                         );
}
#----------------------------------------------------------------------
#
#  Replacement to use <head> within Biohist for label
# ----------------------------------------------------------------------
# NAME         : GetBioghistTocHead
# PURPOSE      :
# CALLS        :
# INPUT        :
# RETURNS      :
# GLOBALS      :
# SIDE-EFFECTS :
# NOTES        : The query here is based on the encoding practice of the Bentley Historical
#                Library at the University of Michigan. Though the distinction between
#                "collections" (papers of indiviudals) and "records" or "record group"
#                (records of organizations) is an archival distinction, the use of the
#                archdesc attribute to determine the label is probably a BHL idiosyncracy.
#                Our practice goes back to early discussions that whenever possible the
#                system / stylesheet should supply standard headings. Most libraries
#                probably hard code a <head>, in which case it would be  necessary to
#                override this method in a subclass.
# ----------------------------------------------------------------------
sub GetBioghistTocHead
{
    my $self = shift;

    my ( $cgi ) = @_;

    my $headText = '';
    $headText = $self->GetSelfKeyInfo( 'bioghistheader' );
    if ( $headText )
    {
        return $headText;
    }

    my $tocheadsHashRef = $self->GetSelfKeyInfo( 'tocheads' );

    # get properly idno properly formatted for query
    my $idno    = ( $cgi->param( 'idno' ) || $cgi->param( 'didno' ) );
    $idno = $self->GetQueryFactory()->pat50TruncationHandler( $idno );

    # get region in which to look for idno
    my $idnoRgn;
    my $tm = $self->GetTermMapper( );
    ASSERT( $idnoRgn = $tm->map( 'IDNO', 'synthetic', 'native' ),
            qq{ID not defined in map: } . $tm->GetMapfileName() );

    my $xpat = $self->FindXPatContainingIdno( $idno );


    #  Modifications here!!

    #XXX do we need to subset1.1 to get the first head in case there are more than one?
    my $query = qq{pr.region."head" subset.1.1 (region "head" within (region "bioghist" within (region ma
in incl ( $idnoRgn incl $idno )) ));};

    my ( $error, $head ) =  $xpat->GetSimpleResultsFromQuery( $query );
    &DlpsUtils::StripAllRSetCruft( \$head );


    if ($head)
    {
        $headText="$head";
    }
    else
    {
        #use default 
        $headText = $$tocheadsHashRef{ 'bioghist-t' };
    }
    
    $self->{ 'bioghistheader' } = $headText;

    return $headText;
}


# ######################################################################
# return truth
1;
# ######################################################################


__END__;



Personal tools