The File System Connector performs full and incremental scans over a file system folder and will extract metadata and content from each file scanned. The connector allows you to filter the scanned files using regular expression patterns, to include subfolders in the results, and to scan subfolder content. Each scanned file will be tagged with one of three possible actions--add, update, or delete--and can be routed to any Aspire pipeline as desired.

The connector, once started, can be stoppedpaused or resumed sending a new Scanner Configuration Job. Typically the start job will contain all information required by the job to perform the scan. When pausing or stopping, the connector will wait until all the jobs it published have completed before updating the statistics and status of the connector.

File System Application Bundle (Aspire 2)
AppBundle Name File System Connector
Maven Coordinates com.searchtechnologies.aspire:app-filesystem-connector
Versions 2.0
Type Flags scheduled
Inputs AspireObject from a content source submitter holding all the information required for a crawl.
Outputs An AspireObject containing the URL, content, ACLs and Metadata processed for each file.

Configuration

This section lists all configuration parameters available to install the File System Application Bundle and to execute crawls using the connector.

General Application Configuration

PropertyTypeDefaultDescription
snapshotDirstring${aspire.home}/snapshotsThe directory for snapshot files to be stored.
disableTextExtractbooleanfalseBy default, connectors use Apache Tika to extract text from downloaded documents. If you wish to apply special text processing to the downloaded document in the workflow, you should disable text extraction. The downloaded document is then available as a content stream.
workflowReloadPeriodint15mThe period after which to reload the business rules. Defaults to ms, but can be suffixed with ms, s, m,h ord to indicate the required units.
workflowErrorTolerantbooleanfalseWhen set, exceptions in workflow rules will only affect the execution of the rule in which the exception occurs. Subsequent rules will be executed and the job will complete the workflow successfully. If not set, exceptions in workflow rules will be re-thrown and the job will be moved to the error workflow.
debugBooleanfalseControls whether debugging is enabled for the application. Debug messages will be written to the log files.


Configuration Example

To install the application bundle, add the configuration, as follows, to the <autoStart> section of the Aspire settings.xml.

  <application config="com.searchtechnologies.aspire:app-filesystem-connector">
    <properties>
      <property name="generalConfiguration">true</property>
      <property name="snapshotDir">${aspire.home}/snapshots</property>
      <property name="disableTextExtract">false</property>
      <property name="workflowReloadPeriod">15s</property>
      <property name="workflowErrorTolerant">false</property>
      <property name="debug">true</property>
    </properties>
  </application>

Any optional properties can be removed from the configuration to use the default value described in the table above.

Source Configuration

Scanner Control Configuration

The following table describes the list of attributes that the AspireObject of the incoming scanner job requires to correctly execute and control the flow of a scan process.

ElementTypeOptionsDescription
@actionstringstart, stop, pause, resume, abortControl command to tell the scanner which operation to perform. Use start option to launch a new crawl.
@actionPropertiesstringfull, incrementalWhen a start @action is received, it will tell the scanner to either run a full or an incremental crawl.
@normalizedCSNamestring
Unique identifier name for the content source that will be crawled.
displayNamestring
Display or friendly name for the content source that will be crawled.

Header Example

  <doc action="start" actionProperties="full" actionType="manual" crawlId="0" dbId="0" jobNumber="0" normalizedCSName="FeedOne_Connector"
   scheduleId="0" scheduler="##AspireSystemScheduler##" sourceName="ContentSourceName">
    ...
    <displayName>testSource</displayName>
    ...
  </doc>

All configuration properties described in this section are relative to /doc/connector source of the AspireObject of the incoming Job.

ElementTypeDefaultDescription
urlstring
The file URL to crawl. Use the default Windows/Linux file path formats depending on the platform you are running on.

I.e. Linux: /home/user/folder1/Windows: C:\folder1\

partialScanbooleanfalseTo run a partial scan – i.e. to only scan a portion of the larger directory. This is useful to re-process portions of your system without having to process the entire content source.
subDirUrlstring
Configurable when partialScanis set to true. The sub-directory which contains the documents to be processed for this partial scan. This directory must be a relative path to the parent directory. Only the documents in this sub-directory will be scanned. This is useful to re-process portions of your system without having to process the entire content source. For Windows use \ as folder separator, forlinux use /.
indexContainersbooleanfalsetrue if folders (as well as files) should be indexed.
scanRecursivelybooleanfalsetrue if subfolders of the given URL should be scanned.
fileNamePatterns/include/@patternregexnoneOptional. A regular expression pattern to evaluate file URLs against; if the file name matches the pattern, the file is included by the scanner. Multiple include nodes can be added.
fileNamePatterns/exclude/@patternregexnoneOptional. A regular expression pattern to evaluate file URLs against; if the file name matches the pattern, the file is excluded by the scanner. Multiple exclude nodes can be added.
acl/userstringnoneOptional. A list of users that can be added as fixed ACLs. See valid attributes below.
acl/user/@domainstringnoneDomain of the user added.
acl/user/@namestringnoneName of the user added.
acl/user/@typestringnoneType of the user acl added: allow or deny are the valid types.
acl/groupstringnoneOptional. A list of groups that can be added as fixed ACLs. See valid attributes below.
acl/group/@namestringnoneName of the group added.
acl/group/@typestringnoneType of the group acl added: allow or deny are the valid types.
fileNamePatterns/include/@patternregexnoneOptional. A regular expression pattern to evaluate file URLs against; if the file name matches the pattern, the file is excluded by the scanner. Multiple exclude nodes can be added.

