mirror of https://github.com/apache/archiva.git
escape xml content
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1395630 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
76fd653c09
commit
535a635cc6
|
@ -19,6 +19,7 @@ package org.apache.archiva.web.docs;
|
|||
*/
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
@ -56,7 +57,8 @@ public class RestDocsServlet
|
|||
|
||||
if ( StringUtils.endsWith( path, ".xsd" ) )
|
||||
{
|
||||
IOUtils.copy( is, resp.getOutputStream() );
|
||||
StringEscapeUtils.escapeXml( resp.getWriter(), IOUtils.toString( is ) );
|
||||
//IOUtils.copy( is, resp.getOutputStream() );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,49 +25,40 @@ define("archiva.docs",["jquery","i18n","jquery.tmpl","bootstrap"], function() {
|
|||
}
|
||||
|
||||
goToArchivaRestDoc=function(target){
|
||||
var mainContent = $("#main-content");
|
||||
mainContent.find("#rest_docs_content" ).html(mediumSpinnerImg());
|
||||
$.ajax({
|
||||
url:"rest-docs/rest-docs-archiva-rest-api/"+target,
|
||||
type:"get",
|
||||
dataType: "html",
|
||||
success: function(data){
|
||||
mainContent.html($("#rest_docs").tmpl());
|
||||
mainContent.find("#rest_docs_content" ).html(data);
|
||||
prettyPrint();
|
||||
}
|
||||
});
|
||||
goToRestDoc(target,"rest-docs/rest-docs-archiva-rest-api");
|
||||
}
|
||||
|
||||
goToArchivaRestUiDoc=function(target){
|
||||
|
||||
goToRestDoc(target,"rest-docs/rest-docs-archiva-ui");
|
||||
}
|
||||
|
||||
goToRedbackRestDoc=function(target){
|
||||
|
||||
goToRestDoc(target,"rest-docs/rest-docs-redback-rest-api");
|
||||
}
|
||||
|
||||
goToRestDoc=function(target,rootPath){
|
||||
var mainContent = $("#main-content");
|
||||
mainContent.find("#rest_docs_content" ).html(mediumSpinnerImg());
|
||||
$.ajax({
|
||||
url:"rest-docs/rest-docs-archiva-ui/"+target,
|
||||
url:rootPath+"/"+target,
|
||||
type:"get",
|
||||
dataType: "html",
|
||||
success: function(data){
|
||||
mainContent.html($("#rest_docs").tmpl());
|
||||
if(target.endsWith(".xsd")){
|
||||
mainContent.find("#rest_docs_content" ).html("<code id='xsd_content'></code>");
|
||||
mainContent.find("#xsd_content" ).html(data);
|
||||
} else {
|
||||
mainContent.find("#rest_docs_content" ).html(data);
|
||||
}
|
||||
|
||||
prettyPrint();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
goToRedbackRestDoc=function(target){
|
||||
var mainContent = $("#main-content");
|
||||
mainContent.find("#rest_docs_content" ).html(mediumSpinnerImg());
|
||||
$.ajax({
|
||||
url:"rest-docs/rest-docs-redback-rest-api/"+target,
|
||||
type:"get",
|
||||
dataType: "html",
|
||||
success: function(data){
|
||||
mainContent.html($("#rest_docs").tmpl());
|
||||
mainContent.find("#rest_docs_content" ).html(data);
|
||||
prettyPrint();
|
||||
}
|
||||
});
|
||||
}
|
||||
displayRedbackRestDocs=function(){
|
||||
window.sammyArchivaApplication.setLocation("#rest-docs-redback-rest-api/index.html");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue