Module: UU::OS::Widget
- Extended by:
- Widget
- Included in:
- Widget
- Defined in:
- uu_os-0.29.16/lib/uu/os/widget.rb,
uu_os-0.29.16/lib/uu/os/widget/widget_create.rb,
uu_os-0.29.16/lib/uu/os/widget/widget_export.rb,
uu_os-0.29.16/lib/uu/os/widget/widget_attributes.rb,
uu_os-0.29.16/lib/uu/os/widget/placeholder_image.rb,
uu_os-0.29.16/lib/uu/os/widget/widget_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/widget/widget_get_export_data.rb,
uu_os-0.29.16/lib/uu/os/widget/widget_get_widget_list.rb,
uu_os-0.29.16/lib/uu/os/widget/widget_get_widget_list_item.rb
Overview
Module Widget.
Defined Under Namespace
Classes: PlaceholderImage, WidgetAttributes, WidgetCreate, WidgetExport, WidgetGetExportData, WidgetGetWidgetList, WidgetGetWidgetListItem, WidgetSetAttributes
Constant Summary
- PATH =
Service path
'uu/os/Widget'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, widget = nil)
Creates a widget in specified location.
-
- (Object) delete(widget_uri)
Deletes the specified widget from the system.
-
- (UU::OS::UESURI) export(widget_uri)
Exports a widget to the XML file, which is saved to the export storage.
-
- (WidgetAttributes) get_attributes(widget_uri)
Returns attributes of the specified widget.
-
- (UU::OS::REST::BinaryValue) get_export_data(widget_uri, widget = nil)
Returns a XML file generated by the export command.Widget#export.
-
- (UU::OS::REST::ResultList<Widget::WidgetGetWidgetListItem, Widget::WidgetGetWidgetList>) get_registered_widget_list(container_uri, criteria = nil)
Returns the list of widgets, which are registered in the selected territory or uuApp meta model.
-
- (UU::OS::REST::ResultList<Widget::WidgetGetWidgetListItem, Widget::WidgetGetWidgetList>) get_widget_list(entity_uri, criteria = nil)
Returns the list of widgets whose instances can be inserted into the content of selected sheet or into the content of a sheet on a given Artifact.
-
- (UU::OS::UESURI) set_attributes(widget_uri, widget = nil)
Sets attributes of widget.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, widget = nil)
Creates a widget in specified location. At the very least meta artifact must be specified in WidgetCreate object. Competent role for the new widget will be selected as the most suitable according to specified package and meta artifact (executive/authorized role with connected interface), or can be also specified in WidgetCreate Object.
57 58 59 60 61 62 63 64 65 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 57 def create(location_uri, = nil) svc = UU::OS::REST::RemoteClient.new(Widget) payload = UU::OS::Widget::WidgetCreate.new().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(widget_uri)
Deletes the specified widget from the system. The widget is deleted even if it contains a locked sheet or attachment. The widget cannot be deleted when: the widget's workflow is not created a property contains a reference to this widget a time sheet exists with a reference to this widget
77 78 79 80 81 82 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 77 def delete() svc = UU::OS::REST::RemoteClient.new(Widget) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', ) end end |
- (UU::OS::UESURI) export(widget_uri)
Exports a widget to the XML file, which is saved to the export storage. The export is an asynchronous process. It is possible to wait for the end of the process. More information in Env::Process and in REST::Future.
204 205 206 207 208 209 210 211 212 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 204 def export() svc = UU::OS::REST::RemoteClient.new(Widget) payload = UU::OS::Widget::WidgetExport.new(nil).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('export', , payload) return UU::OS::UESURI.new(res) end end |
- (WidgetAttributes) get_attributes(widget_uri)
Returns attributes of the specified widget.
93 94 95 96 97 98 99 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 93 def get_attributes() svc = UU::OS::REST::RemoteClient.new(Widget) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', ) return Widget::WidgetAttributes.new(res) end end |
- (UU::OS::REST::BinaryValue) get_export_data(widget_uri, widget = nil)
Returns a XML file generated by the export command.Widget#export.
231 232 233 234 235 236 237 238 239 240 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 231 def get_export_data(, = nil) svc = UU::OS::REST::RemoteClient.new(Widget) dto = UU::OS::Widget::WidgetGetExportData.new() if dto.requested_mime_type svc.add_parameter('requestedMimeType', dto.requested_mime_type) end UU::OS::QoS::QoSHandler.auto_retry do return svc.get_binary('getExportData', ) end end |
- (UU::OS::REST::ResultList<Widget::WidgetGetWidgetListItem, Widget::WidgetGetWidgetList>) get_registered_widget_list(container_uri, criteria = nil)
Returns the list of widgets, which are registered in the selected territory or uuApp meta model. Returned list does not contain widgets located in the system territory. Returned list does not contain any objects filtered out by executed UESQuery. # See UESQuery Documentation.
176 177 178 179 180 181 182 183 184 185 186 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 176 def (container_uri, criteria=nil) svc = UU::OS::REST::RemoteClient.new(Widget) dto = Widget::WidgetGetWidgetList.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('getRegisteredWidgetList', container_uri) return UU::OS::REST::ResultList.new(Widget::WidgetGetWidgetList, Widget::WidgetGetWidgetListItem, res) end end |
- (UU::OS::REST::ResultList<Widget::WidgetGetWidgetListItem, Widget::WidgetGetWidgetList>) get_widget_list(entity_uri, criteria = nil)
Returns the list of widgets whose instances can be inserted into the content of selected sheet or into the content of a sheet on a given Artifact. Returned list does not contain any objects filtered out by executed UESQuery. See UESQuery Documentation.
152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 152 def (entity_uri, criteria=nil) svc = UU::OS::REST::RemoteClient.new(Widget) dto = Widget::WidgetGetWidgetList.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('getWidgetList', entity_uri) return UU::OS::REST::ResultList.new(Widget::WidgetGetWidgetList, Widget::WidgetGetWidgetListItem, res) end end |
- (UU::OS::UESURI) set_attributes(widget_uri, widget = nil)
Sets attributes of widget. Command cannot modify references to objects like location, competent role and so on. Changing the code of the widget will cause malfunction of widget instances. #
131 132 133 134 135 136 137 138 139 |
# File 'uu_os-0.29.16/lib/uu/os/widget.rb', line 131 def set_attributes(, = nil) svc = UU::OS::REST::RemoteClient.new(Widget) payload = UU::OS::Widget::WidgetSetAttributes.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', , payload) return UU::OS::UESURI.new(res) end end |