class Aspose::Cloud::Tasks::Document
Public Class Methods
# File lib/tasks/document.rb, line 5 def initialize(filename) @filename = filename raise 'filename not specified.' if filename.empty? @base_uri = Aspose::Cloud::Common::Product.product_uri + '/tasks/' + @filename end
Public Instance Methods
Add a Task Link to Project @param string link URL of the link. @param number index @param number predecessor_uid Predecessor UID. @param number successor_uid Successor UID. @param string link_type Type of the link. @param number lag @param string lag_format
# File lib/tasks/document.rb, line 97 def add_link(link, index, predecessor_uid, successor_uid, link_type, lag, lag_format, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'link not specified.' if link.empty? raise 'index not specified.' if index.nil? raise 'predecessor_uid not specified.' if predecessor_uid.nil? raise 'successor_uid not specified.' if successor_uid.nil? raise 'link_type not specified.' if link_type.empty? raise 'lag not specified.' if lag.nil? raise 'lag_format not specified.' if lag_format.empty? data = { :Link=> link, :Index=> index, :PredecessorUid=> predecessor_uid, :SuccessorUid=> successor_uid, :LinkType=> link_type, :Lag=> lag, :LagFormat=> lag_format } json_data = data.to_json str_uri = "#{@base_uri}/taskLinks" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(Aspose::Cloud::Common::Utils.process_command(signed_str_uri,'POST','JSON',json_data))['Code'] == 200 ? true : false end
Add a Task to Project @param string task_name The name of the Task. @param number before_task_id The id of the task to insert the new task before.
# File lib/tasks/document.rb, line 49 def add_task(task_name, before_task_id, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'task_name not specified.' if task_name.nil? raise 'before_task_id not specified.' if before_task_id.nil? str_uri = "#{@base_uri}/tasks" qry = { :taskName => task_name, :beforeTaskId => before_task_id } str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry) str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.post(signed_str_uri, '', {:accept=>'application/json'}))['TaskItem'] end
Delete a Extended Attribute from a Project @param number attribute_id The id of the attribute.
# File lib/tasks/document.rb, line 188 def delete_extended_attribute(attribute_id, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'attribute_id not specified.' if attribute_id.nil? str_uri = "#{@base_uri}/extendedAttributes/#{attribute_id}" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) json = JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'})) json['Code'] == 200 ? true : false end
Delete a Task from Project @param number link_index The index of the Link.
# File lib/tasks/document.rb, line 119 def delete_link(link_index, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'link_index not specified.' if link_index.nil? str_uri = "#{@base_uri}/taskLinks/#{link_index}" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) json = JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'})) json['Code'] == 200 ? true : false end
Delete a Outline Code from a Project
# File lib/tasks/document.rb, line 151 def delete_outline_code(outline_code_id, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'outline_code_id not specified.' if outline_code_id.nil? str_uri = "#{@base_uri}/outlineCodes/#{outline_code_id}" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) json = JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'})) json['Code'] == 200 ? true : false end
Delete a Task from Project @param number task_id The id of the Task.
# File lib/tasks/document.rb, line 67 def delete_task(task_id, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'task_id not specified.' if task_id.nil? str_uri = "#{@base_uri}/tasks/#{task_id}" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) json = JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'})) json['Code'] == 200 ? true : false end
Get a Particular Extended Attribute from a Project @param number attribute_id The id of the attribute.
# File lib/tasks/document.rb, line 175 def get_extended_attribute(attribute_id, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'attribute_id not specified.' if attribute_id.nil? str_uri = "#{@base_uri}/extendedAttributes/#{attribute_id}" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['ExtendedAttribute'] end
Get all Extended Attributes from a Project
# File lib/tasks/document.rb, line 164 def get_extended_attributes(folder_name = '', storage_type = 'Aspose', storage_name = '') str_uri = "#{@base_uri}/extendedAttributes" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['ExtendedAttributes'] end
Retrieve Task Links Information from a Project
# File lib/tasks/document.rb, line 80 def get_links(folder_name = '', storage_type = 'Aspose', storage_name = '') str_uri = "#{@base_uri}/taskLinks" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['TaskLinks'] end
# File lib/tasks/document.rb, line 139 def get_outline_code(outline_code_id, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'outline_code_id not specified.' if outline_code_id.nil? str_uri = "#{@base_uri}/outlineCodes/#{outline_code_id}" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['OutlineCode'] end
Get all Outline Codes from Project
# File lib/tasks/document.rb, line 132 def get_outline_codes(folder_name = '', storage_type = 'Aspose', storage_name = '') str_uri = "#{@base_uri}/outlineCodes" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['OutlineCodes'] end
Retrieve Project Properties
# File lib/tasks/document.rb, line 14 def get_properties(folder_name = '', storage_type = 'Aspose', storage_name = '') str_uri = "#{@base_uri}/documentProperties" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Properties']['List'] end
Retrieve Task Information @param number task_id The id of the Task.
# File lib/tasks/document.rb, line 35 def get_task(task_id, folder_name = '', storage_type = 'Aspose', storage_name = '') raise 'task_id not specified.' if task_id.nil? str_uri = "#{@base_uri}/tasks/#{task_id}" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Task'] end
Retrieve Project Tasks
# File lib/tasks/document.rb, line 24 def get_tasks(folder_name = '', storage_type = 'Aspose', storage_name = '') str_uri = "#{@base_uri}/tasks" str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type) signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri) JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Tasks']['TaskItem'] end