Java Code Examples for net.sf.mpxj.Task#getRecurringTask()

The following examples show how to use net.sf.mpxj.Task#getRecurringTask() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MPXWriter.java    From mpxj with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * Write a task.
 *
 * @param record task instance
 * @throws IOException
 */
private void writeTask(Task record) throws IOException
{
   m_buffer.setLength(0);

   //
   // Write the task
   //
   int[] fields = m_taskModel.getModel();
   int field;

   m_buffer.append(MPXConstants.TASK_RECORD_NUMBER);
   for (int loop = 0; loop < fields.length; loop++)
   {
      field = fields[loop];
      if (field == -1)
      {
         break;
      }

      TaskField taskField = MPXTaskField.getMpxjField(field);
      Object value = record.getCachedValue(taskField);
      value = formatType(taskField.getDataType(), value);

      m_buffer.append(m_delimiter);
      m_buffer.append(format(value));
   }

   stripTrailingDelimiters(m_buffer);
   m_buffer.append(MPXConstants.EOL);
   m_writer.write(m_buffer.toString());

   //
   // Write the task notes
   //
   String notes = record.getNotes();
   if (notes.length() != 0)
   {
      writeNotes(MPXConstants.TASK_NOTES_RECORD_NUMBER, notes);
   }

   //
   // Write the recurring task
   //
   if (record.getRecurringTask() != null)
   {
      writeRecurringTask(record.getRecurringTask());
   }

   //
   // Write any resource assignments
   //
   if (record.getResourceAssignments().isEmpty() == false)
   {
      for (ResourceAssignment assignment : record.getResourceAssignments())
      {
         writeResourceAssignment(assignment);
      }
   }

   m_eventManager.fireTaskWrittenEvent(record);
}