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)

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.

Examples:

# Copy meta artifact
UU::OS::MetaArtifact.copy('ues:TERRITORY:SOURCE_METAARTIFACT',
     :location_uri=>'ues:TERRITORY:LOCATION',
     :name=>'Copy name',
     :code=>'COPY_CODE',
     :description=>'Some description string',
     :competent_role_uri=>'ues:TERRITORY:COMPETENT_ROLE',
     :security_level=>UU::OS::Artifact::SecurityLevel::TOP_SECRET,
     :copy_sheets=>false,
     :copy_lifecycle=>false,
     :copy_attachments=>true,
     :copy_sheet_templates=>false,
     :default_name=>'Default name',
     :default_code=>'DEFAULT_CODE',
     :default_security_level=>UU::OS::Artifact::SecurityLevel::CONFIDENTIAL
)

Parameters:

Options Hash (meta_artifact):

  • :location_uri (String, UU::OS::UESURI)

    UESURI of the meta model dictionary where to the meta artifact will be copied. If the rights does not permit to copy a meta artifact from the meta artifact in this location, the copy command fails. The value must not be nil.

  • :name (String)

    Name of the new meta artifact copy. The value must not be blank. The value must not be nil.

  • :code (String)

    Code of the new meta artifact copy. When nil is set, the code is generated automatically using the system sequence. The code must be unique in the given territory, otherwise the create command fails.

  • :description (String)

    Description of the new meta artifact copy. When nil is set, the description is taken from the source meta artifact.

  • :competent_role_uri (String, UU::OS::UESURI)

    UESURI of the competent role. When nil is set, the executive role from authorization is used. If no role is authorized to create the group role into specified container, the create command fails.

  • :security_level (UU::OS::Artifact::SecurityLevel)

    Security level. When nil is set, security level is taken from the source meta artifact security level. If the source meta artifact security level is higher than the user’s security clearance, the copy command fails.

  • :icon_uri (String, UU::OS::UESURI)

    URI of the new meta artifact’s icon. When nil is set, the icon is taken from the source meta artifact. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :copy_sheets (Boolean)

    Specifies whether to copy content from the source meta artifact to the new copy. Default value is false.

  • :copy_lifecycle (Boolean)

    Specifies whether to copy life cycle from the source meta artifact to the new copy. Default value is false.

  • :copy_attachments (Boolean)

    Specifies whether to copy attachments from the source meta artifact to the new copy. Default value is false.

  • :copy_sheet_templates (Boolean)

    Specifies whether to copy sheet templates from the source meta artifact to the new copy. Default value is false.

  • :default_name (String)

    Specifies default name of the created artifact according to new meta artifact copy. When nil is set, the default name is taken from the source meta artifact.

  • :default_code (String)

    Specifies default code of the created artifact according to new meta artifact copy. When nil is set, the default code is taken from the source meta artifact.

  • :default_security_level (UU::OS::Artifact::SecurityLevel)

    Specifies default security level of the created artifact according to new meta artifact copy. When nil is set, the default security level is taken from the source meta artifact.

  • :default_icon_uri (String, UU::OS::UESURI)

    Specifies default icon of the created artifact according to new meta artifact copy. When nil is set, the default icon is taken from the source meta artifact. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the created Meta artifact is component content. Default value is false.

  • :default_component_content (Boolean)

    Defines whether the primarily displayed content of an artifact created according to the new meta artifact copy is component content. When nil is set, the default component content setting is copied from the source meta artifact.

