hid indexbody parm.

show pure xml in cached page if it's xml.
do not show summaries for xml/json docs in the serps, pointless.
fix hashSections().
This commit is contained in:
mwells
2014-09-28 13:47:54 -07:00
parent a8c5d6a46e
commit 235d69571b
4 changed files with 22 additions and 5 deletions

@ -622,6 +622,8 @@ bool processLoop ( void *state ) {
// do not show header for json object display
if ( xd->m_contentType == CT_JSON )
includeHeader = false;
if ( xd->m_contentType == CT_XML )
includeHeader = false;
if ( format == FORMAT_XML ) includeHeader = false;
if ( format == FORMAT_JSON ) includeHeader = false;
@ -868,6 +870,10 @@ bool processLoop ( void *state ) {
// calculate bufLen
//long bufLen = p - buf;
/*
MDW: return the xml page as is now. 9/28/2014
long ct = xd->m_contentType;
// now filter the entire buffer to escape out the xml tags
@ -890,6 +896,7 @@ bool processLoop ( void *state ) {
//bufLen = newbuf.length();
sb->stealBuf ( &newbuf );
}
*/
// now encapsulate it in html head/tail and send it off
// sendErr:

@ -4435,8 +4435,9 @@ bool printResult ( State0 *st, long ix , long *numPrintedSoFar ) {
}
// new line if not xml
if ( si->m_format == FORMAT_HTML && strLen )
// new line if not xml. even summary is empty we need it too like
// when showing xml docs - MDW 9/28/2014
if ( si->m_format == FORMAT_HTML ) // && strLen )
sb->safePrintf("<br>\n");

@ -17353,7 +17353,7 @@ void Parms::init ( ) {
m->m_def = "1";
m->m_page = PAGE_SPIDER;
m->m_obj = OBJ_COLL;
m->m_flags = PF_CLONE;
m->m_flags = PF_CLONE | PF_HIDDEN;
m++;
m->m_cgi = "apiUrl";

@ -27401,8 +27401,8 @@ bool XmlDoc::hashUrl ( HashTableX *tt , bool isStatusDoc ) {
// . copied Url2.cpp into here basically, so we can now dump Url2.cpp
bool XmlDoc::hashSections ( HashTableX *tt ) {
if ( ! m_contentTypeValid ) { char *xx=NULL;*xx=0; }
if ( m_contentType == CT_HTML ) return true;
//if ( ! m_contentTypeValid ) { char *xx=NULL;*xx=0; }
//if ( m_contentType == CT_HTML ) return true;
setStatus ( "hashing sections" );
@ -30658,6 +30658,15 @@ Title *XmlDoc::getTitle ( ) {
Summary *XmlDoc::getSummary () {
if ( m_summaryValid ) return &m_summary;
// xml and json docs have empty summaries for now
uint8_t *ct = getContentType();
if ( ! ct || ct == (void *)-1 ) return (Summary *)ct;
if ( *ct == CT_JSON || *ct == CT_XML ) {
m_summaryValid = true;
return &m_summary;
}
// need a buncha crap
Words *ww = getWords();
if ( ! ww || ww == (Words *)-1 ) return (Summary *)ww;