This is documentation of an archived release.
For documentation on the current version, please check Knowledge Base.

Example : Load publication list

Steps to take :

  1. Embed the component.
  2. Load publication list.

1. Embed the component

Embedding the component is described here : Example : Embed the component.

2. Load publication list

To load the list of available publications for a specific user, we must first configure which server to use, which credentials to use and validate the product license using the setServer(), setCredentials(), checkLicense() and loadPublicationList() methods.

<html title="My Publication">
 <head>
  <script type="text/javascript" src="<server>/api/<api-version>/webclient_api.js"></script>
  <script type="text/javascript">
 
    var client;
 
    client = new orbit.webclient.Client(document.getElementById('clientElement'));
      client.addEventListener(orbit.webclient.ClientEvent.READY,
        function()
        {
          // Check license.
          client.setDeveloperId(<DeveloperId>);
          client.setProductId(<ProductId>);
          client.checkLicense();
        });        
 
      viewer.addEventListener(orbit.webclient.LicenseEvent.GRANTED,
        function(e)
        {
          client.setServer("http://developer.orbitgis.com/service");
          client.setCredentials("dev","dev");
          client.loadPublicationList();
        });
 
      viewer.addEventListener(orbit.webclient.LoadPublicationListEvent.SUCCESS,
        function(e)
        {
          console.log("Publication list loaded.",e.list);
        });
    }
 
  </script>
 </head>
 <body onload="addClient()">
  <div id="clientElement"/>
 </body>
</html>

Result

 
Last modified:: 2019/03/25 11:36