The Insert
action uses an appropriate connector to insert a document or documents into a repository.
http://host:port/action=Fetch&FetchAction=Insert &AUTN_GROUP=ConnectorGroup &Config=Base64_Config &ConfigSection=Section_Name &InsertXML=Insert_XML
Type: Asynchronous
Parameter Name | Description | Required |
---|---|---|
AUTN_GROUP | The connector group to send the action to. | Yes |
Config | An optional Base64 encoded configuration file, used to override the connector configuration file. | |
ConfigSection | The name of the task section in the connector's configuration file to use to insert the documents. | |
FailedDirectory | The directory in which to report failures. | |
InsertXML |
XML containing all the properties to determine how and where to add each document, all the metadata, and optionally, a file to insert for each document. Some connectors require a file. The data must be provided in XML format as below: <InsertXML> <insert> <reference>reference</reference> <section>configsection</section> <property name="propname" value="propvalue"/> <!-- ... --> <metadata name="fieldname" value="fieldvalue"/> <!-- ... --> <file> <type>type</type> <displayname>filename</displayname> <content>content</content> </file> <insert_id>012345</insert_id> </insert> <!-- ... --> </InsertXML> Most of the tags are optional.
|
Yes |
This example shows how to use a connector group called FileSystemConnectors to insert a file with the reference C:\Autonomy\dir1\newfile.txt
with the content This is my file into a file system.
Construct the InsertXML
:
<insertXML> <insert> <reference>C:\Autonomy\dir1\newfile.txt</reference> <file> <type>content</type> <content>VGhpcyBpcyBteSBmaWxl</content> </file> <insert_id>012345</insert_id> </insert> </insertXML>
NOTE: The content This is my file is base64 encoded.
The XML is then URL encoded and used in the Insert
action:
http://localhost:10000/action=Fetch&FetchAction=Insert &AUTN_GROUP=FileSystemConnectors &ConfigSection=DIR1 &InsertXML=...
As this is an asynchronous action, you receive a token in response to the request. You can use the token with the QueueInfo
action to retrieve more information about the request.
The response to /action=QueueInfo&QueueAction=getStatus&QueueName=fetch&token=...
provides a ConnectorToken
(the token returned by the connector when it was passed the action by the Distributed Connector). You can then use the ConnectorToken
to find the response from the connector in the Distributed Connector's fetchfinished
queue.
The response to /action=QueueInfo&QueueAction=getStatus&QueueName=FetchFinished
looks like this:
<action> <status>Finished</status> <queued_time>2014-Jun-04 12:10:56</queued_time> <time_in_queue>0</time_in_queue> <process_start_time>2014-Jun-04 12:10:56</process_start_time> <time_processing>0</time_processing> <process_end_time>2014-Jun-04 12:10:56</process_end_time> <FinalBatch>true</FinalBatch> <ParentToken>MTAuMi4xMDQuODI6MTAwMDA6RkVUQ0g6MTU5NjUyNzE0Mg==</ParentToken> <errors>0</errors> <identifiers> <identifier insert_id="012345">PGlkIHM9IkZFVENIVEFTS1MiIHI9IkM6XEF1dG9ub215XFxkaXIxXG5ld2ZpbGUudHh0Ii8+</identifier> </identifiers> <inserted>1</inserted> <token>MTAuMi4xMDQuODI6MTAwMDA6RkVUQ0hGSU5JU0hFRDoxODUwMjA0Njc=</token> </action>
The insert_id
is the value that you specified in the original request, and the <identifier>
element contains a document identifier for the document in the repository. To see the identifiers, you must set the configuration parameter AddIdsFromFinished to true
.
|