_search__convert_binary_to_text (private)

 _search__convert_binary_to_text

Defined in packages/search/tcl/test/search-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
aa_log aa_log (public) aa_log_result aa_log_result (public) aa_true aa_true (public) acs_root_dir acs_root_dir (public) search::convert::binary_to_text search::convert::binary_to_text (public) _search__convert_binary_to_text _search__convert_binary_to_text _search__convert_binary_to_text->aa_log _search__convert_binary_to_text->aa_log_result _search__convert_binary_to_text->aa_true _search__convert_binary_to_text->acs_root_dir _search__convert_binary_to_text->search::convert::binary_to_text

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        #
        # .ppt conversion is currently only best-effort, as the
        # underlying tool catppt seems to be unreliable even for a
        # trivial document as the one we test here.
        #
        # We comment this test until a better solution is found,
        # e.g. one based on LibreOffice, unoconv or other similar
        # tools.
        #
        # ppt application/mspowerpoint
        #
        foreach {extension mime_type} {
            txt text/plain
            html text/html
            doc application/msword
            xls application/msexcel
            pdf application/pdf
            odt application/vnd.oasis.opendocument.text
            ott application/vnd.oasis.opendocument.text-template
            odp application/vnd.oasis.opendocument.presentation
            otp application/vnd.oasis.opendocument.presentation-template
            ods application/vnd.oasis.opendocument.spreadsheet
            ots application/vnd.oasis.opendocument.spreadsheet-template
            docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
            xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
        } {
            set filename [acs_root_dir]/packages/search/tcl/test/data/test.$extension
            set text [search::convert::binary_to_text  -filename $filename  -mime_type $mime_type]
            set ok_p [expr {[string first "OpenACS" $text] >= 0}]
            aa_true "Text was extracted correctly for '.$extension'/'$mime_type'" $ok_p
            if {!$ok_p} {
                aa_log "Extracted text: [ns_quotehtml $text]"
            }
        }
    }} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "convert_binary_to_text (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: