Module: UU::OS::OrganizationalUnit
- Extended by:
- OrganizationalUnit
- Included in:
- OrganizationalUnit
- Defined in:
- uu_os-0.29.16/lib/uu/os/organizational_unit/organizational_unit_create.rb,
uu_os-0.29.16/lib/uu/os/organizational_unit.rb,
uu_os-0.29.16/lib/uu/os/organizational_unit/organizational_unit_attributes.rb,
uu_os-0.29.16/lib/uu/os/organizational_unit/organizational_unit_entry_type.rb,
uu_os-0.29.16/lib/uu/os/organizational_unit/organizational_unit_get_entry_list.rb,
uu_os-0.29.16/lib/uu/os/organizational_unit/organizational_unit_set_attributes.rb,
uu_os-0.29.16/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 OrganizationalUnitCreate 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.
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'uu_os-0.29.16/lib/uu/os/organizational_unit.rb', line 44 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) # res is nil if dry_run was set to true. In that case, return nil (do nothing) if !(res.nil? || res.empty?) return UU::OS::UESURI.new(res) end 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.
116 117 118 119 120 121 |
# File 'uu_os-0.29.16/lib/uu/os/organizational_unit.rb', line 116 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.
68 69 70 71 72 73 74 |
# File 'uu_os-0.29.16/lib/uu/os/organizational_unit.rb', line 68 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.
145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'uu_os-0.29.16/lib/uu/os/organizational_unit.rb', line 145 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.
93 94 95 96 97 98 99 100 101 |
# File 'uu_os-0.29.16/lib/uu/os/organizational_unit.rb', line 93 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 |