Bug 49939 - Exported kMDItemContentTypeTree is missing root (was: .Odf files not showing in Document search!)
Summary: Exported kMDItemContentTypeTree is missing root (was: .Odf files not showing ...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.5.3 release
Hardware: x86 (IA32) macOS (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-14 23:36 UTC by Allards
Modified: 2017-08-26 16:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test .odt file used. (8.31 KB, application/vnd.oasis.opendocument.text)
2012-05-18 09:50 UTC, Allards
Details
Test .ods file used (7.10 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-05-19 01:54 UTC, Allards
Details
Test .odf file used (4.50 KB, application/vnd.oasis.opendocument.formula)
2012-05-19 02:00 UTC, Allards
Details
Test .odg file used (7.84 KB, application/vnd.oasis.opendocument.graphics)
2012-05-19 02:00 UTC, Allards
Details
Test .odp file used (13.89 KB, application/vnd.oasis.opendocument.presentation)
2012-05-19 02:01 UTC, Allards
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allards 2012-05-14 23:36:29 UTC
Using LibreOffice together with Alfred on my Mac the .odf are not showing up in the search results. This could be related to "LibreOffice not exporting the correct UTI types"

For more details please take a look here.
https://getsatisfaction.com/alfredapp/topics/_odf_files_not_showing_in_document_search?utm_content=topic_link&utm_medium=email&utm_source=reply_notification

i'm not a dev so!
Comment 1 Julien Nabet 2012-05-18 07:13:53 UTC
Do you reproduce this with a brand new file ?

BTW, I wanted to post this :
"
I'm trying to reproduce the bug but I've got fewer elements returned by mdls on new files (an odf and an ods file). For example, there's no kMDItemContentTypeTree.
I'm mainly use Linux and I know very little about Mac, could anybody give me advice ?
"
but it needed an account and I didn't want to create one.

The weird thing is everything seems there (I compared ods and odf declarations) when we look at http://opengrok.libreoffice.org/xref/core/sysui/desktop/macosx/Info.plist
but perhaps I missed something.
Comment 2 Allards 2012-05-18 09:50:18 UTC
Created attachment 61810 [details]
Test .odt file used.
Comment 3 Allards 2012-05-18 09:52:23 UTC
@Julien tnx for looking into this, i'm not a dev but willing to help out where i can.

I created a brand new test file and ran a new mdls i attached the test.odt to this page. 
Let me know if you have additional questions.

 mdls test.odt
kMDItemContentCreationDate     = 2012-05-18 16:48:11 +0000
kMDItemContentModificationDate = 2012-05-18 16:48:11 +0000
kMDItemContentType             = "org.oasis-open.opendocument.text"
kMDItemContentTypeTree         = (
    "org.oasis-open.opendocument.text",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded               = 2012-05-18 16:48:11 +0000
kMDItemDisplayName             = "test.odt"
kMDItemFSContentChangeDate     = 2012-05-18 16:48:11 +0000
kMDItemFSCreationDate          = 2012-05-18 16:48:11 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "test.odt"
kMDItemFSNodeCount             = 8514
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 8514
kMDItemFSTypeCode              = ""
kMDItemKind                    = "OpenDocument Text"
kMDItemLastUsedDate            = 2012-05-18 16:48:12 +0000
kMDItemLogicalSize             = 8514
kMDItemPhysicalSize            = 12288
kMDItemUseCount                = 2
kMDItemUsedDates               = (
    "2012-05-17 22:00:00 +0000"
)
Comment 4 Julien Nabet 2012-05-18 13:26:51 UTC
You created an odt file but you said that the pb was with odf file.
Could you create a new odf file and give the results of mdls on it ?

As for me, I don't have anything for kMDItemContentTypeTree or kMDItemContentType when I launch mdls on your file. Perhaps I must configure Spotlight before.
Comment 5 Allards 2012-05-18 13:32:58 UTC
This was new file, what's PB?
Comment 6 Julien Nabet 2012-05-18 15:41:12 UTC
(In reply to comment #5)
> This was new file, what's PB?

There's no pb with your file, the pb is my lack of knowledge with Macos world. I don't know why mdls doesn't show the 2 attributes I quoted.

Anyway, as I said, it could be useful you give mdls results from a ods file + mdls results from a odf file to compare.
Comment 7 Allards 2012-05-19 01:54:51 UTC
Created attachment 61826 [details]
Test .ods file used
Comment 8 Allards 2012-05-19 01:55:23 UTC
I ran an mdls on a .ods 


mdls test.ods
kMDItemContentCreationDate     = 2012-05-19 08:53:52 +0000
kMDItemContentModificationDate = 2012-05-19 08:53:52 +0000
kMDItemContentType             = "org.oasis-open.opendocument.spreadsheet"
kMDItemContentTypeTree         = (
    "org.oasis-open.opendocument.spreadsheet",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded               = 2012-05-19 08:53:52 +0000
kMDItemDisplayName             = "test.ods"
kMDItemFSContentChangeDate     = 2012-05-19 08:53:52 +0000
kMDItemFSCreationDate          = 2012-05-19 08:53:52 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "test.ods"
kMDItemFSNodeCount             = 7271
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 7271
kMDItemFSTypeCode              = ""
kMDItemKind                    = "OpenDocument Spreadsheet"
kMDItemLastUsedDate            = 2012-05-19 08:53:53 +0000
kMDItemLogicalSize             = 7271
kMDItemPhysicalSize            = 8192
kMDItemUseCount                = 2
kMDItemUsedDates               = (
    "2012-05-18 22:00:00 +0000"
)
Allards-MacBook-Pro:desktop Allards$
Comment 9 Allards 2012-05-19 01:59:46 UTC
ODF

mdls test.odf
kMDItemContentCreationDate     = 2012-05-19 08:57:50 +0000
kMDItemContentModificationDate = 2012-05-19 08:57:53 +0000
kMDItemContentType             = "org.oasis-open.opendocument.formula"
kMDItemContentTypeTree         = (
    "org.oasis-open.opendocument.formula",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded               = 2012-05-19 08:58:12 +0000
kMDItemDisplayName             = "test.odf"
kMDItemFSContentChangeDate     = 2012-05-19 08:57:53 +0000
kMDItemFSCreationDate          = 2012-05-19 08:57:50 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "test.odf"
kMDItemFSNodeCount             = 4610
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 4610
kMDItemFSTypeCode              = ""
kMDItemKind                    = "OpenDocument Formula"
kMDItemLastUsedDate            = 2012-05-19 08:57:54 +0000
kMDItemLogicalSize             = 4610
kMDItemPhysicalSize            = 8192
kMDItemUseCount                = 3
kMDItemUsedDates               = (
    "2012-05-18 22:00:00 +0000"
)
Comment 10 Allards 2012-05-19 02:00:08 UTC
Created attachment 61827 [details]
Test .odf file used
Comment 11 Allards 2012-05-19 02:00:37 UTC
Created attachment 61828 [details]
Test .odg file used
Comment 12 Allards 2012-05-19 02:01:02 UTC
Created attachment 61829 [details]
Test .odp file used
Comment 13 Roman Eisele 2012-10-04 14:58:20 UTC
Allards has answered all questions (thank you very much!), therefore the NEEDINFO status is not appropriate. But I can not confirm this issue right now, therefore I reset it to UNCONFIMED, sorry! This has some advantage: at least UNCONFIRMED bugs will not be closed after some time, so this status is better than NEEDINFO ;-)
Comment 14 Uwe Altmann 2012-10-10 08:15:45 UTC
Someone forgot to post the answer from Alfred team here (https://getsatisfaction.com/alfredapp/topics/_odf_files_not_showing_in_document_search?utm_content=topic_link&utm_medium=email&utm_source=reply_notification):

The kMDItemContentTypeTree is missing "org.oasis-open.opendocument" which should be there as listed here: 
http://en.wikipedia.org/wiki/OpenDocument in the "UTI conforms to" section and... 
http://www.escape.gr/manuals/qdrop/UTI.html in the "conforms to" 

These could be missing on your mac due to a bug in LibreOffice not exporting the correct UTI types so it may be worth raising an issue with them? 
It is the "org.oasis-open.opendocument" classification which is required for a 'document' classification as far as Alfred is concerned as this covers all open doc types.
Comment 15 QA Administrators 2015-01-05 17:52:17 UTC Comment hidden (obsolete)
Comment 16 Alex Thurgood 2015-03-25 16:06:27 UTC
So, Alfred (currently at version 2) is a third party search tool.

As OSX Finder allows one to search for ODF documents (both in terms of filename and content strings), why should we be bothered about this third party tool ?

I would be tempted to mark this as NOTOURBUG or WONTFIX, unless it can still be shown that it is LibreOffice's fault - which doesn't appear to be the case, at least for Finder.
Comment 17 tommy27 2016-04-16 07:28:28 UTC Comment hidden (obsolete)
Comment 18 QA Administrators 2017-05-22 13:26:31 UTC Comment hidden (obsolete)
Comment 19 eisa01 2017-08-26 16:06:43 UTC
According to comment #14 the LibreOffice files are missing "org.oasis-open.opendocument" from the kMDItemContentTypeTree, and I see the mdls logs posted don't have them

When I run mdls on my mac on the test files here, they are present now

This is in fact set by the Spotlight importer, so this has been resolved, but was not a bug in LibreOffice

https://developer.apple.com/library/content/documentation/CoreServices/Reference/MetadataAttributesRef/Reference/CommonAttrs.html

kMDItemContentType
Uniform Type Identifier of the file. For example, a jpeg image file will have a value of public.jpeg. The value of this attribute is set by the Spotlight importer. Changes to this value are lost when the file attributes are next imported.
This attribute is marked as nosearch. You must specify this attribute key explicitly in a query in order for its contents to be searched.

Version: 5.4.0.3
Build ID: 7556cbc6811c9d992f4064ab9287069087d7f62c
CPU threads: 2; OS: Mac OS X 10.12.6; UI render: default; 
Locale: en-US (en_US.UTF-8); Calc: group


mdls test2.odf 
_kMDItemOwnerUserID            = 501
kMDItemContentCreationDate     = 2017-08-26 15:58:48 +0000
kMDItemContentModificationDate = 2017-08-26 15:58:48 +0000
kMDItemContentType             = "org.oasis-open.opendocument.formula"
kMDItemContentTypeTree         = (
    "org.oasis-open.opendocument.formula",
    "org.oasis-open.opendocument",
    "public.data",
    "public.archive",
    "public.item",
    "public.content",
    "public.zip-archive",
    "org.oasis-open.opendocument.formula",
    "com.pkware.zip-archive"
)
kMDItemDateAdded               = 2017-08-26 15:58:48 +0000
kMDItemDisplayName             = "test2.odf"
kMDItemFSContentChangeDate     = 2017-08-26 15:58:48 +0000
kMDItemFSCreationDate          = 2017-08-26 15:58:48 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = (null)
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = (null)
kMDItemFSLabel                 = 0
kMDItemFSName                  = "test2.odf"
kMDItemFSNodeCount             = (null)
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 4264
kMDItemFSTypeCode              = ""
kMDItemKind                    = "OpenDocument Formula"
kMDItemLogicalSize             = 4264
kMDItemPhysicalSize            = 8192