Manual Configuration of GWG

Settings (ports, etc.) can be configured by the gg-bindings.xml or other corresponding bindings file or by GGConfigurator program (if installed).

The gg-default-network-settings.xml contains the network and user configurations for the WSN OpenAPI Gateway. These settings are used for to populate the database for the first time (Basic) and always when running the Tiny instance.

Use the information and adding structures presented below. The order of the structures must be as presented. Add the own information after the default information in the gg-default-network-settings.xml file (just be for tag).

The bean ids must be unique. This is maintained by using the names within the bean identifiers.

1. Adding new user named 'new_user': NOTE: The name of the user must be unique.

1.1 Password information structure for 'new_user':

      <bean class="gg.core.standalone.components.Invoker" id="gg/manage/user/user/new_user/password">
        <property name="bean" ref="gg/common/hash"/>
        <property name="parameter" value="new_password_to_be_hashed"/>
        <property name="bindResult" value="gg/manage/user/user/new_user/password/hash"/>
        <property name="method" value="calculateHash"/>
      </bean>
  
PropertyDatatypeDescription
parameterStringThe password to be used for the 'new_user'.

1.2 User information structure for 'new_user':

      <bean class="gg.core.service.g2.user.User" id="gg/manage/user/user/new_user">
        <property name="name" value="new_user"/>
        <property name="password" ref="gg/manage/user/user/new_user/password/hash"/>
        <property name="firstName" value="First Name"/>
        <property name="lastName" value="Last Name"/>
        <property name="phone" value="0123456789"/>
        <property name="email" value="email@email.com"/>
        <property castTo="gg.core.service.g2.user.Permission" name="systemRole" value="USER"/>
      </bean>
  
PropertyDatatypeDescription
name String Username.
password Hashed String (Look the information structure for 'new_user'.)
firstName String First name of the user.
lastName String Last name of the user.
phone String Phone number.
email String Email address.
systemRole enum GUEST = guest user (limited usability)
USER = normal user
ADMIN = administrative user (network administrator)
OWNER = no restrictions (owner of the GG)

1.3 Save the user information of the 'new_user':

      <bean class="gg.core.standalone.components.Invoker" id="gg/manage/user/user/new_user/save">
        <property name="bean" ref="gg/services/user"/>
        <property name="parameter" ref="gg/manage/user/user/new_user"/>
        <property name="bindResult" value="gg/manage/user/user/new_user/UID"/>
        <property name="method" value="addPermissionHolder"/>
      </bean>
  

1.4 Add user 'new_user' to SIDF_OUT group to allow messages to be conveyed to the user.

      <bean class="gg.core.service.g2.user.GroupMembership" id="gg/manage/user/groupmembership/new_user/userToSidfOut">
        <property name="groupId" ref="gg/manage/user/usergroup/sidfout/UID"/>
        <property name="userId" ref="gg/manage/user/user/new_user/UID"/>
      </bean>
  

1.5 Save permission for user 'new_user':

      <bean class="gg.core.standalone.components.Invoker" id="gg/manage/user/groupmembership/new_user/userToSidfOut/save">
        <property name="bean" ref="gg/services/user"/>
        <property name="parameter" ref="gg/manage/user/groupmembership/new_user/userToSidfOut"/>
        <property name="method" value="addGroupMembership"/>
      </bean>
  

2. Adding new network:

2.1 Network information structure for 'my_network':

      <bean class="gg.core.service.g2.network.Network" id="gg/manage/network/network/my_network">
        <property name="networkID" value="my_network"/>
        <property name="name" value="My network"/>
        <property name="description" value="Description of my network..."/>
      </bean>
  
PropertyDatatypeDescription
networkID String Contains the identification for the network.
name String Human readable identifier.
description String A description for the network.

2.2 Save the network information of the 'my_network':

      <bean class="gg.core.standalone.components.Invoker" id="gg/manage/network/network/my_network/save">
        <property name="bean" ref="gg/services/g2/network"/>
        <property name="parameter" ref="gg/manage/network/network/my_network"/>
        <property name="bindResult" value="gg/manage/network/my_network/UID"/>
        <property name="method" value="addNetwork"/>
      </bean>
  

2.3 Add permission for 'sidfin' group members to write information to 'my_network':

      <bean class="gg.core.service.g2.user.NetworkPermission" id="gg/manage/user/networkpermission/my_network/sidfInPermission">
        <property name="networkId" value="my_network"/>
        <property name="holderId" ref="gg/manage/user/usergroup/sidfin/UID"/>
        <property castTo="gg.core.service.g2.user.Permission" name="level" value="SIDF_IN"/>
      </bean>
  
PropertyDatatypeDescription
networkId String The identifier of the network.
level enum SIDF_IN = The permission holder can send messages in.
SIDF_OUT = The permission holder can get messages out.
SADF = The permission holder can get archive data out.

2.4 Save permission for network 'my_network'

      <bean class="gg.core.standalone.components.Invoker" id="gg/manage/user/networkpermission/sidfInPermission/my_network/save">
        <property name="bean" ref="gg/services/user"/>
        <property name="parameter" ref="gg/manage/user/networkpermission/my_network/sidfInPermission"/>
        <property name="method" value="addNetworkPermission"/>
      </bean>
  

2.5 Add permission for 'sidfout' group members to read information from 'my_network':

      <bean class="gg.core.service.g2.user.NetworkPermission" id="gg/manage/user/networkpermission/my_network/sidfOutPermission">
        <property name="networkId" value="my_network"/>
        <property name="holderId" ref="gg/manage/user/usergroup/sidfout/UID"/>
        <property castTo="gg.core.service.g2.user.Permission" name="level" value="SIDF_OUT"/>
      </bean>
  

2.6 Save permission for network 'my_network':

      <bean class="gg.core.standalone.components.Invoker" id="gg/manage/user/networkpermission/sidfOutPermission/my_network/save">
        <property name="bean" ref="gg/services/user"/>
        <property name="parameter" ref="gg/manage/user/networkpermission/my_network/sidfOutPermission"/>
        <property name="method" value="addNetworkPermission"/>
      </bean>