Module: UU::OS::MetaAccessRole
- Extended by:
- MetaAccessRole
- Included in:
- MetaAccessRole
- Defined in:
- uu_os-0.29.16/lib/uu/os/meta_access_role.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_copy.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_create.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_export.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_get_export_data.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_add_role_interface.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_remove_role_interface.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_get_role_interface_list.rb,
uu_os-0.29.16/lib/uu/os/meta_access_role/meta_access_role_get_role_interface_list_item.rb
Overview
Module Meta Access Role.
Defined Under Namespace
Classes: MetaAccessRoleAddRoleInterface, MetaAccessRoleAttributes, MetaAccessRoleCopy, MetaAccessRoleCreate, MetaAccessRoleExport, MetaAccessRoleGetExportData, MetaAccessRoleGetRoleInterfaceList, MetaAccessRoleGetRoleInterfaceListItem, MetaAccessRoleRemoveRoleInterface, MetaAccessRoleSetAttributes
Constant Summary
- PATH =
Service path
'ues/core/role/UESMetaAccessRole'
Instance Method Summary (collapse)
-
- (Object) add_role_interface(meta_access_role_uri, role_interface = nil)
Creates new role interface connection to the specified meta access role.
-
- (UU::OS::UESURI) copy(source_meta_artifact_uri, meta_access_role = nil)
Copy a meta access role.
-
- (UU::OS::UESURI) create(location_uri, meta_access_role = nil)
deprecated
Deprecated.
The uuCommand MetaAccessRole.create is used for creating meta access role from the XML file temporarily. This feature will be removed in a future version and replaced by the specific uuCommands for creating template objects.
-
- (UU::OS::UESURI) export(meta_access_role_uri)
Exports a meta access role to the XML file, which is saved to the export storage.
-
- (UU::OS::MetaAccessRole::MetaAccessRoleAttributes) get_attributes(meta_access_role_uri)
Returns attributes representing the meta access role specified by the meta_access_role_uri parameter.
-
- (UU::OS::REST::BinaryValue) get_export_data(meta_access_role_uri, meta_access_role = nil)
Returns a XML file generated by the export command.
-
- (UU::OS::REST::ResultList<MetaAccessRole::MetaAccessRoleGetRoleInterfaceList, MetaAccessRole::MetaAccessRoleGetRoleInterfaceListItem>) get_role_interface_list(meta_access_role_uri, criteria = nil)
Returns list of the role interfaces that are added to the specified meta access role.
-
- (Object) remove_role_interface(meta_access_role_uri, role_interface = nil)
Removes role interface connection from the specified meta access role.
-
- (UU::OS::UESURI) set_attributes(meta_access_role_uri, meta_access_role = nil)
Command for setting attributes of a meta access role.
Instance Method Details
- (Object) add_role_interface(meta_access_role_uri, role_interface = nil)
Creates new role interface connection to the specified meta access role. The role interface has to be in an active state and must not be already added. The role interface can be added to meta access role only provided that role interface is located in the same, child or parent meta model as meta access role.
133 134 135 136 137 138 139 140 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 133 def add_role_interface(, role_interface = nil) svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) payload = UU::OS::MetaAccessRole::MetaAccessRoleAddRoleInterface.new(role_interface).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('addRoleInterface', , payload) end end |
- (UU::OS::UESURI) copy(source_meta_artifact_uri, meta_access_role = nil)
Copy a meta access role. The command creates a new meta access role according to specified source meta access role in a specified location. At the very least location meta access role and name must be specified in MetaAccessRoleCopy DTO. Competent role for the new meta access role copy will be selected as the most suitable according to specified container and meta access role (executive/authorized role with connected interface), or can be also specified in MetaAccessRoleCopy DTO.
110 111 112 113 114 115 116 117 118 119 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 110 def copy(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) svc.timeout = 120 # may take longer than default 60 seconds payload = UU::OS::MetaAccessRole::MetaAccessRoleCopy.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('copy', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) create(location_uri, meta_access_role = nil)
The uuCommand MetaAccessRole.create is used for creating meta access role from the XML file temporarily. This feature will be removed in a future version and replaced by the specific uuCommands for creating template objects.
Creates a meta access role from an exported XML file in the specified location. Source meta access role must be derived (at least indirectly) from a meta access role which is a part of UU.OS uuApp. Creation of meta access role is divided into synchronous and asynchronous part. During the synchronous part, the meta access role is created. During the asynchronous part, the template objects are created. If the asynchronous process fails and the Problem state is set on meta access role, it is possible to solve the problem (e.g. add reference_map) and run the command again.
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 287 def create(location_uri, = nil) svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) dto = UU::OS::MetaAccessRole::MetaAccessRoleCreate.new() payload = dto.to_hash payload.delete(:data) tmpfile = Tempfile.new("MetaAccessRoleCreate") begin if (!dto.data.data.respond_to?(:read)) tmpfile.write(dto.data.data) payload[:data] = tmpfile elsif (dto.data.data.respond_to?(:read) && !dto.data.data.respond_to?(:path)) tmpfile.binmode dto.data.data.rewind tmpfile.write(dto.data.data.read) payload[:data] = tmpfile else payload[:data] = dto.data.to_hash(false) end tmpfile.flush tmpfile.rewind UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, payload) return UU::OS::UESURI.new(res) end ensure tmpfile.close tmpfile.unlink end end |
- (UU::OS::UESURI) export(meta_access_role_uri)
Exports a meta access role to the XML file, which is saved to the export
storage. The export is an asynchronous process.
It is possible to wait
for the end of the process. More information in Process and in Future.
To get exported data
from the storage use get_export_data.
209 210 211 212 213 214 215 216 217 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 209 def export() svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) payload = UU::OS::MetaAccessRole::MetaAccessRoleExport.new(nil).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('export', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::MetaAccessRole::MetaAccessRoleAttributes) get_attributes(meta_access_role_uri)
Returns attributes representing the meta access role specified by the meta_access_role_uri parameter. The command does not change the state of the meta access role in the system.
36 37 38 39 40 41 42 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 36 def get_attributes() svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', ) return MetaAccessRole::MetaAccessRoleAttributes.new(res) end end |
- (UU::OS::REST::BinaryValue) get_export_data(meta_access_role_uri, meta_access_role = nil)
Returns a XML file generated by the export command.
236 237 238 239 240 241 242 243 244 245 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 236 def get_export_data(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) dto = UU::OS::MetaAccessRole::MetaAccessRoleGetExportData.new() if dto.requested_mime_type svc.add_parameter('requestedMimeType', dto.requested_mime_type) end UU::OS::QoS::QoSHandler.auto_retry do return svc.get_binary('getExportData', ) end end |
- (UU::OS::REST::ResultList<MetaAccessRole::MetaAccessRoleGetRoleInterfaceList, MetaAccessRole::MetaAccessRoleGetRoleInterfaceListItem>) get_role_interface_list(meta_access_role_uri, criteria = nil)
Returns list of the role interfaces that are added to the specified meta access role. The list of returned interfaces could be filtered by the name or code. Returned list does not contain any objects filtered out by executed UESQuery. The list is sorted by the name (and codes in case are equal) of an interface by default.
161 162 163 164 165 166 167 168 169 170 171 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 161 def get_role_interface_list(, criteria = nil) svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) dto = MetaAccessRole::MetaAccessRoleGetRoleInterfaceList.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('getRoleInterfaceList', ) return UU::OS::REST::ResultList.new(MetaAccessRole::MetaAccessRoleGetRoleInterfaceList, MetaAccessRole::MetaAccessRoleGetRoleInterfaceListItem, res) end end |
- (Object) remove_role_interface(meta_access_role_uri, role_interface = nil)
Removes role interface connection from the specified meta access role. Only added interfaces can be removed from meta access role.
183 184 185 186 187 188 189 190 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 183 def remove_role_interface(, role_interface = nil) svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) payload = UU::OS::MetaAccessRole::MetaAccessRoleRemoveRoleInterface.new(role_interface).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('removeRoleInterface', , payload) end end |
- (UU::OS::UESURI) set_attributes(meta_access_role_uri, meta_access_role = nil)
Command for setting attributes of a meta access role. The command cannot modify references to objects like location, competent role and so on.
67 68 69 70 71 72 73 74 75 |
# File 'uu_os-0.29.16/lib/uu/os/meta_access_role.rb', line 67 def set_attributes(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaAccessRole) payload = UU::OS::MetaAccessRole::MetaAccessRoleSetAttributes.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', , payload) return UU::OS::UESURI.new(res) end end |