Spotlight Importer in Xcode 6. Up to date documentation? - plugins

I need to develop a spotlight importer for a custom data type on Xcode 6
The online apple documentation seems quite comprehensive, and there is also a nice example project here. Only problem is, when I create a new Spotlight Importer project in Xcode 6, the template doesn't look at all like anything described in the official docs. For example, there's no schema.xml file, there is different and obscure terminology like store file uti, external record uti, etc.
It looks like the apple docs are seriously out of date. Can anybody provide some help? A link to some third party tutorial or example project?

The documentation isn't really out of date. It's just that the template in Xcode 6 assumes your application uses Core Data. You can find details in the Core Data Spotlight Integration Programming Guide.
However, you can pretty easily adapt the project created from the Spotlight Importer template so that it lets you create a normal importer. I recently did this in order to write an importer that processed Lua source files so that I could use Spotlight to search for particular functions, etc.
If you were going to create lots of importers, you could create a custom template that has the following fixes applied. But I'm not, so I didn't...
Create a new project using the Spotlight Importer template and then:
Remove MySpotlightImporter.{h, m}
Gut the implementation of GetMetadataForFile() in GetMetadataForFile.m
Add schema.xml and schema.strings using the Empty file template
Edit Info.plist to correctly describe your Exported Type UTIs (if any).
You can find the details on schema.xml in Apple's documentation. Now you just need to implement GetMetadataForFile() so that it behaves appropriately for your custom file format.

Related

How to create the affix and dic files for postgresql text search

I wanna use postgresql's text search capability for one of my projects. The language supported gonna be in english and indonesian. Unfortunately, I can't find indonesian config to be used. (example is here https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html)
Looking at https://www.postgresql.org/docs/11/textsearch-dictionaries.html, it seems I can make my own custom stopwords, affix, and dic files. I already found and load the stopwords file (from https://github.com/masdevid/ID-Stopwords), meanwhile for the affix (the rule looks like here http://indodic.com/affixeng.html) I can't seem to find the file, or the way to write the affix/dic file.
Can someone point out to me how, or possibly where can I find some information in more details?
The Ispell link referenced in the PostgreSQL documentation has the following information:
Complete documentation for ispell, including documentation of the affix-file format, comes with the distribution kit in Unix manual-page format. If you have ispell installed on your machine, you should be able to type "man ispell" to view it. For convenience and browsing, the primary manual page for ispell is also available online.
You will have to study that, then you can create an affix file.

Why don't the Target 8 files implement the project as described in the tutorial?

