This documentation is for WSO2 IoT Server 3.2.0. View the documentation for the latest release.
Page Comparison - Customizing the Android Agent Download Location for Tenants (v.4 vs v.5) - IoT Server 3.2.0 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Make a copy of the cdmf.unit.device.type.android.type-view directory that is in the <IOTS_HOME>/repository/deployment/server/jaggeryapps/devicemgt/app/units directory in the same directory.
  2. Rename the newly copied file as follows: <TENANT_DOMAIN>.cdmf.unit.device.type.android.type-view .
    For example, if your tenant domain is foo.com the directory name needs to be foo.com.cdmf.unit.device.type.android.type-view.
  3. Remove the type-view.hbs files from the <TENANT_DOMAIN>.cdmf.unit.device.type.android.type-view directory.
  4. Update the following files in the <TENANT_DOMAIN>.cdmf.unit.device.type.android.type-view directory.
    1. Open the type-view.js file and replace all the content in it with the following configurations:
      Update the enrollmentURL with the URL to download the agent.

      Code Block
      function onRequest(context) {
          var viewModel = {};
          var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
          var isCloud = devicemgtProps["isCloud"];
          viewModel["isVirtual"] = request.getParameter("type") == 'virtual';
          viewModel["isCloud"] = isCloud;
          viewModel["hostName"] = devicemgtProps["httpsURL"];
          viewModel["enrollmentURL"] = "http://abc.com";
          return viewModel;
      }
    2. Open the type-view.json file and replace all the content in it with the following configurations:

      Code Block
      {
          "version": "1.0.0",
          "extends": "cdmf.unit.device.type.android.type-view"
      }
      Info
      titleWhy am I extending this unit?

      For this tutorial only the Android agent download URL changes. All the other content of the Android agent is the same. Therefore, all you need to do is extend the existing cdmf.unit.device.type.android.type-view unit.

...