NeoLight

From NeoWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 06:32, 29 April 2005 (edit)
Waldo ( | contribs)
(mild grammar changes)
← Previous diff
Current revision (17:10, 11 January 2009) (edit) (undo)
Yakusha ( | contribs)
(adding link to Dutch version)
 
(57 intermediate revisions not shown.)
Line 1: Line 1:
=NeoLight= =NeoLight=
 +[[image:Neolight.gif|NeoLight]]
 +
Edward Peterlin Edward Peterlin
-4/29/05+ 
 +Authored: 4/29/05
 + 
 +Revised: 6/22/07
==What is NeoLight?== ==What is NeoLight?==
NeoLight is an abbreviation I've come up with for "NeoOffice Spotlight Importer". This importer allows [http://www.apple.com/macosx/features/spotlight/ Spotlight] to index metadata and content within the files created by NeoOffice. Through Spotlight integration, searching across multiple NeoOffice documents can be done in a nice, Mac-like fashion. NeoLight is an abbreviation I've come up with for "NeoOffice Spotlight Importer". This importer allows [http://www.apple.com/macosx/features/spotlight/ Spotlight] to index metadata and content within the files created by NeoOffice. Through Spotlight integration, searching across multiple NeoOffice documents can be done in a nice, Mac-like fashion.
- 
-Today is the first development release of the NeoLight plugin. This release aims to be the start of an addition that will be included with future builds of NeoOffice/J. The purposes of this release are: 
- 
-# Allow testers who have Tiger to begin assessing the utility of the plugin. 
-# Allow developers access to the source code to bugfix and improve the plugin. 
-# Research what other types of metadata may wish to be extracted from documents. 
-# Get people excited enough to help add support for OpenDocument formatted documents. 
==Licensing== ==Licensing==
-NeoLight is being released under the GNU Lesser General Public License. While I would have preferred to use a GPL-style license like the main NeoOffice project, LGPL is necessary in this case as the Spotlight importers are shared libraries loaded into closed-source applications. Using LGPL allows for the executable code of NeoLight to be used by Spotlight without "infecting" Mac OS X with GPL requirements.+NeoLight is released under the GNU General Public License. It is our opinion that GPL does not extend to the operating system as GPL contains exceptions for code utilizing standard operating system services.
- +
-==Installation Requirements==+
- +
-* Mac OS X 10.4 "Tiger"+
-* NeoOffice/J (or OpenOffice.org X11...see below)+
-* patience+
==Downloading== ==Downloading==
-The NeoLight plugin can be downloaded as a single installer package:+The NeoLight plugin is included by default for all NeoOffice installers. NeoLight updates will be made available with the next NeoOffice patch following the release of a new version of NeoLight.
-http://trinity.neooffice.org/downloads/neolight_installer.pkg.tgz+The NeoLight plugin is no longer available as a download separate from the NeoOffice application. Using the standalone installer can conflict with updates distributed through the NeoOffice patching mechanism. The version of Spotlight in Mac OS X 10.4 is not designed well to handle multiple versions of the same Spotlight indexing plugin in mulitple locations, or multiple plugins that claim to handle the same file type. This may change in the future.
-*43K in size+
-* MD5 sum : 8436e94ca1e6956a3277db0cf12e2f33+
-A reference Info.plist is also provided:+If you have downloaded NeoOffice 2.x, you already have the Spotlight indexing plugin.
-http://trinity.neooffice.org/downloads/neolight_neoj_Info.plist.gz+* Latest Version : 1.1.6
-* < 1K in size+* Last updated 6/21/07
-* MD5 sum : 0fc545f35af027424d7fc8f6ea41eaa0+** ''most recent update for Leopard support''
==Installing== ==Installing==
-In order to install the NeoLight plugin, you will be required to edit the Info.plist of NeoOffice/J. The changes required for Spotlight support will be integrated into future patch and/or final releases of NeoOffice/J once these plist additions have been verified to not cause harm on systems older then 10.4.+Throughout its system, Spotlight identifies files by [http://arstechnica.com/reviews/os/macosx-10.4.ars/11 UTI] types. Because Mac OS X does not have built-in types for OpenOffice.org formatted files, they must be defined by an installed application to avoid having Spotlight assign them dynamically-generated UTI types (which cannot reliably be mapped to a Spotlight importer).
-You should edit the Info.plist before attempting to index documents with Spotlight.+NeoLight assumes the following UTI types correspond to the following file types:
-===Editing the Info.plist===+* org.neooffice.writer - Writer "sxw" files and "stw" templates
 +* org.neooffice.calc - Calc "sxc" files and "stc" templates
 +* org.neooffice.impress - Impress "sxi" files and "sti" templates
 +* org.neooffice.draw - Draw "sxd" files and "std" templates (hehe)
 +* org.oasis.opendocument.text - OpenDocument Text files "odt" and templates "ott"
 +* org.oasis.opendocument.graphics - OpenDocument Graphics files "odg" and templates "otg"
 +* org.oasis.opendocument.presentation - OpenDocument Presentation files "odp" and templates "otp"
 +* org.oasis.opendocument.spreadsheet - OpenDocument Spreadsheet files "ods" and templates "ots"
 +* org.oasis.opendocument.database - OpenDocument Databaes files "odb"
-Throughout its system, Spotlight identifies files by UTI types. Because Mac OS X does not have built-in types for OpenOffice.org formatted files, they must be defined by an installed application to avoid having Spotlight assign them dynamically generated UTI types (which cannot reliably be mapped to a Spotlight importer).+The 1.1 plugin release will define these UTI mappings within the Info.plist of the importer plugin.
-NeoLight assigns the following UTI types to files:+NeoLight is automatically installed with NeoOffice.
- +
-* org.neooffice.writer - Writer "sxw" files+
-* org.neooffice.calc - Calc "sxc" files+
-* org.neooffice.impress - Impress "sxi" files+
-* org.neooffice.draw - Draw "sxd" files+
- +
-In order to define these types, the NeoOffice/J Info.plist must have a "UTExportedTypeDeclarations" dictionary added to its root. The "neolight_neoj_Info.plist.gz" file link above includes a 1.1 Release Candidate Info.plist file with these changes already applied. To install it, copy that Info.plist over the appropriate file within the NeoOfficeJ application bundle.+
- +
-After you either copy over the Info.plist or do the edits manually, you should [http://www.macosxhints.com/article.php?story=20031215144430486 rebuild your LaunchServices database] to make sure the UTI types take.+
- +
-It is also possible to perform these edits manually using the Property List Editor (or your favorite text editor). The contents of the appropriate dictionary to add are:+
-<pre>+
- <key>UTExportedTypeDeclarations</key>+
- <array>+
- <dict>+
- <key>UTTypeConformsTo</key>+
- <array>+
- <string>public.content</string>+
- <string>public.data</string>+
- </array>+
- <key>UTTypeDescription</key>+
- <string>NeoOffice/J Draw</string>+
- <key>UTTypeIdentifier</key>+
- <string>org.neooffice.draw</string>+
- <key>UTTypeReferenceURL</key>+
- <string>http://xml.openoffice.org/xml_specification.pdf</string>+
- <key>UTTypeTagSpecification</key>+
- <dict>+
- <key>public.filename-extension</key>+
- <array>+
- <string>sxd</string>+
- </array>+
- <key>public.mime-type</key>+
- <string>application/vnd.sun.xml.draw</string>+
- </dict>+
- </dict>+
- <dict>+
- <key>UTTypeConformsTo</key>+
- <array>+
- <string>public.content</string>+
- <string>public.data</string>+
- </array>+
- <key>UTTypeDescription</key>+
- <string>NeoOffice/J Impress</string>+
- <key>UTTypeIdentifier</key>+
- <string>org.neooffice.impress</string>+
- <key>UTTypeReferenceURL</key>+
- <string>http://xml.openoffice.org/xml_specification.pdf</string>+
- <key>UTTypeTagSpecification</key>+
- <dict>+
- <key>public.filename-extension</key>+
- <array>+
- <string>sxi</string>+
- </array>+
- <key>public.mime-type</key>+
- <string>application/vnd.sun.xml.impress</string>+
- </dict>+
- </dict>+
- <dict>+
- <key>UTTypeConformsTo</key>+
- <array>+
- <string>public.content</string>+
- <string>public.data</string>+
- </array>+
- <key>UTTypeDescription</key>+
- <string>NeoOffice/J Calc</string>+
- <key>UTTypeIdentifier</key>+
- <string>org.neooffice.calc</string>+
- <key>UTTypeReferenceURL</key>+
- <string>http://xml.openoffice.org/xml_specification.pdf</string>+
- <key>UTTypeTagSpecification</key>+
- <dict>+
- <key>public.filename-extension</key>+
- <array>+
- <string>sxc</string>+
- </array>+
- <key>public.mime-type</key>+
- <string>application/vnd.sun.xml.calc</string>+
- </dict>+
- </dict>+
- <dict>+
- <key>UTTypeConformsTo</key>+
- <array>+
- <string>public.content</string>+
- <string>public.data</string>+
- </array>+
- <key>UTTypeDescription</key>+
- <string>NeoOffice/J Writer</string>+
- <key>UTTypeIdentifier</key>+
- <string>org.neooffice.writer</string>+
- <key>UTTypeReferenceURL</key>+
- <string>http://xml.openoffice.org/xml_specification.pdf</string>+
- <key>UTTypeTagSpecification</key>+
- <dict>+
- <key>public.filename-extension</key>+
- <array>+
- <string>sxw</string>+
- </array>+
- <key>public.mime-type</key>+
- <string>application/vnd.sun.xml.writer</string>+
- </dict>+
- </dict>+
- </array>+
-</pre>+
- +
-===Installing the NeoLight Plugin===+
- +
-To install the NeoLight Importer Plugin, simply extract and double-click the neolight_installer.pkg.tgz linked to above. After clicking through the requisite license agreements, it will install the neolight plugin named "neolight.mdimporter" within the "/Library/MDImporters" directory. This will make the NeoLight importer available for all users on the machine.+
===Testing Your Installation=== ===Testing Your Installation===
Line 162: Line 52:
If you have the Tiger Developer's Tools installed, you can verify proper loading of the plugin from a Terminal after installation using the following command: If you have the Tiger Developer's Tools installed, you can verify proper loading of the plugin from a Terminal after installation using the following command:
- /Developer/Tools/mdimport -L+<pre>/usr/bin/mdimport -L</pre>
-You should see "/Library/MDImporters/neolight.mdimporter" in the list if all has been installed well.+You should see '''/Library/Spotlight/neolight.mdimporter''' in the list if all has been installed well.
-To test whether installation was successful:+To verify that installation was successful:
-# Launch NeoOffice/J+# Launch '''NeoOffice'''
# Create a new empty Writer document. # Create a new empty Writer document.
-# Go to File > Properties.+# Under the '''File''' menu item, choose '''Properties.'''
-# Add in a "Title" for the document with a relatively unused nonsense word (e.g. "interzone")+# Add a '''Title''' for the document with a relatively unused nonsense word (e.g. "interzone")
-# Notice that the title from the properties dialog goes into the document's titlebar.+# Notice that the title from the '''Properties''' dialog appears in the dialog's titlebar.
-# Save the doc to a known location with a filename that does not contain your nonsense word.+# Save the document to a known location with a filename that does not contain your nonsense word.
# Start a new Spotlight search. # Start a new Spotlight search.
# Type the nonsense word you used above. # Type the nonsense word you used above.
-If the neolight plugin is installed properly, the doc you just saved should show up in the search results. If it doesn't, open a Terminal and type the followng:+If the NeoLight plugin is installed properly, the document you just saved should show up in the search results. If it doesn't, open a Terminal and type the followng:
- /Developer/Tools/mdimport -d3 /path/to/test/doc.sxw+<pre>/usr/bin/mdimport -d3 /path/to/test/doc.sxw</pre>
-Check to make sure the doc is of type "org.neooffice.writer". If it is, look in the keys for the "Title" key and you should see your nonsense word. If you do, then everything is installed correctly.+Check to make sure the document is of type "org.neooffice.writer". If it is, look in the keys for the "Title" key and you should see your nonsense word. If you do, then everything is installed correctly.
-If when you type the above the doc is of type "dyn.a3f42morehexgarbageinherefoo" then LaunchServices hasn't mapped the extension to the UTI type. Either the update to the Info.plist is misapplied or you may need to rebuild your LaunchServices database.+If when you type the above the doc is of type "dyn.a3f42morehexgarbageinherefoo", LaunchServices hasn't mapped the extension to the UTI type properly. Either the update to the '''Info.plist''' is misapplied or you may need to rebuild your LaunchServices database.
 + 
 +If you want to index several files or directories, you can use the "find"-command. This example let Spotlight index all *sxw-files in your $HOME-directory:
 + 
 +<pre>sudo find -s $HOME -name *sxw -exec /usr/bin/mdimport -d3 {} \;</pre>
 + 
 +If you'd like Spotlight to just re-index all of your NeoOffice documents automatically, just use the following command:
 + 
 +<pre>mdimport -r /Library/Spotlight/neolight.mdimporter</pre>
==What does NeoLight Import?== ==What does NeoLight Import?==
Line 198: Line 96:
* textual display content of all cells of a Calc document for indexing * textual display content of all cells of a Calc document for indexing
* content of bullets, titles, and other text areas for indexing from Impress and Draw documents. * content of bullets, titles, and other text areas for indexing from Impress and Draw documents.
 +* for database documents, any standard OOo metadata (optional for database files, apparently) allong with:
 +** names of defined forms
 +** names of defined tables
 +** column names of all tables
Once the NeoLight plugin is installed, it should be possible to search OOo formatted documents by these criteria within Spotlight enabled applications. Once the NeoLight plugin is installed, it should be possible to search OOo formatted documents by these criteria within Spotlight enabled applications.
 +
 +==OpenDocument Compatibility==
 +
 +Starting with version 1.0.3 (5/7/05), the neolight importer is compatible with both documents generated by NeoOffice/J 0.8.4, NeoOffice/J 1.1, OpenOffice.org 1.x, and OpenOffice.org 2.0 (OpenDocument). While OpenDocument compatibility has not been extensively tested, documents that conform to the approved OpenDocument specification should be compatible.
 +
 +Version 1.1 (10/2/05) defines UTI types for the OpenDocument o{d,g}* extensions now that the extensions and MIME types have been finalized, so Info.plist editing should no longer be required to start indexing OpenDocument formatted files.
 +
 +Version 1.1.5 (9/27/06) adds in UTI types and content extraction for OpenDocument database files.
==Using NeoLight to Index OpenOffice.org Documents== ==Using NeoLight to Index OpenOffice.org Documents==
-NeoLight is not specific to NeoOffice and can index any OpenOffice.org 1.x formatted document. To enable indexing of OpenOffice.org documents if you do not use NeoOffice/J, some application will need to have its Info.plist edited to provide the UTI types listed above. If you use OpenOffice.org Mac OS X (X11), you may want to consider assigning this to the [http://www.geocities.com/terry_teague/openoffice.html Start OpenOffice.org] application Info.plist file (or the Info.plist of whatever launcher you are using).+NeoLight is not specific to NeoOffice and can index any OpenOffice.org 1.x formatted document. Starting with version 1.0.3, no special actions are required to index OpenOffice.org documents besides installing the Neolight plugin. To force reindexing of OOo documents already existing on your computer, you may need to do a find with <tt>mdimport</tt> as noted above.
==Known Issues== ==Known Issues==
-* This is completely untested and unreviewed! Prior to the release of Mac OS X 10.4, it was not possible to release source code publicly due to Apple NDA requirements.+* The UTI types are required to be defined before files are manually indexed using mdimport -d3. Files that get indexed prior to the initial installation of the neolight plugin will get the wrong UTI type in the Spotlight metadata database. Although the type tree gets updated to reflect the proper mapping to the org.neooffice types, the raw type remains fixed to the dynamically generated dyn UTI type and the file cannot be indexed. Workaround is to copy the file to a new file and re-index again.
-* The UTI types are required to be defined before files are manually indexed using mdimport -d3. Files that get forcefully indexed prior to the UTI types being defined will get the wrong UTI type in the Spotlight metadata database. Although the type tree gets updated to reflect the proper mapping to the org.neooffice types, the raw type remains fixed to the dynamically generated dyn UTI type and the file cannot be indexed. Workaround is to copy the file to a new file and re-index again.+* Content is being extracted in Unicode16 encoding, where possible. I am unsure if OOo 1.x files can go to different encodings that may cause the parsers to fail.
-* I have been unable to verify if the text content provided in the kMDItemTextContent key is in fact getting indexed. This key does not show up in the list for mdimport -d3 or -d4. I am unsure if this is a limitation of the build of Tiger on which NeoLight was developed and tested (WWDC 2004).+* Having two copies of NeoLight on the same system is A Bad Thingâ„¢ (particularly if one of them is an older copy, e.g. the NeoLight in the NeoOffice 1.1 bundle). This is a limitation of Apple's Spotlight design.
-* Content is being extracted in UTF-8 encoding, where possible. I am unsure if OOo 1.x files can go Unicode and if I need to handle that differently.+* Installing any other Spotlight indexing plugin that claims the same UTI types as NeoLight may result in an unknown plugin being used.
==Getting the Source Code== ==Getting the Source Code==
Line 224: Line 134:
cvs co neolight cvs co neolight
-This will checkout the neolight module that has the source code for the plugin. Simply open the neolight.xcode project in Xcode and away you go!+This will checkout the neolight module that has the source code for the plugin. Simply open the neolight.xcodeproj project in Xcode 2.1 or later and away you go!
==Source Code Structure== ==Source Code Structure==
Line 235: Line 145:
* impress - Contains functions for SXI file parsing (and SXD) * impress - Contains functions for SXI file parsing (and SXD)
* main - CFPlugin foundational code and dispatch of metadata extraction to appropriate handler based on UTI type * main - CFPlugin foundational code and dispatch of metadata extraction to appropriate handler based on UTI type
 +* base - Contains functions for ODB file parsing.
All of the functions are commented with [http://docpp.sourceforge.net/ Doc++]/JavaDoc style comments, so you should be able to run a documentation generator on the code to browse through it. All of the functions are commented with [http://docpp.sourceforge.net/ Doc++]/JavaDoc style comments, so you should be able to run a documentation generator on the code to browse through it.
Line 242: Line 153:
==Issues and Feedback== ==Issues and Feedback==
-Please note any issues here or in the [http://trinity.neooffice.org/modules.php?name=Forums&file=viewforum&f=15 NeoLight Development forum] on http://trinity.neooffice.org+Please note any issues in [http://bugzilla.neooffice.org/bug.php?op=add&project=2 Bugzilla] or in the [http://trinity.neooffice.org/modules.php?name=Forums&file=viewforum&f=15 NeoLight Development forum] on http://trinity.neooffice.org.
 + 
 +==Binary Changelog==
 + 
 +29.04.2005 ''change install location to /Library/Spotlight''
 + 
 +04.05.2005 ''change from UTF-8 to Unicode; change popen command to use double quotes instead of single''
 + 
 +07.05.2005 ''modify meta.xml parsing for OpenDocument compatibility; add UTI types to plugin's own Info.plist file''
 + 
 +15.05.2005 ''add Apple recommended lsregister command to postflight script of standalone installer''
 + 
 +14.06.2005 ''Fix [http://bugzilla.neooffice.org/bug.php?op=show&bugid=845 bug 845] to index header and footer content''
 + 
 +02.10.2005 ''Universal Binary support; add UTI types for OpenDocument''
 + 
 +27.09.2006 ''OpenDocument Database indexing''
 + 
 +21.06.2007 ''Update for compatibility with Leopard Beta''
 + 
 +{{botlangbarEN|[[nl:NeoLight|Nederlands]]}}
 +[[Category:NeoLight]][[Category:NeoOffice]][[Category:RetroOffice]][[Category:OpenOffice.org]][[Category:Release Notes]]

Current revision

Contents

NeoLight

NeoLight

Edward Peterlin

Authored: 4/29/05

Revised: 6/22/07

What is NeoLight?

NeoLight is an abbreviation I've come up with for "NeoOffice Spotlight Importer". This importer allows Spotlight to index metadata and content within the files created by NeoOffice. Through Spotlight integration, searching across multiple NeoOffice documents can be done in a nice, Mac-like fashion.

Licensing

NeoLight is released under the GNU General Public License. It is our opinion that GPL does not extend to the operating system as GPL contains exceptions for code utilizing standard operating system services.

Downloading

The NeoLight plugin is included by default for all NeoOffice installers. NeoLight updates will be made available with the next NeoOffice patch following the release of a new version of NeoLight.

The NeoLight plugin is no longer available as a download separate from the NeoOffice application. Using the standalone installer can conflict with updates distributed through the NeoOffice patching mechanism. The version of Spotlight in Mac OS X 10.4 is not designed well to handle multiple versions of the same Spotlight indexing plugin in mulitple locations, or multiple plugins that claim to handle the same file type. This may change in the future.

If you have downloaded NeoOffice 2.x, you already have the Spotlight indexing plugin.

  • Latest Version : 1.1.6
  • Last updated 6/21/07
    • most recent update for Leopard support

Installing

Throughout its system, Spotlight identifies files by UTI types. Because Mac OS X does not have built-in types for OpenOffice.org formatted files, they must be defined by an installed application to avoid having Spotlight assign them dynamically-generated UTI types (which cannot reliably be mapped to a Spotlight importer).

NeoLight assumes the following UTI types correspond to the following file types:

  • org.neooffice.writer - Writer "sxw" files and "stw" templates
  • org.neooffice.calc - Calc "sxc" files and "stc" templates
  • org.neooffice.impress - Impress "sxi" files and "sti" templates
  • org.neooffice.draw - Draw "sxd" files and "std" templates (hehe)
  • org.oasis.opendocument.text - OpenDocument Text files "odt" and templates "ott"
  • org.oasis.opendocument.graphics - OpenDocument Graphics files "odg" and templates "otg"
  • org.oasis.opendocument.presentation - OpenDocument Presentation files "odp" and templates "otp"
  • org.oasis.opendocument.spreadsheet - OpenDocument Spreadsheet files "ods" and templates "ots"
  • org.oasis.opendocument.database - OpenDocument Databaes files "odb"

The 1.1 plugin release will define these UTI mappings within the Info.plist of the importer plugin.

NeoLight is automatically installed with NeoOffice.

Testing Your Installation

If you have the Tiger Developer's Tools installed, you can verify proper loading of the plugin from a Terminal after installation using the following command:

/usr/bin/mdimport -L

You should see /Library/Spotlight/neolight.mdimporter in the list if all has been installed well.

To verify that installation was successful:

  1. Launch NeoOffice
  2. Create a new empty Writer document.
  3. Under the File menu item, choose Properties.
  4. Add a Title for the document with a relatively unused nonsense word (e.g. "interzone")
  5. Notice that the title from the Properties dialog appears in the dialog's titlebar.
  6. Save the document to a known location with a filename that does not contain your nonsense word.
  7. Start a new Spotlight search.
  8. Type the nonsense word you used above.

If the NeoLight plugin is installed properly, the document you just saved should show up in the search results. If it doesn't, open a Terminal and type the followng:

/usr/bin/mdimport -d3 /path/to/test/doc.sxw

Check to make sure the document is of type "org.neooffice.writer". If it is, look in the keys for the "Title" key and you should see your nonsense word. If you do, then everything is installed correctly.

If when you type the above the doc is of type "dyn.a3f42morehexgarbageinherefoo", LaunchServices hasn't mapped the extension to the UTI type properly. Either the update to the Info.plist is misapplied or you may need to rebuild your LaunchServices database.

If you want to index several files or directories, you can use the "find"-command. This example let Spotlight index all *sxw-files in your $HOME-directory:

sudo find -s $HOME -name *sxw -exec /usr/bin/mdimport -d3 {} \;

If you'd like Spotlight to just re-index all of your NeoOffice documents automatically, just use the following command:

mdimport -r /Library/Spotlight/neolight.mdimporter

What does NeoLight Import?

NeoLight currently handles all four types of major OOo/NeoOffice documents in a single plugin. It will extract the following:

  • standard OOo metadata (generally accessible and editable through File > Properties)
    • title
    • author/last edited
    • keywords
    • description
    • comments
  • text content from Writer documents for indexing
  • textual display content of all cells of a Calc document for indexing
  • content of bullets, titles, and other text areas for indexing from Impress and Draw documents.
  • for database documents, any standard OOo metadata (optional for database files, apparently) allong with:
    • names of defined forms
    • names of defined tables
    • column names of all tables

Once the NeoLight plugin is installed, it should be possible to search OOo formatted documents by these criteria within Spotlight enabled applications.

OpenDocument Compatibility

Starting with version 1.0.3 (5/7/05), the neolight importer is compatible with both documents generated by NeoOffice/J 0.8.4, NeoOffice/J 1.1, OpenOffice.org 1.x, and OpenOffice.org 2.0 (OpenDocument). While OpenDocument compatibility has not been extensively tested, documents that conform to the approved OpenDocument specification should be compatible.

Version 1.1 (10/2/05) defines UTI types for the OpenDocument o{d,g}* extensions now that the extensions and MIME types have been finalized, so Info.plist editing should no longer be required to start indexing OpenDocument formatted files.

Version 1.1.5 (9/27/06) adds in UTI types and content extraction for OpenDocument database files.

Using NeoLight to Index OpenOffice.org Documents

NeoLight is not specific to NeoOffice and can index any OpenOffice.org 1.x formatted document. Starting with version 1.0.3, no special actions are required to index OpenOffice.org documents besides installing the Neolight plugin. To force reindexing of OOo documents already existing on your computer, you may need to do a find with mdimport as noted above.

Known Issues

  • The UTI types are required to be defined before files are manually indexed using mdimport -d3. Files that get indexed prior to the initial installation of the neolight plugin will get the wrong UTI type in the Spotlight metadata database. Although the type tree gets updated to reflect the proper mapping to the org.neooffice types, the raw type remains fixed to the dynamically generated dyn UTI type and the file cannot be indexed. Workaround is to copy the file to a new file and re-index again.
  • Content is being extracted in Unicode16 encoding, where possible. I am unsure if OOo 1.x files can go to different encodings that may cause the parsers to fail.
  • Having two copies of NeoLight on the same system is A Bad Thingâ„¢ (particularly if one of them is an older copy, e.g. the NeoLight in the NeoOffice 1.1 bundle). This is a limitation of Apple's Spotlight design.
  • Installing any other Spotlight indexing plugin that claims the same UTI types as NeoLight may result in an unknown plugin being used.

Getting the Source Code

The source code is in the NeoOffice CVS repository. To checkout the source code do the following:

csh
setenv CVSROOT :pserver:anoncvs@anoncvs.neooffice.org:/cvs
cvs login

use anoncvs as the cvs password

cvs co neolight

This will checkout the neolight module that has the source code for the plugin. Simply open the neolight.xcodeproj project in Xcode 2.1 or later and away you go!

Source Code Structure

In general, the source code is split up into the following files:

  • common - These contain utility code used across all the file types and common metadata extraction (all the OpenOffice.org file types have the same meta.xml format)
  • writer - Contains functions for SXW file parsing.
  • calc - Contains functions for SXC file parsing.
  • impress - Contains functions for SXI file parsing (and SXD)
  • main - CFPlugin foundational code and dispatch of metadata extraction to appropriate handler based on UTI type
  • base - Contains functions for ODB file parsing.

All of the functions are commented with Doc++/JavaDoc style comments, so you should be able to run a documentation generator on the code to browse through it.

While all of the files are technically Objective-C++, no Cocoa is used in the plugin. It is all CoreFoundation based and I'm essentially using the language as a "better C". Since plugins are supposed to be lightweight, it simply made more sense to re-use the CoreFoundation utilities then to make any grand scheme.

Issues and Feedback

Please note any issues in Bugzilla or in the NeoLight Development forum on http://trinity.neooffice.org.

Binary Changelog

29.04.2005 change install location to /Library/Spotlight

04.05.2005 change from UTF-8 to Unicode; change popen command to use double quotes instead of single

07.05.2005 modify meta.xml parsing for OpenDocument compatibility; add UTI types to plugin's own Info.plist file

15.05.2005 add Apple recommended lsregister command to postflight script of standalone installer

14.06.2005 Fix bug 845 to index header and footer content

02.10.2005 Universal Binary support; add UTI types for OpenDocument

27.09.2006 OpenDocument Database indexing

21.06.2007 Update for compatibility with Leopard Beta


This article in other languages: Nederlands
Personal tools