Showing link property and sorting files by it

Showing link property and sorting files by it

GabrieleZelasco
Enthusiast Enthusiast
2,128 Views
8 Replies
Message 1 of 9

Showing link property and sorting files by it

GabrieleZelasco
Enthusiast
Enthusiast

Hi all,

we easily managed to create link between files and folder using C# and SDK. For every single file-folder link created we store an Index Order value (long type) inside a custom Link property (LinkIndexOrder). This is essential for our project as a single file can have links with multiple folders therefore we need to save a different index order for each link created. So far, so good.

At this point we need:


- For every new link created check if other files are already linked to the target folder, eventually retrieve the max index order value and assign to new link the max(LinkIndexOrder) + 1


- Show the LinkIndexOrder property in the File tab and in the UDP Property tab


- Use the LinkIndexOrder property to sort the files, into the folder, by that value.


The first point is feasible and we should already know how to proceed.
About the other two we don't really know if the Vault allows them.

Attached an explanatory image.
Any suggestion? Thank you all in advance

0 Likes
Accepted solutions (2)
2,129 Views
8 Replies
Replies (8)
Message 2 of 9

Markus.Koechl
Autodesk
Autodesk

You need to implement a custom detail tab to display link properties. There is an AU class covering (Handout: Use Case 3) a similar approach to managing links from files to custom objects, and I think the concept applies to your objective. 



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 9

GabrieleZelasco
Enthusiast
Enthusiast

Markus thanks for the tip! I found the HandOut example and was looking at the code and explanation in the attached pdf. I have a doubt though. The structure requested by us, starting from the explorer tree, is the following:

parent Folder (DATABOOK), under this folder the user can create as many custom entitites (MAIN INDEX) as he wants via link between each custom entity and parent folder. 

Finally, the user needs to add files (pdf) under each custom entity MAIN INDEX.

I get this same previous way, by linking each file to the custom entity selected. So basically FOLDER -> CUSTOM ENTITIES -> FILES (See picture attached).
I would like to add the index order property to the link between file and custom entity and not between custom entity and folder.
Is it possible using the example you gave me? What should I change to get that result?

Thanks again!

0 Likes
Message 4 of 9

GabrieleZelasco
Enthusiast
Enthusiast

Markus, I'm sorry.

I looked at the example better. The properties shown in the custom tab are already related to the link between each single file and the custom entity! Basically, if I understand correctly, some of the standard fields present in the Contents tab (Name, Revision, Version, State) are repeated in the Orders tab with the addition of custom fields (where I will show the Index order). If you want just give me confirmation of the above, thanks again.

0 Likes
Message 5 of 9

Markus.Koechl
Autodesk
Autodesk
Accepted solution
I confirm your findings :).


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 6 of 9

GabrieleZelasco
Enthusiast
Enthusiast

Hi Markus,

I managed to get the custom tab (see attached) and show a few file properties (Name, Revision, Version) together with the requested link properties  (Index Order, Document List). Is it possibile to show a context menu inside that custom tab when user right click on file row ? Is it customizable (add Edit menu)? Currently if I right click on a row I get just a "Select All" menu, nothing else. 

I need to edit those link properties starting from selected file. Thanks again for all the support!

0 Likes
Message 7 of 9

GabrieleZelasco
Enthusiast
Enthusiast

Good morning Markus,

just a few adds to my previous message. In according to SDK docs I've implemented some event handlers to the vaultbrowsercontrol (in the designer class) to get a context menu on right click:

 

this.vaultBrowserControl1.GetContextMenu += VaultBrowserControl1_GetContextMenu;
this.vaultBrowserControl1.EntityDoubleClick += VaultBrowserControl1_EntityDoubleClick;
this.vaultBrowserControl1.Exception += VaultBrowserControl1_Exception;

 

Then I've tried to catch the selected entity name jsut for a test:

 

private void VaultBrowserControl1_GetContextMenu(object sender, VDF.Vault.Forms.Currency.GetContextMenuArgs e)
{
MessageBox.Show(e.ClickedEntity.EntityName, "");
throw new System.NotImplementedException();
}

But Vault crashes everytime. This happens with the EntityDoubleClick  handler as well.

I've sent the crash report to Autodesk support. 

Are you awared of it ? There's any patches or workarounds to get it work? Or maybe an alternative solution to get a working context menu on a VaultBrowserControl ?
I apologize for the many questions. Thanks a lot if you want to answer me once again.

0 Likes
Message 8 of 9

Markus.Koechl
Autodesk
Autodesk
Accepted solution
Unfortunately, I don't have a ready-to-use snippet for this in my repository and need to have a look if I find time later this week. I'm a little more cautious about saying that it needs a patch.


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 9 of 9

GabrieleZelasco
Enthusiast
Enthusiast

Markus, sorry for late answer.  Don't worry for the issue, I manage to solve it. It was related to my own code. Thanks once again for your time and support.

0 Likes