Module: UU::OS::Sheet
- Extended by:
- Sheet
- Included in:
- Sheet
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/sheet/sheet_delete_version.rb,
uu_os_client-0.10.6/lib/uu/os/sheet.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/mime_type.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_create.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_check_in.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_check_out.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_width_type.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_get_sheet_data.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_get_sheet_list.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_get_version_list.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_delete_component.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_replace_component.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_get_component_data.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_version_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_get_component_content.rb,
uu_os_client-0.10.6/lib/uu/os/sheet/sheet_get_version_attributes.rb
Overview
Module Sheet.
Defined Under Namespace
Classes: MimeType, SheetAttributes, SheetCheckIn, SheetCheckOut, SheetCreate, SheetDeleteComponent, SheetDeleteVersion, SheetGetComponentContent, SheetGetComponentData, SheetGetSheetData, SheetGetSheetList, SheetGetVersionAttributes, SheetGetVersionList, SheetReplaceComponent, SheetSetAttributes, SheetVersionAttributes, SheetWidthType
Constant Summary
- PATH =
Service path
'ues/core/content/UESSheet'
Instance Method Summary (collapse)
-
- (Object) check_in(sheet_uri, sheet = nil)
This command changes the content of the public sheet version and unlocks it by default.
-
- (UU::OS::REST::BinaryValue) check_out(sheet_uri, sheet = nil)
This command locks the sheet for further modification, locks the given sheet of artifact.
-
- (UU::OS::UESURI) create(artifact_uri, sheet = nil)
Command creates a new sheet in the specified artifact.
-
- (Object) delete(sheet_uri)
Deletes the sheet from the system.
-
- (Object) delete_component(sheet_uri, sheet = nil)
Deletes specified component from the sheet.
-
- (Object) delete_version(sheet_uri, version = nil)
Deletes the version from the system.
-
- (SheetAttributes) get_attributes(sheet_uri)
Returns attributes representing the sheet specified by the sheetUri attribute.
-
- (UU::OS::REST::BinaryValue) get_component_data(sheet_uri, sheet = nil)
Returns the content of specified sheet component in the BB code format.
-
- (UU::OS::REST::BinaryValue) get_sheet_data(sheet_uri, sheet = nil)
Returns content from sheet specified by sheetUri.
-
- (Object) get_sheet_list(artifact_uri, criteria = nil)
This command returns a list of sheets on the specified artifact.
-
- (SheetVersionAttributes) get_version_attributes(sheet_uri, version = nil)
The uuCommand returns attributes of given sheet version.
-
- (Array) get_version_list(sheet_uri, criteria = nil)
The uuCommand returns a list of sheet versions of the specified sheet.
-
- (Object) publish(sheet_uri)
Publishes private version and opens the lock sheet.
-
- (Array) replace_component(sheet_uri, sheet = nil)
The uuCommand replaces specified component with given content.
-
- (UU::OS::UESURI) set_attributes(sheet_uri, sheet = nil)
This command updates basic attributes of an sheet.
-
- (Object) unlock(sheet_uri)
Unlocks the specified sheet.
Instance Method Details
- (Object) check_in(sheet_uri, sheet = nil)
This command changes the content of the public sheet version and unlocks it by default. Sheet content is in UXML or UDF format, data are streamed.Sheet must be unlocked or the user must be the lock owner.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 101 def check_in(sheet_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) payload = UU::OS::Sheet::SheetCheckIn.new(sheet).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_uri, payload) end end |
- (UU::OS::REST::BinaryValue) check_out(sheet_uri, sheet = nil)
This command locks the sheet for further modification, locks the given sheet of artifact. When lock succeed or sheet is currently locked by the user,sheet data can be returned. Sheet lock failure throws UESSheetRTException.
81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 81 def check_out(sheet_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) payload = UU::OS::Sheet::SheetCheckOut.new(sheet).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('checkOut', sheet_uri, payload) if res return UU::OS::REST::BinaryValue.new(res,true) else return nil end end end |
- (UU::OS::UESURI) create(artifact_uri, sheet = nil)
Command creates a new sheet in the specified artifact. Initial sheet content could be specified. Content is streamed.
155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 155 def create(artifact_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) payload = UU::OS::Sheet::SheetCreate.new(sheet) 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', artifact_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) delete(sheet_uri)
Deletes the sheet from the system.
261 262 263 264 265 266 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 261 def delete(sheet_uri) svc = UU::OS::REST::RemoteClient.new(Sheet) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', sheet_uri) end end |
- (Object) delete_component(sheet_uri, sheet = nil)
Deletes specified component from the sheet.
272 273 274 275 276 277 278 279 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 272 def delete_component(sheet_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) payload = UU::OS::Sheet::SheetDeleteComponent.new(sheet).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('deleteComponent', sheet_uri, payload) end end |
- (Object) delete_version(sheet_uri, version = nil)
Deletes the version from the system.
352 353 354 355 356 357 358 359 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 352 def delete_version(sheet_uri, version = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) payload = UU::OS::Sheet::SheetDeleteVersion.new(version).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('deleteVersion', sheet_uri, payload) end end |
- (SheetAttributes) get_attributes(sheet_uri)
Returns attributes representing the sheet specified by the
sheetUri
attribute.
35 36 37 38 39 40 41 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 35 def get_attributes(sheet_uri) svc = UU::OS::REST::RemoteClient.new(Sheet) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', sheet_uri) return Sheet::SheetAttributes.new(res) end end |
- (UU::OS::REST::BinaryValue) get_component_data(sheet_uri, sheet = nil)
Returns the content of specified sheet component in the BB code format. The result is streamed.
192 193 194 195 196 197 198 199 200 201 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 192 def get_component_data(sheet_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) dto = UU::OS::Sheet::SheetGetComponentData.new(sheet) svc.add_parameter("componentId", dto.component_id) svc.add_parameter("requestedMimeType", dto.requested_mime_type) UU::OS::QoS::QoSHandler.auto_retry do return UU::OS::REST::BinaryValue.new(svc.get('getComponentData', sheet_uri),true) end end |
- (UU::OS::REST::BinaryValue) get_sheet_data(sheet_uri, sheet = nil)
Returns content from sheet specified by sheetUri
. Data are
streamed. On the input can be selected output data stream format(UXML file,
UDF archive).
133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 133 def get_sheet_data(sheet_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) dto = UU::OS::Sheet::SheetGetSheetData.new(sheet) svc.add_parameter('requestedMimeType', dto.requested_mime_type) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getSheetData', sheet_uri) if res return UU::OS::REST::BinaryValue.new(res,true) else return nil end end end |
- (Object) get_sheet_list(artifact_uri, criteria = nil)
This command returns a list of sheets on the specified artifact. Command does not return all sheets, only a sublist. The list of returned sheets couldbe filtered by the name, code, main, order of a sheet and state of the lock. The list is sorted by the name (and codes in case are equal) of asheet by default, or it can be sorted arbitrarily by any of sheet attributes usable for the filtering or these attributes combinations.
for selecting sheets. Available parameters are: name, code, order, main, locked, lockTime, visible and width : SheetWidthType.
61 62 63 64 65 66 67 68 69 70 71 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 61 def get_sheet_list(artifact_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) dto = Sheet::SheetGetSheetList.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('getSheetList', artifact_uri) return UU::OS::REST::ResultList.new(Sheet::SheetGetSheetList, Sheet::SheetAttributes, res) end end |
- (SheetVersionAttributes) get_version_attributes(sheet_uri, version = nil)
The uuCommand returns attributes of given sheet version.
308 309 310 311 312 313 314 315 316 317 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 308 def get_version_attributes(sheet_uri, version = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) dto = UU::OS::Sheet::SheetGetVersionAttributes.new(version) svc.add_parameter('versionID', dto.version_id) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getVersionAttributes', sheet_uri) return Sheet::SheetVersionAttributes.new(res) end end |
- (Array) get_version_list(sheet_uri, criteria = nil)
The uuCommand returns a list of sheet versions of the specified sheet.
330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 330 def get_version_list(sheet_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) dto = Sheet::SheetGetVersionList.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('getVersionList', sheet_uri) return UU::OS::REST::ResultList.new(Sheet::SheetGetVersionList, Sheet::SheetVersionAttributes, res) end end |
- (Object) publish(sheet_uri)
Publishes private version and opens the lock sheet. All changes made in private version are published.
241 242 243 244 245 246 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 241 def publish(sheet_uri) svc = UU::OS::REST::RemoteClient.new(Sheet) UU::OS::QoS::QoSHandler.auto_retry do svc.post('publish', sheet_uri) end end |
- (Array) replace_component(sheet_uri, sheet = nil)
The uuCommand replaces specified component with given content.
227 228 229 230 231 232 233 234 235 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 227 def replace_component(sheet_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) payload = UU::OS::Sheet::SheetReplaceComponent.new(sheet).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('replaceComponent',sheet_uri, payload) return JSON.parse(res).values[0] end end |
- (UU::OS::UESURI) set_attributes(sheet_uri, sheet = nil)
This command updates basic attributes of an sheet.
287 288 289 290 291 292 293 294 295 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 287 def set_attributes(sheet_uri, sheet = nil) svc = UU::OS::REST::RemoteClient.new(Sheet) payload = UU::OS::Sheet::SheetSetAttributes.new(sheet).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', sheet_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) unlock(sheet_uri)
Unlocks the specified sheet. Allows to unlock the sheet locked by another user
251 252 253 254 255 256 |
# File 'uu_os_client-0.10.6/lib/uu/os/sheet.rb', line 251 def unlock(sheet_uri) svc = UU::OS::REST::RemoteClient.new(Sheet) UU::OS::QoS::QoSHandler.auto_retry do svc.post('unlock', sheet_uri) end end |