Select to view content in your preferred language

Using a Windows Variable, Environment Variable in Config.daml's viewerXslt Parameter in Metadata Toolkit Addin

1079
2
08-31-2023 06:30 PM
TheBobScript
Occasional Contributor

Due to folder permission restrictions in the default install location for some of my ArcGIS Pro users (unable to edit/add files in the \Program Files folder), I need to find a new home for the .xsl and xslt files that support a custom metadata stylesheet add-in.

I have unsuccessfully tested the use of the Windows %UserProfile% variable (usually C:\Users\<USER_NAME_HERE>\AppData\Roaming) in the viewerXslt parameter in the Config.daml file;  it's not honored.  Based on my testing and the example found here, I know that I am able to specify a drive/folder/file path (ex. C:\test\ArcGISProFull.xsl) for the viewerXslt parameter.

To visualize, the top entry shown below does not work, the second does:

<viewerXslt>%USERPROFILE%\AppData\Roaming\StyleTest\CustomStylesheetFile.xsl</viewerXslt>
<viewerXslt>C:\Users\USER_NAME_HERE\AppData\Roaming\StyleTest\CustomStylesheetFile.xsl</viewerXslt>


In the scenario where C:\ is not available, I would like to know if there is anyway to update the viewerXslt parameter after or during add-in initialization.  Is it possible to update parameters listed in the Config.daml or are those constants?  

If that is not possible, is there a better way to find and use an environment variable, Windows variable (like %UserProfile%) or known location in a Config.daml file?

 

 

0 Kudos
2 Replies
RichardDaniels
Frequent Contributor
Since the Add-in is compiled code, e.g., C#, you can reference the application properties with Project.SetProperty and Project.GetEvaluatedProperty(String) Method. Use these rather than config.daml to hold application and user properties specific to the add-in (a.k.a., visual studio project).
Since you can reference any location in any file location, recommend using a shared UNC path like \\mydomainserver\mygisfolder\mycustomappfolder<> and store the shared files there. That way you only have one copy for your entire agency.
TheBobScript
Occasional Contributor

@RichardDaniels - thanks for the Project.SetProperty and Project.GetEvaluatedProperty suggestions.  I'll see where that gets me and update this thread with the results.

Great idea on use of a shared UNC path/location.  Unfortunately our end users work at disparate locations with different environments and do not have a common network where I could use this option.

0 Kudos