function fetch_content(mime_type, path, ctype) {
      var url = '/api/doc/ascii_contents/' + ctype + path;
      var buf_ascii = null;
      var buf_raw = null;

      /* get ASCII contents */
      $.get( { url: url, async: false, success: function(data) {
        buf_ascii = data;
      } });

      /* if not an ASCII document, get raw contents */
      /* NOTE: internal node types are all ASCII (i.e. JSON) */
      if ((typeof mime_type == 'undefined') || mime_type === '') {
        mime_type = 'application/octet-stream'
      }
      if ((ctype === 'document') && (mime_type.split('/')[0] !== 'text')) {
        url = '/api/doc/contents/' + ctype + path;
        $.get( { url: url, async: false, success: function(data) {
          buf_raw = data;
        } });
      } else {
        /* for ASCII documents, set raw contents to ascii contents */
        buf_raw = buf_ascii;
      }
      return( { ascii: buf_ascii, raw: buf_raw } )
    }
/* helper routine to download doc contents *sychronously* */
helper routine to download doc contents *sychronously
helper routine to download doc contents * sychronously
function fetch_content(mime_type, path, ctype) {
      var url = '/api/doc/ascii_contents/' + ctype + path;
      var buf_ascii = null;
      var buf_raw = null;
      $.get( { url: url, async: false, success: function(data) {
        buf_ascii = data;
      } });
      if ((typeof mime_type == 'undefined') || mime_type === '') {
        mime_type = 'application/octet-stream'
      }
      if ((ctype === 'document') && (mime_type.split('/')[0] !== 'text')) {
        url = '/api/doc/contents/' + ctype + path;
        $.get( { url: url, async: false, success: function(data) {
          buf_raw = data;
        } });
      } else {
        buf_raw = buf_ascii;
      }
      return( { ascii: buf_ascii, raw: buf_raw } )
    }
function fetch_content ( mime_type , path , ctype ) { var url = '/api/doc/ascii_contents/' + ctype + path ; var buf_ascii = null ; var buf_raw = null ; $ . get ( { url : url , async : false , success : function ( data ) { buf_ascii = data ; } } ) ; if ( ( typeof mime_type == 'undefined' ) || mime_type === '' ) { mime_type = 'application/octet-stream' } if ( ( ctype === 'document' ) && ( mime_type . split ( '/' ) [ 0 ] !== 'text' ) ) { url = '/api/doc/contents/' + ctype + path ; $ . get ( { url : url , async : false , success : function ( data ) { buf_raw = data ; } } ) ; } else { buf_raw = buf_ascii ; } return ( { ascii : buf_ascii , raw : buf_raw } ) }
helper routine to download doc contents *sychronously
helper routine to download doc contents * sychronously
/* get ASCII contents */ /* if not an ASCII document, get raw contents */ /* NOTE: internal node types are all ASCII (i.e. JSON) */ /* for ASCII documents, set raw contents to ascii contents */