3. GSUser Object

3.1. Introduction

The GSUser object represents a GeoShop user. GSUser objects have to be initialized by the login() method.

3.2. GSUser Methods

ConstructorGSUser()
DescriptionCreates a new GSUser object.
Example
var gsuser = new GSUser();
Methodlogin(String user,String password, function successCallback(), function errorCallback(String))
DescriptionInitializes the GSUser object. All other methods of GSUser can only be used after successCallback() is called. Calls successCallback()asynchronously if the user exists, calls errorCallback() asynchronously if the user does not exist or the password is wrong.
Example
gsuser.login("test","test", function() {
      // successful login
   }, function(errorMessage) {
      // invalid user / password
   }
);
MethodGSHashtable getProducts()
DescriptionDelivers a GSHashtable with (name / display_name) entries of all available data products for the user.
Example
var products = gsuser.getProducts();
MethodgetProductByName(String name, function successCallback(GSHashtable), function errorCallback(String))
DescriptionCalls successCallback()asynchronously with a detailed description of the product by name. Calls errorCallback() asynchronously if the product is not found or some other error occurs.
Example
gsuser.getProductByName("dxf_geobau", function(product) {
      // do somthing with product 
   }, function(errorMessage) {
      // some error occured
   }
);
MethodgetProductByDisplayName(String display_name, function successCallback(GSHashtable), function errorCallback(String))
DescriptionVariant of getProductByName(). Delivers a detailed description of the product by display_name.
Example
gsuser.getProductByDisplayName("DXF GeoBau", function(product) {
      // do something with product
   }, function(errorMessage) {
      // display an error message
   });
MethodGSHashtable getPreferences()
DescriptionDelivers a all user preferences as a GSHashtable.
Example
var preferences = gsuser.getPreferences();