Returns:



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(source_meta_artifact_uri, meta_artifact = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaArtifact)
  svc.timeout = 120 # may take longer than default 60 seconds
  payload = UU::OS::MetaArtifact::MetaArtifactCopy.new(meta_artifact).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('copy', source_meta_artifact_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end

- (UU::OS::UESURI) create(location_uri, meta_artifact = nil)

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.

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.

Examples:

# Get exported data from an existing meta artifact.
exported_data = UU::OS::MetaArtifact.get_export_data('ues:TERRITORY:META_ARTIFACT', :requested_mime_type=>'application/xml')

# Create a new meta artifact according to exported one without creating sheets and attachments specified in the XML. Also set different code and name.
UU::OS::MetaArtifact.create('ues:TERRITORY:APP_PACKAGE', :code => 'NEW_META_ARTIFACT', :name => 'New Meta Artifact', :data => exported_data.data, :import_sheets => false, :import_attachments => false)

# Create a new meta artifact and set new objects to the references.
UU::OS::MetaArtifact.create('ues:TERRITORY:APP_PACKAGE', :data => exported_data.data, :reference_map => '[{"ues:OLD_TERRITORY:OLD_ARTIFACT1":"ues:TERRITORY:ARTIFACT1"},{"ues:OLD_TERRITORY:OLD_ARTIFACT2:OLD_OBJECT":"ues:TERRITORY:ARTIFACT2:OBJECT"}]')

Parameters:

Options Hash (meta_artifact):

  • :data (String, File, UU::OS::REST::BinaryValue)

    XML or zip compressed XML containing informations about meta artifact (e.g. exported with export)

  • :competent_role_uri (String, UU::OS::UESURI)

    UESURI of the role that will be competent for the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :name (String)

    Name of the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :code (String)

    Code of the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :description (String)

    Description of the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :security_level (String)

    Security level of the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used. All possible security levels may be found as constants in Artifact::SecurityLevel class.

  • :icon_uri (String, UU::OS::UESURI)

    UESURI of the new meta artifact icon. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :default_name (String)

    Default name of an artifact that will be created according to the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :default_code (String)

    Default code of an artifact that will be created according to the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :default_icon_uri (String, UU::OS::UESURI)

    UESURI of the artifact icon that will be created according to the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used.

  • :default_security_level (String)

    Default security level of the new meta artifact. When nil is set, the attribute from the XML (entered in :data option) is used. All possible security levels may be found as constants in Artifact::SecurityLevel class.

  • :import_life_cycle_template (Boolean)

    Flag indicating whether the life cycle template will be created according to specification in the entered XML. Default value is true.

  • :import_property_templates (Boolean)

    Flag indicating whether the property templates will be created according to specification in the entered XML. Default value is true.

  • :import_sheet_templates (Boolean)

    Flag indicating whether the sheet templates will be created according to specification in the entered XML. Default value is true.

  • :import_properties (Boolean)

    Flag indicating whether the properties will be created according to specification in the entered XML. Default value is true.

  • :import_sheets (Boolean)

    Flag indicating whether the sheets will be created according to specification in the entered XML. Default value is true.

  • :import_attachments (Boolean)

    Flag indicating whether the attachments will be created according to specification in the entered XML. Default value is true.

  • :import_meta_permissions (Boolean)

    Flag indicating whether the meta permissions will be created according to specification in the entered XML. Default value is true.

  • :import_permissions (Boolean)

    Flag indicating whether the permissions will be created according to specification in the entered XML. Default value is true.

  • :import_use_cases (Boolean)

    Flag indicating whether the use cases and artifact interfaces will be created according to specification in the entered XML. Default value is true. If the exported data was created before uuOS 8-14 HF4, the basic artifact interfaces Manage, Read, Read and Write are created regardless to the flag value.

  • :import_masks (Boolean)

    Flag indicating whether the permission masks will be created according to specification in the entered XML. Default value is true.

  • :reference_map (String)

    JSON describing the linkage of references specified in XML to another objects (e.g. references in properties, activity related artifacts. …).

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the created Meta artifact is component content. Default value is false.

  • :default_component_content (Boolean)

    Defines whether the primarily displayed content of an artifact created according to the new meta artifact is component content. When nil is set, the attribute from the XML (entered in :data option) is used.

Returns:



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, meta_artifact = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaArtifact)
  dto = UU::OS::MetaArtifact::MetaArtifactCreate.new(meta_artifact)
  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.

Examples:

# Start exporting a meta artifact
process_uri = UU::OS::MetaArtifact.export('ues:TERRITORY:META_ARTIFACT')

# Wait for the end of the process.
export_uri = UU::OS::REST::Future.new(process_uri).get(nil, 600)

# Get exported XML file.
exported_data = UU::OS::MetaArtifact.get_export_data(export_uri)

Parameters:

  • meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of the meta artifact to export.

