Module: UU::OS::PersonalRole

Extended by:
PersonalRole
Included in:
PersonalRole
Defined in:
uu_os-0.29.16/lib/uu/os/personal_role.rb,
uu_os-0.29.16/lib/uu/os/personal_role/territory_type.rb,
uu_os-0.29.16/lib/uu/os/personal_role/profile_attributes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/territory_attributes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_create.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_portlet.rb,
uu_os-0.29.16/lib/uu/os/personal_role/profile_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_relocate.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_language.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_attributes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_account_realm.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_portlets_mode.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_remove_account.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_set_access_codes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_get_territory_list.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_account_attributes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_notifications_rule.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_artifact_presentation_attributes.rb,
uu_os-0.29.16/lib/uu/os/personal_role/personal_role_set_artifact_presentation_attributes.rb

Overview

Module Personal Role.

Defined Under Namespace

Classes: PersonalRoleAccountAttributes, PersonalRoleAccountRealm, PersonalRoleArtifactPresentationAttributes, PersonalRoleAttributes, PersonalRoleCreate, PersonalRoleGetTerritoryList, PersonalRoleLanguage, PersonalRoleNotificationsRule, PersonalRolePortlet, PersonalRolePortletsMode, PersonalRoleRelocate, PersonalRoleRemoveAccount, PersonalRoleSetAccessCodes, PersonalRoleSetArtifactPresentationAttributes, PersonalRoleSetAttributes, ProfileAttributes, ProfileSetAttributes, TerritoryAttributes, TerritoryType

Constant Summary

PATH =

Service path

'ues/core/personalrole/UESPersonalRole'

Instance Method Summary (collapse)

Instance Method Details

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

Creates a new Personal Role to a specified location.

Examples:

# Create personalRole.
UU::OS::PersonalRole.create("ues:MT.SMITH.JOHN:PERSONAL",
  :meta_artifact_uri => "ues:MT.SMITH.JOHN:UU.OS/PERSONAL_TERRITORY/PERSONAL_ROLE",
  :first_name => "John",
  :surname => "Smith",
  :access_code1 => "accessCode1",
  :access_code2 => "accessCode2",
  :searchable_in_territory=> true,
  :grant_all_from_organizational_unit=>true,
  :security_clearance=>'NO_CONFIDENTIALITY',
  :security_level=>'NO_CONFIDENTIALITY',
  :code => nil,
  :description => nil,
  :competent_role_uri => nil,
  :component_content => nil,
  :icon_uri => nil,
  :avatar_uri => nil,
  :external_access_code1_validation => true
)
# Creates a Personal Role into a Business Territory for users without their own Personal Territory,
# in which case it should not be granted all from organizational unit and should not be searchable in territory.
# First name and surname can be set later when the Personal Role is assigned to a specific user.
UU::OS::PersonalRole.create("ues:PEOPLE-BT:ENV.ACRS/PACRS",
  :meta_artifact_uri => "ues:PEOPLE-BT:UU.OS/PERSONAL_TERRITORY/PERSONAL_ROLE",
  :grant_all_from_organizational_unit => false,
  :searchable_in_territory => false
)

Parameters:

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

    UESURI of a folder or an organizational unit where a Personal Role will be created to.

  • personal_role (PersonalRoleCreate) (defaults to: nil)

    Object containing attributes of the new Personal Role.

