Samples

MenuSettings.xml is where you configure to have your menus appear in the Vault client. It can be found in folder C:\ProgramData\Autodesk\ApplicationPlugins\coolOrange.qJob.bundle. The config file can be edited with every editor.
We recommend XML editors like the XML Notepad from Microsoft.

Adding a context menu for Folder

Adding a menu for folder is simple. Let’s add the default syncproperties menu item also to folder.

<CommandSite>
  ...
  <FolderContext Location="FolderContextMenu">
          <SyncProperties/>
  </FolderContext>
</CommandSite>

After adding this we will find that the context menu ‘SyncProperties’ is added to the folder, but it isn’t enabled. Of course, we have to enable the menu item also to folders. By adding ‘Folder’ to the comma separated list of NavigationTypes, we will see that the menu item is enabled also to folder.

<MenuItem>
  <SyncProperties Label="sync properties" Description="sync properties" Hint="sync properties"
                  ToolbarPaintStyle="TextAndGlyph"
                  NavigationTypes="File,Folder" MultiSelectEnabled="False">
  <SyncPropertiesJob/>
  </SyncProperties>
</MenuItem>

Adding a context menu for Custom Object

Let’s add context menu to an existing custom object similar to how we did with adding the context menu for the folder.

Warning

For adding a menu for Custom Object, the custom object definition name (unique GUID) should be used in the ‘Location’ attribute of the CommandSite element as well as NavigationTypes attribute of the MenuItem element.

Tip

To make it easier for the users to find out the GUIDs, the name and the GUID of the exising custom objects is written to a log file (C:\ProgramData\Autodesk\ApplicationPlugins\coolOrange.qJob.bundle\Log\qJob.log).

<CommandSite>
  ...
  <CustomContext Location="PUT-YOUR-GUID-HERE">
          <SyncProperties/>
  </CustomContext>
</CommandSite>

Again we find the context menu ‘sync properties’ on the custom object but it isn’t enabled. We will follow the same instructions as before to enable it.

<MenuItem>
  <SyncProperties Label="sync properties" Description="sync properties" Hint="sync properties"
                  ToolbarPaintStyle="TextAndGlyph"
                  NavigationTypes="File,Folder,PUT-YOUR-GUID-HERE" MultiSelectEnabled="False">
  <SyncPropertiesJob/>
  </SyncProperties>
</MenuItem>

Restart the vault with the above changes in the SyncProperties menu item and the sync properties will be enabled in the context menu of your custom object.

Adding an additional job to the context menu for Files

This sample shows how to add a job to the context menu for Files. The sample uses a job for creating PDFs that is delivered with coolOrange powerJobs Processor “Sample.CreatePDF.ps1”.

Add the job definition to the Jobs section:

<Jobs>
    <CreatePDFJob Name="Sample.CreatePDF" Priority="1" Description="powerJobs Create PDF" />
</Jobs>

Warning

Remember: Take away the file extension “ps1”.

Then you need to add the job in the menu. Therefore, add a new element to the section “MenuItem”:

<MenuItem>
    <CreatePDF Label="Create PDF" Description="powerJobs Create PDF" Hint="Create PDF with powerJobs" ToolbarPaintStyle="TextAndGlyph" NavigationTypes="File" MultiSelectEnabled="False">
  <CreatePDFJob />
  </CreatePDF>
</MenuItem>

Then you need to make the job visible in the context menu of files. Therefore, add a new element to the section ” CommandSite”:

<CommandSite>
<FileContext Label="qJob" DeployAsPullDown="False" Location="FileContextMenu">
    <CreatePDF />
  </FileContext>
</CommandSite>

Now save the MenuSettings.xml, restart Vault and test it. Have fun!