Module: UU::OS::UUEE

Extended by:
UUEE
Included in:
UUEE
Defined in:
uu_os-0.29.16/lib/uu/os/uuee.rb,
uu_os-0.29.16/lib/uu/os/uuee/uuee_create.rb,
uu_os-0.29.16/lib/uu/os/uuee/uuee_attributes.rb,
uu_os-0.29.16/lib/uu/os/uuee/uuee_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/uuee/uuee_set_access_codes.rb

Defined Under Namespace

Classes: UUEEAttributes, UUEECreate, UUEESetAccessCodes, UUEESetAttributes

Constant Summary

PATH =

Service path of the REST API.

'ues/core/role/UESUUEE'

Instance Method Summary (collapse)

Instance Method Details

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

Creates an uuEE to the specified location.

Examples:

# Create uuEE.
UU::OS::UUEE.create('ues:UNI:FOLDER',
  :meta_artifact_uri=>'ues:UUEE_TERRITORY:UUEE',
  :app_code=>'CDS.GB',
  :code=>'6-6666-1',
  :description=>'',
  :first_name=>'uuEE',
  :surname=>'6-6666-1',
  :grant_all_from_organizational_unit=>false,
  :icon_uri=>'ues:[-1]:[-1]:',
  :searchable_in_territory=> false,
  :security_clearance=>'NO_CONFIDENTIALITY',
  :security_level=>'NO_CONFIDENTIALITY',
  :avatar_uri=>''
)

Parameters:

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

    UESURI of the folder/org. unit/meta model where the personal access role will be created.

  • uuee (UUEECreate) (defaults to: nil)

    DTO containing the attributes of the uuEE.

Options Hash (uuee):

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

    UESURI of the meta artifact. UUEE is created only by meta artifact with the template class of UUEE. If this meta artifact will not be specified or if the rights does not permit to create a new uuEE from this meta artifact, the create command fails.

  • :app_code (String)

    Full code of the application which be represented by the uuEE. The code must be in the format VENDOR_CODE.APP_CODE. If set to an empty string or nil, the uuEE will not be an identity of any application.

  • :first_name (String)

    The first name of the uuEE. When nil is set, automatically will be set to the value of the uuEE universe ID.

  • :surname (String)

    The surname of the uuEE. When nil is set, automatically will be set to “uuEE”.

  • :code (String)

    The code of the uuEE. The code must be unique in a given territory, otherwise the create command fails. When nil or blank string is set, the code is generated automatically using the uuEE’s universe ID.

  • :description (String)

    The description of the uuEE.

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

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

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

    Security level of the new uuEE. When nil is set, security level is taken from the meta artifact. If the meta artifact is higher than the user’s security clearance, the create command fails.

  • :security_clearance (UU::OS::Artifact::SecurityLevel)

    Security clearance of the new uuEE. When nil is set, the value NO_CONFIDENTIALITY is used.

  • :searchable_in_territory (Boolean)

    Specifies if it is possible to search the uuEE within the territory. When nil is set, the default value from meta artifact is used.

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

    URI of the uuEE’s icon. When nil is set or if nil UESURI (“ues::[-1]:”) is set, the uuEE uses icon from meta artifact. Allowed format of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{CODE_OF_ICON}’. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :grant_all_from_organizational_unit (Boolean)

    Deprecated. Specifies if the uuEE will be included among All roles from organizational unit. When nil is set, the value will be automatically set to true.

  • :component_content (Boolean)

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

  • :access_code1 (String)

    Access Code 1 of newly created uuEE. Access code 1 must be 4-250 characters long and can only contain these characters: a-z, A-Z, 0-9, ‘.’, ‘-’, ‘_’, ‘@’. If not specified, random code is generated.

  • :access_code2 (String)

    Access Code 2 of newly created uuEE. Access code 2 must be 8-250 characters long and can only contain these characters: any character. If not specified, random code is generated.

  • :avatar_uri (String)

    UESURI or URL of image which represents uuEE’s avatar. If set to an empty string or nil, the uuEE will be created without avatar.

  • :universe_id (String)

    Universe identifier of the user. When nil is set, universe identifier will be generated.

Returns:



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

def create(location_uri, uuee = nil)
  svc = UU::OS::REST::RemoteClient.new(UUEE)
  payload = UU::OS::UUEE::UUEECreate.new(uuee).to_json

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

- (UUEEAttributes) get_attributes(uueeUri)

This command returns attributes representing the uuEE specified by the uueeUri parameter. The command does not change the state of the role in the system.

Examples:

# Get attributes of specified uuEE.
UU::OS::UUEE.get_attributes('ues:TERRITORY:UUEE')

Parameters:

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

    UESURI of the uuEE whose attributes will be returned.

Returns:



28
29
30
31
32
33
34
# File 'uu_os-0.29.16/lib/uu/os/uuee.rb', line 28

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

