Apache-TopicMaps

 view release on metacpan or  search on metacpan

lib/Apache/TopicMaps.pm  view on Meta::CPAN

package Apache::TopicMaps;

use 5.008;
use strict;
use warnings;

require Exporter;
use AutoLoader qw(AUTOLOAD);

our @ISA = qw(Exporter);

# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

# This allows declaration	use Apache-TopicMaps ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw(
	
) ] );

our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

our @EXPORT = qw(
	
);

our $VERSION = '0.01';


# Preloaded methods go here.

# Autoload methods go after =cut, and are processed by the autosplit program.

use strict;
use vars qw(@ISA $VERSION);
use URI::Escape;
use TM;
use LWP::UserAgent;
use Apache::Constants qw(:common :http :response);

@ISA = qw(LWP::UserAgent);
$VERSION = '1.00';
 
my $ua = __PACKAGE__->new;
$ua->agent(join "/", __PACKAGE__, $VERSION);

my $tmc = 0;

sub redirect_ok {0}

#sub get_basic_credentials
#{
#        return ("user","pass");
#}

#TM::set_trace("*");

my $SAM = "http://www.gooseworks.org/disclosures/SAM.xml";

# this is the map for the static tm handler
my $topicmap;


sub get_param_types
{
	my $view_name = shift;
	if( $view_name eq 'topic') {
		return { topic => 'Topic' };
	} elsif( $view_name eq 'index') {
		return {};
	} elsif( $view_name eq 'search') {
		return { query => 'String' };
	} else {
		return {};
	}
}
	

sub trim_path_info
{
	my $r = shift;

	my $p = $r->path_info;
	$p =~ s/\/$//g;
	$p =~ s/^\///g;
	if( $p eq '') { $p = 'WELCOME'; }
	$r->path_info($p);
}
sub choose_mime
{
	my $r = shift;

	my $accept = 'text/plain';
	my $accept_header = $r->header_in('Accept');

	if($accept_header =~ /\*\/\*/) {
		return 'text::html';
	} elsif($accept_header =~ /text\/html/) {
		return 'text::html';
	} elsif($accept_header =~ /application\/xtm\+xml/) {
		return 'application::xtmPLUSxml';
	} elsif($accept_header =~ /application\/rdf\+xml/) {
		return 'application::rdfPLUSxml';
	}
	return 'text::plain';
}

sub load_maps
{
	my($r,$tm) = @_;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.822 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )