Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New ThinClient URL

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
xavier_dumont1
1726 Views, 2 Replies

New ThinClient URL

Hello,

 

The new Thin Client 2014 (with subscription advantage pack) has a new kind of URL to access file (regarding the fileID).

http://servername/AutodeskTC/servername/vaultname#/Entity/Details?id=mRklMRTpMQVRFU1Q6MTMxOTQxNA&itemtype=File

 

How can we create this URL from a file in Vault (my goal is to create the URL from a Vault-Addin in order to place this URL in a ERP system).

 

I try with persistantID but I don't get the same ID. And if I try to resolve the ID (mRklMRTpMQVRFU1Q6MTMxOTQxNA) in Vault API, I don't get anything...

 

Is there a way to create this URL?

 

Thanks in advance for you help and have a nice day.

2 REPLIES 2
Message 2 of 3
Daniel.Du
in reply to: xavier_dumont1

Hi,

     
GetPersistentIds and ResolvePersistentIds in the KnowledgeVaultService are the functions to use for converting between file IDs and the persistent IDs.  Keep in mind that there are two types of persistent IDs for files.  If EntPersistOpt is History, the Persistent ID is for a specific file version.  If EntPersistOpt is Latest, the Persistent ID is for the latest version of the file.  The caller has to know which type to use.  There is no way to tell the type by looking at the Persistent ID itself.

Following code works fine for me :

void ThinClientUrlCmd_Execute(object sender, CommandItemEventArgs e)
      {
       
        WebServiceManager webMgr =  e.Context.Application.Connection.WebServiceManager;

        ISelection selectedItem = e.Context.CurrentSelectionSet.FirstOrDefault<ISelection>();
        if (selectedItem != null)
        {
            if (selectedItem.TypeId == SelectionTypeId.File || selectedItem.TypeId == SelectionTypeId.FileVersion)
            {
              File file = webMgr.DocumentService.GetLatestFileByMasterId(selectedItem.Id);

             string[] ids = webMgr.KnowledgeVaultService.GetPersistentIds("FILE",
              new long[]{file.Id}, 
              Autodesk.Connectivity.WebServices.EntPersistOpt.Latest);

             string id = ids[0];
             id = id.TrimEnd('=');
             string result = string.Format("{0}://{1}/AutodeskTC/{1}/{2}#/Entity/Details?id=m{3}=&itemtype=File",
                  "Http""localhost", e.Context.Application.Connection.Vault, id);


             System.Windows.Forms.MessageBox.Show(result);
            }
        }



      }


Daniel Du
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
xavier_dumont1
in reply to: Daniel.Du

You are the best 🙂 Thanks a lot and have a nice day.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report