Nuxeo Content Services Platformの重要な機能として、ファイルのテキストコンテンツのインデックス作成があります。ユーザは、オフィスファイルについてはそれほど期待しませんが、このプラットフォームでは、通常は多くのテキストが含まれているメディアアセットを同じ環境で使用できます。Adobe Illustrator(.ai)とカプセル化PostScript(.eps)。最も重要な点は、Nuxeo Studioがこの機能を設定するのに数分しかかからないことです!
aiファイルとepsファイルのテキストコンテンツのインデックス作成は、2つのステップで行われます。まず、Ghostscriptを使用してファイルをPDFに変換し、PDFからテキストコンテンツを抽出します。Ghostscriptは、すでにプラットフォームで使用されている第三者ツールの一部ですので、ここで余分なインストール手順を行う必要はありません。必要なことは、Studioでコマンドラインとコンバータを構成することだけです。
コマンドラインから始めましょう!Nuxeoプラットフォームはコマンドラインエグゼキュータサービスを提供しているので、次のXMLへの貢献に新しいコマンドを登録するだけでよいのです。
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"><command enabled="true" name="ps2pdf"></command><commandline>gs</commandline> <wincommand>gswin64c</wincommand> <parameterstring>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=#{targetFilePath} #{sourceFilePath}</parameterstring> <installationdirective>You need to install GhostScript.</installationdirective></extension>
インストールが完了すると、前のコマンドを使用するコンバータを登録できます。
<extension point="converter" target="org.nuxeo.ecm.core.convert.service.ConversionServiceImpl"><converter class="org.nuxeo.ecm.platform.convert.plugins.CommandLineConverter" name="psi2pdf"><sourcemimetype>application/postscript</sourcemimetype> <sourcemimetype>application/eps</sourcemimetype> <sourcemimetype>application/x-eps</sourcemimetype> <sourcemimetype>image/eps</sourcemimetype> <sourcemimetype>image/x-eps</sourcemimetype> <sourcemimetype>application/illustrator</sourcemimetype> <destinationmimetype>application/pdf</destinationmimetype> <parameters><parameter name="CommandLineName">ps2pdf</parameter></parameters></converter></extension>
最後に、サブコンバータを連鎖させるNuxeo Platformの変換サービスの特徴を少し活用します。前に定義したコンバータを使用し、プラットフォームにすでに登録されているpdf2textコンバータで連鎖させます。
<extension point="converter" target="org.nuxeo.ecm.core.convert.service.ConversionServiceImpl"><converter name="ps2pdf2text"><sourcemimetype>application/postscript</sourcemimetype> <sourcemimetype>application/eps</sourcemimetype> <sourcemimetype>application/x-eps</sourcemimetype> <sourcemimetype>image/eps</sourcemimetype> <sourcemimetype>image/x-eps</sourcemimetype> <sourcemimetype>application/illustrator</sourcemimetype> <destinationmimetype>text/plain</destinationmimetype> <conversionsteps><subconverter>ps2pdf</subconverter> <subconverter>pdf2text</subconverter></conversionsteps></converter></extension>
プラットフォームは、ファイルのテキストコンテンツのインデックスを作成する必要があることをどのように認識するのでしょうか?これには、text / plainを返すソースファイルのMIMEタイプ用のコンバータを必要とします。このプラットフォームは、テキストコンテンツを抽出してインデックスを作成するのにこのコンバータを使用します。
テキストコンテンツ検索
これはすべて構成のためのものです。このアプリケーションで、Adobe Illustratorとカプセル化PostScriptファイルのテキストコンテンツのインデックスが作成できるようになりました。