for my $h (@$list) {
my ($type) = keys %$h;
- $body .= "<format><name>$type</name><type>application/$type+xml</type>";
+ $body .= "<format><name>$type</name><type>application/xml</type>";
for my $part ( qw/namespace_uri docs schema_location/ ) {
$body .= "<$part>$$h{$type}{$part}</$part>"
for my $h (@$list) {
my ($type) = keys %$h;
- print "<format><name>$type</name><type>application/x-$type+xml</type>";
+ print "<format><name>$type</name><type>application/xml</type>";
for my $part ( qw/namespace_uri docs schema_location/ ) {
print "<$part>$$h{$type}{$part}</$part>"
for my $h (@$list) {
my ($type) = keys %$h;
- print "<format><name>$type</name><type>application/$type+xml</type>";
+ print "<format><name>$type</name><type>application/xml</type>";
for my $part ( qw/namespace_uri docs schema_location/ ) {
print "<$part>$$h{$type}{$part}</$part>"
for my $h (@$list) {
my ($type) = keys %$h;
- print "<format><name>$type</name><type>application/$type+xml</type>";
+ print "<format><name>$type</name><type>application/xml</type>";
for my $part ( qw/namespace_uri docs schema_location/ ) {
print "<$part>$$h{$type}{$part}</$part>"
$type = 'atom';
}
+
$class = 'keyword' if ($class eq '-');
$terms =~ s/\+/ /go;
+ $terms =~ s/'//go;
#warn "searching for $class -> [$terms] via OS $version, response type $type";
$feed->link( unapi => $unapi);
- $feed->link(
- alternate =>
- $root . "../$lang/skin/default/xml/rresult.xml?rt=list&" .
- join('&', map { 'rl=' . $_->[0] } @{$recs->{ids}} ),
- 'text/html'
- );
+# $feed->link(
+# alternate =>
+# $root . "../$lang/skin/default/xml/rresult.xml?rt=list&" .
+# join('&', map { 'rl=' . $_->[0] } @{$recs->{ids}} ),
+# 'text/html'
+# );
$feed->link(
opac =>
sub new {
my $class = shift;
my $self = $class->SUPER::new;
- $self->{type} = 'text/html';
+ $self->type('text/html');
return $self;
}
sub toString {
my $self = shift;
- my $base = $self->base;
- my $root = $self->root;
- my $search = $self->search;
+ my $base = $self->base || '';
+ my $root = $self->root || '';
+ my $search = $self->search || '';
my $lib = $self->lib || '-';
$self->composeDoc;
searchTerms => "'$search'",
);
- return $new_doc->toString(1);
+ return $new_doc->toStringHTML();
}
<b>Search:</b>
<form method="GET">
<xsl:attribute name="action"><xsl:value-of select="concat($base_dir, 'opensearch/1.1/', $lib, '/html/keyword')" /></xsl:attribute>
- <input class="searchbox" type="text" name="searchTerms" value="keywords" onfocus="this.value='';"/>
+ <input class="searchbox"
+ type="text" name="searchTerms"
+ value="keywords"
+ title="keywords"
+ onfocus="if (this.value=='keywords') this.value='{$searchTerms}';"/>
</form>
<form method="GET">
<xsl:attribute name="action"><xsl:value-of select="concat($base_dir, 'opensearch/1.1/', $lib, '/html/title')" /></xsl:attribute>
- <input class="searchbox" type="text" name="searchTerms" value="titles" onfocus="this.value='';"/>
+ <input class="searchbox"
+ type="text" name="searchTerms"
+ value="titles"
+ title="titles"
+ onfocus="if (this.value=='titles') this.value='{$searchTerms}';"/>
</form>
<form method="GET">
<xsl:attribute name="action"><xsl:value-of select="concat($base_dir, 'opensearch/1.1/', $lib, '/html/author')" /></xsl:attribute>
- <input class="searchbox" type="text" name="searchTerms" value="authors" onfocus="this.value='';"/>
+ <input class="searchbox"
+ type="text" name="searchTerms"
+ value="authors"
+ title="authors"
+ onfocus="if (this.value=='authors') this.value='{$searchTerms}';"/>
</form>
<form method="GET">
<xsl:attribute name="action"><xsl:value-of select="concat($base_dir, 'opensearch/1.1/', $lib, '/html/subject')" /></xsl:attribute>
- <input class="searchbox" type="text" name="searchTerms" value="subjects" onfocus="this.value='';"/>
+ <input class="searchbox"
+ type="text" name="searchTerms"
+ value="subjects"
+ title="subjects"
+ onfocus="if (this.value=='subjects') this.value='{$searchTerms}';"/>
</form>
<form method="GET">
<xsl:attribute name="action"><xsl:value-of select="concat($base_dir, 'opensearch/1.1/', $lib, '/html/series')" /></xsl:attribute>
- <input class="searchbox" type="text" name="searchTerms" value="series" onfocus="this.value='';"/>
+ <input class="searchbox"
+ type="text" name="searchTerms"
+ value="series"
+ title="series"
+ onfocus="if (this.value=='series') this.value='{$searchTerms}';"/>
</form>
<br/>
</div>
<xsl:if test="string-length($showname)>0">
<xsl:choose>
<xsl:when test="string-length($showlink)>0"><a href="{$showlink}"><xsl:value-of select="$showname" /></a></xsl:when>
- <xsl:otherwise><xsl:value-of select="$showname" /></xsl:otherwise>
+ <xsl:otherwise>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat($base_dir, 'opensearch/1.1/', $lib, '/html/author?searchTerms=', $showname)" />
+ </xsl:attribute>
+ <xsl:value-of select="$showname" />
+ </a>
+ </xsl:otherwise>
</xsl:choose>
<xsl:text>; </xsl:text>
</xsl:if>