Module: UU::OS::Company Deprecated

Extended by:
Company
Included in:
Company
Defined in:
uu_os-0.29.16/lib/uu/os/company.rb,
uu_os-0.29.16/lib/uu/os/company/company_create.rb,
uu_os-0.29.16/lib/uu/os/company/company_attributes.rb,
uu_os-0.29.16/lib/uu/os/company/company_get_entry_list.rb,
uu_os-0.29.16/lib/uu/os/company/company_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/company/company_entry_attributes.rb

Overview

Deprecated.

Very soon, it will not be possible to create artifacts of this class

Company service.

Defined Under Namespace

Classes: CompanyAttributes, CompanyCreate, CompanyEntryAttributes, CompanyGetEntryList, CompanySetAttributes

Constant Summary

PATH =

Service path

'ues/core/container/UESCompany'

Instance Method Summary (collapse)

Instance Method Details

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

Creates a new company. The command creates a new company in a specified location. At the very least meta artifact must be specified in CompanyCreate Object. Competent role for the company 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 CompanyCreate Object.

Parameters:

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

    UESURI of the container except meta model where the company is going to be created

  • company (CompanyCreate) (defaults to: nil)

    Object containing attributes of new company

Returns:



30
31
32
33
34
35
36
37
38
# File 'uu_os-0.29.16/lib/uu/os/company.rb', line 30

def create(location_uri, company = nil)
  svc = UU::OS::REST::RemoteClient.new(Company)
  payload = UU::OS::Company::CompanyCreate.new(company).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(company_uri)

This command deletes the specified company from the system. The company is deleted even if constains locked sheet or attachment. The company cannot be deleted when:

the company is not empty. 
the company's workflow is not created 
a property contains a reference to this company 
a time sheet exists with a reference to this company

Parameters:

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

    UESURI of the company which is going to be deleted



79
80
81
82
83
84
# File 'uu_os-0.29.16/lib/uu/os/company.rb', line 79

def delete(company_uri)
  svc = UU::OS::REST::RemoteClient.new(Company)
  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('delete', company_uri)
  end
end

- (CompanyAttributes) get_attributes(company_uri)

This command returns attributes representing the company specified by the companyUri parameter. The command does not change the state of the company in the system.

Parameters:

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

    UESURI of the company whose attributes are returned

Returns:



46
47
48
49
50
51
52
# File 'uu_os-0.29.16/lib/uu/os/company.rb', line 46

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

- (UU::OS::REST::ResultList<Company::CompanyGetEntryList, Company::CompanyEntryAttributes>) get_entry_list(company_uri, criteria = nil)

This command returns a list of entries (artifacts or shortcuts) enlisted in the specified company. Only entries listed exactly in the specified company 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 entityType 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 entityTypeUri.

See UESQuery Documentation.

Parameters:

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

    UESURI of the company from where entries are listed

  • criteria (CompanyGetEntryList) (defaults to: nil)

    Object containing criteria for listing Available parameters are:

Returns:



103
104
105
106
107
108
109
110
111
112
113
114
# File 'uu_os-0.29.16/lib/uu/os/company.rb', line 103

def get_entry_list(company_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(Company)
  dto = Company::CompanyGetEntryList.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', company_uri)
    return UU::OS::REST::ResultList.new(Company::CompanyGetEntryList, Company::CompanyEntryAttributes, res)
  end
end

- (UU::OS::UESURI) set_attributes(company_uri, company = nil)

Command for setting attributes of a company. The command cannot modify references to objects like location, competent role and so on.

Parameters:

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

    UESURI of the company whose attributes are to be changed.

  • company (CompanySetAttributes) (defaults to: nil)

    Object containing new attributes for company

Returns:



61
62
63
64
65
66
67
68
69
# File 'uu_os-0.29.16/lib/uu/os/company.rb', line 61

def set_attributes(company_uri, company = nil)
  svc = UU::OS::REST::RemoteClient.new(Company)
  payload = UU::OS::Company::CompanySetAttributes.new(company).to_json

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