Module: UU::OS::Folder
- Extended by:
- Folder
- Included in:
- Folder
- Defined in:
- uu_os-0.29.16/lib/uu/os/folder/folder_create.rb,
uu_os-0.29.16/lib/uu/os/folder.rb,
uu_os-0.29.16/lib/uu/os/folder/folder_export.rb,
uu_os-0.29.16/lib/uu/os/folder/folder_entry_type.rb,
uu_os-0.29.16/lib/uu/os/folder/folder_attributes.rb,
uu_os-0.29.16/lib/uu/os/folder/folder_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/folder/folder_get_entry_list.rb,
uu_os-0.29.16/lib/uu/os/folder/folder_get_export_data.rb,
uu_os-0.29.16/lib/uu/os/folder/folder_entry_attributes.rb
Overview
Module Folder.
Defined Under Namespace
Classes: FolderAttributes, FolderCreate, FolderEntryAttributes, FolderEntryType, FolderExport, FolderGetEntryList, FolderGetExportData, FolderSetAttributes
Constant Summary
- PATH =
Service path
'ues/core/container/UESFolder'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, folder = nil)
Creates a folder of class Folder.
-
- (Object) delete(folder_uri)
This command deletes the specified folder from the system.
-
- (UU::OS::UESURI) export(folder_uri)
Exports a folder to the XML file, which is saved to the export storage.
-
- (FolderAttributes) get_attributes(folder_uri)
Reads folder specified by the folderUri attribute and returns its attributes.
-
- (UU::OS::REST::ResultList<Folder::FolderGetEntryList, Folder::FolderEntryAttributes>) get_entry_list(folder_uri, criteria = nil)
This command returns a list of entries (artifacts or shortcuts) enlisted in the specified folder (entity type of main entity of the command could be a Folder, Organizational Unit, Territory or Meta Model Dictionary).
-
- (UU::OS::REST::BinaryValue) get_export_data(folder_uri, folder = nil)
Returns a XML file generated by the export command Folder Export.
-
- (UU::OS::UESURI) set_attributes(folder_uri, folder = nil)
Command for setting attributes of a folder.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, folder = nil)
Creates a folder of class Folder. Command creates new folder in specified container. At the very least meta artifact must be specified in artifactCreate Object. Competent role for artifact 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 ArtifactCreate Object.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'uu_os-0.29.16/lib/uu/os/folder.rb', line 45 def create(location_uri, folder = nil) svc = UU::OS::REST::RemoteClient.new(Folder) payload = UU::OS::Folder::FolderCreate.new(folder).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(folder_uri)
This command deletes the specified folder from the system. The folder is deleted even if it contains a locked sheet or attachment. The folder cannot be deleted when:
the folder is not empty.
the folder's workflow is not created
a property contains a reference to this folder
a time sheet exists with a reference to this folder
123 124 125 126 127 128 |
# File 'uu_os-0.29.16/lib/uu/os/folder.rb', line 123 def delete(folder_uri) svc = UU::OS::REST::RemoteClient.new(Folder) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', folder_uri) end end |
- (UU::OS::UESURI) export(folder_uri)
Exports a folder 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.
171 172 173 174 175 176 177 178 179 |
# File 'uu_os-0.29.16/lib/uu/os/folder.rb', line 171 def export(folder_uri) svc = UU::OS::REST::RemoteClient.new(Folder) payload = UU::OS::Folder::FolderExport.new(nil).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('export', folder_uri, payload) return UU::OS::UESURI.new(res) end end |
- (FolderAttributes) get_attributes(folder_uri)
Reads folder specified by the folderUri
attribute and returns
its attributes.
69 70 71 72 73 74 75 |
# File 'uu_os-0.29.16/lib/uu/os/folder.rb', line 69 def get_attributes(folder_uri) svc = UU::OS::REST::RemoteClient.new(Folder) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', folder_uri) return Folder::FolderAttributes.new(res) end end |
- (UU::OS::REST::ResultList<Folder::FolderGetEntryList, Folder::FolderEntryAttributes>) get_entry_list(folder_uri, criteria = nil)
This command returns a list of entries (artifacts or shortcuts) enlisted in the specified folder (entity type of main entity of the command could be a Folder, Organizational Unit, Territory or Meta Model Dictionary). 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 codes in case are equal) of a entry by default, or it can be sorted arbitrarily by any of entry attributes usable for the filtering or these attributes combinations.
be a Folder, Organizational Unit, Territory or Meta Model Dictionary.
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'uu_os-0.29.16/lib/uu/os/folder.rb', line 97 def get_entry_list(folder_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Folder) dto = Folder::FolderGetEntryList.new(criteria) svc.add_parameter('pageIndex', dto.page_index) svc.add_parameter('pageSize', dto.page_size) svc.add_parameter('query', dto.query) svc.add_parameter('recursive', dto.recursive) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getEntryList', folder_uri) return UU::OS::REST::ResultList.new(Folder::FolderGetEntryList, Folder::FolderEntryAttributes, res) end end |
- (UU::OS::REST::BinaryValue) get_export_data(folder_uri, folder = nil)
Returns a XML file generated by the export command Folder Export.
198 199 200 201 202 203 204 205 206 207 |
# File 'uu_os-0.29.16/lib/uu/os/folder.rb', line 198 def get_export_data(folder_uri, folder = nil) svc = UU::OS::REST::RemoteClient.new(Folder) dto = UU::OS::Folder::FolderGetExportData.new(folder) 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', folder_uri) end end |
- (UU::OS::UESURI) set_attributes(folder_uri, folder = nil)
Command for setting attributes of a folder. The command can't modify references to objects like location, competent role and so on.
148 149 150 151 152 153 154 155 156 |
# File 'uu_os-0.29.16/lib/uu/os/folder.rb', line 148 def set_attributes(folder_uri, folder = nil) svc = UU::OS::REST::RemoteClient.new(Folder) payload = UU::OS::Folder::FolderSetAttributes.new(folder).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', folder_uri, payload) return UU::OS::UESURI.new(res) end end |