Module: UU::OS::AppMetaModel

Extended by:
AppMetaModel
Included in:
AppMetaModel
Defined in:
uu_os-0.29.16/lib/uu/os/app_meta_model.rb,
uu_os-0.29.16/lib/uu/os/app_meta_model/app_meta_model_create.rb,
uu_os-0.29.16/lib/uu/os/app_meta_model/app_meta_model_attributes.rb,
uu_os-0.29.16/lib/uu/os/app_meta_model/app_meta_model_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/app_meta_model/app_meta_model_get_entry_list.rb,
uu_os-0.29.16/lib/uu/os/app_meta_model/app_meta_model_entry_attributes.rb,
uu_os-0.29.16/lib/uu/os/app_meta_model/app_meta_model_install_app_parameters.rb,
uu_os-0.29.16/lib/uu/os/app_meta_model/app_meta_model_install_shared_meta_model_app_parameters.rb

Defined Under Namespace

Classes: AppMetaModelAttributes, AppMetaModelCreate, AppMetaModelEntryAttributes, AppMetaModelGetEntryList, AppMetaModelInstallAppParameters, AppMetaModelInstallSharedMetaModelAppParameters, AppMetaModelSetAttributes

Constant Summary

PATH =

Service path

'uu/os/AppMetaModel'

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::UESURI) create(location_uri, app_meta_model = nil)

Creates a new app meta model. The command creates a new app meta model in a specified location. At the very least meta artifact must be specified in AppMetaModelCreate DTO. Competent role for the app meta model will be selected as the most suitable according to specified container and meta artifact (executive/authorized role with connected interface), or can be also specified in AppMetaModelCreate DTO.

Examples:

# Create a new app meta model.
UU::OS::AppMetaModel.create('ues:TERRITORY:ORGANIZATIONAL_UNIT', :code => 'NEW_APP_META_MODEL', :name => 'New App Meta Model')

Parameters:

  • location_uri (String, UU::OS::UESURI)

    UESURI of the folder/org. unit/meta model where app meta model will be created.

  • app_meta_model (AppMetaModelCreate) (defaults to: nil)

    DTO containing attributes of the new app meta model

Options Hash (app_meta_model):

  • :meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of the meta artifact. Only a meta artifact with the template class of App Meta Model (not its descendants) can be used. If the rights does not permit to create a app meta model from the meta artifact in the specified location, the create command fails.

  • :code (String)

    Code of the new app meta model. If nil is set, the code is generated automatically using the system sequence. The code must be unique in the given territory, otherwise the create command fails.

  • :app_box_uri (String)

    UESURI of appbox from which was the app meta model created.

  • :name (String)

    Name of the new app meta model. If nil is set, tName from meta artifact is used if set, otherwise the create command fails.

  • :description (String)

    Description of the new app meta model. If nil is set, tDescription from meta artifact is used if set, otherwise no description is set on the new app meta model.

  • :competent_role_uri (String, UU::OS::UESURI)

    UESURI of the competent role. If nil is set, the executive role from authorization is used. If no role is authorized to create the new app meta model into specified container, the create command fails. If the selected role doesn’t have connected the role interface with the selected meta artifact, the create command fails. If the selected role doesn’t belong to one of superior organizational units, the create command fails.

  • :security_level (String, UU::OS::Artifact::SecurityLevel)

    Security level. If nil is set, security level is taken from the meta artifact tSecurityLevel. If the meta artifact tSecurityLevel is higher than theuser’s security clearance, the create command fails.

  • :icon_uri (String, UU::OS::UESURI)

    URI of the app meta model’s icon. If nil is set, the app meta model uses icon from meta artifact. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the created AppMetaModel is component content. Default value is false.

Returns:



41
42
43
44
45
46
47
48
49
# File 'uu_os-0.29.16/lib/uu/os/app_meta_model.rb', line 41

