Module: UU::OS::SheetTemplate
- Extended by:
- SheetTemplate
- Included in:
- SheetTemplate
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/sheet_template.rb,
uu_os_client-0.10.6/lib/uu/os/sheet_template/sheet_template_create.rb,
uu_os_client-0.10.6/lib/uu/os/sheet_template/sheet_template_check_in.rb,
uu_os_client-0.10.6/lib/uu/os/sheet_template/sheet_template_get_data.rb,
uu_os_client-0.10.6/lib/uu/os/sheet_template/sheet_template_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/sheet_template/sheet_template_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/sheet_template/sheet_template_get_sheet_template_list.rb
Defined Under Namespace
Classes: SheetTemplateAttributes, SheetTemplateCheckIn, SheetTemplateCreate, SheetTemplateGetData, SheetTemplateGetSheetTemplateList, SheetTemplateSetAttributes
Constant Summary
- PATH =
Service path
'ues/core/content/UESSheetTemplate'
Instance Method Summary (collapse)
-
- (Object) check_in(sheet_template_uri, sheet_template = nil)
Replaces the content of the specified sheet template and unlock it by default.
-
- (UU::OS::UESURI) create(meta_artifact_uri, sheet_template = nil)
Creates a new sheet template on the specified Meta Artifact.
-
- (Object) delete(sheet_template_uri)
Deletes the sheet template from the system.
-
- (SheetTemplateAttributes) get_attributes(sheet_template_uri)
Returns attributes representing specified sheet template.
-
- (UU::OS::REST::BinaryValue) get_data(sheet_template_uri, sheet_template = nil)
Returns the content of the sheet template.
-
- (Array) get_sheet_template_list(meta_artifact_uri, criteria = nil)
Returns a list of sheet templates on the specified Meta Artifact.
-
- (UU::OS::UESURI) set_attributes(sheet_template_uri, sheet_template = nil)
Updates basic attributes of the sheet template.
Instance Method Details
- (Object) check_in(sheet_template_uri, sheet_template = nil)
Replaces the content of the specified sheet template and unlock it by default. Sheet template content must be in UXML or UDF format. Sheet template must be locked by the current user or must be unlocked.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet_template.rb', line 56 def check_in(sheet_template_uri, sheet_template = nil) svc = UU::OS::REST::RemoteClient.new(SheetTemplate) payload = UU::OS::SheetTemplate::SheetTemplateCheckIn.new(sheet_template).to_hash stream_value = false if payload[:content].kind_of?File # If data is File, send request as multipart stream stream_value = true else if payload[:content].kind_of?StringIO payload[:content] = UU::OS::REST::BinaryValue.new(payload[:content]) end # Any other data will be serialized to JSON and sent as normal request payload = payload.to_json end UU::OS::QoS::QoSHandler.auto_retry do if stream_value # Reset stream before each call in order to send all data payload[:content].rewind end svc.post('checkIn', sheet_template_uri, payload) end end |
- (UU::OS::UESURI) create(meta_artifact_uri, sheet_template = nil)
Creates a new sheet template on the specified Meta Artifact. Initial sheet template content can be specified.
168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet_template.rb', line 168 def create(, sheet_template = nil) svc = UU::OS::REST::RemoteClient.new(SheetTemplate) payload = UU::OS::SheetTemplate::SheetTemplateCreate.new(sheet_template) if payload.content.kind_of?StringIO payload.content = UU::OS::REST::BinaryValue.new(payload.content) end payload = payload.to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', , payload) return UU::OS::UESURI.new(res) end end |
- (Object) delete(sheet_template_uri)
Deletes the sheet template from the system.
188 189 190 191 192 193 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet_template.rb', line 188 def delete(sheet_template_uri) svc = UU::OS::REST::RemoteClient.new(SheetTemplate) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', sheet_template_uri) end end |
- (SheetTemplateAttributes) get_attributes(sheet_template_uri)
Returns attributes representing specified sheet template.
29 30 31 32 33 34 35 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet_template.rb', line 29 def get_attributes(sheet_template_uri) svc = UU::OS::REST::RemoteClient.new(SheetTemplate) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', sheet_template_uri) return SheetTemplate::SheetTemplateAttributes.new(res) end end |
- (UU::OS::REST::BinaryValue) get_data(sheet_template_uri, sheet_template = nil)
Returns the content of the sheet template. The content may be returned as structured UXML or full content including images in a compressed UDF format. The type of the returned stream is determined by options (see UU::OS::SheetTemplate::SheetTemplateGetData#requested_mime_type), UXML is returned by default.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet_template.rb', line 93 def get_data(sheet_template_uri, sheet_template = nil) svc = UU::OS::REST::RemoteClient.new(SheetTemplate) dto = UU::OS::SheetTemplate::SheetTemplateGetData.new(sheet_template) svc.add_parameter('requestedMimeType', dto.requested_mime_type) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getData', sheet_template_uri) if res return UU::OS::REST::BinaryValue.new(res,true) else return nil end end end |
- (Array) get_sheet_template_list(meta_artifact_uri, criteria = nil)
Returns a list of sheet templates on the specified Meta Artifact. Command does not return all sheet templates, only a sublist. The list of returned sheet templates could be filtered by the name, code, main, visible, order of a sheet template, state of the lock and width. The list is sorted by the name (and code in case are equal) of a sheet template by default, or it can be sorted arbitrarily by any of sheet template attributes usable for the filtering or these attributes combinations. See the UES query documentation for more information.
It is possible to filter result by: name, code, order, main, locked, lockTime, visible and width : UU::OS::Sheet::SheetWidthType.
127 128 129 130 131 132 133 134 135 136 137 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet_template.rb', line 127 def get_sheet_template_list(, criteria = nil) svc = UU::OS::REST::RemoteClient.new(SheetTemplate) dto = SheetTemplate::SheetTemplateGetSheetTemplateList.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('getSheetTemplateList', ) return UU::OS::REST::ResultList.new(SheetTemplate::SheetTemplateGetSheetTemplateList, SheetTemplate::SheetTemplateAttributes, res) end end |
- (UU::OS::UESURI) set_attributes(sheet_template_uri, sheet_template = nil)
Updates basic attributes of the sheet template.
219 220 221 222 223 224 225 226 227 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet_template.rb', line 219 def set_attributes(sheet_template_uri, sheet_template = nil) svc = UU::OS::REST::RemoteClient.new(SheetTemplate) payload = UU::OS::SheetTemplate::SheetTemplateSetAttributes.new(sheet_template).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', sheet_template_uri, payload) return UU::OS::UESURI.new(res) end end |