Parameter and Command Reference > CFS Connector Actions > Insert Fetch Action

Insert Fetch Action
This action is used to insert a document or documents into a repository.
http://host:port/action=Fetch&FetchAction=Insert
                  [&Config=Base64_Config]
                   &ConfigSection=Section_Name
                   &InsertXML=Insert_XML
Type: Asynchronous
 
Optional Base64 encoded configuration file. If this parameter is specified, then the encoded configuration options is used instead of the options in the connector configuration file.
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 expect a file to be provided.
 <insert>
  <reference>reference</reference>
  <property name="propname" value="propvalue"/>
  <!-- ... -->
  <metadata name="fieldname" value="fieldvalue"/>
  <!-- ... -->
  <file>
   <isfilename>true/false</isfilename>
   <ownfile>true/false</ownfile>
   <content>filename/base64file</content>
  </file>
 </insert>
 <!-- ... -->
*
ownfile. If ownfile is true, this file is deleted after it has been inserted. By default, this is false.
*
isfilename. If isfilename is true, the content tag contains the full path to the file. If isfilename is false, the content tag contains the entire file base64 encoded. The ownfile tag is ignored in this case.
*
insert. The insert tag can be omitted if a single document is being inserted.
*
reference, property, metadata. The usage of these tags depends on the connector used.
Example
In this example, the object is to insert a file with the reference C:\Autonomy\FileSystemConnectorCFS\dir1\newfile.txt with the content This is my file. First, construct the InsertXML:
<insertXML>
 <insert>
  <reference>C:\Autonomy\FileSystemConnectorCFS\dir1\newfile.txt</   reference>
  <file>
   <isfilename>false</isfilename>
   <content>VGhpcyBpcyBteSBmaWxl</content>
  </file>
 </insert>
</insertXML>
Note that the content This is my file is base64 encoded. The XML is then escaped and used in the Insert action.
http://localhost:1234/action=Fetch&FetchAction=Insert&ConfigSection=DIR1&InsertXML=%3CinsertXML%3E%3Cinsert%3E%3Creference%3EC%3A%5CAutonomy%5CFileSystemConnectorCFS%5Cdir1%5Cnewfile.txt%3C%2Freference%3E%3Cfile%3E%3Cisfilename%3Efalse%3C%2Fisfilename%3E%3Ccontent%3EVGhpcyBpcyBteSBmaWxl%3C%2Fcontent%3E%3C%2Ffile%3E%3C%2Finsert%3E%3C%2FinsertXML%3E
Response
As this is an asynchronous action, you receive a token in response to the request. A sample response to the action (as retrieved using the queueinfo action) appears below.
This action shows that the action has completed and that one document has been inserted, and gives the identifier of the new document.
<action>
 <documentcounts>
  <documentcount
   added="0"          collected="0"       deleted="0"
   errors="0"         holds="0"           ingestadded="0"
   ingestdeleted="0"  ingestfailed="0"    ingestupdated="0"
   inserted="1"       releasedholds="0"   seen="0"
   task="DIR1"        unchanged="0"       updated="0"/>
 </documentcounts>
 <fetchaction>INSERT</fetchaction>
 <identifiers>
  <identifier>
   PGlkIHM9IkRJUjEiIHI9IkM6XEF1dG9ub215XEZpbGVTeXN0ZW1Db25uZWN0b3J   DRlNcZGlyMVxuZXdmaWxlLnR4dCIvPg==
  </identifier>
 </identifiers>
 <token>MTAuMi4xMDUuMzQ6MTIzNDpGRVRDSDotMTc4NTQ1MTYwOQ==</token>
 <status>Finished</status>
 <queued_time>2009-Oct-15 16:36:32</queued_time>
 <time_in_queue>0</time_in_queue>
 <process_start_time>2009-Oct-15 16:36:32</process_start_time>
 <time_processing>0</time_processing>
 <process_end_time>2009-Oct-15 16:36:32</process_end_time>
</action>
Related Topics 
*