03-12-2009 07:53 AM
I am trying to write a small vb app that will arhive selected file from file system manually. I try to use EVContentManagementAPI to do this, but I am missing something since I get an error("No access to the vaultstore, archive, or item") when I try to call insert method on the Item object. We have Evault version 2007. Anybody has a code snippet that shows how to connect to a Evault server box and insert item manually into archive with custom app.
This is what I use:
Dim oItem As EVContentManagementAPILib.IItem
Dim cmAPI As New EVContentManagementAPILib.ContentManagementAPI
cmAPI.DirectoryDNSAlias = "My Server"
cmAPI.AuthenticationMode = AUTHENTICATE_USING_DCOM_SECURITY
Set oItem = cmAPI.Item
With oItem
.Content.Title = "Test"
.ArchiveId = "131A658235284F84E9E2C6B6E2E80AECD1110000MyServer1"
.ArchiveMetaData.RetentionCategory = "Test Retention"
.Content.Data = "c:\test.txt"
.Insert
End With
Thanks,
Goran
03-12-2009 10:08 AM
Option Explicit
On Error Resume Next
Dim ContentManagementAPI
Set ContentManagementAPI = CreateObject("EnterpriseVault.ContentManagementAPI")
Dim item
set item = ContentManagementAPI.Item
On Error Resume Next
dim CurAction
Item.ArchiveId = ArchiveId.value
Item.Content.Title = ContentTitle.value
Item.Content.FileExtension = ContentFileExtension.value
Item.Content.OriginalLocation = ContentOriginalLocation.value
Item.Content.Data = Content.value
Item.Insert()
if (Err.number <> 0) then
MsgBox "Failed!" + vbCrLf + "Reason: " + Hex(Err.number) + vbCrLf + "Description: " + Err.Description, _
vbOKOnly + vbExclamation, "Insert Item"
Err.Clear
else
ssid = Item.Id
MsgBox "Success! SSID=" + ssid, vbOKOnly, "Insert Item"
Err.Clear
end if
03-13-2009 07:03 AM
Wayne,
Thank you very much for your response. I did try your code and I am getting an error:
Reason Code: 80040303
Description: No access to the vaultstore, archive, or item.
This is the same error I was getting before. I can retrieve archives from this vaultstore and enumerate arhives. But when I try to insert item into one of the arhives I get this error. Could it be permissions on the server? Maybe I don't have rights to insert items? What do you think?
Thanks,
Goran
03-13-2009 07:20 AM
yep, check the perms on that archive for the user you are running the app as
03-13-2009 12:06 PM
Wayne, you are a life saver. I didn't have write permissions. Now I can insert file into archive. Do you now by any chance how can I display shortcut to that file. What I mean is: I created windows shell extension, so when user open windows explorer and right click on the file the dialog pops up with the list of retention categories.User select the category and then I run this code that you sent me to insert the file into archive. So far so good. Now I would like to delete the original file from the hard drive, and create the shortcut to the archived file in Evault instead. So the shortcut will show in the Windows explorer. Any idea how to do this.
Thanks a lot,
Goran
03-14-2009 03:23 AM
03-16-2009 05:37 AM
Thanks Michael for your help.
Any idea where I can find out more about format of the Evault shortcut? An what is a "offline" bit?
What exactly did you mean when you said not supported by SYMC? I use SYMC API to archive the item, and I want to create shortcut to retrieve it, the same way SYMC do it with FSA.
Thanks,
Goran
03-16-2009 05:44 AM
Evault? whats that?
Enterprise Vault is the correct term you are looking for!
If you do create placeholders, what Michel is saying is we will support the API, but if you mess something up with creating placeholders how are we meant to support you on something you wrote. We will not support your app or how it creates placeholders.
03-16-2009 06:10 AM
Thanks Wayne.
Sorry you had troubles understanding what Evault is. I will use the proper term from now on.
I don't expect you to support my app. I just want to learn more about placeholder creation so I can use it. Any idea where i can find more documentation? I have "Symantec Enterprise Vault Application Programmer's Guide", but I can't find how these placeholders are created.
Thanks,
Goran
03-16-2009 06:14 AM
03-16-2009 06:21 AM
Thank you Michel.
03-16-2009 06:58 AM
Hi,
Wayne is correct in that it would not be supported. Frankly I simply would not go there. Sure it may be possible to hack but who is to say what problems these items may cause down the line. Perhaps corruption, data loss, break apps etc. who is to say. As Wayne said support and engineering simply wouldn't accept a call from a customer doing this as we could well spend time on an issue not our creating.
03-16-2009 07:17 AM
Thank you Dodo2.
03-16-2009 04:42 PM
Hi,
What you want to do sounds like a simple version of what FSA already does... so I wondered why you wouldn't just buy an FSA license vs. writing VB code?
03-16-2009 11:38 PM