Change getMimeType and setMimeType to response->content_type.

This commit is contained in:
Colin Kuskie 2010-11-21 22:35:26 -08:00
parent e5adc07a05
commit fd8f03a186
52 changed files with 138 additions and 175 deletions

View file

@ -64,7 +64,7 @@ sub handler {
else {
$session->log->warn("User ".$session->user->username." tried to execute ajaxGetI18n but could not decode JSON string: $json");
}
$session->http->setMimeType( "application/json" );
$session->response->content_type( "application/json" );
return JSON->new->encode( $response );
}

View file

@ -134,10 +134,10 @@ sub handler {
assets => \@assets
};
if ($as eq "xml") {
$session->http->setMimeType('text/xml');
$session->response->content_type('text/xml');
return XML::Simple::XMLout($document, NoAttr => 1);
}
$session->http->setMimeType('application/json');
$session->response->content_type('application/json');
return JSON->new->encode($document);
}
return undef;

View file

@ -107,7 +107,7 @@ EOSQL
$results{'startIndex'} = $startIndex;
$results{'sort'} = undef;
$results{'dir'} = $sortDir;
$session->http->setMimeType('application/json');
$session->response->content_type('application/json');
my $json = JSON::to_json(\%results);
return $json;
}

View file

@ -315,7 +315,7 @@ sub www_ajaxGetManagerPage {
$assetInfo->{ sort } = $session->form->get( 'orderByColumn' );
$assetInfo->{ dir } = lc $session->form->get( 'orderByDirection' );
$session->http->setMimeType( 'application/json' );
$session->response->content_type( 'application/json' );
return to_json( $assetInfo );
}

View file

@ -93,7 +93,7 @@ sub handler {
.'</urlset>';
$session->http->setMimeType('text/xml');
$session->response->content_type('text/xml');
return $xml;
}