Scanner Configuration Example

  <doc action="start" actionProperties="full" normalizedCSName="testFile">
    <connectorSource>
      <url>D:\AspireTesting\</url>
      <partialScan>true</partialScan>
      <subDirUrl>LSA</subDirUrl>
      <indexContainers>true</indexContainers>
      <scanRecursively>true</scanRecursively>
      <useACLs>true</useACLs>
      <acl>
        <user domain="search" name="user1">
          <type>allow</type>
        </user>
        <user domain="search" name="user2">
          <type>deny</type>
        </user>
        <group name="wikiusers">
          <type>allow</type>
        </group>
      </acl>
      <fileNamePatterns>
        <include pattern=".*LSA.*"/>
        <exclude pattern=".*\.bak$"/>
      </fileNamePatterns>
    </connectorSource>
    <displayName>testFile</displayName>
  </doc>

To launch a crawl, the job should be sent (processed/enqueued) to the "/FileSystemConnector/Main" pipeline.

Output

<doc>
  <url>D:\AspireTesting\LSA\testfile.txt</url>
  <snapshotUrl>003 D:\AspireTesting\LSA\testfile.txt</snapshotUrl>
  <docType>item</docType>
  <repItemType>aspire/file</repItemType>
  <fetchUrl>file:/D:/AspireTesting/LSA/testfile.txt</fetchUrl>
  <displayUrl>D:\AspireTesting\LSA\testfile.txt</displayUrl>
  <id>D:\AspireTesting\LSA\testfile.txt</id>
  <lastModified>2012-07-25T05:57:30Z</lastModified>
  <dataSize>111</dataSize>
  <sourceName>testFile</sourceName>
  <sourceType>filesystem</sourceType>
  <acls>
    <acl access="allow" domain="search" entity="user" fullname="search\user1" name="user1" scope="global"/>
    <acl access="allow" entity="group" fullname="wikiusers" name="wikiusers" scope="global"/>
    <acl access="deny" domain="search" entity="user" fullname="search\user2" name="user2" scope="global"/>
  </acls>
  <connectorSource>
    <url>D:\AspireTesting\</url>
    <partialScan>true</partialScan>
    <subDirUrl>LSA</subDirUrl>
    <indexContainers>true</indexContainers>
    <scanRecursively>true</scanRecursively>
    <useACLs>true</useACLs>
    <acl>
      <user domain="search" name="user1">
        <type>allow</type>
      </user>
      <user domain="search" name="user2">
        <type>deny</type>
      </user>
      <group name="wikiusers">
        <type>allow</type>
      </group>
    </acl>
    <fileNamePatterns>
      <include pattern=".*LSA.*"/>
      <exclude pattern=".*\.bak$"/>
    </fileNamePatterns>
    <displayName>testFile</displayName>
    <partialScanUrl>LSA</partialScanUrl>
  </connectorSource>
  <action>add</action>
  <hierarchy>
    <item id="4C1AB83A0DB23C7B3F1022F6FB2CBA86" level="3" name="testfile.txt" url="D:\AspireTesting\LSA\testfile.txt">
      <ancestors>
        <ancestor id="00BE2B03F63AB87312C149D16263A6AB" level="2" name="LSA\" parent="true" type="aspire/folder" url="D:\AspireTesting\LSA\"/>
        <ancestor id="CC00EC8FA97894C732CF72EF719D703E" level="1" name="testFile" type="aspire/filesystem" url="D:\AspireTesting\"/>
      </ancestors>
    </item>
  </hierarchy>
  <protocol source="FetchURLStage/protocol">file</protocol>
  <mimeType source="FetchURLStage/mimeType">text/plain</mimeType>
  <extension source="FetchURLStage">
    <field name="modificationDate">2012-07-25T05:57:30Z</field>
    <field name="content-type">text/plain</field>
    <field name="content-length">111</field>
    <field name="last-modified">Wed, 25 Jul 2012 05:57:30 GMT</field>
  </extension>
  <contentType source="ExtractTextStage/Content-Type">text/plain; charset=windows-1252</contentType>
  <extension source="ExtractTextStage">
    <field name="Content-Encoding">windows-1252</field>
    <field name="resourceName">D:\AspireTesting\LSA\testfile.txt</field>
  </extension>
  <content source="ExtractTextStage">This is the content of the testfile.</content>
</doc>



  • No labels