EV10 API Reference
EV10 API Reference
10.0
Legal Notice
Copyright 2012 Symantec Corporation. All rights reserved.
Symantec, the Symantec Logo, Veritas, Enterprise Vault, Compliance Accelerator, and
Discovery Accelerator are trademarks or registered trademarks of Symantec Corporation
or its affiliates in the U.S. and other countries. Other names may be trademarks of their
respective owners.
This Symantec product may contain third party software for which Symantec is required
to provide attribution to the third party (Third Party Programs). Some of the Third Party
Programs are available under open source or free software licenses. The License Agreement
accompanying the Software does not alter any rights or obligations you may have under
those open source or free software licenses. Please see the Third Party Software file
accompanying this Symantec product for more information on the Third Party Programs.
The product described in this document is distributed under licenses restricting its use,
copying, distribution, and decompilation/reverse engineering. No part of this document
may be reproduced in any form by any means without prior written authorization of
Symantec Corporation and its licensors, if any.
THE DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS,
REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT,
ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO
BE LEGALLY INVALID. SYMANTEC CORPORATION SHALL NOT BE LIABLE FOR INCIDENTAL
OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING,
PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED
IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE.
The Licensed Software and Documentation are deemed to be commercial computer software
as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19
"Commercial Computer Software - Restricted Rights" and DFARS 227.7202, "Rights in
Commercial Computer Software or Commercial Computer Software Documentation", as
applicable, and any successor regulations. Any use, modification, reproduction release,
performance, display or disclosure of the Licensed Software and Documentation by the U.S.
Government shall be solely in accordance with the terms of this Agreement.
Symantec Corporation
350 Ellis Street, Mountain View, CA 94043
http://www.symantec.com
Technical Support
In order to develop software using Enterprise Vault APIs, your company must be
a member of Symantec Technology Enabled Program (STEP).
For details of the technical support available to you, refer to your STEP
membership documentation, or contact the STEP office at
TechPartner@symantec.com.
Further information about STEP is available at the following address:
http://go.symantec.com/step
Contents
Chapter 2
API updates
.......................................................................... 21
22
22
23
26
26
27
29
30
32
32
34
34
34
34
34
35
38
38
38
39
39
40
42
45
Contents
Chapter 3
Chapter 4
47
47
49
49
50
50
50
51
51
51
53
54
55
55
56
56
56
57
57
65
66
69
69
70
71
71
72
72
74
75
75
75
76
76
76
77
77
78
79
Contents
Contents
134
136
138
140
142
143
145
147
148
149
152
153
154
155
156
157
157
159
162
164
168
169
170
172
174
175
177
178
179
181
183
184
185
187
191
194
198
200
201
205
208
210
212
Contents
214
214
215
217
218
219
220
222
223
225
228
229
230
232
233
234
235
236
237
239
240
242
243
245
251
253
255
256
259
260
261
262
265
265
267
268
269
269
270
272
275
277
278
10
Contents
279
281
282
283
284
285
287
288
289
290
292
293
294
295
296
298
300
301
302
304
305
306
306
307
308
309
310
311
312
313
314
315
315
316
320
320
321
322
322
323
324
325
325
Contents
Chapter 5
Chapter 6
Filtering APIs
329
330
331
331
332
332
332
333
334
335
336
337
338
339
340
341
342
...................................................................... 345
348
350
352
352
356
356
356
357
357
358
358
359
359
360
360
365
365
366
367
367
11
12
Contents
368
368
369
369
370
371
372
373
373
374
374
375
375
376
377
378
378
379
380
381
382
383
385
385
389
389
391
393
394
395
397
397
397
398
398
399
400
400
401
401
402
403
403
Contents
404
404
405
405
406
406
407
407
407
408
409
410
410
411
412
413
414
415
416
417
417
418
418
420
420
422
423
424
425
425
426
428
428
428
428
430
430
430
431
431
431
432
433
13
14
Contents
Chapter 7
438
438
439
439
441
442
443
443
445
446
448
449
449
452
453
453
457
457
458
459
459
460
460
461
461
462
464
465
466
468
470
472
474
476
478
479
481
482
484
485
489
Contents
490
491
493
494
495
497
497
498
499
500
501
502
504
505
506
508
510
511
514
517
518
519
519
521
522
522
523
524
525
527
528
529
530
531
531
532
533
534
534
536
538
539
540
15
16
Contents
Chapter 8
541
542
543
543
545
546
547
548
549
550
551
552
553
554
556
557
558
562
562
562
563
563
563
563
564
565
567
568
569
571
572
574
576
577
578
579
581
583
585
587
Contents
Appendix A
Appendix B
595
596
609
609
610
610
611
612
613
614
615
615
616
616
617
Appendix C
588
589
591
593
619
619
620
621
623
623
624
625
627
628
628
633
17
18
Contents
640
640
641
641
645
646
647
648
648
650
650
651
652
Chapter
20
Report errors and omissions, or tell us what you would find useful in future
versions of our guides and online help.
Please include the following information with your comment:
The title and product version of the guide you are commenting on
Your name
Chapter
API updates
This chapter includes the following topics:
Enterprise Vault 2007 SP1, Enterprise Vault 7.0 SP3, and Enterprise Vault 6.0
SP5
Enterprise Vault 2007, Enterprise Vault 7.0 SP2, and Enterprise Vault 6.0 SP4
22
API updates
About API updates
Ref
Change details
E2595657
10788
API updates
Enterprise Vault 10.0
Table 2-1
Ref
Change details
9912, E2478239
12266, E2603468
Ref
Change details
100-2538,
100-5024,
100-5049,
100-5743,
100-5815,
100-6252,
CAS-6002
The File System Filtering API has been added to the Filtering APIs
chapter. This API enables you to create external custom filters for File
System Archiving tasks. The filters define how the archiving task
selects and processes files. Two example filters that use the File System
Filtering API are included in the SDK. The ReadMe file in the folder
InstallFolder\sdk\samples\FSA Filter Sample describes
the example filters and gives instructions on how to install and use
them.
See Domino Filtering and File System Filtering APIs on page 389.
23
24
API updates
Enterprise Vault 10.0
Table 2-2
Ref
Change details
100-6002
Filters developed using the Domino Filtering and File System Filtering
APIs must reference the .NET assembly:
Symantec.EnterpriseVault.FilterInterfaces.dll
The API interfaces are loaded within the namespace:
Symantec.EnterpriseVault.FilterInterfaces
Note: If you have existing filters developed using the Domino Filtering
API, then you need to rebuild the filters after upgrading to Enterprise
Vault 10. References in the existing filters to the .NET assembly,
KVS.EnterpriseVault.LotusDominoInterfaces.dll, must be
redirected to the new .NET assembly,
Symantec.EnterpriseVault.FilterInterfaces.dll.
100-6100
Table 2-3
Ref
When entering the registry setting value for a file system or Domino
custom filter, the class name must include the namespace. The
separator used between the assembly and the class name must be "!".
API updates
Enterprise Vault 10.0
Table 2-3
Ref
Change details
100-8848
Table 2-4
Ref
Change details
E2082521
100-5709
100-6261
100-7987
100-6424
25
26
API updates
Enterprise Vault 9.0 SP3
Table 2-4
Ref
Change details
100-6481
Error reporting has been improved for the situation where an archive
is created, but no index locations have been configured for the archive.
Use the ExtendedErrorInfo object to access detailed error information.
100-7796
Table 2-5
Documentation change
Ref
Change details
100-9330,
E2365577
A new appendix has been added to this manual. This appendix provides
information on the following topics:
How the Content Management API processes message items. In
particular, how Enterprise Vault processes sender and recipient
details for different message types, and key changes over recent
releases of Enterprise Vault.
Why a retrieved item is not a binary copy of the original item.
Ref
Change details
903-11055
API updates
Enterprise Vault 8.0 SP5
Table 2-7
Ref
900-1652
900-2524
900-2677
2050482
Ref
Change details
8053386,
E2030385
27
28
API updates
Enterprise Vault 8.0 SP5
Table 2-8
Ref
Change details
E2133959
Table 2-9
Ref
Change details
8054561,
E2096343
E1980890
E2095734
Table 2-10
Ref
Change details
E2027779
API updates
Enterprise Vault 8.0 SP4
Table 2-10
Ref
Change details
E2139819
The following index properties have been added to the list of Enterprise
Vault system properties:
Ref
Change details
E1927661
E1533874
The manual indicated that the Vault Store ID must be set before
Archive::Get is called. This is incorrect. The manual has been updated.
E1669297
804-1613,
E1948433
29
30
API updates
Enterprise Vault 8.0 SP3
Table 2-11
Ref
Change details
8041728,
E1950563
Table 2-12
Ref
Change details
E1448964
Information has been added to the Search API chapter on how to create
multiple index volume sets for testing search applications.
See Performing a search on page 449.
Ref
Change details
803151
803137
Soft deleted items are no longer included when populating the Items
collection object.
See Items object on page 164.
API updates
Enterprise Vault 8.0 SP3
Table 2-13
Ref
803069, E1630338 When using the Archive object to retrieve details for an archive that
was created prior to Enterprise Vault 7.0, the ConvertedContent and
IndexUrgency properties could contain misleading values, as these
properties were introduced at Enterprise Vault 7.0.
When retrieving details for pre-Enterprise Vault 7.0 archives, these
properties are now given the following default values:
IndexUrgency = INDEX_ITEMS_IMMEDIATELY
ConvertedContent = CONVERTED_CONTENT_STORED
E1810317
The S_FALSE return value has been documented for the following
object properties.
IItem::Id
IContent::OriginalLocation
IArchiveMetaData::RetentionCategory
IArchiveMetaData::CustomIdentifier
IArchiveMetaData::CustomQualifier
ArchiveMetaData::CustomProperties
IArchiveMetaData2::CurrentLocation
IArchiveMetaData2::CurrentFolderId
IArchiveMetaData2::ArchivedDate
These properties can return the default property value and an S_FALSE
return value when reading the property before it has been written.
This is a success return value. When coding in C++ the S_FALSE return
value should be handled using the Windows SUCCEEDED or FAILED
macros.
803587, E1737966 When populating very large Archives collection objects, the value of
the Maximum property (the maximum number of records that can be
returned) was not honored. As a result, the operation failed, and
insufficient resource errors were reported.
This has been fixed.
803125, E1726196, Sometimes files of between 5 MB and 50 MB were truncated when
E1739537
retrieved using the Content Management API .
This has been fixed.
31
32
API updates
Enterprise Vault 8.0 SP2
Table 2-13
Ref
803327, E1792685 Retrieving large items (that is, files larger than 50 MB) resulted in
corrupt data being returned. This has been fixed.
If Enterprise Vault 8.0 SP3 is installed on your Enterprise Vault server,
ensure that you install the Enterprise Vault 8.0 SP3 API runtime on
your client application computer. Failure to do this may result in
insufficient memory errors when attempting to retrieve large items.
Ref
Change details
802168
802077
API updates
Enterprise Vault 8.0 SP1
Table 2-15
Ref
Change details
8010032
8010141
The new interface, IHolds2, has been added. This provides the method,
ReleaseHolds2, which can be used to release a hold on each item in a
collection, and also returns a summary status report, in XML, for each
vault store in which items were processed.
See IHolds2 :: ReleaseHolds2 on page 298.
8010204,
E1422959
33
34
API updates
Enterprise Vault 8.0
General changes
Audit logging can now be enabled for item operations.
See Audit logging on page 74.
The name of the Enterprise Vault SDK kit has changed to Symantec Enterprise
Vault Software Development Kit.msi.
The name of the Enterprise Vault API runtime kit has changed to: Symantec
Enterprise Vault API Runtime.msi.
API updates
Enterprise Vault 8.0
BAU0819
BAU0819
BAU0819
BAU2464
BAU0225
35
36
API updates
Enterprise Vault 8.0
Table 2-16
Ref
Change details
BAU0778
BAU0378
BAU0378
BAU778
BAU0795
BAU1179
API updates
Enterprise Vault 8.0
Table 2-16
Ref
Change details
BAU1179
BAU1761
BAU1473
BAU1796
BAU2013
BAU2853
37
38
API updates
Enterprise Vault 8.0
Retention API
Table 2-17
Ref
Change details
BAU1072
Enabled the caller to set the date from which storage expiry is
calculated.
Added the following interfaces, method and property:
IRetentionCategories2
Improved the retrieval of retention category details by providing
a Get method.
IRetentionCategory2
Provides ExpiryBasis property for determining date from which
storage expiry is calculated.
Migration API
Table 2-18
Ref
Change details
BAU2485
Ref
Description
BAU0585
crct
BAU0931
clcn
cllf
clfn
crcn
API updates
Enterprise Vault 7.0 SP4
Table 2-19
Ref
Description
BAU1320
cnhv
BAU1426
fpdd
fpcn
Corrections
Table 2-20
Corrections
Ref
Change details
1088101, 847952
1204891
1271036
Corrections
Ref
Change details
E1107082
E1143215
E1167957
39
40
API updates
Enterprise Vault 2007 SP1, Enterprise Vault 7.0 SP3, and Enterprise Vault 6.0 SP5
Table 2-21
Corrections (continued)
Ref
Change details
E1185396
E1187820
E1188342
E1191078
E1193018
E1196051
E1203217
API updates
Enterprise Vault 2007 SP1, Enterprise Vault 7.0 SP3, and Enterprise Vault 6.0 SP5
Table 2-22
Ref
Change details
751207, 703021,
605047
751208, 703020,
605036
751127, 703010
Availability
41
42
API updates
Enterprise Vault 2007, Enterprise Vault 7.0 SP2, and Enterprise Vault 6.0 SP4
Table 2-22
Ref
Change details
751143, 703011
Availability
API updates
Enterprise Vault 2007, Enterprise Vault 7.0 SP2, and Enterprise Vault 6.0 SP4
Table 2-23
Ref
Change details
DOR610
DOR620
Availability
43
44
API updates
Enterprise Vault 2007, Enterprise Vault 7.0 SP2, and Enterprise Vault 6.0 SP4
Table 2-23
Ref
Change details
702045, 604133,
E974294
702045, 604133
Availability
API updates
Enterprise Vault 7.0
Ref
Change details
CAP031
CAP433
CAP463
CAP545, CAP721,
E804597
CAP525
E775452
Availability
45
46
API updates
Enterprise Vault 7.0
Chapter
Licensing
Programming notes
48
To help you choose the appropriate APIs for your application, Table 3-1 lists the
available APIs. Examples of possible applications are also given to provide
guidance:
Table 3-1
API
Description
Content
Management API
Create archives.
Search API
Retention API
Table 3-1
API
Permissions
In general, the caller has to have sufficient permissions to access the target archive.
If the calling application is acting on behalf of clients, and has assumed the
responsibility of checking client permissions prior to proxying calls to the API,
then the caller must have adequate administration permissions. This can be either
Vault Service account permissions, or a suitable Enterprise Vault administration
role, which is assigned using the Enterprise Vault Administration Console.
Similarly, to create archives, the caller must have either Vault Service account
permissions, or a suitable Enterprise Vault administration role.
Vault Service account permissions are described in the Installing and Configuring
manual.
Enterprise Vault administration roles are described in the Enterprise Vault
Administrator's Guide.
49
50
Licensing
No additional Enterprise Vault license is required in order to develop applications
against the Enterprise Vault APIs. However, customer deployments of third-party
applications which make use of the Enterprise Vault APIs will require the following
license, in addition to any third party licensing requirements:
This section describes the licensing requirements for the Enterprise Vault APIs.
Development licensing
The Enterprise Vault APIs described in this guide are for developers who wish to
add and/or manage content in Enterprise Vault archives. In most circumstances,
these developers would be granted a Not for Resale (NFR) license to develop to
these APIs by membership of Symantec Technology Enabled Program (STEP).
Customers who wish to develop applications that integrate to these APIs would
need to purchase one of the following licenses and request access to the Enterprise
Vault SDK:
Symantec Generic Ingest Agent license (Enterprise Vault 7.0 and Enterprise
Vault 2007) for ingesting content into Enterprise Vault. This license also covers
management of content archived by Enterprise Vault.
Production licensing
The STEP licensing contract does not grant production use of the Enterprise Vault
APIs. Customer deployments of third-party applications and customer-developed
applications that make use of the Enterprise Vault APIs will require one of the
following licenses, in addition to any third-party licensing requirements:
Symantec Generic Ingest Agent license (Enterprise Vault 7.0 and Enterprise
Vault 2007) for ingesting content into Enterprise Vault. This license also covers
management of content archived by Enterprise Vault.
51
52
If you are using Enterprise Vault 8.0 or later, the application can query registry
settings directly to find out the the version of the Enterprise Vault API runtime
installed locally and the installation path. The registry settings to query are
InstallPath and Version in the following location:
HKEY_LOCAL_MACHINE
\Software
\KVS
\Enterprise Vault
\API Runtime
\Install
On 64-bit versions of Windows Server, the Enterprise Vault registry settings are
under the following location:
HKEY_LOCAL_MACHINE
\Software
\WOW6432node
\KVS
If you are using a version of Enterprise Vault prior to Enterprise Vault 8.0, follow
the instructions given in Checking version and installation path details prior to
Enterprise Vault 8.0.
Use the FindRelatedProducts action and the Upgrade Table to locate products
with the following UpgradeCodes:
{2FEB3523-3A2C-4518-A0D4-BD38E66A5E8C} Enterprise Vault runtime
{C8486BDD-85C4-48CC-97BA-82F1079DA61E} Enterprise Vault SDK
When you have ascertained that either of these is installed, you can use the
MsiGetProductInfo method and the relevant product code to find out the
installation location (INSTALLPROPERTY_INSTALLLOCATION) of the runtime
or SDK.
To detect if Enterprise Vault server is installed, and find out the installation
location, you can query the following registry settings directly:
HKEY_LOCAL_MACHINE
\Software
\KVS
\Enterprise Vault
\Install
\VaultServices
HKEY_LOCAL_MACHINE
\Software
\KVS
\Enterprise Vault
\Install
\InstallPath
The application can be built against the set of Primary Interop Assemblies
(PIAs) in the Enterprise Vault SDK. When the application is deployed, it must
be configured to use the PIAs provided by the Enterprise Vault API runtime.
Using Visual Studio the required API COM libraries, for example
EVContentManagementAPI.dll, should be added to the application's References.
53
54
Open the client application's configuration file, locate the Enterprise Vault
<assemblyIdentity> nodes, and update any <bindingRedirect> and
<codebase> nodes as illustrated in the following example to redirect any
requests for an older version of an Enterprise Vault API Runtime file to the
new version. For example:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="KVS.EnterpriseVault.Interop.IndexClient"
culture="neutral" publicKeyToken="26c5e2ccf2b9267c"/>
<bindingRedirect oldVersion="7.5.4.2534"
newVersion="8.0.0.0"/>
<codeBase version="8.0.0.0" href=
"FILE:///C:\Program Files\Enterprise Vault\
KVS.EnterpriseVault.Interop.IndexClient.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Apply the updates to the configuration file for each .NET application that
uses the Enterprise Vault API Runtime files.
API samples
On 64-bit versions of Windows Server, the Enterprise Vault registry settings are
under the following location:
HKEY_LOCAL_MACHINE
\Software
\WOW6432node
\KVS
If you are using a version of Enterprise Vault prior to Enterprise Vault 8.0, follow
the instructions given elsewhere.
See Checking version and installation path details prior to Enterprise Vault 8.0
on page 52.
SDK examples
The following examples are included in the SDK:
Two example filters that use the File System Filtering API are installed in the
folder, InstallFolder\samples\FSA Filter Sample. A ReadMe file in the
folder provides instructions on how to install and use the filters.
55
56
Programming notes
As the API interfaces are derived from IDispatch, they can be used by scripting
languages.
The APIs can be used from C++, .NET languages (such as Visual Basic .NET
and C#), ASP web pages (using Visual Basic Script), and other languages that
support COM.
When running scripts on a 64-bit operating system, use the 32-bit version of
command prompt, C:\Windows\SysWOW64\cmd.exe.
The Primary Interop Assemblies (PIAs), COM API libraries or Interop assemblies
should be added to the project's references to provide definitions of the COM
classes, interfaces and types. For example, to reference the Content Management
API via its PIA, add :
KVS.EnterpriseVault.Interop.EVContentManagementAPI.dll
When referencing a PIA the API types are defined in the namespace
KVS.EnterpriseVault.Interop.
When referencing an Interop assembly the API types are defined in the namespace
of the COM type library name. For example the namespace for the Content
Management API is EVContentManagementAPILib.
Code samples
In the code samples given in this manual, attention has been paid to the API
specifics only. Other programming aspects, such as error handling, have been
omitted for clarity.
In general, code samples are included for C++ and C#. As Visual Basic .NET is very
similar to C#, separate examples are not included in most cases.
57
58
Chapter
Enumerations
ContentManagementAPI object
IContentManagementAPI :: Archive
IContentManagementAPI :: Item
IContentManagementAPI :: Holds
IContentManagementAPI :: Hold
IContentManagementAPI :: DirectoryDNSAlias
IContentManagementAPI :: AuthenticationMode
IContentManagementAPI2 :: VaultStores
IContentManagementAPI2 :: VaultStore
IContentManagementAPI2 :: Archives
IContentManagementAPI3 :: Items
IContentManagementAPI3 :: IDispatchQueryInterface
IContentManagementAPI4 :: LastError
VaultStores object
IVaultStores :: Computer
60
VaultStore object
IVaultStore :: Id
IVaultStore :: Name
IVaultStore :: Description
IVaultStore :: Status
IVaultStore :: ArchiveCount
IVaultStore :: DirectoryDNSAlias
IVaultStore :: Get
Archives object
IArchives :: Computer
IArchives :: VaultStoreId
IArchives :: ArchiveName
IArchives :: Permissions
IArchives :: ArchiveTypes
Archive object
IArchive :: VaultStoreId
IArchive :: Id
IArchive :: Name
IArchive :: Description
IArchive :: ExpireItems
IArchive :: ConvertedContent
IArchive :: IndexUrgency
IArchive :: IndexLevel
IArchive :: Size
IArchive :: SecurityDescriptor
IArchive :: ComplianceDevice
IArchive :: ItemCount
IArchive :: Create
IArchive :: Get
IArchive2 :: Type
IArchive2 :: Status
IArchive2 :: HasFolders
IArchive2 :: Full
IArchive2 :: DirectoryDNSAlias
IArchive3 :: SecurityDescriptor
IArchive3 :: SecurityDescriptorString
IArchive3 :: Type
Items object
IItems :: ArchiveId
IItems :: StartSequenceNum
IItems :: OrderBy
Item object
IItem :: ArchiveId
IItem :: Id
IItem :: Content
IItem :: ArchiveMetaData
IItem :: BrowserViewURL
IItem :: DefaultMSGFormat
IItem :: Holds
IItem :: NativeItemURL
IItem :: DeletionLevel
IItem :: CopyOptions
IItem :: Insert
IItem :: Get
61
62
IItem :: Delete
IItem :: CanBeDeleted
IItem :: CopyTo
IItem :: MoveTo
IItem2 :: DeletionReason
IItem3 :: Undelete
Content object
IContent :: Title
IContent :: OriginalLocation
IContent :: FileExtension
IContent :: MIMEFormat
IContent :: CreatedDate
IContent :: ModifiedDate
IContent :: Data
IContent :: OriginalSize
IContent :: Author
ArchiveMetaData object
IArchiveMetaData :: RetentionCategory
IArchiveMetaData :: ComplianceDevice
IArchiveMetaData :: OverrideOnHoldRetCat
IArchiveMetaData :: ArchivedDate
IArchiveMetaData :: ComplianceData
IArchiveMetaData :: SavesetSize
IArchiveMetaData :: RetentionExpires
IArchiveMetaData :: IndexData
IArchiveMetaData :: IsItemSecured
IIArchiveMetaData :: CustomIdentifier
IIArchiveMetaData :: CustomQualifier
IIArchiveMetaData :: CustomProperties
IArchiveMetaData :: Update
IArchiveMetaData2 :: CurrentLocation
IArchiveMetaData2 :: CurrentFolderId
IArchiveMetaData2 :: SequenceNum
IArchiveMetaData2 :: ArchivedDate
SimpleIndexMetadata object
ISimpleIndexMetadata :: _NewEnum
ISimpleIndexMetadata :: DateTimesUTC
ISimpleIndexMetadata :: Count
ISimpleIndexMetadata :: Add
ISimpleIndexMetadata :: Clear
ISimpleIndexMetadata :: ToXML
ISimpleIndexMetadata :: FromXML
ISimpleIndexMetadata :: ToLocalTime
ISimpleIndexMetadata :: ToUTCTime
SimpleIndexProperty object
ISimpleIndexProperty :: Set
ISimpleIndexProperty :: Name
ISimpleIndexProperty :: Value
ISimpleIndexProperty :: Searchable
ISimpleIndexProperty :: Retrievable
ISimpleIndexProperty :: System
ComplianceData object
IComplianceData :: Units
IComplianceData :: Value
63
64
IComplianceData :: SetBy
Holds object
IHolds :: _NewEnum
IHolds :: Item
IHolds :: Count
IHolds :: GroupId
IHolds :: ConsumerGUID
IHolds :: Metadata
IHolds :: Add
IHolds :: PlaceHolds
IHolds :: ReleaseHolds
IHolds2 :: ReleaseHolds2
Hold object
IHold :: ArchiveId
IHold :: ItemId
IHold :: Id
IHold :: Status
IHold :: Metadata
IHold :: ConsumerGUID
IHold :: GroupId
ICollectionBase : IDispatch
ICollectionBase :: Count
ICollectionBase :: _NewEnum
ICollectionBase :: Item
ICollectionBase :: Maximum
ICollectionBase :: More
ICollectionBase :: Get
ICollectionBase :: Clear
ICollectionBase :: Reset
ExtendedErrorInfo object
IExtendedErrorInfo :: Error
IExtendedErrorInfo :: Description
IExtendedErrorInfo :: InnerError
IExtendedErrorInfo :: InnerErrorDescription
IExtendedErrorInfo :: Source
DiagnosticsAPI object
IDiagnosticsAPI : Name
IDiagnosticsAPI : IsTraceEnabled
IDiagnosticsAPI : LogEvent
IDiagnosticsAPI : Trace
IContentManagementAPI
IContentManagementAPI2
IContentManagementAPI3
IContentManagementAPI4
IVaultStores
IVaultStore
IArchives
IArchive
IArchive2
IArchive3
IItems
IItem
65
66
IItem2
IItem3
IContent
IArchiveMetaData
IArchiveMetaData2
ISimpleIndexMetadata
IComplianceData
IHolds
IHold
IExtendedErrorInfo
IDiagnosticsAPI
The methods and properties exposed by all these interfaces are described in detail
in this chapter.
When working with Lotus Notes databases, you can use the NSF Manager API to
manage NSF databases, and import archived notes into a database or extract notes
to be archived from a database. You can use the Content Management API to store
notes in the archive or retrieve notes from the archive.
Figure 4-1
<<object>>
ContentManagementAPI
<<object>>
<<object>>
<<object>>
<<object>>
VaultStores
Archives
Items
Holds
<<object>>
VaultStore
<<object>>
Archive
<<object>>
Item
<<object>>
ArchiveMetaData
<<object>>
ComplianceData
<<object>>
Hold
<<object>>
Content
<<object>>
SimpleIndexMetadata
<<object>>
ExtendedErrorInfo
<<object>>
DiagnosticsAPI
<<object>>
SimpleIndexProperty
All the objects shown are exposed by the Content Management API:
67
68
The Item object provides applications with a way to store and manage items
in Enterprise Vault archives.
The following interfaces are implemented by the Item object:
The Holds object provides calling applications with the ability to place or
release legal holds on multiple items at a time with a single call to the
Enterprise Vault server. It exposes a standard COM collection interface that
manages a collection of IHold objects.
Use of objects
It is best practice for the calling application to keep the ContentManagementAPI
object alive as long as possible, as the ContentManagementAPI object caches
information from Enterprise Vault, and frequent creation and release would result
in poor performance of the client.
Most of the object instances obtained from the ContentManagementAPI object
are designed to be used only once. This prevents reuse of stale data.
Once an object instance has been used (that is, Get, Insert or Create have been
called), it can only be used for querying properties, not for setting them. Before
any of these methods (Get, Insert or Create) can be called again, the existing object
instance should be released and a new one obtained.
For example, the following steps are required when storing an item in an archive:
69
70
A number of object properties, for example Item.Id, return the default property
value and an S_FALSE return value when reading the property before it has been
written. This is a success return value. When coding in C++ the S_FALSE return
value should be handled using the Windows SUCCEEDED or FAILED macros.
When coding in C# it is not possible to differentiate between the S_OK and S_FALSE
return values.
By archive type.
With vault stores, you can only select all vault stores in an Enterprise Vault Site.
By archive.
Property validation
The syntax of a property is validated when the property is set, but validation of
the value is typically delayed until the property is used, for example when invoking
the Get method.
71
72
Figure 4-2
Third party
application
IContentManagementAPI
ContentManagementAPI
Enterprise
Vault Storage
Vault store
service
Insert()
+ metadata
Item
ID
ArchiveID
Content
ArchiveMetaData
IndexData
Enterprise
Vault Indexing
Index
service
ISimpleIndexMetadata
SimpleIndexPropert
SimpleIndexPropert
y SimpleIndexPropert
y ySimpleIndexPropert
ySimpleIndexPropery
You can add custom index metadata to an item using the Content Management
API, or one of the Filtering APIs:
In the Domino Filtering API and File System Filtering API, use the Add method
in the IndexMetadata class.
See IArchivingControl interface on page 402.
73
74
To check that the metadata has been indexed, perform an archive search for the
custom information. If the custom index property is defined as searchable, you
can use the Other attribute fields in Enterprise Vault browser search to specify
the name and value of the custom index property. In the Name field, specify the
property set and name of the custom index property in the form
propertySet.propertyName. To see the Other attribute fields in browser search,
add ?advanced to the browser search URL. For example:
http://evserver/enterprisevault/search.asp?advanced
Audit logging
From Enterprise Vault 8.0, audit logging includes Content Management API item
operations. Auditing for various categories of item operations from all Enterprise
Vault agents can be enabled or disabled.
Table 4-1 lists the operations that can be logged and the associated Enterprise
Vault audit category. Audit logging can be enabled for specific audit categories
using the Enterprise Vault Administration Console.
Table 4-1
API operation
Insert
Archive
CopyTo
MoveTo
Archive
Delete1
Delete
Delete
Get
View
1.MoveTo will support two audit entries; one for the item insertion and another
for the item deletion from the original location.
Enumerations
This section describes the enumerations used by the Content Management API.
EV_API_DELETION_LEVEL enumeration
Deletion level enumeration defines the type of delete permitted for archived items:
enum EV_API_DELETION_LEVEL
{
DELETION_LEVEL_SOFT_DELETE = 0,
DELETION_LEVEL_HARD_DELETE = 1
};
Items can be deleted completely (hard delete), or moved to the Enterprise Vault
"dumpster" area (soft delete). The default value is
DELETION_LEVEL_SOFT_DELETE.
75
76
In the Enterprise Vault Administration Console, in the Site Properties pages, the
administrator can enable the recovery of deleted items and specify how long
soft-deleted items are to be kept.
This enumeration value is set using the Item DeletionLevel property.
See IItem :: DeletionLevel on page 185.
EV_API_EVENT_TYPE enumeration
Event type enumeration indicates the type of event:
enum EV_API_EVENT_TYPE
{
EVENT_TYPE_ERROR = 1,
EVENT_TYPE_WARNING = 2,
EVENT_TYPE_INFORMATION = 3,
EVENT_TYPE_SUCCESS_AUDIT = 4,
EVENT_TYPE_FAILURE_AUDIT = 5
};
EV_API_ITEMS_ORDERBY enumeration
Items collection order defines whether to increase or decrease the index sequence
number when enumerating a collection of items.
enum EV_API_ITEMS_ORDERBY
{
ITEMS_ORDERBY_ASC = 0,
ITEMS_ORDERBY_DESC = 1
};
EV_API_TRACE_LEVEL enumeration
Trace level enumeration indicates the trace level:
enum EV_API_TRACE_LEVEL
{
TRACE_LEVEL_HIGH = 1,
TRACE_LEVEL_MEDIUM = 2,
TRACE_LEVEL_LOW = 3
};
EV_STG_API_ARCHIVE_TYPE enumeration
Archive type enumeration indicates the type of archive:
enum EV_STG_API_ARCHIVE_TYPE
{
ARCHIVE_TYPE_NOT_SET
ARCHIVE_TYPE_SHARED
ARCHIVE_TYPE_EXCHANGE_MAILBOX
ARCHIVE_TYPE_EXCHANGE_JOURNAL
ARCHIVE_TYPE_EXCHANGE_PUBLIC_FOLDER
ARCHIVE_TYPE_FILE_SYSTEM
ARCHIVE_TYPE_SHAREPOINT
ARCHIVE_TYPE_DOMINO_JOURNAL
ARCHIVE_TYPE_DOMINO_MAILBOX
};
=
=
=
=
=
=
=
=
=
0x00000000,
0x00000001,
0x00000002,
0x00000004,
0x00000008,
0x00000010,
0x00000020,
0x00000040,
0x00000080
EV_STG_API_AUTHENTICATE_USING enumeration
Storage authentication enumeration indicates the authentication mode to use
when authenticating to Enterprise Vault.
77
78
enum EV_STG_API_AUTHENTICATE_USING
{
AUTHENTICATE_USING_DCOM_SECURITY = 0,
AUTHENTICATE_USING_AUTHSERVER = 1
AUTHENTICATE_USING_MOST_APPROPRIATE_MODE = 2
};
EV_STG_API_CAN_DELETE enumeration
Can delete enumeration indicates whether or not the item can be deleted.
enum EV_STG_API_CAN_DELETE
{
DELETE_ALLOWED = 0,
DELETE_ACCESS_DENIED = 1,
DELETE_RETCAT_ONHOLD = 2,
DELETE_ITEM_ONHOLD = 4,
DELETE_ITEM_COMPLIANCE = 8
};
The Item CanBeDeleted method returns the current value for an item.
Values that indicate that the item cannot be deleted have the following meanings:
DELETE_ACCESS_DENIED
DELETE_RETCAT_ONHOLD
DELETE_ITEM_ONHOLD
DELETE_ITEM_COMPLIANCE
EV_STG_API_CONVERTED_CONTENT enumeration
When a file is archived, the Enterprise Vault Storage Service converts the file to
HTML, if possible. The HTML version is used by the Indexing Service to index the
item. The HTML version is also presented to users when the item is previewed or
viewed using the Enterprise Vault Web Access application.
Store converted content enumeration indicates whether converted content is
stored with the item, or generated on demand:
enum EV_STG_API_CONVERTED_CONTENT
{
CONVERTED_CONTENT_STORED = 0,
CONVERTED_CONTENT_ON_DEMAND = 1
};
EV_STG_API_CP_SETBY enumeration
Compliance set by enumeration is for use with compliance devices only. It indicates
where the compliance retention period is set:
enum EV_STG_API_CP_SETBY
{
SETBY_NOTSET = 0,
SETBY_SELF = 1,
SETBY_RETCAT = 2
};
The property, ComplianceData SetBy, uses this enumeration value to define where
the compliance retention period is set:
SETBY_NOTSET
SETBY_SELF
SETBY_RETCAT
79
80
EV_STG_API_CP_UNITS enumeration
Compliance units enumeration indicates the units used in specifying the
compliance period:
enum EV_STG_API_CP_UNITS
{
CP_UNITS_DAYS =0,
CP_UNITS_WEEKS = 1,
CP_UNITS_MONTHS = 2,
CP_UNITS_YEARS = 3,
CP_UNITS_DEFAULT = 4,
CP_UNITS_NONE = 5
};
EV_STG_API_DELETION_REASON enumeration
Deletion reason enumeration indicates why an item has been deleted from the
archive.
enum EV_STG_API_DELETION_REASON
{
DELETION_REASON_NONE = 0,
DELETION_REASON_USER = 1,
DELETION_REASON_EXPIRY = 2,
DELETION_REASON_SYSTEM = 3
DELETION_REASON_UNKNOWN = 2147483647
}
If an item no longer exists in the archive, the Item DeletionReason property can
be used to find out why the item was deleted. the Item DeletionReason property
uses the EV_STG_API_DELETION_REASON enumeration.
The enumeration values have the following meanings:
DELETION_REASON_NONE
DELETION_REASON_USER
DELETION_REASON_EXPIRY
DELETION_REASON_SYSTEM
DELETION_REASON_UNKNOWN
EV_STG_API_EXPIRE_ITEMS enumeration
Expire items enumeration indicates whether expired items should be deleted
automatically from the archive:
enum EV_STG_API_EXPIRE_ITEMS
{
DONT_EXPIRE_ITEMS = 0,
EXPIRE_ITEMS = 1
};
The property Archive ExpireItems can be used to return the enumeration value
for an existing archive, or set the required value for a new archive before Archive
Create is called.
See IArchive :: ExpireItems on page 136.
EV_STG_API_INDEX_LEVEL enumeration
Index level enumeration indicates how much of an item is indexed:
enum EV_STG_API_INDEX_LEVEL
{
INDEX_LEVEL_BRIEF = 0,
INDEX_LEVEL_MEDIUM = 1,
INDEX_LEVEL_FULL = 2,
INDEX_LEVEL_DEFAULT = 3
};
The Enterprise Vault Indexing service manages the indexes of archived data to
enable users to search for archived items. When users search the archives to
81
82
which they have access, the index volume files are searched. The more information
that is indexed about an item, the quicker it is to find the item. However, the more
information that is indexed about an item, the more disk space is required for the
index.
Note: INDEX_LEVEL_MEDIUM is only available on servers running Enterprise
Vault 9 or earlier. If INDEX_LEVEL_MEDIUM is requested on an Enterprise Vault
10.0 server, then INDEX_LEVEL_FULL is implemented.
See About indexing options on page 442.
FULL indexing is required for phrase searches of the content property
(IndexPropCONT).
The property, IArchive::IndexLevel, is used to determine the level of detail stored
in the archive's index.
See IArchive :: IndexLevel on page 142.
EV_STG_API_INDEX_URGENCY enumeration
Index urgency enumeration indicates whether to index items as they are stored:
enum EV_STG_API_INDEX_URGENCY
{
INDEX_ITEMS_IMMEDIATELY = 0,
INDEX_ITEMS_DEFER_INDEFINITELY = 1
};
Deferring indexing may be useful if you want to store a very large number of items
quickly.
If INDEX_ITEMS_DEFER_INDEFINITELY is set, the items will not be indexed until
the value has been reset to IMMEDIATELY. Thereafter, the next time the Indexing
Service runs, it will process the indexing backlog.
The Archive IndexUrgency property is used to access index urgency information.
See IArchive :: IndexUrgency on page 140.
EV_STG_API_ITEM_COPYOPTIONS enumeration
The Item CopyOptions property uses this enumeration to identify the source item
property values that are to be copied to the destination item when an archived
item is moved or copied to a different location.
enum EV_STG_API_ITEM_COPYOPTIONS
{
ITEM_COPYOPTIONS_UNSPECIFIED = 0x00000000,
ITEM_COPYOPTIONS_ARCHIVEMETADATA = 0x00000002,
ITEM_COPYOPTIONS_MERGE_INDEXMETADATA = 0x00000004
} ;
ITEM_COPYOPTIONS_MERGE_INDEXMETADATA
If this is set, then the resulting destination item will include the custom index
metadata properties on the source item and also any additional custom index
metadata properties that were added to the destination item before the copy
or move operation was performed.
EV_STG_API_ITEM_DETAIL enumeration
Item detail enumeration indicates the data to populate for an Item.Get request:
enum EV_STG_API_ITEM_DETAIL
{
DETAIL_LEVEL_ITEM_PROPERTIES = 1,
DETAIL_LEVEL_ITEM_CONTENT = 2,
DETAIL_LEVEL_ARCHIVE_METADATA = 4,
DETAIL_LEVEL_COMPLIANCE_DATA = 8,
DETAIL_LEVEL_HOLD_DATA = 16,
DETAIL_LEVEL_CUSTOM_INDEX_METADATA = 32,
DETAIL_LEVEL_SYSTEM_INDEXDATA = 64,
DETAIL_LEVEL_MESSAGE_ENVELOPE_INDEXDATA = 128
83
84
DETAIL_LEVEL_SENDER_RECIPIENT_INDEXDATA = 256
};
The following table lists the properties that are populated for the different item
detail levels.
Table 4-2
Enumeration value
Properties populated
DETAIL_LEVEL_ITEM_PROPERTIES
IContent.Title
IContent.Author
IContent.FileExtension
IContent.MIMEFormat
IContent.OriginalLocation
IContent.CreatedDate
IContent.ModifiedDate
IContent.OriginalSize
IItem.CanBeDeleted
IArchiveMetadata.IsItemSecured
See Content object on page 212.
See Item object on page 172.
See ArchiveMetaData object
on page 225.
DETAIL_LEVEL_ITEM_CONTENT
IContent.Data
DETAIL_LEVEL__ARCHIVE_METADATA
IArchiveMetadata.ArchivedDate
IArchiveMetadata.SavesetSize
IArchiveMetadata.RetentionCategory
IArchiveMetadata.CustomIdentifier
IArchiveMetadata.CustomQualifier
IArchiveMetadata.CustomProperties
IArchiveMetadata.CurrentFolderId
IArchiveMetadata.SequenceNum
DETAIL_LEVEL__COMPLIANCE_DATA
IArchiveMetadata.ComplianceDevice
IArchiveMetadata.RetentionExpires
Table 4-2
Enumeration value
Properties populated
DETAIL_LEVEL__HOLD_DATA
IItem.Holds
See Holds object on page 285.
DETAIL_LEVEL__CUSTOM_INDEX_METADATA
IArchiveMetadata.IndexData custom
index properties only. (System
properties are not included).
See Adding custom index metadata
on page 72.
DETAIL_LEVEL__SYSTEM_INDEXDATA
IArchiveMetadata.IndexData system
properties only, excluding the "menv"
and "sere" properties.
See System properties on page 596.
DETAIL_LEVEL__MESSAGE_ENVELOPE_INDEXDATA
IArchiveMetadata.IndexData "menv"
system property only.
See System properties on page 596.
DETAIL_LEVEL__SENDER_RECIPIENT_INDEXDATA
IArchiveMetadata.IndexData "sere"
system property only.
See System properties on page 596.
EV_STG_API_PERMISSIONS_TYPE enumeration
Archive permissions enumeration indicates archive permissions:
enum EV_STG_API_PERMISSIONS_TYPE
{
PERMISSIONS_UNSPECIFIED
= 0x00000000,
PERMISSIONS_SEARCH
= 0x00000080,
PERMISSIONS_READ
= 0x00000001,
PERMISSIONS_WRITE
= 0x00000002,
PERMISSIONS_DELETE
= 0x00000004,
PERMISSIONS_FOLDER_READ
= 0x00000008,
PERMISSIONS_FOLDER_WRITE = 0x00000010,
PERMISSIONS_FOLDER_DELETE = 0x00000020,
85
86
PERMISSIONS_READ_WRITE
= PERMISSIONS_READ|PERMISSIONS_WRITE,
PERMISSIONS_READ_WRITE_DELETE = PERMISSIONS_READ
|PERMISSIONS_WRITE
|PERMISSIONS_DELETE,
PERMISSIONS_WRITE_DELETE = PERMISSIONS_WRITE
|PERMISSIONS_DELETE,
PERMISSIONS_READ_DELETE
= PERMISSIONS_READ
|PERMISSIONS_DELETE,
PERMISSIONS_FOLDER_READ_WRITE= PERMISSIONS_FOLDER_READ
|PERMISSIONS_FOLDER_WRITE,
PERMISSIONS_FOLDER_READ_WRITE_DELETE = PERMISSIONSFOLDER__READ
|PERMISSIONS_FOLDER_WRITE
|PERMISSIONS_FOLDER_DELETE,
PERMISSIONS_FOLDER_WRITE_DELETE
= PERMISSIONS_FOLDER__WRITE
|PERMISSIONS_FOLDER_DELETE,
PERMISSIONS_FOLDER_READ_DELETE
= PERMISSIONS_FOLDER_READ
|PERMISSIONS_FOLDER_DELETE,
};
The Archives Permissions property uses this enumeration to select archives based
on the archive access permissions of the caller.
The Archive SecurityDescriptor property represents the manually set permissions
on an archive, which are displayed on the Permissions tab of the archive properties
dialog in the Enterprise Vault Administration Console.
EV_STG_API_PERMISSIONS_TYPE enumeration indicates the security descriptor
permissions for an archive.
See IArchives :: Permissions on page 126.
See IArchive3 :: SecurityDescriptor on page 157.
EV_STG_API_STATUS enumeration
Vault store or archive status enumeration indicates the status of the vault store
or archive storage:
enum EV_STG_API_STATUS
{
STS_AVAILABLE = 0,
STS_UNAVAILABLE = 1,
STS_TEMPORARILY_UNAVAILABLE = 2
STS_INBACKUPMODE = 3
};
The VaultStore Status and Archive Status properties use this enumeration to
indicate the status of the vault store or archive, and whether it can be accessed.
See IVaultStore :: Status on page 115.
See IArchive2 :: Status on page 154.
ContentManagementAPI object
This object provides top-level access (via the appropriate interfaces) to archives,
items and holds, and enables you to set and retrieve the Directory DNS Alias and
Authentication mode.
This object implements the following interfaces:
IContentManagementAPI
IContentManagementAPI2
IContentManagementAPI3
IContentManagementAPI4 (default)
Syntax
interface
interface
interface
interface
IContentManagementAPI : IDispatch
IContentManagementAPI2 : IContentManagementAPI
IContentManagementAPI3 : IContentManagementAPI2
IContentManagementAPI4 : IContentManagementAPI3
87
88
Member summary
Table 4-3
IContentManagementAPI properties
Property
Read/Write
Description
Archive
Read only
Item
Read only
Holds
Read only
Hold
Read only
DirectoryDNSAlias
Read/Write
Identifies an Enterprise
Vault server running an
Enterprise Vault Directory
Service.
AuthenticationMode
Read/Write
Table 4-4
IContentManagementAPI2 properties
Property
Read/Write
Description
VaultStores
Read only
VaultStore
Read only
Archives
Read only
Table 4-5
IContentManagementAPI3 property
Property
Read/Write
Description
Items
Read only
Table 4-6
IContentManagementAPI3 method
Method
Read/Write
Description
IDispatchQueryInterface
Read/Write
Table 4-7
IContentManagementAPI4 method
Method
Read
Description
LastError
Read
Remarks
This interface returns pointers to instances of other interfaces, such as
IVaultStores, IArchives, IItem, IHold, and IHolds. The properties of these need to
be set so that they can then be used to create, fetch, move, enumerate and delete
items, as required.
The interface also enables you to get and set the Directory DNS Alias and the
authentication mode for accessing Enterprise Vault.
See General guidelines for using the API on page 69.
Requirements
MSXML 6.0 or later is required on the computer where you install the Enterprise
Vault API runtime.
CLSID
E4BE20A4-9EF1-4B05-9117-AF43EAB4B295
89
90
Prog ID
EnterpriseVault.ContentManagementAPI
Type Library
EVContentManagementAPILib
DLL
EVContentManagementAPI.dll
.NET Primary
Interop Assembly
(PIA)
KVS.EnterpriseVault.Interop.EVContentManagementAPI.dll
.NET PIA
namespace
KVS.EnterpriseVault.Interop
Version information
Examples
[C++]
#import "c:\program files\Enterprise Vault\
EVContentManagementAPI.dll" no_namespace, raw_interfaces_only
class SomeClass
{
IContentManagementAPI4* m_pCmAPI = NULL;
public:
void SomeClass()
{
CLSID clsid;
CLSIDFromProgID(L"EnterpriseVault.ContentManagmentAPI",
&clsid);
CoCreateInstance(clsid, NUKK, CLSCTX_ALL, __uuidof
IContentManagementAPI :: Archive
This property returns an empty instance of an Archive object that can then be
used to perform various tasks, such as creating an archive, or modifying various
properties.
This property is read only.
Syntax
HRESULT Archive([out,retval] IArchive** pVal)
Parameters
[out,retval] IArchive** pVal
Remarks
After the Create method or Get method has been called, this interface pointer
must be released and a new one obtained before calling either of these methods
again.
91
92
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
In the following examples it is assumed a reference to IContentManagmentAPI,
m_pCmAPI (C++) or cmAPI (C#) has already been obtained.
[C++]
IArchive* pArchive = NULL:
m_pCmAPI->get_Archive(&pArchive);
CComBSTR bstrID(L"1C9EFA88998592944ADB634ACC0D7410D1110000EVSite");
CComBSTR bstrVaultStoreId(L"16D002240AEDFAC45A44E7FBE88FDC7721
210000EVSite");
pArchive->put_Id(bstrID);
pArchive->put_VaultStoreId(bstrVaultStoreId);
pArchive->Get();
//Do something
pArchive->Release();
pArchive = NULL;
[C#]
IArchive archive = cmAPI.Archive;
archive.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
archive.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
archive.Get();
//do something
System.Runtime.InteropServices.FinalReleaseComObject(archive);
archive = null;
93
IContentManagementAPI :: Item
This property returns an instance of an Item object that can then be used to
perform various tasks, such as creating an item and adding it to an archive,
fetching data, getting item properties, deleting items from an archive, copying or
moving items.
This property is read only.
Syntax
HRESULT Item([out, retval] IItem** pVal)
Parameters
[out, retval] IItem** pVal
Remarks
After the Insert, Delete or Get method has been called, this interface pointer must
be released and a new one obtained before calling any of these methods again.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
IItem* pItem = NULL:
m_pCmAPI->get_Item(&pItem);
CComBSTR bstrID(L"68bd9b6a-6355-4468-b647-0ec33ade6340"); //note transaction id used
CComBSTR bstrArchId(L"1C9EFA88998592944ADB634ACC0D7410
D1110000EVSite");
pItem->put_Id(bstrID);
94
pItem->put_ArchiveId(bstrArchId);
pItem->Release();
pItem = NULL;
[C#]
IItem itm = cmAPI.Item;
itm.Id = "68bd9b6a-6355-4468-b647-0ec33ade6340";
itm.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
//get item properties
itm.Get((int)EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ITEM_PROPERTIES);
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(item);
item = null;
See also
IContentManagementAPI :: Holds
This property returns an empty instance of a Holds object that can then be used
to place or release holds on a group of items with a single call to the Enterprise
Vault Server.
It exposes a standard COM interface (IEnumVariant), which manages a collection
of IHold objects.
IHolds is one of the interfaces that provides Legal Hold functionality.
This property is read only.
Syntax
HRESULT Holds([out, retval] IHolds** pVal)
Parameters
[out, retval] IHolds** pVal
Remarks
The IHold objects used to populate the Holds collection must be obtained using
the Hold property of IContentManagementAPI.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
IHolds* pHolds = NULL:
m_pCmAPI->get_Holds(&pHolds);
//Do something
pHolds->Release();
pHolds = NULL;
[C#]
IHolds holds = cmAPI.Holds;
//do something
System.Runtime.InteropServices.FinalReleaseComObject(holds);
holds = null;
See also
95
96
IContentManagementAPI :: Hold
This property returns an empty instance of a Hold object that can then be used
to place an item on hold. When a hold has been placed on an item, the item cannot
be deleted from the archive until the hold is released.
IHold is one of the interfaces that provides Legal Hold functionality
This property is read only.
Syntax
HRESULT Hold([out, retval] IHold** pVal);
Parameters
[out, retval] IHold** pVal
Remarks
The IHold interface is the mechanism by which hold(s) are placed on an item
archived in Enterprise Vault. The interface allows various properties to be set
before the Hold is added to the Holds collection in Enterprise Vault. The Holds
collection is exposed via the IHolds interface.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
IHolds* pHolds = NULL:
m_pCmAPI->get_Holds(&pHolds);
IHold* pHold = NULL;
m_pCmAPI->get_Hold(&pHold);
//Set properties
pHolds->Add(pHold);
pHold->Release();
pHold = NULL;
pHolds->Release();
pHolds = NULL;
[C#]
IHolds holds = cmAPI.Holds;
IHold hold = cmAPI.Hold;
//add some properties
holds.Add(hold);
System.Runtime.InteropServices.FinalReleaseComObject(holds);
holds = null;
System.Runtime.InteropServices.FinalReleaseComObject(hold);
hold = null;
See also
IContentManagementAPI :: DirectoryDNSAlias
This property is used to identify a computer running an Enterprise Vault Directory
Service, in order to retrieve information from the Enterprise Vault Directory.
This property is read/write.
Syntax
HRESULT DirectoryDNSAlias([out, retval] BSTR* pVal);
HRESULT DirectoryDNSAlias([in] BSTR newVal);
97
98
Parameters
[out, retval] BSTR* pVal
Remarks
The ID of an Enterprise Vault site can be found in the following registry entry on
an Enterprise Vault server:
HKEY_LOCAL_MACHINE
\SOFTWARE
\Wow6432Node
\KVS
\Enterprise Vault
\SiteID
Return value
S_OK
Success.
Examples
[C++]
CComBSTR bstrDNS(L"EVSERVER1");
m_pCmAPI->get_DirectoryDNSAlias(&bstrDNS);
//Do something
[C#]
[out]
string dns = cmAPI.DirectoryDNSAlias;
[in]
cmAPI.DirectoryDNSAlias = dns;
IContentManagementAPI :: AuthenticationMode
This property is used to get or set the mode to be used when authenticating to
Enterprise Vault. This can be either DCOM or Enterprise Vault authentication
server.
The property is read/write.
Syntax
HRESULT AuthenticationMode([out, retval]
EV_STG_API_AUTHENTICATE_USING* pVal)
HRESULT AuthenticationMode([in]
EV_STG_API_AUTHENTICATE_USING newVal)
Parameters
[out, retval]EV_STG_API_AUTHENTICATE_USING* pVal
Pointer to an
EV_STG_API_
AUTHENTICATE
_USING object which
will return the
current
authentication
mode.
[in]EV_STG_API_AUTHENTICATE_USING newVal
Remarks
The EV_STG_API_AUTHENTICATE_USING enumerator defines the authentication
mode to use.
99
100
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
m_pCmAPI->put_AuthenticationMode(AUTHENTICATE_USING_DCOM_SECURITY);
[C#]
cmAPI.AuthenticationMode =
EV_STG_API_AUTHENTICATE_USING.AUTHENTICATE_USING_DCOM_SECURITY;
IContentManagementAPI2 :: VaultStores
This property returns an empty instance of the VaultStores object, which enables
applications to enumerate details of the vault stores configured in Enterprise
Vault.
Syntax
HRESULT VaultStores([out, retval] IUnknown** pVal);
Parameters
[out, retval] IUnknown** pVal
Remarks
When successful, a pointer to an IUnknown* that can be QI'd (cast) for an
IVaultStores interface pointer.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL
Examples
[C++]
IVaultStores pVaultStores = NULL;
m_pCmAPI->get_VaultStores(&pVaultStores);
CComBSTR bstrComputer(L"EVSERVER1");
pVaultStores->put_Computer(bstrComputer);
pVaultStores->Get();
[C#]
IVaultStores vaultStores = cmAPI.VaultStores;
vaultStores.Computer = "EVSERVER1";
vaultStores.Get();
See also
IContentManagementAPI2 :: VaultStore
This property returns an empty instance of the VaultStore object, which can be
used to read the details of a vault store.
This property is read only.
101
102
Syntax
HRESULT VaultStore([out, retval] IUnknown** pVal);
Parameters
[out, retval] IUnknown** pVal
Remarks
To populate the Vault Store object, set the Id property to that of the vault store
then call Get.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL
Examples
[C++]
CComPtr<IVaultStore> spVaultStore;
CComPtr<IUnknown> spUnk;
m_pCmAPI->get_VaultStore(&pUnk);
spUnk->QueryInterface(&spVaultStore);
CComBSTR bstrID(L"16D002240AEDFAC45A44E7FBE88FDC772121
0000EVSite");
spVaultStore->put_Id(bstrID);
spVaultstore->Get();
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.ID = "16D002240AEDFAC45A44E7FBE88FDC7721210000
EVSite";
vaultStore.Get();
See also
IContentManagementAPI2 :: Archives
This property returns an instance of the Archives collection object, which enables
applications to enumerate archives configured in the current vault store.
Syntax
HRESULT Archives([out, retval] IUnknown** pVal);
Parameters
[out, retval] IUnknown** pVal
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL
Example
[C++]
CComPtr<IArchives> spArchives;
CComPtr<IUnknown> spUnk;
m_pCmAPI->get_Archives(&spUnk);
spUnk->QueryInterface(&spArchives);
CComBSTR
bstrVaultStore(L"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite");
spArchives->put_VaultStore(bstrVaultStore);
spArchives->put_ArchiveTypes(ARCHIVE_TYPE_EXCHANGE_MAILBOX);
See also
IContentManagementAPI3 :: Items
This property returns an empty instance of the Items object, which is populated
by calling IItems::Get. Applications can then enumerate the items in the archive.
103
104
Syntax
HRESULT Items([out, retval] IUnknown** pVal);
Parameters
[out, retval] IUnknown** pVal
Remarks
An IItems interface pointer can be obtained by calling QueryInterface on the
returned IUnknown* pointer.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL
Example
[C++]
// Get empty items collection for populating
CComPtr<IContentManagementAPI3> spCMAPI;
spCMAPI.CreateInstance(CComBSTR(L"EnterpriseVault.ContentManagement
API"));
CComPtr<IUnknown> spUnk;
// Get an Items object for enumeration
spCMapi->get_Items(&spUnk);
CComQIPtr<IItems> spItems(spUnk);
See also
IContentManagementAPI3 :: IDispatchQueryInterface
This method enables calling applications written in Visual Basic Script to access
the properties of the following interfaces:
IArchive3
IArchiveMetaData2
IItem2
Syntax
HRESULT IDispatchQueryInterface ([in] IDispatch* pUnkObj,
[in] BSTR interfaceId,
[out, retval] IDispatch** ppUnkRetVal);
Parameters
[in] IDispatch* pUnkObj
Remarks
The pointer for returning the queried interface object returns NULL, and an error
is reported, if the interface is not supported.
When running scripts on a 64-bit operating system, use the 32-bit version of
command prompt, C:\Windows\SysWOW64\cmd.exe.
Return value
S_OK
Success
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Either of pUnkObj or
ppUnkRetVal are NULL, or
interfaceId is empty, is not a
valid interface ID (IID), or the
interface is not available on the
object being queried.
105
106
Example
The following Visual Basic Script example illustrates how to use this method to
query for an IArchiveMetaData2 interface (with the IID string
"{5C6882BD-24BE-4C32-87EF-C3701D949BAA}" ) from an IArchiveMetaData
object interface, in order to access the IArchiveMetaData2::SequenceNum property.
dim cmAPI, item, SeqNo, IAMD2
set cmAPI = CreateObject("EnterpriseVault.ContentManagementAPI")
set item = ContentManagementAPI.Item
set IAMD2 = cmAPI.IDispatchQueryInterface(item.ArchiveMetaData,
"{5C6882BD-24BE-4C32-87EF-C3701D949BAA}")
if (IAMD2 is nothing) then
MsgBox "ArchiveMetaData2 API Object create failed!"
end if
SeqNo = IAMD2.SequenceNum
See also
IContentManagementAPI4 :: LastError
This method provides calling applications with extended error information if an
error is encountered when using the Content Management API methods.
Syntax
HRESULT LastError([out,retval] IUnknown** pVal);
Parameters
[out,retval] IUnknown** pVal
Remarks
The ExtendedErrorInfo object provides error details for the last call to a Content
Management API method.
Return value
S_OK
Success
See also
VaultStores object
This object implements the following interface:
IVaultStores
Syntax
interface IVaultStores : ICollectionBase
Member summary
Table 4-8
IVaultstores properties
Property
Read/Write
Description
Computer
Read/Write
Details of the properties and methods of the ICollectionBase interface are provided
in later sections of this guide.
See Table 4-9 on page 108.
See Table 4-10 on page 108.
107
108
Table 4-9
ICollectionBase properties
Property
Read/Write
Description
Count
Read only
_NewEnum
Read only
Item
Read only
Maximum
Read/Write
More
Read only
Table 4-10
ICollectionBase methods
Method
Description
Get
Clear
Reset
Remarks
Use the ICollectionBase :: Get method of this interface to obtain a collection of
VaultStore objects, and automatically populate the properties of each VaultStore
object .
See VaultStore object on page 110.
Version information
Example
This example code lists all vault stores based on a Computer DNS name.
[C#]
IContentManagementAPI3 cmAPI = (IContentManagementAPI3)
new ContentManagementAPI();
IVaultStores vaultStores = (IVaultStores) CMAPI.VaultStores;
// Populate collection from EV1
vaultStores.Computer = "EV1.Acme.com";
vaultStores.Get();
// Process each Vault Store
foreach(IVaultStore vaultStore in vaultStores)
{
ProcessIt(vaultStore.Id, vaultStore.Name);
}
IVaultStores :: Computer
This property identifies an Enterprise Vault server running a Directory Service.
The property is read/write.
Syntax
HRESULT Computer([in] BSTR pVal);
HRESULT Computer([out, retval] BSTR* pVal);
Parameters
[in] BSTR pVal
Remarks
This property can be set with any identifier that Enterprise Vault can use to
identify an Enterprise Vault server running a Directory Service, for example:
DNS name
IP address
Vault store Id
Archive Id
109
110
The Id of an Enterprise Vault Site can be found in the following registry entry on
an Enterprise Vault server:
HKEY_LOCAL_MACHINE
\SOFTWARE
\Wow6432Node
\KVS
\Enterprise Vault
\SiteID
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL
Example
[C#]
IContentManagementAPI3 cmAPI = (IContentManagementAPI3)
new ContentManagementAPI();
IVaultStores vaultStores = (IVaultStores) CMAPI.VaultStores;
// Populate collection from EV1
vaultStores.Computer = "EV1.Acme.com";
vaultStores.Get();
// Process each Vault Store
foreach(IVaultStore vaultStore in vaultStores)
{
ProcessIt(vaultStore.Id, vaultStore.Name);
}
VaultStore object
This object implements the following interface:
IVaultStore
Syntax
interface IVaultStore : IDispatch
Member summary
Table 4-11
IVaultstore properties
Property
Read/Write
Description
Id
Read/Write
Name
Read only
Description
Read only
Status
Read only
ArchiveCount
Read only
Table 4-12
IVaultStore methods
Method
Description
Get
Remarks
If you use the ICollectionBase interface to enumerate vault stores, then the
IVaultStore properties are populated automatically for each vault store returned.
See VaultStores object on page 107.
Alternatively, if you select a specific vault store using the Id property, you can
call the Get method to populate the VaultStore properties.
Version information
111
112
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
string name = vaultStore.Name;
string description = vaultsStore.Description;
string dnsAlias = vaultStore.DirectoryDNSAlias;
EV_STG_API_STATUS evStatus = vaultStore.Status;
long count = vaultStore.ArchiveCount;
IVaultStore :: Id
This property contains the Id of the target vault store.
The property is read/write.
Syntax
HRESULT Id([out, retval] BSTR* pVal);
HRESULT Id([in] BSTR newVal);
Parameters
[in] BSTR pVal
Remarks
The Id of a vault store can be found in the Administration Console, in the properties
dialog for a vault store.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
string name = vaultStore.Name;
string description = vaultsStore.Description;
string dnsAlias = vaultStore.DirectoryDNSAlias;
EV_STG_API_STATUS evStatus = vaultStore.Status;
long count = vaultStore.ArchiveCount;
IVaultStore :: Name
This property contains the name of the selected vault store.
The property is read only.
Syntax
HRESULT Name([out, retval] BSTR* pVal);
Parameter
[out, retval] BSTR* pVal
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
113
114
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
string name = vaultStore.Name;
string description = vaultsStore.Description;
string dnsAlias = vaultStore.DirectoryDNSAlias;
EV_STG_API_STATUS evStatus = vaultStore.Status;
long count = vaultStore.ArchiveCount;
IVaultStore :: Description
This property contains the vault store description.
The property is read only.
Syntax
HRESULT Description([out, retval] BSTR* pVal);
Parameter
[out, retval] BSTR* pVal
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
IVaultStore :: Status
This property contains the status of the vault store.
The property is read only.
Syntax
HRESULT Status([out, retval] EV_STG_API_STATUS* pVal);
Parameter
[out, retval] EV_STG_API_STATUS* pVal
EV_STG_API_STATUS
enumerated value.
Remarks
EV_STG_API_STATUS is an enumerated type.
See EV_STG_API_STATUS enumeration on page 86.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
string name = vaultStore.Name;
string description = vaultsStore.Description;
115
116
IVaultStore :: ArchiveCount
This property contains the number of archives in the vault store.
The property is read only.
Syntax
HRESULT ArchiveCount([out, retval] long* pVal);
Parameter
[out, retval] long* pVal
Remarks
This property is populated using an additional call to the Enterprise Vault server.
For this reason, it is only populated when explicitly requested.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
string name = vaultStore.Name;
string description = vaultsStore.Description;
string dnsAlias = vaultStore.DirectoryDNSAlias;
EV_STG_API_STATUS evStatus = vaultStore.Status;
long count = vaultStore.ArchiveCount;
IVaultStore :: DirectoryDNSAlias
This property contains the DNS Alias created for the Enterprise Vault Site.
The property is read only.
Syntax
HRESULT DirectoryDNSAlias([out, retval] BSTR* pVal);
Parameter
[out, retval] BSTR* pVal
Remarks
When configuring Enterprise Vault, a DNS alias is assigned to the IP address of
the computer that hosts the primary Enterprise Vault Directory Service for the
Enterprise Vault Site.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
117
118
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
string name = vaultStore.Name;
string description = vaultsStore.Description;
string dnsAlias = vaultStore.DirectoryDNSAlias;
EV_STG_API_STATUS evStatus = vaultStore.Status;
long count = vaultStore.ArchiveCount;
IVaultStore :: Get
This method returns the properties for the selected vault store.
Syntax
HRESULT Get(void);
Remarks
If you do not enumerate vault stores using the IVaultStores interface, then you
can set the Id property of the IVaultStore interface and call Get to populate the
IVaultStore properties.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
[C#]
IVaultStore vaultStore = cmAPI.VaultStore;
vaultStore.Id = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
vaultStore.Get();
//now get vault store properties
string name = vaultStore.Name;
string description = vaultsStore.Description;
string dnsAlias = vaultStore.DirectoryDNSAlias;
EV_STG_API_STATUS evStatus = vaultStore.Status;
long count = vaultStore.ArchiveCount;
Archives object
This object implements the following interface:
IArchives
The IArchives interface inherits the properties and methods of the ICollectionBase
interface.
This interface enables applications to enumerate archives optionally filtered by
archive name, type, permissions or vault store.
Syntax
interface IArchives : ICollectionBase
119
120
Member summary
Table 4-13
IArchives properties
Property
Read/Write
Description
Computer
Read/Write
VaultStoreId
Read/Write
ArchiveName
Read/Write
Permissions
Read/Write
ArchiveTypes
Read/Write
The properties and methods of the ICollectionBase interface are described in later
sections.
See Table 4-14 on page 120.
See Table 4-15 on page 121.
Table 4-14
ICollectionBase properties
Property
Read/Write
Description
Count
Read only
_NewEnum
Read only
Item
Read only
Maximum
Read/Write
More
Read only
Table 4-15
ICollectionBase methods
Method
Description
Get
Clear
Reset
Remarks
Use the ICollectionBase :: Get method of this interface to obtain a collection of
Archive objects, and automatically populate the properties of each Archive object.
The properties of the IArchives interface enable you to select which archives you
want returned.
The ICollectionBase :: Get method supports archive selection using combinations
of properties, subject to the following rules:
If you set Computer, you can also set the one of the following properties or
combinations of properties:
ArchiveName
Permissions
ArchiveType
If you set VaultStoreId, the only other property that you can set is ArchiveType.
Version information
Example
This example lists all Exchange Server mailbox archives that can be searched by
the caller, based on the DNS Alias for an Enterprise Vault Site.
[C#]
IArchives archives = (IArchives)cmAPI.Archives;
121
122
See also
IArchives :: Computer
This property identifies an Enterprise Vault server running a Directory Service.
The property is read/write.
Syntax
HRESULT Computer([in] BSTR pVal);
HRESULT Computer([out, retval] BSTR* pVal);
Parameters
[in] BSTR pVal
Remarks
This property can be set with any identifier that Enterprise Vault can use to
identify an Enterprise Vault server running a Directory Service, for example:
DNS name
IP address
Vault store Id
Archive Id
The Id of an Enterprise Vault Site can be found in the following registry entry on
an Enterprise Vault server:
HKEY_LOCAL_MACHINE
\SOFTWARE
\Wow6432Node
\KVS
\Enterprise Vault
\SiteID
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
This example gets all the archives that the user has permission to search.
[C#]
IArchives archives = (IArchives)cmAPI.Archives;
archives.Computer = "EV1.acme.com";
archives.Permissions =
EV_STG_API_PERMISSIONS_TYPE.PERMISSIONS_SEARCH;
archives.Get();
IArchives :: VaultStoreId
This property contains the Id of the vault store that contains the required archive
or archives.
The property is read/write.
123
124
Syntax
HRESULT VaultStoreId([in] BSTR pVal);
HRESULT VaultStoreId([out, retval] BSTR* pVal);
Parameters
[in] BSTR pVal
Remarks
The Id of a vault store can be found in the Administration Console, in the properties
dialog for a vault store, or by enumerating vault stores using the VaultStores
object.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
This example gets all Exchange Server mailbox archives in a particular vault store.
[C#]
IArchives archs = (IArchives)cmAPI.Archives;
archs.VaulStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
archs.ArchiveTypes =
EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_EXCHANGE_MAILBOX;
archs.Get();
IArchives :: ArchiveName
This property enables archives to be selected by name or partial name.
The property is read/write.
Syntax
HRESULT ArchiveName([in] BSTR pVal);
HRESULT ArchiveName([out, retval] BSTR* pVal);
Parameters
[in] BSTR pVal
Remarks
Multiple archives can be selected by use of common wildcard syntax. The following
wildcard features are supported:
[] matches any single character within the specified range or set (case
insensitive). For example
[^] to match any single character not in the specified range or set (case
insensitive). For example
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
125
126
Example
This example retrieves all archives with a name ending in Smith.
[C#]
IArchives archs = cmAPI.Archives;
archs.Computer = "SERVER1";
archs.ArchiveName = "*Smith";
archs.Get();
IArchives :: Permissions
This property enables selection of archives based on the archive access permissions
of the caller.
The property is read/write.
Syntax
HRESULT Permissions([in] EV_STG_API_PERMISSIONS_TYPE pVal);
HRESULT Permissions([out, retval] EV_STG_API_PERMISSIONS_TYPE*
pVal);
Parameters
[in] EV_STG_API_PERMISSIONS_TYPE pVal
New EV_STG_API
_PERMISSIONS_TYPE
value.
Remarks
EV_STG_API_PERMISSIONS_TYPE is an enumerated type that indicates the
required archive permissions.
See EV_STG_API_PERMISSIONS_TYPE enumeration on page 85.
The permissions checks are based on the current Windows identity of the caller.
If the caller is currently impersonating, then the impersonation identity is used.
Currently there is no support for the Lotus Domino authentication model.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
[C#]
IArchives archives = (IArchives)cmAPI.Archives;
archives.Computer = "EV1.acme.com";
archives.Permissions =
EV_STG_API_PERMISSIONS_TYPE.PERMISSIONS_SEARCH;
archives.Get();
IArchives :: ArchiveTypes
This property enables the selection of archives based on the type of archive. For
example, Exchange Server mailbox archive, FSA archive, SharePoint archive, and
so on.
The property is read/write.
Syntax
HRESULT ArchiveTypes([in] LONG pVal));
HRESULT ArchiveTypes([out, retval] LONG* pVal);
Parameters
[in] LONG pVal
Remarks
EV_STG_API_ARCHIVE_TYPE enumeration indicates the type of archive.
See EV_STG_API_ARCHIVE_TYPE enumeration on page 77.
127
128
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
[C#]
IArchives archives = (IArchives)cmAPI.Archives;
archives.ArchiveTypes =
(int)EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_EXCHANGE_MAILBOX;
archives.Permissions =
(int)EV_STG_API_PERMISSIONS_TYPE.PERMISSION_SEARCH;
archives.Get();
Archive object
This object implements the following interfaces:
IArchive
IID is {48092C71-5618-4EB5-9060-01030C191450}
IArchive2
IID is {B85C5178-0B9D-4987-8DC5-92F77B33879E}
IArchive3
IID is {9E2C0ACF-4CB5-4FB3-A9AB-499BB9EE959C}
These interfaces enable the creation and examination of archives in a vault store.
IArchive2 provides additional properties to enable querying the type and status
of an archive.
IArchive3 provides additional properties to enable setting and querying the access
security assigned to an archive.
Syntax
interface IArchive : IDispatch
interface IArchive2 : IArchive
interface IArchive3 : IArchive2
Member summary
Table 4-16
IArchive properties
Property
Read/Write
Description
VaultStoreId
Read/Write
Id
Read/Write
Name
Read/Write
Description
Read/Write
ExpireItems
Read/Write
ConvertedContent
Read/Write
IndexLevel
Read/Write
IndexUrgency
Read/Write
Size
Read only
SecurityDescriptor
Write only
ComplianceDevice
Read only
ItemCount
Read only
Table 4-17
IArchive2 properties
Property
Read/Write
Description
Type
Read only
Status
Read only
129
130
Table 4-17
Property
Read/Write
Description
HasFolders
Read only
Full
Read only
DirectoryDNSAlias
Read only
Table 4-18
IArchive3 properties
Property
Read/Write
Description
SecurityDescriptor
Read/Write
SecurityDescriptorString
Read/Write
Type
Read/Write
Table 4-19
IArchive methods
Method
Description
Create
Creates an archive.
Get
Remarks
After the Create method or Get method has been called on this interface, the
reference must be released and a new one obtained before calling either of these
methods again.
Version information
131
Example
[C#]
IArchive arch = cmAPI.Archive
arch.VaultStoreId = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
IArchive :: VaultStoreId
This property identifies the vault store in which the archive resides or will reside.
The property is read/write.
Syntax
HRESULT VaultStoreId([in] BSTR newVal)
HRESULT VaultStoreId([out,retval] BSTR* pVal)
Parameters
[in] BSTR newVal
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Incorrect Id format.
Example
arch.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
132
IArchive :: Id
This property contains the Archive Id of the archive.
This property is read/write.
Syntax
HRESULT Id([out, retval] BSTR* pVal);
HRESULT Id([in] BSTR newVal);
Parameters
[in] BSTR newVal
Remarks
This value must be set prior to calling Get.
If an attempt to change this value on an existing archive is made then an error
will occur.
The following is an example value of the Id property:
"181E669473B52E64384C9A7D9EACA0E7E1110000evsite"
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
arch.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
or
[out]
IArchive :: Name
This property is used to set the name for a new archive or retrieve the name of
an existing archive.
The property is read/write.
Syntax
HRESULT Name([in] BSTR newVal)
HRESULT Name([out,retval] BSTR* pVal)
Parameters
[in] BSTR newVal
Remarks
This property must be set before creating an archive, but is not required to get
an archive.
Any attempt to change the name of an existing archive will result in an error.
The value must contain printable characters only, and cannot be blank or an
empty string.
133
134
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[in]
arch.Name = "my new archive";
arch.Description = "my new archive description";
arch.ExpireItems = EV_STG_API_EXPIRE_ITEMS. DONT_EXPIRE_ITEMS;
arch.ConvertedContent = EV_STG_API_CONVERTED_CONTENT.
CONVERTED_CONTENT_STORED;
arch.IndexUrgency = EV_STG_API_INDEX_URGENCY.
INDEX_ITEMS_IMMEDIATELY;
arch.IndexLevel = EV_STG_API_INDEX_LEVEL. INDEX_LEVEL_FULL;
arch.Create();
[out]
arch.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
string
name = arch.Name;
IArchive :: Description
This property contains a more complete description of the archive.
The property is read/write.
Syntax
HRESULT Description([in] BSTR newVal)
HRESULT Description([out,retval] BSTR* pVal)
Parameters
[in] BSTR newVal
[out,retval] BSTR* Pointer to a BSTR that will contain the description of the archive.
pVal
Remarks
The [in] property can only be used to set the description of a new archive before
it is created. Any attempt to change the description of an existing archive will
result in an error.
The property is optional. If supplied, the value must contain printable characters
only.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
CComBstr bstr = new CComBSTR(L"archive description");
archive->put_Description(bstr):
//do something - create archive
//then check name
archive->get_ Description (&bstr);
//try changing name
135
136
//ERROR
[C#]
archive. Description = "archive description";
//do something - create archive
//then check name
string name = archive. Description;
//try changing name
archive. Description = "New description";
//ERROR
IArchive :: ExpireItems
This property specifies whether or not items should be automatically deleted
(expired) from the archive.
The property is read/write.
Syntax
HRESULT ExpireItems([out, retval] EV_STG_API_EXPIRE_ITEMS* pVal);
HRESULT ExpireItems([in] EV_STG_API_EXPIRE_ITEMS newVal);
Parameters
[out, retval] EV_STG_API_EXPIRE_ITEMS* pVal
Pointer to an
EV_STG_API
_EXPIRE_ITEMS
object that will
contain the current
value.
Remarks
The required value must be set prior to calling Create.
The [in] property can only be used to set the ExpireItems value of a new archive
before it is created. Any attempt to change this value in an existing archive will
result in an error.
Do not attempt to retrieve a value for ExpireItems before creating or getting an
archive, as an error will occur. No default value is set for this property.
EV_STG_API_EXPIRE_ITEMS is an enumeration type that indicates whether
expired items should be deleted automatically from the archive.
See EV_STG_API_EXPIRE_ITEMS enumeration on page 81.
It may be necessary to cast this to an integer if using in C#.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
EV_STG_API_EXPIRE_ITEMS ei = DONT_EXPIRE_ITEMS;
archive->put_ExpireItems(ei);
//do other things and create archive
//Now check value
archive->get_ExpireItems(&ei);
//try changing value
archive->put_ExpireItems(EXPIRE_ITEMS);
//ERROR
[C#]
EV_STG_API_EXPIRE_ITEMS ei =
EV_STG_API_EXPIRE_ITEMS.DONT_EXPIRE_ITEMS;
archive.ExpireItems = ei;
//do other things and create archive
137
138
IArchive :: ConvertedContent
This property specifies whether converted content is stored in the item or
generated on demand.
The property is read/write.
Syntax
HRESULT ConvertedContent([out, retval]
EV_STG_API_CONVERTED_CONTENT* pVal);
HRESULT ConvertedContent([in] EV_STG_API_CONVERTED_CONTENT newVal);
Parameters
[out, retval]EV_STG_API_CONVERTED_CONTENT* pVal
Pointer to an
EV_STG_API_
CONVERTED_CONTENT
object that will contain
the current value.
Remarks
This property must be set before calling Create. Any attempt to retrieve the value
of this property before Get or Create has been called will result in an error. Any
attempt to change this value on an existing archive will result in an error.
EV_STG_API_CONVERTED_CONTENT enumeration indicates whether to store
converted content with the item.
See EV_STG_API_CONVERTED_CONTENT enumeration on page 79.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
EV_STG_API_CONVERTED_CONTENT cc = CONVERTED_CONTENT_STORED;
archive->put_ConvertedContent(cc);
139
140
IArchive :: IndexUrgency
This property specifies when items are indexed.
The property is read/write.
Syntax
HRESULT IndexUrgency([out, retval] EV_STG_API_INDEX_URGENCY* pVal);
HRESULT IndexUrgency([in] EV_STG_API_INDEX_URGENCY newVal);
Parameters
[out, retval] EV_STG_API_INDEX_URGENCY* pVal
Pointer to an
EV_STG_API
_INDEX_URGENCY
object that will
contain the current
value
New value of
EV_STG_API_
INDEX_URGENCY
Remarks
This property must be set before calling Create. Any attempt to retrieve the value
of this property before Get or Create have been called will result in failure.
EV_STG_API_INDEX_URGENCY enumeration indicates whether to index items
as they are stored.
See EV_STG_API_INDEX_URGENCY enumeration on page 82.
Deferring indexing may be useful if you want to store a very large number of items
quickly.
INDEX_ITEMS_DEFER_INDEFINITELY was originally introduced to be used with
File System Archiving only. If this value is set, the items will not be indexed until
the value has been reset to IMMEDIATELY, and the next time the Indexing Service
runs it will process the index backlog.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
EV_STG_API_INDEX_URGENCY
iu = INDEX_ITEMS_IMMEDIATELY;
;
archive->put_IndexUrgency(iu);
141
142
IArchive :: IndexLevel
This property determines the level of detail stored in the archive's index.
The property is read/write.
Syntax
HRESULT IndexLevel([out, retval] EV_STG_API_INDEX_LEVEL* pVal);
HRESULT IndexLevel([in] EV_STG_API_INDEX_LEVEL newVal);
Parameters
[out, retval] EV_STG_API_INDEX_LEVEL* pVal
Pointer to an
EV_STG_API_
INDEX_LEVEL
object that will
contain the
current value.
New value of
EV_STG_API_
INDEX_LEVEL.
Remarks
EV_STG_API_INDEX_LEVEL enumeration indicates how much of an item is
indexed.
See EV_STG_API_INDEX_LEVEL enumeration on page 81.
The Indexing service manages the indexes of archived data to enable users to
search for archived items.
When users search the archives to which they have access, the index volume files
are searched. The more information that is indexed about an item, the quicker it
is to find the item. However, the more information that is indexed about an item,
the more disk space is required for the index.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
EV_STG_API_INDEX_LEVEL il = INDEX_LEVEL_BRIEF;
archive->put_IndexLevel(il);
//do something and create archive
//Now check value
archive->get_ IndexLevel (&il);
//try and change value
archive->put_ IndexLevel (INDEX_LEVEL_FULL); //ERROR
[C#]
EV_STG_API_INDEX_URGENCY il =
EV_STG_API_INDEX_LEVEL. INDEX_LEVEL_BRIEF;
archive. IndexLevel = il;
//do something - create archive
//check value
il = Archive. IndexLevel;
IArchive :: Size
This property contains the size of the archive.
The property is read only.
143
144
Syntax
HRESULT Size([out, retval] VARIANT* pVal);
Parameters
[out, retval] VARIANT* pVal
Remarks
Property will only contain a value once an archive has been created.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
arch.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
string name = arch.Name;
string description = arch.Description;
EV_STG_API_EXPIRE_ITEMS evEI = arch.ExpireItems;
EV_STG_API_CONVERTED_CONTENT evCC = arch.ConvertedContent;
EV_STG_API_INDEX_URGENCY evIU = arch.IndexUrgency;
EV_STG_API_INDEX_LEVEL evIL = arch.IndexLevel;
ulong size = (ulong) arch.Size;
IArchive :: SecurityDescriptor
This property contains the self-relative security descriptor to be used when
creating an archive.
The property is write only. A read/write version of the property is available on
the IArchive3 interface.
Syntax
HRESULT SecurityDescriptor([in] VARIANT newVal);
Parameters
[in] VARIANT newVal
Remarks
Any attempt to modify the security descriptor of an existing archive will result
in an error.
The self-relative security descriptor may override the current user.
If the type of the variant is VT_ARRAY then the variant is a byte array containing
the SECURITY_DESCRIPTOR for the user account that will be given access to the
archive.
If the type of the variant is VT_EMPTY then the security descriptor is set to default
(that is, the user creating the archive has full access to the archive).
Finally a type of VT_NULL means that the archive is created without any
permissions.
EV_STG_API_PERMISSIONS_TYPE enumeration indicates the security descriptor
permissions for an archive.
See EV_STG_API_PERMISSIONS_TYPE enumeration on page 85.
The values of the EV_STG_API_PERMISSIONS_TYPE enumeration may be
combined (using OR) to set the required value. For example, to set search and read
item, you would enter PERMISSIONS_SEARCH|PERMISSIONS_READ.
145
146
Version information
At Enterprise Vault 8.0, this property is superseded by the
IArchive3::SecurityDescriptor property.
See IArchive3 :: SecurityDescriptor on page 157.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
To create a security descriptor:
char aszPrompt[MAX_INPUT_BUFFER];
wcout << L"Domain\\Account: " << flush;
cin.getline(aszPrompt, MAX_INPUT);
// Create Security Identifier from Domain and Account
CSid Sid;
if (!Sid.LoadAccount(aszPrompt))
{
return HRESULT_FROM_WIN32(GetLastError());
}
// Create ACE (access-control entry)
CDacl Dacl;
if (!Dacl.AddAllowedAce(Sid, PERMISSIONS_READ_WRITE_DELETE))
{
return HRESULT_FROM_WIN32(GetLastError());
}
// Set information in a DACL (discretionary access-control list)
CSecurityDesc SecurityDesc;
SecurityDesc.SetDacl(Dacl);
// Convert security descriptor to self-relative format
SecurityDesc.MakeSelfRelative();
// Copy security descriptor to a byte array
UINT SecurityDescLength = SecurityDesc.GetLength();
IArchive :: ComplianceDevice
This property tells the caller whether the archive resides on a device capable of
setting compliance periods.
The property is read only.
Syntax
HRESULT ComplianceDevice([out, retval] VARIANT_BOOL* pVal);
Parameters
[out, retval] VARIANT_BOOL* pVal
Remarks
If the archive is on a compliance device then TRUE is returned, otherwise FALSE
is returned.
Get must be called before accessing this property, otherwise an error will result.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
147
148
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
arch.VaultStoreId = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
string name = arch.Name;
string description = arch.Description;
EV_STG_API_EXPIRE_ITEMS evEI = arch.ExpireItems;
EV_STG_API_CONVERTED_CONTENT evCC = arch.ConvertedContent;
EV_STG_API_INDEX_URGENCY evIU = arch.IndexUrgency;
EV_STG_API_INDEX_LEVEL evIL = arch.IndexLevel;
ulong size = (ulong) arch.Size;
bool complianceDevice = arch.ComplianceDevice;
uint itemCount = (uint) arch.ItemCount;
IArchive :: ItemCount
This property tells the caller how many items are currently held in the archive.
The property is read only.
Syntax
HRESULT ItemCount([out,retval] VARIANT* pVal)
Parameters
[out,retval] VARIANT* pVal
149
Remarks
This property can only be used after Get or Create have been called.
The type of the variant will be unsigned long, for example, vt= VT_UI4.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
arch.VaultStoreId = "16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
string name = arch.Name;
string description = arch.Description;
EV_STG_API_EXPIRE_ITEMS evEI = arch.ExpireItems;
EV_STG_API_CONVERTED_CONTENT evCC = arch.ConvertedContent;
EV_STG_API_INDEX_URGENCY evIU = arch.IndexUrgency;
EV_STG_API_INDEX_LEVEL evIL = arch.IndexLevel;
;
ulong size = (ulong) arch.Size;
bool complianceDevice = arch.ComplianceDevice;
uint itemCount = (uint) arch.ItemCount;
IArchive :: Create
This method is used to create an archive.
150
Syntax
HRESULT Create(void)
Remarks
To create an archive the calling application must be in a role that includes the
operation, Can manage Enterprise Vault Stores. By default, the Enterprise Vault
Storage Administrator and Power Administrator roles include this operation.
Before calling this method, the following properties must be set:
VaultStoreId
Name
IndexUrgency
ConvertedContent
ExpireItems
IndexLevel
If the archive is created successfully, the Id property will be populated with the
archive Id from the Enterprise Vault Directory.
When an archive is created, it is always created as an Enterprise Vault shared
archive.
See IArchive3 :: Type on page 162.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
CONTENTMANAGEMENTAPI_E_NO_ACCESS
Examples
[C++]
archiveName = L"XYZRM_";
archiveName += username;
archive->put_Name(archiveName);
archive->put_Description(CComBSTR(L"XYZ RM application archive"));
archive->put_VaultStoreId(CComBSTR(L"181E669473B52E64384C9A7D9EACA0
E7E1210000evsite"));
archive->put_ExpireItems(EXPIRE_ITEMS);
archive->put_IndexLevel(INDEX_LEVEL_FULL);
archive->put_ConvertedContent(CONVERTED_CONTENT_STORED);
archive->put_IndexUrgency(INDEX_ITEMS_IMMEDIATELY);
archive->Create();
archive->get_Id(&archiveId); // Remember the assigned Id for future
insertions
[C#]
archive.Name = "XYZRM_" + userName;
archive.Description = "XYZ RM application archive";
archive.VaultStoreId =
"181E669473B52E64384C9A7D9EACA0E7E1210000evsite";
archive.ExpireItems = EV_STG_API_EXPIRE_ITEMS.EXPIRE_ITEMS;
151
152
archive.IndexLevel = EV_STG_API_INDEX_LEVEL.INDEX_LEVEL_FULL;
archive.ConvertedContent =
EV_STG_API_CONVERTED_CONTENT.CONVERTED_CONTENT_STORED;
archive.IndexUrgency
=EV_STG_API_INDEX_URGENCY.INDEX_ITEMS_IMMEDIATELY;
archive.Create();
archiveId = archive.Id;
// Remember the assigned Id for future
insertions
IArchive :: Get
This method is used to retrieve information about an archive.
Syntax
HRESULT Get(void)
Remarks
The Get method tells the Content Management API to retrieve archive details
from the store, populating the properties of the object. Before calling this method,
the ArchiveId must be set.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
arch.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch.Get();
string name = arch.Name;
string description = arch.Description;
EV_STG_API_EXPIRE_ITEMS evEI = arch.ExpireItems;
EV_STG_API_CONVERTED_CONTENT evCC = arch.ConvertedContent;
EV_STG_API_INDEX_URGENCY evIU = arch.IndexUrgency;
EV_STG_API_INDEX_LEVEL evIL = arch.IndexLevel;
ulong size = (ulong) arch.Size;
bool complianceDevice = arch.ComplianceDevice;
uint itemCount = (uint) arch.ItemCount;
IArchive2 :: Type
This property identifies the type of the archive, for example, Exchange Server
mailbox archive, FSA archive, SharePoint archive, and so on.
The property is read only.
Syntax
HRESULT Type([out, retval] EV_STG_API_ARCHIVE_TYPE* pVal);
Parameters
[out, retval] EV_STG_API_ARCHIVE_TYPE* pVal
Pointer to an
EV_STG_API
_ARCHIVE_TYPE that
contains the current
value.
Remarks
EV_STG_API_ARCHIVE_TYPE enumeration indicates the type of archive.
See EV_STG_API_ARCHIVE_TYPE enumeration on page 77.
Version information
At Enterprise Vault 8.0, this property is superseded by the IArchive3::Type
property.
See IArchive3 :: Type on page 162.
153
154
Return value
S_OK
Success
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
IArchive2 :: Status
This property indicates the status of the archive, that is, whether it can be accessed.
The property is read only.
Syntax
HRESULT Status([out, retval] EV_STG_API_STATUS* pVal);
Parameters
Pointer to an EV_STG_API
_STATUS that contains the
current value.
Remarks
EV_STG_API_STATUS enumeration indicates the status of the archive.
See EV_STG_API_STATUS enumeration on page 86.
Return value
S_OK
Success
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
IArchive2 arch2 = cmAPI.Archive2;
arch2.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch2.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch2.Get();
EV_STG_API_STATUS evStatus = arch2.Status;
IArchive2 :: HasFolders
This property indicates whether the archive is flat or contains a folder structure.
The property is read only.
Syntax
HRESULT HasFolders([out, retval] VARIANT_BOOL* pVal);
Parameters
[out, retval] VARIANT_BOOL* pVal
Remarks
In Enterprise Vault some types of archive, such as shared or journal archives,
cannot contain folders.
Return value
S_OK
Success
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
IArchive2 arch2 = cmAPI.Archive2;
arch2.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch2.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
bool hasFolders = arch2.HasFolders;
if (hasFolders == true)
155
156
{
//do something
IArchive2 :: Full
This property indicates whether the archive is full.
The property is read only.
Syntax
HRESULT Full([out, retval] VARIANT_BOOL* pVal);
Parameters
[out, retval] VARIANT_BOOL* pVal
Remarks
If the archive is full, no more items can be stored in it.
Return value
S_OK
Success
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
IArchive2 arch2 = cmAPI.Archive2;
arch2.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch2.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
bool full = arch2.Full;
if (!full)
{
//store some items
IArchive2 :: DirectoryDNSAlias
This property contains the DNS Alias created for the Enterprise Vault Site.
The property is read only.
Syntax
HRESULT DirectoryDNSAlias([out, retval] BSTR* pVal);
Parameters
[out, retval] BSTR* pVal
Remarks
When configuring Enterprise Vault, a DNS alias is assigned to the IP address of
the computer that hosts the primary Enterprise Vault Directory Service for the
Enterprise Vault Site.
Return value
S_OK
Success
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
IArchive2 arch2 = cmAPI.Archive2;
arch.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
string dnsAlias = arch2.DirectoryDNSAlias;
IArchive3 :: SecurityDescriptor
This property contains the self-relative security descriptor associated with an
existing archive, or to be used when creating an archive. This property represents
the manually set permissions of the archive, which are displayed on the
Permissions tab of the archive properties dialog in the Enterprise Vault
Administration Console.
157
158
Syntax
HRESULT SecurityDescriptor([out, retval] VARIANT* pVal);
HRESULT SecurityDescriptor([in] VARIANT newVal);
Parameters
[out, retval] VARIANT pVal
Remarks
If the type of the variant is VT_ARRAY, then the variant is a byte array containing
the SECURITY_DESCRIPTOR for the user account that will be given access to the
archive.
If the type of the variant is VT_EMPTY then the security descriptor is set to default
(that is, the user creating the archive has full access to the archive).
If the type of the variant is VT_NULL, then the archive is created without any
permissions.
EV_STG_API_PERMISSIONS_TYPE enumeration indicates the security descriptor
permissions for an archive. The values are logically OR'd to get the combined
permissions.
See EV_STG_API_PERMISSIONS_TYPE enumeration on page 85.
Any attempt to modify the security descriptor of an existing archive will result
in an error.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
This example illustrates how to fetch the SecurityDescriptor property value.
[C++]
CComPtr<IArchive> pArchive;
// Get an instance of an IArchive3 object to populate
pCmAPI->get_Archive(&pArchive);
CComQIPtr<IArchive3> pArchive3(pArchive);
if (pArchive3 != NULL)
{
pArchive3->put_Id(CComBSTR(L"240A579483C52B89384A9D7D9EACA0E7E
9350000evsite");
pArchive3->put_VaultStoreId(CComBSTR(L"181E669473B52E64384C9A7
D9EACA0E7E1210000evsite"));
// Retrieve Archive information
//
pArchive3->Get();
// Fetch the SecurityDescriptor property value associated
with archive
//
CComVariant varSecurityDescriptor;
pArchive3->get_SecurityDescriptor(&varSecurityDescriptor);
}
IArchive3 :: SecurityDescriptorString
This property contains the security descriptor string associated with an existing
archive, or to be used when creating an archive. This property represents the
manually set permissions of the archive, which are displayed on the Permissions
tab of the archive properties dialog in the Enterprise Vault Administration Console.
The property is read/write.
159
160
Syntax
HRESULT SecurityDescriptorString ([in] BSTR newVal);
HRESULT SecurityDescriptorString([out, retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
If specified, this property must be set before calling the Create archive method.
Any attempt to change this value on an existing archive will result in an error.
The value of the SecurityDescriptorString property must conform to the MSDN
Security Descriptor String Format. For example,
"O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)".
For information on how to create Security Descriptor strings, see the MSDN
Security Descriptor String Format article:
http://msdn.microsoft.com/en-us/library/aa379570.aspx
The following permissions will be applied to the archive being created based on
the supplied SecurityDescriptorString BSTR property values:
If the supplied BSTR value is NULL, then the archive is created without any
permissions.
If the supplied BSTR value is an empty (zero length) string, then the user
creating the archive is given full access to the archive.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
The following security descriptor string indicates a user who has been granted
full permissions access (Read+Write+Delete) to an archive:
"D:(A;;CCDCLCSW;;;S-1-5-21-2457296135-1045600968-201182662-6419)"
This example shows the value associated with the Manual security descriptor
setting for the archive to which the user has full permissions access.
The following example includes the access described in the example above, and
in addition a group has been granted full permissions access ( Read+Write+Delete)
on the archive:
"D:(A;;CCDCLCSW;;;S-1-5-21-2457296135-1045600968-2011822662-6419)
(A;;CCDCLCSW;;;S-1-5-21-2986758783-3322231649-3643854221-1255)"
The following example includes the access described in the first example above,
and in addition a group have been denied full permissions access
(Read+Write+Delete) on the archive:
"D:(D;;CCDCLCSW;;;S-1-5-21-2986758783-3322231649-3643854221-1255)
(A;;CCDCLCSW;;;S-1-5-21-2457296135-1045600968-2011822662-6419)"
161
162
IArchive3 :: Type
This property identifies the type of the archive, for example, Exchange Server
mailbox archive, FSA archive, SharePoint archive, and so on.
The property is read/write.
Syntax
HRESULT Type([in] EV_STG_API_ARCHIVE_TYPE newVal);
HRESULT Type([out, retval] EV_STG_API_ARCHIVE_TYPE* pVal);
Parameters
[in] EV_STG_API_ARCHIVE_TYPE newVal
Pointer to an EV_STG_API
_ARCHIVE_TYPE that
contains the current value.
Remarks
Currently, newVal can only be set to ARCHIVE_TYPE_SHARED; any other value
is treated as invalid.
Any attempt to change this value on an existing archive will result in an error.
EV_STG_API_ARCHIVE_TYPE enumeration indicates the type of archive.
See EV_STG_API_ARCHIVE_TYPE enumeration on page 77.
The value of the property IArchive::HasFolders will be implied from the Type
property value. Table 4-20 shows the implied values. False means that the archive
is flat. True means that the archive is structured.
Table 4-20
EV_STG_API_ARCHIVE_TYPE value
HasFolders
property
value
ARCHIVE_TYPE_SHARED
False
ARCHIVE_TYPE_EXCHANGE_MAILBOX
True
ARCHIVE_TYPE_EXCHANGE_PUBLIC_FOLDER
True
ARCHIVE_TYPE_EXCHANGE_JOURNAL
False
Table 4-20
EV_STG_API_ARCHIVE_TYPE value
HasFolders
property
value
ARCHIVE_TYPE_FILE_SYSTEM
True
ARCHIVE_TYPE_SHAREPOINT
True
ARCHIVE_TYPE_DOMINO_MAILBOX
False
ARCHIVE_TYPE_DOMINO_JOURNAL
False
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[out]
IArchive3 arch3 = cmAPI.Archive3;
arch3.VaultStoreId =
"16D002240AEDFAC45A44E7FBE88FDC7721210000EVSite";
arch3.Id = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
arch3.Get();
EV_STG_API_ARCHIVE_TYPE evType = arch3.Type;
if (evType == EV_STG_API_ARCHIVE_TYPE.
ARCHIVE_TYPE_EXCHANGE_MAILBOX)
{
// do something
[in]
IArchive3 arch3 = cmAPI.Archive3;
arch3.Name = "my new archive";
arch3.Description = "my new archive description";
163
164
Items object
This object implements the following interface:
IItems
The IItems interface inherits the properties and methods of the ICollectionBase
interface.
This interface enables external applications to enumerate the items in an archive
in order to retrieve details of each item from the Enterprise Vault Directory.
Syntax
interface IItems : ICollectionBase
Member summary
Table 4-21
IItems properties
Property
Read/Write
Description
ArchiveId
Read/Write
StartSequenceNum Read/Write
OrderBy
Read/Write
The properties and methods of the ICollectionBase interface are described in later
sections.
See Table 4-9 on page 108.
ICollectionBase properties
Property
Read/Write
Description
Count
Read only
_NewEnum
Read only
Item
Read only
Maximum
Read/Write
More
Read only
Table 4-23
ICollectionBase methods
Method
Description
Get
Clear
Reset
Remarks
Calling applications must have at least Read access to the target archive.
The following properties are populated for each Item object in the collection. If
additional properties are required for an Item, the Get method should be called
specifying the required detail level.
IItem::Id
IItem::ArchiveId
IArchiveMetaData2::SequenceNum
IArchiveMetaData2::CurrentLocation
IArchiveMetaData2::CurrentFolderId
IArchiveMetaData::RetentionCategory
IItem::CopyOptions
165
166
IItem::DeletionLevel
IArchvieMetaData::ComplianceDevice
IArchiveMetaData::OverrideOnholdRetCat
Populating these properties avoids the need to call Get to determine the source
item information before calling CopyTo or MoveTo.
Note that the items collection will not include items that have been soft deleted
from the archive, if this has been enabled. The soft delete functionality is enabled
using the Enterprise Vault Administration Console; by selecting the archive setting,
Enable recovery of user deleted items, in Site properties.
Version information
Example
This example creates an Items collection object, enumerates the required items
in the target archive and retrieves details of the items from the Enterprise Vault
Directory.
[C++]
// Get empty items collection for populating
CComPtr<IContentManagementAPI3> spCMAPI;
spCMAPI.CreateInstance(CComBSTR(L"EnterpriseVault.ContentManagement
API"));
CComPtr<IUnknown> spUnk;
VARIANT_BOOL vbMore = VARIANT_TRUE;
ULONGLONG LastSequenceNum;
// Get an Items object for enumeration
spCMapi->get_Items(&spUnk);
CComQIPtr<IItems> spItems(spUnk);
// Populate the Items collection
spItems->put_ArchiveId (CComBSTR("1C51F75FFC26EC840A012AD322C579
3AF1e10000LAGUNA4.REA.RND.SYM.COM"));
spItems->put_StartSequenceNum (1) // [Min = 1]
spItems->put_Maximum(500) // [Max = 10,000] (Comment: Ref
ICollectionBase :: Maximum)
spItems->put_OrderBy(ITEMS_ORDERBY_ASC) // Ascending
do
{
CComPtr<IItem> spItem;
// Fetch a batch of items
spItems->Get();
// Process each item in collection
long lCount = 0;
spItems->get_Count(&lCount);
// Iterative loop
for(long idx = 0; idx < lCount; ++idx)
{
CComPtr<IUnknown> spUnk;
//Fetch item
spItems->get_Item(idx, &spUnk);
CComQIPtr<IItem> spItem(spUnk);
//Do something
spItem->Get(DETAIL_LEVEL_ITEM_CONTENT |
DETAIL_LEVEL_ARCHIVE_METADATA);
...
// Remember the last item seq. no.
CComPtr<IArchiveMetaData> spAMD;
spItem->get_ArchiveMetaData(&spAMD);
CComQIPtr<IArchiveMetaData2> spAMD2(spAMD);
spAMD2->get_SequenceNum(&LastSequenceNum)
}
vbMore = spItems->More();
// Fetch next chunk of items
if (vbMore)
{
// Reset start sequence no to last item's sequence no.
(of previous collection) + 1
spItems->put_StartSequenceNum = LastSequenceNum+1;
167
168
}
} while (vbMore)
See also
IItems :: ArchiveId
This property identifies the archive in which the required items are stored.
The property is read/write.
Syntax
HRESULT ArchiveId([in] BSTR newVal);
HRESULT ArchiveId([out, retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
Note that the value used can be either the Archive ID or the ID of a folder in the
archive, as this identifies both the archive and the archive folder.
The Archive ID is displayed in the properties of the archive in the Administration
Console.
The following gives an example value of the ArchiveId property:
"181E669473B52E64384C9A7D9EACA0E7E1110000evsite"
169
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IContentManagementAPI4 cmAPI4 = new
agementAPIClass();
(IContentManagementAPI4)ContentMan
IItems :: StartSequenceNum
This property specifies the Index Sequence Number (ISN) of the first item in the
items collection.
The property is read/write.
Syntax
HRESULT StartSequenceNum([in] ULONGLONG newValue);
HRESULT StartSequenceNum([out,retval] ULONGLONG* pVal);
Parameters
[in] ULONGLONG newValue
170
Remarks
The Index Sequence Number of an archived item is specified in the
IArchiveMetaData2::SequenceNum property. This property can be used to
determine the start Index Sequence Number for the collection enumeration.
See IArchiveMetaData2 :: SequenceNum on page 253.
Enterprise Vault item sequence numbers are not always consecutive, as items
may have expired or been deleted.
The default value for this property is 1.
Requirements
Windows Server 2003 supports ULONGLONG types with OLE Automation. However
ULONGLONG types are not supported on Windows Server 2000.
.NET managed code and C++ support ULONGLONG types, but these types are not
supported by Visual Basic Script.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IContentManagementAPI3 cmAPI3 = new
(IContentManagementAPI3)ContentManagementAPIClass();
IItems :: OrderBy
This property is used to specify the index sequence number order to be used when
enumerating items in the collection.
The property is read/write.
171
Syntax
HRESULT OrderBy([in] EV_API_ITEMS_ORDERBY newVal);
HRESULT OrderBy[out,retval] EV_API_ITEMS_ORDERBY* pVal);
Parameters
[in] EV_API_ITEMS_ORDERBY newVal
Remarks
The default is to order by ascending index sequence number
(ITEMS_ORDERBY_ASC).
See EV_API_ITEMS_ORDERBY enumeration on page 76.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IContentManagementAPI4 cmAPI4 = new
(IContentManagementAPI3)ContentManagementAPIClass();
172
Item object
This object implements the following interfaces:
IItem
IID is {D96AF252-8216-4907-AF6B-7DBC93028694}
IItem2
IID is {9F6D061C-A8E9-4937-8592-762F23B037CA}
IItem3
IID is {E5C7F710-36AD-4e24-B00A-E3D709FF76CD}
This object enables the storage and management of items in Enterprise Vault
archives.
The IItem2 interface provides an additional property to help determine why an
item no longer exists in an archive.
The IItem3 interface provides an additional method to recover an item that has
been soft-deleted.
Syntax
interface IItem : IDispatch
Member summary
Table 4-24
IItem properties
Property
Read/Write
Description
ArchiveId
Read/Write
Id
Read/Write
Content
Read only
ArchiveMetaData
Read only
Pointer to an IArchiveMetaData
object that provides details of how
the item will be, or has been
archived.
BrowserViewURL
Read only
Table 4-24
Property
Description
DefaultMSGFormat Read/Write
Holds
Read only
NativeItemURL
Read only
DeletionLevel
Read/Write
CopyOptions
Read/Write
Table 4-25
IItem methods
Methods
Description
Get
Delete
CanBeDeleted
CopyTo
MoveTo
Insert
Table 4-26
IItem2 property
Property
Read/write
Description
DeletionReason
Read only
173
174
Table 4-27
IItem3 method
Property
Description
Undelete
Remarks
After the Create or Get method has been called on this interface, the current
interface pointer must be released and a new one obtained before calling either
of these methods again.
Version information
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ITEM_PROPERTIES);
IItem :: ArchiveId
This property identifies the archive in which the item is stored, or to be stored.
The property is read/write.
Syntax
HRESULT ArchiveId([out, retval] BSTR* pVal);
HRESULT ArchiveId([in] BSTR newVal);
Parameters
[in] BSTR newVal
Remarks
Note that the value used can be either the Archive ID or the ID of a folder in the
archive, as this identifies both the archive and the archive folder.
This property must be set before calling Get.
An error will result if an attempt is made to change the value of an existing item.
This value is displayed in the properties of the archive in the Administration
Console.
The following gives an example value of the ArchiveId property:
"181E669473B52E64384C9A7D9EACA0E7E1110000evsite"
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C#]
IItem itm = cmAPI.Item;
itm.ArchiveId = ""181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
itm.Id = "161000000000000~200501051649270000~0~9039eb282e3d4083b7
9f3298dc8a1e60";
itm.Get((int)EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ITEM_PROPERTIES);
IItem :: Id
This property identifies the item in the archive.
This property is read/write.
Syntax
HRESULT Id([out, retval] BSTR* pVal);
HRESULT Id([in] BSTR newVal);
175
176
Parameters
[in] BSTR newVal
Id of stored item.
Remarks
This property sets or retrieves the identifier of the item in the archive. It is only
populated once an item has been stored in an archive, and must be set before
calling the Get method.
It should not be set before calling an Insert method, as this will result in an error.
Any attempt to change the value of an existing item will result in an error.
This property can hold the item's Transaction ID or Saveset ID.
See Saveset IDs and Transaction IDs on page 71.
Version information
Enterprise Vault 7.0 or later is required to support a Transaction ID value for this
property.
Return value
S_OK
Success.
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
CComBSTR bstr(L"161000000000000~200501051649270000~0~9039eb282e3d4
083b79f3298dc8a1e60")
item->put_Id(bstr);
//DO Get and check the id
bstr.Clear();
item->get_Id(&bstr);
[C#]
IItem item = cmAPI.Item;
item.Id = "161000000000000~200501051649270000~0~9039eb282e3d4083b7
9f3298dc8a1e60";
itm.Archive.Id = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
itm.Get((int)EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ITEM_PROPERTIES);
IItem :: Content
This property returns an instance of a Content object that gives access to the data
that is to be archived, or has been archived (depending on when it is used).
The property is read only.
The interface pointer to IContent is read only, however, the methods and properties
exposed by IContent allow the content, including the item data, to be modified.
Syntax
HRESULT Content([out, retval] IContent** pVal);
Parameters
[out,retval] IContent** pVal
Remarks
The IContent interface makes the following properties available. Each of these is
described in more detail in the relevant section.
Title
OriginalLocation
FileExtension
177
178
MimeFormat
CreatedDate
ModifiedDate
Data
OriginalSize
Author
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Examples
[C++]
IContent* pContent = NULL;
item->get_Content(&pContent);
[C#]
item.Get((int)EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ITEM_PROPERTIES);
IContent content= item.Content;
LogContentProperties(content, item.Id);
IItem :: ArchiveMetaData
This property returns a pointer to an IArchiveMetaData interface that provides
details of how the item will be or has been archived.
The property is read only.
The interface pointer to IArchiveMetaData is read only. However, the methods
and properties exposed by IArchiveMetaData allow the metadata to be modified.
Syntax
HRESULT ArchiveMetaData([out, retval] IArchiveMetaData**
pVal);
Parameters
[out,retval] IArchiveMetaData** pVal
Pointer to an
IArchiveMetaData pointer.
Remarks
The IArchiveMetaData interface makes available properties that hold information
about the item, such as the assigned Retention Category and the date and time
when the item was archived. Each of these is described in more detail in the
relevant section.
See ArchiveMetaData object on page 225.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pVal is NULL.
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
See also
IItem :: BrowserViewURL
This property returns a string containing the URL that should be entered into a
web browser (for example) to view the item.
The property is read only.
Syntax
HRESULT BrowserViewURL([out,retval] BSTR* pVal)
179
180
Parameters
[out,retval] BSTR* pVal
Remarks
This property will return an error if the archive Id and item Id have not been set
previously.
The URL returned includes the IIS virtual directory for the Enterprise Vault Web
access application, but not a specific Web server name. Enterprise Vault
dynamically generates the full URL as needed, with the appropriate server name
for each caller.
This form of URL is compatible with Enterprise Vault Building Blocks architecture.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Examples
[C++]
CComBSTR bstr;
item->put_Id(L"161000000000000~200501051649270000~0~9039eb282e3d408
3b79f3298dc8a1e60");
item->put_ArchiveId("181E669473B52E64384C9A7D9EACA0E7E1110000evsi
te");
item->get_BrowserViewURL(&bstr);
[C#]
item.Id = "161000000000000~200501051649270000~0~9039eb282e3d4
083b79f3298dc8a1e60";
Item.arhiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
String url = Item.BrowserViewURL;
IItem :: DefaultMSGFormat
This property allows the caller to set the format as ANSI or Unicode for the item
being retrieved, where the original format has not been stored with the saveset.
The property is optional.
Syntax
HRESULT DefaultMSGFormat([in] BSTR newVal);
HRESULT DefaultMSGFormat([out,retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
The following values can be assigned to newVal:
"N"
Perform no conversion.
"U"
Return as Unicode.
"A:"
181
182
DefaultMSGFormat allows the caller to set the default format as ANSI or Unicode
for the item being retrieved, where the original format has not been stored with
the saveset.
From Enterprise Vault 6.0 SP1, items are stored in Enterprise Vault as Unicode.
In addition, items archived using File System Archiving, SharePoint archiving,
or API methods, store details of the original format with the saveset. If details of
the original format were stored, then the item will always be returned in its original
format, irrespective of the value of DefaultMSGFormat.
However, items stored using Exchange Server archiving tasks (or PST migration)
do not record details of the original format. The value set for DefaultMSGFormat,
will be applied to any such items that do not have the original format recorded.
If no value is specified for DefaultMSGFormat, then no conversion is performed
and the archive format is used. On a system with messages archived using an
earlier release than Enterprise Vault 6.0 SP1, this means that items archived prior
to Enterprise Vault 6.0 SP1 are returned in ANSI format, and items archived since
the upgrade to Enterprise Vault 6.0 SP1 are returned in Unicode format.
If a value has not been explicitly set, then this property will return null.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
item->put_DefaultMSGFormat(L"U");
//do something, put ids etc
Item->Get(DETAIL_LEVEL_ALL);
Itm->put_DefaultMSGFormat(L"N");
[C#]
itm.DefaultMSGFomart = "U";
//do something - set ids etc
//
ERROR
Itm.Get((int)(EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ALL));
Itm.=defaultMSGFormat = "N";
//ERROR
IItem :: Holds
This property gives access to the set of holds currently placed on the item. The
property is read only.
See Holds object on page 285.
Syntax
HRESULT Holds([out,retval] IHolds** pVal);
Parameters
[out,retval] IHolds** pVal
Remarks
This property is a collection of IHold pointers, each of which defines a hold placed
on the particular item.
The caller must have called the IItem.Get method with the
DETAIL_LEVEL_HOLD_DATA flag set prior to calling this property.
See IItem :: Get on page 194.
This property is a collection of IHold pointers, each of which defines a hold placed
on the particular item.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
183
184
item.Get((int)EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_HOLD_DATA);
IHolds holds = Item.Holds;
IItem :: NativeItemURL
The URL downloads the item that was archived and attempts to open the item
using the default application for the type of the item.
Syntax
HRESULT NativeItemURL([out, retval] BSTR* pVal);
Parameters
[out, retval] BSTR* pVal A pointer to a BSTR that will contain the current value.
Remarks
There will be an error if either the item Id or the archive Id have not been set
before using this property.
The URL returned includes the IIS virtual directory for the Enterprise Vault Web
access application, but not a specific Web server name. Enterprise Vault
dynamically generates the full URL as needed, with the appropriate server name
for each caller.
This form of URL is compatible with Enterprise Vault Building Blocks architecture.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Examples
[C++]
185
CComBSTR bstr;
item->put_Id(L"200501051649270000~0~9039eb282e3d4083b79f3298
dc8a1e60")
item->put_ArchiveId(L"181E669473B52E64384C9A7D9EACA0E7E11100
00evsite");
item->get_NativeItemURL(&bstr);
[C#]
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
string url = item.NativeItemURL;
IItem :: DeletionLevel
This property indicates the type of delete to be used for the archived item. Items
can be deleted completely (hard delete), or moved to the Enterprise Vault
"dumpster" area (soft delete).
The property is read/write.
Syntax
HRESULT DeletionLevel([in] EV_API_DELETION_LEVEL newVal);
HRESULT DeletionLevel([out,retval] EV_API_DELETION_LEVEL* pVal);
Parameters
[in] EV_API_DELETION_LEVEL newVal
New
EV_API_DELETION_LEVEL
value.
Current
EV_API_DELETION_LEVEL
value.
Remarks
EV_API_DELETION_LEVEL is an enumerated value.
See EV_API_DELETION_LEVEL enumeration on page 75.
The default value for this property is DELETION_LEVEL_SOFT_DELETE. For a
period of time after deletion (configured by the administrator), users can recover
a soft-deleted item.
186
In the Enterprise Vault Administration Console, in the Site Properties pages, the
administrator can enable the recovery of deleted items and specify how long
soft-deleted items are to be kept.
The Item Undelete method can be used to recover a soft-deleted item.
See IItem3 :: Undelete on page 210.
Version information
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[in]
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
item.DeletionLevel = EV_API_DELETION_LEVEL.
DELETION_LEVEL_SOFT_DELETE;
IContent content = item.Content;
content.Title = "New title";
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
item.Insert();
[out]
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_ITEM_PROPERTIES);
EV_API_DELETION_LEVEL evDL = item.DeletionLevel;
IItem :: CopyOptions
This property identifies the source item property values to be copied to the
destination item.
The property is read/write.
Syntax
HRESULT CopyOptions([in] EV_STG_API_ITEM_COPYOPTIONS newVal);
HRESULT CopyOptions([out,retval] EV_STG_API_ITEM_COPYOPTIONS*
pVal);
Parameters
[in] EV_STG_API_ITEM_COPYOPTIONS newVal
Remarks
The calling application sets the CopyOptions property on the destination item
object that is supplied in calls to the CopyTo or MoveTo methods.
The value of CopyOptions can be one or more of the
EV_STG_API_ITEM_COPYOPTIONS enumeration values. The default value is
ITEM_COPYOPTIONS_ARCHIVEMETADATA. If this is set, then the values of the
following ArchiveMetaData properties on the source item will be copied to the
equivalent properties on the destination item, unless explicitly provided as part
of the CopyTo or MoveTo method call:
SimpleIndexMetadata
ArchivedDate
187
188
RetentionCategory
CurrentLocation
CurrentFolder
CustomIdentifier
CustomQualifier
CustomProperties
Item property
Option selected
ArchivedDate
Yes (Default)
Yes
No
Yes
As above.
Yes (Default)
No
Table 4-28
Item property
No
No
Set to current
date/time.
Yes
Yes
As above.
Yes (Default)
No
No
No
Yes
CurrentLocation
CurrentFolderId
No
Yes
As above.
Yes (Default)
No
No
No
Yes (Default)
Yes
No
Yes
See
IArchiveMetaData2
:: CurrentLocation
on page 245.
Yes (Default)
No
189
190
Table 4-28
Item property
No
No
See
IArchiveMetaData2
:: CurrentLocation
on page 245.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
In the following VBScript example, the source item's ArchiveMetaData values are
preserved on the destination item.
Dim ecmAPI
Set ecmAPI = CreateObject("EnterpriseVault.ContentManagementAPI")
Dim oItem, oDestItem
IItem :: Insert
This method is used to store an item in an archive.
Syntax
HRESULT Insert(void);
Remarks
It is important to make sure that this interface pointer has not been used before
to perform an Insert or Get action.
The caller must have WRITE access permissions on the destination archive.
Otherwise, an error will occur. For structured archives, the caller must have write
access to the destination archive folder.
If an override value is specified for the ArchivedDate property, the calling
application must be in an Enterprise Vault role that includes the operation, "{API}
Can Use Extended API Features". This operation is included in the default
Enterprise Vault Power Administrator and Storage Administrator roles.
The Insert method stores an item in the specified archive. Before calling Insert,
the following properties must be populated:
IItem :: ArchiveId
191
192
IContent :: Data
Outlook messages, which have a file extension of .msg and a MIME format
of application/vnd.ms-outlook.
SMTP messages, which have a file extension of .eml and a MIME format
of message/rfc822.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_ARCHIVE_FULL
CONTENTMANAGEMENTAPI_E_NO_ACCESS
193
CONTENTMANAGEMENTAPI_E_DUPLICATE_ITEMID
Examples
[C++]
spItem.put->ArchiveId(L"181E669473B52E64384C9A7D9EACA0E7E1110000evs
ite");
IContent* pContent = null;
spItem->get_Content(&pContent);
pContent->put_Title(L"new title");
pContent->put_FileExtension(L"msg");
pContent->put_Data(L"C:\\temp\\test.msg");
spItem->Insert();
[C#]
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = item.Content;
194
See also
See Content object on page 212.
IItem :: Get
This method is used to retrieve an archived item or information about an item.
Syntax
HRESULT Get([in] LONG DetailLevel);
Parameters
[in] LONG DetailLevel
Remarks
The item's ArchiveId and either its Id property or
IArchiveMetaData::CustomIdentifier and IArchiveMetaData::CustomQualifier
properties must be set prior to calling this method.
When retrieving hold data only, the item's Id property must be used (DetailLevel
= DETAIL_LEVEL_HOLD_DATA).
The item's CustomIdentifier and CustomQualifier properties can only be used
when together they uniquely identify an item.
See IIArchiveMetaData :: CustomIdentifier on page 239.
EV_STG_API_ITEM_DETAIL indicates the data to retrieve for an item.
See EV_STG_API_ITEM_DETAIL enumeration on page 83.
The caller can "bitwise OR" the bit masks together. For example, IItem.Get(255)
returns the item properties and the metadata.
If the soft delete feature has been enabled, items that have been soft deleted from
the archive are retrieved. The soft delete functionality is enabled using the
Enterprise Vault Administration Console; by selecting the archive setting, Enable
recovery of user deleted items, in Site properties.
To retrieve the item content, the caller must populate the IContent::Data property
with a file location on disk, or to an IStream or ILockbytes object that has been
created ready to receive the item content.
Note: If you specify a file, any existing content will be overwritten.
The Content Management API supports IStream and ILockBytes implementations
where the input data length provided by the Stat method is not known.
See IContent :: Data on page 220.
When DETAIL_LEVEL__SYSTEM_INDEXDATA is requested, the "cont" property
is included in the properties returned. This is the HTML representation (converted
content) of the item or attachment. If the size of the item's converted content is
larger than 5MB, then the converted content is not returned. Instead, a content
missing reason ("comr") property is returned with the reason,
vmrVALUENOTOBTAINED (2).
This limit can be changed using the registry setting:
HKEY_LOCAL_MACHINE
\Software
\Wow6432Node
\KVS
\Enterprise Vault
\MaxIndexDataHTMLContentKB
Return values
S_OK
Success.
195
196
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
The Enterprise
Vault Directory or
Storage services
are not running.
CONTENTMANAGEMENTAPI_E_BUSY
Enterprise Vault is
currently busy or
has insufficient
resource to
complete the
request. This error
indicates that the
caller should retry
later.
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_NO_ACCESS
CONTENTMANAGEMENTAPI_E_AMBIGUOUS_PARAMETER
Version information
Examples
Refer to Microsoft documentation for details and usage of IStorage and IStream.
[C++]
item->put_Id(
L" 200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60");
item->put_ArchiveId(L"181E669473B52E64384C9A7D9EACA0E7E1110000site"
);
IStorage* pStorage = NULL;
StgCreateStorageEx(NULL, STGM_READWRITE | STGM_CREATE, STGFMT_FILE,
0, NULL, 0, NULL, IID_IStorage,
reinterpret_cast<void**>(&pStorage));
IStream* pStream = NULL;
pStorage->CreateStream(\xe3 Test Stream", STGM_READSWRITE |
STGM_CREATE, 0, 0, &pStream);
IContent* pContent = NULL;
item->get_Content(&pContent);
pContent->put_Data(pStream);
item->Get(DETAIL_LEVEL_ITEM_CONTENT);
197
198
//do something
pStream->Release();
pStream = NULL;
pStorage->Release();
pStorage = NULL;
pContent->Release();
pContent = NULL;
item->Release();
item = NULL;
[C#]
item.Id = " 200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
Item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = null;
content = item.Content;
content.Data = "C:\\temp\\temp.msg";
item.Get((int)(EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ITEM_CONTENT));
//do something
IItem :: Delete
This method is used to delete an item from an archive.
Syntax
HRESULT Delete(void);
Remarks
Calling the Delete method will remove the item from its archive. The value of the
DeletionLevel property will determine whether a hard or soft delete is performed.
Prior to calling this method, the application programmer must have set the
ArchiveId (to identify the archive containing the item), and the Id property to
identify the item within its container.
It cannot be called on an item whose ArchiveId and Id properties have not been
set, as this will cause an error.
The calling user must have the appropriate permissions to delete the item. It is
also possible that the server will reject the request because an item is "On Hold"
or cannot be removed for compliance reasons.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
CONTENTMANAGEMENTAPI_E_NO_ACCESS
CONTENTMANAGEMENTAPI_E_DELETION_BARRED
Examples
[C++]
item->put_Archive_Id(L"181E669473B52E64384C9A7D9EACA0E7E1110000evsi
te");
item->putId(L"181E669473B52E64384C9A7D9EACA0E7E1110000evsite");
199
200
item->Delete();
[C#]
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ITEM_PROPERTIES);
object obj = item.CanBeDeleted;
int canBeDeleted = (int)obj;
if (obj == 0)
{
item.Delete();
}
IItem :: CanBeDeleted
This method determines if an item can be deleted from an archive.
Syntax
HRESULT CanBeDeleted([out,retval] VARIANT* CanDelete);
Parameters
[out,retval] VARIANT* CanDelete
Remarks
CanBeDeleted returns a value to indicate whether or not the item can be deleted.
See EV_STG_API_CAN_DELETE enumeration on page 78.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_NO_ACCESS
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ITEM_PROPERTIES);
object obj = item.CanBeDeleted;
int canBeDeleted = (int)obj;
if (obj == 0)
{
item.Delete();
}
IItem :: CopyTo
This method is used to copy an item from one archive to another.
201
202
Syntax
HRESULT CopyTo([in] IItem* DestinationItem);
Parameters
[in] IItem* DestinationItem
Remarks
The source and destination archive and vault store may be different, but the source
and destination site must be the same.
The caller must have READ access to the source archive, and WRITE access
permissions on the destination archive, otherwise an error will occur. For
structured archives, the caller must have READ access to the source archive folder
and WRITE access to the destination archive folder.
If an override value is specified for the ArchivedDate property, the calling
application must be in an Enterprise Vault role that includes the operation, "{API}
Can Use Extended API Features". This operation is included in the default
Enterprise Vault Power Administrator and Storage Administrator roles.
When copying an item:
Optionally set any ArchiveMetadata override property values if the copy option,
ITEM_COPYOPTIONS_ARCHIVEMETADATA, is selected.
The CopyOptions property on the destination item object specifies the item
elements to be copied across to the destination item.
See IItem :: CopyOptions on page 187.
From Enterprise Vault 8.0, the default action has changed; the item content and
its associated ArchiveMetaData and IndexData elements are copied from the
source item. This means that the default behaviour preserves the original
ArchivedDate and OriginalLocation on the destination item, if override values are
not specified.
For backwards compatibility, the calling application can set suitable override
values on the destination item object.
Important considerations apply when specifying the destination archive folder.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_ARCHIVE_FULL
203
204
CONTENTMANAGEMENTAPI_E_NO_ACCESS
CONTENTMANAGEMENTAPI_E_AMBIGUOUS_PARAMETER
Examples
[C++]
IItem* pItemSrc = NULL;
pCmAPI->get_Item(&pItemSrc);
pItemSrc->put_ArchiveId(CComBSTR(L"181E669473B52E64384C9A7D9EACA0E7
E1110000evsite"));
pItmDest->put_ArchiveId(CComBSTR(L"1E1FA1405F674644286ADBD247BA780C
B1110000evsite"));
pItemSrc->put_Id(CComBSTR(L"334880000000000~200707251102240000~0~D3
962A35951E4B03AE9CFB68AFE1218"));
IItem* pItemDst = NULL;
pCmAPI->get_Item(&pItemDst);
IArchiveMetaData* pDstAMD = NULL;
pItemDst->get_ArchiveMetaData(&pDstAMD);
pDstAMD->put_RetentionCategory(CComBSTR(L"Business"));
IComplianceData* pDstComp = NULL;
pDstAMD->get_ComplianceData(&pDstComp);
pDstComp->SetBy(SETBY_RETCAT);
pItemSrc->CopyTo(pItemDst);
[C#]
IItem itemSrc = cmAPI.Item;
IItem itemDst = cmAPI.Item;
itemSrc.ArchiveId ="181E669473B52E64384C9A7D9EACA0E7E1110000ev
site";
itemDst.ArchiveId = "1E1FA1405F674644286ADBD247BA780CB1110000ev
site";
itemSrc.Id ="334880000000000~200707251102240000~0~D3962A35951E4B03
AE9CFB68AFE1218";
itemDst.ArchiveMetaData.RetentionCategory = "Business";
itemDst.ArchiveMetaData.ComplianceData.SetBy =
EV_STG_API_CP_SETBY.SETBY_RETCAT;
itemSrc.CopyTo(itemDst);
IItem :: MoveTo
This method is used to move an item from one archive to another.
Syntax
HRESULT MoveTo([in] IItem* DestinationItem);
Parameters
[in] IItem* DestinationItem
Remarks
The source and destination archive and vault store may be different, but the source
and destination site must be the same.
The caller must have DELETE access to the source archive and archive folder, and
WRITE access permissions on the destination archive and archive folder, otherwise
an error will occur.
If an override value is specified for the ArchivedDate property, the calling
application must be in an Enterprise Vault role that includes the operation, "Can
Use Extended API Features". This operation is included in the default Enterprise
Vault Power Administrator and Storage Administrator roles.
205
206
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_ARCHIVE_FULL
CONTENTMANAGEMENTAPI_E_DELETION_BARRED
CONTENTMANAGEMENTAPI_E_NO_ACCESS
CONTENTMANAGEMENTAPI_E_AMBIGUOUS_PARAMETER
Example
IItem itemSrc = cmAPI.Item;
IItem itemDst = cmAPI.Item;
itemSrc.ArchiveId ="181E669473B52E64384C9A7D9EACA0E7E1110000ev
site";
itemDst.ArchiveId = "1E1FA1405F674644286ADBD247BA780CB1110000ev
site";
itemSrc.Id ="334880000000000~200707251102240000~0~D3962A35951E4B03
AE9CFB68AFE1218";
207
208
itemDst.ArchiveMetaData.RetentionCategory = "Business";
itemDst.ArchiveMetaData.ComplianceData.SetBy =
EV_STG_API_CP_SETBY.SETBY_RETCAT;
itemSrc.MoveTo(itemDst);
IItem2 :: DeletionReason
If an item no longer exists in the archive, this property can be used to find out
why the item was deleted.
This property is read only.
Syntax
HRESULT DeletionReason([out,retval]
EV_STG_API_DELETION_REASON* pVal)
Parameters
[out,retval] EV_STG_API_DELETION_3REASON* pVal
Current EV_STG_API
_DELETION_REASON
value.
Remarks
If an attempt to retrieve an item fails because the item cannot be found, then the
DeletionReason property can be used to determine if the item has been deleted.
The property is populated only when it is accessed.
To retrieve the DeletionReason property, Item::Id and Item::ArchiveId properties
must be specified on the Item object.
EV_STG_API_DELETION_REASON is an enumeration value that identifies why
the item was deleted.
See EV_STG_API_DELETION_REASON enumeration on page 80.
Return value
S_OK
Success.
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_NO_ACCESS
CONTENTMANAGEMENTAPI_E_ITEM_NOT_FOUND
Example
[C#]
Item2 destItem = (IItem2)cmAPI.Item;
destItem.ArchiveId = ="1BFE65542AFD18F418824B15EF3288CD51110000
EVServer.corp.com";
destItem.Id = "200908040000000~200908041247260000~Z~80BD742AD7B88D0
850524974B9F44901";
try
{
// Try to get the item
destItem.Get((int)(
EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ITEM_PROPERTIES
|EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ARCHIVE_METADATA
|EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_SYSTEM_INDEXDATA));
}
catch (COMException e)
{
// If ITEM NOT FOUND error is thrown,
// check the deletion reason of the item.
if (e.ErrorCode == (int)EV_STG_API_ErrorCodes.
CONTENTMANAGEMENTAPI_E_ITEM_NOT_FOUND)
{
EV_STG_API_DELETION_REASON delReason =
EV_STG_API_DELETION_REASON.DELETION_REASON_UNKNOWN;
try
209
210
{
delReason = destItem.DeletionReason;
}
finally
{
// Log that the item was not found together with the
// deletion reason
LogItemNotFound(destItem, delReason);
}
}
}
IItem3 :: Undelete
If an item has been moved to the Enterprise Vault "dumpster" area (soft deleted),
this method can be used to recover the item. The item is restored from the
dumpster area to the archive.
Syntax
HRESULT Undelete([out, retval] VARIANT_BOOL* pVal)
Parameters
[out,retval] VARIANT_BOOL* pVal
Remarks
The caller must be in an Enterprise Vault role that allows the operation "Can
undelete items in any archive". (The task definition, "EVT Execute undelete from
archives", is included in the role, "Placeholder Application".)
Before calling Undelete, both the Archive ID and the Item ID must be set on the
Item object.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_NOT_FOUND
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_NO_ACCESS
CONTENTMANAGEMENTAPI_E_ITEM_NOT_FOUND
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Enterprise Vault is
currently busy or has
insufficient resources to
complete the request.
This error indicates that
the caller should retry
later.
Version information
See also
Examples
[C#]
IItem3 item = (IItem3)cmAPI.Item;
item.ArchiveId =
211
212
"118F819534E391C43B6854E2DD3A708C61110000EV.example.com";
item.Id =
"201004211843143~201004210854360000~Z~60B6FB033CED482A90683BFE5EA51
651";
bool UnDeleted = item.Undelete();
[VBScript]
Dim ecmAPI, oItem, oItem3
Set ecmAPI = CreateObject("EnterpriseVault.ContentManagementAPI")
set oItem = ecmAPI.Item
set oItem3 =
ecmAPI.IDispatchQueryInterface(oItem,"{E5C7F710-36AD-4e24-B00A-E3D7
09FF76CD}")
oItem3.ArchiveId =
"118F819534E391C43B6854E2DD3A708C61110000EV.example.com"
oItem3.ID =
"201004211843143~201004210854360000~Z~60B6FB033CED482A90683BFE5EA51651"
dim results
result = oItem3.Undelete
if (Err.number <> 0) then
WScript.Echo "Error: " & Err.Description
end if
if result then
WScript.Echo "Item Undeleted"
else
WScript.Echo "Item has not been Undeleted"
end if
Content object
This object implements the following interface:
IContent
The IContent interface is obtained from an instance of IItem using the Content
property and provides calling applications with a set of properties that describe
the data being archived.
Syntax
interface IContent : IDispatch
Member summary
Table 4-29
IContent Properties
Property
Description
Title
OriginalLocation
FileExtension
MIMEFormat
CreatedDate
Optional property that contains the UTC date and time that the item
was created.
ModifiedDate
Optional property that contains the UTC date and time that the item
was last modified.
Data
The Data property is used to pass the raw content of the item to or
from the archive. The parameter can be the path to a file that contains
the content to be archived, or an IStream or ILockBytes object
containing the content to be archived.
OriginalSize
This property contains the size in bytes of the original item that was
archived.
Author
Example
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = item.Content;
content.Title = "New title";
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
item.Insert();
213
214
IContent :: Title
This property holds the name, title or subject of the item.
The property is read/write.
Syntax
HRESULT Title([out, retval] BSTR* pVal);
HRESULT Title([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Remarks
If an attempt is made to change the title after a call to Insert or Get, an error will
occur.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C#]
IContent content = itm.Content;
string title = content.Title;
IContent :: OriginalLocation
This property holds the original location of the item.
Syntax
HRESULT OriginalLocation([out, retval] BSTR* pVal);
HRESULT OriginalLocation([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Return value
S_OK
Success.
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = item.Content;
content.Title = "New title";
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
item.Insert();
IContent :: FileExtension
This property holds the file extension describing the format of the item.
The property is read/write.
215
216
Syntax
HRESULT FileExtension([out, retval] BSTR* pVal);
HRESULT FileExtension([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Remarks
This property describes the format of the item.
For example, use .txt where the content is simple text, or .msg where the content
is in Outlook message file format.
It is required so that the item can be indexed when it is archived, and opened
correctly by a web browser using IItem :: BrowserViewURL. The default value is
".bin".
The preceding period in a file extension can be included or omitted when setting
a value. It will be added by the API when the item is archived.
Once this value has been set it cannot be changed.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = item.Content;
content.Title = "New title";
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
item.Insert();
IContent :: MIMEFormat
This property is optional and describes the MIME file format of the item.
This property is useful for HTTP Web-based client applications that process byte
streams with the MIME type parameter (content-type), rather than files.
The property is read/write.
Syntax
HRESULT MIMEFormat([out, retval] BSTR* pVal);
HRESULT MIMEFormat([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Remarks
For example, use text/plain where the content is simple text, or
application/vnd.ms-outlook where the content is in Outlook message file format.
If the property is set, it cannot be changed after the item has been archived.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
217
218
Example
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = item.Content;
content.Title = "New title";
content.MIMEFormat = "text/plain";
content.OriginalLocation = "C:\\temp";
content.Data = "C:\\temp\\test.txt";
item.Insert();
IContent :: CreatedDate
This property contains the UTC date and time that the item was created.
The property is read/write.
Syntax
HRESULT CreatedDate([out, retval] VARIANT* pVal);
HRESULT CreatedDate([in] VARIANT newVal);
Parameters
[out, retval] VARIANT* pVal
Remarks
Once this item has been archived it is not possible to change the value of this
property.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ITEM_PROPERTIES);
IContent cont = item.Content;
object obj = content.CreatedTime;
DateTime dt = (DateTime)obj;
IContent :: ModifiedDate
This property contains the UTC date and time that the item was last modified.
The property is read/write.
Syntax
HRESULT ModifiedDate([out, retval] VARIANT* pVal);
HRESULT ModifiedDate([in] VARIANT newVal);
Parameters
[out, retval] VARIANT* pVal
The UTC date and time that the item was last
modified.
219
220
Remarks
Once this item has been archived it is not possible to change the value of this
property.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ITEM_PROPERTIES);
IContent cont = item.Content;
object obj = content.ModifiedTime;
DateTime dt = (DateTime)obj;
IContent :: Data
This property is used to pass the raw content of the item to or from the archive.
The property is read/write.
Syntax
HRESULT Data([out, retval] VARIANT* pVal);
HRESULT Data([in] VARIANT newVal);
221
Parameters
[out, retval] VARIANT* pVal
Remarks
One important point to remember is that the item data, properties and archive
metadata is not archived until the Insert method has been called.
This property must be set to the path of a file on disk, or an IStream or ILockBytes
object.
Note: If you specify a file, any existing content will be overwritten when retrieving
an item.
If the calling application is a .NET application, and the overhead of saving the
item content to a file is not acceptable, you will need to create a managed
implementation of the System.Runtime.InteropServices.ComTypes.IStream
interface. For example, you can create a .NET class that inherits from
System.Runtime.InteropServices.ComTypes.IStream and implements its
methods using an instance of a managed stream, System.IO.Stream.
The Content Management API supports IStream and ILockBytes implementations
where the input data length provided by the Stat method is not known.
When using a version of the Enterprise Vault API runtime prior to Enterprise
Vault 8.0, .NET applications should ensure the following recommendations are
implemented in order to support the insertion or retrieval of items larger than
4MB:
The application's entry point, the Main method, is not set to use the COM
single-threaded apartment (STA) model.
All use of the Content Management API is from threads set to use the COM
single-threaded apartment; the Content Management API is not invoked from
the application's entry point method.
222
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C#]
IContent content = itm.Content;
content.Data = "C:\\temp\\temp.msg";
IContent :: OriginalSize
This property returns the size of the original item, in bytes, before it was archived.
The property is read only.
Syntax
HRESULT OriginalSize([out, retval] VARIANT*
pVal);
Parameters
[out, retval] VARIANT* pVal
Remarks
This property is only available after an item has been archived.
No error will be returned if this property is called before archiving and the returned
value will be 0.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ITEM_PROPERTIES);
IContent cont = item.Content;
object obj = content.OriginalSize;
double size = (double)obj;
IContent :: Author
This property contains the author of the item.
The property is read/write and optional.
Syntax
HRESULT Author([out, retval] BSTR* pVal);
HRESULT Author([in] BSTR newVal);
223
224
Parameters
[out, retval] BSTR* pVal
Remarks
This is an optional property and does not need to be populated before archiving
an item. However, once set and the item archived, an error will occur if an attempt
is made to change the value.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C#]
[in]
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000EVSite";
IContent content = item.Content;
content.Title = "New title";
content.Author = "Charles Dickens"
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
item.Insert();
[out]
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ITEM_PROPERTIES);
IContent cont = item.Content;
string author = content.Author;
ArchiveMetaData object
This object implements the following interfaces:
IArchiveMetaData
IID is {4A0AAD67-882B-4fd6-A76C-4F7B0864F5D6}
IArchiveMetaData2
IID is {5C6882BD-24BE-4C32-87EF-C3701D949BAA}
Syntax
interface IArchiveMetaData : IDispatch
interface IArchiveMetaData2 : IArchiveMetaData
Member summary
Table 4-30
IArchiveMetaData properties
Property
Read/Write
Description
RetentionCategory
Read/Write
ComplianceDevice
Read only
225
226
Table 4-30
Property
Read/Write
Description
OverrideOnHoldRetCat
Read/Write
ArchivedDate
Read only
ComplianceData
Read only
SavesetSize
Read only
RetentionExpires
Read only
IndexData
Read only
IsItemSecured
Read only
CustomIdentifier
Read/write
Table 4-30
Property
Read/Write
Description
CustomQualifier
Read/write
CustomProperties
Read/write
Table 4-31
IArchiveMetaData method
Method
Description
Update
Table 4-32
IArchiveMetaData2 properties
Property
Read/Write
Description
CurrentLocation
Read/write
CurrentFolderId
Read/write
SequenceNum
Read only
ArchivedDate
Read/write
Remarks
Version information
IArchiveMetaData2 interface requires Enterprise Vault 8.0.
227
228
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
IArchiveMetaData :: RetentionCategory
This property contains the name or Id of the retention category assigned to the
item.
The property is read/write.
Syntax
HRESULT RetentionCategory([out, retval] BSTR* pVal);
HRESULT RetentionCategory([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Remarks
An example of this would be "Business" or any other retention category created
using the Enterprise Vault Administrator Console.
The retention category Id may be specified as an alternative.
The Retention API can be used to discover or create retention categories.
See About Retention API on page 562.
Currently it is not possible to modify this property using the Content Management
API after the item has been archived.
Return value
S_OK
Success.
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
string retCat = amd.RetentionCategory;
IArchiveMetaData :: ComplianceDevice
This property indicates whether the item is stored on a compliance device on
which retention periods can be set.
The property is read only.
Syntax
HRESULT ComplianceDevice([out, retval] VARIANT_BOOL* pVal);
229
230
Parameters
[out, retval] VARIANT_BOOL* pVal
Remarks
A value of true is returned if this item is on a compliance device.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
bool compDevice = amd.ComplianceDevice;
if (conpDevice == true)
{
//do something
IArchiveMetaData :: OverrideOnHoldRetCat
This property enables deletion of an item even if the retention category on-hold
flag is enabled.
The property is read/write.
Syntax
HRESULT OverrideOnHoldRetCat([out, retval] VARIANT_BOOL* pVal);
HRESULT OverrideOnHoldRetCat([in] VARIANT_BOOL newVal);
Parameters
[out, retval] VARIANT_BOOL* pVal
Pointer to an VARIANT_BOOL
which will contain the current
value of this property
Remarks
This property is set to true if the item can be deleted even if the retention category
on-hold flag is set.
Once an item has been archived this property cannot be changed.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[in]
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000EVSite";
IContent content = item.Content;
content.Title = "New title";
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
IArchiveMetaData amd = item.ArchiveMetaData;
amd.OverrideOnHoldRetCat = true;
item.Insert();
[out]
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
231
232
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
bool override = amd. OverrideOnHoldRetCat;
if (override == true)
{
//do something
IArchiveMetaData :: ArchivedDate
This property contains the UTC date and time that the item was originally stored
in the archive.
The property is read only.
Syntax
HRESULT ArchivedDate([out, retval] VARIANT* pVal);
Parameters
[out, retval] VARIANT* pVal
Remarks
This property is optional.
Version information
At Enterprise Vault 8.0, this property becomes a read/write property.
See IArchiveMetaData2 :: ArchivedDate on page 255.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
object obj = amd.ArchivedDate;
DateTime dt = (DateTime) obj;
IArchiveMetaData :: ComplianceData
This property returns a valid pointer to an instance of the
IComplianceDataInterface that allows the caller to set and view compliance values
for the archived item.
The property is read only.
Syntax
HRESULT ComplianceData([out, retval] IComplianceData** pVal);
Parameters
[out, retval] IComplianceData** pVal
Pointer to a valid
IComplianceData pointer.
Remarks
Although this property itself is read-only, its own properties allow compliance
data to be added/modified.
The IComplianceData interface enables compliance metadata to be set on an item
in an archive.
See ComplianceData object on page 281.
Return value
S_OK
Success.
233
234
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
IComplianceData compData = amd.ComplianceData;
EV_STG_API_CP_UNITS evUnits = compData.Units;
object obj = compData.Value;
ulong val = (ulong)obj;
IArchiveMetaData :: SavesetSize
This property holds the size of the archived item saveset, rounded to the nearest
KB.
The property is read/write.
Syntax
HRESULT SavesetSize([out, retval] VARIANT* pVal);
Parameters
[out, retval] VARIANT* pVal
Remarks
This property is only available after an item has been archived. The VARIANT
type of this property should be vt = VT_UI4.
Although it is marked as read/write, this property cannot be modified on an item
that has already been archived.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
object obj = amd.SavesetSize;
ulong size = (ulong)obj;
IArchiveMetaData :: RetentionExpires
This property contains the UTC date and time when the item can be deleted from
a compliance storage device.
The property is read only.
Syntax
HRESULT RetentionExpires([out,retval] VARIANT* pVal);
Parameters
[out,retval] VARIANT* pVal
Remarks
This property value is populated when the item detail level,
DETAIL_LEVEL_COMPLIANCE_DATA, is set on the item Get method.
235
236
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA) | (EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_COMPLIANCE_DATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
object obj
= amd.RetentionExpires;
DateTime dt = (DateTime)obj;
IArchiveMetaData :: IndexData
This property returns a pointer to a SimpleIndexMetadata object, which allows
the calling application to enumerate system and custom index properties for the
current item, and add custom index properties when the item is archived.
The property is read only.
Syntax
HRESULT IndexData([out, retval] ISimpleIndexMetadata** pVal);
Parameters
[out, retval] ISimpleIndexMetadata** pVal
Pointer to a
SimpleIndexMetadata
object.
Remarks
The properties and methods of the ISimpleIndexMetadata interface can also be
used to add custom index data to an item as it is archived. The additional index
data is then available in the archive's index.
The Search API can be used to find items with specific index properties and values.
See Adding custom index metadata on page 72.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Requirements
Requires KVS.EnterpriseVault.Common.dll.
Example
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
See also
IArchiveMetaData :: IsItemSecured
This property indicates that is it safe to delete the original item from the source
store.
237
238
Syntax
HRESULT IsItemSecured([out, retval] VARIANT_BOOL* pVal);
Parameters
[out, retval] VARIANT_BOOL* pVal
Remarks
If the original item is deleted before the archive item is secured, then the item
may not be restored as part of a disaster recovery of the Enterprise Vault server.
The meaning of "secured" depends upon the storage device; it may mean that the
item has been backed-up, or that the storage device has replicated the item to a
duplicate device.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)(EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA)
IArchiveMetaData amd = item.ArchiveMetaData;
bool isSecured = amd.IsItemSecured;
if (isSecured == true)
{
//safe to delete original item from the source
IIArchiveMetaData :: CustomIdentifier
This property, together with the CustomQualifier property, can be used to provide
proprietary identity information for the item. For example, this property could
be used to hold the source store's identifier for the original item.
The property is read/write.
Syntax
HRESULT CustomIdentifier ([in] BSTR newVal);
HRESULT CustomIdentifier ([out, retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
The maximum length of this property is 255 characters.
This property is used in conjunction with the CustomQualifier property, which
defaults to zero.
It is possible to duplicate values using the CustomIdentifier/CustomQualifier
properties. To ensure uniqueness, the CustomIdentifier value should use an
application namespace, for example a GUID, as a prefix to the application identifier.
For example, application GUID.application Id.
As FSA and SharePoint Archiving use this property to hold information for
restoring items, the property value should not be changed for items archived
using FSA or SharePoint Archiving.
Return value
S_OK
Success.
S_FALSE
239
240
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
This VBScript example shows how CustomIdentifier, CustomQualifier and
CustomProperties can be set.
const CUSTOM_PROPERTIES = "<?xml version=1.0?><properties><key =
1 value=some value/></properties>"
const CUSTOM_ID = "AcmeWidgetId-00002"
const CUSTOM_QUALIFIER = 1
Dim oItem
oItem.ArchiveMetaData.CustomIdentifier = CUSTOM_ID
oItem.ArchiveMetaData.CustomProperties = CUSTOM_PROPERTIES
oItem.ArchiveMetaData.CustomQualifier = CUSTOM_QUALIFIER
IIArchiveMetaData :: CustomQualifier
This property, together with the CustomIdentifier property, can be used to provide
proprietary identity information for the item. For example, if different versions
of a document are archived, this property could hold the document version
information.
The property is read/write.
Syntax
HRESULT CustomQualifier ([in] LONG newVal);
HRESULT CustomQualifier ([out, retval] LONG* pVal);
Parameters
[in] LONG newVal
Remarks
This property is used in conjunction with the CustomIdentifier property. The
property can only be set after the CustomIdentifier property has been set.
If a CustomIdentifier has been set this property defaults to zero.
As FSA and SharePoint Archiving use this property to hold information for
restoring items, the property value should not be changed for items archived
using FSA or SharePoint Archiving.
Return value
S_OK
Success
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
This VBScript example shows how CustomIdentifier, CustomQualifier and
CustomProperties can be set.
const CUSTOM_PROPERTIES = "<?xml version=1.0?><properties><key
= 1 value=some value/></properties>"
const CUSTOM_ID = "AcmeWidgetId-00002"
const CUSTOM_QUALIFIER = 1
Dim oItem
oItem.ArchiveMetaData.CustomIdentifier = CUSTOM_ID
oItem.ArchiveMetaData.CustomProperties = CUSTOM_PROPERTIES
oItem.ArchiveMetaData.CustomQualifier = CUSTOM_QUALIFIER
241
242
IIArchiveMetaData :: CustomProperties
This property can be used to hold proprietary information about the stored item.
The property is read/write.
Syntax
HRESULT CustomProperties ([in] BSTR newVal);
HRESULT CustomProperties ([out, retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
The maximum length of this property is 2500 characters.
As FSA and SharePoint Archiving use this property to hold information for
restoring items, the property value should not be changed for items archived
using FSA or SharePoint Archiving.
Return value
S_OK
Success
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
This VBScript example shows how CustomIdentifier, CustomQualifier and
CustomProperties can be set.
IArchiveMetaData :: Update
The Update method is used to effect changes made to the ICompliance interface
by the calling application to the item stored in Enterprise Vault. Currently the
Update method cannot be used to update any other archive metadata properties.
Syntax
HRESULT Update(void)
Remarks
The ArchiveId and Id properties must be set prior to calling the Update method.
The operation will only be performed if the compliance device allows it. If this is
not the case, a bad HRESULT will be returned, indicating the cause of the failure.
Note the following when extending the compliance period on an item:
You cannot change the compliance period if the item is stored on a device that
has no compliance period or does not support extending the compliance period.
The new retention period must be longer than the original retention period.
You can only extend the retention period of the retention category assigned
to the item; you cannot assign a different retention category.
The only values that can be changed currently are the compliance unit and
value properties.
243
244
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_INVALID_DEVICE
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Enterprise Vault is
currently busy or has
insufficient resource to
complete the update
request, or Enterprise
Vault is currently being
backed up and is not
accepting update
requests. This error
indicates that the caller
should retry later.
CONTENTMANAGEMENTAPI_E_NO_ACCESS
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA) | (EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_COMPLIANCE_DATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
IArchiveMetaData2 :: CurrentLocation
This property specifies the path of the archive folder in which the item is currently
stored, or is to be stored when performing insert, copy or move item operations.
This property is only intended for use with structured archives, that is, archives
that contain folders.
The property is read/write.
Syntax
HRESULT CurrentLocation ([in] BSTR newVal);
HRESULT CurrentLocation ([out, retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
The Items collection object can be used to populate this property automatically.
The property value is automatically populated by any of the following methods:
Insert
MoveTo
CopyTo
The folder path specifies the archive folder path relative to the root, or default,
archive folder. The following examples illustrate the default root archive folder
path used by the CurrentLocation property for the different types of archives:
Mailbox archives.
245
246
The CurrentLocation property value does not contain any folder path elements
for the default root archive folder.
The example value "Inbox\Accounts" represents the location of an item in the
folder "Accounts", which is subfolder of "Inbox" archive folder.
FSA archives.
The default root archive folder path in the CurrentLocation property value
represents the location of the FSA volume archiving target.
For example, if the folder path for an FSA volume archiving target is
"\\FileSVR1.Example.COM\FSA Volume\5", and the value of the
CurrentLocation property is "\\FileSVR1.Example.COM\FSA
Volume\5\NewFolder", then the item is located in the folder "NewFolder",
which is subfolder of the root archive folder for the FSA volume archiving
target.
SharePoint archives.
The default root archive folder path in the CurrentLocation property value
represents the URL of the SharePoint site collection archiving target.
For example, if the URL for a SharePoint site collection archiving target is
"http://sharepoint/sites/marketing", and the value of the CurrentLocation
property is "http://sharepoint/sites/marketing/UK", then the item is located
in the folder "UK", which is subfolder of the root archive folder for the
SharePoint site collection target.
Note that the syntax rules applied to SharePoint archive folder paths differ
from those applied to folder paths in other types of archive.
The following syntax rules apply when retrieving or setting the CurrentLocation
property value for archives other than SharePoint archives;
The backslash character (\) is treated as the folder path subfolder separator
character.
Double backslash (\\) is used for preserving a backslash character in the folder
path string.
If the CurrentLocation property is specified for a flat archive (for example, shared
or journal archives, which do not contain folders), then the property value returned
is an empty string.
You can use the IArchive2::HasFolders property to determine if the archive is flat
or has a folder structure.
IArchiveMetaData2::CurrentLocation
IArchiveMetaData2:: CurrentFolderId
IContent::OriginalLocation
When copying or moving an item, then the destination archive folder is defined
by IArchiveMetaData2::CurrentLocation (if the source archive contains a folder
structure), or IContent::OriginalLocation (if the source archive is flat). If neither
of these properties is specified, then the root folder of the archive is used.
For insert, copy or move operations, if the value of ArchiveId is an archive
folder ID, then the ArchiveId property can be used instead of CurrentFolderId
or CurrentLocation to define the archive folder for the item.
Methods to enumerate, create, delete (if empty) and update archive folders are
not currently available. Also, caller applications cannot manage folder level
permissions using the Content Management API.
247
248
Table 4-33 summarizes how the archive folder is determined when different
combinations of the following properties are set:
IArchiveMetaData2::CurrentFolderId
IArchiveMetaData2::CurrentLocation
IContent::OriginalLocation
Table 4-33
Determining the target archive folder for insert, move and copy
operations
ArchiveId
Property
Saveset
OriginalLocation1
Archive Id
Not specified
Not specified
Not specified
Root folder
Archive Id
Not specified
Not specified
Specified
Archive Id
Not specified
Specified
Not specified
Folder matching
CurrentLocation
property (Folder
created as
necessary)
Value of
CurrentLocation
property
Archive Id
Not specified
Specified
Specified
Folder matching
CurrentLocation
property (Folder
created as
necessary)
Value of
OriginalLocation
property
Archive ID
Specified
Not specified
Not specified
Specified folder.
Path of the
specified
CurrentFolderId
from the
Directory
(It must be a
folder in the
archive)
Table 4-33
Determining the target archive folder for insert, move and copy
operations (continued)
ArchiveId
Property
Saveset
OriginalLocation1
Archive ID
Specified
Not specified
Specified
Archive ID
Specified
Specified
Irrelevant
Not supported;
error with invalid
arguments2
Archive folder ID
Not specified
Not specified
Not specified
Folder specified
in ArchiveId
property
Path of specified
Archive folder ID
from the
Directory
Archive folder ID
Not specified
Not specified
Specified
Folder specified
in ArchiveId
property
Value of
OriginalLocation
property
Archive folder ID
Not specified
Specified
Not specified
Folder matching
CurrentLocation
property.
Value of
CurrentLocation
property
(Folder created as
necessary)
Archive folder ID
Not specified
Specified
Specified
Folder matching
CurrentLocation
property.
Value of
OriginalLocation
property
(Folder created as
necessary)
Archive folder ID
Specified
Not specified
Not specified
Specified folder.
(It must be a
folder in the
archive)
Archive folder ID
Specified
Not specified
Specified
Specified folder.
(It must be a
folder in the
archive)
Path of the
specified
CurrentFolderId
from the
Directory
Value of
OriginalLocation
property
249
250
Determining the target archive folder for insert, move and copy
operations (continued)
Table 4-33
ArchiveId
Property
Archive folder ID
Specified
Specified
Irrelevant
Saveset
OriginalLocation1
Not supported;
error with invalid
arguments 2
Return value
S_OK
Success.
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
[C++]
IItem* pItem = NULL;
pCmAPI->get_Item(&pItem);
//
CComBSTR ArchiveId
(L"181E669473B52E64384C9A7D9EACA0E7E1110000evsite");
pItem->put_ArchiveId(ArchiveId);
// Identify Id of stored item
CComBSTR ItemId (L" 161000000000000~200501051649270000~0~9039
eb282e3d4083b79f3298dc8a1e60")
pItem->put_Id(ItemId);
pItem->Get(DETAIL_LEVEL_ARCHIVE_METADATA );
IArchiveMetaDatat* pAMD = NULL;
pItem->get_ArchiveMetaData(&pAMD);
//Fetch the item's current archive folder path location
CComBSTR CurrentLocation;
CComQIPtr<IArchiveMetaData2> pAMD2(pAMD);
pAMD2->get_CurrentLocation(&CurrentLocation);
IArchiveMetaData2 :: CurrentFolderId
This property specifies the ID of the archive folder in which the item is currently
stored, or is to be stored when performing insert, copy or move item operations.
This property is only intended for use with structured archives, that is, archives
that contain folders.
The property is read/write.
Syntax
HRESULT CurrentFolderId ([in] BSTR newVal);
HRESULT CurrentFolderId ([out, retval] BSTR* pVal);
Parameters
[in] BSTR newVal
251
252
Remarks
The Items collection object populates this property automatically.
The property value is automatically populated by any of the following methods:
IItem::Insert
IItem::MoveTo
IItem::CopyTo
For item insert, copy or move operations on structured archives, each of the
following properties can define the destination archive folder:
IArchiveMetaData2::CurrentLocation
IArchiveMetaData2:: CurrentFolderId
IContent::OriginalLocation
Return value
S_OK
Success.
S_FALSE
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C++]
IItem* pItem = NULL;
pCmAPI->get_Item(&pItem);
// Identify ArchiveID of archive in which item is stored
CComBSTR ArchiveId
(L"181E669473B52E64384C9A7D9EACA0E7E1110000evsite");
pItem->put_ArchiveId(ArchiveId);
// Identify Id of stored item
CComBSTR ItemId (L" 161000000000000~200501051649270000~0~9039
eb282e3d4083b79f3298dc8a1e60")
pItem->put_Id(ItemId);
pItem->Get(DETAIL_LEVEL_ARCHIVE_METADATA );
IArchiveMetaDatat* pAMD = NULL;
pItem->get_ArchiveMetaData(&pAMD);
//Fetch the item's current archive folder ID
CComBSTR CurrentFolderId;
CComQIPtr<IArchiveMetaData2> pAMD2(pAMD);
pAMD2->get_CurrentFolderId(&CurrentFolderId);
IArchiveMetaData2 :: SequenceNum
This property specifies the Index Sequence Number of the archived item.
The property is read only.
Syntax
HRESULT SequenceNum ([out, retval] ULONGLONG* pVal)
Parameters
[out, retval] ULONGLONG* pVal
Remarks
This property uniquely identifies the item in the archive. It can be used to identify
the start Index Sequence Number when enumerating collections of archived items
using the Items collection object.
See IItems :: StartSequenceNum on page 169.
The Items collection object populatesthis property automatically. This is useful
for bulk moving or copying items.
253
254
IItem::Insert
IItem::MoveTo
IItem::CopyTo
Enterprise Vault item sequence numbers are not always consecutive, as items
may have expired or been deleted.
Requirements
Windows Server 2003 supports ULONGLONG types with OLE Automation. However
ULONGLONG types are not supported on Windows Server 2000.
.NET managed code and C++ support ULONGLONG types, but these types are not
supported by Visual Basic Script.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
This example shows how to use the IArchiveMetaData2 interface to fetch the
SequenceNUm property.
[C#]
Item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
Item.Id = "200808070000000~200808070940280000~Z~BFA0C1B1FAB1468DB82
2E2473B4AAB05"
Item.Get((int)EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ARCHIVE_METADATA);
// Fetch the item's sequence no property
//
IArchiveMetaData2 IAMD2 = (IArchiveMetaData2)EVItem.
ArchiveMetaData;
ulong SeqNo = EVIAMD2.SequenceNum;
IArchiveMetaData2 :: ArchivedDate
This property enables the caller to retrieve and set the original archived date and
time (UTC) for the item.
The property is read/write.
Syntax
HRESULT ArchivedDate([in] VARIANT newVal);
HRESULT ArchivedDate([out, retval] VARIANT* pVal);
Parameters
[in] VARIANT newVal
Remarks
Setting this property is optional. Typically it is only set to retain the archived date
when copying or moving items.
Note: Setting the archived date can affect the item's retention period.
To specify an ArchivedDate when storing an item, set the ArchivedDate property
value before calling the Insert method.
When copying or moving an item, the default action is to retain the item's archived
date. To reset the achived date to the current date time, simply set a null value
on the destination ArchiveMetadata object.
See IItem :: CopyOptions on page 187.
Return value
S_OK
Success.
S_FALSE
255
256
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem itemSrc = cmAPI.Item;
IItem itemDst = cmAPI.Item;
itemSrc.ArchiveId ="181E669473B52E64384C9A7D9EACA0E7E1110000ev
site";
itemSrc.Id ="334880000000000~200707251102240000~0~D3962A35951E4B03
AE9CFB68AFE1218";
itemDst.ArchiveMetaData.RetentionCategory = "Business";
itemDst.ArchiveMetaData.ComplianceData.SetBy =
EV_STG_API_CP_SETBY.SETBY_RETCAT;
IArchiveMetaData2 amd =
(IArchiveMetaData2)itemDest.ArchiveMetaData;
amd.ArchivedDate = DateTime.Now();
itemSrc.CopyTo(itemDst);
SimpleIndexMetadata object
This object implements the following interface:
ISimpleIndexMetadata
Syntax
interface ISimpleIndexMetadata : IDispatch
Member summary
Table 4-34
ISimpleIndexMetadata properties
Property
Read/Write
Description
NewEnum
Read only
DateTimesUTC
Read/Write
Table 4-35
ISimpleIndexMetadata methods
Method
Description
Count
Gives the number of custom index metadata properties for the current
item.
Add
Clear
ToXML
FromXML
Loads a set of properties that have previously been defined and stored
using the ToXML method.
ToLocalTime
ToUTCTime
Remarks
The type of properties returned in the collection can be controlled using the
enumeration, EV_STG_API_ITEM_DETAIL, on the Get method of the IItem
interface.
Examples
[C#]
257
258
The following VBScript excerpt gives an example of how metadata can be read
from the instance returned by Content Management API:
[VBScript]
[C#]
Get the Index Metadata from the retrieved item
Set IMData = oItem.ArchiveMetaData.IndexData
if (IMData.Count() = 0) then
WScript.Echo "No properties loaded!", vbOKOnly + vbExclamation,
"Index Metadata"
Err.Clear
else
Use local system date/times
IMData.DateTimesUTC = false
Loop through the properties displaying the details of each
Dim idxprop
for each idxprop in IMData
Dim propInfo
Dim pVal
propInfo = "Set: " + idxprop.Set + vbCrLf + "Name: " +
idxprop.Name
propInfo = propInfo + vbCrlf + "Searchable: " +
CStr(idxprop.Searchable)
propInfo = propInfo + vbCrlf + "Retrievable: " +
CStr(idxprop.Retrievable)
pVal = idxprop.Value
propInfo = propInfo + vbCrLf + "Value (" + TypeName(pVal) +
"): " + CStr(pVal)
WScript.Echo propInfo, vbOKOnly, "Index Metadata Properties
List"
next
if (Err.number <> 0) then
WScript.Echo "Enumerating failed!" + vbCrLf + "Reason: " +
Hex(Err.number) + vbCrLf + "Description: " +
Err.Description, vbOKOnly + vbExclamation,
"Index Metadata"
Err.Clear
end if
end if
Requirements
Implemented in KVS.EnterpriseVault.Common.dll.
See also
ISimpleIndexMetadata :: _NewEnum
This property returns an IEnumVARIANT interface on an object that can be used
to enumerate the SimpleIndexMetadata collection object. This property is hidden
in Visual Basic Scripting Edition (VBScript).
The property is read only.
Syntax
HRESULT _NewEnum([out,retval] IUnknown** enumerator);
Parameters
[out,retval] IUnknown** enumerator
Remarks
This property is a standard property used to support enumerating collections, it
is automatically used internally when you use the For Each construct in C#, or
VBScript.
A collection of SimpleIndexProperty objects is returned.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
259
260
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_ARCHIVE_METADATA) |
(EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_CUSTOM_INDEX_METADATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
string set = ip.Set;
string name = ip.Name;
object val = ip.Value;
bool searchable = ip.Searchable;
bool retrievable = ip.Retrievable;
//do something with the values obtained
}
ISimpleIndexMetadata :: DateTimesUTC
This boolean property sets or retrieves whether the date and time properties are
input and output in UTC or local system time.
Syntax
HRESULT DateTimesUTC([out, retval] VARIANT_BOOL* pRetVal);
HRESULT DateTimesUTC([in] VARIANT_BOOL pRetVal);
Parameters
[out, retval] VARIANT_BOOL* pRetVal
Remarks
By default, items are always archived using UTC time.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pRetVal is NULL.
Example
Use local system date/times
IMData.DateTimesUTC = false
ISimpleIndexMetadata :: Count
This method gives the number of custom index metadata properties for the current
item.
Syntax
HRESULT Count([out, retval] long* pRetVal);
Parameters
[out, retval] long* pRetVal
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pRetVal is NULL.
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA) | (EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_CUSTOM_INDEX_METADATA)));
261
262
ISimpleIndexMetadata :: Add
This method is used to add a custom index property to an item before it is archived.
The property is then available in the index document for the item.
The Search API can be used to search for specific index data.
Syntax
HRESULT Add
[in] BSTR propertySet,
[in] BSTR propertyName,
[in] VARIANT propertyValue,
[in] VARIANT_BOOL propertySearchable,
[in] VARIANT_BOOL propertyRetrievable);
Parameters
[in] BSTR propertySet
[in] VARIANT_BOOL
propertyRetrievable
Table 4-36
Value type
Variant type
Note
String
VT_BSTR
dateTime
VT_DATE
Integer
Remarks
Custom index data can only be added when the item is inserted, copied or moved.
It is not possible to update custom index data for an archived item.
The method can be called repeatedly to add multiple properties or to add multiple
values to the same property.
When you use Add to add a property to the index, the property will be added to
the property set specified by the propertySet parameter.
If a property set is specified that does not exist, then the property set will be
created and the property and value will be added to that new set.
It is good practice to use a named property set for properties added by an
application in order to avoid name clashes with other custom additions. Suitable
263
264
names would be your company name or the application name. The following
property set names are reserved:
Vault
EnterpriseVault
KVS
Veritas
Symantec
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
propertySet is NULL, or
propertyName is NULL or
an empty string, or
propertyValue is NULL or
an invalid type or is an
invalid value, for example
out of supported range.
Example
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = item.Content;
content.Title = "New title";
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
//add some custom index data
simple.Add("My set", "My name", 32, true, true);
item.Insert();
ISimpleIndexMetadata :: Clear
This method is used to clear all properties from the SimpleIndexMetadata object
for the current item.
Syntax
HRESULT Clear();
Return value
S_OK
Success.
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_ARCHIVE_METADATA) | (
EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_CUSTOM_INDEX_METADATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
simple.Clear();
ISimpleIndexMetadata :: ToXML
This method returns the metadata in XML format.
Syntax
HRESULT ToXML(
[in] VARIANT_BOOL formattedLayout,
[out, retval] BSTR* pRetVal);
Parameters
[in] VARIANT_BOOL formattedLayout
265
266
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pRetVal is NULL.
Examples
The following code excerpt gives an example of how metadata can be added and
returned as XML, using the ToXML method:
Option Explicit
On Error Resume Next
Dim ecmAPI
Set ecmAPI = CreateObject("EnterpriseVault.ContentManagementAPI")
Dim oItem
set oItem = ecmAPI.Item
oItem.ArchiveId = "137100ED24187DB43A884B0C0B8D3FF511110000EVServer"
// populate the Data property from a file
oItem.Content.Data = "c:\data file.doc"
oItem.Content.Title = "function design document.doc"
oItem.ArchiveMetaData.RetentionCategory = "Technical Documents"
oItem.ArchiveMetaData.ComplianceData.SetBy = RetCat
Dim IMData
set IMData = oItem.ArchiveMetaData.IndexData
IMData.Clear
Use local date and time
IMData.DateTimesUTC = false
Add a property called Agent, with the string value,
"EgApplication" to the default, global property set. This property
is searchable and retrievable.
IMData.Add vbNullString, "Agent", "EgApplication",true, true
Add the following properties to the property set called "EgApp".
IMData.Add "Egapp", "File", "EgFilename", false, true
IMData.Add "EgApp", "TimeStamp", CDate("2006-10-23 12:00:00"),
false, true
return the property information as formatted XML
WScript.Echo IMData.ToXML(true)
oItem.Insert() // actually performs the insert
...
The ToXML method in this example would display the custom metadata as formatted
XML, as shown in Figure 4-3.
Figure 4-3
ToXML result
See also
ISimpleIndexMetadata :: FromXML
This method enables you to load a set of properties that have previously been
defined and stored using the ToXML method.
Syntax
HRESULT FromXML([in] BSTR xmlIndexMetadata);
Parameters
[in] BSTR xmlIndexMetadata
Remarks
Use the Add method to add item specific values.
The XML schema is not published, as the Add method should always be used to
add metadata properties.
267
268
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
xmlIndexMetadata supplied
as NULL, or is invalid XML.
Example
item.ArchiveId = "181E669473B52E64384C9A7D9EACA0E7E1110000evsite";
IContent content = item.Content;
content.Title = "New title";
content.FileExtension = "msg";
content.OriginalLocation = "Inbox";
content.Data = "C:\\temp\\test.msg";
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
//add some custom index data from xml
simple. FromXML(xmlData); //xmlData is a pre-populated string
containing the xml
item.Insert();
ISimpleIndexMetadata :: ToLocalTime
This is a helper method to convert a UTC time to local system time.
Syntax
HRESULT ToLocalTime(
[in] DATE utcDateTime,
[out, retval] DATE* pRetVal);
Parameters
[in] DATE utcDateTime
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
ISimpleIndexMetadata :: ToUTCTime
This is a helper method to convert a local system time to UTC date and time.
Syntax
HRESULT ToUTCTime(
[in] DATE localDateTime,
[out, retval] DATE* pRetVal);
Parameters
[in] DATE localDateTime
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
pRetVal is NULL,or
localDateTime is not a
syntactically valid local date
time value.
SimpleIndexProperty object
The SimpleIndexProperty object implements the following interface:
ISimpleIndexProperty
269
270
Syntax
interface ISimpleIndexProperty : IDispatch
Member summary
This read-only interface has the following properties defined:
Table 4-37
ISimpleIndexProperty properties
Parameter
Read/Write
Description
Set
Read only
Name
Read only
Value
Read only
Searchable
Read only
Retrievable
Read only
System
Read only
Remarks
Properties added to the item index using the Add method of the
ISimpleIndexMetadata interface are held as SimpleIndexProperty objects.
Example
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
ISimpleIndexProperty :: Set
This property returns the property set name.
The property is read only.
Syntax
HRESULT Set([out, retval] BSTR* value);
Parameters
[out, retval] BSTR* value
Remarks
If empty, the property is a member of the global property set.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_ARCHIVE_METADATA) |
EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_CUSTOM_INDEX_METADATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
string set = ip.Set;
string name = ip.Name;
object val = ip.Value;
bool searchable = ip.Searchable;
bool retrievable = ip.Retrievable;
//do something with the values obtained
}
271
272
ISimpleIndexProperty :: Name
This property returns the property name.
The property is read only.
Syntax
HRESULT Name([out,retval] BSTR* value);
Parameters
[out,retval] BSTR* value
Remarks
The name of a property can be a predefined name, such as IndexPropSUBJ, the
numeric identification of an attachment (for example, 1.1), or a custom name.
If the value is a formatted number (1, 1.1, 1.2 and so on), then the property refers
to a message attachment, which may be a file or a message. In this case, the value
is another instance of a SimpleIndexMetadata object, detailing the index properties
of the attachment.
If the property is a top-level message, then the Name is "1". The first attachment
would be "1.1". The first attachment on a nested message would be "1.1.1".
Figure 4-4 illustrates the naming convention for messages and attachments.
Figure 4-4
Top-level message
1
Message
Attachments
1.2
1.1
1.1.1
1.1.2
1.3
1.2.1
1.2.1.1
Each of the nested items has their own set of properties, which can be enumerated.
The property, IndexPropANUM, also contains the numeric identity of a message
attachment. The value of this property differs from the property Name.
Figure 4-5 shows the values of IndexPropANUM for a message with an attached
document and an attached message, which also has attached documents.
273
274
Figure 4-5
Top-level message
anum=0
Message
attachments
anum=1
anum=4
anum=7
Anum
anum=2
=3
anum=5
anum=6
If content items are missing, the COMR (content missing) property is returned in
the index data. The value of this property indicates the reason for the missing
content.
See Note 4 on page 610.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Version information
Content missing reasons returned in the index data COMR property is available
in Enterprise Vault 7.0 SP3 and Enterprise Vault 2007 SP1.
See Enterprise Vault 2007 SP1, Enterprise Vault 7.0 SP3, and Enterprise Vault
6.0 SP5 on page 40.
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA) | (EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL
_CUSTOM_INDEX_METADATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
string set = ip.Set;
string name = ip.Name;
object val = ip.Value;
bool searchable = ip.Searchable;
bool retrievable = ip.Retrievable;
//do something with the values obtained
}
See also
ISimpleIndexProperty :: Value
This property returns the property value.
The property is read only.
Syntax
HRESULT Value([out,retval] VARIANT* value);
275
276
Parameters
[out,retval] VARIANT* value
Table 4-38
Value type
Variant type
String
VT_BSTR
Datetime
VT_DATE
Integer
Note
An ISimpleIndexProperty
instance
Remarks
If the Name property is a formatted number (1.1, 1.2 and so on), then the property
refers to a message attachment, which may be a file or a message. In this case,
the Value property is a SimpleIndexMetadata object, detailing the index properties
of the attachment.
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA) | (EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_CUSTOM_INDEX_METADATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
string set = ip.Set;
string name = ip.Name;
object val = ip.Value;
bool searchable = ip.Searchable;
bool retrievable = ip.Retrievable;
//do something with the values obtained
}
ISimpleIndexProperty :: Searchable
This property returns whether the property is indexed, and hence can be searched
for using the Search API.
The property is read only.
Syntax
HRESULT Searchable([out,retval] VARIANT_BOOL* value);
Parameters
[out,retval] VARIANT_BOOL* value
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
277
278
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA) | (EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_CUSTOM_INDEX_METADATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
string set = ip.Set;
string name = ip.Name;
object val = ip.Value;
bool searchable = ip.Searchable;
bool retrievable = ip.Retrievable;
//do something with the values obtained
}
See also
ISimpleIndexProperty :: Retrievable
This property returns whether the property can be retrieved and displayed with
search results in the search application.
The property is read only.
Syntax
HRESULT Retrievable([out,retval] VARIANT_BOOL* value);
Parameters
[out,retval] VARIANT_BOOL* value
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_ARCHIVE_METADATA) |
(EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_CUSTOM_INDEX_METADATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
string set = ip.Set;
string name = ip.Name;
object val = ip.Value;
bool searchable = ip.Searchable;
bool retrievable = ip.Retrievable;
//do something with the values obtained
}
See also
ISimpleIndexProperty :: System
This property indicates that the property is an Enterprise Vault system property.
See System properties on page 596.
The property is read only.
279
280
Syntax
HRESULT System([out,retval] VARIANT_BOOL* value);
Parameters
[out,retval] VARIANT_BOOL* value
Remarks
For custom properties that are added using Add, the value of System is always
false.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)((EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_ARCHIVE_METADATA) |
(EV_STG_API_ITEM_DETAIL.DETAIL_LEVEL_CUSTOM_INDEX_METADATA) |
(EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_SYSTEM_INDEXDATA)));
IArchiveMetaData amd = item.ArchiveMetaData;
ISimpleIndexMetadata simple = amd.IndexData;
foreach (ISimpleIndexProperty ip in simple)
{
string set = ip.Set;
string name = ip.Name;
object val = ip.Value;
bool searchable = ip.Searchable;
bool retrievable = ip.Retrievable;
bool isSystem = ip.System;
//do something with the values obtained
}
281
See also
ComplianceData object
This object implements the following interface:
IComplianceData
Syntax
interface IComplianceData : IDispatch
Remarks
The IComplianceData interface is for use only with compliance devices.
Member summary
Table 4-39
IComplianceData properties
Property
Read/Write
Description
Value
Read/Write
Units
Read/Write
SetBy
Write only
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
IComplianceData compData = amd.ComplianceData;
282
IComplianceData :: Units
This property, combined with the Value property, specifies the duration of the
compliance period.
The property is read/write.
Syntax
HRESULT Units([out, retval] EV_STG_API_CP_UNITS* pVal);
HRESULT Units([in] EV_STG_API_CP_UNITS newVal);
Parameters
[out, retval] EV_STG_API_CP_UNITS* pVal
Pointer an
EV_STG_API_CP_UNITS
enumerated type that contains
the current value of this
property
Remarks
EV_STG_API_CP_UNITS indicates the units used in specifying the compliance
period.
See EV_STG_API_CP_UNITS enumeration on page 80.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
IComplianceData compData = amd.ComplianceData;
EV_STG_API_CP_UNITS
evUnits = compData.Units;
IComplianceData :: Value
This property, combined with the Units property, specifies the duration of the
compliance period.
The property is read/write.
Syntax
HRESULT Value([out, retval] VARIANT* pVal);
HRESULT Value([in] VARIANT newVal);
Parameters
[out, retval] VARIANT* pVal Pointer to a VARIANT that will hold the current
value of the property
[in] VARIANT newVal
Remarks
The VARTYPE of the VARIANT should be vt = VT_UI4
For example, for a compliance period of 6 days, Value = 6 and Units =
CP_UNITS_DAYS
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
283
284
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL.
DETAIL_LEVEL_ARCHIVE_METADATA);
IArchiveMetaData amd = item.ArchiveMetaData;
IComplianceData compData = amd.ComplianceData;
EV_STG_API_CP_UNITS evUnits = compData.Units;
object obj = compData.Value;
ulong val = (ulong)obj;
IComplianceData :: SetBy
This property indicates where the retention period was defined.
The property is write only.
Syntax
HRESULT SetBy([in] EV_STG_API_CP_SETBY newVal);
Parameters
[in] EV_STG_API_CP_SETBY newVal
Remarks
EV_STG_API_CP_SETBY indicates where the compliance retention period is set.
See EV_STG_API_CP_SETBY enumeration on page 79.
This property should only be used during a copy/move operation and should not
be called once an item has added to the archive.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Holds object
This object implements the following interfaces:
IHolds
IHolds2
These interfaces enable calling applications to place holds on groups of items (to
prevent them from being deleted), remove existing holds and list the holds that
have been placed on items in a vault store.
The IHolds2 interface inherits from IHolds, and provides the method
ReleaseHolds2, which returns information in XML about the success or failure of
removing holds on items in each vault store.
Syntax
interface IHolds : IDispatch
interface IHolds2 : IHolds
A Group ID, to identify the group of items with a particular hold applied. The
Group ID could, for example, identify the legal case.
285
286
The list of items that the calling application wants to place on hold.
The metadata may be useful when there are several consumers of the Legal Hold
API at the same time. For example, metadata could be used to say why one
consumer has put the item on hold, and this information could then be accessed
by other consumers. The metadata is in XML format, for example:
<MetaData>
<Reason Value="John Doe against EG Corp" />
</MetaData>
Using the IItem.Holds property, an application can enumerate all the holds which
have been placed on an item; the API returns a list of holds (Hold IDs) on that item
along with the metadata that was supplied when the item was put on hold.
Holds may be removed from items in two ways:
By specifying the Consumer ID and the Group ID. This will remove all holds
which have been placed on an item with the supplied Consumer ID and Group
ID.
By supplying the Consumer ID and a list of Hold IDs of items from which the
consumer wants to remove holds. This allows the consumer to remove holds
from items in batches rather than a whole group at once.
Member summary
Table 4-40
IHolds Properties
Property
Description
_NewEnum
Item
Count
This read only property returns the number of IHolds in the collection.
GroupId
ConsumerGUID
Table 4-40
Property
Description
Metadata
Table 4-41
IHolds Methods
Method
Description
Add
PlaceHolds
ReleaseHolds
Table 4-42
IHolds2 Method
Method
Description
ReleaseHolds2
Version information
IHolds2 interface requires Enterprise Vault 8.0 SP1.
See also
See Hold object on page 300.
IHolds :: _NewEnum
This property returns an IEnumVARIANT interface on an object that can be used
to enumerate the IHolds collection object. This property is hidden in Visual Basic
Scripting Edition (VBScript).
The property is read only.
Syntax
HRESULT _NewEnum([out,retval] IUnknown** enumerator);
287
288
Parameters
[out,retval] IUnknown** enumerator
Remarks
This property is a standard property used to support enumerating collections, it
is automatically used internally when you use the For Each construct in C#, or
VBScript.
A collection of IHold objects is returned.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_HOLD_DATA);
IHolds holds = Item.Holds;
foreach (IHold hold in holds)
{
IHolds :: Item
This property gives access to a particular hold in a collection.
The property is read/write.
Syntax
HRESULT Item([in] VARIANT index;
HRESULT Item([out, retval] LPVARIANT pRetVal);
Parameters
[in] VARIANT index
Remarks
The VARTPYE of this property should be vt = VT_I4.
Note that the index supplied to the property is 1-based not 0-based.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_HOLD_DATA);
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
IHold hold = (IHold)holds.Item(i + 1);
IHolds :: Count
This read only property returns the number of Holds in the collection.
The property is read only.
289
290
Syntax
HRESULT Count([out, retval] long* pRetVal);
Parameters
[out, retval] long* pRetVal
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IItem item = cmAPI.Item;
item.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
item.Id = "200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
item.Get((int)EV_STG_API_ITEM_DETAIL. DETAIL_LEVEL_HOLD_DATA);
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
IHold hold = (IHold)holds.Item(i + 1);
IHolds :: GroupId
This property is set to identify a group of holds placed at one time. This would
typically be an identifier of a particular legal case, for example.
The property is read/write.
Syntax
HRESULT GroupId([in] BSTR newVal);
HRESULT GroupId([out,retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
The same GroupId used to place holds can also used to release all the holds in that
group.
A GroupId should consist of printable characters and should not contain any of
the following characters: <> & ' "
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IHolds holds = cmAPI.Holds;
holds.GroupId = "Group 1";
holds.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
holds.MetaData = "Some metadata";
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
//add more hold's if necessary
holds.PlaceHolds();
291
292
IHolds :: ConsumerGUID
This property is the unique identifier of the application calling the API.
The property is read only.
Syntax
HRESULT ConsumerGUID([in] BSTR newVal);
HRESULT ConsumerGUID([out,retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
The value should remain the same for all calls made to the ContentManagement
API by the same calling application.
It must be set before holds can be placed or released.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IHolds holds = cmAPI.Holds;
holds.GroupId = "Group 1";
holds.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
holds.MetaData = "Some metadata";
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
//add more hold's if necessary
holds.PlaceHolds();
IHolds :: Metadata
This property contains the metadata to be passed with the holds to the Enterprise
Vault server.
The property is read/write.
Syntax
HRESULT Metadata([in] BSTR newVal);
HRESULT Metadata([out,retval] BSTR* pVal);
Parameters
[in] BSTR newVal
Remarks
The same metadata will be applied to each hold in the group.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
293
294
Example
IHolds holds = cmAPI.Holds;
holds.GroupId = "Group 1";
holds.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
holds.MetaData = "Some metadata";
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
//add more hold's if necessary
holds.PlaceHolds();
IHolds :: Add
This method allows a client to add a new hold to the collection.
Syntax
HRESULT Add([in] IHold* newHold);
Parameters
.[in] IHold* newHold IHold interface pointer to add to the collection.
Remarks
The IHold interface pointer must be obtained through the IContentManagementAPI
property, Hold.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IHolds holds = cmAPI.Holds;
holds.GroupId = "Group 1";
holds.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
holds.MetaData = "Some metadata";
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
//add more hold's if necessary
holds.PlaceHolds();
IHolds :: PlaceHolds
This function is used to actually place a hold on each item in the collection.
Syntax
HRESULT PlaceHolds();
Remarks
After the call has been placed, any errors in placing holds are reported in the
Status property of the hold objects in the collection.
Return value
S_OK
Success.
295
296
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
IHolds holds = cmAPI.Holds;
holds.GroupId = "Group 1";
holds.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
holds.MetaData = "Some metadata";
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
//add more hold's if necessary
holds.PlaceHolds();
IHolds :: ReleaseHolds
This function is used to release a hold on each item in the collection.
Syntax
HRESULT ReleaseHolds();
Remarks
The IContentManagementAPI :: DirectoryDNSAlias property should be set by the
caller before releasing holds by GroupId. This is required to identify the Enterprise
Vault server hosting the directory that will be used to enumerate the Enterprise
Vault Storage service computers that the group of holds spans.
When using a GroupId, if any of the holds in the group fail to be released, then
the whole group is considered to have failed.
Note that some holds may actually have been released, but the caller will need to
repeat the release on the group as whole until it succeeds, after establishing the
reason for failure and correcting it.
When not using a GroupId, if the holds are spread over multiple vault stores, and
any of the holds within a vault store fails to be released, all the holds in the vault
store will also be marked as failed. In this case, the caller can interrogate the Hold
objects in the group to find out what went wrong (using the Status property).
Finally, when all holds in a group are eventually released, then to dispose of the
group itself, you must also call ReleaseHolds( ) specifying the GroupId as before.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
297
298
Example
cmAPI.DirectoryDNSAlias = "SERVER1";
IHolds holds = cmAPI.Holds;
holds.GroupId = "Group 1";
holds.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
holds.ReleaseHolds();
IHolds2 :: ReleaseHolds2
This method is similar to ReleaseHolds, in that it can be used to release a hold on
each item in a collection, but this method also returns a summary status report,
in XML, for each vault store in which items were processed.
Syntax
HRESULT ReleaseHolds2([out, retval] BSTR* pVal);
Parameters
[out,retval] BSTR* pVal Pointer to a BSTR that will contain the status report in
XML.
Remarks
The IContentManagementAPI :: DirectoryDNSAlias property should be set by the
caller before releasing holds by GroupId. This is required to identify the Enterprise
Vault server hosting the directory that will be used to enumerate the Enterprise
Vault Storage service computers that the group of holds spans.
When using a GroupId, if any of the holds in the group fail to be released, then
the whole group is considered to have failed.
Note that some holds may actually have been released, but the caller will need to
repeat the release on the group as whole until it succeeds, after establishing the
reason for failure and correcting it.
When not using a GroupId, if the holds are spread over multiple vault stores, and
any of the holds within a vault store fails to be released, all the holds in the vault
store will also be marked as failed.
Finally, when all holds in a group are eventually released, then to dispose of the
group itself, you must also call ReleaseHolds2( ) specifying the GroupId as before.
The XML returned by the method indicates the success or failure of the action for
each vault store as a whole. In the XML, the vault store is identified by the Id field,
and success or failure of the operation is indicated by the hr field (HRESULT). If
the hold was released successfully on all affected items in a vault store, then the
HRESULT returned for the vault store is 0. If the hold could not be released on
some or all of the affected items in the vault store, then the hr field contains the
error code value.
Version information
ReleaseHolds2 method requires Enterprise Vault 8.0 SP1.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Examples
cmAPI.DirectoryDNSAlias = "SERVER1";
IHolds2 holds = (IHolds2)cmAPI.Holds;
holds2.GroupId = "Group 1";
holds2.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
string xml holds2.ReleaseHolds2();
299
300
Hold object
This object implements the following interface:
IHold
The IHold interface contains properties that relate to a particular hold placed on
a particular item. It is a collection of IHold interface pointers that are stored in
the IHolds collection.
Syntax
interface IHold : IDispatch
Member summary
Table 4-43
IHold properties
Property
Description
ArchiveId
This property specifies the ArchiveID where the item to which this
hold object refers is stored. This property must be set before a hold is
placed or released.
ItemId
This property specifies the identifier of the item to which this hold
object refers. This property must be set before a hold is placed.
Id
This property identifies the hold object. It is returned once a hold has
been placed, and must be set before a hold can be released.
Status
This read only property returns the status of the hold after an attempt
either to place or release a hold.
Table 4-43
Property
Description
Metadata
This read only property returns the metadata that is stored with the
hold.
ConsumerGUID
This read only property returns the unique identifier of the calling
application that placed the hold.
GroupId
This read only property returns the identifier of the group of holds
to which the hold belongs.
Remarks
Being derived from IDispatch, this interface can be used by scripting languages.
Example
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
IHold :: ArchiveId
This property specifies the ArchiveID of the archive where the item that this hold
object refers to is stored.
The property is read/write.
Syntax
HRESULT ArchiveId([out, retval] BSTR* pVal);
HRESULT ArchiveId([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
301
302
Remarks
This property must be set before a hold is placed or released.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[in]
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
[out]
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
I Hold hold = (IHold)holds.Item(i + 1);
string archId = hold.ArchiveId;
IHold :: ItemId
This property specifies the identifier of the item to which the hold object refers.
The property is read/write.
Syntax
HRESULT ItemId([out, retval] BSTR* pVal);
HRESULT ItemId([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Remarks
This property must be set before a hold is placed.
The identifier can be a Saveset Id or a Transaction Id.
See Saveset IDs and Transaction IDs on page 71.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[in]
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.ItemId =
200501051649270000~0~9039eb282e3d4083b79f3298dc8a1e60";
holds.Add(hold);
[out]
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
IHold hold = (IHold)holds.Item(i + 1);
string itemID
= hold.ItemId;
303
304
IHold :: Id
This property identifies the hold object.
The property is read/write.
Syntax
HRESULT Id([out, retval] BSTR* pVal);
HRESULT Id([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
BSTR that will contain the new value of the hold Id.
Remarks
The maximum length for this property is 128 characters.
This property is returned after a hold has been placed, and must be set before a
hold can be released.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[in]
IHolds holds = cmAPI.Holds;
holds.ConsumerGUID = "{1D938946-329D-4bfa-87FF-9D30B808ADD1}";
IHold hold = cmAPI.Hold;
hold.ArchiveId = "1C9EFA88998592944ADB634ACC0D7410D1110000EVSite";
hold.Id = 123;
holds.Add(hold);
//add more holds
holds.ReleaseHolds;
[out]
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
IHold hold = (IHold)holds.Item(i + 1);
string ID
= hold.Id;
IHold :: Status
This property returns the status of the hold after an attempt to either place or
release a hold.
The property is read only.
Syntax
HRESULT Status([out, retval] VARIANT* pVal);
Parameters
[out, retval] VARIANT* pVal
Remarks
The VARTYPE of the variant must be vt = VT_I4.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
305
306
IHold :: Metadata
This property returns the metadata that is stored with the hold.
The property is read only.
Syntax
HRESULT Metadata([out, retval] BSTR* pVal);
Parameters
[out, retval] BSTR* pVal
Remarks
This property is only populated when the IItem.Get method is called and the
DetailLevel parameter includes the HoldData bit.
See IItem :: Get on page 194.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
IHold hold = (IHold)holds.Item(i + 1);
string metadata = hold.MetaData;
IHold :: ConsumerGUID
This property returns the unique identifier of the calling application that placed
the hold.
The property is read only.
Syntax
HRESULT ConsumerGUID([out, retval] BSTR* pVal);
Parameters
[out, retval] BSTR* pVal
Remarks
The format of the consumer GUID should be as in the following example:
{3BC4797A-3238-478b-9CA6-5CC9989078DE}
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
IHold hold = (IHold)holds.Item(i + 1);
string conGUID = hold.ConsumerGUID;
IHold :: GroupId
This property returns the identifier of the group of holds to which the hold belongs.
The property is read only.
Syntax
HRESULT GroupId([out, retval] BSTR* pVal);
307
308
Parameters
[out, retval] BSTR* pVal
Remarks
See IHolds :: GroupId on page 290.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
IHolds holds = Item.Holds;
for (int i = 0; i < holds.Count ; i++)
{
IHold hold = (IHold)holds.Item(i + 1);
string groupID = hold.GroupId;
ICollectionBase : IDispatch
The ICollectionBase interface provides common collection functionality for
Enterprise Vault API collections, for example, Archives and VaultStores collections.
The interface provides the count of items, a standard COM enumerator interface,
a zero-based array style indexer, and methods to manage the collection.
Syntax
interface ICollectionBase : IDispatch
Member summary
Table 4-44
ICollectionBase properties
Property
Read/Write
Description
Count
Read only
Table 4-44
Property
Read/Write
Description
_NewEnum
Read only
Item
Read only
Maximum
Read/Write
More
Read only
Table 4-45
ICollectionBase methods
Method
Description
Get
Clear
Reset
Version information
This interface is available in Enterprise Vault 2007 or later.
ICollectionBase :: Count
This property returns the current number of items in the collection.
The property is read only.
Syntax
HRESULT Count([out,retval] long* value);
Parameters
[out,retval] long* value Number of items in the collection.
309
310
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
value is NULL.
Example
[C#]
archives.Get();
for (long i = 0; i < archives.Count; i++)
{
ProcessArchive(archives.Item(i));
ICollectionBase :: _NewEnum
This property returns an IEnumVARIANT interface on an object that can be used
to enumerate the collection object. This property is hidden in Visual Basic Scripting
Edition (VBScript).
The property is read only.
Syntax
HRESULT _NewEnum([out,retval] IUnknown** enumerator);
Parameters
[out,retval] IUnknown** enumerator
Remarks
This property is a standard property used to support enumerating collections, it
is automatically used internally when you use the For Each construct in C#, or
VBScript.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
enumerator is NULL.
Example
[C#]
archives.Get();
foreach (IArchive archive in archives)
{
SearchArchive(archive.Id);
ICollectionBase :: Item
This property returns an instance of the item at the zero-based index into the
collection treated as a virtual array.
The property is read only.
Syntax
HRESULT Item([in] long index, [out,retval] IUnknown** item);
Parameters
[in] long index
Zero-based index.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C#]
archives.Get();
for (long i = 0; i < archives.Count; i++)
{
IArchive archive = (IArchive)archives.Item(i);
SearchArchive(archive.Id);
311
312
ICollectionBase :: Maximum
This property sets the maximum number of items for the collection.
The property is read/write.
Syntax
HRESULT Maximum([out,retval] long* value);
HRESULT Maximum([in] long value);
Parameters
[out,retval] long* value
Remarks
The default value depends on the collection type but the value for both initial
collection types, vault stores and archives, is 5000.
The default value is set to provide reasonable performance together with
reasonable resource usage. Attempting to build large collections may result in
poor performance and failures due to lack of resources, for example, lack of
available memory.
The defaults are as follows:
Archives 5000
Items 10000
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
Example
[C#]
archives.Maximum = 6000;
archives.Get();
ICollectionBase :: More
This property indicates whether there were more items available in the collection
than specified by Maximum.
The property is read only.
Syntax
HRESULT More([out,retval] VARIANT_BOOL* value);
Parameters
[out,retval] VARIANT_BOOL* value
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
value is NULL.
Example
[C#]
archives.Maximum = 6000;
archives.Get();
if (archives.More == true)
{
//do something,
313
314
ICollectionBase :: Get
This method populates the collection with items that match the selection criteria
up to the maximum number of items specified by Maximum.
Syntax
HRESULT Get(void);
Remarks
Any existing collection is cleared prior to attempting to repopulate the collection.
Return value
S_OK
Success.
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
CONTENTMANAGEMENTAPI_E_BUSY
Example
[C#]
archives.Computer = ""EV1.acme.com";
archives.Permissions =
EV_STG_API_PERMISSIONS_TYPE.PERMISSIONS_SEARCH;
archives.ArchiveTypes =
EV_STG_API_ARCHIVE_TYPE.ARCHIVE_TYPE_SHARED;
archives.Get();
ICollectionBase :: Clear
This method clears the current collection.
Syntax
HRESULT Clear(void);
Remarks
Clears all items from the current collection setting it back to the empty state;
Count returns zero.
Return value
S_OK
Success.
Example
[C#]
archives.Get();
for (long i = 0; i < archives.Count; i++)
{
ProcessArchive(archives.Item(i));
}
//now clear archives before doing another get with different filters
set
archives.Clear();
ICollectionBase :: Reset
This method resets the collection back to the initial empty state.
315
316
Syntax
HRESULT Reset(void);
Remarks
All items are cleared from the current collection, if any, and all selection criteria
properties are reset back to their default empty values.
Return value
S_OK
Success.
Example
[C#]
archives.Get();
for (long i = 0; i < archives.Count; i++)
{
ProcessArchive(archives.Item(i));
}
//now reset archives before doing another get with different filters
set
archives.Reset();
ExtendedErrorInfo object
This object implements the following interface:
IExtendedErrorInfo
This interface makes available properties that provide additional details about
the return value of the most recent call to a child object of the parent Content
Management API object instance.
Syntax
interface IExtendedErrorInfo : IDispatch
Member summary
Table 4-46
IExtendedErrorInfo properties
Property
Read/Write
Description
Error
Read only
Description
Read only
InnerError
Read only
Source
Read only
Remarks
The ExtendedErrorInfo object is read-only, and is not updated by any subsequent
Content Management API call a new instance of the ExtendedErrorInfo object
must be requested from the Content Management API object.
The inner error can be any Windows or Enterprise Vault COM return value. It is
provided for additional information only; for example, to add to extended logging
details. The list of values is not documented, and it is not guaranteed that the
same error scenario will return the same inner error value with future versions
of Enterprise Vault.
Version information
Examples
In the following example, the additional information returned by the
IExtendedErrorInfo interface shows that the Enterprise Vault server is in Backup
Mode:
API Error Code:
0x80040302 (Ref: CONTENTMANAGEMENTAPI_E_BUSY)
317
318
The following example code shows how the ExtendedErrorInfo object is used.
[C++]
CComPtr<IContentManagementAPI4> pCMAPI;
CComPtr<IItem> pItem;
HRESULT hr = pItem->CopyTo(pDestItem);
if (FAILED(hr))
{
HRESULT hrGLE (S_OK);
CComPtr<IUnknown> pIUnkErrInfo;
hrGLE = pCMAPI->get_LastError(&pIUnkErrInfo);
if (SUCCEEDED(hrGLE))
{
CComQIPtr<IExtendedErrorInfo> pExtErrInfo(pIUnkErrInfo);
if (pExErrInfo != NULL)
{
HRESULT hrError = S_OK;
HRESULT hrInnerError = S_OK;
CComBSTR bsErrorDesc;
CComBSTR bsInnerErrorDesc;
pExErrInfo->get_Error(&hrError);
pExErrInfo->get_InnerError(&hrInnerError);
pExErrInfo->get_Description(&bsErrorDesc);
pExErrInfo->get_InnerErrorDescription(&bsInnerErrorDesc);
// *** Use error info
AddExtendedErrorToLogFile(L"Failed to copy archived
item", hrError, bsErrorDesc, hrInnerError,
bsInnerErrorDesc);
}
}
}
The following example code shows how the ExtendedErrorInfo object is used.
[VBScript]
private Sub ReportCMAPIError(byref ecmAPI)
dim
dim
dim
dim
oExtErr
szErrorDesc, szInnerErrorDesc
vbError, vbExtError
Msg
Err.Clear
set oExtErr = ecmAPI.LastError
vbError = oExtErr.Error
vbExtError = oExtErr.InnerError
szErrorDesc = oExtErr.Description
szInnerErrorDesc = oExtErr.InnerErrorDescription
Msg = "***************************" & vbCrLf & vbCrLf
Msg = Msg & "** CM API EXTENDED ERROR INFO" & vbCrLf & vbCrLf
Msg = Msg & " Error Code: 0x" & Hex(vbError) & vbCrLf & vbCrLf
Msg = Msg & " Error Description: " & szErrorDesc & vbCrLf &
vbCrLf
Msg = Msg & " InnerError Code: 0x" & Hex(vbExtError) & vbCrLf &
vbCrLf
319
320
Msg = Msg & " InnerError Description: " & szInnerErrorDesc &
vbCrLf & vbCrLf
Msg = Msg & "***************************"
WScript.Echo Msg
Err.Clear
end sub
IExtendedErrorInfo :: Error
This property provides the Content Management API return value associated with
the most recent call to a Content Management API method.
This property is read only.
Syntax
HRESULT Error([out, retval] long* pVal);
Parameters
[out,retval] long* pVal Pointer to a long data type containing the Content
Management API return value.
Remarks
See Content Management API return values on page 619.
Return value
S_OK
Success.
E_INVALIDARG
pVal is Null.
IExtendedErrorInfo :: Description
This property provides the error description for the Content Management API
return value.
This property is read only.
Syntax
HRESULT Description([out, retval] BSTR* pVal);
Parameters
[out,retval] BSTR* pVal
Remarks
The error description strings are supplied in English only.
Return value
S_OK
Success.
IExtendedErrorInfo :: InnerError
This property provides the internal return value associated with the most recent
call to a Content Management API method.
This property is read only.
Syntax
HRESULT InnerError([out, retval] long* pVal);
Parameters
[out,retval] long* pVal
Remarks
The inner error can be any Windows or Enterprise Vault COM return value. It is
provided for additional information only, for example, to add to extended logging
details.
The list of values is not documented, and it is not guaranteed that the same error
scenario will return the same inner error value with future versions of Enterprise
Vault.
321
322
Return value
S_OK
Success.
IExtendedErrorInfo :: InnerErrorDescription
This property provides the error description for the Enterprise Vault internal
return value.
This property is read only.
Syntax
HRESULT InnerErrorDescription([out, retval] BSTR* pVal);
Parameters
[out,retval] BSTR* pVal
Remarks
The error description strings are supplied in English only.
Return value
S_OK
Success.
E_INVALIDARG
pVal is Null
IExtendedErrorInfo :: Source
This property provides the GUID of the Content Management API object that was
the source of the error information.
This property is read only.
Syntax
HRESULT Source([out, retval] GUID* pVal);
Parameters
[out,retval] GUID* pVal
Remarks
This property is not currently implemented, and returns E_NOTIMPL.
Return value
E_NOTIMPL
Not implemented.
DiagnosticsAPI object
This object implements the following interface:
IDiagnosticsAPI
This interface enables applications to write to Enterprise Vault event log and to
use Enterprise Vault tracing functionality (Dtrace).
Syntax
interface IDiagnosticsAPI : IDispatch
Member summary
Table 4-47
IDiagnosticsAPI properties
Property
Read/Write
Description
Name
Read/Write
Name of application
Table 4-48
IDiagnosticsAPI methods
Method
Description
IsTraceEnabled
LogEvent
Trace
323
324
Remarks
For a description of the Dtrace utility, see the Enterprise Vault Utilities guide.
Version information
IDiagnosticsAPI : Name
This property holds the name of the application.
This property is read/write.
Syntax
HRESULT Name([out, retval] BSTR* pVal);
HRESULT Name([in] BSTR pVal);
Parameters
[out, retval] BSTR* pVal
Remarks
The default value for the Name property is "API", it is limited to a maximum of
50 characters and is a write-once property. The application name is included in
the event log description logged by the LogEvent method. For example with Name
set to Acme.RM and with the message
"Failed to determine archive.\nIdentity: John Paul Jones\nError:
Entry not found (0x0002)"
then the log entry would appear something like the following:
Application: Acme.RM
Failed to determine archive.
Identity: John Paul Jones
Error: Entry Not Found (0x0002)
Return value
S_OK
Success.
E_POINTER
E_ACCESSDENIED
IDiagnosticsAPI : IsTraceEnabled
This method tests whether tracing is enabled for the selected level.
Syntax
HRESULT IsTraceEnabled([in] EV_API_TRACE_LEVEL traceLevel,
[out, retval] VARIANT_BOOL* enabled);
Parameters
[in] EV_API_TRACE_LEVEL traceLevel
EV_API_TRACE_LEVEL value to
check.
Remarks
EV_API_TRACE_LEVEL is an enumerated value that indicates the level of tracing.
See EV_API_TRACE_LEVEL enumeration on page 76.
This method can be used to optimize the cost of building the trace message for
the normal case, where trace is not enabled.
Return value
S_OK
Success.
E_POINTER
enabled is NULL.
IDiagnosticsAPI : LogEvent
This method creates an entry in the Enterprise Vault event log.
325
326
Syntax
HRESULT LogEvent([in] EV_API_EVENT_TYPE eventType,
[in] BSTR message);
Parameters
[in] EV_API_EVENT_TYPE eventType
EV_API_EVENT_TYPE value.
Message to write.
Remarks
EV_API_EVENT_TYPE is an enumerated value that indicates the type of event.
See EV_API_EVENT_TYPE enumeration on page 76.
The events are logged under a single Event Id, 7002. The event source is set to
Enterprise Vault and the event category is determined by the executable logging
the event. If the executable is not an Enterprise Vault executable then the category
is None.
Return value
S_OK
Success.
E_INVALIDARG
IDiagnosticsAPI : Trace
This method traces a message, if trace is enabled for the selected level.
Syntax
HRESULT Trace([in] EV_API_TRACE_LEVEL traceLevel,
[in] BSTR message);
Parameters
[in] EV_API_TRACE_LEVEL traceLevel
Trace message.
Remarks
EV_API_TRACE_LEVEL is an enumerated value that indicates the trace level.
See EV_API_TRACE_LEVEL enumeration on page 76.
In the trace output, the application name is enclosed in brackets and prefixed to
the trace message content to enable filtering in the DTrace utility. For example
with Name set to the value Acme.RM, the message "Initialization complete" would
appear as:
4553 10:42:04.101 [5016] (AcmeRMServer) <4342> EV:L [Acme.RM]
Initialization complete
Trace messages are captured dynamically by the Enterprise Vault DTrace utility
if the component (that is, the executable) is enabled for tracing within the utility.
The DTrace monitoring level setting for the component determines whether or
not the Trace method generates a trace entry and hence whether or not the trace
message is captured by the DTrace utility as shown in the table below.
Table 4-49
DTrace setting
Off
No
No
No
Brief
Yes
No
No
Medium
Yes
Yes
No
Verbose
Yes
Yes
Yes
Return value
S_OK
Success.
E_INVALIDARG
message is NULL.
327
328
Chapter
Enumerations
NSFManager object
INSFManager :: OpenNSF
INSFManager :: CreateNSF
INSFManager :: CloseNSF
INSFManager :: ViewNote
INSFManager :: ImportNote
INSFManager :: ExportNote
INSFManager :: DeleteNote
INSFManager :: InitializeNotes
INSFManager :: TerminateNotes
INSFManager :: SwitchToID
330
Use OpenNSF or CreateNSF to open or create an NSF database to hold the item
to be stored.
Use ExportNote to export the item from the NSF database to the Content
Management API.
The following Content Management API properties and method can then be
used to store the item in an archive:
Use DeleteNote to delete the note from the NSF database (optional).
The following steps outline how an application can use the NSF Manager and
Content Management API to retrieve a Note from an archive and view it in the
Notes client:
Use OpenNSF or CreateNSF to open or create an NSF database to hold the item
to be retrieved and viewed.
Use ImportNote to import the item from Content Management API to the NSF
database.
The following Content Management API properties and method can be used
to retrieve the item from the archive:
Use DeleteNote to delete the item from the NSF database (optional).
Components
The NSF Manager API contains one apartment-threaded, automation-friendly
COM class:
NSFManager
Security
When you interact with databases on a server, you must use an ID file that has
appropriate permissions.
331
332
Enumerations
This section describes enumerations used by the NSF Manager API.
InitializeNotes enumeration
InitializeNotes is an enumerated value that is used in conjunction with the
InitializeNotes and TerminateNotes methods:
enum EV_NOTES_INIT_MODE
{
EV_NOTES_INIT_APPLICATION,
EV_NOTES_INIT_THREAD
};
NSFManager object
The NSFManager object implements the following interface:
INSFManager
Syntax
interface NSFManager : IDispatch
Member summary
Table 5-1
Member summary
Method
Description
OpenNSF
CreateNSF
CloseNSF
ViewNote
ImportNote
ExportNote
DeleteNote
InitializeNotes
Table 5-1
Method
Description
TerminateNotes
SwitchToID
Requirements
See Programming notes on page 56.
CLSID
FBD0FA42-EF3C-4761-B3E4-9C39422273CE
Prog ID
KVS.EnterpriseVault.LotusDomino.NSFManager
Type Library
EVContentManagementAPILib
DLL
KVS.EnterpriseVault.NSFManager.dll
.NET Primary
Interop Assembly
(PIA)
KVS.EnterpriseVault.Interop.EVContentManagementAPI.dll
.NET PIA
namespace
KVS.EnterpriseVault.Interop
INSFManager :: OpenNSF
This method opens an existing NSF database.
Syntax
HRESULT OpenNSF([in] BSTR bsFilePath);
Parameters
[in] BSTR bsFilePath Specifies the full path to the database.
Return value
S_OK (success) or standard COM error codes.
333
334
Example
The following example shows how to use OpenNSF to open a database:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.OpenNSF(@"c:\DBs\TestDB.nsf");
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: CreateNSF
This method creates a new NSF database.
If you supply the name of a template on which to base the new database, the
template must exist on the local machine.
Syntax
HRESULT CreateNSF(
[in] BSTR bsTemplateName,
[in] BSTR bsFilePath);
Parameters
[in] BSTR bsTemplateName The full path and file name of the template on which
you want to base the new database.
[in] BSTR bsFilePath
Return value
S_OK (success) or standard COM error codes.
Example
The following example shows how to use CreateNSF to create a database based
on a specified template:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.CreateNSF(
@"c:\Program Files\Lotus\Notes\Data\mail8.ntf",
@"c:\DBs\TestDB.nsf");
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: CloseNSF
This method closes the open NSF database and optionally deletes it.
Syntax
HRESULT CloseNSF([in] VARIANT_BOOL bDeleteNSF);
Parameters
[in] VARIANT_BOOL bDeleteNSF Use VARIANT_TRUE to delete the database.
Use VARIANT_FALSE to retain the database.
Return value
S_OK (success) or standard COM error codes.
335
336
Example
The following example shows how to use CloseNSF to close a database, without
deleting it:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.OpenNSF(@"c:\DBs\TestDB.nsf");
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: ViewNote
This method launches the Notes client and opens the specified note.
Syntax
HRESULT ViewNote([in] ULONG ulNoteId);
Parameters
[in] ULONG ulNoteId The ID of the note, which must exist in the database.
Return value
S_OK (success) or standard COM error codes.
Example
The following example how to use ViewNote to open a note:
INSFManager :: ImportNote
This method imports a note from a file, or an IStream or ILockBytes object.
The note to be imported is in the proprietary Enterprise Vault format, as returned
from the Content Management API or by the ExportNote method.
Syntax
HRESULT ImportNote(
[in] VARIANT vInputNote,
[out, retval] ULONG *pulNoteId);
Parameters
[in] VARIANT vInputNote
Return value
S_OK (success) or standard COM error codes.
337
338
Example
The following example how to use ImportNote to import a note:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.OpenNSF(@"c:\DBs\TestDB.nsf");
uint noteId = nsfMgr.ImportNote(@"c:\EVNotes\storedNote.dvns");
nsfMgr.ViewNote(noteId);
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: ExportNote
This method exports a note from the NSF database to a file, or an IStream or
ILockBytes object.
The note exported is in proprietary Enterprise Vault format, and can be passed
to the Content Management API or ImportNote method.
Syntax
HRESULT ExportNote(
[in] ULONG lNoteId,
[in] VARIANT vOutputNote);
Parameters
[in]_ULONG_ulNoteId
Return value
S_OK (success) or standard COM error codes.
Example
The following example shows how to use ExportNote to export a note:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.OpenNSF(@"c:\DBs\TestDB.nsf");
nsfMgr.ExportNote(0x8f6, @"c:\EVNotes\storedNote.dvns");
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: DeleteNote
This method deletes the note from the NSF database.
Syntax
HRESULT DeleteNote([in] ULONG ulNoteId);
Parameters
[in] ULONG ulNoteId The ID of the note.
Return value
S_OK (success) or standard COM error codes.
339
340
Example
The following example shows how to use DeleteNote to delete a note:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.OpenNSF(@"c:\DBs\TestDB.nsf");
nsfMgr.DeleteNote(0x8a6);
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: InitializeNotes
This method initializes the Notes runtime on the main application thread, or on
a worker thread.
The main thread must initialize Notes before any worker threads.
Syntax
HRESULT InitializeNotes([in] EV_NOTES_INIT_MODE initMode);
Parameters
[in] EV_NOTES_INIT_MODE initMode Value of the enum, indicating whether to
initialize on the main application thread or
a worker thread.
Return value
S_OK (success) or standard COM error codes.
Example
The following example shows how to use InitializeNotes to initialize the Notes
runtime on the main application thread:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.CreateNSF(
@"c:\Program Files\Lotus\Notes\Data\mail8.ntf",
@"c:\DBs\TestDB.nsf");
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: TerminateNotes
This method terminates the Notes runtime on the main application thread, or on
a worker thread.
Terminate the Notes runtime on the worker threads before the main thread.
Syntax
HRESULT TerminateNotes([in] EV_NOTES_INIT_MODE initMode);
Parameters
[in] EV_NOTES_INIT_MODE initMode Value of the enum, indicating whether to
terminate on the main application thread or
a worker thread.
Return value
S_OK (success) or standard COM error codes.
341
342
Example
The following example shows how to use TerminateNotes to terminate the Notes
runtime:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.OpenNSF(@"c:\DBs\TestDB.nsf");
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
INSFManager :: SwitchToID
This method switches to the specified ID file, which is required when you create
an NSF database from a template, or open an NSF database from a remote server.
Syntax
HRESULT SwitchToID(
[in] BSTR bsIdFilePath,
[in] BSTR bsPassword);
Parameters
[in] BSTR bsIdFilePath The full path and file name of the ID file.
Return value
S_OK (success) or standard COM error codes.
Example
The following example shows how to use SwitchToID to switch to a specified ID:
Type type = Type.GetTypeFromProgID(
"KVS.EnterpriseVault.LotusDomino.NSFManager");
INSFManager nsfMgr = (INSFManager)Activator.CreateInstance(type);
try
{
nsfMgr.InitializeNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
nsfMgr.SwitchToID(
@"c:\Program Files\Lotus\Notes\Data\IDs\user.id",
@"passw0rd");
nsfMgr.OpenNSF(@"DomSvr1/ACME!!mail\user.nsf");
}
finally
{
nsfMgr.CloseNSF(false);
nsfMgr.TerminateNotes(
EV_NOTES_INIT_MODE.EV_NOTES_INIT_APPLICATION);
}
343
344
Chapter
Filtering APIs
This chapter includes the following topics:
IExternalFilter interface
IExternalFilter :: Initialize
IExternalFilter :: ProcessFilter
IExternalFilter :: FilteringComplete
IArchivingControl :: currentVaultId
IArchivingControl :: currentRetentionCategoryId
IArchivingControl :: defaultRetentionCategoryId
IArchivingControl :: deleteOriginalItem
IArchivingControl :: createShortcutToItem
IArchivingControl :: Action
IArchivingControl :: MAPISession
IArchivingControl :: MAPIMessage
IArchivingControl :: AddIndexedProperty
IArchivingControl :: IndexedPropertiesSet
346
Filtering APIs
IArchivingControl :: AddIndexPropertyToSet
IArchivingControl :: AddIndexPropertySet
IArchivingControl :: TransactionID
IArchivingControl :: AgentType
IArchivingControl :: AgentAssignedRetentionCategoryId
IArchivingControl :: AgentAssignedVaultId
IArchivingControl :: GetFilterProperty
IArchivingControl :: PutFilterProperty
IArchivingControl :: AttachmentAction
IArchivingControl :: RetryStatus
IArchivingControl :: ReArchiveStatus
IArchivingControl2 :: BrowserViewURL
IArchivingControl2 :: NativeItemURL
IArchivingControl2 :: MessageClass
IArchivingControl2 :: MAPISaveChanges
IArchivingControl3 :: SenderRecipientXML
IArchivingControl3 :: EnvelopeSenderRecipientXML
IArchivingControl3 :: MessageDirection
IArchivingControl4 :: AddIndexedPropertyEx
IExternalFilter interface
IExternalFilter :: Initialize
IExternalFilter :: ProcessFilter
IExternalFilter :: FilteringComplete
IExternalFilter :: Shutdown
Filtering APIs
IArchivingControl interface
IArchivingControl :: OriginalVaultID
IArchivingControl :: CurrentVaultID
IArchivingControl :: OriginalRetentionCategoryID
IArchivingControl :: CurrentRetentionCategoryID
IArchivingControl :: IndexData
IArchivingControl :: FilterProperties
ILotusArchivingControl interface
ILotusArchivingControl :: Action
ILotusArchivingControl :: NoteHandle
ILotusArchivingControl :: DatabaseHandle
ILotusArchivingControl :: DatabaseName
ILotusArchivingControl :: SenderRecipientXML
ILotusArchivingControl :: StoreIdentifier
ILotusArchivingControl :: Direction
IFileArchivingControl interface
IFileArchivingControl :: Action
IFileArchivingControl :: Name
IFileArchivingControl :: Attributes
IFileArchivingControl :: CreationTimeUtc
IFileArchivingControl :: LastAccessTimeUtc
IFileArchivingControl :: LastWriteTimeUtc
IFileArchivingControl :: GetAccessControl
IFileArchivingControl :: SetAccessControl
IFileArchivingControl :: Length
IFileArchivingControl :: Open
IFileArchivingControl :: StreamNames
347
348
Filtering APIs
About the Filtering APIs
IFileArchivingControl :: OpenStream
IFileArchivingControl :: DeleteStream
IFileArchivingControl :: ExtendedAttributes
IIndexMetadata interface
IIndexMetadata :: ToXML
IIndexMetadata :: FromXML
IIndexMetadata :: Add
IIndexMetadata :: Clear
IIndexMetadata :: Count
IIndexMetadata :: DateTimesUTC
IIndexProperty interface
IIndexProperty :: Set
IIndexProperty :: Name
IIndexProperty :: Value
IIndexProperty :: Searchable
IIndexProperty :: Retrievable
IKeyedList interface
IKeyedList :: Insert
IKeyedList :: RemoveAt
Filtering involves selecting specific items according to set criteria, and performing
certain actions on those items. Items may be selected using attributes such as
Filtering APIs
About the Filtering APIs
Both the Domino Filtering API and the File System Filtering API are presented as
a set of .NET interfaces. The Domino Filtering API can be used to develop
proprietary filters for Domino Journaling tasks. The File System Filtering API can
be used to develop proprietary filters for File System Archiving tasks.
You can configure multiple filters for a particular type of archiving; the associated
archiving task will process these in order.
You enable filtering by configuring registry settings for the associated archiving
task.
The following points summarize the steps you need to take to configure filtering:
Develop your filter class using the API interfaces described in this chapter. In
the filter you can use the Content Management DiagnosticsAPI class to add
tracing and event logging.
See DiagnosticsAPI object on page 323.
349
350
Filtering APIs
Exchange Filtering API
Configure the appropriate filtering registry settings for the archiving tasks
that you want to perform filtering. The registry settings enable filtering for
the archiving task and define the external filters to process.
Details of the registry settings are given in the following sections:
See Exchange filtering registry settings on page 352.
See Domino filtering registry settings on page 394.
See File System filtering registry settings on page 395.
After you upgrade Enterprise Vault, you must update binding redirections in the
associated .NET application configuration files to use the newer version of the
Enterprise Vault API runtime. For File System filtering, the .NET application
configuration file is EvFSAArchivingTask.exe.config. For Domino filtering, the
.NET application configuration file is EVLotusDominoJournalTask.exe.config.
See Updating binding redirections in configuration files on page 54.
Details of the filtering APIs are given in the following sections:
See Domino Filtering and File System Filtering APIs on page 389.
Filtering APIs
Exchange Filtering API
Figure 6-1
Modified contents
Enterprise Vault
Exchange
Journaling
task
Enterprise Vault
Exchange
Mailbox task
Vault
store
Enterprise Vault
Exchange Public
Folder task
External
filter 1
External
filter 1
ProcessFilter()
Modified contents
Task Filter
Controller
External
filter 1
The figure, Figure 6-1, illustrates how Enterprise Vault implements Exchange
external filters:
If the registry settings are configured to enable filtering for the Exchange
Mailbox, Journaling or Public Folder tasks, the task calls the task filter
controller when processing a message.
The task filter controller invokes the first external filter, which implements
the IExternalFilter interface.
The filter processes the message synchronously, using the methods and
properties of the IArchivingControl4 interface to set properties that define
how the Exchange archiving task is to process the message.
Provided the stopFiltering parameter is not set to TRUE, each filter is applied
in turn to the message.
351
352
Filtering APIs
Exchange Filtering API
After the message has been processed by all of the registered filters, the task
filter controller then invokes the FilteringComplete method for each filter.
This enables the filter to tidy up and release any resources used while
processing the message.
The Exchange archiving task then completes archiving the message, as modified
by the external filters and also taking account of any archiving actions set by
the external filters.
To develop a filter for Exchange filtering, you need to obtain and install the
appropriate Enterprise Vault archiving license.
You add a new key to specify the type of archiving task that is to perform the
filtering. The key can be one of the following:
Mailbox
Journaling
PublicFolder
Filtering APIs
Exchange Filtering API
For example, to add filtering for the Exchange Mailbox archiving tasks, you add
the Mailbox key:
HKEY_LOCAL_MACHINE
\SOFTWARE
\Wow6432Node
\KVS
\Enterprise Vault
\External Filtering
\Mailbox
You then add a string value to the Mailbox key for each of the required external
filters. For the name of each filter entry, use the values, 1, 2, 3 and so on. If there
are multiple filters, the filter names should form an unbroken numerical sequence.
The filters are applied in numerical order. If one number is missing, no further
filters are applied.
The following example shows three external filters that have been configured for
the Exchange Mailbox archiving tasks.
HKEY_LOCAL_MACHINE
\SOFTWARE
\Wow6432Node
\KVS
\Enterprise Vault
\External Filtering
\Mailbox
1 = ACompany.Filter1
2 = ACompany.Filter2
4 = ACompany.Filter3
In this case, filter 1 is applied and then filter 2. However, filter processing stops
after filter 2 because the filter name sequence is broken.
Note: When configuring filtering for Exchange journaling tasks, if the Compliance
Accelerator Journaling Connector filter exists, it must be last in the sequence.
For the value of each filter entry give the ProgID (ProjectName.ClassName) of
the COM class implementing IExternalFilter for this particular filter, as defined
in the external filter class registration (.rgs) file. For example:
HKCR
{
EV10FilterVersion.SampleFilterClass.1 = s 'SampleFilterClass Class'
{
353
354
Filtering APIs
Exchange Filtering API
CLSID = s '{B5FFF252-D74C-4723-B812-41E15B4C57EF}'
}
EV10FilterVersion.SampleFilterClass = s 'SampleFilterClass Class'
{
CLSID = s '{B5FFF252-D74C-4723-B812-41E15B4C57EF}'
CurVer = s 'EV10FilterVersion.SampleFilterClass.1'
}
NoRemove CLSID
{
ForceRemove {B5FFF252-D74C-4723-B812-41E15B4C57EF} = s
'SampleFilterClass Class'
{
ProgID = s 'EV10FilterVersion.SampleFilterClass.1'
VersionIndependentProgID = s
'EV10FilterVersion.SampleFilterClass'
ForceRemove 'Programmable'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
val AppID = s '%APPID%'
'TypeLib' = s '{24798ABC-A921-462a-9964-536E8C37E0A3}'
}
}
}
In the above example, you would use the following value in the filter registry
setting:
HKEY_LOCAL_MACHINE
\SOFTWARE
\Wow6432Node
\KVS
\Enterprise Vault
\External Filtering
\Mailbox
1 = EV10FilterVersion.SampleFilterClass.1
The following optional DWORD values can also be created to control filtering:
Exchange Journaling tasks. If created under the Journaling key, and given
the value, 1, this setting forces the Exchange Journaling tasks to retry
messages that were marked as MARK_DO_NOT_ARCHIVE by a previous
filter.
Filtering APIs
Exchange Filtering API
If the value is 0, or the setting does not exist, the Exchange Journaling tasks
do not retry messages that are marked as MARK_DO_NOT_ARCHIVE.
Exchange Mailbox and Public Folder tasks. If created under the Maibox or
PublicFolder keys, and given the value, 1, this setting turns off custom
filtering.
If the value is 0, or the setting does not exist, the archiving tasks implement
the configured custom filters.
If you make changes to the custom filtering registry settings, restart the associated
archiving tasks to implement the changes.
For further details of the filtering registry settings, see the Configuring custom
filtering chapter in the the manual, Setting Up Exchange Server Archiving.
355
356
Filtering APIs
Enumerations (Exchange filtering)
You can use Dtrace to trace the Enterprise Vault archiving task that is enabled
for external filtering. The following Dtrace filter options are useful for verifying
that external filtering is working as expected, and for diagnosing problems:
DT>f
Manage trace entry filter....(? for help)
DT Filter>v
Current Filter Settings:
Include strings:
ExternalFiltering
EVFilterController
For a description of the Dtrace utility, see the Enterprise Vault Utilities guide.
EV_ACTION enumeration
The following enumeration values are defined for EV_ACTION:
enum EV_ACTION
{
NO_ACTION = 0,
ARCHIVE_ITEM = 1,
MARK_DO_NOT_ARCHIVE = 2,
MOVE_DELETED_ITEMS = 3,
HARD_DELETE = 4,
REQUEST_SHUTDOWN = 5
};
EV_ATTACHMENT_ACTION enumeration
The following enumeration values are defined for EV_ATTACHMENT_ACTION:
enum EV_ATTACHMENT_ACTION
{
NO_ATTACHMENT_ACTION = 0,
DELETE_ATTACHMENT = 1,
Filtering APIs
Enumerations (Exchange filtering)
REPLACE_ATTACHMENT = 2
};
If the attachment action is to replace attachments, users will see a file called
Deleted Attachments.txt attached to messages that have had attachments
deleted by the filter. When they open this file, it contains a list of the names of
files that have been deleted.
The contents of this file are taken from the file, CF_Replace_Attachment.txt, in
the Enterprise Vault program folder (typically, C:\Program Files\Enterprise
Vault). If required, you can modify the text of this file. For example, you may want
to localize the descriptive text.
EV_RETRY_STATUS enumeration
The following enumeration values are defined for EV_RETRY_STATUS:
enum EV_RETRY_STATUS
{
UNKNOWN_IF_RETRY = 0,
IS_NOT_RETRY = 1,
IS_A_RETRY = 2
};
UNKNOWN_IF_RETRY does not indicate an error; it indicates that the task could
not determine if the status was a retry. For example, this may be returned if the
archiving task does not support detecting retries. Filters should interpret an
UNKNOWN_IF_RETRY status as IS_NOT_RETRY.
EV_REARCHIVE_STATUS enumeration
The following enumeration values are defined for EV_REARCHIVE_STATUS:
enum EV_REARCHIVE_STATUS
{
UNKNOWN_IF_REARCHIVE = 0,
IS_NOT_REARCHIVE = 1,
IS_A_REARCHIVE = 2
};
357
358
Filtering APIs
IExternalFilter interface
IExternalFilter interface
An external filter implements the following interface:
IExternalFilter
Syntax
interface IExternalFilter : IDispatch
Member summary
Table 6-1
Member summary
Method
Description
Initialize
ProcessFilter
FilteringComplete This method is called after all filters have been processed for the
current item.
Remarks
The external filter must implement the COM interface, IExternalFilter, which is
called by the task filter controller.
All methods must be implemented, even if they return only S_OK.
If the filter makes changes to the message, and the changes are to be reflected in
the Exchange Server store or the Enterprise Vault archive or both, then call the
IArchivingControl2 :: MAPISaveChanges method at the end of the method
Filtering APIs
IExternalFilter :: Initialize
IExternalFilter :: Initialize
This method is called during Exchange archiving task initialization.
Syntax
HRESULT Initialize([in] IDispatch *pArchivingControl);
Parameters
[in] IDispatch *pArchivingControl
Remarks
Filters are instantiated at task startup and released at task shutdown.
The filter should perform any necessary initialization before message processing
begins. The interface does not define a corresponding "Uninitialize" method, so
any resources created or opened in this method should be released on the final
release of the filter implementing the interface.
IExternalFilter :: ProcessFilter
This method is called per-message during the archiving process. The ProcessFilter
method is where you process the message to your requirements.
Syntax
HRESULT ProcessFilter([out, retval] VARIANT_BOOL
*bStopFiltering);
Parameters
[out, retval] VARIANT_BOOL *bStopFiltering
359
360
Filtering APIs
IExternalFilter :: FilteringComplete
Remarks
To get a reference to the message, use the IArchivingControl :: MAPIMessage
property.
To find or change the current action to be taken on the message, use the
IArchivingControl :: Action property.
Similarly to change the retention category or archive for the item, use the
currentRetentionCategoryId and currentVaultId properties on the
IArchivingControl interface.
The external filter must be written to handle concurrent calls. If the filter accesses
a shared resource, it must use appropriate concurrency protection.
See also
IExternalFilter :: FilteringComplete
This method is called after all filters have been processed for the current item. It
can be used to clean up item-specific resources, such as memory or object handles.
Syntax
HRESULT FilteringComplete();
Remarks
After processing has been completed, the properties on the IArchivingControl
interface are read-only. The properties can still be examined so that the filter can
determine the final state of the item.
IArchivingControl
IArchivingControl2
Filtering APIs
IArchivingControl interface for Exchange filtering
IArchivingControl3
IArchivingControl4
Syntax
interface IArchivingControl : IDispatch
interface IArchivingControl2 : IArchivingControl
interface IArchivingControl3 : IArchivingControl2
interface IArchivingControl4 : IArchivingControl3
Member summary
Table 6-2
IArchivingControl properties
Property
Read/Write
Description
currentVaultId
Read/Write
currentRetentionCategoryId
Read/Write
361
362
Filtering APIs
IArchivingControl interface for Exchange filtering
Table 6-2
Property
Read/Write
Description
defaultRetentionCategoryId
Read only
deleteOriginalItem
Read/Write
createShortcutToItem
Read/Write
Action
Read/Write
MAPISession
Read only
MAPIMessage
Read only
IndexedPropertiesSet
Read only
TransactionID
Read only
AgentType
Read only
AgentAssignedRetentionCategoryId
Read only
AgentAssignedVaultId
Read only
AttachmentAction
Read/Write
RetryStatus
Read only
Filtering APIs
IArchivingControl interface for Exchange filtering
Table 6-2
Property
Read/Write
Description
ReArchiveStatus
Read only
Table 6-3
IArchivingControl2 properties
Property
Read/Write
Description
BrowserViewURL
Read only
Provides a URL
that can be used to
present an HTML
view of the original
item.
NativeItemURL
Read only
Provides a URL
that can be use to
fetch the original
item.
MessageClass
Read only
Identifies the
original value of
the MAPI Message
Class property.
Table 6-4
IArchivingControl methods
Method
Description
AddIndexedProperty
AddIndexPropertyToSet
363
364
Filtering APIs
IArchivingControl interface for Exchange filtering
Table 6-4
Method
Description
AddIndexPropertySet
GetFilterProperty
PutFilterProperty
Table 6-5
IArchivingControl2 method
Method
Description
MAPISaveChanges
Enables
changes to
the current
message to
be saved.
Table 6-6
IArchivingControl3 properties
Method
Description
SenderRecipientXML
EnvelopeSenderRecipientXML
MessageDirection
Table 6-7
IArchivingControl4 method
Method
Description
AddIndexedPropertyEx
Filtering APIs
IArchivingControl :: currentVaultId
Version information
IArchivingControl :: currentVaultId
The Id of the archive associated with the current item.
This property is read/write.
Syntax
HRESULT currentVaultId([in] BSTR newVal);
HRESULT currentVaultId([out, retval] BSTR *pVal);
Parameters
[in] BSTR newVal
Id of archive to be assigned.
Id of archive assigned.
Remarks
The currentVaultId property enables an external filter to control the archive (or
folder) in which the item is stored. Although a subsequent filter may actually
redefine this value. The value originally assigned can be retrieved using the
AgentAssignedVaultId property.
An example value is:
190901BF3D1D1364084C418053F8122C31110000EVArchiveSite1
IArchivingControl :: currentRetentionCategoryId
The Enterprise Vault retention category to be assigned to the current item.
This property is read/write.
365
366
Filtering APIs
IArchivingControl :: defaultRetentionCategoryId
Syntax
HRESULT currentRetentionCategoryId([in] BSTR newVal);
HRESULT currentRetentionCategoryId([out, retval] BSTR *pVal);
Parameters
[in] BSTR newVal
Remarks
The currentRetentionCategoryId property enables the external filter to get and
set the retention category that is to be applied to the item when it is stored. The
value originally assigned can be retrieved using the
AgentAssignedRetentionCategoryId property.
An example value is:
18306BF113C2C444096279660836252821b10000EVArchiveSite1
Use the Retention API to retrieve details of retention categories, and create new
retention categories.
See About Retention API on page 562.
IArchivingControl :: defaultRetentionCategoryId
The default retention category for the Enterprise Vault Site.
This property is read only.
Syntax
HRESULT defaultRetentionCategoryId([out, retval] BSTR
*pVal);
Parameters
[out, retval] BSTR *pVal Id of default retention category for site.
Filtering APIs
IArchivingControl :: deleteOriginalItem
Remarks
The defaultRetentionCategoryId property enables the external filter to get the
default retention category for the Enterprise Vault Site.
IArchivingControl :: deleteOriginalItem
This property indicates whether the item is to be deleted from the original location
after it has been archived.
This property is read/write.
Syntax
HRESULT deleteOriginalItem([in] BOOL newVal);
HRESULT deleteOriginalItem([out, retval] BOOL *pVal);
Parameters
[in] BOOL newVal
New value.
Remarks
When the archiving task is running in report mode, the action is ignored.
IArchivingControl :: createShortcutToItem
This property indicates whether a shortcut is created in the original location after
the item has been archived.
This property is read/write.
Syntax
HRESULT createShortcutToItem([in] BOOL newVal);
HRESULT createShortcutToItem([out, retval] BOOL *pVal);
Parameters
[in] BOOL newVal
New value.
367
368
Filtering APIs
IArchivingControl :: Action
Remarks
When the task is running in report mode the action is ignored.
IArchivingControl :: Action
This property indicates the action to be taken by the archiving task when the
filtering process is complete.
This property is read/write.
Syntax
HRESULT Action([in] EV_ACTION newVal);
HRESULT Action([out, retval] EV_ACTION *pVal);
Parameters
[in] EV_ACTION newVal
Remarks
See EV_ACTION enumeration on page 356.
The default action is to archive the item (ARCHIVE_ITEM enumeration value).
IArchivingControl :: MAPISession
This property returns a MAPI session for the current message.
This property is read only.
Syntax
HRESULT MAPISession([out, retval] IUnknown **pUnkVal);
Filtering APIs
IArchivingControl :: MAPIMessage
Parameters
[out, retval] IUnknown **pUnkVal
IArchivingControl :: MAPIMessage
This property provides a pointer to the current MAPI message (P2).
This property is read only.
Syntax
HRESULT MAPIMessage([out, retval] IUnknown **pUnkVal);
Parameters
[out, retval] IUnknown **pUnkVal
Remarks
The properties of the message can be accessed and updated using standard MAPI
calls. Any changes should be persisted using MAPISaveChanges at the end of the
method (ProcessFilter or FilteringComplete) that made the changes to the message.
As MAPISaveChanges does not save changes made to attachments of P2 messages,
these will have to be saved first by the caller.
See also
IArchivingControl :: AddIndexedProperty
This method enables you to add a property to the custom index metadata for the
item.
Note: This method is deprecated, and may not be supported in a future release.
Use IArchivingControl4::AddIndexedPropertyEx to add custom index properties.
See IArchivingControl4 :: AddIndexedPropertyEx on page 385.
369
370
Filtering APIs
IArchivingControl :: IndexedPropertiesSet
Syntax
HRESULT AddIndexedProperty([in] BSTR propname,
[in] BSTR value);
Parameters
[in] BSTR propname
Property name.
Property value.
Remarks
Using this method adds the property to the default property set.
Properties added using this method are always searchable and retrievable.
To avoid property name clashes, you are recommended to add the property to a
named property set. This will also enable you to control whether the property is
searchable and retrievable.
IArchivingControl :: IndexedPropertiesSet
This property lists the custom index properties that have been added to the item.
The property is read only.
Syntax
HRESULT IndexedPropertiesSet([out, retval] BSTR *pVal);
Parameters
[out, retval] BSTR *pVal
Remarks
The properties are returned as XML which can be loaded into an
ISimpleIndexMetadata object using the FromXML method.
See ISimpleIndexMetadata :: FromXML on page 267.
Filtering APIs
IArchivingControl :: AddIndexPropertyToSet
IArchivingControl :: AddIndexPropertyToSet
This method adds a custom index metadata property to a named property set.
Note: This method is deprecated, and may not be supported in a future release.
Use IArchivingControl4::AddIndexedPropertyEx to add custom index properties.
See IArchivingControl4 :: AddIndexedPropertyEx on page 385.
Syntax
HRESULT AddIndexPropertyToSet([in] BSTR setname,
[in] BSTR propname,
[in] BSTR propvalue);
Parameters
[in] BSTR setname
Name of property.
Value of property.
Remarks
The searchable and retrievable settings for the property set will define how the
property is handled.
If the property set exists, the property will be added to that property set. If it does
not exist, the property set will be created first.
If a property set is created "by default", it will have the default attributes of
searchable ="true" and retrievable ="false".
If a property needs to be retrievable, the property set needs to be created, where
the values for searchable and retrievable can be set explicitly.
Properties can be multi-valued. When adding a property, the existence of that
property within the specified set is checked and, if present, the value is added as
an element of that property.
371
372
Filtering APIs
IArchivingControl :: AddIndexPropertySet
IArchivingControl :: AddIndexPropertySet
This method adds a named custom property set.
Note: This method is deprecated, and may not be supported in a future release.
Use IArchivingControl4::AddIndexedPropertyEx to add custom index properties.
See IArchivingControl4 :: AddIndexedPropertyEx on page 385.
Syntax
HRESULT AddIndexPropertySet([in] BSTR setname,
[in] BOOL searchable,
[in] BOOL retrievable);
Parameters
[in] BSTR setname
Remarks
Properties added can be grouped in named property sets. It is good practice to use
a named property sets in order to avoid name clashes with other filter additions.
The property set names, Vault, EnterpriseVault, KVS, Veritas, and Symantec are
reserved.
Properties defined as Searchable can be searched for using the Search API.
Properties defined as Retrievable can be retrieved and displayed later with the
item. Each property set can be marked as Searchable or Retrievable or both.
See SimpleIndexMetadata object on page 256.
Property sets do not need to be created before properties are added to them.
Filtering APIs
IArchivingControl :: TransactionID
IArchivingControl :: TransactionID
This property is the unique identifier that will be assigned to the archived item.
The property is read only.
Syntax
HRESULT TransactionID([out, retval] BSTR* pTransactionID);
Parameters
[out, retval] BSTR* pTransactionID
Transaction Id.
Remarks
This property can be used as the IItem :: Id value in the Content Management API
to subsequently fetch the archived item.
See also
IArchivingControl :: AgentType
This property identifies the type of the current archiving task.
The property is read only.
Syntax
HRESULT AgentType([out, retval] BSTR* pVal);
Parameters
[out, retval] BSTR* pVal
Remarks
The value can be one of the following:
373
374
Filtering APIs
IArchivingControl :: AgentAssignedRetentionCategoryId
Mailbox
Journaling
PublicFolder
IArchivingControl ::
AgentAssignedRetentionCategoryId
This property identifies the original retention category assigned, in case other
filters have assigned a different retention category.
The property is read only.
Syntax
HRESULT AgentAssignedRetentionCategoryId([out, retval] BSTR*
pVal);
Parameters
[out, retval] BSTR* pVal
Remarks
Use the Retention API to retrieve details of retention categories, and create new
retention categories.
See About Retention API on page 562.
IArchivingControl :: AgentAssignedVaultId
This property identifies the original destination archive, in case other filters have
redirected the message to an alternative archive.
The property is read only.
Syntax
HRESULT AgentAssignedVaultId([out, retval] BSTR* pVal);
Parameters
[out, retval] BSTR* pVal
Archive Id.
Filtering APIs
IArchivingControl :: GetFilterProperty
IArchivingControl :: GetFilterProperty
This method enables communication between filters; a filter property can be set
by one filter and queried by another.
Syntax
HRESULT GetFilterProperty([in] BSTR Key);
HRESULT GetFilterProperty([out, retval] BSTR *pVal);
Parameters
[in] BSTR Key
[out, retval] BSTR *pVal Pointer to a string containing the value of Setting (set
with PutFilterProperty).
Remarks
The GetFilterProperty and PutFilterProperty methods facilitate communication
between filters; a filter may set a property value which a later filter can then
query. Once a property value is set, it will be passed down to each filter.
The method uses the Key, (used by PutFilterProperty), to retrieve the Setting value
that was set with PutFilterProperty method.
The setting can be set by separate filters, so the order in which they are called is
important.
If called with a Key that has not been set, then it will return an empty string, but
will not return an error.
IArchivingControl :: PutFilterProperty
This method is used to set a filter property that is passed on to subsequent filters.
Syntax
HRESULT PutFilterProperty ([in] BSTR Key,
[in] BSTR Setting);
375
376
Filtering APIs
IArchivingControl :: AttachmentAction
Parameters
[in] BSTR Key
Remarks
The caller supplies a unique name (Key) for each setting that can then be retrieved
using GetFilterProperty.
The property values exist until filtering is completed for the current item.
Settings can be updated by calling PutFilterProperty a second time, suppling the
same key. The keys are case insensitive.
Its not possible to delete filter settings, but they can be set to empty.
IArchivingControl :: AttachmentAction
This property defines the action to be taken when processing attachments to
messages.
This property is read/write.
Syntax
HRESULT AttachmentAction([in] EV_ATTACHMENT_ACTION newVal);
HRESULT AttachmentAction([out, retval] EV_ATTACHMENT_ACTION *pVal);
Parameters
[in] EV_ATTACHMENT_ACTION newVal
Pointer to an
EV_ATTACHMENT_ACTION
type that contains the current
value.
Remarks
Caution: This property is not currently supported.
Filtering APIs
IArchivingControl :: RetryStatus
With Exchange server filtering, if the message attributes satisfy a rule, any
attachments are then evaluated using attachment attributes. When an attachment
matches a rule, the action specified by ATTACHMENT_ACTION is applied to the
attachment.
See EV_ATTACHMENT_ACTION enumeration on page 356.
IArchivingControl :: RetryStatus
This property enables the caller to determine if the current attempt to archive an
item is a retry.
The property is read only.
Syntax
HRESULT RetryStatus([out, retval] EV_RETRY_STATUS* pRetryStatus
Parameters
[out, retval] EV_RETRY_STATUS* pRetryStatus
Pointer to an
EV_RETRY_STATUS type
containing the current
value.
Remarks
Sometimes when an item fails to be archived, the item will be subsequently retried
by the archiving task. In this case, the item will also be refiltered.
If this is a retry, the transactionID will typically be the same as the previous
attempt.
This property can be used to avoid the following when processing retries:
See also
377
378
Filtering APIs
IArchivingControl :: ReArchiveStatus
IArchivingControl :: ReArchiveStatus
If an item has been restored and is being rearchived, this property enables the
caller to determine if the current item is being rearchived.
The property is read only.
Syntax
HRESULT ReArchiveStatus([out, retval] EV_REARCHIVE_STATUS*
pReArchiveStatus);
Parameters
[out, retval] EV_REARCHIVE_STATUS* pReArchiveStatus
Pointer to an
EV_REARCHIVE
_STATUS type
containing the
current value.
Remarks
If this is a rearchive, the transactionID will typically be the same as the previous
archive transaction.
This property can be used to avoid the following when processing rearchive
transactions:
IArchivingControl2 :: BrowserViewURL
This property returns a string containing the URL that should be entered into a
web browser (for example) to view the item.
The property is read only.
Syntax
HRESULT BrowserViewURL([out,retval] BSTR* pVal)
Filtering APIs
IArchivingControl2 :: NativeItemURL
Parameters
[out,retval] BSTR* pVal
Remarks
This property will return an error if the archive Id and the saveset Id have not
been set previously.
The URL returned includes the IIS virtual directory for the Enterprise Vault Web
access application, but not a specific Web server name. Enterprise Vault
dynamically generates the full URL as needed, with the appropriate server name
for each caller.
This form of URL is compatible with Enterprise Vault Building Blocks architecture.
Return value
S_OK
Success.
E_FAIL
E_INVALIDARG
Either the archive Id or saveset Id have not been set or the saveset Id
is invalid.
Example
The following is an example value of BrowserViewURL:
http://webserver1.EXAMPLE.COM/EnterpriseVault/viewmessage.asp?Vault
ID=12B72E5122E1D714893C625CEF3A762311110000sv1.example.com&SavesetI
D=430D7CD1EA644810ADF10D71CF39063&Format=WEB
IArchivingControl2 :: NativeItemURL
The URL downloads the item that was archived and attempts to open the item
using the default application for the type of the item.
This property is read only.
Syntax
HRESULT NativeItemURL([out, retval] BSTR* pVal);
379
380
Filtering APIs
IArchivingControl2 :: MessageClass
Parameters
[out, retval] BSTR* pVal A pointer to a BSTR that will contain the current value.
Remarks
There will be an error if either the item Id or the archive Id have not been set
before using this property.
The URL returned includes the IIS virtual directory for the Enterprise Vault Web
access application, but not a specific Web server name. Enterprise Vault
dynamically generates the full URL as needed, with the appropriate server name
for each caller.
This form of URL is compatible with Enterprise Vault Building Blocks architecture.
Return value
S_OK
Success.
E_INVALIDARG
E_POINTER
Example
The following is an example value of NativeItemURL:
http://webserver1.EXAMPLE.COM/EnterpriseVault/download.asp?VaultID=
12B72E5122E1D714893C625CEF3A762311110000sv1.example.com&SavesetID=4
30D7CD1EA644810ADF10D71CF39063&Request=NativeItem
IArchivingControl2 :: MessageClass
This property returns the MAPI Message Class for the current item.
This property is read only.
Syntax
HRESULT MessageClass([out, retval] BSTR *pVal);
Filtering APIs
IArchivingControl2 :: MAPISaveChanges
Parameters
[out, retval] BSTR *pValPointer to a string containing the MAPI message class.
Remarks
The value of the MAPI property, OriginalMessageClass, is returned if it exists.
Otherwise the value of PR_MESSAGE_CLASS is returned.
If the current item is an envelope journal message (P1), then the Message Class
is returned from the P2 message.
Example
An example of a MAPI Message Class is:
IPM.Note
IArchivingControl2 :: MAPISaveChanges
This method persists changes to the current message.
Syntax
HRESULT MAPISaveChanges();
Remarks
If the external filter makes changes to the message or message envelope, save the
changes by calling the MAPISaveChanges method at the end of the method
(ProcessFilter or FilteringComplete) that made the changes to the message. The
changes are saved in the Exchange Store. If the item is then archived, the changes
are also saved in the archive. It is not possible to save changes in the archive but
not in the Exchange Store.
MAPISaveChanges saves changes made to the following:
The P2 message.
The P1 message.
381
382
Filtering APIs
IArchivingControl3 :: SenderRecipientXML
IArchivingControl3 :: SenderRecipientXML
This property retrieves an XML document containing the sender and recipient
information for the current message.
The property is read only.
Syntax
HRESULT SenderRecipientXML([out, retval] IUnknown **ppStream);
Remarks
For Exchange Journaling tasks any distribution lists are expanded, regardless of
the setting of the Expand distribution lists setting on the Advanced page of the
Exchange Journaling policy in the Enterprise Vault Administration Console.
The property value is an XML document representing the sender and recipient
information for the current message, including expanded distribution lists.
For Exchange envelope journal items this information is extracted from the P2
message and is just a representation of the sender and recipient information as
taken from the MAPI message.
The return object implements IStream and can be loaded into an
XMLDOMDocument. The only available IStream methods available are IStream
:: CopyTo, IStream :: Read, IStream :: Seek and IStream :: Stat. All other methods
return E_NOTIMPL.
Example
<?xml version="1.0" encoding="UTF-16"?>
<ARCHIVED_ITEM xmlns:o="urn:kvsplc-com:archived_item"
version="1.0">
<MSG>
<RECP>
<TO>
<RC>
<DN>Display Name</DN>
<EA>SMTP Email Address</EA>
</RC>
<DL>
<DN>Distribution List Display Name</DN>
<EA>Distribution List SMTP Email Address</EA>
<TIME>2007-09-03T23:36:28</TIME>
<RC>
Filtering APIs
IArchivingControl3 :: EnvelopeSenderRecipientXML
<DN>User1</DN>
<EA>SMTP Email Address</EA>
</RC>
</DL>
</TO>
<CC/>
<BCC/>
</RECP>
<AUTH>
<FROM>
<DN>Display Name</DN>
<EA>SMTP Email Address</EA>
</FROM>
</AUTH>
</MSG>
</ARCHIVED_ITEM>
IArchivingControl3 :: EnvelopeSenderRecipientXML
This property retrieves an XML document containing the sender and recipient
information taken from the envelope message.
The property is read only.
Syntax
HRESULT EnvelopeSenderRecipientXML([out, retval] IUnknown
**ppStream);
Remarks
This property is only available for Exchange envelope journal items. Any
distribution lists are expanded, regardless of the setting of the Expand distribution
lists setting on the Advanced page of the Exchange Journaling policy in the
Enterprise Vault Administration Console.
The property value is an XML document representing the sender and recipient
information for the current message, including expanded distribution lists. The
recipient information as taken from the envelope report and does not contain
information from the P2 message.
The return object implements IStream and can be loaded into an
XMLDOMDocument. The only available IStream methods available are IStream
:: CopyTo, IStream :: Read, IStream :: Seek and IStream :: Stat. All other methods
return E_NOTIMPL.
383
384
Filtering APIs
IArchivingControl3 :: EnvelopeSenderRecipientXML
Example
<?xml version="1.0" encoding="UTF-16"?>
<ARCHIVED_ITEM xmlns:o="urn:kvsplc-com:archived_item"
version="1.0">
<MSG>
<RECP P1="true">
<TO>
<RC>
<DN>Display Name</DN>
<EA>SMTP Email Address</EA>
</RC>
<DL>
<DN>Distribution List Display Name</DN>
<EA>Distribution List SMTP Email Address</EA>
<RC>
<DN>User1</DN>
<EA>SMTP Email Address</EA>
</RC>
</DL>
</TO>
<CC/>
<BCC>
<RC>
<DN>Display Name</DN>
<EA>SMTP Email Address</EA>
</RC>
</BCC>
<ENV>
<RC>
<DN>Display Name</DN>
<EA>SMTP Email Address</EA>
</RC>
</ENV>
</RECP>
<AUTH P1="true">
<FROM>
<DN>Display Name</DN>
<EA>SMTP Email Address</EA>
</FROM>
</AUTH>
</MSG>
</ARCHIVED_ITEM>
Filtering APIs
IArchivingControl3 :: MessageDirection
IArchivingControl3 :: MessageDirection
This property indicates the direction in which the message was travelling (in
relation to the domain defined as internal).
Syntax
HRESULT MessageDirection([out, retval] MSG_DIRECTION
*Msg_Direction);
Remarks
The property value is an enumerated value.
See Message direction enumeration on page 358.
This property is read only.
IArchivingControl4 :: AddIndexedPropertyEx
This method lets you add a custom index property to an item before it is archived.
The method also lets you create the named property set to which the custom index
property is added.
You can specify the custom index property value as a string, integer, or date.
Specifying the property value as a date allows you to search on the custom index
property using date-based selection criteria, such as the date that the item was
archived (created) or modified by Enterprise Vault.
Syntax
HRESULT AddIndexedPropertyEx([in] BSTR setname,
[in] BSTR propname,
[in] VARIANT propvalue,
[in] VARIANT_BOOL searchable,
[in] VARIANT_BOOL retrievable)
385
386
Filtering APIs
IArchivingControl4 :: AddIndexedPropertyEx
Parameters
[in] BSTR setname
Remarks
Call the method repeatedly to add multiple properties, or add multiple values to
the same property.
Table 6-8 lists the supported variant types for propvalue.
Table 6-8
Value type
Variant type
Note
String
VT_BSTR
Datetime
VT_DATE
Integer
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API..
See Adding custom index metadata on page 72.
Filtering APIs
IArchivingControl4 :: AddIndexedPropertyEx
If you use Dtrace to trace the Enterprise Vault archiving task that is enabled for
external filtering, you can specify the following options to trace custom index
properties added using AddIndexedPropertyEx:
DT>f
Manage trace entry filter....(? for help)
DT Filter>v
Current Filter Settings:
Include strings:
ExternalFiltering
EVFilterController
IndexedPropertiesSet
Details of the custom index properties that are added using AddIndexedPropertyEx
are described using XML. The following is an example of the XML encoded custom
index property data generated using AddIndexedPropertyEx:
<?xml version="1.0" encoding="UTF-16"?>
<ARCHIVED_ITEM version="1.0">
<MSG>
<PROPSETLIST>
<PROPSET NAME="PS_EX">
<PROP NAME="PV_STR" SEARCH="y" RESULTS="n">
<VALUE>Legal</VALUE>
</PROP>
<PROP NAME="PV_DATE" SEARCH="y">
<VALUE type="VT_DATE">2011-09-27T09:51:55Z</VALUE>
</PROP>
<PROP NAME="PV_INT" SEARCH="y" RESULTS="n">
<VALUE type="VT_I4">10</VALUE>
<VALUE type="VT_UI4">100</VALUE>
</PROP>
</PROPSET>
</PROPSETLIST>
</MSG>
</ARCHIVED_ITEM>
VALUE type attributes are only set for dateTime and integer value types. These
attributes are not set for the default value type, string.
387
388
Filtering APIs
IArchivingControl4 :: AddIndexedPropertyEx
SEARCH and RESULT attributes are set at PROP element level, not PROPSET
level. They are only present if the value is not the default value. The default values
for SEARCH and RESULT attributes are SEARCH = "n", RESULTS = "y".
dateTime values are specified in UTC "yyyy-mm-ddThh:mm:ssZ" format. No time
zone offset value is specified.
Return value
E_INVALIDARG
C++ examples
Adding a new searchable, non-retrievable, string value type custom index property:
HRESULT hr (S_OK);
CComPtr<IArchivingControl4>
spArchControl;
Adding a new searchable, retrievable, date value type custom index property:
DATE dateNow = 0;
SYSTEMTIME stNow = {0};
::GetSystemTime(&stNow);
::SystemTimeToVariantTime(&stNow, &dateNow);
_variant_t varDate = _variant_t(dateNow,VT_DATE);
hr = spIArchControl->AddIndexedPropertyEx(_bstr_t(L"PS_EX"),
_bstr_t(L"PV_DATE"), varDate, VARIANT_TRUE, VARIANT_TRUE);
Filtering APIs
Domino Filtering and File System Filtering APIs
VARIANT_FALSE);
ULONG ulValue = 100;
hr = spIArchControl->AddIndexedPropertyEx((_bstr_t(L"PS_EX"),
_bstr_t(L"PV_INT"), _variant_t(ulValue), VARIANT_TRUE,
VARIANT_FALSE);
IExternalFilter
IArchivingControl
The IFileArchivingControl and ILotusArchivingControl interfaces are derived
from IArchivingControl, and refine the interface for the different archiving
target stores.
IIndexMetadata
IIndexProperty
IKeyedList
Additional properties can be added to the Enterprise Vault index for the
message.
The action defined for the task can be to archive the message, mark it as "do
not archive", or delete it.
Marking messages reduces the overhead on the archiving task, as these
messages are not re-evaluated during subsequent archiving runs, unless the
Override registry setting is configured.
See Domino filtering registry settings
389
390
Filtering APIs
Domino Filtering and File System Filtering APIs
Figure 6-2
Enterprise Vault
Domino Journaling
task
Vault
store
Modified contents
External
filter 1
ProcessFilter()
Task Filter
Controller
Modified contents
The figure, Figure 6-2, illustrates how Enterprise Vault implements Domino journal
filters:
If the registry settings are configured to enable filtering for the Domino
Journaling tasks, the Domino Journaling task calls the task filter controller
when processing a message in the Domino journal database.
The task filter controller invokes the first external filter, which implements
the IExternalFilter interface.
The filter then processes the message. Methods and properties on the
ILotusArchivingControl interface enable you to define how the Domino
Journaling task is to process the message.
If there are several filters, each external filter is applied in turn to the message,
provided the stopFiltering parameter is not set to TRUE.
After all the filters have been applied, the FilteringComplete method for each
filter is called to perform any clean up tasks.
The Domino Journaling task then processes the message according to the
properties set by the external filters.
Filtering APIs
Domino Filtering and File System Filtering APIs
Apply the policy that is associated with the volume or folder in which the file
is located.
Archive the file and delete the original, without creating a shortcut.
Only the following subset of filter actions can be applied when processing such
files:
Create a shortcut.
The File System Filtering API requires Enterprise Vault 10.0 or later.
391
392
Filtering APIs
Domino Filtering and File System Filtering APIs
Figure 6-3
File
C
I
F
S
Enterprise Vault
File System Archiving
task
File
Vault
store
Modified contents
cache
External
filter 1
ProcessFilter()
Task Filter
Controller
Modified contents
The figure, Figure 6-3, illustrates how Enterprise Vault implements file system
filters:
If the registry settings are configured to enable filtering for the File System
Archiving task, the archiving task calls the task filter controller when
processing a file in the file system archiving target.
The task filter controller invokes the first external filter, which implements
the IExternalFilter interface.
The filter then processes the file. Methods and properties on the
IFileArchivingControl interface enable you to define how the archiving task
is to process the file.
If the filter makes any modifications to the file, the task filter controller ensures
that the modifications are saved back to the file on the file server using CIFS.
If there are several filters, each external filter is applied in turn to the message,
provided the stopFiltering parameter is not set to TRUE.
After all the filters have been applied, the FilteringComplete method for each
filter is called to perform any clean up tasks.
The File System Archiving task then processes the file according to the
properties set by the external filters.
Filtering APIs
Domino Filtering and File System Filtering APIs
Applied filtering action The archiving task has performed the action defined
by the FSAAction enumeration value.
Performed file stream operation A file or alternate data stream has been
opened to read or write.
Summary information for each external filter is displayed in the report section,
External Filter Summary. The information shows the number of files or alternate
data streams on which the archiving task has performed each filter action. Failure
to load a filter is also reported in this section.
If files that have already been archived are processed by a filter, only the filtering
action can be applied. Therefore only Applied filtering action is reported for
these files.
Symantec.EnterpriseVault.FilterInterfaces.dll
393
394
Filtering APIs
Domino Filtering and File System Filtering APIs
Symantec.EnterpriseVault.FilterInterfaces
You can develop external filters in the programming language of your choice. For
clarity, definitions are given using C#.NET syntax.
An example file system filter in managed C# is provided in the SDK.
For Domino filters, if you want to use the Lotus C API for Lotus Notes/Domino to
access the note, we recommend that you use managed C++. The Lotus C API for
Lotus Notes/Domino is shipped with the Lotus Notes client.
To develop an external filter for Domino journaling, you need to obtain and install
an Enterprise Vault Lotus Domino Journaling license.
To develop an external filter for File System Archiving, you need to obtain and
install an Enterprise Vault File System Archiving license.
If either External Filtering or Lotus Journaling keys do not exist, then you can
create them.
You create a new string entry for each filter under the Lotus Journaling key. Filter
names must be an unbroken numbered sequence starting at 1.
The value of the filter name is a string value that contains the name of the .NET
assembly and the fully qualified filter class name for the new external filter:
PathToFilterAssembly!FilterClassName
A fully-qualified class name includes the namespace. For example, if the class
name is CustomFilter, the namespace is Symantec.EnterpriseVault.Domino,
and the filter is implemented in
Symantec.EnterpriseVault.DominoCustomFilter.dll assembly, then the value
of the registry setting should be as follows:
Symantec.EnterpriseVault.DominoCustomFilter.dll!
Symantec.EnterpriseVault.Domino.CustomFilter
Filtering APIs
Domino Filtering and File System Filtering APIs
then it must be the last in the sequence of filters. When you add other filters, you
must rename the Journaling Connector to ensure that it remains last in the
sequence.
Optionally, you can create a DWORD entry with the name Override, if it does not
exist. Set its value to 0 (zero). This entry controls whether the Domino Journaling
task reexamines any messages that are marked as MARK_DO_NOT_ARCHIVE
each time it processes the Domino journaling location. If the value is 0, or the
Override entry does not exist, then the Domino Journaling task does not reexamine
the messages.
To implement changes to the registry settings, restart the associated Domino
Journaling tasks.
If either External Filtering or File Systemkeys do not exist, then you can create
them.
You create a new string entry for each filter under the File System key. Filter
names must be an unbroken numbered sequence starting at 1.
The value of the filter name is a string value that contains the name of the .NET
assembly and the fully-qualified filter class name for the new external filter:
PathToFilterAssembly!FilterClassName
A fully-qualified class name includes the namespace. For example, if the class
name is CustomFilter, the namespace is Symantec.EnterpriseVault.FileSystem,
and the filter is implemented in
395
396
Filtering APIs
Domino Filtering and File System Filtering APIs
You need to edit the file and add a section called <FSAFilter> to hold the settings.
This section must also be declared in the <configSections> element. The settings
are added as key/value pairs.
The following example shows the file with the settings added:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="FSAFilter"
type="System.Configuration.DictionarySectionHandler"/>
</configSections>
<FSAFilter>
Filtering APIs
Enumerations (Domino filtering)
397
398
Filtering APIs
Enumerations (File System Filtering)
MARK_DO_NOT_ARCHIVE = 2,
HARD_DELETE = 4,
REQUEST_SHUTDOWN = 5
}
Table 6-9
Value
Action
NO_ACTION
ARCHIVE_ITEM
MARK_DO_NOT_ARCHIVE
HARD_DELETE
REQUEST_SHUTDOWN
=
=
=
=
=
=
0,
1,
2,
3,
4,
5,
Filtering APIs
IExternalFilter interface
ARCHIVE_DELETE
= 6
Table 6-10
Value
Action
DEFAULT_POLICYACTION
ARCHIVE_CREATESHORTCUT
ARCHIVE_DONOTCREATESHORTCUT
DONOTARCHIVE
DELETE
REQUEST_SHUTDOWN
ARCHIVE_DELETE
IExternalFilter interface
The external filter must implement the IExternalFilter interface, which is called
by the archiving task filter controller:
Namespace: Symantec.EnterpriseVault.FilterInterfaces
Assembly: Symantec.EnterpriseVault.FilterInterfaces.dll
Syntax
public interface IExternalFilter
399
400
Filtering APIs
IExternalFilter :: Initialize
Member summary
Table 6-11
Member summary
Method
Description
Initialize
ProcessFilter
FilteringComplete Called after all filters have been processed for the current item.
Shutdown
Called during the archiving task shutdown. The filter should perform
any necessary clean-up tasks.
Requirements
IExternalFilter :: Initialize
This method is called during archiving task initialization.
Syntax
void Initialize();
Remarks
Filters are instantiated at task startup and released at task shutdown.
The filter should perform any necessary initialization before item processing
begins.
IExternalFilter :: ProcessFilter
This method is called per-item during the archiving process. The ProcessFilter
method is where you process the item to your requirements.
Syntax
void ProcessFilter(IArchivingControl archivingControl,
ref bool stopFiltering);
Filtering APIs
IExternalFilter :: FilteringComplete
Parameters
IArchivingControl archivingControl
Remarks
The archivingControl reference is used by the filter in the callback to obtain
information about the current item and take appropriate actions.
As the archiving task runs in multiple threads, the external filter must be written
to handle concurrent calls. If the filter accesses a shared resource, it must use
appropriate concurrency protection.
See also
IExternalFilter :: FilteringComplete
This method is called after all filters have been processed.
Syntax
void FilteringComplete();
Remarks
This method can be used to clean up resources used to filter the item.
IExternalFilter :: Shutdown
This method is called during archiving task shutdown.
Syntax
void Shutdown();
401
402
Filtering APIs
IArchivingControl interface
Remarks
The filter should perform any necessary clean-up tasks.
IArchivingControl interface
This task filter controller implements the following interfaces:
IArchivingControl
ILotusArchivingControl
IFileArchivingControl
Namespace: Symantec.EnterpriseVault.FilterInterfaces
Assembly: Symantec.EnterpriseVault.FilterInterfaces.dll
The methods properties of the interfaces enable an external filter to retrieve and
modify properties on the current item.
The ILotusArchivingControl interface is implemented by the Domino archiving
task filter controller, and is passed to the filter on a per-message basis during the
ProcessFilter call. It extends the IArchivingControl interface to provide access to
Domino messages from Domino filters.
See ILotusArchivingControl interface on page 406.
The IFileArchivingControl interface is implemented by the File System archiving
task filter controller, and is passed to the filter on a per-item basis during the
ProcessFilter call. It extends the IArchivingControl interface to provide access to
file system archiving targets from file system archiving filters.
See IFileArchivingControl interface on page 410.
Syntax
public interface ILotusArchivingControl : IArchivingControl
public interface IFileArchivingControl : IArchivingControl
Member summary
Table 6-12
IArchivingControl properties
Property
Read/Write Description
OriginalVaultID
Read only
CurrentVaultID
Read/Write
Filtering APIs
IArchivingControl :: OriginalVaultID
Table 6-12
Property
CurrentRetentionCategoryID Read/Write
IndexData
Read only
FilterProperties
Read only
IArchivingControl :: OriginalVaultID
Retrieves the original archive ID for the current item.
This property is read-only.
Syntax
string OriginalVaultID {get;}
Remarks
This property holds the archive ID originally assigned by the archiving task before
any filters where processed. If a filter changes the target archive for the item, this
property will remain unchanged.
In file system filtering, the value returned is the archive folder Id for the file.
IArchivingControl :: CurrentVaultID
This property retrieves or sets the ID of the archive in which the current item will
be stored.
In file system filtering, the value returned is the archive folder Id for the file.
In Domino filtering, this property is read/write.
In file system filtering, this property is read only. Attempts to set a value will
throw the exception, NotSupportedException.
Syntax
string CurrentVaultID {get; set;}
403
404
Filtering APIs
IArchivingControl :: OriginalRetentionCategoryID
Exception
NotSupportedException
Example
An example value for this property is:
190901BF3D1D1364084C418053F8122C31110000EVArchiveSite1
IArchivingControl :: OriginalRetentionCategoryID
This property holds the original retention category ID for the current item.
This property is read-only.
Syntax
string OriginalRetentionCategoryID {get;}
Remarks
This property holds the Id of the retention category originally assigned by the
archiving task, before any filters where processed. If a filter changes the retention
category for the item, this property will remain unchanged.
IArchivingControl :: CurrentRetentionCategoryID
This property defines the retention category for the current item.
This property is read/write.
Syntax
string CurrentRetentionCategoryID {get; set;}
Remarks
Use this property to set or retrieve the ID of the retention category assigned to
the current item.
An example value is:
18306BF113C2C444096279660836252821b10000EVArchiveSite1
Filtering APIs
IArchivingControl :: IndexData
Exceptions
ArgumentNullException
ArgumentException
IArchivingControl :: IndexData
This property is an instance of the IIndexMetadata interface, and enables access
to the custom index metadata for the current item.
The property is read only.
Syntax
IIndexMetadata IndexData {get;}
Remarks
See also
IArchivingControl :: FilterProperties
This property is an instance of the IKeyedList interface, and enables
communication between multiple filters. For example, a filter property can be set
by one filter and queried by another.
The property is read only.
Syntax
IKeyedList FilterProperties {get;}
Remarks
The properties listed are shared across all filters. These properties are not stored
in Enterprise Vault or reset by Enterprise Vault. The properties can be maintained
across multiple messages, if required.
405
406
Filtering APIs
ILotusArchivingControl interface
See also
ILotusArchivingControl interface
ILotusArchivingControl is derived from the IArchivingControl interface, and
extends the interface to enable filters to access Domino messages.
Namespace: Symantec.EnterpriseVault.FilterInterfaces
Assembly: Symantec.EnterpriseVault.FilterInterfaces.dll
See IArchivingControl interface on page 402.
Member summary
Table 6-13
ILotusArchivingControl properties
Property
Read/Write
Description
Action
Read/Write
NoteHandle
Read only
DatabaseHandle
Read only
DatabaseName
Read only
SenderRecipientXML
Read only
StoreIdentifier
Read only
Direction
Read only
ILotusArchivingControl :: Action
This property defines the filtering action for the current message.
The property is read/write.
Syntax
DominoAction Action {get; set;}
Filtering APIs
ILotusArchivingControl :: NoteHandle
Remarks
The filtering action is defined by the DominoAction enumeration.
See Domino action enumeration on page 397.
The default action is to archive the item (ARCHIVE_ITEM enumeration value).
ILotusArchivingControl :: NoteHandle
This property retrieves the Lotus C API for Lotus Notes/Domino handle to the
current message.
The property is read only.
Syntax
IntPtr NoteHandle {get;}
Remarks
This handle must not be closed by the filter.
ILotusArchivingControl :: DatabaseHandle
This property retrieves the Lotus C API for Lotus Notes/Domino handle to the
current database.
The property is read only.
Syntax
IntPtr DatabaseHandle {get;}
Remarks
This handle must not be closed by the filter.
ILotusArchivingControl :: DatabaseName
This property retrieves the current Domino journal database path.
The property is read only.
407
408
Filtering APIs
ILotusArchivingControl :: SenderRecipientXML
Syntax
string DatabaseName {get;}
Remarks
This path is relative to the Data folder.
ILotusArchivingControl :: SenderRecipientXML
This property retrieves an XML document containing the sender and recipient
information for the current message.
The property is read only.
Syntax
XmlDocument SenderRecipientXML {get;}
Remarks
Any distribution lists are expanded, regardless of the setting of the Expand
distribution lists setting on the Advanced page of the Domino Journaling policy
in the Enterprise Vault Administration Console.
The property value is an XML document representing the sender and recipient
information for the current message, including expanded distribution lists.
This document is described by the following DTD:
<!ELEMENT MSG (RECP, AUTH)>
<!ELEMENT RECP (TO, CC, BCC)>
<!ELEMENT TO RC*, DL*)>
<!ELEMENT CC (RC*, DL*)>
<!ELEMENT BCC (RC*, DL*)>
<!ELEMENT RC (DN, EA+)>
<!ELEMENT DN (#PCDATA)>
<!ELEMENT EA (#PCDATA)>
<!ELEMENT DL (DN, EA, RC*)>
<!ELEMENT AUTH (FROM, PP)>
<!ELEMENT FROM (DN, EA)>
<!ELEMENT PP (DN?, EA?)>
<!ATTLIST EA TYPE CDATA #REQUIRED>
Filtering APIs
ILotusArchivingControl :: StoreIdentifier
Example
The following is an example of the SenderRecipientXML document:
<!--The <RECP> element lists all the message recipients in TO, CC,
BCC fields. If distribution lists are present, the name and address
of the distribution list is given in the <DL> element and member
addresses are listed in <RC> elements -->
<MSG>
<RECP>
<TO>
<RC>
<DN>Display Name</DN>
<EA TYPE="SMTP">SMTP_address</EA>
<EA TYPE="NOTES">LotusNotes_address</EA>
</RC>
<DL>
<DN>Display Name of DL</DN>
<EA TYPE="NOTES">lotusnotes_address_of_dl</EA>
<RC>
<DN>Display Name of DL Member</DN>
<EA TYPE="NOTES">lotusnotes_address_of_dl_member</EA>
</RC>
</DL>
</TO>
<CC/>
<BCC/>
</RECP>
<!--The <AUTH> element gives the display name, SMTP and Lotus Notes
format addresses for the message author. If the message was sent by
a delegate, the principal person is defined in the <PP> element -->
<AUTH>
<FROM>
<DN>Display Name</DN>
<EA TYPE="NOTES">LotusNotes_address</EA>
</FROM>
<PP/>
</AUTH>
</MSG>
ILotusArchivingControl :: StoreIdentifier
This property uniquely identifies the message.
409
410
Filtering APIs
ILotusArchivingControl :: Direction
Syntax
string StoreIdentifier {get;}
Remarks
The property is derived from the Universal Note ID (UNID) and Originator ID
(OID) that are assigned by the Domino server.
The UNID and OID are defined as follows:
UNID (Universal Note
ID)
ILotusArchivingControl :: Direction
This property indicates the direction in which the message was travelling (in
relation to the domain defined as internal).
Syntax
MSG_DIRECTION Direction {get;}
Remarks
The property value is an enumerated value.
See Message direction enumeration on page 397.
IFileArchivingControl interface
The IFileArchivingControl interface is derived from IArchivingControl, and refines
the interface for file system archiving targets.
Namespace: Symantec.EnterpriseVault.FilterInterfaces
Assembly: Symantec.EnterpriseVault.FilterInterfaces.dll
See IArchivingControl interface on page 402.
Filtering APIs
IFileArchivingControl :: Action
Member summary
Table 6-14
IFileArchivingControl properties
Property
Read/Write
Description
Action
Read/Write
Name
Read/Write
Attributes
Read/Write
LastWriteTimeUtc Read/Write
LastAccessTimeUtc Read/Write
CreationTimeUtc
Read/Write
Length
Read only
StreamNames
Table 6-15
Method
Read only
IFileArchivingControl methods
Description
Open
Reads, writes and searches for the file contents (default stream).
OpenStream
DeleteStream
IFileArchivingControl :: Action
This property defines the filtering action for the current item.
The property is read/write.
411
412
Filtering APIs
IFileArchivingControl :: Name
Syntax
FSAAction Action {get; set;}
Value
Action
Remarks
The filtering action is defined by the FSAAction enumeration.
See File System Archiving action enumeration on page 398.
By default the action taken is the one defined in the policy for the folder or volume
in which the file is located.
Exception
ArgumentOutOfRangeException
IFileArchivingControl :: Name
This property holds the file name of the current item, and can be used to rename
the file.
The property is read/write.
Syntax
string Name {get; set;}
Value
string FileName
Remarks
The value does not include the path to the file.
Filtering APIs
IFileArchivingControl :: Attributes
Exceptions
ArgumentNullException
ArgumentException
PathTooLongException
UnathorizedAccessException
FilterControllerException
Example
string fileName = archivingControl.Name;
// rename file as fileName.txt
archivingControl.Name = fileName + ".txt";
IFileArchivingControl :: Attributes
This property provides the file attributes of the current item.
The property is read/write.
Syntax
System.IO.FileAttributes Attributes {get; set;}
Value
System.IO.FileAttributes Attributes
System.IO.FileAttributes
enumeration value.
413
414
Filtering APIs
IFileArchivingControl :: CreationTimeUtc
Remarks
Setting the following file attributes is not supported:
Directory
Device
Offline
Temporary
Exceptions
UnathorizedAccessException
NoteSupportedException
FilterControllerException
Example
IFileArchivingControl :: CreationTimeUtc
This property provides the date and time (UTC) when the current item was created.
The property is read/write.
Syntax
System.DateTime CreationTimeUtc {get; set;}
Value
System.DateTime CreationTimeUtc
UTC datetime.
Filtering APIs
IFileArchivingControl :: LastAccessTimeUtc
Exceptions
ArgumentOutOfRangeException
UnathorizedAccessException
FilterControllerException
Example
IFileArchivingControl :: LastAccessTimeUtc
This property provides the date and time (UTC) when the current item was last
accessed.
The property is read/write.
Syntax
System.DateTime LastAccessTimeUtc {get; set;}
Value
System.DateTime LastAccessTimeUtc UTC datetime
Exceptions
ArgumentOutOfRangeException
UnathorizedAccessException
415
416
Filtering APIs
IFileArchivingControl :: LastWriteTimeUtc
FilterControllerException
Example
IFileArchivingControl :: LastWriteTimeUtc
This property provides the date and time (UTC) when the current item was last
modified.
The property is read/write.
Syntax
System.DateTime LastWriteTimeUtc {get; set;}
Value
System.DateTime LastWriteTimeUtc
UTC datetime
Exceptions
ArgumentOutOfRangeException
UnathorizedAccessException
FilterControllerException
Filtering APIs
IFileArchivingControl :: GetAccessControl
Example
IFileArchivingControl :: GetAccessControl
This method returns the access control that is set on the current file. The method
uses the .NET Framework AccessControlSections enumeration in the
System.Security.AccessControl namespace.
Syntax
System.Security.AccessControl.FileSecurity GetAccessControl(
AccessControlSections includeSections);
Parameter
AccessControlSections includeSections
AccessControlSections
enumeration value.
Exception
NotImplementedException
Example
IFileArchivingControl :: SetAccessControl
This method sets the access control on the current file. The method uses the .NET
Framework AccessControlSections enumeration in the
System.Security.AccessControl namespace.
Syntax
void SetAccessControl(
System.Security.AccessControl.FileSecurity fileSecurity);
Parameter
System.Security.AccessControl.
FileSecurity fileSecurity
AccessControlSections
enumeration value.
417
418
Filtering APIs
IFileArchivingControl :: Length
Exceptions
NotImplementedException
Example
IFileArchivingControl :: Length
This property provides the size of the current file.
The property is read only.
Syntax
System.UInt64 Length {get;}
Value
System.UInt64 Length
Example
IFileArchivingControl :: Open
This method is used to open the default stream for reading or writing. The method
uses the following .NET Framework enumerations in the System.IO namespace:
FileMode
enumeration
FileAccess
enumeration
FileShare
enumeration
Syntax
System.IO.Stream Open(FileMode mode, FileAccess access,
FileShare share);
Filtering APIs
IFileArchivingControl :: Open
Parameters
FileMode mode
FileAccess access
FileShare share
Remarks
The following FileMode values are not supported:
FileMode.Create
FileMode.CreateNew
FileMode.OpenOrCreate
FileMode.Append
Exceptions
ArgumentOutOfRangeException
ArgumentException
UnathorizedAccessException
FilterControllerException
419
420
Filtering APIs
IFileArchivingControl :: StreamNames
Example
IFileArchivingControl :: StreamNames
This property lists the names of alternate data streams.
The property is read only.
Syntax
String[] StreamNames {get;}
Value
String[] StreamNames
Exception
FilterControllerException
Example
string [] alternateDataStreams = archivingControl.StreamNames;
foreach (var v in alternateDataStreams)
{
// add code
}
IFileArchivingControl :: OpenStream
This method is used to open an alternate data stream for reading or writing.
The method uses the following .NET Framework enumerations in the System.IO
namespace:
FileMode
enumeration
Filtering APIs
IFileArchivingControl :: OpenStream
FileAccess
enumeration
FileShare
enumeration
Syntax
System.IO.Stream OpenStream(FileMode mode,
FileAccess access,
FileShare share,
String streamName);
Parameters
FileMode mode
FileAccess access
FileShare share
string streamName
Remarks
The FileShare value, FileShare.Inheritable, is not supported.
Exceptions
ArgumentNullException
ArgumentOutOfRangeException
ArgumentException
UnathorizedAccessException
421
422
Filtering APIs
IFileArchivingControl :: DeleteStream
FilterControllerException
Example
string [] alternateDataStreams = archivingControl.StreamNames;
foreach (var v in alternateDataStreams)
{
using(Stream ads = archivingControl.Open(FileMode.Open,
FileAccess.Read, FileShare.Read, v))
{
long bytesInAds = ads.Length;
}
}
IFileArchivingControl :: DeleteStream
This method is used to delete an alternate data stream.
Syntax
bool DeleteStream(string streamName);
Parameters
string streamName
Exceptions
ArgumentNullException
ArgumentException
UnathorizedAccessException
Filtering APIs
IFileArchivingControl :: ExtendedAttributes
FilterControllerException
Example
bool deleted = archivingControl.DeleteStream("adsName");
IFileArchivingControl :: ExtendedAttributes
This property returns a name/value pair for the extended attributes that exist on
the file.
Syntax
System.Collections.Generic.Dictionary<String, String>
ExtendedAttributes {get;}
Parameters
ExtendedAttributes
Name/value list.
Exception
FilterControllerException
Example
Dictionary<string, string> extendedAttribs =
archivingControl.ExtendedAttributes;
foreach (var v in extendedAttribs)
Console.WriteLine("EA Name:" + v.Key + "EA Value:" + v.Value);
423
424
Filtering APIs
IIndexMetadata interface
IIndexMetadata interface
This interface enables the external filter to add properties to the custom index
metadata for the current item, and retrieve additional properties that have been
previously added to the index using Add ().
Namespace: Symantec.EnterpriseVault.FilterInterfaces
Assembly: Symantec.EnterpriseVault.FilterInterfaces.dll
Syntax
public interface IIndexMetadata : IEnumerable
Member summary
Table 6-16
IIndexMetadata properties
Property
Read/Write
Description
DateTimeUTC
Read/Write
Table 6-17
IIndexMetadata methods
Method
Description
Count
Add
Clear
Remove all custom index metadata properties from the current item.
ToXML
FromXML
Remarks
The IIndexMetadata interface inherits from the IEnumerable interface and hence
supports standard enumeration support for the collection of properties. When
enumerating, each property is returned as an instance of the IIndexProperty
interface.
See IIndexProperty interface on page 428.
See Adding custom index metadata on page 72.
Filtering APIs
IIndexMetadata :: ToXML
IIndexMetadata :: ToXML
This method returns the custom index metadata as an XML document.
Syntax
string ToXML(bool formattedLayout);
Parameters
bool formattedLayout
Remarks
The XML can be loaded into an ISimpleIndexMetadata object, as defined in the
Content Management API.
See SimpleIndexMetadata object on page 256.
IIndexMetadata :: FromXML
This method loads the custom index metadata from an XML document.
Syntax
void FromXML(string xmlIndexMetadata);
Parameters
[in] BSTR xmlIndexMetadata
Remarks
Use the Add method to add item specific values.
The XML schema is not published, as the Add method should always be used to
add metadata properties.
Do not change the structure of the XML.
425
426
Filtering APIs
IIndexMetadata :: Add
IIndexMetadata :: Add
This method adds a property to the custom index metadata for the current item.
The custom index metadata will be added to the archive's item once the item has
been archived.
Syntax
void Add(string propertySet, string propertyName,
string propertyValue, bool propertySearchable,
bool propertyRetrievable);
void Add(string propertySet, string propertyName,
DateTime propertyValue, bool propertySearchable,
bool propertyRetrievable);
void Add(string propertySet, string propertyName,
long propertyValue, bool propertySearchable,
bool propertyRetrievable);
void Add(string propertySet, string propertyName,
ulong propertyValue, bool propertySearchable,
bool propertyRetrievable);
Parameters
string propertySet
string propertyName
string propertyValue
DateTime propertyValue
long propertyValue
ulong propertyValue
Property value.
bool propertySearchable
bool propertyRetrievable
Filtering APIs
IIndexMetadata :: Add
Remarks
The Add method can be called repeatedly to add multiple properties to the index.
The overloads of the Add method allow the addition of strings, integers or dateTime
values.
Table 6-18 lists the supported variant types for propertyValue.
Table 6-18
Value type
Variant type
Note
String
VT_BSTR
Datetime
VT_DATE
Integer
Vault
EnterpriseVault
KVS
Veritas
Symantec
Property sets do not need to be created before properties are added to them. When
you use Add() to add a property to the index, the property will be added to the
property set specified by propertySet, if the property set exists. If the set does not
exist, it will be created first.
427
428
Filtering APIs
IIndexMetadata :: Clear
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
IIndexMetadata :: Clear
This method clears all properties from the IIndexMetadata object for the current
item.
Syntax
void Clear();
IIndexMetadata :: Count
This method retrieves the number of properties in the IndexMetadata object for
the current item.
Syntax
int Count();
IIndexMetadata :: DateTimesUTC
This property sets or retrieves whether the date and time properties are input
and output in UTC or local system time.
Syntax
bool DateTimeUTC {get; set;}
Remarks
This property sets or retrieves whether the date and time properties are input
and output in UTC or local system time.
IIndexProperty interface
The IIndexProperty interface details a a custom index metadata property within
an IIndexMetadata collection.
Filtering APIs
IIndexProperty interface
Namespace: Symantec.EnterpriseVault.FilterInterfaces
Assembly: Symantec.EnterpriseVault.FilterInterfaces.dll
Syntax
public interface IIndexProperty
Member summary
Table 6-19
IIndexProperty properties
Property
Read/Write
Description
Set
Read only
Name
Read only
Value
Read only
Searchable
Read only
Retrievable
Read only
Remarks
An instance of this interface is returned when enumerating an IIndexMetadata
collection.
Example
[C#]
429
430
Filtering APIs
IIndexProperty :: Set
IIndexProperty :: Set
This property holds the name of the property set.
The property is read only.
Syntax
string Set {get;}
IIndexProperty :: Name
This property holds the name of the custom index property.
The property is read only.
Syntax
string Name
{get;}
IIndexProperty :: Value
This property holds the value of the index property.
The property is read only.
Syntax
System.Object Value {get;}
Remarks
The object will be a string, integer, or date/time value.
Example
[C#]
Filtering APIs
IIndexProperty :: Searchable
typeof(DateTime)))
{
searchableDateProps.Add(prop.Set, prop.Name,
(DateTime)prop.Value);
}
}
IIndexProperty :: Searchable
This property indicates whether the property can be returned in search results
when using the Search API.
The property is read only.
Syntax
bool Searchable {get;}
IIndexProperty :: Retrievable
This property indicates whether the index property can be retrieved and displayed
with search results when using the Search API.
The property is read only.
Syntax
bool Retrievable {get;}
IKeyedList interface
This interface enables multiple filters to access a list of filter properties. The
collection allows both random access by index and keyed access using a key value.
Namespace: Symantec.EnterpriseVault.FilterInterfaces
Assembly: Symantec.EnterpriseVault.FilterInterfaces.dll
Syntax
public interface IKeyedList : ICollection, IDictionary,
IEnumerable
431
432
Filtering APIs
IKeyedList :: Insert
Member summary
Table 6-20
IKeyedList methods
Method
Description
Insert
RemoveAt
See also
IKeyedList :: Insert
Inserts a filter property into the list at the specified position.
Syntax
void Insert(System.Int32 index, System.Object key,
System.Object value);
Parameters
System.Int32 index
System.Object key
System.Object value
Remarks
The elements that follow the insertion point are moved down to accommodate
the new element.
If index equals the number of items in the list, then the value is appended at the
end of the list.
An exception is reported if the specified index is out of range.
Filtering APIs
IKeyedList :: RemoveAt
IKeyedList :: RemoveAt
Removes a filter property from the list at the specified position.
Syntax
void RemoveAt(Int32 index);
Parameter
Int32 index The position in the list.
Remarks
The elements that follow the removed element move up to occupy the vacated
spot.
An exception is reported if the index is out of range.
433
434
Filtering APIs
IKeyedList :: RemoveAt
Chapter
Search API
This chapter includes the following topics:
SearchQuery object
ISearchQuery :: Query
ISearchQuery :: Clear
ISearchQuery :: SetTerm
ISearchQuery :: AddTerm
ISearchQuery :: SetRange
ISearchQuery :: AddRange
ISearchQuery :: SetProperty
ISearchQuery :: AddProperty
ISearchQuery :: AddOp
ISearchQuery :: Combine
ISearchQuery :: AddQuery
ISearchQuery2 :: SetPropertyRange
436
Search API
ISearchQuery2 :: AddPropertyRange
IndexSearch object
IIndexSearch2 :: IndexVolumeSets
IIndexSearch2 :: Options
IIndexSearch2 :: SortBy
IIndexSearch2 :: ResultsPropertySet
IIndexSearch2 :: AdditionalResultsProperties
IIndexSearch2 :: Timeout
IIndexSearch2 :: ArchiveEntryId
IIndexSearch2 :: ArchiveName
IIndexSearch2 :: HasFolders
IIndexSearch2 :: IndexVolumeSetIdentity
IIndexSearch2 :: IndexVolumeIdentity
IIndexSearch2 :: IndexVolumeSetCount
IIndexSearch2 :: MaxSearchIndexVolumeSets
IIndexSearch2 :: MaxSearchResultsPerVolumeSet
IIndexSearch2 :: SelectArchive
IIndexSearch2 :: ListIndexVolumeSets
IIndexSearch2 :: SelectIndexVolumeSet
IIndexSearch2 :: SelectIndexVolume
IIndexSearch2 :: Search
IIndexSearch2 :: SearchToXML
IIndexSearch2 :: AddAdditionalResultsProperty
IIndexSearch2 :: AddAdditionalResultsCustomProperty
IIndexSearch2 :: Reset
IndexVolumeSets object
IIndexVolumeSets :: ArchiveEntryId
Search API
IIndexVolumeSets :: ArchiveName
IIndexVolumeSets :: HasFolders
IIndexVolumeSets :: Count
IIndexVolumeSets :: _NewEnum
IIndexVolumeSets :: Item
IndexVolumeSet object
IIndexVolumeSet :: Identity
IIndexVolumeSet :: ArchiveEntryID
IIndexVolumeSet :: ArchiveName
IIndexVolumeSet :: FirstItemIndexSequenceNumber
IIndexVolumeSet :: OldestArchivedDate
IIndexVolumeSet :: YoungestArchivedDate
IIndexVolumeSet :: OldestItemDate
IIndexVolumeSet :: YoungestItemDate
IIndexVolumeSet :: DateTimesUTC
SearchResults object
ISearchResults :: Results
ISearchResults :: Count
ISearchResults :: Total
ISearchResults :: Start
ISearchResults :: Options
ISearchResults :: SortBy
ISearchResults :: _NewEnum
ISearchResults :: Item
ISearchResults2 :: InSync
ISearchResults2 :: TruncationReason
ISearchResults2 :: DateTimesUTC
437
438
Search API
About Search API
ISearchResults2 :: LoadResults
SearchResult object
ISearchResult :: Result
ISearchResult :: Number
ISearchResult :: Prop
ISearchResult :: Prop2
ISearchResult2 :: Count
ISearchResult2 :: Item
ISearchResult2 :: DateTimesUTC
Search API
Introduction to Enterprise Vault indexing
On instruction from the Storage service, the Index Server indexes items. This
can be as the items are archived, or later, depending on how the administrator
has configured indexing.
The Index Server ensures that indexes are complete, and automatically updates
the index every hour.
Index Servers can be standalone, or in Index Server groups. Figure 7-1 shows a
standalone Index Server configuration. An Index Server can only be standalone
if the Storage service and Index Server are collocated on an Enterprise Vault
server.
Figure 7-1
Index Server
Server 1 index
locations
Vault
stores
439
440
Search API
Introduction to Enterprise Vault indexing
Figure 7-2
Enterprise Vault
server 1
(storage only)
Journal
vault
stores
Enterprise Vault
server 2
(storage only)
Journal
vault
stores
Enterprise Vault
server 3
(storage only)
Mailbox
vault
stores
Server 5 index
locations
Index Server
Enterprise Vault
server 6
(Indexing only)
Server 6 index
locations
Index Server
Mailbox index
group
Enterprise Vault
server 7
(Indexing only)
Server 7 index
locations
Index Server
Enterprise Vault
server 4
(storage only)
Mailbox
vault
stores
Enterprise Vault
server 8
(Indexing only)
Server 8 index
locations
Index Server
Creates Index Server groups, and add to each group Index Servers on different
Enterprise Vault servers.
Assigns each vault store to either a standalone Index Server, or an Index Server
group. The Index Servers in a group share the task of indexing the items stored
in the archives in the vault stores assigned to the group.
Search API
Introduction to Enterprise Vault indexing
441
442
Search API
Introduction to Enterprise Vault indexing
Figure 7-3
Enterprise Vault
server 1
Journal
vault
stores
Archive A Archive A
index
index
volume 1 volume 2
Journal
archive A
Archive A Archive B
index
index
volume 3 volume 1
Enterprise Vault
server 2
Journal
vault
stores
Archive B
index
volume 2
Archive A
index
volume 5
Archive B
index
volume 3
Full indexing. This enables users to search as for brief indexing, and also
provides content searching.
Search API
Introduction to Enterprise Vault indexing
Obviously, the more information that is indexed, the more disk space is required
for the index.
The level of indexing, and when an item is indexed for a particular archive, can
be controlled using the Content Management API.
See IArchive :: IndexLevel on page 142.
See IArchive :: IndexUrgency on page 140.
In the Domino Filtering API and File System Filtering API, use the Add method
in the IndexMetadata class.
See IArchivingControl interface on page 402.
443
444
Search API
Introduction to Enterprise Vault indexing
and any attachments; this means that the top-level item and attachments are
searched as a single item.
When a search is performed, the single index entity (containing both top-level
items and attachments) is searched, and only top-level items are returned in the
results. Even if the search criteria is matched in one or more attachments, only
the associated top-level item is returned in the results. Attachments can be
accessed from the top-level items.
In releases before Enterprise Vault 10 the default indexing schema implemented
was attachment granularity. With attachment granularity, an index document
was created for the top-level item (such as a message), and separate index
documents were created for each attachment; each nested message and attachment
was stored in a separate index document. Searches returned both top-level items
and individual attachments.
In Enterprise Vault 9 and earlier releases, you could configure Enterprise Vault
to use the item granularity schema by configuring the registry setting,
SchemaType, in the following location:
HKEY_LOCAL_MACHINE
\SOFTWARE
\KVS
\Enterprise Vault
\Indexing
However, this only tended to be configured on large systems that performed very
complex searching, such as those performed by Symantec Compliance and
Discovery Accelerator products.
Searches on index volumes that use different schemas may behave differently.
The differences can be summarized as follows:
Search API
Using the Search API
item which has "John Doe" in attachment 1, and "Widgets Corp" in attachment
3.
Searching across indexes that have been created using different granularity
schemas is supported on Enterprise Vault 10 and later.
Get an instance of the Search Query object. You can do this in the usual manner
using CoCreateInstance directly (C++), or indirectly using the new operator
(.NET managed code).
Build the query. You do this by adding various terms and operations to the
query object using the ISearchQuery2 interface properties and methods.
See Constructing a search query on page 446.
Get an instance of the IndexSearch2 object and submit the search by calling
the Search method of IndexSearch2 interface.
See Performing a search on page 449.
445
446
Search API
Using the Search API
Author
Subject
Document Date
In order to find the correct emails, we need to attach search conditions to each of
these properties:
Document Date - this must be between 1st January 1970 and 16th May 2001
Search API
Using the Search API
Any number of terms can be added to a SearchQuery object. By default, they are
all combined using the AND operator. Different operators can be specified using
the Combine, AddOp, or AddQuery methods:
Combine takes two SearchQuery objects, each containing one or more terms
and an operator. The method creates a new search query containing all the
terms in both objects, combined with the specified operator. This new query
can be used in a further Combine operation to create searches of arbitrary
complexity.
AddOp combines one or more of the terms previously added to the SearchQuery
object with the specified operator.
All three methods can be used interchangeably, and at different stages in the
construction of a single search query. Which approach you use depends solely on
your preference.
To start to construct the earlier example query, you use the AddTerm method of
the ISearchQuery interface. AddTerm has the parameters: property, value, search
query flag. If SetTerm is used, it clears out any previous query.
The search query flag determines how to process individual terms added to a
search query.
See ESearchQueryFlags enumeration on page 458.
The first term could be added to the query as follows:
AddTerm(IndexPropAUTH, "John Doe",
ESQPhrase);
Now the above terms need to be combined using the OR operator. This is done
using the AddOp method:
AddOp(ESQor, ESQBinary)
The query is built up using a reverse Polish system; the operator is applied to the
previous x "objects" to create a new one, where x is determined by the value of
the second parameter to AppOp, the search object scope.
See ISearchQuery :: AddOp on page 478.
The operator itself can be obtained from the ESearchQueryOperators enumeration.
447
448
Search API
Using the Search API
(In reality, you would use the appropriate DateTime object for the programming
language being used).
The three parts of the query need to be combined using the AND operator. (The
first part is the result of the first call to AddOp. The second and third parts are
the terms being added in this operation):
AppOp(ESQand, ESQQternary)
The resulting query now represents the original query that was expressed in
words. The constructed query can be used by the Search method of the
IndexSearch2 interface to search the index of an archive.
The search query operator, ESQfilter, is a special operator for performing complex
searches, such as those required by the Enterprise Vault Compliance and Discovery
Accelerator products.
See ESQfilter searches on page 448.
ESQfilter searches
ESQfilter is similar to ESQ but more powerful. The following summarizes how
this operator works:
A search is performed using the first query. This searches top-level items only.
(For example, this term could specify a date range to be searched).
The results are compared and any result from the second search which has an
associated top-level item that matches a result from the first query search is
added to the results.
Search API
Using the Search API
If the entire string is being treated as a single phrase anyway (for example,
ESQphrase), none of the above values has any effect.
To search using wildcards, use an asterisk (*) to find zero or more characters,
and a question mark (?) to find any single character. For example, "min*"
matches the words "minutes", "minimum", and so on.
When searching indexes created before Enterprise Vault 10, there must be at
least three other characters before a wildcard.
Finally, words like "and" and "or" have no special meaning in query values (and
cannot be given any special meaning). They will be searched for like any other
word. So, for example, to search for documents containing both "financial" and
"hint", search for the string "financial hint" using ESQall.
Performing a search
The index is searched using the methods and properties of the IIndexSearch2
interface.
Before initiating the search, set requirements for the search and search results
using methods and properties of the IIndexSearch2 interface:
SelectArchive method. Use this to specify the index to search. The index is
identified using the Id of the associated archive.
449
450
Search API
Using the Search API
You can use the vault store and archive enumeration functionality in the
Content Management API to find the target archive.
The Id of an archive can also be discovered using the Enterprise Vault
Administration Console:
Options property. Use this to set the required granularity of the search:
SortBy property. Use this to specify the required sort order of the results.
After setting the required properties, you initiate the search using the Search
method.
The query is passed to this method as a query string. In most cases this query
string is created using the methods of ISearchQuery2 interface. The Query property
returns the string that has been constructed and can be passed to the Search
method.
Use the Search method parameters, startResult and maximumResults to specify
the number of results to return at one time. This enables you to "page" through
the results.
The output from a search is a pointer to a SearchResults object, which provides
a structured way to access the results. The object provides standard collection
support enabling iterative operations on the results in the collection, such as "for
each" in Visual Basic, and .NET managed code.
Search API
Using the Search API
Concurrent searches
To optimize performance, applications using multiple search threads should
search different archives or index volume sets.
To get the next batch of results, amend the search query to return results with
a sequence number (IndexPropertySNUM) greater than that recorded at the
end of the previous batch of results.
Repeat this until no more results are found.
An archive has multiple index volumes, and the number of index volumes is
less than, or equal to MaxSearchIndexVolumeSets (default 5).
If an archive has more than five index volumes, then you can either increase the
number to be searched by setting the value of MaxSearchIndexVolumeSets, or
use SelectIndexVolumeSet to select the index volume set to search.
Use MaxSearchResultsPerVolumeSet to set the maximum number of results per
volume set that can be processed and merged during a federated search (default
is 1000).
Be aware that increasing these default settings could result in a time out.
If it is necessary to select a specific volume set then after calling SelectArchive,
a call to IndexVolumeSets returns a collection of IIndexVolumeSet pointers from
which the ID can be obtained.
451
452
Search API
Using the Search API
Count. This is the number of results in the object; that is, the size of the current
collection.
You can access the data for each result returned using the methods of
ISearchResult2.
When searching indexes created by Enterprise Vault 10.0 or later, results include
top level items only.
When searching indexes created before Enterprise Vault 10.0, results may include
attachments and top-level items. However, only top-level items are returned in
results for these indexes if any of the following are configured:
The search query includes the ESQfilter operator. Attachments are searched
but the associated top-level item is returned in results.
The ItemGranularityOnly index schema was enabled when the index was
created. Attachments are searched but the associated top-level item is returned
in results.
Search API
Using the Search API
To access the properties of each result, use the Prop method of the SearchResult
class, specifying the required property as the parameter.
Searchable means that the property can be used in search queries to find items
in the archive index.
453
454
Search API
Using the Search API
The second method, DoSearch, is then called. DoSearch takes two parameters:
the IndexSearch2 object created in SearchArchive, and the maximum number of
search results. If the search is not a federated search, this second parameter is
zero.
void SearchArchive(string archId, int maxSearchResults)
{
IIndexSearch2 search = (IIndexSearch2) new IndexSearch2();
//First select the archive
search.SelectArchive(archId);
//although the prefered approach is to do a non-federated search this sample
//code will demonstrate both non-federated and federated
//first get the IndexVolumeSets for the archive
IIndexVolumeSets volSets = (IIndexVolumeSets)search.IndexVolumeSets;
long count = volSets.Count;
//use this count value to see which approach to take
if (count > search.MaxSearchIndexVolumeSets)
{
//do non-federated search
foreach (IIndexVolumeSet volSet in volSets)
{
search.SelectIndexVolumeSet(volSet.Identity);
DoSearch(search, 0);
}
}
else
{
DoSearch(search, maxSearchResults);
}
Marshal.FinalReleaseCOMObject(search);
}
The DoSearch method, called from "SearchArchive" performs the actual search
on the entire archive, or the specifed Index Volume Set, depending on whether
or not the search is a federated search.
The search will filter on a range of archived dates, a phrase in the subject, greater
than zero attachments and the author.
Search API
Using the Search API
The retrieved properties are created date, content (first 150 characters only),
saveset Id, number of attachments, subject, TO:recipient, CC:recipient,
BCC:recipient.
Typically the property values in the query would be supplied using a GUI or a
command line. However, for the purposes of this example, they are supplied in
the code.
void DoSearch(IIndexSearch2 search, int maxSearchResults)
{
ISearchQuery2 query = (ISearchQuery2) new SearchQuery2();
DateTime dtFrom = new DateTime(2007, 1, 1);
DateTime dtTo = new DateTime(2007, 12, 31);
query.SetRange("adat", dtFrom, dtTo, (int)ESearchQueryFlags.ESQany);
query.AddRange("natc", 0, 10000, (int)ESearchQueryFlags.ESQany);
query.AddTerm("subj", "a phrase in the subject",
(int)ESearchQueryFlags.ESQphrase);
query.AddTerm("auth", "joe.user", (int)ESearchQueryFlags.ESQexact);
query.AddOp((int)ESearchQueryOperators.ESQand, 4);
search.SortBy = "snum";
//if this is a federated search then set the maximum number of search
//results per index volume set
//if this is not a federated search then "maxSearchResults" will be 0 and
//MaxSearchResultsPerVolumeSet" will not be used.
if (maxSearchResults > 0)
search.MaxSearchResultsPerVolumeSet = maxSearchResults;
//we are going to search top level items only
search.Options = (int)EOptionsFlags.roItemGranularity;
//As the preferred method is to explicitly state which properties to
//retrieve, first set IIndexSearch2::ResultsPropertySet to Empty.
search.ResultsPropertySet = (int)EPropertySet.psEmpty;
search.AdditionalResultsProperties = "date ssid natc subj cont
reto recc rbcc";
int start = 1; //this is the index number into the results from which to
start returning the result set
455
456
Search API
Using the Search API
int count = 0;
ISearchResults2 results = null;
do
{
results = (ISearchResults2)search.Search(query.Query, start, 500, "");
if (results.InSync == true)
{
if (results.TruncationReason == ETruncationReason.trNone)
{
//make sure that date time properties are returned as local
//system time not UTC
results.DateTimesUTC = false;
foreach (ISearchResult2 result in results)
{
DateTime createdDate = (DateTime)result.Prop("date");
string ssid = (string)result.Prop("ssid");
int numAttach = (int)result.Prop("natc");
string subj = (string)result.Prop("subj");
string reto = (string)result.Prop("reto");
string rbcc = (string)result.Prop("rbcc");
//do something with the results
}
}
else
{
ETruncationReason tr = (ETruncationReason)results.TruncationReason;
switch (tr)
{
case ETruncationReason.trAdminResultLimitExceeded:
//do something
break;
case ETruncationReason.trAdminTimeoutExpired:
//do something
break;
case ETruncationReason.trItemsOrContentMissing:
//do something
break;
Search API
Constants and enumerations
case ETruncationReason.trNotSearchedOrFailedVolumes:
//do something
break;
case ETruncationReason.trResultLimitExceeded:
//do something
break;
case ETruncationReason.trTimeoutExpired:
//do something
break;
case ETruncationReason.trWidthNormalizationRequired:
//do something
break;
}
}
}
else
{
MessageBox.Show("It is possible that the index was being updated as the
search was being carried out",
"Index not synchronised?", MessageBoxButtons.OK,
MessageBoxIcon.Warning);
}
count = results.Count;
Marshal.FinalReleaseCOMObject(results);
results = null;
start += 500;
}
while (count != 0);
Marshal.FinalReleaseCOMObject(query);
}
457
458
Search API
Constants and enumerations
For example, IndexPropSUBJ is the constant for the Enterprise Vault defined
property, "subj", and IndexPropRCAT is the constant for the Enterprise Vault
system property, "rcat".
ESearchQueryFlags enumeration
ESearchQueryFlags specify how to process individual terms added to a search
query (for example, using AddTerm).
Note: From Enterprise Vault 10.0, the Search API will not support the following
search operators for newly indexed items:
ESQBeginany
ESQBegins
ESQExactany
is exactly any of
ESQEndsany
ESQEnds
ESQAutowild
Using these search operators against items that were indexed using Enterprise
Vault 9.0 or earlier will continue to be supported.
enum ESearchQueryFlags
{
// Exactly one of these must be present (default is ESQany)
ESQany
= 0, // Contains any of the words
ESQall
= 1, // Contains all the words
ESQallnear = 2, // Contains all the words, near each other
(within 10 words)
ESQphrase
= 3, // Contains all the words, in order (a phrase)
ESQexact
Search API
Constants and enumerations
ESQusermask
};
By default, indexes are built so that they do not support case sensitive searching.
This is to minimize the index storage footprint.
The specified operator applies to the terms or ranges already present in the object,
using a Reverse Polish scheme. Conceptually, the specified number of terms is
removed from the query, and replaced with the result of combining all the terms
with the specified operator. This result can then be combined with other terms
or intermediate results by a subsequent AddOp method.
ESearchQueryOperators enumeration
ESearchQueryOperators specify the operator to use. These operators can be used
with the AddOp, Combine and AddQuery methods.
enum ESearchQueryOperators
{
ESQand
= 0,
ESQor
= 1,
ESQandnot
= 2,
ESQfilter
= 3
};
Using ESQfilter will only return hits on top-level documents. The search finds
items that match the first query and which also match, or have a cover note or
attachment that matches, all the other queries.
ESearchOperatorScope enumeration
ESearchOperatorScope defines the number of operands on which an operation is
to be performed.
enum ESearchOperatorScope
{
ESQdefault = 0,
ESQscopeall = 1,
ESQbinary
= 2,
ESQternary = 3
};
If no value is given, the default is for the operator to be binary (two operands).
The ESearchOperatorScope is a useful extension to the "Reverse Polish" scheme
used by the AddOp method, enabling a single operator to have more than two
459
460
Search API
Constants and enumerations
operands. For more than three operands, there are no symbolic constants, so the
required number should be specified.
Note the value of the scope is the number of operands, not the number of
operations (which, when thinking of conventional binary operators, would be one
less than the number of operands).
EOptionsFlags enumeration
EOptionsFlags defines the granularity of searches.
enum EOptionsFlags
{
roItemGranularity = 0x00000000,// default
roAttachmentGranularity = 0x00000001,
};
EPropertySets enumeration
EPropertySets are the predefined property sets that can be requested in search
results.
As the predefined property sets may change at future releases, we recommend
that you set this property to 0 (psEmpty) and use IIndexSearch2 ::
AddAdditionalResultsProperty and IIndexSearch2 ::
AddAdditionalResultsCustomProperty to set the required properties to be returned
in the results set.
See IIndexSearch2 :: AddAdditionalResultsProperty on page 517.
See IIndexSearch2 :: AddAdditionalResultsCustomProperty on page 518.
enum EPropertySets
{
psEmpty = 0,
psWABrief = 1, default
psWAMedium = 2,
psWAFull = 3,
psAEMailbox = 4,
psAEFSA = 5,
psAESPS = 6,
Search API
Constants and enumerations
psAEMultiFolders = 7,
psCompliance = 8,
psItemIds = 9,// Min set of ids needed to retrieve the item.
psAEShared = 10,
psAEJournal = 11,
psAEPublicFolder = 12,
psAESharePoint = 13
};
ETruncationReason enumeration
ETruncationReason explains why not all search results have been returned.
enum ETruncationReason
{
trNone = 0,
trResultLimitExceeded = 1,
trTimeoutExpired = 2,
trAdminResultLimitExceeded = 4,
trAdminTimeoutExpired = 8,
trNotSearchedOrFailedVolumes = 16,
trItemsOrContentMissing = 32,
trWidthNormalizationRequired = 64
};
trNotSearchedOrFailedVolumes applies to federated searches only. The index
contents for the whole archive cannot be listed. This can occur when one or more
of the index volume sets are in a failed state; they could be, for example, offline
or corrupt.
trItemsOrContentMissing indicates that index entries are missing for items or
content in archive.
trWidthNormalizationRequired is set for old indexes where character width
EXMLResultsFormatOptions enumeration
EXMLResultsFormatOptions enumerates the XML format option values. Currently
there is only one value:
enum EXMLResultsFormatOptions
{
461
462
Search API
SearchQuery object
SearchQuery object
The SearchQuery object implements the following interfaces:
ISearchQuery
ISearchQuery2 (default)
These interfaces are used to build up a search query. Some additional methods
have been introduced in ISearchQuery2, which inherits from ISearchQuery.
You need to get a pointer to an instance of ISearchQuery2, as this is marked as
the default.
Syntax
interface ISearchQuery2 : ISearchQuery : IDispatch
Member summary
Table 7-1
SearchQuery properties
Property
Read/Write
Description
ISearchQuery ::
Query
Read/Write
Table 7-2
SearchQuery methods
Method
Description
ISearchQuery ::
Clear
Discards the query currently being constructed in the object (if any),
and resets the object so that it is ready for a new query.
ISearchQuery ::
SetTerm
ISearchQuery ::
AddTerm
ISearchQuery ::
SetRange
ISearchQuery ::
AddRange
Search API
SearchQuery object
Table 7-2
Method
Description
ISearchQuery ::
SetProperty
ISearchQuery ::
AddProperty
ISearchQuery ::
AddOp
ISearchQuery ::
Combine
ISearchQuery ::
AddQuery
ISearchQuery2 :: Equivalent of SetRange method. Enables use of date and integer ranges
SetPropertyRange for custom properties in queries.
ISearchQuery2 :: Custom property equivalent of AddRange method. Enables use of date
AddPropertyRange and integer ranges for custom properties in queries.
Remarks
As these interfaces are ultimately derived from IDispatch, they can be used by
scripting languages.
Use the methods to create a query that can be used to search the index of an
archive, and return the values of specified properties as results.
A query consists of a number of terms, combined with different operators.
The Query property enables the query to be returned as a string (so that it can
then be used by the Search method), or to be set using a text string.
There are restrictions on the date range that can be returned in search results.
See Enterprise Vault index properties on page 453.
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
Requirements
See Programming notes on page 56.
463
464
Search API
ISearchQuery :: Query
CLSID
B94D399B-B815-11D1-90D2-0000F87A3B5E
Prog ID
EnterpriseVault.IndexSearch
Type Library
EVIndexClient
DLL
IndexClient.dll
.NET Primary
Interop Assembly
(PIA)
KVS.EnterpriseVault.Interop.Indexclient.dll
.NET PIA
namespace
KVS.EnterpriseVault.Interop
Example
The object "query" constructed here will be used in the most of the following
examples. It is shown here as a private class data member.
[C#]
public class SampleSearchClass
{
private ISearchQuery2 query = (ISearchQuery2)
new SearchQuery();
//rest of the class
ISearchQuery :: Query
The Query property is the default property. It returns a string containing the
query previously constructed.
The property is read/write.
Syntax
HRESULT Query([out, retval] BSTR* pbsQuery);
HRESULT Query([in] BSTR bsQuery);
Parameters
[out, retval] BSTR* pbsQuery
Search API
ISearchQuery :: Clear
Remarks
This property returns the query string that has been constructed using the other
ISearchQuery2 methods.
Return value
rvS_OK
Success.
Example
This method is often used in conjunction with IIndexSearch2::Search where it
provides the value for the first parameter, the search query.
[C#]
ISearchResults2 results2 =
(ISearchResults2)search.Search(query.Query,
1, 100, "");
ISearchQuery :: Clear
This method discards the query currently being constructed in the object (if any),
and resets the object so that it is ready to build a new query.
Syntax
HRESULT Clear([out, retval] BSTR* pbsQuery);
Parameters
[out, retval] BSTR* pbsQuery
Remarks
Clears out the string containing the query that has been constructed so far.
465
466
Search API
ISearchQuery :: SetTerm
Return value
rvS_OK
Success.
Example
In this example the previous query is stored in the string "oldQuery".
[C#]
//save the query that is being cleared out
string oldQuery = query.Clear();
ISearchQuery :: SetTerm
This method is used to clear the current query object, reset it and add a new term
(property) to the query. This is equivalent to calling the Clear method and then
calling the AddTerm method.
Syntax
HRESULT SetTerm([in, string] const BSTR bsProp,
[in] VARIANT vVal,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsProp
Search API
ISearchQuery :: SetTerm
Remarks
If the bsProp parameter is left empty, then all indexed properties are searched
for the value. This is really only useful for string values.
The parameter lFlags must contain one ESearchQueryFlags enumeration value.
This value may be bitwise OR'd (C++ operator "|") with one or more values from
the extended values.
bsProp can be a custom index property that has been added using the Content
Management API, or one of the Filtering APIs. This would be specified using the
format:
propertySet.propertyName
If the custom index property is a member of the global property set, then the
property set name is omitted.
There are restrictions on the date range that can be returned in search results.
See Enterprise Vault index properties on page 453.
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
Return value
rvS_OK
Success.
Example
In this example a query is constructed that will find all items where the subject
contains the phrase "some subject", and the number of attachments is 1. In this
example the return value is not used.
[C#]
//search for an item where the subject contains the phrase
"some subject"
467
468
Search API
ISearchQuery :: AddTerm
See also
ISearchQuery :: AddTerm
This method is used to add a new term (property) to the query.
Syntax
HRESULT AddTerm([in, string] const BSTR bsProp,
[in] VARIANT vVal,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Parameters
Table 7-3
Parameter
Description
Search API
ISearchQuery :: AddTerm
Table 7-3
Parameter
Description
Remarks
If the bsProp parameter is left empty, all indexed properties are searched for the
value. This is really only useful for string values.
The parameter lFlags must contain one ESearchQueryFlags enumeration value.
This value may be bitwise or'd (C++ operator "|") with one or more values from
the extended values.
bsProp can be a custom index property that has been added using the Content
Management API, or one of the Filtering APIs. This would be specified using the
format:
propertySet.propertyName
If the custom index property is a member of the global property set, then the
property set name is omitted.
There are restrictions on the date range that can be returned in search results.
See Enterprise Vault index properties on page 453.
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
Return value
rvS_OK
Success.
Example
In this example, a query is constructed that finds all items where the subject
contains the phrase "some subject" and the number of attachments is 1. The return
value is not used.
[C#]
469
470
Search API
ISearchQuery :: SetRange
//search for an item where the subject contains the phrase "some subject"
query.SetTerm("subj", "some subject", (int)ESearchQueryFlags.ESQphrase);
//search for an item with 1 attachment
query.AddTerm("natc", 1, (int)ESearchQueryFlags.ESQany);
//now we AND the two terms so that both terms must be satisfied before returning a result
query.AddOp((int)ESearchQueryOperators.ESQand, (int) ESearchOperatorScope.ESQdefault);
See also
ISearchQuery :: SetRange
This method is used to delete all queries in the query object, reset the object and
add a date or numeric (integer) range to the query being built in the object. This
is equivalent to calling Clear then AddRange.
Syntax
HRESULT SetRange([in, string] const BSTR bsProp,
[in] VARIANT vVal1,
[in] VARIANT vVal2,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsProp
Search API
ISearchQuery :: SetRange
Remarks
vVal1 and vVal2 must be the same type.
The parameter lFlags must contain one ESearchQueryFlags enumeration value.
Currently, however, none of the Search Query Flags has any effect on range
searches.
This method can only be used with date or integer values.
When specifying dateTime values, it is strongly recommended that you set
ESearchQueryFlags.ESQutcdate and supply UTC dateTime values.
If ESearchQueryFlags.ESQutcdate is not set, dateTime values are treated as local
system dateTime.
bsProp can be a custom index property that has been added using the Content
Management API, or one of the Filtering APIs. This would be specified using the
format:
propertySet.propertyName
If the custom index property is a member of the global property set, then the
property set name is omitted.
There are restrictions on the date range that can be returned in search results.
See Enterprise Vault index properties on page 453.
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
Return value
rvS_OK
Success.
471
472
Search API
ISearchQuery :: AddRange
Example
This example builds a query that will find items archived between 01/01/2008
and 21/10/2008 inclusive, or that have less than five attachments.
//search for all items archived between 01/01/2008 and 31/10/2008 inclusive
DateTime from = new DateTime(2008, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime to = new DateTime(2008, 10, 31, 23, 59, 59, DateTimeKind.Utc);
query.SetRange("adat",
from,
to, (
int)(ESearchQueryFlags.ESQany | ESearchQueryFlags.ESQutcdate));
//search for items with less than 5 attachments
query.AddRange("natc", 0, 4, (int)ESearchQueryFlags.ESQany);
//OR the 2 terms together so the result set will contain items that fall into one or
//the other (or both) ranges
query. AddOp((int)ESearchQueryOperators.ESQor, (int)ESearchOperatorScope.ESQdefault);
See also
ISearchQuery :: AddRange
This method is used to add a date or numeric integer range to the query being
built in the object.
Syntax
HRESULT AddRange([in, string] const BSTR bsProp,
[in] VARIANT vVal1,
[in] VARIANT vVal2,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsProp
Search API
ISearchQuery :: AddRange
Remarks
This method can only be used with date/time or integer values.
vVal1 and vVal2 must be the same type.
The parameter lFlags must contain one ESearchQueryFlags enumeration value.
Currently, however, none of the Search Query Flags has any effect on range
searches.
When specifying dateTime values, it is strongly recommended that you set
ESearchQueryFlags.ESQutcdate and supply UTC dateTime values.
If ESearchQueryFlags.ESQutcdate is not set, dateTime values are treated as local
system dateTime.
bsProp can be a custom index property that has been added using the Content
Management API, or one of the Filtering APIs. This would be specified using the
format:
propertySet.propertyName
If the custom index property is a member of the global property set, then the
property set name is omitted.
There are restrictions on the date range that can be returned in search results.
See Enterprise Vault index properties on page 453.
Hints and tips on adding custom index properties are provided in the introduction
to the Content Management API.
See Adding custom index metadata on page 72.
473
474
Search API
ISearchQuery :: SetProperty
Return value
rvS_OK
Success.
Example
This example builds a query that will find items archived between 01/01/2008
and 21/10/2008 inclusive, or that have less than five attachments.
[C#]
//search for all items archived between 01/01/2008 and 31/10/2008 inclusive
DateTime from = new DateTime(2008, 1, 1);
DateTime to = new DateTime(2008, 10, 31);
query.SetRange("adat", from, to, (int)ESearchQueryFlags.ESQany);
//search for items with less than 5 attachments
query.AddRange("natc", 0, 4, (int)ESearchQueryFlags.ESQany);
//OR the 2 terms together so the result set will contain items that fall into one
//or the other (or both) ranges
query. AddOp((int)ESearchQueryOperators.ESQor, (int)ESearchOperatorScope.ESQdefault);
See also
ISearchQuery :: SetProperty
This method clears all queries from the query object, resets the object, and adds
a custom property that can be used for searching.
This is equivalent to calling Clear then AddProperty.
Syntax
HRESULT SetProperty([in, string] const BSTR bsPropSet,
[in, string] const BSTR bsProp,
[in] VARIANT vVal,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Search API
ISearchQuery :: SetProperty
Parameters
[in, string] const BSTR bsPropSet
Remarks
Note that SetTerm can also be used to set a term for a custom property using the
propertySet.propertyName format.
SetProperty method is very similar to SetTerm, but as it requires both a property
set and property name, it can only be used to add custom properties.
Return value
rvS_OK
Success.
Example
It is assumed that a custom property "Type", belonging to the property set
"Instrument", has been added to archived items.
Two queries are constructed in this sample; the first searches for all queries with
the custom property Instrument.Type = Guitar. The second searches for all items
where the retention category = Business.
The two queries are combined to form one query that searches for all items where
Instrument.Type is Guitar and retention category is not Business.
475
476
Search API
ISearchQuery :: AddProperty
[C#]
//search for items with custom property value Guitar
string qry1 = query.SetProperty("Instrument", "Type", "Guitar", (int)
ESearchQueryFlags.ESQexact);
//search for items with a retention category of "Business"
string qry2 = query.SetTerm("rcat", "Business", (int)(ESearchQueryFlags.ESQexact);
//combine the 2 queries so that the result set contains items that contain Guitar in
//the custom property Instrument.Type and that have a retention category that is not
//Business
query.Combine(qry1, qry2, (int)ESearchQueryOperators.ESQandnot);
See also
ISearchQuery :: AddProperty
This method adds a custom property to the query being built in the object and
which can be used for searching.
Syntax
HRESULT AddProperty([in, string] const BSTR bsPropSet,
[in, string] const BSTR bsProp,
[in] VARIANT vVal,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsPropSet
Search API
ISearchQuery :: AddProperty
Remarks
This method is very similar to AddTerm, but with both a property set and property
name being included as parameters. This means that it can only be used to add
custom properties.
Return value
rvS_OK
Success.
Example
In this example we use the return value which holds the current query. It is also
assumed that a custom property "Type", belonging to the property set
"Instrument", has been added to archived items as well as a custom property
"Colour", belonging to the same property set.
The example builds two queries; the first searches for all items where
Instrument.Colour is Red. The second searches for items where Instrument.Type
is Guitar. The two queries are combined to form one, in order to search for all
items where Instrument.Type is Guitar and Instrument.Colur is Red.
[C#]
//search for items where custom property Instrument.Colour = "Red"
string qry1 = query.SetProperty("Instrument", "Colour", "red",
(int)ESearchQueryFlags.ESQexact);
//search for items with custom property Instrument.Type = Guitar
string qry2 = query.AddProperty("Instrument", "Type", "Guitar", (int)(
ESearchQueryFlags.ESQexact);
477
478
Search API
ISearchQuery :: AddOp
//combine the 2 queries so that the result set contains items that contain Guitar in
//the custom property Instrument.Type and "red" in Instrument.Colour"
query.Combine(qry1, qry2, (int)ESearchQueryOperators.ESQand);
See also
ISearchQuery :: AddOp
This method is used to add an operator to the query in order to combine previously
defined terms.
Syntax
HRESULT AddOp([in] const long lOp,
[in, defaultvalue(0)] const long lScope,
[out, retval] BSTR* pbsQuery);
Parameters
[in] const long lOp
Remarks
This method combines the previous x properties by using the operator defined in
the first parameter, where x is the value given in the second parameter.
Search API
ISearchQuery :: Combine
Return value
rvS_OK
Success.
Example
In this example, a query is constructed that will search for all items with a subject
that contains the phrase "some subject", and one attachment. In this example the
return value is not used.
[C#]
//search for an item where the subject contains the phrase "some subject"
query.SetTerm("subj", "some subject", (int)ESearchQueryFlags.ESQphrase);
//search for an item with 1 attachment
query.AddTerm("natc", 1, (int)ESearchQueryFlags.ESQany);
//now we AND the 2 terms so that both terms must be satisfied before returning a result
query.AddOp((int)ESearchQueryOperators.ESQand, (int) ESearchOperatorScope.ESQdefault);
ISearchQuery :: Combine
This method clears the current query in the object and then adds queries from
two other query objects. These are combined using the specified operator.
Syntax
HRESULT Combine([in, string] const BSTR bsQuery1,
[in, string] const BSTR bsQuery2,
[in] const long lOp,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsQuery1
479
480
Search API
ISearchQuery :: Combine
Remarks
This method combines two search queries. Each of the search queries is the Query
property of another SearchQuery object.
No check is made to ensure that the two strings are correctly-formed query strings.
Similarly, the lOp parameter is not checked to make sure that it is a valid operator.
If any of these parameters are incorrect, an error is not reported until the query
string is parsed.
Return value
rvS_OK
Success.
Example
In this example we create two queries; the first searches for all items where the
custom property Instrument.Type is Guitar, and the second searches for all items
with a retention category of Business. The return values hold the resultant
queries. These are then combined to produce one query to search for all items
where Instrument.Type is Guitar and retention category is not Business.
[C#]
//search for items with custom property value Guitar
string qry1 = query.SetProperty("Instrument", "Type", "Guitar", (int)(
ESearchQueryFlags.ESQexact);
//search for items with a retention category of "Business"
string qry2 = query.SetTerm("rcat", "Business", (int)(ESearchQueryFlags.ESQexact);
//combine the 2 queries so that the result set contains items that contain Guitar in
//the custom property Instrument.Type and that have a retention category that is not
//Business
Search API
ISearchQuery :: AddQuery
ISearchQuery :: AddQuery
This method is used to combine a query from another query object with the query
in the current object, using the specified operator.
Syntax
HRESULT AddQuery([in, string] const BSTR bsQuery1,
[in] const long lOp,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsQuery1
Remarks
Combines a search query, which is assumed to be the Query property of another
SearchQuery object, with the query string of this object.
No check is made to ensure that the new string is correctly formed. Similarly, the
lOp parameter is not checked to ensure that it is a valid operator.
If any of these parameters are incorrect, an error is not reported until the query
string is parsed.
Return value
rvS_OK
Success.
481
482
Search API
ISearchQuery2 :: SetPropertyRange
Example
In this example it is assumed there is already a populated ISearchQuery object,
query2.
This example adds a new query string to this existing query.
[C#]
string qry = query.SetTerm("cont", "-white blue.red",
(int)ESearchQueryFlags.ESQany);
query2.AddQuery(qry, (int)ESearchQueryOperators.ESQand);
ISearchQuery2 :: SetPropertyRange
This method is used to add a date or integer range to a query that specifies a
custom index property. The method deletes any queries in the current object,
resets it, and adds the specified information as part of a new query.
Custom index properties can be added to index entries using the Content
Management API, or one of the Filtering APIs.
See Adding custom index metadata on page 72.
Syntax
HRESULT SetPropertyRange([in, string] const BSTR bsPropSet,
[in, string] const BSTR bsProp,
[in] VARIANT vVal1,
[in] VARIANT vVal2,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsPropSet
Search API
ISearchQuery2 :: SetPropertyRange
Remarks
This method can only be used with date or integer values.
vVal1 and vVal2 must be the same type.
The parameter lFlags must contain one ESearchQueryFlags enumeration value.
Currently, none of the Search Query Flags has any effect on range searches.
There are restrictions on the date range that can be returned in search results.
See Enterprise Vault index properties on page 453.
Return value
rvS_OK
Success.
Example
In this example it is assumed there is a custom property set, "CustomTags",
containing a property "Relevance", which is on a scale 0 - 9.
[C#]
//return all items that have the custom property CustomTags.Relevance between 0 and 5
query.SetPropertyRange("CustomTags", "Relevance", 0, 5,
(int)ESearchQueryFlags.ESQany);
See also
483
484
Search API
ISearchQuery2 :: AddPropertyRange
ISearchQuery2 :: AddPropertyRange
This method is used to add a date or integer range to a query that specifies a
custom index property.
Custom index properties can be added to index entries using the Content
Management API, or one of the Filtering APIs.
See Adding custom index metadata on page 72.
Syntax
HRESULT AddPropertyRange([in, string] const BSTR bsPropSet,
[in, string] const BSTR bsProp,
[in] VARIANT vVal1,
[in] VARIANT vVal2,
[in, defaultvalue(0)] const long lFlags,
[out, retval] BSTR* pbsQuery);
Parameters
[in, string] const BSTR bsPropSet
Search API
IndexSearch object
Remarks
This method can only be used with date or integer values.
vVal1 and vVal2 must be the same type.
The parameter lFlags must contain one ESearchQueryFlags enumeration value.
Currently, however, none of the Search Query Flags has any effect on range
searches.
There are restrictions on the date range that can be returned in search results.
See Enterprise Vault index properties on page 453.
Return value
rvS_OK
Success.
Example
In this example it is assumed there is a custom property set, "CustomTags",
containing a property "Relevance", which is on a scale 0 -9.
[C#]
//return all items that have the custom property CustomTags.Relevance between 0 and 5
query.AddPropertyRange("CustomTags", "Relevance", 0, 5,
(int)ESearchQueryFlags.ESQany);
See also
IndexSearch object
IndexSearch object implements the following interface:
IIndexSearch2
485
486
Search API
IndexSearch object
IIndexSearch2 provides properties and methods that can be used to enable the
user to search an archive using a query that has been built using the methods of
ISearchQuery2.
The output from a search is a pointer to an ISearchResults2 interface, the
implementation of which contains a collection of ISearchResult2 pointers.
Syntax
interface IIndexSearch2 : IDispatch
Member summary
Table 7-4
IndexSearch properties
Property
Read/Write
Description
IndexVolumeSets
Read only
Options
Read/Write
SortBy
Read/Write
ResultsPropertySet
Read/Write
AdditionalResultsProperties
Read/Write
Timeout
Read/Write
ArchiveEntryId
Read only
Search API
IndexSearch object
Table 7-4
Property
Read/Write
Description
ArchiveName
Read only
HasFolders
Read only
IndexVolumeSetIdentity
Read only
IndexVolumeIdentity
Read only
IndexVolumeSetCount
Read only
MaxSearchIndexVolumeSets
Read/Write
MaxSearchResultsPerVolumeSet Read/Write
Table 7-5
IndexSearch methods
Method
Description
SelectArchive
ListIndexVolumeSets
487
488
Search API
IndexSearch object
Table 7-5
Method
Description
SelectIndexVolumeSet
SelectIndexVolume
Search
SearchToXML
AddAdditionalResultsProperty
AddAdditionalResultsCustomProperty
Reset
Remarks
As they are ultimately derived from IDispatch, these interfaces can be used by
scripting languages. IIndexSearch2 supersedes IIndexSearch interface, which
does not support multiple volume sets.
Although the property ResultsPropertySet can still be used, it is recommended
that only the actual properties required are added through the use of the property
AdditionalResultsProperties.
Search API
IIndexSearch2 :: IndexVolumeSets
Example
The object, "search", constructed in this example will be used in most of the
subsequent examples. It is shown here as a private class data member.
[C#]
public class SampleSearchClass
{
private IIndexSearch2 search = (IIndexSearch2)
new IndexSearch2();
//rest of the class
See also
IIndexSearch2 :: IndexVolumeSets
This property returns a pointer to an IndexVolumeSets collection object. The
collection can be accessed using the properties and methods of the returned
interface pointer. The property is read only.
Syntax
HRESULT IndexVolumeSets([out,retval] IUnknown**
volumeSetsCollection);
489
490
Search API
IIndexSearch2 :: Options
Parameters
[out,retval] IUnknown** volumeSetsCollection
Pointer to an
IUnknown pointer that
can be QI'd (or cast) to
obtain an
IIndexVolumeSets
pointer.
Remarks
This property must not be used before SelectArchive has been called.
The returned data should not be persisted, as the collection of index volume sets
associated with an archive may change over time. Also when indexes are rebuilt
the set of index volumes will change.
See IndexVolumeSets object on page 519.
Return value
rvS_OK
Success.
rvE_POINTER
rvINDEXING_W_ARCHIVE_NOT_SET
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
IIndexVolumeSets volSets = (IIndexVolumeSets)search.IndexVolumeSets;
foreach (IIndexVolumeSet volSet in volSets)
{
search.SelectIndexVolumeSet(volSet.Identity);
DoSearch(search);
}
IIndexSearch2 :: Options
This property sets or returns search option flags that define the granularity of
search results.
The property is read/write.
Search API
IIndexSearch2 :: SortBy
Syntax
HRESULT Options([in] long options,
[out,retval] long* options);
Parameters
[in] long options
[out,retval] long* options Pointer to a long integer that will contain the current
value.
Remarks
Both messages and their attachments are searched, but the granularity of search
results (Option) defines whether attachments are returned in search results or
only the top-level items.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
[in]
search.Options = (int)EOptionsFlags.roItemGranularity;
[out]
EOptionsFlags eof = (EOptionsFlags )search.Options;
if (eof == EOptionsFlags.roAttachmentGranularity)
{
//do something
}
else //do something else
IIndexSearch2 :: SortBy
This property is used to order the returned search results.
491
492
Search API
IIndexSearch2 :: SortBy
Syntax
HRESULT SortBy([in] BSTR sortProperties,
[out,retval] BSTR* sortProperties);
Parameters
[in] BSTR sortProperties
Remarks
sortProperties can be none or one index property.
The sort order is normally ascending, but you can reverse the order by preceding
the property with a minus sign (-), for example:
search.SortBy = "-" + "adat";
Return value
rvS_OK
Success.
rvE_POINTER
Example
This example shows how to sort by archived date, in descending order.
[C#]
[in]
//sort by archived date descending
search.SortBy = "-" + "adat";
[out]
string sortBy = search.SortBy;
Search API
IIndexSearch2 :: ResultsPropertySet
IIndexSearch2 :: ResultsPropertySet
This property can be used to specify a predefined set of properties returned in
search results.
See Remarks for important comments on using this property.
The property is read/write.
Syntax
HRESULT ResultsPropertySet([in] long propertySet,
[out,retval] long* propertySet);
Parameters
[in] long propertySet
Remarks
As the predefined property sets may change in future releases, we strongly
recommend that you set this property to psEmpty, and use the
AdditionalResultsProperties property and/or AddAdditionalResultsProperty and
AddAdditionalResultsCustomProperty to set the required properties to be found
in the result set.
Return value
rvS_OK
Success.
rvE_POINTER
Example
As this property is no longer the recommended way of setting the returned
properties, it is set to "empty".
493
494
Search API
IIndexSearch2 :: AdditionalResultsProperties
[C#]
[in]
search.ResultPropertySet = (int)EPropertySets.psEmpty;
[out]
if (search.ResultPropertySet != 0)
{
search.ResultPropertySet = 0; // (psEmpty)
}
See also
IIndexSearch2 :: AdditionalResultsProperties
This property is the recommended way to define the properties returned in search
results.
The property is read/write.
Syntax
HRESULT AdditionalResultsProperties([in] BSTR propertiesList);
HRESULT AdditionalResultsProperties([out,retval] BSTR*
propertiesList);
Parameters
[in] BSTR propertiesList
Remarks
The properties added must be in the format of a space delimited list.
Search API
IIndexSearch2 :: Timeout
Properties you define using this property should be in addition to those found in
the predefined property sets. It is recommended that the empty ResultPropertySet
is selected.
See EPropertySets enumeration on page 460.
Return value
rvS_OK
Success.
rvE_POINTER
Example
Note that as IIndexSearch2::ResultPropertySet is no longer a preferred method,
it is set "empty" as a precaution.
[C#]
[in]
search.ResultPropertySet = (int)EPropertySets.psEmpty; //set empty
search.AdditionalResultsProperties = "ssid adat natc";
[out]
string props = search.AdditionalResultsProperties;
if (props.Contains("ssid"))
{
//do something
See also
IIndexSearch2 :: Timeout
This property defines the timeout period applied to search requests.
The property is read/write.
495
496
Search API
IIndexSearch2 :: Timeout
Syntax
HRESULT Timeout([in] long seconds,
[out,retval] long* seconds);
Parameters
Long integer containing number of seconds to wait
before the search times out. The default value is 120
seconds.
[out,retval] long* seconds Pointer to a long integer that will receive the current
value.
Remarks
For searches on indexes created using Enterprise Vault 9.0 or earlier, the timeout
period is only applied to federated search requests (that is, searches across multiple
index volume sets).
For searches on indexes created using Enterprise Vault 10.0 or later, the timeout
period is applied to all search requests.
Return value
rvS_OK
Success.
rvE_POINTER
rvE_INVALIDARG
Example
[C#]
[in][out]
if (search.Timeout < 120)
{
search.Timeout = 120;
}
Search API
IIndexSearch2 :: ArchiveEntryId
IIndexSearch2 :: ArchiveEntryId
This property returns the ID of the archive that is currently selected for searching.
The property is read only.
Syntax
HRESULT ArchiveEntryId([out,retval] BSTR* value)
Parameters
[out,retval] BSTR* value
Remarks
This method will only return a valid Id after SelectArchive has been called.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
//do something
string aeid = search.ArchiveEntryId;
IIndexSearch2 :: ArchiveName
This property returns the name of the archive that is currently selected for
searching.
The property is read only.
497
498
Search API
IIndexSearch2 :: HasFolders
Syntax
HRESULT ArchiveName([out,retval] BSTR* value);
Parameters
[out,retval] BSTR* value
Remarks
This method will only return a valid archive name after SelectArchive has been
called.
If the archive has not been selected, then the return value will be S_FALSE.
If tested in one of the C++ SUCCEEDED or FAILED macros, this will register as
true. It is therefore advisable to test that the value acquired is as expected.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
//display the archive name in a textbox.
textBoxArchId.Text = search.ArchiveName;
IIndexSearch2 :: HasFolders
This property indicates whether the currently selected archive contains a folder
structure.
The property is read only.
Search API
IIndexSearch2 :: IndexVolumeSetIdentity
Syntax
HRESULT HasFolders([out,retval] VARIANT_BOOL* value);
Parameters
[out,retval] VARIANT_BOOL* value
Remarks
This method will only return a valid result after SelectArchive has been called.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
//do something
if (search.HasFolders == true)
{
//do something
IIndexSearch2 :: IndexVolumeSetIdentity
This property identifies the volume set of the index volume to search.
The property is read only.
Syntax
HRESULT IndexVolumeSetIdentity([out,retval] long* value);
499
500
Search API
IIndexSearch2 :: IndexVolumeIdentity
Parameters
[out,retval] long* value
Remarks
This property will return a valid Id after SelectArchive has been called.
It returns -1 and S_FALSE if SelectArchive has not been called, or the selected
archive has multiple index volume sets and SelectIndexVolumeSet has not been
called.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
//do something
long id = search.IndexVolumeSetIdentity;
if (id == -1)
MessageBox.Show("This archive has multiple Index Volume Sets please select one", "Multiple Index Volume Sets", MB_OK);
IIndexSearch2 :: IndexVolumeIdentity
This property should not be used: it is currently available for Enterprise Vault
internal purposes only.
The property is read only.
Syntax
HRESULT IndexVolumeIdentity([out,retval] long* value);
Search API
IIndexSearch2 :: IndexVolumeSetCount
Parameters
[out,retval] long* value
Remarks
This property should not be used.
This property returns the IndexVolumeIdentity as selected by the search
application.
See IndexSearch object on page 485.
Return value
rvS_OK
rvS_FALSE
The archive Id has not been selected, or the internal index volume
identity has not been populated (for example, in a federated search).
rvE_POINTER
IIndexSearch2 :: IndexVolumeSetCount
This property returns the number of index volume sets in the archive's index.
The property is read only.
Syntax
HRESULT IndexVolumeSetCount([out,retval] long* value);
Parameters
[out,retval] long* value Pointer to a long integer that will receive the current
value.
Remarks
This property should not be used before SelectArchive has been called.
501
502
Search API
IIndexSearch2 :: MaxSearchIndexVolumeSets
Return value
rvS_OK
Success.
rvS_FALSE
rvE_POINTER
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
long count = search.IndexVolumeSetCount;
//want to do a federated search depending on number of Index Volume sets
if (count <= 10)
{
//do federated search
search.MaxSearchIndexVolumeSets = count;
//carry on with search
}
else
{
//do non-federated search
}
IIndexSearch2 :: MaxSearchIndexVolumeSets
This property specifies the maximum number of index volume sets that can be
searched by a federated search (that is, a search across multiple index volume
sets).
The property is read/write.
Syntax
HRESULT MaxSearchIndexVolumeSets([out, retval] LONG* pVal,
[in] LONG newVal);
Search API
IIndexSearch2 :: MaxSearchIndexVolumeSets
503
Parameters
[out, retval] LONG* pVal
Remarks
This property should not be used before SelectArchive has been called.
Default value is 5. A search that spans multiple index volume sets is called a
federated search.
The default value has been selected to provide a reasonable performance and
response times for federated searches. Increasing this value will extend response
times and also consume additional memory and CPU resource in the client
application when correlating the search results from the additional index volume
sets' searches.
Return value
rvS_OK
rvE_INVALIDARG The new value being set is less than 1.
rvE_POINTER
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
long count = search.IndexVolumeSetCount;
//want to do a federated search depending on number of Index Volume sets
if (count <= 10)
{
//do federated search
search.MaxSearchIndexVolumeSets = count;
//carry on with search
}
else
504
Search API
IIndexSearch2 :: MaxSearchResultsPerVolumeSet
{
//do non-federated search
IIndexSearch2 :: MaxSearchResultsPerVolumeSet
This property indicates the maximum number of search results that can be
returned per volume set by a federated search (that is, a search across multiple
index volume sets).
The property is read/write.
Syntax
HRESULT MaxSearchResultsPerVolumeSet([out, retval] LONG* pVal,
[in] LONG newVal);
Parameters
[out, retval] LONG* pVal
Remarks
This property should not be used before SelectArchive has been called.
In a federated search, results returned from each volume set are processed and
merged. This property indicates the maximum number of search results per
volume set that can be processed and merged. The default is 1000 search results
per volume set.
The default value has been selected to provide a reasonable performance and
response times for federated searches. Increasing this value will extend response
times and will also consume additional memory and CPU resource in the client
application in order to correlate the increased number of search results.
Return value
rvS_OK
rvE_INVALIDARG The new value being set is less than 1.
rvE_POINTER
Search API
IIndexSearch2 :: SelectArchive
505
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
long count = search.IndexVolumeSetCount;
//want to do a federated search depending on number of Index Volume sets
if (count <= 10)
{
//do federated search
search.MaxSearchIndexVolumeSets = count;
search.MaxsearchResultsPerVolumeSet = 500;
//carry on with search
}
else
{
//do non-federated search
IIndexSearch2 :: SelectArchive
This method is used to select an archive to search.
Syntax
HRESULT SelectArchive([in]BSTR archiveEID);
Parameters
[in]BSTR archiveEID
Remarks
The SelectArchive method specifies the archive to search in subsequent calls to
Search or SearchToXML. The archive must be selected before attempting to list
index volume sets associated with the index, or search the index.
You can find out the ID of an archive by performing a search.
See Performing a search on page 449.
506
Search API
IIndexSearch2 :: ListIndexVolumeSets
Return value
rvS_OK
Success.
rvE_INVALIDARG
rvINDEXING_W_CANT_ACCESS_DIRECTORY
rvINDEXING_E_ARCHIVE_NOT_FOUND
rvINDEXING_W_INDEXDISABLED
Example
Assume that there is a populated IArchives object, "archives".
[C#]
foreach (IArchive archive in archives)
{
search.SelectArchive(archive.Id);
DoSearch(search, 500);
}
See also
IIndexSearch2 :: ListIndexVolumeSets
This method is used to list the index volume set collection for the selected archive
as an XML document.
Syntax
HRESULT ListIndexVolumeSets([in] BSTR processingInstruction,
[out,retval] BSTR* volumeSetsList);
Search API
IIndexSearch2 :: ListIndexVolumeSets
Parameters
String containing an optional parameter
that enables the caller to specify an XML
processing instruction. This is added to
the XML following the XML declaration.
For example, an XSL style sheet
reference can be specified with the
following string:
xml-stylesheet
href="indexvolumesets.xsl"
type="text/xsl"
(XML processing instruction delimiters
are added by the method).
[out,retval] BSTR* volumeSetsList
Remarks
An archive must have been selected using SelectArchive.
This method is an alternative to using the IndexVolumeSets property.
IndexVolumeSets returns a pointer to an enumerated collection of
IIndexVolumeSet interface pointers, which can be accessed using the properties
and methods of the returned interface pointer.
Return value
rvS_OK
Success.
rvE_POINTER
rvINDEXING_W_ARCHIVE_NOT_SET
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
string volSetsXML = search.ListIndexVolumeSets("xml-stylesheet
507
508
Search API
IIndexSearch2 :: SelectIndexVolumeSet
href=indexvolumesets.xsl type=text/xsl");
//do something with the XML
See also
IIndexSearch2 :: SelectIndexVolumeSet
This method selects an index volume set when searching an index with multiple
index volume sets.
Search API
IIndexSearch2 :: SelectIndexVolumeSet
Syntax
HRESULT SelectIndexVolumeSet([in] long volumeSetIdentity);
Parameters
[in] long volumeSetIdentity
Remarks
An archive must have been selected using SelectArchive.
For an index with a single index volume set, that index volume set is selected by
default.
Unless this property is set to specify an index volume set to search, then a
federated search will be carried out across all index volume sets in the archive.
However, if the number of index volume sets exceeds the number set by
MaxSearchIndexVolumeSets (default is 5), this property must be set to determine
which index volume set to search, otherwise the Search API will return an error,
rvINDEXING_E_TOO_MANY_VOLUMES.
See IIndexSearch2 :: MaxSearchIndexVolumeSets on page 502.
Index volume set Ids can be obtained using the ListIndexVolumeSets method.
See IIndexSearch2 :: ListIndexVolumeSets on page 506.
Return value
rvS_OK
Success.
rvE_INVALIDARG
rvINDEXING_W_ARCHIVE_NOT_SET
rvINDEXING_W_UNKNOWN_INDEX_VOLUME_SET
rvINDEXING_W_CANT_ACCESS_DIRECTORY
rvINDEXING_E_ARCHIVE_NOT_FOUND
rvINDEXING_W_UNABLE_FAILED_VOLUME
509
510
Search API
IIndexSearch2 :: SelectIndexVolume
rvINDEXING_E_UNABLE_OFFLINE_VOLUME
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
//set up the search
ISearchResults2 results = null;
if (search.IndexVolumeSetCount > search.MaxSearchIndexVolumeSets)
{
IIndexVolumeSets volSets = (IIndexVolumeSets)search.IndexVolumeSets;
foreach (IIndexVolumeSet volSet in volSets)
{
search.SelectIndexVolumeSet(volSet.Identity);
//do the search etc.
results = (ISearchResults2)search.Search(query.Query, 1, 100, "");
}
}
else results = (ISearchResults2)search.Search(query.Query, 1, 100, "");
IIndexSearch2 :: SelectIndexVolume
This method is used to select a specific index volume of the archive to search.
Syntax
HRESULT SelectIndexVolume([in] long volumeIdentity);
Parameters
[in] long volumeIdentity
Remarks
This method should not be used. An Index Volume Set is considered the smallest
element of an archive's index. The ability to select individual index volumes may
be removed in a future release.
See IndexSearch object on page 485.
Search API
IIndexSearch2 :: Search
Return value
rvS_OK
Success.
rvE_INVALIDARG
rvINDEXING_W_UNKNOWN_INDEX_VOLUME
rvINDEXING_W_ARCHIVE_NOT_SET
rvINDEXING_W_CANT_ACCESS_DIRECTORY
rvINDEXING_E_ARCHIVE_NOT_FOUND
rvINDEXING_W_UNABLE_FAILED_VOLUME
rvINDEXING_E_UNABLE_OFFLINE_VOLUME
IIndexSearch2 :: Search
This method submits the search request and returns a search results object.
See SearchResults object on page 536.
Syntax
HRESULT Search([in] BSTR bsQuery,
[in] long startResult,
[in] long maximumResults,
[in] BSTR reserved,
[out, retval] IUnknown** resultsSet);
Parameters
[in] BSTR bsQuery
511
512
Search API
IIndexSearch2 :: Search
Remarks
An empty query causes a full wildcard search, which matches all entries in the
index. As maximum results will probably be exceeded, it is unlikely to return all
the items in the index.
To ensure a well formed query is passed to this method, obtain an ISearchQuery2
interface pointer and construct a query using the properties and methods of this
interface.
See SearchQuery object on page 462.
Each search starts a new search in the Indexing server.
The startResult and maximumResults arguments enable paging through search
results.
Results are numbered, in order, after sorting. Search results are ordered as follows:
Using the index property specified with the SortBy property, if any.
Otherwise, for those terms where the ESQRank flag was specified in the search
term, by relevance to the words used in the search query.
See ESearchQueryFlags enumeration on page 458.
Return value
rvS_OK
Success.
rvE_POINTER
rvE_ACCESSDENIED
rvE_NOINTERFACE
rvE_SERVER_UNAVAILABLE
rvINDEXING_SERVER_STOPPING
Search API
IIndexSearch2 :: Search
rvINDEXING_E_SERVICE_STOPPING
rvINDEXING_E_ARCHIVE_NOT_SET
INDEXING_W_CANT_ACCESS_DIRECTORY
rvINDEXING_E_ARCHIVE_NOT_FOUND
rvINDEXING_W_ARCHIVE_BEING_DELETED
rvINDEXING_W_UNKNOWN_INDEX_VOLUME_SET
rvINDEXING_W_UNKNOWN_INDEX_VOLUME
rvINDEXING_W_UNABLE_FAILED_VOLUME
rvINDEXING_E_UNABLE_OFFLINE_VOLUME
rvINDEXING_W_SEARCH_WOULD_BLOCK
rvINDEXING_W_SEARCH_TIMEDOUT
rvINDEXING_E_TOO_MANY_RESULTS
rvINDEXING_E_TOO_MANY_VOLUMES
rvINDEXING_E_INVALID_QUERY
rvINDEXING_E_ILLEGAL_WILDCARD_QUERY
rvINDEXING_E_FAILED_SEARCH_REQUEST
rvINDEXING_E_INDEX_SEARCH_FAILED
Example
In this example it is assumed that an ISearchQuery2 object, "query", has been
created and populated.
[C#]
//select the archive and set up the search query etc
//return a results set that starts from the first item found up to a
//total of 100 items.
ISearchResults2 results = (ISearchResults2)search(query.Query, 1,
100, "");
513
514
Search API
IIndexSearch2 :: SearchToXML
See also
IIndexSearch2 :: SearchToXML
This method is used to search the selected index volume set or index volume and
return the results as XML. This method is similar to Search, but it returns XML
not an interface pointer.
Syntax
HRESULT SearchToXML([in] BSTR bsQuery,
[in] long startResult,
[in] long maximumResults,
[in] BSTR reserved,
[in] BSTR processingInstruction,
[in] long xmlFormatOptions,
[out,retval] VARIANT* xmlResults);
Parameters
[in] BSTR bsQuery
Search API
IIndexSearch2 :: SearchToXML
Remarks
EXMLResultsFormatOptions enumerates the XML format option values. Currently
there is only the following default value:
xoNone = 0x00000000
An empty query causes a full wildcard search, which matches all entries in the
index. As maximum results will probably be exceeded, it is unlikely to return all
the items in the index.
To ensure a well formed query is passed to this method, obtain an ISearchQuery2
interface pointer and construct a query using the properties and methods of this
interface.
See SearchQuery object on page 462.
Each search starts a new search in the Indexing server.
The startResults and maximumResults arguments enable paging through search
results.
Results are numbered, in order, after sorting. Search results are ordered as follows:
Using the index property specified with the SortBy property, if any.
Otherwise, for those terms where the ESQRank flag was specified in the search
term, by relevance to the words used in the search query.
See ESearchQueryFlags enumeration on page 458.
Return value
rvS_OK
Success.
rvE_POINTER
rvE_ACCESSDENIED
515
516
Search API
IIndexSearch2 :: SearchToXML
rvE_NOINTERFACE
rvE_SERVER_UNAVAILABLE
rvINDEXING_SERVER_STOPPING
rvINDEXING_E_SERVICE_STOPPING
rvINDEXING_E_ARCHIVE_NOT_SET
INDEXING_W_CANT_ACCESS_DIRECTORY
rvINDEXING_E_ARCHIVE_NOT_FOUND
rvINDEXING_W_ARCHIVE_BEING_DELETED
rvINDEXING_W_UNKNOWN_INDEX_VOLUME_SET
rvINDEXING_W_UNKNOWN_INDEX_VOLUME
rvINDEXING_W_UNABLE_FAILED_VOLUME
rvINDEXING_E_UNABLE_OFFLINE_VOLUME
rvINDEXING_W_SEARCH_WOULD_BLOCK
rvINDEXING_W_SEARCH_TIMEDOUT
rvINDEXING_E_TOO_MANY_RESULTS
rvINDEXING_E_TOO_MANY_VOLUMES
rvINDEXING_E_INVALID_QUERY
rvINDEXING_E_ILLEGAL_WILDCARD_QUERY
rvINDEXING_E_FAILED_SEARCH_REQUEST
rvINDEXING_E_INDEX_SEARCH_FAILED
Example
In this example it is assumed that an ISearchQuery2 object, "query", has been
created and populated.
[C#]
//select the archive and set up the search query etc
byte[] res = (byte[])search.SearchToXML(query.Query, 1, 100, "",
"", 0);
Search API
IIndexSearch2 :: AddAdditionalResultsProperty
IIndexSearch2 :: AddAdditionalResultsProperty
This method is used to add a single property to the AdditionalResultsProperties
list. Using the AdditionalResultsProperty list is now the preferred way of specifying
properties required in the results set.
Syntax
HRESULT AddAdditionalResultsProperty([in] BSTR propertyName);
Parameters
[in] BSTR propertyName
Remarks
In conjunction with AdditionalResultsProperties, this is now the preferred way
to set up a list of properties to be returned. A custom property can be specified
using the propertySet.propertyName format.
Return value
rvS_OK
Success.
rvE_POINTER
rvE_INVALIDARG
Example
[C#]
search.AddAdditionalResultsProperty ("natc");
See also
517
518
Search API
IIndexSearch2 :: AddAdditionalResultsCustomProperty
IIndexSearch2 ::
AddAdditionalResultsCustomProperty
This method is used to add a single custom property to the
AdditionalResultsProperties list.
Syntax
HRESULT AddAdditionalResultsCustomProperty([in] BSTR propertySet,
[in] BSTR propertyName);
Parameters
[in] BSTR propertySet
Remarks
If the property is in the global property set, then the propertySet parameter should
be set to NULL.
Custom properties can be added at the time of storage using the
ISimpleIndexMetadata interface.
Return value
rvS_OK
Success.
rvE_POINTER
rvE_INVALIDARG
Example
[C#]
search.AddAdditionalResultsCustomProperty("custpropset",
"custpropname");
Search API
IIndexSearch2 :: Reset
See also
IIndexSearch2 :: Reset
This method is used to reset the object properties to their default values.
Syntax
HRESULT Reset();
Remarks
This method is used to reset the object properties to their default values.
Return value
rvS_OK
Success.
Example
[C#]
private void resetButton_Click(object sender, EventArgs e)
{
//reset button pressed so reset all object properties to default
search.Reset();
}
IndexVolumeSets object
This object implements the following interface:
IIndexVolumeSets
This interface provides a set of properties than can used to manage a collection
of index volume sets.
Syntax
interface IIndexVolumeSets : IDispatch
519
520
Search API
IndexVolumeSets object
Member summary
Table 7-6
IndexVolumeSets properties
Property
Description
ArchiveEntryId
The archive Id of the archive to which the index volume set collection
belongs.
ArchiveName
HasFolders
Count
_NewEnum
Item
Remarks
An index volume set comprises a sequence of index volumes; the order of index
volumes is defined by the value of FirstItemSequenceNumber. Thus each index
volume set contains all items archived between a start and end date defined by
OldestArchivedDate and YoungestArchivedDate properties of the first and last
index volume respectively.
The volume sets can be enumerated either using the Item property of
IIndexVolumeSets, or using the enumerator returned by _NewEnum.
This interface pointer is returned by a call to the ListIndexVolumeSets method
of IIndexSearch2.
Example
Note that IIndexSearch2::SelectArchive must be called before using
IIndexSearch2::IndexVolumeSets.
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
IIndexVolumeSets volSets = (IIndexVolumeSets)search.IndexVolumeSets;
See also
Search API
IIndexVolumeSets :: ArchiveEntryId
IIndexVolumeSets :: ArchiveEntryId
This property returns the archive Id of the archive to which the index volume set
belongs.
The property is read only.
Syntax
HRESULT ArchiveEntryId([out,retval] BSTR* value);
Parameters
[out,retval] BSTR* valuePointer to a string that will hold the currently selected
archive Id.
Remarks
Gets the ArchiveEntryId associated with the current index volume sets.
SelectArchive must be called prior to using this property.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
521
522
Search API
IIndexVolumeSets :: ArchiveName
IIndexVolumeSets volSets =
(IIndexVolumeSets)search.IndexVolumeSets;
string aeid = volSets.ArchiveEntryId;
IIndexVolumeSets :: ArchiveName
This property returns the name of the archive to which the index volume set
belongs.
The property is read only.
Syntax
HRESULT ArchiveName([out,retval] BSTR* value);
Parameters
[out,retval] BSTR* value Pointer to a string that will contain current name.
Remarks
SelectArchive must be called prior to using this property.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
IIndexVolumeSets volSets = (IIndexVolumeSets)search.IndexVolumeSets;
string archName = volSets.ArchiveName;
IIndexVolumeSets :: HasFolders
This property indicates whether the archive contains a folder structure.
The property is read only.
Search API
IIndexVolumeSets :: Count
523
Syntax
HRESULT HasFolders([out,retval] VARIANT_BOOL* value);
Parameters
[out,retval] VARIANT_BOOL* value
Remarks
SelectArchive must be called prior to using this property.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
IIndexVolumeSets volSets = (IIndexVolumeSets)search.IndexVolumeSets;
if (volSets.HasFolders == true)
{
//do something
IIndexVolumeSets :: Count
This property returns the number of index volume sets associated with the
currently selected archive.
The property is read only.
Syntax
HRESULT Count([out,retval] long* value);
524
Search API
IIndexVolumeSets :: _NewEnum
Parameters
[out,retval] long* value Long pointer to receive the current number of index
volume sets for the current archive.
Remarks
SelectArchive must be called prior to using this property.
Return value
rvS_OK
Success.
rvE_POINTER
The long integer pointer passed to the parameter to receive the current
value is not valid.
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsite1");
IIndexVolumeSets volSets = (IIndexVolumeSets)search.IndexVolumeSets;
for (int i = 1; i <= volSets.Count; i++)
{
IIndexVolumeSet volSet = (IIndexVolumeSet)volSets.Item(i);
//do something
IIndexVolumeSets :: _NewEnum
This property returns an IEnumVARIANT interface on an object that can be used
to enumerate the collection. This property is hidden in VBScript.
Syntax
HRESULT _NewEnum([out,retval] IUnknown** enumerator);
Parameters
[out,retval] IUnknown** enumerator
Search API
IIndexVolumeSets :: Item
Remarks
This property is a standard property used to support enumerating collections, it
is automatically used internally when you use the For Eachconstruct in C#,
VBScript.
SelectArchive must be called prior to using this property.
Return value
rvS_OK
Success.
rvE_POINTER
Examples
The following examples show how to enumerate the Index Volume Sets in an
Index Search object.
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
IIndexVolumeSets volSets =
(IIndexVolumeSets)search.IndexVolumeSets;
foreach (IIndexVolumeSet volSet in volSets)
{
//do something
See also
See IIndexVolumeSets :: Item on page 525.
IIndexVolumeSets :: Item
This property returns an index volume set instance from the collection, based on
the index value passed to it.
The property is read only.
Syntax
HRESULT Item([in] long index,
[out,retval] IUnknown** indexVolumeSet);
525
526
Search API
IIndexVolumeSets :: Item
Parameters
[in] long index
Returns an IUnknown
interface to the index volume
set object.
Remarks
This property provides an alternative method to _NewEnum for accessing the
IIndexVolumeSet pointers contained in the collection.
See IIndexVolumeSets :: _NewEnum on page 524.
IIndexSearch2::SelectArchive must be called prior to using this property.
Return value
rvS_OK
Success.
rvE_POINTER
rvE_INVALIDARG
Example
[C#]
search.SelectArchive("183B7B0F0D085C5428A46D163C39922E61110000evsit
e1");
IIndexVolumeSets volSets =
(IIndexVolumeSets)search.IndexVolumeSets;
for (int i = 1;
{
i <= volSets.Count;
i++)
See also
Search API
IndexVolumeSet object
IndexVolumeSet object
The IndexVolumeSet object implements the following interface:
IIndexVolumeSet
Syntax
interface IIndexVolumeSet : IDispatch
Member summary
Table 7-7
IndexVolumeSet properties
Property
Read/Write
Description
Identity
Read only
ArchiveEntryID
Read only
ArchiveName
Read only
OldestArchivedDate
Read only
YoungestArchivedDate
Read only
OldestItemDate
Read only
527
528
Search API
IIndexVolumeSet :: Identity
Table 7-7
Property
Read/Write
Description
YoungestItemDate
Read only
DateTimesUTC
Read/Write
Remarks
IIndexVolumeSet interface pointers can be obtained using the properties of the
IIndexVolumeSets interface that allows you to iterate through the index volume
sets for an archive.
See IndexVolumeSets object on page 519.
Examples
The following C# examples show two ways of obtaining an object of type
IIndexVolumeSet. Both ways assume that an object of type IIndexVolumeSets,
"volSets", has been obtained.
IIndexVolumeSet volSet = (IIndexVolumeSet)volSets.Item(index);
//index is a 1 based index into the collection of IIndexVolumeSets
or
//Use the foreach method with IIndexVolumeSets::_NewEnum:
foreach (IIndexVolumeSet volSet in volSets)
{
//do something
See also
IIndexVolumeSet :: Identity
This property returns the Id of the current index volume set.
The property is read only.
Search API
IIndexVolumeSet :: ArchiveEntryID
Syntax
HRESULT Identity([out,retval] LONG* value);
Parameters
[out,retval] LONG* value Pointer to a long integer which will receive the current
value.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
IIndexVolumeSets volSets = (IIndexVolumeSets)
search.IndexVolumeSets;
foreach (IIndexVolumeSet volSet in volSets)
{
search.SelectIndexVolumeSet(volSet.Identity);
DoSearch(search, 500);
}
IIndexVolumeSet :: ArchiveEntryID
This property returns the archive Id of the archive to which the index volume set
collection belongs.
The property is read only.
Syntax
HRESULT ArchiveEntryId([out,retval] BSTR* value);
Parameters
[out,retval] BSTR* value
529
530
Search API
IIndexVolumeSet :: ArchiveName
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
string archId = volSet.ArchiveEntryId;
IIndexVolumeSet :: ArchiveName
This property returns the name of the archive to which the index volume set
collection belongs.
The property is read only.
Syntax
HRESULT ArchiveName([out,retval] BSTR*
value);
Parameters
[out,retval] BSTR* value Pointer to a string that will contain the current Id.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
string archId = volSet.ArchiveName;
Search API
IIndexVolumeSet :: FirstItemIndexSequenceNumber
IIndexVolumeSet :: FirstItemIndexSequenceNumber
This property returns the Index Sequence Number (ISN) of the first item in the
index volume set.
The property is read only.
Syntax
HRESULT FirstItemIndexSequenceNumber([out,retval] VARIANT*
value);
Parameters
[out,retval] VARIANT* value
Remarks
The value of this property determines the order of volume sets in the collection.
The number is returned as a VARIANT and could be either a variant type VT_I4
or VT_I8. In Windows 2000, VT_I8 is not supported, so variant type will be
VT_DECIMAL.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
object obj =
volSet.FirstIndexSequenceNumber;
IIndexVolumeSet :: OldestArchivedDate
This property returns the oldest archived date of the items indexed in the index
volume set.
The property is read only.
531
532
Search API
IIndexVolumeSet :: YoungestArchivedDate
Syntax
HRESULT OldestArchivedDate([out,retval] VARIANT* value);
Parameters
[out,retval] VARIANT* value
Remarks
This date value is returned as VARIANT. The variant type will be VT_DATE.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
object obj = volSet.OldestArchivedDate;
DateTime dateTime = (DateTime)obj;
IIndexVolumeSet :: YoungestArchivedDate
This property returns the youngest archived date of the items indexed in the index
volume set.
The property is read only.
Syntax
HRESULT YoungestArchivedDate([out,retval] VARIANT* value);
Parameters
[out,retval] VARIANT* value
Search API
IIndexVolumeSet :: OldestItemDate
Remarks
This date value is returned as VARIANT. The variant type will be VT_DATE.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
object obj = volSet.YoungestArchivedDate;
DateTime dateTime = (DateTime)obj;
IIndexVolumeSet :: OldestItemDate
This property returns the oldest item in the index.
The property is read only.
Syntax
HRESULT OldestItemDate([out,retval] VARIANT* value);
Parameters
[out,retval] VARIANT* value Pointer to a VARIANT that will receive the oldest
date of items in the index volume set.
Remarks
This date value is returned as VARIANT. The variant type will be VT_DATE.
Return value
rvS_OK
Success.
rvE_POINTER
533
534
Search API
IIndexVolumeSet :: YoungestItemDate
Example
[C#]
object obj = volSet.OldestItemDate;
DateTime dateTime = (DateTime)obj;
IIndexVolumeSet :: YoungestItemDate
This property returns the youngest item in the index.
The property is read only.
Syntax
HRESULT YoungestItemDate([out,retval] VARIANT* value);
Parameters
[out,retval] VARIANT* value
Remarks
This date value is returned as VARIANT. The variant type will be VT_DATE.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
object obj = volSet.YoungestItemDate;
DateTime dateTime = (DateTime)obj;
IIndexVolumeSet :: DateTimesUTC
This property indicates whether property values of type VT_DATE are returned
as UTC or local system time.
Search API
IIndexVolumeSet :: DateTimesUTC
Syntax
HRESULT DateTimesUTC([in] VARIANT_BOOL value);
HRESULT DateTimesUTC([out,retval] VARIANT_BOOL* value);
Parameters
[in] VARIANT_BOOL value
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
[in]
IIndexVolumeSets volSets = (IIndexVolumeSets)
search.IndexVolumeSets;
foreach (IIndexVolumeSet volSet in volSets)
{
//make sure we return the datetime in local system time
volSet.DateTimeUTC = false;
object obj = volSet.YoungestItemDate;
DateTime dateTime = (DateTime)obj;
DateTime dt = new DateTime(2006, 12, 31);
if (dateTime > dt)
{
//do something
}
else //do something else
}
[out]
IIndexVolumeSets volSets = (IIndexVolumeSets)
535
536
Search API
SearchResults object
search.IndexVolumeSets;
foreach (IIndexVolumeSet volSet in volSets)
{
bool utc = volSet.DateTimeUTC;
SearchResults object
The SearchResults object implements the following interfaces:
ISearchResults
ISearchResults2
These interfaces provide a set of methods and properties that can be used to query
and manage results returned from a search operation. Each result is represented
by an SearchResult object.
Syntax
interface ISearchResults2 :ISearchResults : IDispatch
Member summary
Table 7-8
SearchResults properties
Property
Read/Write
Description
ISearchResults::Results
Read/Write
ISearchResults::Count
Read only
ISearchResults::Total
Read only
ISearchResults::Start
Read only
ISearchResults::Options
Read only
Search API
SearchResults object
Table 7-8
Property
Read/Write
Description
ISearchResults::SortBy
Read only
ISearchResults::_NewEnum
Read only
Table 7-9
SearchResults methods
Method
Read/Write
Description
ISearchResults::Item
Read only
ISearchResults2::InSync
Read only
ISearchResults2::TruncationReason
Read only
ISearchResults2::DateTimesUTC
Read/Write
ISearchResults2::LoadResults
Write only
Example
An object of type ISearchResults2 is obtained from a call to IIndexSearch2::Search,
or by creating it directly and initializing it with a set of pre-existing results.
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
or
537
538
Search API
ISearchResults :: Results
ISearchResults :: Results
This property gets or sets an XML text string which represents the results string.
The property is read/write.
Syntax
HRESULT Results([out, retval] BSTR *pbsResults,
[in, string] BSTR bsResults);
Parameters
[out, retval] BSTR *pbsResults
Remarks
Search results are stored in XML and can be retrieved or set using this property.
If a new string is stored then any previous results will be lost.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
vE_INVALIDARG
rvE_NOINTERFACE
Example
[C#]
Search API
ISearchResults :: Count
[out]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
//get the results in XML
string xmlResults = results.Results;
[in]
//assume that a previous results set has been stored in the string
xmlResults
ISearchResults2 src = (ISearchResults2) new SearchResults();
//initialise the new object with some existing results
src.Results = xmlResults;
ISearchResults :: Count
This property returns the number of results found by the Search operation.
The property is read only.
Syntax
HRESULT Count([out, retval] long *plCount);
Parameters
[out, retval] long *plCount
Remarks
The number of results returned in this SearchResults object may differ from the
number of results requested.
Return value
rvS_OK
Success.
rvE_POINTER
Example
The following example gives an alternative approach to using "foreach" to
enumerate the results returned.
539
540
Search API
ISearchResults :: Total
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
int num = results.Count;
for (int i = 1; i <= num; i++)
{
ISearchResult2 res = (ISearchResult2)results.Item(i);
ISearchResults :: Total
This property returns the total number of results that matched the search query.
The property is read only.
Syntax
HRESULT Total([out, retval] long *plTotal);
Parameters
[out, retval] long *plTotal
Remarks
Total refers to the total number of hits for the query. This number should be
greater than, or equal to, the number of results (Count).
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
long num = results.Count;
long total = results.Total;
Search API
ISearchResults :: Start
ISearchResults :: Start
This property returns the start position in the entire set of results of the first
result in this SearchResults object.
The property is read only.
Syntax
HRESULT Start([out, retval] long *plStart);
Parameters
[out, retval] long *plStart
Remarks
This value can be from 1 to Total.
A search application will not know what the value of Total is on the first call to
Search.
Note that Total can also change between calls to consecutive searches, as result
of newly archived, indexed and deleted items.
Return value
rvS_OK
Success.
rvE_POINTER
The long integer pointer that was passed to the property is invalid.
Example
[C#]
ISearchResults2 results =
541
542
Search API
ISearchResults :: Options
ISearchResults :: Options
This property returns the value of the Options property of the IndexSearch2 object
used to generate this set of results. The property contains search option flags that
define the granularity of search results.
The property is read only.
Syntax
HRESULT Options([out, retval] long *plOptions);
Parameters
[out, retval] long *plOptions
Remarks
This property retrieves the value that indicates the granularity used to generate
the set of results.
See IIndexSearch2 :: Options on page 490.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
EOptionsFlags eof = (EOptionsFlags )results.Options;
if (eof == EOptionsFlags.roAttachmentGranularity)
{
//do something
Search API
ISearchResults :: SortBy
}
else //do something else
ISearchResults :: SortBy
This property returns the value of the SortBy property of the IndexSearch2 object
used to generate this set of results. The property is used to order the returned
search results.
The property is read only.
Syntax
HRESULT SortBy([out, retval] BSTR *pbsSortBy);
Parameters
[out, retval] BSTR *pbsSortBy
Remarks
See IIndexSearch2 :: SortBy on page 491.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
string sortBy = results.SortBy;
ISearchResults :: _NewEnum
This property returns an IEnumVARIANT interface on an object that can be used
to enumerate the SearchResults collection. This property is hidden in VBScript.
543
544
Search API
ISearchResults :: _NewEnum
Syntax
HRESULT _NewEnum([out,retval] IUnknown** enumerator);
Parameters
[out,retval] IUnknown** enumerator
Remarks
This property is a standard property used to support enumerating collections, it
is automatically used internally when you use the foreachconstruct in C# or
VBScript.
This property provides an alternative to Item for iterating through the collection.
See ISearchResults :: Item on page 545.
Return value
rvS_OK
Success.
rvE_POINTER
Example
This property is not normally called explicitly; it allows the use of "foreach", as
shown in the following example.
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
//do something
Search API
ISearchResults :: Item
ISearchResults :: Item
This method is used to return the specified item in the SearchResult collection
object. The value returned is an ISearchResult interface pointer which provides
properties and methods to allow the user to extract the results data.
Syntax
HRESULT Item([in] long lIndex,
[out, retval] LPVARIANT pvResult);
Parameters
[in] long lIndex
Remarks
This property can be used in place of the _NewEnum property to iterate through
the collection.
See ISearchResults :: _NewEnum on page 543.
Return value
rvS_OK
Success.
rvE_POINTER
rvE_INVALIDARG The value of the first parameter, lIndex, is either less than 1 or
greater than the number of results returned.
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
int num = results.Count;
for (int i = 1; i <= num; i++)
545
546
Search API
ISearchResults2 :: InSync
{
ISearchResult2 res = (ISearchResult2)results.Item(i);
See also
ISearchResults2 :: InSync
This property indicates whether or not the index is synchronized with the current
contents of the archive.
The property is read only.
Syntax
HRESULT InSync([out,retval] VARIANT_BOOL* value);
Parameters
[out,retval] VARIANT_BOOL* value
Remarks
Typically a false value indicates that the index is currently being updated.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
bool inSync = results.InSync;
if (inSync == false)
{
Search API
ISearchResults2 :: TruncationReason
ISearchResults2 :: TruncationReason
This property indicates the reason, if any, for incomplete search results.
The property is read only.
Syntax
HRESULT TruncationReason([out,retval] ETruncationReason* value);
Parameters
[out,retval] ETruncationReason* value
Pointer to an ETruncationReason
enumeration value which
contains the reason for
truncation.
See ETruncationReason
enumeration on page 461.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
ETruncationReason tr = (ETruncationReason)results.TruncationReason;
if (tr == ETruncationReason.trNone)
{
//carry on processing
}
547
548
Search API
ISearchResults2 :: DateTimesUTC
else
{
switch (tr)
{
case ETruncationReason.trAdminResultLimitExceeded:
//handle the problem
break;
case ETruncationReason.trAdminTimeoutExpired:
//handle the problem
break;
//and so on for the other reasons
ISearchResults2 :: DateTimesUTC
This property indicates whether date/time property values are returned as UTC
or local system time.
The property is read/write.
Syntax
HRESULT DateTimesUTC([in] VARIANT_BOOL value);
HRESULT DateTimesUTC([out,retval] VARIANT_BOOL* value);
Parameters
[in] VARIANT_BOOL value
Remarks
By default, items are returned as UTC time.
Return value
rvS_OK
Success.
rvE_POINTER
Search API
ISearchResults2 :: LoadResults
Example
[C#]
[in]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
//make sure date/time values are returned in local system time
results.DateTimesUTC = false;
[out]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
if (results.DateTimesUTC == true)
{
//do something
ISearchResults2 :: LoadResults
This method can be used to load an instance of ISearchResults2 with the XML
results returned by the IIndexSearch2.SearchToXML method.
Syntax
HRESULT LoadResults([in] VARIANT rResultsXML);
Parameters
[in] VARIANT rResultsXML
Remarks
For information on the XML schema used to return the search results, consult
Symantec support.
If possible, use the SearchResults object rather than processing the XML directly.
The VARIANT may contain an IStream, byte array (SAFEARRAY) or a string (BSTR)
containing the XML.
Return value
rvS_OK
Success.
549
550
Search API
SearchResult object
Example
In this example, it is assumed that there is a string holding a set of XML results
from a previous search, called xmlResults.
[C#]
ISearchResults2 results = (ISearchResults2) new SearchResults();
results.LoadResults(xmlResults);
SearchResult object
The SearchResult object implements the following interfaces:
ISearchResult
ISearchResult2
These interfaces provide methods and properties that allow the user to examine
the individual results returned after a call to Search.
Syntax
interface ISearchResult2 : ISearchResult : IDispatch
Member summary
Table 7-10
SearchResult properties
Property
Read/Write
Description
ISearchResult::Result
Read/Write
ISearchResult::Number
Read only
ISearchResult2::Count
Read
ISearchResult2::DateTimesUTC Read/Write
Search API
ISearchResult :: Result
Table 7-11
SearchResult methods
Method
Description
ISearchResult::Prop
ISearchResult::Prop2
ISearchResult2::Item
Remarks
ISearchResult interface pointers are obtained by using either
ISearchResults::_NewEnum and iterating through the collection, or by using
ISearchResults::Item to obtain a specific pointer from the collection.
Examples
The following examples show two different ways of iterating through results in
a SearchResults collection object. It is assumed there is an ISearchResults2 object,
"results", obtained from a search.
[C#]
ISearchResult2 res = (ISearchResult2)results.Item(index);
//index is a 1 based index into the collection of ISearchResult's.
or
foreach (ISearchResult2 res in results)
{
ISearchResult :: Result
This property is used to get an XML string for this result or to set a new XML
string.
Syntax
HRESULT Result([out, retval] BSTR *pbsResult,
[in, string] BSTR bsResult);
551
552
Search API
ISearchResult :: Number
Parameters
[out, retval] BSTR *pbsResult
Remarks
This property is simply the XML string for the search result stored in this result
object, or an empty string if the object is not initialized. It can also be used to store
an XML result. Any previous result will be overwritten.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
string xmlResult = res.Result;
//do something
ISearchResult :: Number
This property returns the unique identifier for this result.
Syntax
HRESULT Number([out, retval] long *plNumber);
Search API
ISearchResult :: Prop
Parameters
[out, retval] long *plNumber
Remarks
Returns the unique identifier for this result within the collection. The Id is stored
in the NUMBER attribute of each XML result tag.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
long number = res.Number;
ISearchResult :: Prop
This method returns the specified property for the current result.
Syntax
HRESULT Prop([in, string] BSTR bsName,
[out, retval] LPVARIANT pvVal);
Parameters
[in, string] BSTR bsName
553
554
Search API
ISearchResult :: Prop2
Remarks
The value returned can be either a date, string or integer. If the value is
multi-valued, the returned VARIANT is an array of VARIANTS, each of which
contains a date, string or integer value.
The following VARIANT types may be returned: VT_I4, VT_UI4, VT_I8,
VT_DECIMAL, VT_DATE, VT_BSTR or VT_EMPTY.
The name can be that of a custom property, in the propertySet.propertyName
format.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
object obj = res.Prop("ssid");
string ssid = (string)obj;
RetrieveItem(ssid);
ISearchResult :: Prop2
This method is used to get the value of a specific custom property.
Syntax
HRESULT Prop2([in] BSTR bsName,
[in] BSTR bsPropertySet,
[in] BSTR bsPropertyName,
[out, retval] LPVARIANT pvVal);
Search API
ISearchResult :: Prop2
Parameters
[in] BSTR bsName
Remarks
This method returns the value of a custom property. If the requested property
does not exist, an initialized but empty VARIANT will be returned.
The value returned can be either a date, string or integer. If the value is
multi-valued, the returned VARIANT is an array of VARIANTS, each of which
contains a date, string or integer value.
The following VARIANT types may be returned: VT_I4, VT_UI4, VT_I8,
VT_DECIMAL, VT_DATE, VT_BSTR or VT_EMPTY.
Return value
rvS_OK
Success.
rvE_POINTER
rvS_FALSE
Example
This example assumes there is a custom property set, "CustomTags", which has
an integer property, "Importance".
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
int tag = 0;
//the prop we want should be an int but make sure
555
556
Search API
ISearchResult2 :: Count
ISearchResult2 :: Count
This property returns the number of properties in the current search result.
The property is read only.
Syntax
HRESULT Count([out, retval] long* count);
Parameters
[out, retval] long* count
Return value
rvS_OK
Success.
rvE_POINTER
The long integer pointer passed into receive the count number is
invalid.
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
int count = res.Count;
for (int i = 1; i < = count; i++)
{
object objProp = null;
object objVal = null;
res.Item(i, out objProp, out objVal);
if ((string)objProp == "ssid")
Search API
ISearchResult2 :: Item
{
string ssid = (string)objVal;
//do something
ISearchResult2 :: Item
This method returns the property name and value of the property at the position
in the index specified by the first parameter.
Syntax
HRESULT Item([in] long index,
[out] LPVARIANT propertyName,
[out] LPVARIANT propertyValue);
Parameters
[in] long index
Remarks
Use this method to obtain the name and value of a property at a specific position
in the collection. Note that the collection is 1-based not 0-based.
The value returned can be either a date, string or integer. If the value is
multi-valued, the returned VARIANT is an array of VARIANTS, each of which
contains a date, string or integer value.
The following VARIANT types may be returned: VT_I4, VT_UI4, VT_I8,
VT_DECIMAL, VT_DATE, VT_BSTR or VT_EMPTY.
The name can be that of a custom property, in the propertySet.propertyName
format.
Return value
rvS_OK
Success.
557
558
Search API
ISearchResult2 :: DateTimesUTC
rvE_POINTER
rvE_INVALIDARG The index was outside the range 1 to the number of properties.
Example
[C#]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
int count = res.Count;
for (int i = 1; i < = count; i++)
{
object objProp = null;
object objVal = null;
res.Item(i, out objProp, out objVal);
if ((string)objProp == "ssid")
{
string ssid = (string)objVal;
//do something
ISearchResult2 :: DateTimesUTC
This property indicates whether property values of type VT_DATE are returned
as UTC or local system time.
The property is read/write.
Syntax
HRESULT DateTimesUTC([in] VARIANT_BOOL value,
[out,retval] VARIANT_BOOL* value);
Parameters
[in] VARIANT_BOOL value
Search API
ISearchResult2 :: DateTimesUTC
Remarks
By default, items are always archived using UTC time.
Return value
rvS_OK
Success.
rvE_POINTER
Example
[C#]
[in]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
//make sure date/times are returned in local system time
res.DateTimesUTC = false;
//do something
[out]
ISearchResults2 results =
(ISearchResults2)search.Search(query.Query, 1, 100, "");
foreach (ISearchResult2 res in results)
{
bool isUTC = res.DateTimesUTC;
//do something
559
560
Search API
ISearchResult2 :: DateTimesUTC
Chapter
Retention API
This chapter includes the following topics:
Retention API
Enumerations
RetentionCategories object
IRetentionCategories :: Count
IRetentionCategories :: _NewEnum
IRetentionCategories :: Item
IRetentionCategories :: DirectoryDNSAlias
IRetentionCategories :: Lookup
IRetentionCategories :: Create
IRetentionCategories :: Add
IRetentionCategories :: Update
IRetentionCategories2 :: Get
RetentionCategory object
IRetentionCategory :: Period
IRetentionCategory :: Units
IRetentionCategory :: IsVisible
IRetentionCategory :: Identifier
562
Retention API
About Retention API
IRetentionCategory :: Name
IRetentionCategory :: Description
IRetentionCategory :: OnHold
IRetentionCategory :: Locked
IRetentionCategory2 :: ExpiryBasis
Retention API
The Retention API enables management of the set of Enterprise Vault retention
categories. An application using the Content Management API to archive items
or an application using the Filtering APIs can use the Retention API to select an
existing retention category, or create a new retention category.
The Retention API enables client applications to:
Components
The API consists of two apartment-threaded, automation-friendly COM classes:
RetentionCategories
RetentionCategories implements a collection object of class RetentionCategory.
It implements the IRetentionCategories and IRetentionCategories2 interfaces.
The methods and properties enable the calling application to enumerate the
current list of retention categories and add new retention categories.
RetentionCategory
The RetentionCategory class maintains a collection of RetentionCategory
properties. It implements the IRetentionCategory and IRetentionCategory2
interfaces. The methods and properties enable the calling application to view
and change the various attributes of a retention category.
Retention API
Enumerations
Security
No special privileges are required to list and read retention categories.
To create or update retention categories requires that the API is run under the
Vault Service Account, or an account that is in a suitable Enterprise Vault
roles-based administration role that includes the role task "EVT Administer
Enterprise Vault Retention Categories".
Enumerations
This section describes enumerations used by the Retention API.
ExpiryBasisInherit takes the value set for the Enterprise Vault site.
The retention category cannot be saved or updated if the value set is
ExpiryBasisUnknown.
563
564
Retention API
RetentionCategories object
RetentionCategories object
The RetentionCategories object implements the following interfaces:
IRetentionCategories
IRetentionCategories2 (default)
The interfaces implement a collection object for the creation and enumeration of
RetentionCategory objects.
The IRetentionCategories2 interface inherits the properties and methods of the
IRetentionCategories interface, and also provides a Get method to retrieve the
properties of a retention category.
Syntax
interface IRetentionCategories : IDispatch
interface IRetentionCategories2 : IRetentionCategories
Member summary
Table 8-1
IRetentionCategories properties
Property
Read/Write
Description
Count
Read only
_NewEnum
Read only
Item
Read/Write
DirectoryDNSAlias
Write only
Table 8-2
IRetentionCategories methods
Method
Description
Lookup
Retention API
IRetentionCategories :: Count
Table 8-2
Method
Description
Create
Add
Update
Table 8-3
IRetentionCategories2 method
Method
Description
Get
Remarks
To ensure all available retention category properties can be retrieved, use the Add
method to create a new retention category, and the Get method to retrieve details
of a retention category.
The DirectoryDNSAlias property identifies an Enterprise Vault server that can
be used to access the Enterprise Vault Directory for retention category information.
Requirements
See Programming notes on page 56.
CLSID
744FC7D7-6933-4696-AC3F-9EFC1E00C96B
Prog ID
EnterpriseVault.RententionCategories
Type Library
RetentionAPILib
DLL
EVRetentionAPI.dll
KVS.EnterpriseVault.Interop.RetentionAPI.dll
KVS.EnterpriseVault.Interop
IRetentionCategories :: Count
This property returns the number of retention categories in the collection.
565
566
Retention API
IRetentionCategories :: Count
Syntax
HRESULT Count([out, retval] long *plCount);
Parameters
[out, retval] long *plCount Pointer to a long that will contain the current value.
Return value
S_OK
Success.
E_POINTER
Example
The following Visual Basic script example enumerates the available retention
categories.
Dim
Dim
Dim
Dim
oRCs
oRC
sNames
sMsg
Retention API
IRetentionCategories :: _NewEnum
IRetentionCategories :: _NewEnum
This property returns an IEnumVARIANT interface on an object that can be used
to enumerate the collection of retention categories. This property is hidden in
Visual Basic and Visual Basic Scripting Edition (VBScript).
The property is read only.
Syntax
HRESULT _NewEnum([out,retval] IUnknown** enumerator);
Parameters
[out,retval] IUnknown** enumerator
Remarks
This property is a standard property used to support enumerating collections, it
is automatically used internally when you use the For Eachconstruct in .NET
managed code or VBScript.
This property returns a collection of RetentionCategory objects.
Return value
S_OK
Success.
E_POINTER
Example
Dim
Dim
Dim
Dim
oRCs
oRC
sNames
sMsg
567
568
Retention API
IRetentionCategories :: Item
IRetentionCategories :: Item
This property returns the nth retention category object in the collection.
The property is read/write.
Syntax
propget] HRESULT Item([in] long index, [out, retval] VARIANT* pVal);
Parameters
[in] long Index
Remarks
This method enables an alternative method of enumerating the retention
categories in the collection.
Return value
S_OK
Success.
E_POINTER
E_INVALIDARG
Retention API
IRetentionCategories :: DirectoryDNSAlias
Example
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory retCat = (IRetentionCategory)retcats.Item(i +
1);
IRetentionCategories :: DirectoryDNSAlias
This property is used to identify a computer running an Enterprise Vault Directory
Service, in order to retrieve information from the Enterprise Vault Directory.
The property is write only.
Syntax
HRESULT DirectoryDNSAlias([in] BSTR bstrVal);
Parameters
[in] BSTR bstrVal
Remarks
The Id of an Enterprise Vault Site can be found in the following registry entry on
an Enterprise Vault server:
HKEY_LOCAL_MACHINE
\SOFTWARE
\Wow6432Node
\KVS
569
570
Retention API
IRetentionCategories :: DirectoryDNSAlias
\Enterprise Vault
\SiteID
Return value
S_OK
Success.
E_UNEXPECTED
SiteIdNotFound
Example
The following example sets a value for DirectoryDNSAlias in order to list retention
categories on a remote Enterprise Vault server.
Dim
Dim
Dim
Dim
oRCs
oRC
sNames
sMsg
Retention API
IRetentionCategories :: Lookup
IRetentionCategories :: Lookup
This method is used to obtain details of a retention category when the Name or
Id of the retention category is known.
As this method does not return all available retention category properties, we
recommend that you use the Get method instead.
Syntax
HRESULT Lookup([in]
[out]
[out]
[out]
[out]
[out]
[out,
BSTR NameOrId,
VARIANT *Period,
VARIANT *Units,
VARIANT *IsVisible,
VARIANT* Id,
VARIANT* RCName,
retval] VARIANT* RCFound);
Parameters
.[in] BSTR NameOrId
[out] VARIANT* Id
571
572
Retention API
IRetentionCategories :: Create
[out, retval] VARIANT* RCFound A boolean return value that indicates whether
or not the lookup was successful.
Return value
S_OK
Success.
E_UNEXPECTED
Example
The following Visual Basic script example looks up the values assigned to the
Public retention category.
Dim oAPI
Dim msg
Set oAPI = CreateObject("EnterpriseVault.RetentionCategories")
Dim id, name, units, period, isvisible
oAPI.Lookup "Public", period, units, isvisible, id, name
set oAPI = Nothing
msg
msg
msg
msg
msg
=
=
=
=
=
msg
msg
msg
msg
msg
&
&
&
&
&
"
"
"
"
"
Msgbox(msg)
IRetentionCategories :: Create
This method is used to create a new retention category.
As this method does not allow the specification of all available retention category
properties, we recommend that you use the Add method instead.
Syntax
HRESULT Create([in] BSTR Name,
[in] LONG Period,
Retention API
IRetentionCategories :: Create
Parameters
[in] BSTR Name
[out,retval] BSTR* Id
Remarks
If the value of Period is 999999, and the value of Units is Years, the retention
period is "forever".
If IsVisible is false, the retention category is still visible in the Enterprise Vault
Administration Console.
This method does not allow you to set a specific value for the ExpiryBasis property;
the default value for the Enterprise Vault site will be used.
Return value
S_OK
Success.
E_UNEXPECTED
E_INVALIDARG
573
574
Retention API
IRetentionCategories :: Add
Example
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.Create("New business",10, RetentionUnits.Months, false,
"New business correspondence");
IRetentionCategories :: Add
This is the preferred method for creating a new retention category and adding it
to the collection object.
Syntax
HRESULT Add([in] IUnknown* RetentionCategory);
Parameters
.[in] IUnknown* RetentionCategory A reference to a RetentionCategory object.
Remarks
An error will be returned if a retention category already exists with the same
name.
If the value of Period is 999999, and the value of Units is Years, the retention
period is "for ever".
Return value
S_OK
Success.
E_UNEXPECTED
E_INVALIDARG
E_NOINTERFACE
Retention API
IRetentionCategories :: Add
Example
The following Visual Basic script example adds two new retention categories:
Finance and Legal.
Dim oRCS
Dim oRC
Set oRCS = CreateObject("EnterpriseVault.RetentionCategories")
'Create a Retention Category
Set oRC = Nothing
Set oRC = CreateObject("EnterpriseVault.RetentionCategory")
oRC.Name = "Finance"
oRC.Description = "For finance dept items"
oRC.Units = 3
oRC.Period = 6
oRC.IsVisible = True
oRC.OnHold = False
oRC.Locked = False
oRCS.Add(oRC)
msgbox(oRC.identifier)
'Create another Retention Category
Set oRC = Nothing
Set oRC = CreateObject("EnterpriseVault.RetentionCategory")
oRC.Name = "Legal"
oRC.Description = "For legal department items"
oRC.Units = 3
oRC.Period = 7
oRC.IsVisible = False
oRC.OnHold = True
oRC.Locked = True
oRCS.Add(oRC)
msgbox(oRC.identifier)
575
576
Retention API
IRetentionCategories :: Update
IRetentionCategories :: Update
This method is used to change an existing retention category.
Syntax
HRESULT Update([in] IUnknown* RetentionCategory);
Parameters
.[in] IUnknown* RetentionCategory Reference to the RetentionCategory object
to be updated.
Remarks
Any changes that you make to a retention category will be retrospective, and be
applied to unexpired items that have been archived with the retention category.
An error will be returned if the retention category specified does not exist.
Return value
S_OK
Success.
E_UNEXPECTED
E_INVALIDARG
RetentionCategoryNotExist
Example
The following example updates details of retention categories on a remote
computer and sets all the retention categories on hold.
Dim
Dim
Dim
Dim
oRCs
oRC
sNames
sMsg
Retention API
IRetentionCategories2 :: Get
else
oRCs.DirectoryDNSAlias = "ourvaultsite.domain.com"
MsgBox("There are " & oRCs.Count & " categories")
For Each oRC In oRCs
sMsg = "Category is " & oRC.Name & " ; IsVisible=" &
oRC.IsVisible & " ; OnHold=" & oRC.OnHold & " ;
Locked=" & oRC.Locked
MsgBox(sMsg)
oRC.OnHold = true
oRCs.Update(oRC)
sNames = sNames & " " & oRC.Name
Next
set oRCS = Nothing
MsgBox("The list is: " & sNames)
end if
IRetentionCategories2 :: Get
This is the preferred method for obtaining details of a retention category. It returns
a populated instance of the RetentionCategory object.
Syntax
HRESULT Get([in] BSTR NameOrId,
[out, retval] IUnknown** RetentionCategory);
Parameters
[in] BSTR NameOrId
Remarks
This method supersedes the Lookup method as it enables the retrieval of all
available retention category properties, including the ExpiryBasis property.
Return value
S_OK
Success.
E_INVALIDARG
E_UNEXPECTED
577
578
Retention API
RetentionCategory object
RetentionCategoryNotExist
Example
IRetentionCategories2 retCats2 = (IRetentionCategories2) new
RetentionCategoriesClass();
IRetentionCategory retcat =
(IRetentionCategory)retCats2.Get("Business");
RetentionCategory object
The RetentionCategory object implements the following interfaces:
IRetentionCategory
IRetentionCategory2 (default)
Syntax
interface IRetentionCategory : IDispatch
interface IRetentionCategory2 : IRetentionCategory
Member summary
Table 8-4
IRetentionCategory properties
Property
Read/Write
Description
Period
read/write
Units
read/write
IsVisible
read/write
Identifier
read/write
Retention API
IRetentionCategory :: Period
Table 8-4
Property
Read/Write
Description
Name
read/write
Description
read/write
OnHold
read/write
Locked
read/write
IRetentionCategory2 property
Table 8-5
Property
Read/Write
Description
ExpiryBasis
read/write
Remarks
A RetentionCategory pointer can either be obtained using CoCreateInstance (or
the equivalent in .NET or Visual Basic), or by obtaining one from the collection
held in an instance of RetentionCategories.
Requirements
CLSID
333D8892-6804-4090-942B-43909C498951
Prog ID
EnterpriseVault.RetentionCategory
IRetentionCategory :: Period
This property describes the number of retention units (days, weeks, months, years)
an item is to be retained.
The property is read/write.
579
580
Retention API
IRetentionCategory :: Period
Syntax
HRESULT Period([out, retval] long* pVal);
HRESULT Period([in] long newVal);
Parameters
[out, retval] long* pVal
Remarks
If the value of Period is 999999, and the value of Units is Years, the retention
period is "for ever".
Return value
S_OK
Success.
E_POINTER
E_INVALIDARG
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory retcat = (IRetentionCategory) new
RetentionCategoryClass();
retcat.Name = "Finance";
retcat.Description = "For finance depts";
retcat.Identifier = "xyz";
retcat.Units = RetentionUnits.Months;
retcat.Period = 10;
retcat.IsVisible = true;
Retention API
IRetentionCategory :: Units
retcat.OnHold = true;
retcat.Locked = true;
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory retCat = (IRetentionCategory)retcats.Item(i +
1);
string name = retCat.Name;
string descr = retCat.Description;
string ident = retCat.Identifier;
RetentionUnits ru = retCat.Units;
long period = retCat.Period;
bool isVis = retCat.IsVisible;
bool onHold = retCat.OnHold;
bool locked = retCat. Locked;
IRetentionCategory :: Units
This property describes whether the period is expressed in days, weeks, months
or years.
The property is read/write.
Syntax
HRESULT Units([out, retval] RetentionUnits* pVal);
HRESULT Units([in] RetentionUnits newVal);
581
582
Retention API
IRetentionCategory :: Units
Parameters
[out, retval] RetentionUnits* pVal
Remarks
If the value of Period is 999999, and the value of Units is Years, the retention
period is "for ever".
Return value
S_OK
Success.
E_POINTER
E_INVALIDARG
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory retcat = (IRetentionCategory) new
RetentionCategoryClass();
retcat.Name = "Finance";
retcat.Description = "For finance depts";
retcat.Identifier = "xyz";
retcat.Units = RetentionUnits.Months;
retcat.Period = 10;
retcat.IsVisible = true;
retcat.OnHold = true;
retcat.Locked = true;
Retention API
IRetentionCategory :: IsVisible
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory retCat = (IRetentionCategory)retcats.Item(i +
1);
period = retCat.Period;
isVis = retCat.IsVisible;
onHold = retCat.OnHold;
locked = retCat. Locked;
IRetentionCategory :: IsVisible
This property describes whether the retention category is to be displayed to end
users.
The property is read/write.
Syntax
HRESULT IsVisible([out, retval] VARIANT_BOOL* pVal);
HRESULT IsVisible([in] VARIANT_BOOL newVal);
Parameters
[out, retval] VARIANT_BOOL* pVal Reference to current value.
New value.
583
584
Retention API
IRetentionCategory :: IsVisible
Remarks
All retention categories are visible to administrators in the Administration Console,
even if this the value of this property is FALSE.
Return value
S_OK
Success.
E_POINTER
E_INVALIDARG
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory retcat = (IRetentionCategory) new
RetentionCategoryClass();
retcat.Name = "Finance";
retcat.Description = "For finance depts";
retcat.Identifier = "xyz";
retcat.Units = RetentionUnits.Months;
retcat.Period = 10;
retcat.IsVisible = true;
retcat.OnHold = true;
retcat.Locked = true;
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
Retention API
IRetentionCategory :: Identifier
IRetentionCategory :: Identifier
This parameter uniquely identifies the retention category.
The property is read/write.
Syntax
HRESULT Identifier([out, retval] BSTR* pVal);
HRESULT Identifier([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal Pointer to a string containing the retention category Id.
String containing retention category Id (up to 250
Unicode characters).
Return value
S_OK
Success.
E_POINTER
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
585
586
Retention API
IRetentionCategory :: Identifier
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory retcat = (IRetentionCategory) new
RetentionCategoryClass();
retcat.Name = "Finance";
retcat.Description = "For finance depts";
retcat.Identifier = "xyz";
retcat.Units = RetentionUnits.Months;
retcat.Period = 10;
retcat.IsVisible = true;
retcat.OnHold = true;
retcat.Locked = true;
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory retCat = (IRetentionCategory)retcats.Item(i +
1);
string name = retCat.Name;
string descr = retCat.Description;
string ident = retCat.Identifier;
RetentionUnits ru = retCat.Units;
long period = retCat.Period;
bool isVis = retCat.IsVisible;
bool onHold = retCat.OnHold;
bool locked = retCat. Locked;
Retention API
IRetentionCategory :: Name
IRetentionCategory :: Name
This parameter identifies the retention category to end users and the
administrator.
The property is read/write.
Syntax
HRESULT Name([out, retval] BSTR* pVal);
HRESULT Name([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Return value
S_OK
Success.
E_POINTER
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory retcat = (IRetentionCategory) new
RetentionCategoryClass();
retcat.Name = "Finance";
retcat.Description = "For finance depts";
retcat.Identifier = "xyz";
retcat.Units = RetentionUnits.Months;
retcat.Period = 10;
587
588
Retention API
IRetentionCategory :: Description
retcat.IsVisible = true;
retcat.OnHold = true;
retcat.Locked = true;
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory retCat = (IRetentionCategory)retcats.Item(i +
1);
string name = retCat.Name;
string descr = retCat.Description;
string ident = retCat.Identifier;
RetentionUnits ru = retCat.Units;
long period = retCat.Period;
bool isVis = retCat.IsVisible;
bool onHold = retCat.OnHold;
bool locked = retCat. Locked;
IRetentionCategory :: Description
This property describes the retention category to the administrator.
The property is read/write.
Syntax
HRESULT Description([out, retval] BSTR* pVal);
HRESULT Description([in] BSTR newVal);
Parameters
[out, retval] BSTR* pVal
Retention API
IRetentionCategory :: OnHold
Remarks
When creating a retention category, this property must be set. The value cannot
be an empty string.
Return value
S_OK
Success.
E_POINTER
E_INVALIDARG
IRetentionCategory :: OnHold
This property describes whether archived items with a particular retention
category can be deleted or expired. This protection applies during the retention
period, and also after the retention period has expired.
While this property remains true, neither users nor Enterprise Vault storage
expiry can delete items that have been stored using this retention category.
The property is read/write.
Syntax
HRESULT OnHold([out, retval] VARIANT_BOOL* pVal);
HRESULT OnHold([in] VARIANT_BOOL newVal);
Parameters
[out, retval] VARIANT_BOOL* pVal
New value.
Remarks
This retention category hold is different from the Legal Hold feature.
589
590
Retention API
IRetentionCategory :: OnHold
Return value
S_OK
Success.
E_POINTER
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory retcat = (IRetentionCategory) new
RetentionCategoryClass();
retcat.Name = "Finance";
retcat.Description = "For finance depts";
retcat.Identifier = "xyz";
retcat.Units = RetentionUnits.Months;
retcat.Period = 10;
retcat.IsVisible = true;
retcat.OnHold = true;
retcat.Locked = true;
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory retCat = (IRetentionCategory)retcats.Item(i +
1);
Retention API
IRetentionCategory :: Locked
IRetentionCategory :: Locked
This property enables a lock to be put on a retention category. This prevents an
administrator from inadvertently modifying the retention category.
The property is read/write.
Syntax
HRESULT Locked([out, retval] VARIANT_BOOL* pVal);
HRESULT Locked([in] VARIANT_BOOL newVal);
Parameters
[out, retval] VARIANT_BOOL* pVal
New value.
Remarks
In the Administration Console, this lock feature can be controlled using the
checkbox, Lock this Retention Category, in the retention category properties.
Return value
S_OK
Success.
E_POINTER
591
592
Retention API
IRetentionCategory :: Locked
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory retcat = (IRetentionCategory) new
RetentionCategoryClass();
retcat.Name = "Finance";
retcat.Description = "For finance depts";
retcat.Identifier = "xyz";
retcat.Units = RetentionUnits.Months;
retcat.Period = 10;
retcat.IsVisible = true;
retcat.OnHold = true;
retcat.Locked = true;
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory retCat = (IRetentionCategory)retcats.Item(i +
1);
string name = retCat.Name;
string descr = retCat.Description;
string ident = retCat.Identifier;
RetentionUnits ru = retCat.Units;
long period = retCat.Period;
bool isVis = retCat.IsVisible;
bool onHold = retCat.OnHold;
Retention API
IRetentionCategory2 :: ExpiryBasis
IRetentionCategory2 :: ExpiryBasis
This property indicates the date from which storage expiry is calculated.
The property is read/write.
Syntax
HRESULT ExpiryBasis([out, retval] RetentionDateBasis* pVal);
HRESULT ExpiryBasis([in] RetentionDateBasis newVal);
Parameters
[out, retval] RetentionDateBasis* pVal Enumeration value for date used to
calculate storage expiry.
See Retention Date Basis
enumeration on page 563.
[in] RetentionDateBasis newVal
RetentionDateBasis enumeration
value.
Remarks
To retrieve the value of this property use the Get method; it is not returned by
the Lookup method.
Return value
S_OK
Success.
E_POINTER
E_INVALIDARG
Example
[in]
IRetentionCategories retcats = (IRetentionCategories) new
RetentionCategoriesClass();
593
594
Retention API
IRetentionCategory2 :: ExpiryBasis
retCats.DirectoryDNSAlias = "SERVER1";
IRetentionCategory2 retcat2 = (IRetentionCategory2) new
RetentionCategoryClass();
retcat2.Name = "Finance";
retcat2.Description = "For finance depts";
retcat2.Identifier = "xyz";
retcat2.Units = RetentionUnits.Months;
retcat2.Period = 10;
retcat2.IsVisible = true;
retcat2.OnHold = true;
retcat2.Locked = true;
retcat2.ExpiryBasis = RetentionDataBasis. ExpiryBasisArchiveDate;
retCats.Add(retCat);
[out]
IRetentionCategories retCats = (IRetentionCategories) new
RetentionCategoriesClass();
retCats.DirectoryDNSAlias = "SERVER1";
for (int i = 0; i < retCats.Count; i++)
{
IRetentionCategory2 retCat = (IRetentionCategory2)retcats.Item(i +
1);
string name = retCat2.Name;
string descr = retCat2.Description;
string ident = retCat2.Identifier;
RetentionUnits ru = retCat2.Units;
long period = retCat2.Period;
bool isVis = retCat2.IsVisible;
bool onHold = retCat2.OnHold;
bool locked = retCat2.Locked;
RetentionDataBasis rdb = retCat2.ExpiryBasis;
Appendix
System properties
System properties
596
Multi-valued properties can have multiple values for a single index entry.
Sortable properties are those that can be used to order search results. Properties
marked as Yes are optimized in the index for sorting and provide the quickest
results.
System properties
This section lists the system properties defined in Enterprise Vault.
All properties in this table have defined constants, IndexPropXXXX, where XXXX
is the uppercase form of the property name. For example, IndexPropSUBJ is the
constant for the defined property, "subj", and IndexPropRCAT is the constant for
the system property, "rcat".
Table A-1
System properties
Description
Name
Type
Subject/Title
subj
String
Yes
Yes
No
No
Message Priority
prio
String
Yes
Yes
No
No
Notes
Table A-1
Description
Name
Type
Notes
Message Importance
impo
String
Yes
Yes
No
No
Technically no limit,
practically limited to 32-bit
integer maximum.
Message Sensitivity
sens
String
Yes
Yes
No
No
Message Security
secu
String
Yes
Yes
No
No
Message Originator
orgn
String
Yes
No
No
No
iden
String
Yes
Yes
No
No
mdat
Date
Yes
Yes
No
Yes
String
Yes
Yes
No
No
dtyp
String
Yes
Yes
No
No
De-duplication
fingerprint of item
fpdd
String
Yes
Yes
No
No
String
Yes
Yes
No
No
597
598
Table A-1
Description
Name
Type
Notes
Archived Date
adat
Date
Yes
Yes
No
Yes
String
Yes
Yes
No
No
A sequence of folders.
String
No
Yes
No
No
A sequence of folders.
lolf
String
No
Yes
No
No
cllf
String
No
Yes
No
No
Original location
lofn
folder names (ordered)
String
No
Yes
Yes
No
String
No
Yes
Yes
No
String
Yes
Yes
No
No
ssid
Shortcut location
shct
String
No
Yes
No
No
String
No
Yes
No
No
Original retention
category Id
String
Yes
Yes
No
No
rcat
Table A-1
Description
Name
Type
Notes
Current retention
category Id
crct
String
Yes
Original retention
category name
rcnm
String
No
Yes
No
No
Max 32 chars
Current retention
category name
crcn
String
No
Yes
No
No
Max 32 chars
Index Sequence
Number
snum
Integer
Yes
Yes
No
Yes
64-bit integer
String
No
Yes
No
No
Date
Yes
Yes
No
Yes
Yes
No
No
cont
String
Yes
Yes
No
No
Languages
lang
String
Yes
No
No
No
Categories/Keywords
keys
String
Yes
Yes
Yes
No
Integer
Yes
Yes
No
Yes
32-bit integer
599
600
Table A-1
Description
Name
Type
Notes
The number of
attachments
natc
Integer
Yes
Yes
No
Yes
32-bit integer
Permission VaultIds
pvid
for the item. (Known as
Archive Folder
VaultIds)
String
Yes
Yes
Yes
No
Attachment Number
Integer
Yes
No
No
Yes
32-bit integer
anum
edat
Date
Yes
Yes
No
No
Number of days to
expiry for the item
(based on crct)
ndte
Integer
Yes
Yes
No
No
32-bit integer
Integer
No
Yes
No
No
32-bit integer
msgc
String
Yes
Yes
No
No
flag
Integer
No
Yes
No
No
32-bit integer
comr
String
Yes
Yes
No
No
Table A-1
Name
Type
Notes
String
No
Yes
No
No
String
No
Yes
No
No
Integer
No
Yes
No
No
32-bit integer
String
Description
Yes
No
No
String
No
Yes
No
No
String
No
Yes
No
No
Integer
No
Yes
No
No
32-bit integer.
601
602
Table A-1
Description
Name
Type
Notes
vsid
Integer
No
Yes
No
No
32-bit integer.
menv
String
No
No
No
No
Message Envelope
Recipient.
jrcp
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
Message Envelope
BCC: Recipient
jrbc
String
Yes
No
Yes
No
Message Envelope
Other Recipient
jren
String
Yes
No
Yes
No
Table A-1
Name
Type
Notes
Message Envelope
jrau
Author Union of jrfm,
jrpp & jaen
String
Yes
Message Envelope
FROM: Recipient
String
Description
jrfm
No
Yes
No
No
Yes
No
String
Message Envelope
Other Author
String
jaen
Yes
No
Yes
No
Yes
No
Yes
No
sere
String
No
No
No
No
Message Recipient.
Union of redn, reea,
resm, reot & jrcp
recp
String
Yes
No
Yes
No
Message Recipient.
redn
Display/friendly name.
Union of rtdn, rcdn,
rbdn & rndn
String
Yes
No
Yes
No
603
604
Table A-1
Description
Name
Type
Message Recipient.
Email address. Union
of rtea, rcea, rbea &
rnea
reea
String
Yes
No
Yes
No
Message Recipient.
SMTP email address.
Union of rtsm, rcsm,
rbsm & rnsm
resm
String
Yes
No
Yes
No
Message Recipient.
Other email address.
Union of rtot, rcot,
rbot & rnot
reot
String
Yes
No
Yes
No
TO: Recipient
reto
String
Yes
Yes
No
No
Notes
TO: Recipient.
rtdn
Display/friendly name
String
Yes
No
Yes
No
rtea
String
Yes
No
Yes
No
rtsm
String
Yes
No
Yes
No
rtot
String
Yes
No
Yes
No
CC: Recipient
recc
String
Yes
Yes
No
No
CC: Recipient.
rcdn
Display/friendly name
String
Yes
No
Yes
No
Table A-1
Name
Type
String
Yes
No
Yes
No
rcsm
String
Yes
No
Yes
No
rcot
String
Yes
No
Yes
No
BCC: Recipient
rbcc
String
Yes
Yes
No
No
Description
Notes
BCC: Recipient.
rbdn
Display/friendly name
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
rbot
String
Yes
No
Yes
No
Other Envelope
Recipient
renv
String
No
Yes
No
No
Other Envelope
rndn
Recipient.
Display/friendly name
String
Yes
No
Yes
No
Other Envelope
rnea
Recipient. Email
address. Union of rnsm
& rnot
String
Yes
No
Yes
No
605
606
Table A-1
Name
Type
Other Envelope
rnsm
Recipient. SMTP email
address
String
Yes
No
Yes
No
Other Envelope
rnot
Recipient. Other email
address
String
Yes
No
Yes
No
Number of Recipients
nrcp
Integer
Yes
Yes
No
Yes
32-bit integer
Number of TO:
Recipients
nrto
Integer
No
Yes
No
No
32-bit integer
Number of CC:
Recipients
nrcc
Integer
No
Yes
No
No
32-bit integer
Number of BCC:
Recipients
nrbc
Integer
No
Yes
No
No
32-bit integer
Number of Other
Envelope Recipients
nren
Integer
No
Yes
No
No
32-bit integer
String
Yes
Yes
Yes
No
Author.
audn
Display/friendly name.
Union of wrdn, frdn,
ppdn
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
Description
ausm
Notes
Table A-1
Name
Type
Notes
String
Yes
No
Yes
No
Writer.
wrdn
Display/friendly name
String
Yes
No
Yes
No
String
Yes
No
Yes
No
wrsm
String
Yes
No
Yes
No
wrot
String
Yes
No
Yes
No
from
String
Yes
No
Yes
No
FROM:
frdn
Display/friendly name
String
Yes
No
Yes
No
String
Yes
No
Yes
No
frsm
String
Yes
No
Yes
No
frot
String
Yes
No
Yes
No
PP Union of ppdn,
ppgn
ppea, ppsm & ppot. Per
Procurationem (by
delegation to) person
on whose behalf
document has been
written or message has
been sent
String
Yes
No
Yes
No
PP Display/friendly
name
String
Yes
Yes
Yes
No
Description
ppdn
607
608
Table A-1
Description
Name
Type
PP Exchange email
address. Union of
ppsm, ppot
ppea
String
Yes
No
Yes
No
PP SMTP email
address
ppsm
String
Yes
No
Yes
No
String
Yes
No
Yes
No
name
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
String
Yes
No
Yes
No
Date
No
Yes
No
No
Date
No
Yes
No
No
String
No
Yes
No
No
text
clon
Notes
Table A-1
Description
Name
Type
Notes
tddt
Date
No
Yes
No
No
tcdt
Date
No
Yes
No
No
Task status
tsts
Integer
No
Yes
No
No
609
0 = Not started
1 = In progress
2 = Completed
3 = Paused
4 = Deferred
Note 1
The ssid value returned for attachments is a concatenation of the SavesetId and
the attachment number (see anum), separated by a full stop.
For example, for the first attachment:
849000000000000~200002041641270000~0~2F0993C0D5BD4D0087E592D043C22B0.1
To use the Content Management API to retrieve the item, the SavesetId must be
extracted by removing the trailing full stop and attachment number:
849000000000000~200002041641270000~0~2F0993C0D5BD4D0087E592D043C22B0
Note 2
For a message, this is selected from the first of the following properties that is
present on the message:
Message Delivery Time (PR_MESSAGE_DELIVERY_TIME)
Original Message Delivery Time (PR_ORIGINAL_DELIVERY_TIME)
Submission Time (PR_CLIENT_SUBMIT_TIME)
Original Message Submission Time (PR_ORIGINAL_SUBMIT_TIME)
Message Transport Provider Submission Time (PR_PROVIDER_SUBMIT_TIME)
Last Modification Time (PR_LAST_MODIFICATION_TIME)
610
Note 3
In the Search API, if the item index is 32-bit, only the first 120 characters of the
textual representation of the content can be retrieved.
If the item index is 64-bit, by default the first 128 characters of the textual
representation of the content are retrieved, but this value can be configured.
In the Content Management API, the value is the HTML representation of the
content to a maximum of 5 MB.
If the size is larger than 5 MB, no value is returned, but a content missing reason
property (comr) with value vmrVALUENOTOBTAINED is returned instead.
The 5 MB limit can be changed using the registry value,
HKEY_LOCAL_MACHINE
\Software
\Wow6432Node
\KVS
\Enterprise Vault
\MaxIndexDataHTMLContentKB
Note 4
Predefined values for comr property:
enum EValueMissingReason
{
vmrNOREASON
=0 No reason available
vmrVALUENOTFOUND
=1 Content does not exist
vmrVALUENOTOBTAINED
=2 Content could not be obtained
vmrVALUECORRUPT
=3 Content is (or appears to be) corrupt
vmrNOCONVERTER
=4 Not possible to convert content to
suitable format (i.e. no converter for this specific conversion)
vmrCONVERSIONFAILED
=5 Conversion of content failed (i.e.
converter error)
vmrCONVERSIONTIMEDOUT =6 Conversion of content timed out
vmrFORMATEXCLUDED
=7 Content requires conversion but its data
format is excluded from conversion
vmrCONVERSIONBYPASS
=8 Content requires conversion but
conversion bypass has been set
vmrVALUEENCRYPTED
=9 Content is encrypted
vmrCONVERTERUNINIT
=10 Content requires conversion but
converters are not available, or have not been initialized
vmrADDITEMTOINDEX
=11 Unable to add content to index
vmrFORMATNOTRECOGNISED=12
Converters did not recognize the file
type
vmrLARGEFILE
=13 Conversion excluded for large files
vmrUNKNOWNCODEPAGE
=14 Conversion excluded for codepages we
cannot detect (e.g. GB18030)
Note 5
The menv property contains the Message Envelope recipient and sender
information for journal messages, in XML format. The following is an example of
what it can contain:
<?xml version="1.0" encoding="utf-16?">
<MSGENV>
<RECP P1="true">
<TO>
<RC>
<DN>Joe User</DN>
<EA>Joe.User@email.com</EA>
</RC>
<DL>
<DN>Internal Users</DN>
<EA>Internal.Users@ourcompany.com</EA>
<RC>
<DN>Administrator</DN>
<EA>admin@ourcompany.com</EA>
</RC>
<RC>
<DN>CEO</DN>
<EA>theboss@ourcompany.com</EA>
</RC>
</DL>
</TO>
<CC />
<BCC>
611
612
<RC>
<DN>Jill User</DN>
<EA>Jill.User@email.com</EA>
</RC>
</BCC>
<ENV>
<RC>
<DN>John User</DN>
<EA>John.User@email.com</EA>
</RC>
</ENV>
</RECP>
<AUTH>
<FROM><DN>Chris Davies</DN> <EA>CDavies@ourcompany.com</EA>
</FROM>
<PP><DN>Bill Stephens</DN><EA>BStephens@ourcompany.com
</EA></PP>
</AUTH>
</MSGENV>
This example is not exhaustive. The full XSD also specifies DLs and their nesting.
The values returned for recipient properties (e.g. reto, renv) for envelope-journal
items are returned from the envelope (P1) unless the message (P2) contains at
least the same number of (or more) recipients for each index property.
The AUTH element contains the message sender/author details (FROM). Where
a message has been sent on behalf of another user, the AUTH information will
include both the sender (FROM) and delegate (PP) details.
Note 6
The sere property contains the sender and recipient information in XML format.
The following is an example of what it can contain:
<?xml version="1.0" encoding="utf-16?">
<MSG>
<RECP>
<TO>
<RC>
<DN>Joe User</DN>
<EA>Joe.User@email.com</EA>
</RC>
<DL>
<DN>Internal Users</DN>
<EA>Internal.Users@ourcompany.com</EA>
<RC>
<DN>Administrator</DN>
<EA>admin@ourcompany.com</EA>
</RC>
<RC>
<DN>CEO</DN>
<EA>theboss@ourcompany.com</EA>
</RC>
</DL>
</TO>
<CC />
<BCC />
</RECP>
<AUTH>
<FROM><DN>Chris Davies</DN> <EA>CDavies@ourcompany.com</EA>
</FROM>
<PP><DN>Bill Stephens</DN>
<EA>BStephens@ourcompany.com</EA>
</PP>
</AUTH>
</MSG>
This example is not exhaustive. The sere property follows the same schema as
the menv property, except that the root node is <MSG> rather than <MSGENV>.
Version information
The sere property is available in Enterprise Vault 6.0 SP5, Enterprise Vault
7.0 SP3 and Enterprise Vault 2007 SP1.
See Enterprise Vault 2007 SP1, Enterprise Vault 7.0 SP3, and Enterprise Vault
6.0 SP5 on page 40.
Missing content reasons returned in the missing content property, comr, are
available in Enterprise Vault 7.0 SP3 and Enterprise Vault 2007 SP1.
See Enterprise Vault 2007 SP1, Enterprise Vault 7.0 SP3, and Enterprise Vault
6.0 SP5 on page 40.
613
614
The event and task properties, csrt, cend, clon, tddt, tcdt and tsts are available
in Enterprise Vault 8.0 SP3 and later.
Name
Saveset ID
If message is a journal
message, the type of journal
message
Vault.JournalType String
Yes
Yes
Yes
E2007
E2003
E2007ClearText
E2007RMS
Table A-2
Description
Name
Type
Message direction
Vault.MsgDirection String
Yes
0 - undefined
Vault.MsgType
String
Yes
Yes
EXCH
SMTP
Bloomberg
IM.vendor
FAX.vendor
DXL
Note 1
Format is
<UTC_datetime_of_copy>,<source_archive_ID>,<source_item_Saveset_ID>
For example,
2009-11-17 13:37:012,16B3597E77206FB4690FB46573DA6D7081110000
EVServer.domain.local,200811140000000~200811141011170000~Z~
B082EF701FF8FB47509D5228C99D2B51
Note 2
If the message is from Exchange Server 2010 with journal report decryption
enabled, then the message is in Exchange Server 2007 report format and includes
both an RMS-protected copy and a clear text copy of the message. Both copies are
stored in the saveset. The advanced setting in the Enterprise Vault Exchange
Journaling policy, ClearText copies of RMS Protected items, determines whether
Enterprise Vault uses the clear text copy or the RMS-protected copy as the primary
message during archiving. If the value of Vault.JournalType is "E2007RMS", then
615
616
Name
Type
Yes
Yes
Yes
Yes
EVFSADLMImport.DLM String
Currently only
populated with the
string "Imported"
Description
Name
Type
Document title
EVSP.Title
String
Yes
Yes
SharePoint documentId
EVSP.DocId
String
Yes
Yes
Document version
EVSP.Version
String
No
Yes
Check in comment
EVSP.Comment
String
No
Yes
EVSP.Editor
String
Yes
Yes
EVSP.CreatedBy
String
Yes
Yes
Table A-4
Description
Name
Type
EVSP.ModifiedBy
String
Yes
Yes
SharePoint Site Id
EVSP.SiteId
String
Yes
Yes
EVSP.Site
String
No
Yes
EVSP.SiteUrl
String
Yes
Yes
Customer configurable
properties - any SharePoint
property
EVSPP.<Sharepoint
property name>
String
Yes
Yes
Type
The set of CA
KVSCA.DeptAuthor
Department Ids that
the item's author is
a member of
String
Yes
Yes
Yes
CA Dept IDs
The set of CA
KVSCA.DeptRecips
Department Ids that
the item's recipients
are members of
String
Yes
Yes
Yes
CA Dept IDs
KVSCA.Department String
Yes
Yes
Yes
CA Dept IDs
The union of
KVSCA.DeptAuthor
and
KVSCA.DeptRecips
Name
617
618
Table A-5
Description
Name
String
Yes
Yes
Yes
Policy names
String
Yes
Yes
Yes
Policy names
Policies, defined in
the policy
management
software, which
either demand or
suggest capture.
String
Yes
Yes
Yes
Policy names
String
Yes
Yes
Yes
evtag.inclusion
NOACTION
EXCLUDE
INCLUDE
Appendix
Return value
Value
Description
CONTENTMANAGEMENTAPI_E_UNAVAILABLE
0x80040300
CONTENTMANAGEMENTAPI_E_ARCHIVE_FULL
0x80040301
CONTENTMANAGEMENTAPI_E_BUSY
0x80040302
Enterprise Vault is
temporarily unable to process
the request. The server is
busy, or has insufficient
resources, or is only able to
read data due to ongoing
backups. Wait and retry later.
620
Table B-1
Return value
Value
Description
CONTENTMANAGEMENTAPI_E_NO_ACCESS
0x80040303
CONTENTMANAGEMENTAPI_E_BAD_PARAMETER
0x80040304
CONTENTMANAGEMENTAPI_E_AMBIGUOUS_PARAMETER
0x80040305
CONTENTMANAGEMENTAPI_E_INTERNAL_FAILURE
0x80040306
CONTENTMANAGEMENTAPI_E_ITEM_NOT_FOUND
0x80040307
CONTENTMANAGEMENTAPI_E_NOT_FOUND
0x80040308
CONTENTMANAGEMENTAPI_E_DELETION_BARRED
0x80040309
CONTENTMANAGEMENTAPI_E_NO_LICENSE
0x8004020A
CONTENTMANAGEMENTAPI_E_LICENSE_EXPIRED
0x8004030B
CONTENTMANAGEMENTAPI_E_INVALID_DEVICE
0x8004030C
CONTENTMANAGEMENTAPI_E_DUPLICATE_ITEMID
0x8004030D
Attempting to
insert/copy/move item with
an Item Id that is not unique
in the target vault store.
CONTENTMANAGEMENTAPI_E_NOT_SUPPORTED
0x8004030E
Table B-2
Return value
Value
Description
RetentionCategoryAlreadyExists
0x800700b7
RetentionCategoryNotExist
0x80070002
SiteIdNotFound
0x800704BA
Return value
Value
Description
rvS_OK
0x00000000
Successful completion
rvS_FALSE
0x00000001
rvE_POINTER
0x80004003
rvE_INVALIDARG
0x80070057
Invalid argument
rvE_ACCESSDENIED
0x80070005
rvE_NOINTERFACE
0x80004002
rvE_SERVER_UNAVAILABLE
0x800706BA
rvINDEXING_W_ARCHIVE_NOT_SET
0x80041C6B
rvINDEXING_W_CANT_ACCESS_DIRECTORY
0x80041C11
rvINDEXING_E_ARCHIVE_NOT_FOUND
0xc0041C5C
rvINDEXING_W_INDEXDISABLED
0x80041C84
621
622
Table B-3
Return value
Value
Description
rvINDEXING_W_ARCHIVE_BEING_DELETED
0x80041C52
rvINDEXING_W_UNKNOWN_INDEX_VOLUME_SET 0x80041C6C
rvINDEXING_W_UNKNOWN_INDEX_VOLUME
0x80041C6D
rvINDEXING_W_UNABLE_FAILED_VOLUME
0x80041C69
rvINDEXING_W_UNABLE_OFFLINE_VOLUME
0x80041C6A
rvINDEXING_E_TOO_MANY_RESULTS
0xc0041C83
rvINDEXING_E_TOO_MANY_VOLUMES
0xc0041C82
rvINDEXING_W_SERVICE_BUSY
0x80041C86
rvINDEXING_W_SERVER_STOPPING
0x80041C1A
rvINDEXING_W_SERVICE_STOPPING
0x80041C47
rvINDEXING_W_SEARCH_WOULD_BLOCK
0x80041C70
rvINDEXING_W_SEARCH_TIMEDOUT
0x80041C71
rvINDEXING_E_INVALID_QUERY
0xC0041C53
Table B-3
Return value
Value
Description
rvINDEXING_E_ILLEGAL_WILDCARD_QUERY
0xC0041C5E
rvINDEXING_E_FAILED_SEARCH_REQUEST
0xC0041C67
rvINDEXING_E_INDEX_SEARCH_FAILED
0xC0041C0E
Event
Type
Description
Example
3144
Error
3263
Error
623
624
Table B-4
Event
Type
Description
Example
3146
Error
Logged by the filter controller Failed to initialize the external filter with
when attempting to create an ProgId filter prog id. Either the ProgId is
instance of an external filter. incorrect or the DLL has not been
registered.
Please check the ProgId or register the DLL
for the external filter.
3147
Error
3150
Error
45329
Informational
45330
Informational
Event
Type
Description
Example
41086
Informational
41087
Informational
Table B-5
Event
Type
Description
Example
41088
Error
41036
Error
Event
Type
Description
Example
41294
Informational
Logged by the filter controller The file system external filter filter_name
when the filter starts.
has started.
41295
Informational
Logged by the filter controller The file system external filter filter_name
when the filter stops.
has stopped.
41296
Warning
Logged by the filter controller The file system external filter filter_name
when the filter fails to process failed to process a file.
a file.
File: FileUNCPath
Error: error_message
41338
Error
Logged by the filter controller The File System Archiving task has
when the error count reaches stopped because th external filter error
the threshold level.
count has reached the threshold.
41339
Warning
625
626
Table B-6
Event
Type
Description
Example
41340
Warning
41336
Warning
Logged by the filter controller Failed to load the file system external filter
if it fails to load the filter.
filter_name.
Error: error_message
41337
Warning
Logged by the filter controller Failed to initialize the file system external
if it fails to initialize the filter. filter filter_name.
Error: error_message
41361
Error
41362
Warning
Appendix
Understanding how
Enterprise Vault archives
and indexes messages
This appendix includes the following topics:
SMTP messages
628
The Enterprise Vault archiving agents for Exchange (MAPI), Lotus Notes, and
SMTP messages augment the sender and recipient details from the message with
additional values sourced from the domain directory of mail users. The primary
aim is to ensure that Enterprise Vault index searches on a users primary email
address also find messages in which the user was addressed using a secondary or
alternative email address. The archiving agent processes the message sender and
recipients to generate a structured collection of enhanced sender and recipient
details. These details are stored as the Message Sender and Recipients (sere)
property in the archived item. The details are used when indexing the archived
item. The sere property can be retrieved using the Content Management API.
See IItem :: Get on page 194.
The Enterprise Vault Exchange and Domino journal archiving agents also augment
the sender and recipient details for a journal message with additional values
sourced from both the message envelope and the domain directory of mail users.
The message envelope typically provides further details of the message routing,
including Distribution List expansion, BCC recipients and alternate recipient
delivery. These properties are processed to generate another structured collection
of enhanced sender and recipient details. These details are stored as the Message
Envelope Sender and Recipients (menv) property in the archived item, and are
also used when indexing the archived item. The menv property can also be
retrieved using the Content Management API.
Details of the properties that are defined in Enterprise Vault, including the Message
Sender and Recipients (sere) and Message Envelope Sender and Recipients (menv)
properties, are included in this manual.
See System properties on page 596.
This appendix describes how Enterprise Vault processes different message types,
and includes information about key changes over recent releases of Enterprise
Vault.
receipts, tasks, calendar items, and so on. The message is stored as the primary
content of the archived item. The message sender and recipients are processed
in conjunction with the Exchange Global Address List (GAL) to generate the
Message Sender and Recipients (sere) property.
The sender, sent representing, and each recipient listed in the message are
recorded in the sere property with an entry containing a friendly name, and an
email address. In all cases, if a current Exchange GAL entry is identified by the
appropriate MAPI entry id property in the message, then the display name and
default SMTP address are used from that GAL entry. Otherwise the best values
from the available message properties are used, with precedence given to an SMTP
address value over an Exchange address value. Furthermore if a recipient maps
to a Distribution List entry in the Exchange GAL, and the advanced setting Expand
Distribution List in the Enterprise Vault Exchange archiving policy is enabled,
the sere property is augmented with the display name and default SMTP addresses
of the members of the Distribution List.
Figure C-1 details the workflow for generating the sender element of the sere
property from the message sender properties.
629
630
Figure C-1
Does Exchange
GAL entry exist for
sender entry id?
MAPI properties
Display name: PR_SENDER_NAME (ID:0x0C1A)
Address Book Entry Id: PR_SENDER_ENTRYID (ID:0x0C19)
Email address: PR_SENDER_EMAIL_ADDRESS (ID:0x0C1F)
Email address type: PR_SENDER_ADDRTYPE (ID:0x0C1D)
yes
no
Read Exchange
GAL entry
Does Exchange
GAL entry contain
default SMTP
address?
no
Is sender
email address an
SMTP address?
MAPI properties
Alternate email addresses:
PR_EMS_AB_PROXY_ADDRESSES
(ID:0x800F)
Default SMTP address:
PR_SMTP_ADDRESS (ID:0x39FE)
Add sender display
name and GAL default
SMTP address to
Message Sender and
Recipient property
yes
yes
no
Is sender
email address
an Exchange
address?
yes
Search Active
Directory for user
object containing
Exchange address
SMTP address
found in Active
Directory?
no
LDAP properties
Legacy Exchange address:
legacyExchangeDN
Email-Addresses: mail
yes
The same workflow is used to generate the sent representing element of the sere
property, but the logic is based on the sent representing MAPI properties in the
message:
Display name: PR_SENT_REPRESENTING_NAME (ID:0x0042)
Exchange Address Book Entry Id: PR_SENT_REPRESENTING _ENTRYID (ID:0x0041)
Email address: PR_SENT_REPRESENTING _EMAIL_ADDRESS (ID:0x0065)
Email address type: PR_SENT_REPRESENTING _ADDRTYPE (ID:0x0064)
Figure C-2 details the workflow for generating each of the recipient elements of
the sere property from the message recipient properties.
631
632
Figure C-2
MAPI properties
Recipient Type: PR_RECIPIENT_TYPE (ID:0x0C15)
Display name: PR_DISPLAY_NAME (ID:0x3001)
Exchange Address Book Entry Id: PR_ENTRYID (ID:0x0FFF)
Email address: PR_EMAIL_ADDRESS (ID:0x3003)
Email address type: PR_ADDRTYPE (ID:0x3002)
Default SMTP Address: PR_SMTP_ADDRESS (ID:0x39FE)
Original email address: PR_OrgEmailAddr (ID:0x403E )
Original email address type: PR_OrgAddrType (ID:0x403D)
no
MAPI properties
Display Name: PR_DISPLAY_NAME (ID:0x3001)
Alternate email addresses:
PR_EMS_AB_PROXY_ADDRESSES (ID:0x800F)
Default SMTP address: PR_SMTP_ADDRESS
(ID:0x39FE)
Read Exchange
Global Address
List entry
yes
Is entry a DL and
is DL expansion archiving
policy enabled?
yes
no
no
Is recipient default
SMTP address
present?
Does Exchange
GAL entry contain default
SMTP address?
yes
yes
yes
yes
no
no
Is recipient
email address an
SMTP address?
no
Is recipient
original email
address an SMTP
address?
Content Management API support for the sere property for MAPI
messages
Enterprise Vault
8.x
Enterprise Vault
9.x a
Enterprise Vault
10.x
Yes
Yes
If the Message
Sender and
Recipients (sere)
property is not
present in the
archived item, it is
generated
dynamically when
the item is indexed
Yes
Yes
Yes
Yes
Yes
Sender/Recipient
No
details are generated
dynamically when
the item is retrieved
(if not stored in
archived item)
a. Enterprise Vault 9.0 SP1 included a performance improvement and a fix for an
issue introduced in Enterprise Vault 9.0. The issue prevented Enterprise Vault
from indexing the sender/recipient details correctly for some items (Ref 901-5786).
633
634
The Content Management API uses the display name and SMTP email address
values from the message in preference to attempting Exchange address resolution.
From Enterprise Vault 9.0 Exchange address resolution uses Active Directory. In
releases prior to Enterprise Vault 9.0, the Exchange GAL is used. There is no
expansion of distribution lists, regardless of the advanced setting Expand
Distribution Lists in the Exchange archiving policy.
Figure C-3 details the workflow for generating the sender element of the sere
property from the message sender properties.
Figure C-3
MAPI properties
Display name: PR_SENDER_NAME (ID:0x0C1A)
Exchange Address Book Entry Id: PR_SENDER_ENTRYID (ID:0x0C19)
Email address: PR_SENDER_EMAIL_ADDRESS (ID:0x0C1F)
Email address type: PR_SENDER_ADDRTYPE (ID:0x0C1D)
Is sender
email address an
SMTP address?
yes
no
Is
Enterprise Vault
release 9.0 or
later?
yes
Search Active
Directory for user
object containing
sender email
address
LDAP properties
Legacy Exchange address:
legacyExchangeDN
Email-Addresses: mail
yes
no
no
no
yes
Read Exchange
GAL entry
yes
635
636
The same workflow is used to generate the sent representing element of the sere
property, but the logic is based on the message sent representing MAPI properties:
Display name: PR_SENT_REPRESENTING_NAME (ID:0x0042)
Exchange Address Book Entry Id: PR_SENT_REPRESENTING _ENTRYID (ID:0x0041)
Email address: PR_SENT_REPRESENTING _EMAIL_ADDRESS (ID:0x0065)
Email address type: PR_SENT_REPRESENTING _ADDRTYPE (ID:0x0064)
Figure C-4 and Figure C-5 detail the workflow for generating each of the recipient
elements of the sere property from the message recipient properties.
Figure C-4
Is recipient default
SMTP address
present?
MAPI properties
Recipient Type: PR_RECIPIENT_TYPE (ID:0x0C15)
Display name: PR_DISPLAY_NAME (ID:0x3001)
Exchange Address Book Entry Id: PR_ENTRYID (ID:0x0FFF)
Email address: PR_EMAIL_ADDRESS (ID:0x3003)
Email address type: PR_ADDRTYPE (ID:0x3002)
Default SMTP Address: PR_SMTP_ADDRESS (ID:0x39FE)
Original email address: PR_OrgEmailAddr (ID:0x403E )
Original email address type: PR_OrgAddrType (ID:0x403D)
yes
yes
yes
no
Is recipient
email address an
SMTP address?
no
Is recipient
original email address
an SMTP address?
no
637
638
Figure C-5
no
Is
Enterprise Vault
release 9.0 or later?
yes
SMTP address
found in Active
Directory?
no
no
yes
Read Exchange
Global Address
List entry
yes
no
LDAP properties
Legacy Exchange address:
legacyExchangeDN
Email-Addresses: mail
yes
As indicated in Table C-1, prior to Enterprise Vault 9.0 the Message Sender and
Recipients property may not be available when retrieving MAPI messages using
the Content Management API. This is particularly relevant to items that were
originally inserted using the Content Management API. In such cases the basic
sender and recipient properties are available:
The property values are completed with the message sender and recipient email
address values, in accordance with the email address type from the following
MAPI properties:
Sender display name: PR_SENDER_NAME (ID:0x0C1A)
Sender email address type: PR_SENDER_ADDRTYPE (ID:0x0C1D)
Sender email address: PR_SENDER_EMAIL_ADDRESS (ID:0x0C1F)
Sent representing display name: PR_SENT_REPRESENTING_NAME (ID:0x0042)
Sent representing email address type: PR_SENT_REPRESENTING _ADDRTYPE
(ID:0x0064)
Sent representing email address: PR_SENT_REPRESENTING _EMAIL_ADDRESS
(ID:0x0065)
Recipient type: PR_RECIPIENT_TYPE (ID:0x0C15)
Recipient display name: PR_DISPLAY_NAME (ID:0x3001)
Recipient email address type: PR_ADDRTYPE (ID:0x3002)
Recipient email address: PR_EMAIL_ADDRESS (ID:0x3003)
639
640
Typically the SMTP address properties are only populated for non-Exchange
senders and recipients. BCC recipient information is only available for messages
that are archived from the mailbox Sent Items folder. Note also that you cannot
correlate display names and corresponding email address values using these
properties.
Display name
When Lotus Notes names are processed, the canonical, hierarchical form names
are translated to their abbreviated format. The abbreviated hierarchical name
format is used as the display name, and the same value is used as the email address.
For example, the canonical name CN=John Smith/OU=Sales/O=Acme results
in a display name and an email address of John Smith/Sales/Acme. When the
641
642
Lotus Notes name is sourced from the Domino Directory, the abbreviated
hierarchical name is appended with the entrys mail domain name. For example,
the canonical name CN=John Smith/OU=Sales/O=Acme in the mail domain
ACMEInc results in the display name and email address values of John
Smith/Sales/Acme@ACMEInc. For SMTP addresses without a display name
element, the local part of the address is used as the display name. For example,
the address JSmith@acme.com results in a display name of JSmith and an
email address JSmith@acme.com.
Figure C-6 details the workflow for generating the sender element of the sere
property from the message sender properties.
Domino archiving agent workflow for generating the sender entry
of the sere property
Figure C-6
Notes fields
Read message sender Email address: From
properties
Domain name: FromDomain
Is archiving
policy Lookup
email addresses
enabled?
yes
Search Domino
Directory for user or
group in sender
domain containing
sender
email address
no
yes
no
Add sender display name and
sender email address to Message
Sender and Recipient property
The same workflow is used for generating the sent representing element of the
sere property, but the logic is based on the message sent representing field; that
is, the Principal field.
Figure C-7 details the workflow for generating each of the recipient elements of
the sere property from the message recipient properties.
643
644
Figure C-7
Read message
recipient properties
and process each
recipient
Is archiving
policy Lookup
email addresses
enabled?
no
Notes fields
TO recipients: SendTo
CC recipients: CopyTo
BCC recipients: BlindCopyTo
yes
Search Domino
Directory for user
or group in sender
domain containing
sender email address
yes
no
yes
no
Add sender display name and
sender email address to Message
Sender and Recipient property
Notes field
Email address: From
The same workflow is used for generating the sent representing element of the
sere property, but the logic is based on the message sent representing field; that
is, the Principal field.
Figure C-9 details the workflow for generating each of the recipient elements of
the sere property from the message recipient properties.
645
646
Figure C-9
Read message
recipient properties
and process each
recipient
Notes fields
TO recipients: SendTo
CC recipients: CopyTo
BCC recipients: BlindCopyTo
How the Enterprise Vault archiving agent processes Lotus Notes journal
messages
The Enterprise Vault Domino archiving agent handles all Lotus Notes messages
exactly the same, with the exception of journal messages that are delivered to a
Domino journaling database. The journal message contains additional Notes fields
detailing the journal recipients, including distribution list expansions.
When the Enterprise Vault Domino archiving agent archives journal messages,
the journal message is stored as the primary content of the archived item.
The sender, sent representing, and each recipient listed in the message are
recorded in the Message Sender and Recipients (sere) property as described for
Lotus Notes mailbox messages.
See How the Enterprise Vault archiving agent processes Lotus Notes mailbox
messages on page 641.
Additionally the journal recipients Notes fields are processed to generate the
Message Envelope Sender and Recipients (menv) property, together with an entry
containing a friendly name and one or more email addresses. The display name
and email address from the Notes field are always used. The Domino Directory is
used to look up the email address. From the Domino Directory, the users primary
SMTP and Notes email addresses are added to the menv property, if not already
present.
Figure C-10 details the workflow for generating each of the recipient elements of
the menv property from the message journal recipient properties.
Figure C-10
Read message
envelope recipient
properties and process
each recipient
Notes fields
Journal recipients: $JournalRecipients
Journal expanded group recipients:
$JournalRecipientsExpanded_<n>
or
Envelope recipients: Recipients
yes
no
647
648
indexed, nor is it available when the archived item is retrieved using the Content
Management API.
SMTP messages
The Content Management API supports SMTP messages inserted in MIME format
(.eml). There is no difference in behavior between SMTP messages archived using
the Content Management API and those archived by the Enterprise Vault SMTP
Archiving feature.
Content Management API support for the sere property for SMTP
messages
Enterprise Vault
8.x
Enterprise Vault
9.x
Enterprise Vault
10.x
No
Yes
Table C-2
Content Management API support for the sere property for SMTP
messages (continued)
Enterprise Vault
8.x
Enterprise Vault
9.x
Enterprise Vault
10.x
No
No
Yes
Sender/Recipient
No
details are generated
dynamically when
the item is retrieved
(if not stored in
archived item)
No
Yes
If the Message
Sender and
Recipients (sere)
property is not
present in the
archived item, it is
generated
dynamically when
the item is indexed
Prior to Enterprise Vault 10.0, the sere property may not be available when
retrieving SMTP messages using the Content Management API. In such cases the
basic sender and recipient properties are available:
649
650
The property values are completed with the message sender and recipient email
address values, in accordance with the email address type from the following
SMTP header fields:
Sender: From
Sent representing: Sender
Primary recipients: To
Carbon copy recipients: Cc
Blind carbon copy recipients: Bcc
Wait for the destination items to be secured (as indicated by the IsItemSecured
property of the ArchiveMetadata object).
See IArchiveMetaData :: IsItemSecured on page 237.
Using the MoveTo method for intra-site moves is not recommended, as this deletes
the source item before the destination item has been secured. The archived item
could be lost in a disaster recovery scenario.
Wait for the destination items to be secured, (as indicated by the IsItemSecured
property of the ArchiveMetadata object).
See IArchiveMetaData :: IsItemSecured on page 237.
651
652
Index
AddProperty method
ISearchQuery interface methods
SearchQuery object 476
AddQuery method
ISearchQuery interface methods
SearchQuery object 481
Indexes
updating 439
Indexing items 438
Indexing levels 442
IndexSearch2 object
Search API
SelectArchive method 505
interface methods
AddProperty
SearchQuery object 476
AddQuery
SearchQuery object 481
SelectArchive
IndexSearch2 object 505
SetProperty
SearchQuery object 474
ISearchQuery interface methods
AddProperty method 476
AddQuery method 481
SetProperty method 474
items
compressing 438
converting 438
C
compressing items 438
constants
ESearchQueryFlags constant
Search API 458
Converting items 438
Custom Filtering API
get_defaultRetentionCategoryId methods
IArchivingControl interface 366
ProcessFilter method
IExternalFilter interface 359
E
Enterprise Vault documentation 19
ESearchQueryFlags constant
Search API 458
F
File system filter reports 393
flags
ESearchQueryFlags constant
Search API 458
G
get_defaultRetentionCategoryId methods
IArchivingControl interface
Custom Filtering API 366
granularity of search results
attachment 444
item 444
M
methods
SelectArchive
IndexSearch2 object 505
P
ProcessFilter method
IExternalFilter interface
Custom Filtering API 359
S
Search API
ESearchQueryFlags constant 458
searches
overview of performing a search 449
654
Index
searches (continued)
results, processing 452
SearchQuery object
SearchQuery interface methods
AddProperty 476
AddQuery 481
SetProperty 474
SelectArchive method
IndexSearch2 object
Search API 505
SetProperty method
ISearchQuery interface methods
SearchQuery object 474