Module: UU::OS::MetaArtifact
- Extended by:
- MetaArtifact
- Included in:
- MetaArtifact
- Defined in:
- uu_os-0.29.16/lib/uu/os/meta_artifact.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_copy.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_export.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_create.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_get_export_data.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_presentation_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_set_presentation_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_default_presentation_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_artifact/meta_artifact_set_default_presentation_attributes.rb
Overview
Module Meta Artifact.
Defined Under Namespace
Classes: MetaArtifactAttributes, MetaArtifactCopy, MetaArtifactCreate, MetaArtifactDefaultPresentationAttributes, MetaArtifactExport, MetaArtifactGetExportData, MetaArtifactPresentationAttributes, MetaArtifactSetAttributes, MetaArtifactSetDefaultPresentationAttributes, MetaArtifactSetPresentationAttributes
Constant Summary
- PATH =
Service path
'ues/core/artifact/UESMetaArtifact'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) copy(source_meta_artifact_uri, meta_artifact = nil)
Copy a meta artifact.
-
- (UU::OS::UESURI) create(location_uri, meta_artifact = nil)
deprecated
Deprecated.
The uuCommand MetaArtifact.create is used for creating meta artifact from the XML file temporarily. This feature will be removed in a future version and replaced by the specific uuCommands for creating template objects.
-
- (UU::OS::UESURI) export(meta_artifact_uri)
The uuCommand exports a meta artifact to the XML file, which is saved to the export storage.
-
- (UU::OS::MetaArtifact::MetaArtifactAttributes) get_attributes(meta_artifact_uri)
This command returns attributes representing the meta artifact specified by the metaArtifactUri parameter.
-
- (UU::OS::MetaArtifact::MetaArtifactDefaultPresentationAttributes) get_default_presentation_attributes(meta_artifact_uri)
Retrieves an artifact presentation template.
-
- (UU::OS::REST::BinaryValue) get_export_data(meta_artifact_uri, meta_artifact = nil)
The uuCommand returns a XML file generated by the export command.
-
- (UU::OS::MetaArtifact::MetaArtifactPresentationAttributes) get_presentation_attributes(meta_artifact_uri)
This command gets an meta artifact presentation settings.
-
- (UU::OS::UESURI) set_attributes(meta_artifact_uri, meta_artifact = nil)
Command for setting attributes of a meta artifact.
-
- (UU::OS::UESURI) set_default_presentation_attributes(meta_artifact_uri, presentation_attributes = nil)
Configures an artifact presentation template.
-
- (UU::OS::UESURI) set_presentation_attributes(meta_artifact_uri, presentation_attributes = nil)
Configures meta artifact presentation settings.
Instance Method Details
- (UU::OS::UESURI) copy(source_meta_artifact_uri, meta_artifact = nil)
Copy a meta artifact. The command creates a new meta artifact according to specified source meta artifact in a specified location in the same territory as source meta artifact. At the very least location and name must be specified in MetaArtifactCopy DTO. Only basic meta artifact types can be copied by this command (no meta role, meta group, etc.). Competent role for the new meta artifact copy will be selected as the most suitable according to specified container and meta artifact (executive/authorized role with connected interface), or can be also specified in MetaArtifactCopy DTO.
135 136 137 138 139 140 141 142 143 144 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 135 def copy(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaArtifact) svc.timeout = 120 # may take longer than default 60 seconds payload = UU::OS::MetaArtifact::MetaArtifactCopy.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('copy', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) create(location_uri, meta_artifact = nil)
The uuCommand MetaArtifact.create is used for creating meta artifact from the XML file temporarily. This feature will be removed in a future version and replaced by the specific uuCommands for creating template objects.
Creates a meta artifact from an exported XML file in the specified location. Source meta artifact must be derived (at least indirectly) from a meta artifact which is a part of UU.OS uuApp. Creation of meta artifact is divided into synchronous and asynchronous part. During the synchronous part, the meta artifact is created. During the asynchronous part, the template objects are created. If the asynchronous process fails and the Problem state is set on meta artifact, it is possible to solve the problem (e.g. add reference_map) and run the command again.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 215 def create(location_uri, = nil) svc = UU::OS::REST::RemoteClient.new(MetaArtifact) dto = UU::OS::MetaArtifact::MetaArtifactCreate.new() payload = dto.to_hash payload.delete(:data) tmpfile = Tempfile.new("MetaArtifactCreate") begin if (!dto.data.data.respond_to?(:read)) tmpfile.write(dto.data.data) payload[:data] = tmpfile elsif (dto.data.data.respond_to?(:read) && !dto.data.data.respond_to?(:path)) tmpfile.binmode dto.data.data.rewind tmpfile.write(dto.data.data.read) payload[:data] = tmpfile else payload[:data] = dto.data.to_hash(false) end tmpfile.flush tmpfile.rewind UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, payload) return UU::OS::UESURI.new(res) end ensure tmpfile.close tmpfile.unlink end end |
- (UU::OS::UESURI) export(meta_artifact_uri)
The uuCommand exports a meta artifact 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
Process and in Future.
To
get exported data from the storage use get_export_data.
163 164 165 166 167 168 169 170 171 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 163 def export() svc = UU::OS::REST::RemoteClient.new(MetaArtifact) payload = UU::OS::MetaArtifact::MetaArtifactExport.new(nil).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('export', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::MetaArtifact::MetaArtifactAttributes) get_attributes(meta_artifact_uri)
This command returns attributes representing the meta artifact specified by the metaArtifactUri parameter. Only basic meta artifact types attributes can be returned by this command (no meta role, meta group, etc.). The command does not change the state of the meta artifact in the system.
39 40 41 42 43 44 45 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 39 def get_attributes() svc = UU::OS::REST::RemoteClient.new(MetaArtifact) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', ) return MetaArtifact::MetaArtifactAttributes.new(res) end end |
- (UU::OS::MetaArtifact::MetaArtifactDefaultPresentationAttributes) get_default_presentation_attributes(meta_artifact_uri)
Retrieves an artifact presentation template. Artifact presentation template consist of width, header visibility, toolbar visibility, and artifact display mode. All of these attributes control default presentation of an artifact created with this meta artifact. When viewing an artifact, presentation settings are looked up in the following order: User settings, artifact presentation settings, meta artifact template presentation settings, and layout artifact, if it is configured, or default system settings otherwise. Attribute lockSettings on the DTO can make user settings and artifact presentation settings to be ignored.
328 329 330 331 332 333 334 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 328 def get_default_presentation_attributes() svc = UU::OS::REST::RemoteClient.new(MetaArtifact) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getDefaultPresentationAttributes', ) return MetaArtifact::MetaArtifactDefaultPresentationAttributes.new(res) end end |
- (UU::OS::REST::BinaryValue) get_export_data(meta_artifact_uri, meta_artifact = nil)
The uuCommand returns a XML file generated by the export command.
263 264 265 266 267 268 269 270 271 272 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 263 def get_export_data(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaArtifact) dto = UU::OS::MetaArtifact::MetaArtifactGetExportData.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::MetaArtifact::MetaArtifactPresentationAttributes) get_presentation_attributes(meta_artifact_uri)
This command gets an meta artifact presentation settings. Meta artifact presentation settings consists of width, layout artifact UESURI, header visibility, toolbar visibility or artifact display mode. All of this attributes control presentation of meta artifact. For default setting of this attributes will be meta artifact presentation resolved by algorithm looking for setting on user setting than on artifact presentation setting than on meta artifact template presentation setting then on layout artifact if is configured end if not is used system default setting.
387 388 389 390 391 392 393 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 387 def get_presentation_attributes() svc = UU::OS::REST::RemoteClient.new(MetaArtifact) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getPresentationAttributes', ) return MetaArtifact::MetaArtifactPresentationAttributes.new(res) end end |
- (UU::OS::UESURI) set_attributes(meta_artifact_uri, meta_artifact = nil)
Command for setting attributes of a meta artifact. The command can't modify references to objects like location, competent role and so on.
77 78 79 80 81 82 83 84 85 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 77 def set_attributes(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaArtifact) payload = UU::OS::MetaArtifact::MetaArtifactSetAttributes.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) set_default_presentation_attributes(meta_artifact_uri, presentation_attributes = nil)
Configures an artifact presentation template. Artifact presentation template consist of width, header visibility, toolbar visibility, and artifact display mode. All of these attributes control default presentation of an artifact created with this meta artifact. When viewing an artifact, presentation settings are looked up in the following order: User settings, artifact presentation settings, meta artifact template presentation settings, and layout artifact, if it is configured, or default system settings otherwise. Attribute lockSettings on the DTO can make user settings and artifact presentation settings to be ignored.
305 306 307 308 309 310 311 312 313 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 305 def set_default_presentation_attributes(, presentation_attributes = nil) svc = UU::OS::REST::RemoteClient.new(MetaArtifact) payload = UU::OS::MetaArtifact::MetaArtifactSetDefaultPresentationAttributes.new(presentation_attributes).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setDefaultPresentationAttributes', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) set_presentation_attributes(meta_artifact_uri, presentation_attributes = nil)
Configures meta artifact presentation settings. Meta artifact presentation settings consist of width, layout artifact UESURI, header visibility, toolbar visibility, and artifact display mode. All of these attributes control presentation of the meta artifact. When viewing a meta artifact, presentation settings are looked up in the following order: User settings, meta artifact presentation settings, meta artifact template presentation settings, and layout artifact, if it is configured, or default system settings otherwise.
365 366 367 368 369 370 371 372 373 |
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 365 def set_presentation_attributes(, presentation_attributes = nil) svc = UU::OS::REST::RemoteClient.new(MetaArtifact) payload = UU::OS::MetaArtifact::MetaArtifactSetPresentationAttributes.new(presentation_attributes).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setPresentationAttributes', , payload) return UU::OS::UESURI.new(res) end end |