[p]This chapter documents tags and behaviors which are specific to the Spotlight and custom third
[p]The Spotlight data source allows the meta information which is generated by the Spotlight indexer on Mac OS X 10.4/10.5 to be searched by Lasso. This data source provides an effective file system search which is powerful and efficient. [/p]
[p]This chapter also includes information about how to use custom third
[table][tr][th]Data Source[/th][th]Description[/th][th] [/th][/tr]
[tr][td]Spotlight[/td][td]Supports searching files on Mac OS X 10.4/10.5 systems only. [/td][/tr]
[tr][td]Custom[/td][td]Lasso allows third parties to create data sources using LassoScript, LCAPI, or LJAPI. [/td][/tr]
[/table]
[p]The following tables detail the features of each data source in this chapter. Since some features are only available in certain data sources it is important to check these tables when reading the documentation in order to ensure that each data source supports your solutions required features. [/p]
[table][tr][th]Feature[/th][th]Description[/th][th] [/th][/tr]
[tr][td]Platform[/td][td]Mac OS X Only [/td][/tr]
[tr][td]Friendly Name[/td][td]Lasso Connector for Spotlight [/td][/tr]
[tr][td]Internal Name[/td][td]spotlightds. [/td][/tr]
[tr][td]Module Name[/td][td]SpotlightDS.dylib [/td][/tr]
[tr][td]Actions[/td][td]
[tr][td]Operators[/td][td]
[tr][td]Notes[/td][td]This data source differs significantly from other built
[/table]
[table][tr][th]Feature[/th][th]Description[/th][th] [/th][/tr]
[tr][td]Module Name[/td][td]Third
[tr][td]Inline Host Attributes[/td][td]Data source dependent. Third
[tr][td]Actions[/td][td]Data source dependent. Third
[/table]
[p]The Spotlight data source is used to search the file system on machines with Mac OS X 10.4/10.5. This data source is not supported on earlier versions of Mac OS X or on Windows or Linux. [/p]
[p]The Spotlight data source has one pre
[p]Apple’s developer information page about Spotlight provides a conceptual background to how Spotlight works, what types of metadata are indexed, and how to run Spotlight queries from the command line. [/p]
[pre]http://developer.apple.com/macosx/spotlight.html [/pre]
[note][b]Important: [/b]The Spotlight data source searches the raw contents of files. When the Web site root is searched the raw LassoScript contained within Lasso pages will be searched, not the output of those pages. [/note]
[p]The Spotlight data source requires Mac OS X 10.4/10.5. The Spotlight data source can only be used to search for files and folders which have been indexed by the Spotlight indexer. [/p]
[p]Sites will only be able to return Spotlight search results for files contained within their Web server root unless the Server Administrator has granted the site permission to access files outside the root and appropriate file permissions have been granted to the user who is performing the search. [/p]
[p]Lasso defines four Spotlight metadata sets as databases within Lasso Site Administration. A set will also be defined for each volume which is mounted on the machine hosting Lasso Service. Each set must be enabled and appropriate permissions assigned to it before they can be searched by the site user. Some of the sets also require file permissions to be configured. Each metadata set can be enabled by visiting the Site > Data Sources > Databases section of Lasso Site Administration. [/p]
[note][b]Note: [/b]The [code]
[p]The fields for Spotlight are defined by the file importers which are active on the system. The following table lists some of the most common field names. See below the table for code which returns a complete list of available field names. [/p]
[table][tr][th]Field Name[/th][th]Description[/th][th] [/th][/tr]
[tr][td]Content Created[/td][td]The date/time the contents were created (06/03/20 19:20:58 GMT-08:00) [/td][/tr]
[tr][td]Content Modified[/td][td]The date/time the contents were modified (06/05/04 09:56:25 GMT-07:00) [/td][/tr]
[tr][td]Created[/td][td]The date/time the file was created (06/03/20 19:20:58 GMT-08:00) [/td][/tr]
[tr][td]Display Name[/td][td]The name of the file in the Finder (default.lasso) [/td][/tr]
[tr][td]File Extension Hidden[/td][td]Is the file extension hidden in the Finder (false) [/td][/tr]
[tr][td]File Invisible[/td][td]Is the file invisible in the Finder (false) [/td][/tr]
[tr][td]File Label[/td][td]The ID of the Finder label for the file (0) [/td][/tr]
[tr][td]File Pathname[/td][td]The path to the file (/Library/WebServer/Documents/85/default.lasso). This is the only field which is returned by default if no
[tr][td]Filename[/td][td]The name of the disk file (default.lasso) [/td][/tr]
[tr][td]Group[/td][td]The ID of the group which owns the file (80) [/td][/tr]
[tr][td]Last Opened[/td][td]The date/time the file was last opened (06/05/04 09:48:49 GMT-07:00) [/td][/tr]
[tr][td]Modified[/td][td]The date/time the file was modified (06/05/04 09:56:25 GMT-07:00) [/td][/tr]
[tr][td]Owner[/td][td]The ID of the user who owns the file (501) [/td][/tr]
[tr][td]Size[/td][td]The size of the file in bytes (24666) [/td][/tr]
[tr][td]Text Content[/td][td]The contents of the file. This field can be used for searching, but is not returned in search results. [/td][/tr]
[tr][td]Type[/td][td]The type of the file (text file) [/td][/tr]
[tr][td]*[/td][td]Can be specified as the return field to return all available fields
[tr][td]kMDItem…[/td][td]It is also possible to use any of the low
[/table]
[p]Use an inline with a [code]
[pre]Inline:
Field_Names->Sort & Join('<br>');
/Inline; [/pre]
[pre]
Album
Alpha channel
Aperture
Audiences
Audio bit rate
Audio encoding application
… [/pre]
[p]Spotlight queries can make use of any of the fields listed in the table above (or returned by the [code]
[pre]Inline:
'Display Name' = 'default';
Records_Array->Join('<br>');
/Inline; [/pre]
[pre]
/Library/WebServer/Documents/default.html
/Library/WebServer/Documents/default.lasso [/pre]
[p]The operator can be changed by preceding the search terms with any of Lasso’s built
Inline:
Records_Array->Join('<br>');
/Inline;
[pre]
/Library/WebServer/Documents/default.lasso
/Library/WebServer/Documents/include.lasso [/pre]
[p]The [code]
Inline:
Records_Array->Join('<br>');
/Inline;
[pre]
/Library/WebServer/Documents/default.lasso [/pre]
[p]When searching fields whose value is an integer, decimal, or boolean value an “Equals” search is used automatically. The operator can be changed by preceding the search terms with any of Lasso’s built
[pre]Inline:
Records_Array->Join('<br>');
/Inline; [/pre]
[pre]
/Library/WebServer/Documents/splah.swf [/pre]
[p]A query can be restricted to a sub
[p]The following code searches only within [code]Images[/code] folders inside the Web root. Note that any path which contains [code]/Images/[/code] is searched including an [code]Images[/code] folder at the root of the Web server and an [code]Images[/code] folder within a sub
[pre]Inline:
Records_Array->Join('<br>');
/Inline; [/pre]
[pre]
/Library/WebServer/Documents/Images/logo.gif
/Library/WebServer/Documents/Images/welcome.gif
/Library/WebServer/Documents/Admin/Images/secure.gif [/pre]
[pre]Spotlight Return Fields [/pre]
[p]By default the Spotlight data source only returns the [code]File Pathname[/code] field. Additional fields can be returned by listing the desired field names with
[p]For example, the following code returns information about an AAC encoded audio file. The [code]
[pre]Inline:
Records;
'Album: ' + (Field: 'Album') + '<br>';
'File Pathname: ' + (Field: 'File Pathname') + '<br>';
'Title: ' + (Field: 'Title') + '<br>';
/Records;
/Inline; [/pre]
[pre]
Album: Music From The Good, The Bad And The Ugly & A Fistful Of Dollars & For A Few Dollars More
File pathname: /Library/WebServer/Documents/01 The Good, The Bad And The Ugly.m4a
Title: The Good, The Bad And The Ugly [/pre]
[p]If [code]
[pre]Inline:
Records;
Iterate: Field_Names->Sort &, (Var: 'field');
(Field: $field) != '' ? $field + ': ' + (Field: $field) + '<br>';
/Iterate;
'<hr>';
/Records;
/Inline; [/pre]
[pre]
Album: Music From The Good, The Bad And The Ugly & A Fistful Of Dollars & For A Few Dollars More
Audio bit rate: 124.852
Audio encoding application: iTunes v4.0.1, QuickTime 6.4
Channel count: 2
Display name: 01 The Good, The Bad And The Ugly.m4a
Duration: 166.997
File pathname: /Library/WebServer/Documents/01 The Good, The Bad And The Ugly.m4a
Filename: 01 The Good, The Bad And The Ugly.m4a
Modified: 04/02/18 07:56:52 GMT-08:00
Musical genre: Soundtrack
Size: 2722974
Streamable: false
Title: The Good, The Bad And The Ugly
Total bit rate: 124.852
Track number: 1
Type: MPEG-4 Audio File [/pre]
[p]The Spotlight data source supports the [code]
[pre]Inline:
Action_Statement;
/Inline; [/pre]
[pre]
((kMDItemFSSize > 32768)) [/pre]
[p]That raw query can then be executed by feeding it into the Spotlight data source through the [code]
[pre]Inline:
Records_Array->Join('<br>');
/Inline; [/pre]
[pre]
splah.swf [/pre]
[p]Third
[p]See the Custom Data Sources, LCAPI Data Sources, or LJAPI Data Sources chapters in this manual for more information about third
[pre]Custom Inline Data Source
http://www.lassosoft.com/TotW.1768.8931.lasso[/pre]