Module: UU::OS::Shortcut

Extended by:
Shortcut
Included in:
Shortcut
Defined in:
uu_os_client-0.10.6/lib/uu/os/shortcut.rb,
uu_os_client-0.10.6/lib/uu/os/shortcut/shortcut_create.rb,
uu_os_client-0.10.6/lib/uu/os/shortcut/shortcut_relocate.rb,
uu_os_client-0.10.6/lib/uu/os/shortcut/shortcut_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/shortcut/shortcut_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/shortcut/shortcut_get_shortcut_list.rb

Defined Under Namespace

Classes: ShortcutAttributes, ShortcutCreate, ShortcutGetShortcutList, ShortcutRelocate, ShortcutSetAttributes

Constant Summary

PATH =

Service path

'ues/core/container/UESShortcut'

Instance Method Summary (collapse)

Instance Method Details

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

This command creates a new shortcut for the specified artifact. At the very least, referenced artifact have to be specified in this command.

Parameters:

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

    UESURI of the location (folder, org. unit, territory etc.) where the new shortcut is created

  • shortcut (ShortcutCreate) (defaults to: nil)

    DTO containing attributes of the new shortcut

Returns:



24
25
26
27
28
29
30
31
32
# File 'uu_os_client-0.10.6/lib/uu/os/shortcut.rb', line 24

def create(location_uri, shortcut = nil)
  svc = UU::OS::REST::RemoteClient.new(Shortcut)
  payload = UU::OS::Shortcut::ShortcutCreate.new(shortcut).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(shortcut_uri)

This command deletes the shortcut from the system.

Parameters:

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

    UESURI of the shortcut to be deleted



98
99
100
101
102
103
# File 'uu_os_client-0.10.6/lib/uu/os/shortcut.rb', line 98

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

- (ShortcutAttributes) get_attributes(shortcut_uri)

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

Parameters:

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

    UESURI of a shortcut whose attributes are returned

Returns:



40
41
42
43
44
45
46
# File 'uu_os_client-0.10.6/lib/uu/os/shortcut.rb', line 40

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

- (UU::OS::REST::ResultList<Shortcut::ShortcutGetShortcutList, Shortcut::ShortcutAttributes>) get_shortcut_list(artifact_uri, criteria = nil)

This command returns a list of shortcuts to the specified artifact. The command does not return all shortcuts, only a sublist. Only the shortcuts from the territory of the artifact are returned. The list of returned shortcuts could be filtered by the name or code of a shortcut. The list is sorted by the name (and codes in case are equal) of a shortcut by default, or it can be sorted arbitrarily by any of shortcut attributes usable for the filtering or these attributes combinations. See the UES query documentation for more information.

name and code.

See UESQuery Documentation.

Parameters:

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

    UESURI of the artifact to which the returned shortcuts point.

  • criteria (ShortcutGetShortcutList) (defaults to: nil)

    DTO containing criteria for listing shortcuts. Available parameters are:

Returns:



63
64
65
66
67
68
69
70
71
72
73
# File 'uu_os_client-0.10.6/lib/uu/os/shortcut.rb', line 63

def get_shortcut_list(artifact_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(Shortcut)
  dto = Shortcut::ShortcutGetShortcutList.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('getShortcutList', artifact_uri)
    return UU::OS::REST::ResultList.new(Shortcut::ShortcutGetShortcutList, Shortcut::ShortcutAttributes, res)
  end
end

- (UU::OS::UESURI) relocate(shortcut_uri, shortcut = nil)

This command relocates the shortcut to the new location. It means the shortcut is deleted and created again in a new location. It is recreated with the same attributes. But its UESURI is different because the shortcut is deleted and created again in another location. At the very least new location have to be specified in this command. The new location has to be in the same territory.

Parameters:

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

    UESURI of the shortcut to relocate

  • shortcut (ShortcutRelocate) (defaults to: nil)

    DTO containing attributes for the shortcut relocation

Returns:

  • (UU::OS::UESURI)

    UESURI of the relocated shortcut. UESURI is different because the shortcut is deleted and created again in another location.



85
86
87
88
89
90
91
92
93
# File 'uu_os_client-0.10.6/lib/uu/os/shortcut.rb', line 85

def relocate(shortcut_uri, shortcut = nil)
  svc = UU::OS::REST::RemoteClient.new(Shortcut)
  payload = UU::OS::Shortcut::ShortcutRelocate.new(shortcut).to_json

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

- (UU::OS::UESURI) set_attributes(shortcut_uri, shortcut = nil)

This command updates some basic attributes of a shortcut.

Parameters:

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

    UESURI of the shortcut whose attributes are to be changed

  • shortcut (ShortcutSetAttributes) (defaults to: nil)

    DTO containing new attributes the shortcut

Returns:

  • (UU::OS::UESURI)

    UESURI of the shortcut. It could be changed because command could change the code



111
112
113
114
115
116
117
118
119
# File 'uu_os_client-0.10.6/lib/uu/os/shortcut.rb', line 111

def set_attributes(shortcut_uri, shortcut = nil)
  svc = UU::OS::REST::RemoteClient.new(Shortcut)
  payload = UU::OS::Shortcut::ShortcutSetAttributes.new(shortcut).to_json

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