Options Hash (personal_role):

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

    UESURI of the Personal Role meta artifact. If the meta artifact is not specified or the user is not authorized to create a Personal Role according to the selected meta artifact, the command fails. Must not be nil.

  • :first_name (String)

    First name of the user represented by the Personal Role. When nil is set, the first name is set to the generated Universe ID.

  • :surname (String)

    Surname of the user represented by the Personal Role. When nil is set, the surname is set to “uuPerson”.

  • :access_code1 (String)

    Access code 1 of the Personal Role. Access code 1 must be 4-250 characters long and can only contain these characters: a-z, A-Z, 0-9, ‘.’, ‘-’, ‘_’, ‘@’. The access code 1 must be unique in the Universe, otherwise the command fails. When nil is set, a random code is generated.

  • :access_code2 (String)

    Access code 2 of the Personal Role. Access code 2 must be 8-250 characters long and can only contain these characters: any character. When nil is set, a random code is generated.

  • :grant_all_from_organizational_unit (Boolean)

    Deprecated. Specifies whether the Personal Role will be cast into All roles from organizational unit. When nil is set, the value is set to true.

  • :searchable_in_territory (Boolean)

    Specifies whether the Personal Role will be searchable within the territory. When nil is set, the value is set to the default value from the meta artifact.

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

    Security clearance of the Personal Role. When nil is set, the security clearance is set to NO_CONFIDENTIALITY.

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

    Security level of the Personal Role. When nil is set, the security level is set to the default value from the meta artifact. If the default security level is higher than the user security clearance, the command fails.

  • :code (String)

    Code of the Personal Role. The code must be unique within the territory, otherwise the command fails. When nil is set, the code is set to the generated Universe ID.

  • :description (String)

    Description of the Personal Role.

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

    UESURI of the Personal Role competent role. When nil is set, the executive role from authorization is used. If no role is authorized to create a Personal Role into the selected location, the command fails. If the selected role does not have a connected interface with the selected meta artifact, the command fails. If the selected role does not belong to the same organizational unit as the new Personal Role or to a superior organizational unit, the command fails.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the Personal Role is component content. When nil is set, the value is set to the default value from the meta artifact.

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

    UESURI of the Personal Role icon. When nil is set, the Personal Role uses the default icon from the 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}’.

  • :avatar_uri (String)

    UESURI or URL of image which represents the Personal Role avatar (user photo). When nil is set, the Personal Role is created without an avatar.

  • :universe_id (String)

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

  • :external_access_code1_validation (Boolean)

    determines whether to validation access code 1 using an external service (the default value is true)

Returns:



84
85
86
87
88
89
90
91
92
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 84

def create(location_uri, personal_role = nil)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  payload = UU::OS::PersonalRole::PersonalRoleCreate.new(personal_role).to_json

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

- (PersonalRoleAccountAttributes) get_account_list(personal_role_uri)

Returns a list of accounts of a Personal Role. The selected Personal Role must belong to the currently logged in user.

@param[String, UU::OS::UESURI] personal_role_uri URI of the Personal role whose accounts will be returned. Not nil.

Examples:

UU::OS::PersonalRole.('ues:PERSONAL_TERRITORY:PERSONAL_ROLE')

Parameters:

  • account_attributes (Hash)

    a customizable set of options

Returns:



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 348

def (personal_role_uri)
  result = nil;

  svc = UU::OS::REST::RemoteClient.new(PersonalRole);
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getAccountList', personal_role_uri);
    if (!res.nil?)
      res = JSON.parse(res, :symbolize_names => true)
      if ( res != nil )
        result = Array.new();
        res.each do |item|
          result << PersonalRole::PersonalRoleAccountAttributes.new(item);
        end
      end
    end
  end

  return result;
end

- (PersonalRoleSetArtifactPresentationAttributes) get_artifact_presentation_attributes(personal_role_uri)

Retrieves user settings of artifact presentation. User will see artifacts according to this configuration. Presentation of artifact can be affected by these attributes: artifact width, header mode (two lines, one line, none), control bar visibility, artifact header sticking, artifact display mode (advanced, simple). When viewing an artifact, presentation settings are looked up in the following order: User settings, artifact presentation settings, meta artifact template presentation settings, and layout artifact, if it is configured, or default system settings otherwise.

Examples:

# Get user presentation attributes of an artifact
UU::OS::PersonalRole.get_artifact_presentation_attributes('ues:PERSONAL_TERRITORY:PERSONAL_ROLE')

