Module: UU::OS::Artifact
- Extended by:
- Artifact
- Included in:
- Artifact
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/artifact.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_type.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_move.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/security_level.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_create.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_export.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_layout.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/export_mime_type.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_set_state.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_width_type.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_state_type.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_visual_style.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_get_export_data.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_reference_entry.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_get_reference_list.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_set_competent_role.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_header_display_mode.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_comments_display_mode.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_set_visual_presentation.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_presentation_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_control_bar_display_mode.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_context_menu_display_mode.rb,
uu_os_client-0.10.6/lib/uu/os/artifact/artifact_set_presentation_attributes.rb
Overview
Module Artifact.
Defined Under Namespace
Classes: ArtifactAttributes, ArtifactCommentsDisplayMode, ArtifactContextMenuDisplayMode, ArtifactControlBarDisplayMode, ArtifactCreate, ArtifactExport, ArtifactGetExportData, ArtifactGetReferenceList, ArtifactHeaderDisplayMode, ArtifactLayout, ArtifactMove, ArtifactPresentationAttributes, ArtifactSetAttributes, ArtifactSetCompetentRole, ArtifactSetPresentationAttributes, ArtifactSetState, ArtifactSetVisualPresentation, ArtifactStateType, ArtifactType, ArtifactVisualStyle, ArtifactWidthType, ExportMimeType, ReferenceEntry, 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)
This command 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)
This command gets the attributes of the artifact specified by artifact URI and returns its detail.
-
- (UU::OS::UESURI) get_export_data(artifact_uri, artifact = nil)
Returns a XML file generated by the export command Artifact#export.
-
- (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)
This command 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)
This command 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)
This command 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)
This command 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 |
# File 'uu_os_client-0.10.6/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) return UU::OS::UESURI.new(res) end end |
- (Object) delete(artifact_uri)
This command 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
117 118 119 120 121 122 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 117 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.
267 268 269 270 271 272 273 274 275 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 267 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)
This command gets the attributes of the artifact specified by artifact URI and returns its detail.
72 73 74 75 76 77 78 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 72 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::UESURI) get_export_data(artifact_uri, artifact = nil)
Returns a XML file generated by the export command Artifact#export.
294 295 296 297 298 299 300 301 302 303 304 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 294 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 res = svc.get('getExportData', artifact_uri) return UU::OS::REST::BinaryValue.new(res, true) 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 context menu visibility. 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.
#
246 247 248 249 250 251 252 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 246 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)
This command 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 artefact, 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.
name, code, entityTypeUri, type : UESReferenceType UESReferenceType, direction : UESReferenceDirection UESReferenceDirection and count. TODO reference enums
181 182 183 184 185 186 187 188 189 190 191 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 181 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)
This command 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.
101 102 103 104 105 106 107 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 101 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.
87 88 89 90 91 92 93 94 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 87 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)
This command sets a new competent role for an artifact (asynchronously).
128 129 130 131 132 133 134 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 128 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 context menu visibility. 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.
225 226 227 228 229 230 231 232 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 225 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)
This command 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 two ways to specify this activity:
-
The easiest way is to specify the required artifact state from the enumeration
ArtifactStateType. In this scenario appropriate activity template is found (an activity transforming the artifact to the required state) and it is used the same way as in the second scenario. If there is no such activity template the command fails. If there are more than one then the first one is used (activity templates are ordered by name and code for this purpose).
-
The ues uri of the activity template can be 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).
157 158 159 160 161 162 163 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 157 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)
This command 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.
201 202 203 204 205 206 207 |
# File 'uu_os_client-0.10.6/lib/uu/os/artifact.rb', line 201 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 |