Module: UU::OS::Artifact
- Extended by:
- Artifact
- Included in:
- Artifact
- Defined in:
- uu_os-0.29.16/lib/uu/os/artifact.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_type.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_move.rb,
uu_os-0.29.16/lib/uu/os/artifact/reference_type.rb,
uu_os-0.29.16/lib/uu/os/artifact/security_level.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_create.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_export.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_layout.rb,
uu_os-0.29.16/lib/uu/os/artifact/export_mime_type.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_set_state.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_width_type.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_attributes.rb,
uu_os-0.29.16/lib/uu/os/artifact/reference_direction.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_state_type.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_visual_style.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_display_mode.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_get_export_data.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_reference_entry.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_get_reference_list.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_set_competent_role.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_header_display_mode.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_comments_display_mode.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_set_visual_presentation.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_presentation_attributes.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_control_bar_display_mode.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_context_menu_display_mode.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_set_presentation_attributes.rb,
uu_os-0.29.16/lib/uu/os/artifact/artifact_navigation_area_display_mode.rb
Overview
Module Artifact.
Defined Under Namespace
Classes: ArtifactAttributes, ArtifactCommentsDisplayMode, ArtifactContextMenuDisplayMode, ArtifactControlBarDisplayMode, ArtifactCreate, ArtifactDisplayMode, ArtifactExport, ArtifactGetExportData, ArtifactGetReferenceList, ArtifactHeaderDisplayMode, ArtifactLayout, ArtifactMove, ArtifactNavigationAreaDisplayMode, ArtifactPresentationAttributes, ArtifactSetAttributes, ArtifactSetCompetentRole, ArtifactSetPresentationAttributes, ArtifactSetState, ArtifactSetVisualPresentation, ArtifactStateType, ArtifactType, ArtifactVisualStyle, ArtifactWidthType, ExportMimeType, ReferenceDirection, ReferenceEntry, ReferenceType, SecurityLevel
Constant Summary
- PATH =
Service path
'ues/core/artifact/UESArtifact'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, artifact = nil)
Creates an artifact of class Artifact.
-
- (Object) delete(artifact_uri)
Deletes the specified artifact from the system.
-
- (UU::OS::UESURI) export(artifact_uri)
Exports an artifact to the XML file, which is saved to the export storage.
-
- (ArtifactAttributes) get_attributes(artifact_uri)
Gets the attributes of the artifact specified by artifact URI and returns its detail.
-
- (UU::OS::REST::BinaryValue) get_export_data(artifact_uri, artifact = nil)
Returns a XML file generated by the export command.
-
- (ArtifactPresentationAttributes) get_presentation_attributes(artifact_uri)
Retrieves presentation settings of an artifact.
-
- (UU::OS::REST::ResultList<Artifact::ArtifactGetReferenceList, Artifact::ReferenceEntry>) get_reference_list(artifact_uri, criteria = nil)
Returns a list of all references from the specified artifact and / or all references to the specified artifact.
-
- (Object) move(artifact_uri, new_location = nil)
Moves an artifact to the new location (folder, organizational unit, meta mode dictionary) in the same territory.
-
- (UU::OS::UESURI) set_attributes(artifact_uri, artifact = nil)
Command for setting attributes of artifact.
-
- (Object) set_competent_role(artifact_uri, new_competency = nil)
Sets a new competent role for an artifact (asynchronously).
-
- (UU::OS::UESURI) set_presentation_attributes(artifact_uri, presentation_attributes = nil)
Configures presentation settings of an artifact.
-
- (Object) set_state(artifact_uri, state = nil)
Sets a new state of the specified artifact.
- - (Object) set_visual_presentation(artifact_uri, presentation = nil) deprecated Deprecated.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, artifact = nil)
Creates an artifact of class Artifact. Command creates new artifact in specified location. Meta artifact can be specified in ArtifactCreate Object, otherwise is used default meta artifact for territory. Competent role for artifact will be selected as the most suitable according to specified location and meta artifact (executive/authorized role with connected interface), or can be also specified in ArtifactCreate Object.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 58 def create(location_uri, artifact = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = Artifact::ArtifactCreate.new(artifact).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, payload) # res is nil if dry_run was set to true. In that case, return nil (do nothing) if !(res.nil? || res.empty?) return UU::OS::UESURI.new(res) end end end |
- (Object) delete(artifact_uri)
Deletes the specified artifact from the system. The artifact is deleted even if it contains a locked sheet or attachment. The artifact cannot be deleted when:
- the artifact's workflow is not created
- a property contains a reference to this artifact
- a time sheet exists with a reference to this artifact
147 148 149 150 151 152 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 147 def delete(artifact_uri) svc = UU::OS::REST::RemoteClient.new(Artifact) UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('delete', artifact_uri) end end |
- (UU::OS::UESURI) export(artifact_uri)
Exports an 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 Env::Process and in
REST::Future.
327 328 329 330 331 332 333 334 335 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 327 def export(artifact_uri) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = UU::OS::Artifact::ArtifactExport.new(nil).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('export', artifact_uri, payload) return UU::OS::UESURI.new(res) end end |
- (ArtifactAttributes) get_attributes(artifact_uri)
Gets the attributes of the artifact specified by artifact URI and returns its detail.
79 80 81 82 83 84 85 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 79 def get_attributes(artifact_uri) svc = UU::OS::REST::RemoteClient.new(Artifact) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', artifact_uri) return Artifact::ArtifactAttributes.new(res) end end |
- (UU::OS::REST::BinaryValue) get_export_data(artifact_uri, artifact = nil)
Returns a XML file generated by the export command.
354 355 356 357 358 359 360 361 362 363 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 354 def get_export_data(artifact_uri, artifact = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) dto = UU::OS::Artifact::ArtifactGetExportData.new(artifact) 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', artifact_uri) end end |
- (ArtifactPresentationAttributes) get_presentation_attributes(artifact_uri)
Retrieves presentation settings of an artifact. 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 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.
#
306 307 308 309 310 311 312 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 306 def get_presentation_attributes(artifact_uri) svc = UU::OS::REST::RemoteClient.new(Artifact) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getPresentationAttributes', artifact_uri) return Artifact::ArtifactPresentationAttributes.new(res) end end |
- (UU::OS::REST::ResultList<Artifact::ArtifactGetReferenceList, Artifact::ReferenceEntry>) get_reference_list(artifact_uri, criteria = nil)
Returns a list of all references from the specified artifact and / or all references to the specified artifact. The command does not return all references, only a sublist. The list of returned references can be filtered by the name and code of the artifact, by the meta artifact uri of the artifact, by the type of the reference, direction and the reference count. The list is sorted by the name, code and type by default, or it can be sorted arbitrarily by any of reference attributes usable for the filtering or these attributes combinations.
232 233 234 235 236 237 238 239 240 241 242 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 232 def get_reference_list(artifact_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) dto = UU::OS::Artifact::ArtifactGetReferenceList.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('getReferenceList', artifact_uri) return UU::OS::REST::ResultList.new(Artifact::ArtifactGetReferenceList, Artifact::ReferenceEntry, res) end end |
- (Object) move(artifact_uri, new_location = nil)
Moves an artifact to the new location (folder, organizational unit, meta mode dictionary) in the same territory. It optionally leaves a shortcut at the original location.
127 128 129 130 131 132 133 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 127 def move(artifact_uri, new_location = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = UU::OS::Artifact::ArtifactMove.new(new_location).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('move', artifact_uri, payload) end end |
- (UU::OS::UESURI) set_attributes(artifact_uri, artifact = nil)
Command for setting attributes of artifact. Command can't modify references to object like storage, competent role and so on.
107 108 109 110 111 112 113 114 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 107 def set_attributes(artifact_uri, artifact = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = UU::OS::Artifact::ArtifactSetAttributes.new(artifact).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', artifact_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) set_competent_role(artifact_uri, new_competency = nil)
Sets a new competent role for an artifact (asynchronously).
163 164 165 166 167 168 169 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 163 def set_competent_role(artifact_uri, new_competency = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = UU::OS::Artifact::ArtifactSetCompetentRole.new(new_competency).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setCompetentRole', artifact_uri, payload) end end |
- (UU::OS::UESURI) set_presentation_attributes(artifact_uri, presentation_attributes = nil)
Configures presentation settings of an artifact. 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 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.
286 287 288 289 290 291 292 293 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 286 def set_presentation_attributes(artifact_uri, presentation_attributes = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = UU::OS::Artifact::ArtifactSetPresentationAttributes.new(presentation_attributes).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setPresentationAttributes', artifact_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) set_state(artifact_uri, state = nil)
Sets a new state of the specified artifact. The current state of an artifact can be retrieved by get_attributes command. Transition to the new state is driven by an activity on the artifact workflow. The activity itself sets the artifact state. There are three ways to specify this activity:
-
The easiest way is to specify the required artifact state from the enumeration
ArtifactStateType. In this scenario, an appropriate activity template is found (an activity transforming the artifact to the required state) and it is used the same way as in the third scenario. If there is no such an activity template, the command fails. If there are a few such activities, then the first one is used (activity templates are ordered by name and code for this purpose).
-
By the same pattern, it is possible to specify UESURI of the artifact state template we want
to set. The advantage compared to the first scenario is that we can also set some specific custom states that are not included in the enumeration UESArtifactStateType without knowing the activity template that sets it.
-
The UESURI of the activity template can be also specified directly. This activity has to
contain an action to change the artifact state on its exit activity state. The activity is created and it changes the artifact state. If the activity contains an action with an attached script then the script is run first asynchronously and the artifact state is set after the script finishes successfully (therefore the artifact state can be actually set later, e.g. two minutes after set_state command finishes).
205 206 207 208 209 210 211 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 205 def set_state(artifact_uri, state = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = UU::OS::Artifact::ArtifactSetState.new(state).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setState', artifact_uri, payload) end end |
- (Object) set_visual_presentation(artifact_uri, presentation = nil)
Sets an artifact presentation settings. The current presentation settings of an artifact can be retrieved by getAttributes command. Artifact presentation settings consists of width. Changing the width of the artifact changes the width of the content part of the artifact. Artifact width is used as default width for all artifact sheets and in visual use cases over artifact and its aggregated objects.
254 255 256 257 258 259 260 |
# File 'uu_os-0.29.16/lib/uu/os/artifact.rb', line 254 def set_visual_presentation(artifact_uri, presentation = nil) svc = UU::OS::REST::RemoteClient.new(Artifact) payload = UU::OS::Artifact::ArtifactSetVisualPresentation.new(presentation).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setVisualPresentation', artifact_uri, payload) end end |