Parameters:

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

    URI of the personal role whose profile attributes are to be retrieved.

Returns:



289
290
291
292
293
294
295
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 289

def get_artifact_presentation_attributes(personal_role_uri)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getArtifactPresentationAttributes', personal_role_uri)
    return PersonalRole::PersonalRoleArtifactPresentationAttributes.new(res)
  end
end

- (PersonalRoleAttributes) get_attributes(personal_role_uri)

Returns attributes of a Personal Role.

Examples:

# Returns attributes a Personal Role.
UU::OS::PersonalRole.get_attributes("ues:MT.SMITH.JOHN:6-6666-1")

Parameters:

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

    UESURI of a Personal Role whose attributes will be returned.

Returns:



148
149
150
151
152
153
154
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 148

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

- (PersonalRole::ProfileAttributes) get_profile_attributes(personal_role_uri)

Returns profile information of the user.

Examples:

# Get profile attributes for certain role.
UU::OS::PersonalRole.get_profile_attributes('ues:MY_TERRITORY:PERSONAL_ROLE')

Parameters:

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

    URI of the personal role whose profile attributes are returned.

Returns:



192
193
194
195
196
197
198
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 192

def get_profile_attributes(personal_role_uri)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getProfileAttributes', personal_role_uri)
    return PersonalRole::ProfileAttributes.new(res)
  end
end

- (UU::OS::REST::ResultList<PersonalRole::PersonalRoleGetTerritoryList, PersonalRole::TerritoryAttributes>) get_territory_list(personal_role_uri, criteria = nil)

Returns a list of territories the personal role has access to. The command does not return all territories, only a sublist. The list of returned territories can be filtered by the name, code or type of a territory (See TerritoryType for supported types). The list is sorted by names (and codes in case two names are equal) by default, or it can be sorted arbitrarily.

Examples:

# Get territory list for specified personal role.
UU::OS::PersonalRole.get_territory_list('ues:MY_TERRITORY:PERSONAL_ROLE')

Parameters:

Returns:



170
171
172
173
174
175
176
177
178
179
180
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 170