Returns:



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(meta_artifact_uri)
  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', meta_artifact_uri, 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.

Examples:

# Get meta artifact attributes by specified uri.
metaArtifactAttributes = UU::OS::MetaArtifact.get_attributes('ues:TERRITORY:META_ARTIFACT')

Parameters:

  • meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of a meta artifact whose attributes are returned

Returns:



39
40
41
42
43
44
45
# File 'uu_os-0.29.16/lib/uu/os/meta_artifact.rb', line 39

def get_attributes(meta_artifact_uri)
  svc = UU::OS::REST::RemoteClient.new(MetaArtifact)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getAttributes', meta_artifact_uri)
    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.

Examples:

# Get default presentation attributes of a meta-artifact
UU::OS::MetaArtifact.get_default_presentation_attributes('ues:TERRITORY:META_ARTIFACT')

Parameters:

  • meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of the meta artifact whose presentation template is to be retrieved.

Returns:



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(meta_artifact_uri)
  svc = UU::OS::REST::RemoteClient.new(MetaArtifact)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getDefaultPresentationAttributes', meta_artifact_uri)
    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.

Examples:

# Start exporting a meta artifact
process_uri = UU::OS::MetaArtifact.export('ues:TERRITORY:META_ARTIFACT')

# Wait for the end of the process.
export_uri = UU::OS::REST::Future.new(process_uri).get(nil, 600)

# Get exported XML file.
exported_data = UU::OS::MetaArtifact.get_export_data(export_uri)

Parameters:

Options Hash (meta_artifact):

  • :requested_mime_type (String)

    MIME type of the returned value. Possible values are ‘application/xml’ for XML and ‘application/zip’ for ZIP. ZIP is returned by default.

