Module: UU::OS::OrganizationalUnit
- Extended by:
- OrganizationalUnit
- Included in:
- OrganizationalUnit
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/organizational_unit/organizational_unit_create.rb,
uu_os_client-0.10.6/lib/uu/os/organizational_unit.rb,
uu_os_client-0.10.6/lib/uu/os/organizational_unit/organizational_unit_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/organizational_unit/organizational_unit_entry_type.rb,
uu_os_client-0.10.6/lib/uu/os/organizational_unit/organizational_unit_get_entry_list.rb,
uu_os_client-0.10.6/lib/uu/os/organizational_unit/organizational_unit_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/organizational_unit/organizational_unit_entry_attributes.rb
Overview
Module Organizational Unit.
Defined Under Namespace
Classes: OrganizationalUnitAttributes, OrganizationalUnitCreate, OrganizationalUnitEntryAttributes, OrganizationalUnitEntryType, OrganizationalUnitGetEntryList, OrganizationalUnitSetAttributes
Constant Summary
- PATH =
Service path
'ues/core/container/UESOrganizationalUnit'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, organizational_unit = nil)
Creates a new organizational unit.
-
- (Object) delete(org_unit_uri)
This command deletes the specified organizational unit from the system.
-
- (OrganizationalUnitAttributes) get_attributes(organizational_unit_uri)
This command returns attributes representing the organizational unit specified by the organizationalUnitUri parameter.
-
- (UU::OS::REST::ResultList<OrganizationalUnit::OrganizationalUnitGetEntryList, OrganizationalUnit::OrganizationalUnitEntryAttributes>) get_entry_list(organizational_unit_uri, criteria = nil)
This command returns a list of entries (artifacts or shortcuts) enlisted in the specified organizational unit.
-
- (UU::OS::UESURI) set_attributes(organizational_unit_uri, organizational_unit = nil)
Command for setting attributes of an organizational unit.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, organizational_unit = nil)
Creates a new organizational unit. The command creates a new organizational unit in a specified location. At the very least meta artifact must be specified in UESOrganizationalUnitCreate DTO. Competent role for the organizational unit 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 OrganizationalUnitCreate DTO.
43 44 45 46 47 48 49 50 51 |
# File 'uu_os_client-0.10.6/lib/uu/os/organizational_unit.rb', line 43 def create(location_uri, organizational_unit = nil) svc = UU::OS::REST::RemoteClient.new(OrganizationalUnit) payload = UU::OS::OrganizationalUnit::OrganizationalUnitCreate.new(organizational_unit).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) delete(org_unit_uri)
This command deletes the specified organizational unit from the system. The organizational unit is deleted even if it contains a locked sheet or attachment. The organizational unit cannot be deleted when: the org. unit is not empty, the org. unit's workflow is not created, a property contains a reference to this org. unit, a time sheet exists with a reference to this org. unit.
94 95 96 97 98 99 |
# File 'uu_os_client-0.10.6/lib/uu/os/organizational_unit.rb', line 94 def delete(org_unit_uri) svc = UU::OS::REST::RemoteClient.new(OrganizationalUnit) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', org_unit_uri) end end |
- (OrganizationalUnitAttributes) get_attributes(organizational_unit_uri)
This command returns attributes representing the organizational unit specified by the organizationalUnitUri parameter. The command does not change the state of the organizational unit in the system.
60 61 62 63 64 65 66 |
# File 'uu_os_client-0.10.6/lib/uu/os/organizational_unit.rb', line 60 def get_attributes(organizational_unit_uri) svc = UU::OS::REST::RemoteClient.new(OrganizationalUnit) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', organizational_unit_uri) return OrganizationalUnit::OrganizationalUnitAttributes.new(res) end end |
- (UU::OS::REST::ResultList<OrganizationalUnit::OrganizationalUnitGetEntryList, OrganizationalUnit::OrganizationalUnitEntryAttributes>) get_entry_list(organizational_unit_uri, criteria = nil)
This command returns a list of entries (artifacts or shortcuts) enlisted in the specified organizational unit. Only entries listed exactly in the specified organizational units are considered (so subordinate organizational units 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.
name, code and type : OrganizationalUnitEntryType.
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'uu_os_client-0.10.6/lib/uu/os/organizational_unit.rb', line 118 def get_entry_list(organizational_unit_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(OrganizationalUnit) dto = OrganizationalUnit::OrganizationalUnitGetEntryList.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', organizational_unit_uri) return UU::OS::REST::ResultList.new(OrganizationalUnit::OrganizationalUnitGetEntryList, OrganizationalUnit::OrganizationalUnitEntryAttributes, res) end end |
- (UU::OS::UESURI) set_attributes(organizational_unit_uri, organizational_unit = nil)
Command for setting attributes of an organizational unit. The command can't modify references to objects like location, competent role and so on.
75 76 77 78 79 80 81 82 83 |
# File 'uu_os_client-0.10.6/lib/uu/os/organizational_unit.rb', line 75 def set_attributes(organizational_unit_uri, organizational_unit = nil) svc = UU::OS::REST::RemoteClient.new(OrganizationalUnit) payload = UU::OS::OrganizationalUnit::OrganizationalUnitSetAttributes.new(organizational_unit).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', organizational_unit_uri, payload) return UU::OS::UESURI.new(res) end end |