Module: UU::OS::PropertyTemplate
- Extended by:
- PropertyTemplate
- Included in:
- PropertyTemplate
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/property_template.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_create.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_get_entry_list.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_entry_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_delete_collection.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_collection_create.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_collection_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/property_template/property_template_set_collection_attributes.rb
Overview
UES Property Template service.
Defined Under Namespace
Classes: PropertyTemplateAttributes, PropertyTemplateCollectionAttributes, PropertyTemplateCollectionCreate, PropertyTemplateCreate, PropertyTemplateDeleteCollection, PropertyTemplateEntryAttributes, PropertyTemplateGetEntryList, PropertyTemplateSetAttributes, PropertyTemplateSetCollectionAttributes
Constant Summary
- PATH =
Service path
'ues/core/property/UESPropertyTemplate'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(parent_node_uri, property_template = nil)
Creates a new property template on the specified Meta Artifact or in the specified property template group.
-
- (UU::OS::UESURI) create_collection(parent_node_uri, collection = nil)
Creates a new property template collection on the specified Meta Artifact or in the specified property collection template.
-
- (Object) delete(template_uri)
Deletes the property template from the system.
-
- (Object) delete_collection(collection_uri, collection = nil)
Deletes the specified property collection template.
-
- (PropertyTemplateAttributes) get_attributes(template_uri)
Returns attributes representing the specified property template.
-
- (PropertyTemplateCollectionAttributes) get_collection_attributes(collection_uri)
Returns attributes of the specified property collection template.
-
- (Array) get_entry_list(parent_node_uri, criteria = nil)
Returns a list of entries (property templates or property template collections) enlisted in the specified property template collection or on the specified Meta Artifact (property template entries from the Meta Artifact root property template collection are returned in that case).
-
- (Object) get_value(template_uri)
Returns the value of the given property template of the corresponding type.
-
- (UU::OS::UESURI) set_attributes(template_uri, property_template = nil)
Sets basic attributes of the specified property template.
-
- (UU::OS::UESURI) set_collection_attributes(collection_uri, collection = nil)
Modifies basic attributes of the property collection template specified in collTemplateUri.
-
- (Object) set_value(template_uri, value = nil)
Sets a new value on the specified property template.
Instance Method Details
- (UU::OS::UESURI) create(parent_node_uri, property_template = nil)
Creates a new property template on the specified Meta Artifact or in the specified property template group. At the very least property template type and name have to be specified in this command. Value of the property template is optional.
169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 169 def create(parent_node_uri, property_template = nil) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) prop = UU::OS::PropertyTemplate::PropertyTemplateCreate.new(property_template) value = prop.value if (value.kind_of?File) prop.value = UU::OS::REST::BinaryValue.new(value) end payload = prop.to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', parent_node_uri, payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) create_collection(parent_node_uri, collection = nil)
Creates a new property template collection on the specified Meta Artifact or in the specified property collection template. At the very least property template collection name has to be specified in this command.
246 247 248 249 250 251 252 253 254 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 246 def create_collection(parent_node_uri, collection = nil) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) payload = UU::OS::PropertyTemplate::PropertyTemplateCollectionCreate.new(collection).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('createCollection', parent_node_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) delete(template_uri)
Deletes the property template from the system.
190 191 192 193 194 195 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 190 def delete(template_uri) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', template_uri) end end |
- (Object) delete_collection(collection_uri, collection = nil)
Deletes the specified property collection template. When recursive is set in options, all nested objects in property collection template are also removed.
306 307 308 309 310 311 312 313 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 306 def delete_collection(collection_uri, collection = nil) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) payload = UU::OS::PropertyTemplate::PropertyTemplateDeleteCollection.new(collection).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('deleteCollection', collection_uri, payload) end end |
- (PropertyTemplateAttributes) get_attributes(template_uri)
Returns attributes representing the specified property template.
33 34 35 36 37 38 39 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 33 def get_attributes(template_uri) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', template_uri) return PropertyTemplate::PropertyTemplateAttributes.new(res) end end |
- (PropertyTemplateCollectionAttributes) get_collection_attributes(collection_uri)
Returns attributes of the specified property collection template.
265 266 267 268 269 270 271 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 265 def get_collection_attributes(collection_uri) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getCollectionAttributes', collection_uri) return PropertyTemplate::PropertyTemplateCollectionAttributes.new(res) end end |
- (Array) get_entry_list(parent_node_uri, criteria = nil)
Returns a list of entries (property templates or property template collections) enlisted in the specified property template collection or on the specified Meta Artifact (property template entries from the Meta Artifact root property template collection are returned in that case). Command does not return all entries, only a sublist. The list of returned entries could be filtered by the name, code or type of an entry. The list is sorted by the name (and code in case are equal) of an entry by default, or it can be sorted arbitrarily by any of entry attributes usable for the filtering or these attributes combinations. See the UES query documentation for more information.
It is possible to filter result by: name, code, entityTypeUri, valueType
124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 124 def get_entry_list(parent_node_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) dto = PropertyTemplate::PropertyTemplateGetEntryList.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('getEntryList', parent_node_uri) res = UU::OS::REST::ResultList.new(PropertyTemplate::PropertyTemplateGetEntryList, PropertyTemplate::PropertyTemplateEntryAttributes, res) return res end end |
- (Object) get_value(template_uri)
Returns the value of the given property template of the corresponding type. Null in case the value is not set.
93 94 95 96 97 98 99 100 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 93 def get_value(template_uri) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) UU::OS::QoS::QoSHandler.auto_retry do value = svc.get('getValue', template_uri) type = get_attributes(template_uri).type() return deserialize_by_type(value,type) end end |
- (UU::OS::UESURI) set_attributes(template_uri, property_template = nil)
Sets basic attributes of the specified property template.
222 223 224 225 226 227 228 229 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 222 def set_attributes(template_uri, property_template = nil) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) payload = UU::OS::PropertyTemplate::PropertyTemplateSetAttributes.new(property_template).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', template_uri, payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) set_collection_attributes(collection_uri, collection = nil)
Modifies basic attributes of the property collection template specified in collTemplateUri.
287 288 289 290 291 292 293 294 295 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 287 def set_collection_attributes(collection_uri, collection = nil) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) payload = UU::OS::PropertyTemplate::PropertyTemplateSetCollectionAttributes.new(collection).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setCollectionAttributes', collection_uri, payload) return UU::OS::UESURI.new(res) end end |
- (Object) set_value(template_uri, value = nil)
Sets a new value on the specified property template. The data type of the value must match the data type of the specified property template.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'uu_os_client-0.10.6/lib/uu/os/property_template.rb', line 55 def set_value(template_uri, value = nil) svc = UU::OS::REST::RemoteClient.new(PropertyTemplate) file_value = false payload = {} if (value.kind_of?File) file_value = true payload[:value] = value elsif (value.kind_of?IO) payload = UU::OS::REST::BinaryValue.new(value).to_json elsif ((value.kind_of?UU::OS::REST::BinaryValue) && (value.data.kind_of?File) && (File.basename(value.data.path) == value.name)) payload[:value] = value.data payload[:defaultName] = value.name elsif ((value.kind_of?UU::OS::REST::BinaryValue) && (value.data.nil?) && (!value.name.nil? && !value.name.empty?)) payload[:defaultName] = value.name else payload = value.to_json end UU::OS::QoS::QoSHandler.auto_retry do if file_value payload[:value].rewind end svc.post('setValue', template_uri, payload) end end |