Returns:



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(meta_artifact_uri, meta_artifact = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaArtifact)
  dto = UU::OS::MetaArtifact::MetaArtifactGetExportData.new(meta_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', meta_artifact_uri)
  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.

Examples:

# Get meta artifact presentation attributes
getPresentationAttributes = UU::OS::MetaArtifact.get_presentation_attributes('ues:TERRITORY:META_ARTIFACT')

Parameters:

  • meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of a meta artifact whose presentation are returned

Returns:



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(meta_artifact_uri)
  svc = UU::OS::REST::RemoteClient.new(MetaArtifact)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getPresentationAttributes', meta_artifact_uri)
    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.

Examples:

# Set attributes of meta artifact.
UU::OS::MetaArtifact.set_attributes('ues:TERRITORY:META_ARTIFACT',
    :name=>'Meta art name',
    :code=>'CODE',
    :description=>'Text description without sense.',
    :security_level=>UU::OS::Artifact::SecurityLevel::CONFIDENTIAL,
    :default_name=>'Mar default name',
    :default_code=>'DEFAULT_CODE',
    :default_security_level=>UU::OS::Artifact::SecurityLevel::CONFIDENTIAL
)

Parameters:

Options Hash (meta_artifact):

  • :name (String)

    The new name of the meta artifact. When nil is set, the name is not modified.

  • :code (String)

    The new code of the meta artifact. When nil is set, the code is not modified. When blank string is set, the code is generated automatically using the system sequence. The code must be unique in a given territory, otherwise the setAttributes command fails.

  • :description (String)

    The new description of the meta artifact. When nil is set, the description is not modified.

  • :security_level (UU::OS::Artifact::SecurityLevel)

    The new security level of the meta artifact. When nil is set, the security level is not modified. When user is setting the meta artifact template security level higher than the user’s security clearance, the setAttributes command fails.

  • :icon_uri (String, UU::OS::UESURI)

    UESURI of the new meta artifact’s icon. When nil is set, the icon is not modified. If nil UESURI (“ues:[-1]:[-1]:”) is set, the meta artifact icon is removed and the meta artifact uses icon from his meta artifact. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :default_name (String)

    Specifies new default name of the created artifact according to meta artifact (specified in source_meta_artifact_uri). When nil is set, the default name is not modified.

  • :default_code (String)

    Specifies new default code of the created artifact according to meta artifact (specified in source_meta_artifact_uri). When nil is set, the default code is not modified.

  • :default_security_level (UU::OS::Artifact::SecurityLevel)

    Specifies new default security level of the created artifact according to meta artifact (specified in source_meta_artifact_uri). When nil is set, the default security is not modified.

  • :default_icon_uri (String, UU::OS::UESURI)

    Specifies new default icon of the created artifact according to meta artifact (specified in metaArtifactUri). When nil is set, the default icon is not modified. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the created Meta artifact is component content. Default value is false.

  • :default_component_content (Boolean)

    Defines whether the primarily displayed content of an artifact created according to the meta artifact (specified in source_meta_artifact_uri) is component content. When nil is set, the default component content setting is not modified.

Returns:



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(meta_artifact_uri, meta_artifact = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaArtifact)
  payload = UU::OS::MetaArtifact::MetaArtifactSetAttributes.new(meta_artifact).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setAttributes', meta_artifact_uri, 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.

Examples:

# Sets default presentation attributes of a meta-artifact
UU::OS::MetaArtifact.set_default_presentation_attributes('ues:TERRITORY:META_ARTIFACT',
    :artifact_width => UU::OS::Artifact::ArtifactWidthType::DEFAULT,
    :header_display_mode => UU::OS::Artifact::ArtifactHeaderDisplayMode::HIDDEN,
    :comment_display_mode => UU::OS::Artifact::ArtifactCommentsDisplayMode::VISIBLE,
    :lock_personal_settings => true,
    :lock_artifact_settings => false,
    :visual_style => UU::OS::Artifact::ArtifactVisualStyle::V2
)

Parameters:

Options Hash (presentation_attributes):

  • :artifact_width (UU::OS::Artifact::ArtifactWidthType)

    Width of the layout. Never nil.

  • :header_display_mode (UU::OS::Artifact::ArtifactHeaderDisplayMode)

    Header type. Never nil.

  • :control_bar_display_mode (UU::OS::Artifact::ArtifactControlBarDisplayMode)

    # Show/hide control bar. Never nil.

  • :comment_display_mode (UU::OS::Artifact::ArtifactCommentsDisplayMode)

    Show/hide comments. Never nil.

  • :artifact_display_mode (UU::OS::Artifact::ArtifactDisplayMode)

    Show simple or advanced context menu. Never nil.

  • :lock_settings (Boolean)

    Deprecated. Use lock_personal_settings and lock_artifact_settings instead.

  • :lock_personal_settings (Boolean)

    This option forbids to impact artifact presentation through user settings. The artifacts created from this meta artifact will be displayed based on the meta artifact’s presentation template regardless of the general user settings.

  • :lock_artifact_settings (Boolean)

    This option forbids to change artifact presentation settings on artifacts created from this meta artifact. The artifacts will be displayed based on the meta artifact’s presentation template and general user settings regardless of the artifact presentation settings.

  • :visual_style (UU::OS::Artifact::ArtifactVisualStyle)

    Represents visual style.

  • :navigation_area_display_mode (UU::OS::Artifact::ArtifactNavigationAreaDisplayMode)

    Show/hide navigation area when displaying sheet content. Navigation area contains navigation bar, header, heading and control bar.

Returns:



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(meta_artifact_uri, 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', meta_artifact_uri, 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.

Examples:

#
UU::OS::MetaArtifact.set_presentation_attributes('ues:TERRITORY:PERSONAL_ROLE',
   :artifact_width => UU::OS::Artifact::ArtifactWidthType::DEFAULT,
   :header_display_mode => UU::OS::Artifact::ArtifactHeaderDisplayMode::HIDDEN,           
   :artifact_display_mode => UU::OS::Artifact::ArtifactDisplayMode::ADVANCED,
   :control_bar_display_mode => UU::OS::Artifact::ArtifactControlBarDisplayMode::VISIBLE,
   :comment_display_mode => UU::OS::Artifact::ArtifactCommentsDisplayMode::VISIBLE,
   :visual_style => UU::OS::Artifact::ArtifactVisualStyle::V1,
   :navigation_area_display_mode => UU::OS::Artifact::ArtifactNavigationAreaDisplayMode::VISIBLE
)

Parameters:

Options Hash (presentation_attributes):

Returns:



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(meta_artifact_uri, 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', meta_artifact_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end