Changes between Version 4 and Version 5 of SearchAttachmentsPlugin


Ignore:
Timestamp:
May 9, 2007, 5:27:43 PM (8 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SearchAttachmentsPlugin

    v4 v5  
    2626
    2727==   How to install?   ==
    28 
     28 
    2929  * Install swish-e, http://swish-e.org/
    3030
    31   * Install filter tools for the formats you want to index, for instance
     31  * Install filter tools for the formats you want to index:
    3232    * `catdoc` and `catppt`, http://www.45.free.net/~vitus/software/catdoc/
    3333    * `pdftotext`, http://www.foolabs.com/xpdf/
    3434
    35   * Download the plugin from xxxx
     35  * Download the code from http://trac-hacks.org/wiki/SearchAttachmentsPlugin[[BR]]
     36    to YOUR_SOURCE_DIR
    3637
    3738  * Install the plugin
    3839{{{
    39     python set-up bdist_egg
    40     cp searchattachmpents.egg YOUR_TRAC_ENV/plugins
    41 }}}
    42 
    43   * Configure the [attachment] section of trac.ini
    44 
    45 `[components]`[[BR]]
    46 `searchattachments.* = enabled`
    47 [[BR]][[BR]]
    48 `[attachment]`[[BR]]
    49 `swish = /usr/bin/local/swish-e`[[BR]]
    50 `filter.doc = /usr/local/bin/catdoc -b "%s" > "%s"`[[BR]]
    51 `filter.ppt = /usr/local/bin/catppt "%s" > "%s"`[[BR]]
    52 `filter.pdf = /usr/bin/pdftotext "%s" "%s"`[[BR]]
    53 [[BR]]
    54 ''swish''
    55   path to the swish-e command on your system.
    56 
    57 ''filter.*''
    58   command to use for converting a non-text format to text. The command takes a file as input (first ''%s'') and writes the generated a text file in a file (second ''%s''):
    59 
    60 
    61   There is no need to declare a filter command for .txt or .text. Text files are handled
    62   natively. To index a new non-text format, just add a filter.* entry using the appropriate
    63   command line tool for this format.
    64 {{{
    65    filter.myEXT = my_command -infile "%s" -outfile "%s"
     40    python setup.py bdist_egg
     41    cp dist/TracSearchAttachmentsPlugin-0.1-py2.4.egg /path/to/your/env/plugins/
    6642}}}
    6743
    6844  * Trac 10.x and 11.x source code must be manually modified for SEAT plugin to work.
    69     The file to modify is '''attachment.py'''. On a Linux Fedora system, it is located in
     45    The file to modify is '''attachment.py''', on a Linux Fedora system, it is located in
    7046    /usr/lib/python2.4/site-packages/trac
    7147
     
    9672203                 db.commit()
    9773204
    98    205             targetfile.close() # << Line to add for SEAT plugin
     74205             targetfile.close() # << Line to add for SEAT plugin
    9975206
    10076207             for listener in AttachmentModule(self.env).change_listeners:
     
    10682
    10783
    108   * Add the trac-seat utility to your path. For instance, copy trac-seat to /usr/local/bin.
    109   * Use trac-seat to convert existing attachments to text files and index these.
     84  * Use the trac-seat utility to index existing attachments:
    11085{{{
    111 trac-seat /path/to/your/env meta
    112 trac-seat /path/to/your/env index -c
     86    cp YOUR_SOURCE_DIR/searchattachmentsplugin/0.10/trac-seat /path/to/your/env/index
     87    cd /path/to/your/env/index
     88    chmod +x trac-seat
     89    ./trac-seat /path/to/your/env meta
     90    ./trac-seat /path/to/your/env index -c
     91    cd ..
     92    chown -R apache:apache /path/to.your/env/index
    11393}}}
    11494
    115   * '''restart''' the trac server ( /etc/init.d/httpd restart)
     95  * Configure trac.ini
     96{{{
     97
     98   [components]
     99   ....
     100   searchattachments.* = enabled
     101
     102   [attachments]
     103   ...
     104   # This is the path to the swish-e command on your system
     105   swish = /usr/local/bin/swish-e
     106   seat  = /path/to/your/env/trac-seat
     107
     108   # The first %s is the absolute path of the input file.
     109   # The second %s is the absolute path of the text file generated by the command.
     110   filter.doc = /usr/local/bin/catdoc -b "%s" > "%s"
     111   filter.ppt = /usr/local/bin/catppt "%s" > "%s"
     112   filter.pdf = /usr/bin/pdftotext "%s" "%s"
     113}}}
     114
     115  There is no need to declare a filter command for .txt or .text. Text files are handled
     116  natively. To index a new non-text format, just add a filter.* entry using the appropriate
     117  command line tool for this format.
     118{{{
     119   filter.EXTENSION = path_to_EXTENSION_to_text_command -infile "%s" -outfile "%s"
     120}}}
     121
     122  * '''restart''' the trac server
     123
    116124
    117125