def create(location_uri, app_meta_model = nil)
  svc = UU::OS::REST::RemoteClient.new(AppMetaModel)
  payload = UU::OS::AppMetaModel::AppMetaModelCreate.new(app_meta_model).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('create', location_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end

- (AppMetaModelAttributes) get_attributes(app_meta_model_uri)

Returns attributes representing the app meta model specified by the app_meta_model_uri parameter. The command does not change the state of the app meta model in the system.

Examples:

# Get attributes of an app meta model.
UU::OS::AppMetaModel.get_attributes('ues:TERRITORY:APP_META_MODEL')

Parameters:

  • app_meta_model_uri (String, UU::OS::UESURI)

    UESURI of an app meta model whose attributes are returned

Returns:



61
62
63
64
65
66
67
# File 'uu_os-0.29.16/lib/uu/os/app_meta_model.rb', line 61

def get_attributes(app_meta_model_uri)
  svc = UU::OS::REST::RemoteClient.new(AppMetaModel)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getAttributes', app_meta_model_uri)
    return AppMetaModel::AppMetaModelAttributes.new(res)
  end
end

- (UU::OS::REST::ResultList<AppMetaModel::AppMetaModelGetEntryList, AppMetaModel::AppMetaModelEntryAttributes>) get_entry_list(app_meta_model_uri, criteria = nil)

This command returns a list of entries (artifacts or shortcuts) enlisted in the specified app meta model. Only entries listed exactly in the specified app meta models are considered (so subordinate app meta models are not considered). The command does not return all entries, only a sublist. The list of returned entries could be filtered by the name, code or type of an entry. The list is sorted by the name (and codes in case are equal) of a entry by default, or it can be sorted arbitrarily by any of entry attributes usable for the filtering or these attributes combinations. See the UES query documentation for more information.

See UESQuery Documentation.

Examples:

# Returns list of entries, whose names start with 'T', from an app meta model.
UU::OS::AppMetaModel.get_entry_list('ues:TERRITORY:APP_META_MODEL',
   :query => 'name="T%"')

Parameters:

  • app_meta_model_uri (String, UU::OS::UESURI)

    UESURI of the app meta model from where entries (artifacts or shortcuts) are listed.

  • criteria (AppMetaModelGetEntryList) (defaults to: nil)

    DTO containing criteria for listing entries. Available parameters are: name, code and type.

Options Hash (criteria):

  • :query (String)

    The UES query string. It has to conform the ues query syntax (see documentation for more info). Filtering and order of the result list can be specified there. If nil is set, no filtering is applied and entries are ordered by name of referenced artifact (and code and type as the second and the third criteria).

  • :recursive (Boolean)

    Flag for recursive listing. It means that if the listed app meta model contains inner folders and the recursive flag is true, entries of the all inner folders are in result too. If the recursive flag is nil or false, only entries are returned exactly from the listed app meta model.

Returns:



115
116
117
118
119
120
121
122
123
124
125
126
# File 'uu_os-0.29.16/lib/uu/os/app_meta_model.rb', line 115

def get_entry_list(app_meta_model_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(AppMetaModel)
  dto = AppMetaModel::AppMetaModelGetEntryList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  svc.add_parameter('query', dto.query)
  svc.add_parameter('recursive', dto.recursive)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getEntryList', app_meta_model_uri)
    return UU::OS::REST::ResultList.new(AppMetaModel::AppMetaModelGetEntryList, AppMetaModel::AppMetaModelEntryAttributes, res)
  end
end

- (UU::OS::REST::Future) install(territory_uri, app_parameters = nil)

Command UU::OS::AppMetaModel.install is used to install an application to the Business or Development territory. It also allows to install applications with shared meta model, if the application supports it. In this case, first will be performed the installation to the system territory (or to the location, specified in the parameter devSharedSpaceUri, when installed to Development territory) and then the application will be installed in specified Business territory.

Examples:

# Returns UU::OS::REST::Future
UU::OS::AppMetaModel.install('ues:UU-BT:UU-BT',
    :app_box_uri => 'ues:OP-BT:WHS.CDS/CDS.GUESTBOOK_1.0.0',
    :app_identities => [
      {
        :identity => 'appInstaller',
        :uid => '33-6677-1',
        :credentials => {
          "password_file_path" => 'PASSWORD_FILE'
        }
      },
      {
        :identity => 'appIdentity',
        :uid => '23-5555-1'
      }
    ],
    :app_identity_cast_list => [
      {
        :app_identity_to_cast => "appIdentity",
        :subject_code => "APPS~AUTHORITIES"
      }
    ]
)

UU::OS::AppMetaModel.install('ues:UU-BT:UU-BT',
    :app_box_uri => 'ues:OP-BT:WHS.CDS/CDS.GUESTBOOK_1.0.0',
    :app_identities => [
      {
        :identity => 'appInstaller',
        :uid => '33-6677-1',
        :credentials => {
          "access_code_1" => "123",
          "access_code_2" => "456"
        }
      },
      {
        :identity => 'appIdentity',
        :uid => '23-5555-1'
      }
    ],
    :dev_system_space_uri => "ues:DEV-BT:SYS",
    :dev_app_space_uri => "ues:DEV-BT:APPS",
    :dev_shared_space_uri => "ues:DEV-BT:SYS"
)

Parameters:

Options Hash (app_parameters):

  • :app_box_uri (String)

    UESURI of uuApp Box, according to which the application should be installed. The uuEE of the territory, in which the application is going to be installed, must have rights on copying of mentioned uuApp Box.

  • :app_limits (Hash)

    JSON, which defines operating limits of the application.

  • :app_identities (Array<Hash>)

    The parameter is used for entering the identities, needed for installation of the application. Obligatorily must be entered the identities “appInstaller” and “appIdentity”.

    • :identity (String) - Identifier of the identity - “appIdentity”, “appInstaller”.

    • :uid (String) - UID of the uuEE (identity), which should represent the account.

    • :qos (String) - JSON, which defines Local and Remote QoS.

    • :credentials (Array<Hash>) - Array, which contains identity credentials. The parameter is set only for identity “appInstaller”.

      • :password_file_path (String) - Path to a file on server, which defines the encrypted login data of application identity. Relative address only.

      • :access_code1 (String) - Access code 1 of application identity.

      • :access_code2 (String) - Access code 2 of application identity.

  • :app_installation_config (Hash)

    JSON with additional configuration of application, which can be necessary during its installation.

  • :app_identity_cast_list (Array<Hash>)

    JSON, with the list of casts of identities “appIdentity” and “appInstaller”.

    • :app_identity_to_cast (String) - Identity to cast - “appIdentity” or “appInstaller”.

    • :subject_code (String) - Code of a role or a group, to which the identity “appIdentity” or “appInstaller” will be cast. The identity is always cast to EXECUTIVE level.

  • :force (Boolean)

    Parameter is used for forcing the installation of uuApp in case if the metamodel state of the same uuApp version, which is already installed, is in Problem state. Default value is false.

  • :dev_system_space_uri (String, UU::OS::UESURI)

    Parameter is used for installation in development mode. Defines UESURI of the location in the Business space of the territory, where the uuApp Meta Model is going to be installed.

  • :dev_app_space_uri (String, UU::OS::UESURI)

    Parameter is used for installation in development mode. Defines UESURI of the location in the Business space of the territory, where the uuApp structure is going to be installed.

  • :dev_meta_model_suffix (String)

    Parameter is used for installation in development mode. In case of installation of a new application, it is needed to add a suffix, which will be added to the artifact codes of the application.

  • :dev_shared_space_uri (String, UU::OS::UESURI)

    Parameter is used for installation in development mode. Defines UESURI of the location, where the shared uuApp Meta Model is going to be installed.

Returns:



199
200
201
202
203
204
205
206
207
208
# File 'uu_os-0.29.16/lib/uu/os/app_meta_model.rb', line 199

def install(territory_uri, app_parameters = nil)
  svc = UU::OS::REST::RemoteClient.new(AppMetaModel)
  payload = UU::OS::AppMetaModel::AppMetaModelInstallAppParameters.new(app_parameters).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('install', territory_uri, payload)
    uesuri =  UU::OS::UESURI.new(res)
    return UU::OS::REST::Future.new(uesuri)
  end
end

- (UU::OS::REST::Future) install_shared_meta_model(territory_uri, app_parameters = nil)

Command UU::OS::AppMetaModel.installSharedMetamodel is used only to install a shared meta model to the system and it can not be used for installation to business territory. Parameters devSystemSpaceUri and devAppSpaceUri are not used within this command.

Examples:

# Returns UU::OS::REST::Future
UU::OS::AppMetaModel.install_shared_meta_model('ues:SYSTER-BT:SYSTER-BT',
    :app_box_uri => 'ues:OP-BT:WHS.CDS/CDS.GUESTBOOK_1.0.0',
    :app_identities => [
      {
        :identity => 'appInstaller',
        :uid => '33-6677-1',
        :credentials => {
          "password_file_path" => 'PASSWORD_FILE'
        }
      }
    ]
)

Parameters:

Options Hash (app_parameters):

  • :app_box_uri (String)

    UESURI of uuApp Box, according to which the application should be installed. The uuEE of the territory, in which the application is going to be installed, must have rights on copying of mentioned uuApp Box.

  • :app_limits (Hash)

    JSON, which defines operating limits of the application.

  • :app_identities (Array<Hash>)

    Parameter is used for entering the identities, needed for installation of the application. Obligatorily must be entered the identity “appInstaller”.

    • :identity (String) - Identifier of the identity - “appIdentity”, “appInstaller”.

    • :uid (String) - UID of the uuEE (identity), which should represent the account.

    • :qos (String) - JSON, which defines Local and Remote QoS.

    • :credentials (Array<Hash>) - Array, which contains identity credentials. The parameter is set only for identity “appInstaller”.

      • :password_file_path (String) - Path to a file on server, which defines the encrypted login data of application identity. Relative address only.

      • :access_code1 (String) - Access code 1 of application identity.

      • :access_code2 (String) - Access code 2 of application identity.

  • :app_installation_config (Hash)

    JSON with additional configuration of application, which can be necessary during its installation.

  • :app_identity_cast_list (Array<Hash>)

    JSON, with the list of casts of identities “appIdentity” and “appInstaller”.

    • :app_identity_to_cast (String) - Identity to cast - “appIdentity” or “appInstaller”.

    • :subject_code (String) - Code of a role or a group, to which the identity “appIdentity” or “appInstaller” will be cast. The identity is always cast to EXECUTIVE level.

  • :force (Boolean)

    Parameter is used for forcing the installation of uuApp in case if the metamodel state of the same uuApp version, which is already installed, is in Problem state. Default value is false.

  • :dev_meta_model_suffix (String)

    Parameter is used for installation in development mode. In case of installation of a new application, it is needed to add a suffix, which will be added to the artifact codes of the application.

  • :dev_shared_space_uri (String, UU::OS::UESURI)

    Parameter is used for installation in development mode. Defines UESURI of the location, where the shared uuApp Meta Model is going to be installed.

Returns:



248
249
250
251
252
253
254
255
256
257
# File 'uu_os-0.29.16/lib/uu/os/app_meta_model.rb', line 248

def install_shared_meta_model(territory_uri, app_parameters = nil)
  svc = UU::OS::REST::RemoteClient.new(AppMetaModel)
  payload = UU::OS::AppMetaModel::AppMetaModelInstallSharedMetaModelAppParameters.new(app_parameters).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('installSharedMetaModel', territory_uri, payload)
    uesuri =  UU::OS::UESURI.new(res)
    return UU::OS::REST::Future.new(uesuri)
  end
end

- (UU::OS::UESURI) set_attributes(app_meta_model_uri, app_meta_model = nil)

Command for setting attributes of an app meta model. The command can't modify references to objects like location, competent role and so on.

Examples:

# Set a different name and security_level of an existing app meta model.
UU::OS::AppMetaModel.set_attributes('ues:TERRITORY:APP_META_MODEL', :name => 'New Name of App Meta Model', :security_level => UU::OS::Artifact::SecurityLevel::INTERNAL_USE)

Parameters:

  • app_meta_model_uri (String, UU::OS::UESURI)

    UESURI of the app meta model whose attributes are to be changed

  • app_meta_model (AppMetaModelSetAttributes) (defaults to: nil)

    DTO containing new attributes the app meta model

Options Hash (app_meta_model):

  • :name (String)

    The new name of the app meta model. If nil is set, the name is not modified.

  • :code (String)

    The new code of the app meta model. If nil is set, the code is not modified. The code must be unique in a given territory, otherwise the set_attributes command fails.

  • :description (String)

    The new description of the app meta model. If nil is set, the description is not modified.

  • :security_level (String, UU::OS::Artifact::SecurityLevel)

    The new security level of the app meta model. If nil is set, the security level is not modified. If the meta artifact tSecurityLevel is higher than the user’s security clearance, the set_attributes command fails.

  • :icon_uri (String, UU::OS::UESURI)

    URI of the app meta model’s icon. If nil is set, the icon is not modified. If nil URI (“ues:[-1]:[-1]:”) is set, the app meta model’s icon is removed and the app meta model uses icon from meta artifact. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the created AppMetaModel is component content. Default value is false.

Returns:



86
87
88
89
90
91
92
93
94
# File 'uu_os-0.29.16/lib/uu/os/app_meta_model.rb', line 86

def set_attributes(app_meta_model_uri, app_meta_model = nil)
  svc = UU::OS::REST::RemoteClient.new(AppMetaModel)
  payload = UU::OS::AppMetaModel::AppMetaModelSetAttributes.new(app_meta_model).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setAttributes', app_meta_model_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end