Module: UU::OS::Shortcut
- Extended by:
- Shortcut
- Included in:
- Shortcut
- Defined in:
- uu_os-0.29.16/lib/uu/os/shortcut.rb,
uu_os-0.29.16/lib/uu/os/shortcut/shortcut_create.rb,
uu_os-0.29.16/lib/uu/os/shortcut/shortcut_relocate.rb,
uu_os-0.29.16/lib/uu/os/shortcut/shortcut_attributes.rb,
uu_os-0.29.16/lib/uu/os/shortcut/shortcut_set_attributes.rb,
uu_os-0.29.16/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)
-
- (UU::OS::UESURI) create(location_uri, shortcut = nil)
This command creates a new shortcut for the specified artifact.
-
- (Object) delete(shortcut_uri)
This command deletes the shortcut from the system.
-
- (ShortcutAttributes) get_attributes(shortcut_uri)
This command returns attributes representing the shortcut specified by the shortcutUri parameter.
-
- (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.
-
- (UU::OS::UESURI) relocate(shortcut_uri, shortcut = nil)
This command relocates the shortcut to the new location.
-
- (UU::OS::UESURI) set_attributes(shortcut_uri, shortcut = nil)
This command updates some basic attributes of a shortcut.
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.
31 32 33 34 35 36 37 38 39 |
# File 'uu_os-0.29.16/lib/uu/os/shortcut.rb', line 31 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.
124 125 126 127 128 129 |
# File 'uu_os-0.29.16/lib/uu/os/shortcut.rb', line 124 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.
52 53 54 55 56 57 58 |
# File 'uu_os-0.29.16/lib/uu/os/shortcut.rb', line 52 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.
79 80 81 82 83 84 85 86 87 88 89 |
# File 'uu_os-0.29.16/lib/uu/os/shortcut.rb', line 79 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.
107 108 109 110 111 112 113 114 115 |
# File 'uu_os-0.29.16/lib/uu/os/shortcut.rb', line 107 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.
145 146 147 148 149 150 151 152 153 |
# File 'uu_os-0.29.16/lib/uu/os/shortcut.rb', line 145 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 |