In Target 8: Define a Custom DOM Tag, the reader is told about custom DOM tags that can be created by extending other tags. A sample is described for an example called "x-converter" before listing the files as "These files implement the app:".
The three files are...
a drseuss.html file (not sure why there's a sudden deviation in the project name and the HTML file, as opposed to the matching names in previous tutorials...),
a converter-element.html file,
and a convertercomponent.dart file.
I tried creating a new application in the latest Dart editor, and replaced the default HTML file contents with that of drseuss.html, replaced the default dart file contents with that of convertercomponent.dart, and added converter-element.html file.
After fixing an include issue (the file from the tutorial refers to drseuss.css and not the default project name's CSS file), I only see the following in the Chromium browser.
As you can see, the element described in the tutorial (converter-element) doesn't show up. Why don't the files provided for the project result in what's shown in the tutorial?
For reference, here's what's shown in the tutorial.
Web UI requires the build.dart script which compiles the various components into the executable output HTML+Dart.
Take a look at the parent folder in the github src that you reference, and you will see the build.dart script.
In addition, you will need the pubspec.yaml from that folder, too, which includes web_ui package, which brings in the dwc tool(Dart Web Components compiler) used by build.dart.
Take a look at the article Tools for Web UI for more information about dwc and build.dart, and Target 6 - Getting Started with Web UI which covers similar ground, but in a tutorial format.

Use .mdb file instead of SQLite in iOS app ?

How can I use the .mdb file instead of SQLite, I am working on a project that will load and update data from .mdb file. I search about it but can't found anything can you poeple guide me.
MDB Tools is an opensource project that aims to bring support of the prorpietary MDB file format of Microsoft Access to POSIX systems. Since it's written in pure C, it should be fairly easy to integrate this project in your iOS app. (You should specifically be looking at its libmdb part.)
.mdb is not supported with iOS API. You should convert your .mdb file into sqlite file to access through iOS API.

How to use Offline Cloudmade Maps in an iPhone App

I’ve looked through the posts on the Cloudmade site here and I get some of it, but not all. I've posted the question below, but haven't had the help I need, so I thought I'd ask the question here.
I can see that I need to:
download the tiles for the required area to my Mac (but can’t see how to do this)
convert these to a sqlite database using the map2sqlite utility, changing the code to output the tiles to a table called “ZCACHE”, not “tiles”
Copy the DB to the Application Bundle
insert some code to copy this DB on first run, from the Application Bundle to the Documents Directory
Somehow get App to use this DB and not an online one – I can’t see how that’s done.
Any help would be warmly welcomed,
Chris.
The best solution for me to have iPhone offline maps is:
1.- Generate your own maps with TileMill and then export to MBTiles format.
2.- Get the mbtiles-ios-example and use the MBTiles file you just generated. In order to compile it, you need to download Route-Me and add it to the project.
Now, there is another option (not for free): Mapbox.
please check this tutorial, it can help - http://www.gisnotes.com/wordpress/category/sqlite3/.

Programmatically convert DITA to FrameMaker

Is there a toolkit available (paid or otherwise) to help with programmatically converting a DITA document to a FrameMaker one?
I'm attempting to make an application that converts to multiple formats from DITA. I know I can use the DITA Open Toolkit for most of my needs, but I need to be able to create a native FrameMaker document as well.
Programing language doesn't matter, altho I prefer Java as my application will be web based.
Arbortext import-export is industrial strength and very flexible. You could also try MIFtoGo. Conversion is tricky because source documents are rarely consistent. Conversion without cleanup before and after is next to impossible.
DITA-FMx is what you need:
http://leximation.com/dita-fmx/
Using DITA-FMx, you generate a FrameMaker book from your ditamap (and then save the FM book as PDF).
There is a movie on YouTube that shows you how the process goes. Just search for "PDF Publishing with DITA-FMx 1.1" (Stack Overflow does not allow me to post a second URL here yet)
If you like to see an example, just send me a small sample of a ditamap and I'll generate a FrameMaker book for you.
The disclaimer is that if you're converting a lot of documents you'll be better off with a supported well-integrated solution that fully uses FrameMaker's DITA support. If you're looking to do it on the cheap though (and who isn't) you can do this conversion by using straight XSLT and framemaker templates.
First create the framemaker template to handle the appearance of the document, then use XSLT to map your DITA content to the content tags you've used in Framemaker.
You can use the free SAXON xslt interpretor to do the actual conversion.
Here is some of adobe's reference material on authoring new DITA documents:
http://help.adobe.com/en_US/FrameMaker/8.0/05h/dita.html
Info on Framemakers's native XML support is here:
http://www.adobe.com/products/framemaker/pdfs/xml_fm7.pdf
The framemaker manuals also cover the subject quite extensively. Hope that helps
Indeed FM supports loading DITA files (I tried FM10 and newer) but to automate conversion to .FM format you either use the internal scripting mechanism which is still some manual work.
I have found an existing free utility that can do most basic operations like opening a file, 'saving as' another format and closing it.
tool name is DZBatcher
Example DZbatcher batch file:
Open "c:\My Dita Files\Doc1.dita"
SaveAs -d "c:\My FM Files\Doc1.fm"
Close "c:\My FM Files\Doc1.fm"
Open "c:\My Dita Files\Doc2.dita"
SaveAs -d "c:\My FM Files\Doc2.fm"
Close "c:\My FM Files\Doc2.fm"
Exit
Adobe has a framework called RoboHelp which is probably the infrastructure for this, but I didn't dig deeper as this utility did the job perfectly.
In my SW flow, I created this batch file using a python script that scan all the docs in an input directory and added 3 lines per file as seen above.
I used FM2015 for this task.
Bryan, after a decade's experience converting Frame, Word, Interleaf, etc to XML, I'll tell you that Adobe doesn't have it fully covered. The DITA support in FrameMaker works best if you also have the Leximation plug-in or know how to program the Adobe proprietary EDD. You can't do DITA specialization without programming the EDD in FrameMaker.
FrameMaker has excellent support for DITA. You can open DITA topics, and save them (if you wish) as .fm files. You could also open DITAMAPS, and save them as FrameMaker book files, or as composite (monolithic) .fm files. There is no need to write a parser.
PS: I am talking about FM 12.