- (UU::OS::UESURI) set_access_codes(uuee_uri, access_codes = nil)

Sets access codes of an uuEE. It is possible to change both access codes or just one of them. For security reasons, both current access codes must be entered.

Examples:

# Changes both access codes.
UU::OS::UUEE.set_access-codes("ues:MT.SMITH.JOHN:6-6666-1",
  :access_code1 => "accessCode1",
  :access_code2 => "accessCode2",
  :new_access_code1 => "newAccessCode1",
  :new_access_code2 => "newAccessCode2"
)
# Changes access code 2 only.
UU::OS::UUEE.set_access-codes("ues:MT.SMITH.JOHN:6-6666-1",
  :access_code1 => "accessCode1",
  :access_code2 => "accessCode2",
  :new_access_code2 => "newAccessCode2"
)

Parameters:

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

    UESURI of an uuEE whose attributes will be modified.

  • access_codes (UUEESetAccessCodes) (defaults to: nil)

    Object containing both current and new access codes of the uuEE.

Returns:



152
153
154
155
156
157
158
159
160
# File 'uu_os-0.29.16/lib/uu/os/uuee.rb', line 152

def set_access_codes(uuee_uri, access_codes = nil)
  svc = UU::OS::REST::RemoteClient.new(UUEE)
  payload = UU::OS::UUEE::UUEESetAccessCodes.new(access_codes).to_json

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

- (UU::OS::UESURI) set_attributes(uueeUri, uuee = nil)

Command for setting attributes of a uuEE. The command can't modify references to objects like location, competent role and so on.

Examples:

#Set attributes of personal access role.
uuEEUri = UU::OS::UUEE.set_attributes('ues:TERRITORY:UUEE',
              :first_name=>'John',
              :surname=>'Doe',
              :code=>'NEWUUEE',
              :description=>'uuEE',
              :security_level=>UU::OS::Artifact::SecurityLevel::CONFIDENTIAL,
              :searchable_in_territory=>false,
              :app_code=>'CDS.GB')

Parameters:

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

    UESURI of the uuEE whose attributes will be modified.

  • uuee (UUEESetAttributes) (defaults to: nil)

    Object containing the modified attributes of the uuEE.

Options Hash (uuee):

  • :first_name (String)

    The new first name of the uuEE. When nil is set, the first name is not modified.

  • :surname (String)

    The new surname of the uuEE. When nil is set, the surname is not modified.

  • :code (String)

    The new code of the uuEE. When nil is set, the code is not modified. When blank string is set, the code is generated automatically using the system sequence. The code must be unique in a given territory, otherwise the setAttributes command fails.

  • :description (String)

    The new description of the uuEE. When nil is set, the description is not modified.

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

    Security level of the new uuEE. When nil is set, security level is taken from the meta artifact SecurityLevel. If the meta artifact SecurityLevel is higher than the user’s security clearance, the create command fails.

  • :security_clearance (UU::OS::Artifact::SecurityLevel)

    Security clearance of the new uuEE. When nil is set, the security clearance is not modified.

  • :searchable_in_territory (Boolean)

    Specifies if it is possible to search the uuEE in its territory. When nil is set, this attribute on the uuEE is not modified.

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

    URI of the uuEE’s icon. When nil is set, the icon is not modified. If nil UESURI (“ues::[-1]:”) is set, the uuEE icon is removed and the uuEE uses icon from meta artifact. Allowed format of icon URI: ‘ues:#system:#UU::OS::UUEE.ues_v5ues_v5.core_v1ues_v5.core_v1.codetable_v1ues_v5.core_v1.codetable_v1.base_v1ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons:#CODE_OF_ICON’. An example of icon URI: ‘ues:#system:#UU::OS::UUEE.ues_v5ues_v5.core_v1ues_v5.core_v1.codetable_v1ues_v5.core_v1.codetable_v1.base_v1ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons:#ART_077’.

  • :grant_all_from_organizational_unit (Boolean)

    Deprecated. Specifies if the uuEE will be included among All roles from organizational unit. When nil is set, this attribute on the uuEE is not modified.

  • :component_content (Boolean)

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

  • :app_code (String)

    Full code of the application which is represented by the uuEE. The code must be in the format VENDOR_CODE.APP_CODE. If set to an empty string, the code will be erased (uuEE will not be an identity of any application). If set to nil, the value will not be modified.

  • :avatar_uri (String)

    UESURI or URL of image which represents uuEE’s avatar (user photo). If set to an empty string, the value will be erased. When nil is set, the value is not modified.

Returns:



67
68
69
70
71
72
73
74
75
# File 'uu_os-0.29.16/lib/uu/os/uuee.rb', line 67

def set_attributes(uueeUri, uuee = nil)
  svc = UU::OS::REST::RemoteClient.new(UUEE)
  payload = UU::OS::UUEE::UUEESetAttributes.new(uuee).to_json

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