cancel
Showing results for 
Search instead for 
Did you mean: 

Content Management API

djordjeg
Level 3

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

 

 

 

 

14 REPLIES 14

Wayne_Humphrey
Level 6
Partner Accredited Certified

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

djordjeg
Level 3

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

 

Wayne_Humphrey
Level 6
Partner Accredited Certified

yep, check the perms on that archive for the user you are running the app as

djordjeg
Level 3

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

MichelZ
Level 6
Partner Accredited Certified
Hi That's probably a lot more difficult. That's not going to be supported by SYMC, but you could analyze the shortcut format of the EV Shortcut, it's probably a hidden XML stream, where saveset ID and things like this are stored. Then you would need to toggle the "Offline" bit. I't won't be easy... ;) Cheers Michel

cloudficient - EV Migration, creators of EVComplete.

djordjeg
Level 3

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

 

Wayne_Humphrey
Level 6
Partner Accredited Certified

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.

djordjeg
Level 3

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

MichelZ
Level 6
Partner Accredited Certified
Yes, what I'm trying to say is: - There is no API to create a shortcut - Hence you have to do it yourself (It would be a "Hack") - And that's not supported by SYMC The "offline bit" is an Attribute of an NTFS File: http://msdn.microsoft.com/de-de/library/system.io.fileattributes.aspx I'm not sure, but I think EV saves this information as an alternate NTFS stream. More info here: http://members.cox.net/slatteryt/Streams.html Good luck & Cheers Michel

cloudficient - EV Migration, creators of EVComplete.

djordjeg
Level 3

Thank you Michel.

Michael_Bilsbor
Level 6
Accredited

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.

 

 

djordjeg
Level 3

Thank you Dodo2.

mathewl
Level 2
Employee

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? 

MichelZ
Level 6
Partner Accredited Certified
Well, this seems to be the requirement: 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. How would you do this with FSA? You could setup retention folders... ?

cloudficient - EV Migration, creators of EVComplete.