Package net.sf.mpxj

Examples of net.sf.mpxj.TaskField


    * @param field field ID
    * @return field type
    */
   private TaskField getTaskField(int field)
   {
      TaskField result = MPPTaskField14.getInstance(field);

      if (result != null)
      {
         switch (result)
         {
View Full Code Here


      switch (prefix)
      {
         case MPPTaskField.TASK_FIELD_BASE :
         {
            TaskField field = MPPTaskField.getInstance(index);
            if (field != null && field != TaskField.NOTES)
            {
               Task task = m_project.getTaskByUniqueID(entityID);
               if (task != null)
               {
                  if (field.getDataType() == DataType.CURRENCY)
                  {
                     value = Double.valueOf(((Double) value).doubleValue() / 100);
                  }
                  task.set(field, value);
               }
            }
            break;
         }

         case MPPResourceField.RESOURCE_FIELD_BASE :
         {
            ResourceField field = MPPResourceField.getInstance(index);
            if (field != null && field != ResourceField.NOTES)
            {
               Resource resource = m_project.getResourceByUniqueID(entityID);
               if (resource != null)
               {
                  if (field.getDataType() == DataType.CURRENCY)
                  {
                     value = Double.valueOf(((Double) value).doubleValue() / 100);
                  }
                  resource.set(field, value);
               }
            }
            break;
         }

         case MPPAssignmentField.ASSIGNMENT_FIELD_BASE :
         {
            AssignmentField field = MPPAssignmentField.getInstance(index);
            if (field != null && field != AssignmentField.NOTES)
            {
               ResourceAssignment assignment = m_assignmentMap.get(entityID);
               if (assignment != null)
               {
                  if (field.getDataType() == DataType.CURRENCY)
                  {
                     value = Double.valueOf(((Double) value).doubleValue() / 100);
                  }
                  assignment.set(field, value);
               }
View Full Code Here

   {
      Map<TaskField, String> fieldAliasMap = m_projectFile.getTaskFieldAliasMap();

      for (int loop = 0; loop < ExtendedAttributeTaskFields.FIELD_ARRAY.length; loop++)
      {
         TaskField key = ExtendedAttributeTaskFields.FIELD_ARRAY[loop];
         Integer fieldID = Integer.valueOf(MPPTaskField.getID(key) | MPPTaskField.TASK_FIELD_BASE);
         String name = key.getName();
         String alias = fieldAliasMap.get(key);

         if (m_taskExtendedAttributes.contains(key) || alias != null)
         {
            Project.ExtendedAttributes.ExtendedAttribute attribute = m_factory.createProjectExtendedAttributesExtendedAttribute();
View Full Code Here

      Project.Tasks.Task.ExtendedAttribute attrib;
      List<Project.Tasks.Task.ExtendedAttribute> extendedAttributes = xml.getExtendedAttribute();

      for (int loop = 0; loop < ExtendedAttributeTaskFields.FIELD_ARRAY.length; loop++)
      {
         TaskField mpxFieldID = ExtendedAttributeTaskFields.FIELD_ARRAY[loop];
         Object value = mpx.getCachedValue(mpxFieldID);

         if (writeExtendedAttribute(value, mpxFieldID))
         {
            m_taskExtendedAttributes.add(mpxFieldID);

            Integer xmlFieldID = Integer.valueOf(MPPTaskField.getID(mpxFieldID) | MPPTaskField.TASK_FIELD_BASE);

            attrib = m_factory.createProjectTasksTaskExtendedAttribute();
            extendedAttributes.add(attrib);
            attrib.setFieldID(xmlFieldID.toString());
            attrib.setValue(DatatypeConverter.printExtendedAttribute(this, value, mpxFieldID.getDataType()));
            attrib.setDurationFormat(printExtendedAttributeDurationFormat(value));
         }
      }
   }
View Full Code Here

   private void readTaskExtendedAttributes(Project.Tasks.Task xml, Task mpx)
   {
      for (Project.Tasks.Task.ExtendedAttribute attrib : xml.getExtendedAttribute())
      {
         int xmlFieldID = Integer.parseInt(attrib.getFieldID()) & 0x0000FFFF;
         TaskField mpxFieldID = MPPTaskField.getInstance(xmlFieldID);
         DatatypeConverter.parseExtendedAttribute(m_projectFile, mpx, attrib.getValue(), mpxFieldID);
      }
   }
View Full Code Here

         switch (base)
         {
            case MPPTaskField.TASK_FIELD_BASE :
            {
               TaskField taskField = MPPTaskField.getInstance(index);
               if (taskField != null)
               {
                  m_projectFile.setTaskFieldAlias(taskField, attribute.getAlias());
               }
               break;
View Full Code Here

         if ((field == null) || (field.length() == 0))
         {
            continue;
         }

         TaskField taskField = MPXTaskField.getMpxjField(mpxFieldID);
         if (taskField == null)
         {
            System.out.println("Null Task Field " + mpxFieldID);
            continue;
         }
View Full Code Here

    * @param value value from an MS Project file
    * @return TaskField instance
    */
   public static TaskField getMpxjField(int value)
   {
      TaskField result = null;

      if (value >= 0 && value < MPX_MPXJ_ARRAY.length)
      {
         result = MPX_MPXJ_ARRAY[value];
      }
View Full Code Here

         // Then the number of custom value lists
         int numberOfValueLists = MPPUtility.getInt(data, offset);
         offset += 4;

         // Then the value lists themselves
         TaskField field;
         int valueListOffset = 0;
         while (index < numberOfValueLists && offset < length)
         {
            // Each item consists of the Field ID (2 bytes), 40 0B marker (2 bytes), and the
            // offset to the value list (4 bytes)
View Full Code Here

         //System.out.println(props);

         for (Integer key : props.keySet())
         {
            int keyValue = key.intValue() - MPPTaskField.TASK_FIELD_BASE;
            TaskField field = MPPTaskField.getInstance(keyValue);

            if (field != null)
            {
               Object value = null;

               switch (field.getDataType())
               {
                  case CURRENCY :
                  {
                     value = Double.valueOf(props.getDouble(key) / 100);
                     break;
View Full Code Here

TOP

Related Classes of net.sf.mpxj.TaskField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.