SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

Webvi_plugin template required changes to avoid duplicates

Solved!
Go to solution

Hi,

 

I'm playing around with the webvi_plug template stuff from https://github.com/ni/systemlink-web-interface-template and I'm wondering:

  1. In which place I need to change the reference to webvi_plugin to avoid duplicate SystemLink dashboards in the web server configuration?
  2. Which references to webvi_plugin need to be changed to identify the dashboard with it's functional name in:
    • SystemLink portal?
    • Web server configuration application privileges page?
  3. How to rename e.g. the name of "52_webvi_plugin.conf" in the project and have it update properly in the distribution?
  4. How to add a file like "52_webvi_plugin.conf" to the distribution like the current one is done, I don't seem to be able to select a .conf file. 
Regards,
André (CLA, CLED)
0 Kudos
Message 1 of 3
(3,497 Views)
Solution
Accepted by andre.buurman@carya

Hi Andre,

 

(The example on Github uses 'webvi_plugin' in the NXG example, and 'webapp_plugin' in the manual example. I primarily used the manually installed example, so use 'webapp_plugin' throughout my response).

 

 

Screen Shot 2020-04-14 at 4.43.49 PM.png

 

 

1. To configure security/access control for all Web VIs in one place, modify the `52_webapp_plugin.conf` file, and duplicate the <Directory> tag to specify any other plugins. E.g. 

 

<Directory htdocs/plugins/webapp_plugin/resources>
    # Tell the privilege module to use webapp_plugin.htpriv
	Session On
    AuthNIPrivilegeApplication webapp_plugin
    Require privilege ModifyResource
</Directory> 
<Directory htdocs/plugins/webapp_plugin2/resources>
    # Tell the privilege module to use webapp_plugin.htpriv
	Session On
    AuthNIPrivilegeApplication webapp_plugin
    Require privilege ModifyResource
</Directory> ​

 

2a. To change the name of the plugin in the SystemLink homepage, change the "pluginTitle" value within the en.json file –

htdocs\plugins\webapp_plugin\resources\json\locales\en.json

 

2b. To change the name of the application shown in the NI Web Server Configuration utility, change the <description> tag within the `webapp_plugin.xml` file. E.g.

<description xml:lang="en">Web Application</description>

 

To duplicate the webapp_plugin, you would also need to update a few other values with the config.json and en.json files. E.g.

C:\Program Files\National Instruments\Shared\Web Server\htdocs\plugins\webapp_plugin2\config.json

{
   "authorizationMarker": "/plugins/webapp_plugin2/resources/marker.txt",
   "buttonIconCls": "fa fa-area-chart",
   "buttonLabelToken": "webapp_plugin2.pluginTitle",
   "buttonTooltipToken": "webapp_plugin2.pluginTitle",
   "iframeResources": {
      "en": {
         "json": [
            "resources/json/locales/en.json"
         ]
      }
   },
   "iframeSrc": "plugins/webapp_plugin2/index.html",
   "orderWeight": 2,
   "permission": "",
   "resources": {
      "en": {
         "css": [
            "plugins/webapp_plugin2/resources/css/webapp_plugin.css"
         ],
         "json": [
            "plugins/webapp_plugin2/resources/json/locales/en.json"
         ]
      }
   },
   "routeToken": "webapp_plugin2",
   "titleToken": "webapp_plugin2.pluginTitle",
   "waitUntilLaunched": false
}

 

C:\Program Files\National Instruments\Shared\Web Server\htdocs\plugins\webapp_plugin2\resources\json\locales\en.json

{
   "webapp_plugin2": {
      "pluginTitle": "Web Application 2"
   }
}

 

3. You should be able to rename the file from within the Project Files pane in NXG. Right-click > Rename.

 

4. You should be able to import new conf files in the same way. Right-click `support files` > Import file…

 

Hope this helps! 

Fred Visser -- SystemLink R&D -- National Instruments
Message 2 of 3
(3,446 Views)

Thanks Fred, this helps tremendous.

 

Would it be something to add to the readme in the Github repo?

 

I will try and add a new file to a webvi dist using a new project started in NXG 4, the example was a converted project from NXG 3.1

There a few annoyance for me with NXG 4's performance compared to 3.1, I'm hoping the next release will provide a better experience on some topics. Since it's so cose I'll check when it's released and provide in app feedback when it's still an annoyance/problem.

Regards,
André (CLA, CLED)
0 Kudos
Message 3 of 3
(3,421 Views)