Module: Asposetasksjava::TasksProperties
- Defined in:
- lib/asposetasksjava/Tasks/tasksproperties.rb
Instance Method Summary collapse
- #get_actual_properties ⇒ Object
- #get_general_properties ⇒ Object
- #get_outline_properties ⇒ Object
- #initialize ⇒ Object
Instance Method Details
#get_actual_properties ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/asposetasksjava/Tasks/tasksproperties.rb', line 47 def get_actual_properties() data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/' # Instantiate project object project = Rjb::import('com.aspose.tasks.Project').new(data_dir + 'test_tasks.mpp') # Create a ChildTasksCollector instance collector = Rjb::import('com.aspose.tasks.ChildTasksCollector').new # Collect all the tasks from RootTask using TaskUtils Rjb::import('com.aspose.tasks.TaskUtils').apply(project.getRootTask(), collector, 0) tasks = collector.getTasks() tsk = Rjb::import('com.aspose.tasks.Tsk') # Parse through all the collected tasks i = 0 while i < tasks.size() task = tasks.get(i) puts "Task Name : " + task.get(tsk.NAME).to_string puts "Actual Start: " + task.get(tsk.ACTUAL_START).toString() puts "Actual Finish: " + task.get(tsk.ACTUAL_FINISH).toString() puts "Actual Duration: " + task.get(tsk.ACTUAL_DURATION).toString() puts "Actual Cost: " + task.get(tsk.ACTUAL_COST).toString() puts "---------------------------------------------" i +=1 end end |
#get_general_properties ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/asposetasksjava/Tasks/tasksproperties.rb', line 14 def get_general_properties() data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/' # Instantiate project object project = Rjb::import('com.aspose.tasks.Project').new(data_dir + 'test_tasks.mpp') # Create a ChildTasksCollector instance collector = Rjb::import('com.aspose.tasks.ChildTasksCollector').new # Collect all the tasks from RootTask using TaskUtils Rjb::import('com.aspose.tasks.TaskUtils').apply(project.getRootTask(), collector, 0) tasks = collector.getTasks() #puts tasks.size() #abort() tsk = Rjb::import('com.aspose.tasks.Tsk') # Parse through all the collected tasks #tasks.each do |task| i = 0 while i < tasks.size() task = tasks.get(i) puts "Task Id:" + task.get(tsk.ID).to_string puts "Task Uid: " + task.get(tsk.UID).to_string puts "Task Name: " + task.get(tsk.NAME).to_string puts "Task Start: " + task.get(tsk.START).to_string puts "Task Finish: "+ task.get(tsk.FINISH).to_string puts "---------------------------------------------" i +=1 end end |
#get_outline_properties ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/asposetasksjava/Tasks/tasksproperties.rb', line 77 def get_outline_properties() data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/' # Instantiate project object project = Rjb::import('com.aspose.tasks.Project').new(data_dir + 'test_tasks.mpp') # Create a ChildTasksCollector instance collector = Rjb::import('com.aspose.tasks.ChildTasksCollector').new # Collect all the tasks from RootTask using TaskUtils Rjb::import('com.aspose.tasks.TaskUtils').apply(project.getRootTask(), collector, 0) tasks = collector.getTasks() tsk = Rjb::import('com.aspose.tasks.Tsk') # Parse through all the collected tasks i = 0 while i < tasks.size() task = tasks.get(i) puts "Outline Level: " + task.get(tsk.OUTLINE_LEVEL).to_string puts "Outline Number: " + task.get(tsk.OUTLINE_NUMBER).to_string puts "---------------------------------------------" i +=1 end end |
#initialize ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/asposetasksjava/Tasks/tasksproperties.rb', line 3 def initialize() # Getting General Properties get_general_properties() # Getting Actual Properties get_actual_properties() # Getting Outline Properties get_outline_properties() end |