def get_territory_list(personal_role_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  dto = UU::OS::PersonalRole::PersonalRoleGetTerritoryList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  svc.add_parameter('query', dto.query)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getTerritoryList', personal_role_uri)
    return UU::OS::REST::ResultList.new(PersonalRole::PersonalRoleGetTerritoryList, PersonalRole::TerritoryAttributes, res)
  end
end

- (UU::OS::UESURI) relocate(personal_role_uri, personal_role = nil)

Relocates a Personal Role between two territories within the same Territory Container. It is not possible to relocate a Personal Role within the same territory or across Territory Containers. To relocate a Personal Role, it is necessary to have permissions to move the selected Personal Role and insert it into the selected location according to the selected meta artifact. Note that attributes related to authorization and structure are not preserved when relocating the Personal Role and their value is evaluated the same way as when creating a new Personal Role.

Examples:

# Relocates a Personal Role from an Access Territory to a Personal Territory.
 UU::OS::PersonalRole.relocate("ues:ACCESS-BT:6-6666-1",
   :location_uri => "ues:MT.SMITH.JOHN:PERSONAL",
   :meta_artifact_uri => "ues:MT.SMITH.JOHN:UU.OS/PERSONAL_TERRITORY/PERSONAL_ROLE",
   :grant_all_from_organizational_unit => true,
   :searchable_in_territory => true,
   :security_clearance => "NO_CONFIDENTIALITY",
   :security_level => "NO_CONFIDENTIALITY",
   :code => nil,
   :competent_role_uri => nil
 )

Parameters:

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

    UESURI of a Personal Role to relocate.

  • personal_role (PersonalRoleRelocate) (defaults to: nil)

    Object containing a new location and modified attributes of the Personal Role.

Options Hash (personal_role):

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

    UESURI of a folder or an organizational unit in the target territory where the Personal Role will be relocated to. Must not be nil.

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

    UESURI of the Personal Role meta artifact in the target territory. If the meta artifact is not specified or the user is not authorized to create a Personal Role according to the selected meta artifact, the command fails. Must not be nil.

  • :grant_all_from_organizational_unit (Boolean)

    Deprecated. Specifies whether the Personal Role will be cast into All roles from organizational unit. When nil is set, the value is set to true.

  • :searchable_in_territory (Boolean)

    Specifies whether the Personal Role will be searchable within the territory. When nil is set, the value is set to the default value from the meta artifact.

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

    Security clearance of the Personal Role. When nil is set, the security clearance is set to NO_CONFIDENTIALITY.

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

    Security level of the Personal Role. When nil is set, the security level is set to the default value from the meta artifact. If the default security level is higher than the user security clearance, the command fails.

  • :code (String)

    Code of the Personal Role. The code must be unique within the territory, otherwise the command fails. When nil is set, the code is set to the generated Universe ID.

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

    UESURI of the Personal Role competent role in the target territory. When nil is set, the executive role from authorization is used. If no role is authorized to create a Personal Role into the selected location, the command fails. If the selected role does not have a connected interface with the selected meta artifact, the command fails. If the selected role does not belong to the same organizational unit as the new Personal Role or to a superior organizational unit, the command fails.

Returns:



325
326
327
328
329
330
331
332
333
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 325

def relocate(personal_role_uri, personal_role = nil)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  payload = UU::OS::PersonalRole::PersonalRoleRelocate.new(personal_role).to_json

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

- (Object) remove_account(personal_role_uri, account_attributes)

Removes an account of a Personal Role. Only an OAuth account, Mobile login account, One time login, Secure key login and Diary access account can be removed. See PersonalRoleAccountRealm for supported realms. The selected Personal Role must belong to the currently logged in user.

Examples:

UU::OS::PersonalRole.('ues:PERSONAL_TERRITORY:PERSONAL_ROLE', :id => '123456')

Parameters:

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

    URI of the Personal role whose account will be removed. Not nil.

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

    Object containing attributes of the account which will be removed. Not nil.

Options Hash (account_attributes):

  • :id (String)

    ID of the account. Not nil.



377
378
379
380
381
382
383
384
385
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 377

def (personal_role_uri, )
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  payload = UU::OS::PersonalRole::PersonalRoleRemoveAccount.new().to_json;

  svc = UU::OS::REST::RemoteClient.new(PersonalRole);
  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('removeAccount', personal_role_uri, payload);
  end
end

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

Sets access codes of a Personal Role. 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::PersonalRole.set_access_codes("ues:MT.SMITH.JOHN:6-6666-1",
  :access_code1 => "accessCode1",
  :access_code2 => "accessCode2",
  :new_access_code1 => "newAccessCode1",
  :new_access_code2 => "newAccessCode2",
  :external_access_code1_validation => true
)
# Changes access code 2 only.
UU::OS::PersonalRole.set_access_codes("ues:MT.SMITH.JOHN:6-6666-1",
  :access_code1 => "accessCode1",
  :access_code2 => "accessCode2",
  :new_access_code2 => "newAccessCode2"
)

Parameters:

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

    UESURI of a Personal Role whose attributes will be modified.

  • access_codes (PersonalRoleSetAccessCodes) (defaults to: nil)

    Object containing both current and new access codes of the Personal Role.

Options Hash (access_codes):

  • :external_access_code1_validation (Boolean)

    determines whether to validation access code 1 using an external service (the default value is true)

Returns:



413
414
415
416
417
418
419
420
421
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 413

def set_access_codes(personal_role_uri, access_codes = nil)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  payload = UU::OS::PersonalRole::PersonalRoleSetAccessCodes.new(access_codes).to_json

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

- (UU::OS::UESURI) set_artifact_presentation_attributes(personal_role_uri, presentation_attributes = nil)

Configures user settings of artifact presentation. User will see artifacts according to this configuration. Presentation of artifact can be affected by these attributes: artifact width, header mode (two lines, one line, none), control bar visibility, artifact header sticking, artifact display mode (advanced, simple). When viewing an artifact, presentation settings are looked up in the following order: User settings, artifact presentation settings, meta artifact template presentation settings, and layout artifact, if it is configured, or default system settings otherwise. #

Examples:

# Set user presentation attributes of an artifact
UU::OS::PersonalRole.set_artifact_presentation_attributes('ues:PERSONAL_TERRITORY:PERSONAL_ROLE',
   :artifact_width => UU::OS::Artifact::ArtifactWidthType::DEFAULT,
   :header_display_mode => UU::OS::Artifact::ArtifactHeaderDisplayMode::HIDDEN,
   :pin_artifact_header => true,
   :artifact_display_mode => UU::OS::Artifact::ArtifactDisplayMode::ADVANCED)

Parameters:

Options Hash (presentation_attributes):

Returns:



265
266
267
268
269
270
271
272
273
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 265

def set_artifact_presentation_attributes(personal_role_uri, presentation_attributes = nil)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  payload = UU::OS::PersonalRole::PersonalRoleSetArtifactPresentationAttributes.new(presentation_attributes).to_json

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

- (UU::OS::UESURI) set_attributes(personal_role_uri, personal_role = nil)

Sets attributes of a Personal Role.

Examples:

# Set attributes of a Personal Role.
UU::OS::PersonalRole.set_attributes("ues:MT.SMITH.JOHN:6-6666-1",
  :first_name => "John",
  :surname => "Smith",
  :grant_all_from_organizational_unit => true,
  :searchable_in_territory => true,
  :security_clearance => "NO_CONFIDENTIALITY",
  :security_level => "NO_CONFIDENTIALITY",
  :code => "6-6666-1",
  :description => "",
  :component_content => true,
  :icon_uri => "ues:[-1]:[-1]:",
  :avatar_uri => ""
)

Parameters:

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

    UESURI of a Personal Role whose attributes will be modified.

  • personal_role (PersonalRoleSetAttributes) (defaults to: nil)

    Object containing modified attributes of the Personal Role.

Options Hash (personal_role):

  • :first_name (String)

    First name of the user represented by the Personal Role. When nil is set, the first name is not modified.

  • :surname (String)

    Surname of the user represented by the Personal Role. When nil is set, the surname is not modified.

  • :grant_all_from_organizational_unit (Boolean)

    Deprecated. Specifies whether the Personal Role is cast into All roles from organizational unit. When nil is set, the value is not modified.

  • :searchable_in_territory (Boolean)

    Specifies whether the Personal Role is searchable within the territory. When nil is set, the value is not modified.

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

    Security clearance of the Personal Role. When nil is set, the security clearance is not modified.

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

    Security level of the Personal Role. When nil is set, the security level is not modified.

  • :code (String)

    Code of the Personal Role. When nil is set, the code is not modified. When an empty string is set, the code is generated automatically using the system sequence. The code must be unique in the given territory, otherwise the command fails.

  • :description (String)

    Description of the Personal Role. When nil is set, the description is not modified.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the Personal Role is component content. When nil is set, the value is not modified.

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

    UESURI of the Personal Role icon. When nil is set, the icon is not modified. When nil UESURI (“ues::[-1]:”) is set, the Personal Role uses the default icon from the 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}’.

  • :avatar_uri (String)

    UESURI or URL of image which represents Personal Role avatar (user photo). When nil is set, the avatar is not modified. When an empty string is set, the value is erased.

