StoreDoc method
Content Manager OnDemand converts the folder field values to application group fields and stores the data from the specified file in the database as a document associated with the specified application group and application.
- Method
- short StoreDoc(
- Parameters
- DocPath
- Specifies the fully-qualified path of a file containing the document data to be stored in the Content Manager OnDemand database. This parameter is required.
- ApplGrpName
- Specifies the name of an application group within the folder. It is the responsibility of the
caller to know the application group names associated with the active folder. This
parameter is required. In order for StoreDoc() to succeed, the
following requirements must be met:
- The application group's Database Organization must be set to use
Multiple loads per database table
on the General/Advanced tab under Database Organization. - The application group's Expiration Type must be set to
Segment
on the Storage Management tab under Life of Data and Indexes/Expiration Type. - The application group's Cache Data must be set to
Yes
and Cache Document Data tox
Days on the Storage Management tab under Cache Data. - The application group's Migrate Data from Cache setting must be set to
either
Next Cache Migration
orAfter x Days in Cache
on the Storage Management/Advanced tab under Migrate Data from Cache. - The application group requires cache to allow the Content Manager OnDemand server to append new documents that are being stored to the current storage object in cache. This approach creates larger storage objects that can be migrated at a later date to archive storage such as cloud, Tivoli® Storage Manager (TSM), disk pools, or other external storage options which vary depending on your Content Manager OnDemand server platform.
- The application group's Database Organization must be set to use
- ApplName
- Specifies the name of an application within the specified application group. It is the responsibility of the caller to know the application names associated with the specified application group. This parameter is required.
- Values
- Points to a SafeArray of folder values. Each value is a character string which will be converted
to data of the field type (that is, integer, date, and so on).
The number and order of folder fields can be determined by using the GetFolderFieldName methods.
Any folder fields not specified are given an empty string for string fields or zero for numeric fields. If extraneous fields are specified, they are ignored.
Date fields must be provided in the format required for the field. For example, specifying 02/03/23 is invalid when February 3, 2023 is required.
- Description
- Content Manager OnDemand converts the folder field values to application group
fields and stores the data from the specified file in the database as a document
associated with the specified application group and application. If the return code is one of the following codes:
The GetStoreDocInvalidFieldNum method can be used to determine the folder field which caused the problem.ARS_OLE_RC_INVALID_DATE_FIELD ARS_OLE_RC_INVALID_INTEGER_FIELD ARS_OLE_RC_INVALID_DECIMAL_FIELD ARS_OLE_RC_TOO_MANY_VALUE_CHARS ARS_OLE_RC_INVALID_APPLGRP_FIELD_TYPE
- Return Value
- Refer to return codes.
- See Also
- GetNumFolderFields, GetFolderFieldName, GetFolderFieldNames, and GetStoreDocInvalidFieldNum method
C/C++
CArsOle * pArsCtrl;
short rc;
SAFEARRAY * pSA;
VARIANT var;
BSTR bstrElement;
long i;
.
.
pSA = SafeArrayCreateVector(VT_BSTR,0,2);
if ( pSA == NULL )
ERROR;
bstrElement = SysAllocStringByteLen ("255-546-667",11);
i = 0;
SafeArrayPutElement (pSA, &i,bstrElement);
bstrElement = SysAllocStringByteLen ("06/07/23",8);
i = 1;
SafeArrayPutElement (pSA, &i,bstrElement);
var.vt = VT_ARRAY | VT_BSTR;
var.parray = pSA;
rc = pArsCtrl->StoreDoc("g:\\download \\file.afp",
"BKH-CRD",
"BKH-CRD",
&var);
if (rc != ARS_OLE_RC_SUCCESS)
ERROR;
.
.
.
Visual Basic
Dim values(2) As String
Dim rc As Integer
.
.
.
values(0) = "255-546-667"
values(1) = "06/07/23"
var = values
rc = ArsOle.StoreDoc ("g:\download \file.afp", _
"BKH-CRD", _
"BKH-CRD", _
var)
if rc <> ARS_OLE_RC_SUCCESS Then
MsgBox "ERROR"
End
End If
.
.
.