Box Application Bundle (Aspire 2)

From wiki.searchtechnologies.com
Revision as of 23:22, 8 December 2015 by Dherrera (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

 (2.0.3 Release)  

Box Application Bundle (Aspire 2)
AppBundle Name  Box.Com Connector
Maven Coordinates  com.searchtechnologies.aspire:app-box-connector
Versions  2.2.2
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.


The Box Connector performs full and incremental scans over a Box repository and will extract security, metadata, and content from each object scanned. Each scanned object 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 stopped, paused or resumed via the Scheduler Component. 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.



Configuration

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

Property Type Default Description
snapshotDir string ${aspire.home}/snapshots The directory for snapshot files to be stored.
disableTextExtract boolean false By 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.
workflowReloadPeriod int 15m The period after which to reload the business rules. Defaults to ms, but can be suffixed with ms, s, m, h or d to indicate the required units.
workflowErrorTolerant boolean false When set, exceptions in workflow rules will only effect the execution of the rule in which the exception occurs. Subsequent rules will be executed and the job will complete the workflow sucessfully. If not set, exceptions in workflow rules will be re-thrown and the job will be moved to the error workflow.
useGE boolean false true if group expansion is going to be used.
geSchedule string 0 0 0 * * ? Indicates how often the group expasion is going to fetch all the security groups.
Server string https://app.box.com The Box server Url.
Server API Url string https://api.box.com URL for Box API.
API version string 2.0 The API version that Box is using.
Client Id string none The client id of an app in Box.com with access to the Box account.
Client Secret string none The Client Secret of an app in Box.com with access to the Box account.
Redirect Url string https://localhost:4000 The a valid URL to redirect the authorization tokens (for authorization process)
User String none Login of the Box account.
Password string none Password for Box accound.
PageSize integer 100 Indicates the amount of documents or folders that will be returned by the API each call.
ExcludeExtensions string none Indicates the list of extensions (separeted by comma) you don't want to extract the text, for instance dll or exe.
UseImpersonate boolean false Impersonate each user of Box account in order to crawl all shared and private content. If unchecked, only shared content accessible by the crawling account will be crawled.
indexFolders boolean false Indicates if folders (as well as files) should be indexed.
scanRecursively boolean false Indicates if subfolders should be scan.
ExcludeSubFolders/include string none Optional. A list of folders that can be excluded from the crawling.
fileNamePatterns/include regex none Optional. 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 regex none Optional. 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.


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-box-connector">
    <properties>
    <property name="generalConfiguration">true</property>
    <property name="useGE">true</property>
    <property name="geSchedule">0 0 0 ? * *</property>
    <property name="Server">https://app.box.com</property>
    <property name="ServerApi">https://api.box.com</property>
    <property name="ApiVersion">2.0</property>
    <property name="ClientId">yv1mhjwja6dfwju8odkpi8rjn97v1xkv</property>
    <property name="ClientSecret">encrypted:FEFCE311A433D8C76B66215CEA9FB9ED50C5B1ED4B92EB5ED2414AFA94EB40B720A3E725DDD2D3D74A6FE5A70A931FCD</property>
    <property name="Redirect_Url">http://localhost:4000</property>
    <property name="User">jhgross@searchtechnologies.com</property>
    <property name="BoxPassword">encrypted:B39D6E9181FBBEBDF7C880CBEF98F4F2</property>
    <property name="extractLDAP">true</property>
    <property name="ldapUrl">ldap://10.2.1.21:389</property>
    <property name="dnUser">test1@domain.com</property>
    <property name="dnPassword">encrypted:1E4230BFB07D53AE16879EAF4D57291A</property>
    <property name="userSearchFilter">(|(objectClass=person))</property>
    <property name="ldapSearchBase">OU=Employee Users,OU=Accounts,dc=domain,dc=com</property>
    <property name="LDAPGuidAttr">userPrincipalName</property>
    <property name="LDAPNameAttr">samAccountName</property>
    <property name="snapshotDir">${dist.data.dir}/${app.name}/boxWorkingDir</property>
    <property name="disableTextExtract">false</property>
    <property name="workflowReloadPeriod">15s</property>
    <property name="workflowErrorTolerant">false</property>
    <property name="debug">true</property>
  </properties>
  </application>

Note: Any optional properties can be removed from the configuration to use the default value described on 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.

Element Type Options Description
@action string start, stop, pause, resume, abort Control command to tell the scanner which operation to perform. Use start option to launch a new crawl.
@actionProperties string full, incremental When a start @action is received, it will tell the scanner to either run a full or an incremental crawl.
@normalizedCSName string Unique identifier name for the content source that will be crawled.
displayName string 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/connectorSource of the AspireObject of the incoming Job.

Element Type Default Description
Server string https://app.box.com The Box server Url.
Server API Url string https://api.box.com URL for Box API.
API version string 2.0 The API version that Box is using.
Client Id string none The client id of an app in Box.com with access to the Box account.
Client Secret string none The Client Secret of an app in Box.com with access to the Box account.
Redirect Url string https://localhost:4000 The a valid URL to redirect the authorization tokens (for authorization process)
User String none Login of the Box account.
Password string none Password for Box account.
PageSize integer 100 Indicates the amount of documents or folders that will be returned by the API each call.
ExcludeExtensions string none Indicates the list of extensions (separeted by comma) you don't want to extract the text, for instance dll or exe.
UseImpersonate boolean false Impersonate each user of Box account in order to crawl all shared and private content. If unchecked, only shared content accessible by the crawling account will be crawled.
ExcludeSubFolders/include string none Optional. A list of folders that can be excluded from the crawling.
indexContainers boolean false Indicates if folders (as well as files) should be indexed..
scanRecursively boolean false Indicates if subfolders of the given URL should be scanned..
fileNamePatterns/include/@pattern regex none Optional. 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/@pattern regex none Optional. 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>
  <Server>https://app.box.com</Server>
  <ServerApi>https://api.box.com</ServerApi>
  <ApiVersion>2.0</ApiVersion>
  <ClientId>yv1mhjwj6yffwj1wodkpi8rjn97v1xkv</ClientId>
  <ClientSecret>encrypted:FEFCE311A433D8C76B66215CEA9FB9ED50C5B1ED4B92EB5ED2414AFA94EB40B720A3E725DDD2D3D74A6FE5A70A931FCD</ClientSecret>
  <Redirect_Url>http://localhost:4000</Redirect_Url>
  <User>crawl-box@searchtechnologies.com</User>
  <BoxPassword>encrypted:B39D6E9181FBBEBDF7C880CBEF98F4F2</BoxPassword>
  <pageSize>100</pageSize>
  <useImpersonate>true</useImpersonate>       
  <indexContainers>true</indexContainers>
  <scanRecursively>true</scanRecursively>
  <ExcludeSubFolders/>
  <fileNamePatterns>
    <exclude pattern=".*Aspire Support.*"/>
  </fileNamePatterns>
</connectorSource>
<displayName>testFile</displayName>
  </doc>

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


Output


<job id="192.168.1.5:50505/2015-07-16T17:46:07Z/0/4" time="2015-07-16T17:56:05Z">
<doc>
  <url>https://app.box.com/files/0/f/3804969570/Folder_private</url>
  <fetchUrl>https://app.box.com/files/0/f/3804969570/Folder_private</fetchUrl>
  <displayUrl>https://app.box.com/files/0/f/3804969570/Folder_private</displayUrl>
  <snapshotUrl>002 https://app.box.com/files/0/f/3804969570/Folder_private</snapshotUrl>
  <id>3804969570</id>
  <connectorSpecific>
    <field name="size">0</field>
    <field name="impersonate">226635049</field>
    <field name="eventType">ITEM_CREATE</field>
    <field name="created_by">MMarin@searchtechnologies.com</field>
    <field name="created_by_Name">Manuel</field>
    <field name="author_Id">226635049</field>
    <field name="user_profile_url">https://app.box.com/profile/226635049</field>
    <field name="modified_by">MMarin@searchtechnologies.com</field>
    <field name="modify_by_Id">226635049</field>
    <field name="modify_by_Name">Manuel</field>
    <field name="last_modified">2015-06-09T17:01:09-07:00</field>
    <field name="owned_by">MMarin@searchtechnologies.com</field>
    <field name="owned_by_Id">226635049</field>
    <field name="owned_by_Name">Manuel</field>
    <field name="type">folder</field>
    <field name="id">3804969570</field>
    <field name="etag">0</field>
    <field name="sequence_id">0</field>
    <field name="name">Folder_private</field>
    <field name="description"/>
    <field name="path_collection">/All Files/Folder_private</field>
    <field name="created_at">2015-06-09T17:01:09-07:00</field>
    <field name="modified_at">2015-06-09T17:01:09-07:00</field>
    <field name="content_created_at">2015-06-09T17:01:09-07:00</field>
    <field name="content_modified_at">2015-06-09T17:01:09-07:00</field>
    <field name="item_status">active</field>
    <field name="parent">https://app.box.com/files/0/f/0/All Files</field>
  </connectorSpecific>
  <docType>container</docType>
  <repItemType>aspire/folder</repItemType>
  <BoxAction>add</BoxAction>
  <dataSize>0</dataSize>
  <title>Folder_private</title>
  <createdBy>MMarin@searchtechnologies.com</createdBy>
  <createdById>226635049</createdById>
  <acls>
    <acl access="allow" domain="" entity="user" fullname="Manuel" name="MMarin@searchtechnologies.com" scope="global"/>
    <acl access="allow" domain="" entity="group" name="3804969570" scope="global"/>
  </acls>
  <modifiedBy>MMarin@searchtechnologies.com</modifiedBy>
  <lastModified>2015-06-09T17:01:09-07:00</lastModified>
  <connectorSource>
    <Server>https://app.box.com</Server>
    <ServerApi>https://api.box.com</ServerApi>
    <ApiVersion>2.0</ApiVersion>
    <ClientId>yv1mhjwja6dfwju8odkpi8rjn97v1xkv</ClientId>
    <ClientSecret>encrypted:FEFCE311A433D8C76B66215CEA9FB9ED50C5B1ED4B92EB5ED2414AFA94EB40B720A3E725DDD2D3D74A6FE5A70A931FCD</ClientSecret>
    <Redirect_Url>http://localhost:4000</Redirect_Url>
    <User>jhgross@searchtechnologies.com</User>
    <BoxPassword>encrypted:B39D6E9181FBBEBDF7C880CBEF98F4F2</BoxPassword>
    <pageSize>100</pageSize>
    <useImpersonate>true</useImpersonate>
    <indexContainers>true</indexContainers>
    <scanRecursively>false</scanRecursively>
    <ExcludeSubFolders/>
    <fileNamePatterns/>
    <displayName>BoxLocal</displayName>
  </connectorSource>
  <action>add</action>
  <hierarchy>
    <item id="CF6BD6634617AB002314F57950CCD87F" level="2" name="Folder_private" type="aspire/folder" url="https://app.box.com/files/0/f/3804969570/Folder_private">
      <ancestors>
        <ancestor id="CD84D22EDB049F30B6DFB825B428EF61" level="1" parent="true" type="aspire/folder" url="https://app.box.com/files/0/f/0/All Files"/>
      </ancestors>
    </item>
  </hierarchy>
  <content/>
</doc>
</job>