Returns:



128
129
130
131
132
133
134
135
136
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 128

def set_attributes(personal_role_uri, personal_role = nil)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  payload = UU::OS::PersonalRole::PersonalRoleSetAttributes.new(personal_role).to_json

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

- (UU::OS::UESURI) set_profile_attributes(personal_role_uri, options)

Sets user's profile attributes.

Examples:

# Set the personals role language.
UU::OS::PersonalRole.set_profile_attributes('ues:MY_TERRITORY:PERSONAL_ROLE', :language => 'en')

# Enable usage of experimental functionalities
UU::OS::PersonalRole.set_profile_attributes('ues:MY_TERRITORY:PERSONAL_ROLE',
:experimental_features_enabled => true
)

Parameters:

Options Hash (options):

  • :language (String, UU::OS::PersonalRole::PersonalRoleLanguage)

    User language. The language is in the ISO 639-1 format. Changes may take effect with delay due to profile cache.

  • :notifications_email (String)

    E-mail address for notifications. Must be specified if notifications are not turned off. For example email@email.com.

  • :notifications_rule (String, UU::OS::PersonalRole::PersonalRoleNotificationsRule)

    Notification rule setting. If notifications are not turned off, notifications e-mail must be specified.

  • :experimental_features_enabled (Boolean)

    Experimental features setting. Enables or disables the use of experimental features for the personal role. Changes may take effect with delay due to profile cache.

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

    Location of user bookmarks. The location must be a Folder or Organizational Unit of the same territory as the Personal Role. Also, the Personal Role must have rights to insert into this location. If set to an empty string, no location will be set. If set to nil, the value will not be modified.

  • :global_login_enabled (Boolean)

    Specifies whether the user global login is enabled. If set to nil, the value will not be modified.

  • :portlets (Array)

    List of portlets displayed in the portlet area. The value is an array of portlet codes defined in PersonalRolePortlet. An empty position with no portlet is specified by a nil value (or an empty string). Example: [“NAVIGATION”, “NEW_ACTIVITIES”, nil, “TABLE_OF_CONTENTS”]. The maximum allowed number of portlets (array size) is 5. If set to nil, the value will not be modified.

  • :portlets_mode (UU::OS::PersonalRole::PersonalRolePortletsMode)

    Specifies whether the portlet area is displayed. Only VISIBLE or HIDDEN can be set. If set to nil, the value will not be modified.

  • :portlets_mobile_mode (UU::OS::PersonalRole::PersonalRolePortletsMode)

    Specifies whether the portlet area is displayed on mobile devices. If set to DEFAULT, then the portlet area will be displayed on mobile devices according to the portlets_mode. If set to nil, the value will not be modified.

  • :responsive_layout_enabled (Boolean)

    Responsive layout settings. Enables or disables using layout customized for devices with different screen sizes.

  • :responsive_content_enabled (Boolean)

    Responsive content settings. Enables or disables showing artifact content customized for devices with different screen sizes.

  • :bookmarks_to_navigator (Boolean)

    Enables or disables the automatic saving of links to artifacts in the navigator. Setting this attribute may not have any effect if the UC for adding bookmark to navigator is not available for given personal role.

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

    UESURI of the preferred territory. It is the preferred territory of the user identified by the personal role. If nil is set, preferred territory will not be changed for the personal role.

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

    UESURI of the preferred role in the preferred territory. Those are the preferred territory and the preferred role of the user identified by the personal role. If nil is set, preferred role in the preferred territory will not be changed for the personal role. Preferred role can’t be set if parameter preferred_territory_uri is nil.

Returns:

  • (UU::OS::UESURI)

    URI of the personal role, for which was the language settings modified.



230
231
232
233
234
235
236
237
238
# File 'uu_os-0.29.16/lib/uu/os/personal_role.rb', line 230

def set_profile_attributes(personal_role_uri, options)
  svc = UU::OS::REST::RemoteClient.new(PersonalRole)
  attributesJson = UU::OS::PersonalRole::ProfileSetAttributes.new(options).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setProfileAttributes', personal_role_uri, attributesJson)
    return UU::OS::UESURI.new(res)
  end
end