Writes the timephased data for a resource assignment.

@param mpx MPXJ assignment
@param xml MSDPI assignment
345711
private void writeAssignmentTimephasedData(ResourceAssignment mpx, Project.Assignments.Assignment xml)
   {
      if (m_writeTimphasedData && mpx.getHasTimephasedData())
      {
         List<TimephasedDataType> list = xml.getTimephasedData();
         ProjectCalendar calendar = mpx.getCalendar();
         BigInteger assignmentID = xml.getUID();

         List<TimephasedWork> complete = mpx.getTimephasedActualWork();
         List<TimephasedWork> planned = mpx.getTimephasedWork();

         if (m_splitTimephasedAsDays)
         {
            TimephasedWork lastComplete = null;
            if (complete != null && !complete.isEmpty())
            {
               lastComplete = complete.get(complete.size() - 1);
            }

            TimephasedWork firstPlanned = null;
            if (planned != null && !planned.isEmpty())
            {
               firstPlanned = planned.get(0);
            }

            if (planned != null)
            {
               planned = splitDays(calendar, mpx.getTimephasedWork(), null, lastComplete);
            }

            if (complete != null)
            {
               complete = splitDays(calendar, complete, firstPlanned, null);
            }
         }

         if (planned != null)
         {
            writeAssignmentTimephasedData(assignmentID, list, planned, 1);
         }

         if (complete != null)
         {
            writeAssignmentTimephasedData(assignmentID, list, complete, 2);
         }
      }
   }
322185
public void writeXML(OutputStream outputStream, String encoding, String indent, String lineSeparator)
  throws IOException {
    XMLOutputter outputter = new XMLOutputter();
    Format format = Format.getPrettyFormat();
    format.setEncoding(encoding);
    format.setIndent(indent);
    format.setLineSeparator(lineSeparator);
    outputter.setFormat(format);
    outputter.output(getDocument(), outputStream);
  }
309207
@Override
    public void xmlWriteOn(FormattedWriter writer) throws IOException
    {
        writer.startTag(XML_MESSAGE_STORE);
        writer.indent();
        synchronized (_startLock)
        {
            if (_state == MessageStoreState.STATE_STARTED)
            {
                _rootMembership.xmlWriteItemStreamsOn(writer);
            }
            else
            {
                writer.newLine();
                writer.write(XML_CANNOT_BE_WRITTEN);
            }
        }

        if (null != _itemStorageManager)
        {
            _itemStorageManager.xmlWriteOn(writer);
        }

        if (null != _membershipMap)
        {
            _membershipMap.xmlWriteOn(writer);
        }

        if (null != _persistentMessageStore)
        {
            _persistentMessageStore.xmlWriteOn(writer);
        }

        if (null != _expirer)
        {
            _expirer.xmlWriteOn(writer);
        }

        if (null != _cacheLoader)
        {
            _cacheLoader.xmlWriteOn(writer);
        }

        if (null != _deliveryDelayManager) {
            _deliveryDelayManager.xmlWriteOn(writer);
        }
        writer.outdent();
        writer.newLine();
        writer.endTag(XML_MESSAGE_STORE);
    }
761791
private void createTimephasedData(ProjectFile file, ResourceAssignment assignment, List<TimephasedWork> timephasedPlanned, List<TimephasedWork> timephasedComplete)
   {
      if (timephasedPlanned.isEmpty() && timephasedComplete.isEmpty())
      {
         Duration totalMinutes = assignment.getWork().convertUnits(TimeUnit.MINUTES, file.getProjectProperties());

         Duration workPerDay;

         if (assignment.getResource() == null || assignment.getResource().getType() == ResourceType.WORK)
         {
            workPerDay = totalMinutes.getDuration() == 0 ? totalMinutes : ResourceAssignmentFactory.DEFAULT_NORMALIZER_WORK_PER_DAY;
            int units = NumberHelper.getInt(assignment.getUnits());
            if (units != 100)
            {
               workPerDay = Duration.getInstance((workPerDay.getDuration() * units) / 100.0, workPerDay.getUnits());
            }
         }
         else
         {
            if (assignment.getVariableRateUnits() == null)
            {
               Duration workingDays = assignment.getCalendar().getWork(assignment.getStart(), assignment.getFinish(), TimeUnit.DAYS);
               double units = NumberHelper.getDouble(assignment.getUnits());
               double unitsPerDayAsMinutes = (units * 60) / (workingDays.getDuration() * 100);
               workPerDay = Duration.getInstance(unitsPerDayAsMinutes, TimeUnit.MINUTES);
            }
            else
            {
               double unitsPerHour = NumberHelper.getDouble(assignment.getUnits());
               workPerDay = ResourceAssignmentFactory.DEFAULT_NORMALIZER_WORK_PER_DAY;
               Duration hoursPerDay = workPerDay.convertUnits(TimeUnit.HOURS, file.getProjectProperties());
               double unitsPerDayAsHours = (unitsPerHour * hoursPerDay.getDuration()) / 100;
               double unitsPerDayAsMinutes = unitsPerDayAsHours * 60;
               workPerDay = Duration.getInstance(unitsPerDayAsMinutes, TimeUnit.MINUTES);
            }
         }

         Duration overtimeWork = assignment.getOvertimeWork();
         if (overtimeWork != null && overtimeWork.getDuration() != 0)
         {
            Duration totalOvertimeMinutes = overtimeWork.convertUnits(TimeUnit.MINUTES, file.getProjectProperties());
            totalMinutes = Duration.getInstance(totalMinutes.getDuration() - totalOvertimeMinutes.getDuration(), TimeUnit.MINUTES);
         }

         TimephasedWork tra = new TimephasedWork();
         tra.setStart(assignment.getStart());
         tra.setAmountPerDay(workPerDay);
         tra.setModified(false);
         tra.setFinish(assignment.getFinish());
         tra.setTotalAmount(totalMinutes);
         timephasedPlanned.add(tra);
      }
   }
308919
void writeTimestamp(DataOutput out)
        throws IOException {

        int header = SPX.MOMENT_TYPE;
        header <<= 4;

        if (this.isPositiveLS()) {
            header |= 1;
        }

        int fp = this.getNanosecond();

        if (fp > 0) {
            header |= 2;
        }

        out.writeByte(header);
        out.writeLong(this.posixTime);

        if (fp > 0) {
            out.writeInt(fp);
        }

    }
1013881
public static void writeXML(Document xmldocument, Writer writer) throws IOException {
		assert xmldocument != null : AssertMessages.notNullParameter(0);
		assert writer != null : AssertMessages.notNullParameter(1);
		writeNode(xmldocument, writer);
	}
1130780
public void write(ObjectWriter out, PersistedNodeData nodeData) throws IOException
   {
      // write id
      out.writeInt(SerializationConstants.PERSISTED_NODE_DATA);

      // TransientItemData
      out.writeString(nodeData.getQPath().getAsString());
      out.writeString(nodeData.getIdentifier());

      if (nodeData.getParentIdentifier() != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         out.writeString(nodeData.getParentIdentifier());
      }
      else
         out.writeByte(SerializationConstants.NULL_DATA);

      out.writeInt(nodeData.getPersistedVersion());
      // -------------------

      out.writeInt(nodeData.getOrderNumber());

      // primary type
      out.writeString(nodeData.getPrimaryTypeName().getAsString());

      // mixins
      InternalQName[] mixinNames = nodeData.getMixinTypeNames();

      if (mixinNames != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         out.writeInt(mixinNames.length);
         for (int i = 0; i < mixinNames.length; i++)
         {
            out.writeString(mixinNames[i].getAsString());
         }
      }
      else
      {
         out.writeByte(SerializationConstants.NULL_DATA);
      }

      ACLWriter wr = new ACLWriter();

      AccessControlList acl = nodeData.getACL();
      if (acl != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         wr.write(out, acl);
      }
      else
      {
         out.writeByte(SerializationConstants.NULL_DATA);
      }
   }
110098
public static void writeMemento(final File resourceDir, final Resource resource,
            final Instant time) {
        try (final BufferedWriter writer = newBufferedWriter(
                        getNquadsFile(resourceDir, time).toPath(), UTF_8, CREATE, WRITE,
                        TRUNCATE_EXISTING)) {

            try (final Stream<String> quads = generateServerManaged(resource).map(FileUtils::serializeQuad)) {
                final Iterator<String> lineIter = quads.iterator();
                while (lineIter.hasNext()) {
                    writer.write(lineIter.next() + lineSeparator());
                }
            }

            try (final Stream<String> quads = resource.stream().filter(FileUtils::notServerManaged)
                    .map(FileUtils::serializeQuad)) {
                final Iterator<String> lineiter = quads.iterator();
                while (lineiter.hasNext()) {
                    writer.write(lineiter.next() + lineSeparator());
                }
            }
        } catch (final IOException ex) {
            throw new UncheckedIOException(
                            "Error writing resource version for " + resource.getIdentifier().getIRIString(), ex);
        }
    }
1202508
public static void writeXml(Serializable serializable, OutputStream output) throws IOException {
		TransportFormat.XML.writeSerializableTo(serializable, output);
	}
1214839
protected void storeTimeout(Timeout t, XMLStreamWriter writer) throws Exception
   {
      writer.writeStartElement(XML.ELEMENT_TIMEOUT);

      if (t.getBlockingTimeoutMillis() != null)
      {
         writer.writeStartElement(XML.ELEMENT_BLOCKING_TIMEOUT_MILLIS);
         writer.writeCharacters(t.getValue(XML.ELEMENT_BLOCKING_TIMEOUT_MILLIS,
                                           t.getBlockingTimeoutMillis().toString()));
         writer.writeEndElement();
      }

      if (t.getIdleTimeoutMinutes() != null)
      {
         writer.writeStartElement(XML.ELEMENT_IDLE_TIMEOUT_MINUTES);
         writer.writeCharacters(t.getValue(XML.ELEMENT_IDLE_TIMEOUT_MINUTES, t.getIdleTimeoutMinutes().toString()));
         writer.writeEndElement();
      }

      if (t.isSetTxQueryTimeout() != null && Boolean.TRUE.equals(t.isSetTxQueryTimeout()))
      {
         writer.writeEmptyElement(XML.ELEMENT_SET_TX_QUERY_TIMEOUT);
      }

      if (t.getQueryTimeout() != null)
      {
         writer.writeStartElement(XML.ELEMENT_QUERY_TIMEOUT);
         writer.writeCharacters(t.getValue(XML.ELEMENT_QUERY_TIMEOUT, t.getQueryTimeout().toString()));
         writer.writeEndElement();
      }

      if (t.getUseTryLock() != null)
      {
         writer.writeStartElement(XML.ELEMENT_USE_TRY_LOCK);
         writer.writeCharacters(t.getValue(XML.ELEMENT_USE_TRY_LOCK, t.getUseTryLock().toString()));
         writer.writeEndElement();
      }

      if (t.getAllocationRetry() != null)
      {
         writer.writeStartElement(XML.ELEMENT_ALLOCATION_RETRY);
         writer.writeCharacters(t.getValue(XML.ELEMENT_ALLOCATION_RETRY, t.getAllocationRetry().toString()));
         writer.writeEndElement();
      }

      if (t.getAllocationRetryWaitMillis() != null)
      {
         writer.writeStartElement(XML.ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS);
         writer.writeCharacters(t.getValue(XML.ELEMENT_ALLOCATION_RETRY_WAIT_MILLIS,
                                           t.getAllocationRetryWaitMillis().toString()));
         writer.writeEndElement();
      }

      if (t.getXaResourceTimeout() != null)
      {
         writer.writeStartElement(XML.ELEMENT_XA_RESOURCE_TIMEOUT);
         writer.writeCharacters(t.getValue(XML.ELEMENT_XA_RESOURCE_TIMEOUT, t.getXaResourceTimeout().toString()));
         writer.writeEndElement();
      }

      writer.writeEndElement();
   }
1235746
@Override
    public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
        context.startSubsystemElement(InfinispanSchema.CURRENT.getNamespaceUri(), false);
        ModelNode model = context.getModelNode();
        if (model.isDefined()) {
            for (Property entry: model.get(ModelKeys.CACHE_CONTAINER).asPropertyList()) {

                String containerName = entry.getName();
                ModelNode container = entry.getValue();

                writer.writeStartElement(Element.CACHE_CONTAINER.getLocalName());
                writer.writeAttribute(Attribute.NAME.getLocalName(), containerName);
                // AS7-3488 make default-cache a non required attribute
                // this.writeRequired(writer, Attribute.DEFAULT_CACHE, container, ModelKeys.DEFAULT_CACHE);
                this.writeListAsAttribute(writer, Attribute.ALIASES, container, ModelKeys.ALIASES);
                this.writeOptional(writer, Attribute.DEFAULT_CACHE, container, ModelKeys.DEFAULT_CACHE);
                this.writeOptional(writer, Attribute.JNDI_NAME, container, ModelKeys.JNDI_NAME);
                this.writeOptional(writer, Attribute.START, container, ModelKeys.START);
                this.writeOptional(writer, Attribute.MODULE, container, ModelKeys.MODULE);
                this.writeOptional(writer, Attribute.STATISTICS, container, ModelKeys.STATISTICS);

                if (container.hasDefined(ModelKeys.TRANSPORT)) {
                    writer.writeStartElement(Element.TRANSPORT.getLocalName());
                    ModelNode transport = container.get(ModelKeys.TRANSPORT, ModelKeys.TRANSPORT_NAME);
                    this.writeOptional(writer, Attribute.CHANNEL, transport, ModelKeys.CHANNEL);
                    this.writeOptional(writer, Attribute.LOCK_TIMEOUT, transport, ModelKeys.LOCK_TIMEOUT);
                    this.writeOptional(writer, Attribute.STRICT_PEER_TO_PEER, transport, ModelKeys.STRICT_PEER_TO_PEER);
                    this.writeOptional(writer, Attribute.INITIAL_CLUSTER_SIZE, transport, ModelKeys.INITIAL_CLUSTER_SIZE);
                    this.writeOptional(writer, Attribute.INITIAL_CLUSTER_TIMEOUT, transport, ModelKeys.INITIAL_CLUSTER_TIMEOUT);
                    writer.writeEndElement();
                }

                if (container.hasDefined(ModelKeys.SECURITY)) {
                    writer.writeStartElement(Element.SECURITY.getLocalName());
                    ModelNode security = container.get(ModelKeys.SECURITY, ModelKeys.SECURITY_NAME);
                    if (security.hasDefined(ModelKeys.AUTHORIZATION)) {
                        writer.writeStartElement(Element.AUTHORIZATION.getLocalName());
                        ModelNode authorization = security.get(ModelKeys.AUTHORIZATION, ModelKeys.AUTHORIZATION_NAME);
                        if (authorization.hasDefined(ModelKeys.MAPPER)) {
                            String mapper = authorization.get(ModelKeys.MAPPER).asString();
                            if (CommonNameRoleMapper.class.getName().equals(mapper)) {
                                writer.writeEmptyElement(Element.COMMON_NAME_ROLE_MAPPER.getLocalName());
                            } else if (ClusterRoleMapper.class.getName().equals(mapper)) {
                                writer.writeEmptyElement(Element.CLUSTER_ROLE_MAPPER.getLocalName());
                            } else if (IdentityRoleMapper.class.getName().equals(mapper)) {
                                writer.writeEmptyElement(Element.IDENTITY_ROLE_MAPPER.getLocalName());
                            } else {
                                writer.writeStartElement(Element.CUSTOM_ROLE_MAPPER.getLocalName());
                                writer.writeAttribute(Attribute.CLASS.getLocalName(), mapper);
                                writer.writeEndElement();
                            }
                        }

                        ModelNode roles = authorization.get(ModelKeys.ROLE);
                        if (roles.isDefined()) {
                            for (ModelNode roleNode : roles.asList()) {
                                ModelNode role = roleNode.get(0);
                                writer.writeStartElement(Element.ROLE.getLocalName());
                                AuthorizationRoleResource.NAME.marshallAsAttribute(role, writer);
                                this.writeListAsAttribute(writer, Attribute.PERMISSIONS, role, ModelKeys.PERMISSIONS);
                                writer.writeEndElement();
                            }
                        }

                        writer.writeEndElement();
                    }

                    writer.writeEndElement();
                }

                if (container.hasDefined(ModelKeys.GLOBAL_STATE)) {
                    writer.writeStartElement(Element.GLOBAL_STATE.getLocalName());
                    ModelNode globalState = container.get(ModelKeys.GLOBAL_STATE, ModelKeys.GLOBAL_STATE_NAME);
                    writeStatePathElement(Element.PERSISTENT_LOCATION, ModelKeys.PERSISTENT_LOCATION, writer, globalState);
                    writeStatePathElement(Element.SHARED_PERSISTENT_LOCATION, ModelKeys.SHARED_PERSISTENT_LOCATION, writer, globalState);
                    writeStatePathElement(Element.TEMPORARY_LOCATION, ModelKeys.TEMPORARY_LOCATION, writer, globalState);
                    if (globalState.hasDefined(ModelKeys.CONFIGURATION_STORAGE)) {
                        ConfigurationStorage configurationStorage = ConfigurationStorage.valueOf(globalState.get(ModelKeys.CONFIGURATION_STORAGE).asString());
                        switch (configurationStorage) {
                            case IMMUTABLE:
                                writer.writeEmptyElement(Element.IMMUTABLE_CONFIGURATION_STORAGE.getLocalName());
                                break;
                            case VOLATILE:
                                writer.writeEmptyElement(Element.VOLATILE_CONFIGURATION_STORAGE.getLocalName());
                                break;
                            case OVERLAY:
                                writer.writeEmptyElement(Element.OVERLAY_CONFIGURATION_STORAGE.getLocalName());
                                break;
                            case MANAGED:
                                writer.writeEmptyElement(Element.MANAGED_CONFIGURATION_STORAGE.getLocalName());
                                break;
                            case CUSTOM:
                                writer.writeStartElement(Element.CUSTOM_CONFIGURATION_STORAGE.getLocalName());
                                writer.writeAttribute(Attribute.CLASS.getLocalName(), globalState.get(ModelKeys.CONFIGURATION_STORAGE_CLASS).asString());
                                writer.writeEndElement();
                                break;
                        }
                    }
                    writer.writeEndElement();
                }

                // write any configured thread pools
                if (container.hasDefined(ThreadPoolResource.WILDCARD_PATH.getKey())) {
                    writeThreadPoolElements(Element.ASYNC_OPERATIONS_THREAD_POOL, ThreadPoolResource.ASYNC_OPERATIONS, writer, container);
                    writeScheduledThreadPoolElements(Element.EXPIRATION_THREAD_POOL, ScheduledThreadPoolResource.EXPIRATION, writer, container);
                    writeThreadPoolElements(Element.LISTENER_THREAD_POOL, ThreadPoolResource.LISTENER, writer, container);
                    writeScheduledThreadPoolElements(Element.PERSISTENCE_THREAD_POOL, ScheduledThreadPoolResource.PERSISTENCE, writer, container);
                    writeThreadPoolElements(Element.REMOTE_COMMAND_THREAD_POOL, ThreadPoolResource.REMOTE_COMMAND, writer, container);
                    writeScheduledThreadPoolElements(Element.REPLICATION_QUEUE_THREAD_POOL, ScheduledThreadPoolResource.REPLICATION_QUEUE, writer, container);
                    writeThreadPoolElements(Element.STATE_TRANSFER_THREAD_POOL, ThreadPoolResource.STATE_TRANSFER, writer, container);
                    writeThreadPoolElements(Element.TRANSPORT_THREAD_POOL, ThreadPoolResource.TRANSPORT, writer, container);
                }

                // write modules
                if (container.hasDefined(ModelKeys.MODULES)) {
                   writer.writeStartElement(Element.MODULES.getLocalName());
                   ModelNode modules = container.get(ModelKeys.MODULES, ModelKeys.MODULES_NAME, ModelKeys.MODULE);
                   for (ModelNode moduleNode : modules.asList()) {
                      if (moduleNode.isDefined()) {
                         ModelNode modelNode = moduleNode.get(0);
                         writer.writeStartElement(Element.MODULE.getLocalName());
                         writeAttribute(writer, modelNode, CacheContainerModuleResource.NAME);
                         if (modelNode.hasDefined(ModelKeys.SLOT)) {
                            writeAttribute(writer, modelNode, CacheContainerModuleResource.SLOT);
                         }
                         writer.writeEndElement();
                      }
                   }
                   writer.writeEndElement();
                }

                ModelNode configurations = container.get(ModelKeys.CONFIGURATIONS, ModelKeys.CONFIGURATIONS_NAME);

                // write any existent cache types
                processCacheConfiguration(writer, container, configurations, ModelKeys.LOCAL_CACHE);
                processCacheConfiguration(writer, container, configurations, ModelKeys.INVALIDATION_CACHE);
                processCacheConfiguration(writer, container, configurations, ModelKeys.REPLICATED_CACHE);
                processCacheConfiguration(writer, container, configurations, ModelKeys.DISTRIBUTED_CACHE);

                // counters
                processCounterConfigurations(writer, container);

                writer.writeEndElement();
            }
        }
        writer.writeEndElement();
    }
579937
private void writeCalendar(ProjectCalendar mpxj)
   {
      CalendarType xml = m_factory.createCalendarType();
      m_apibo.getCalendar().add(xml);
      String type = mpxj.getResource() == null ? "Global" : "Resource";

      xml.setBaseCalendarObjectId(getCalendarUniqueID(mpxj.getParent()));
      xml.setIsPersonal(mpxj.getResource() == null ? Boolean.FALSE : Boolean.TRUE);
      xml.setName(mpxj.getName());
      xml.setObjectId(mpxj.getUniqueID());
      xml.setType(type);

      StandardWorkWeek xmlStandardWorkWeek = m_factory.createCalendarTypeStandardWorkWeek();
      xml.setStandardWorkWeek(xmlStandardWorkWeek);

      for (Day day : EnumSet.allOf(Day.class))
      {
         StandardWorkHours xmlHours = m_factory.createCalendarTypeStandardWorkWeekStandardWorkHours();
         xmlStandardWorkWeek.getStandardWorkHours().add(xmlHours);
         xmlHours.setDayOfWeek(getDayName(day));

         for (DateRange range : mpxj.getHours(day))
         {
            WorkTimeType xmlWorkTime = m_factory.createWorkTimeType();
            xmlHours.getWorkTime().add(xmlWorkTime);

            xmlWorkTime.setStart(range.getStart());
            xmlWorkTime.setFinish(getEndTime(range.getEnd()));
         }
      }

      HolidayOrExceptions xmlExceptions = m_factory.createCalendarTypeHolidayOrExceptions();
      xml.setHolidayOrExceptions(xmlExceptions);

      if (!mpxj.getCalendarExceptions().isEmpty())
      {
         Calendar calendar = DateHelper.popCalendar();
         for (ProjectCalendarException mpxjException : mpxj.getCalendarExceptions())
         {
            calendar.setTime(mpxjException.getFromDate());
            while (calendar.getTimeInMillis() < mpxjException.getToDate().getTime())
            {
               HolidayOrException xmlException = m_factory.createCalendarTypeHolidayOrExceptionsHolidayOrException();
               xmlExceptions.getHolidayOrException().add(xmlException);

               xmlException.setDate(calendar.getTime());

               for (DateRange range : mpxjException)
               {
                  WorkTimeType xmlHours = m_factory.createWorkTimeType();
                  xmlException.getWorkTime().add(xmlHours);

                  xmlHours.setStart(range.getStart());

                  if (range.getEnd() != null)
                  {
                     xmlHours.setFinish(getEndTime(range.getEnd()));
                  }
               }
               calendar.add(Calendar.DAY_OF_YEAR, 1);
            }
         }
         DateHelper.pushCalendar(calendar);
      }
   }
77709
public <TYPE> void write(@NotNull final TYPE obj, @NotNull final File file, @NotNull final JAXBContext jaxbContext)
            throws MarshalObjectException {

        Contract.requireArgNotNull("obj", obj);
        Contract.requireArgNotNull("file", file);
        Contract.requireArgNotNull("jaxbContext", jaxbContext);

        try {
            final FileWriter fw = new FileWriter(file);
            try {
                write(obj, fw, jaxbContext);
            } finally {
                fw.close();
            }
        } catch (final IOException ex) {
            throw new MarshalObjectException("Unable to write XML to file: " + file, ex);
        }
    }
107794
private void readAssignmentExtendedAttributes(Project.Assignments.Assignment xml, ResourceAssignment mpx)
   {
      for (Project.Assignments.Assignment.ExtendedAttribute attrib : xml.getExtendedAttribute())
      {
         int xmlFieldID = Integer.parseInt(attrib.getFieldID()) & 0x0000FFFF;
         AssignmentField mpxFieldID = MPPAssignmentField.getInstance(xmlFieldID);
         TimeUnit durationFormat = DatatypeConverter.parseDurationTimeUnits(attrib.getDurationFormat(), null);
         DatatypeConverter.parseExtendedAttribute(m_projectFile, mpx, attrib.getValue(), mpxFieldID, durationFormat);
      }
   }
1265224
private void run(XmlOperation operation) throws ReportException {
        try {
            operation.run();
        } catch (XMLStreamException | IOException e) {
            throw new ReportException("Cannot write to XML report.", e);
        }
    }
1308230
private void readResource(Project.Resources.Resource xml, HashMap<BigInteger, ProjectCalendar> calendarMap)
   {
      Resource mpx = m_projectFile.addResource();

      mpx.setAccrueAt(xml.getAccrueAt());
      mpx.setActveDirectoryGUID(xml.getActiveDirectoryGUID());
      mpx.setActualCost(DatatypeConverter.parseCurrency(xml.getActualCost()));
      mpx.setActualOvertimeCost(DatatypeConverter.parseCurrency(xml.getActualOvertimeCost()));
      mpx.setActualOvertimeWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualOvertimeWork()));
      mpx.setActualOvertimeWorkProtected(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualOvertimeWorkProtected()));
      mpx.setActualWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualWork()));
      mpx.setActualWorkProtected(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualWorkProtected()));
      mpx.setACWP(DatatypeConverter.parseCurrency(xml.getACWP()));
      mpx.setAvailableFrom(xml.getAvailableFrom());
      mpx.setAvailableTo(xml.getAvailableTo());
      mpx.setBCWS(DatatypeConverter.parseCurrency(xml.getBCWS()));
      mpx.setBCWP(DatatypeConverter.parseCurrency(xml.getBCWP()));
      mpx.setBookingType(xml.getBookingType());
      //mpx.setBaseCalendar ();
      //mpx.setBaselineCost();
      //mpx.setBaselineWork();
      mpx.setBudget(BooleanHelper.getBoolean(xml.isIsBudget()));
      mpx.setCanLevel(BooleanHelper.getBoolean(xml.isCanLevel()));
      mpx.setCode(xml.getCode());
      mpx.setCost(DatatypeConverter.parseCurrency(xml.getCost()));
      mpx.setCostPerUse(DatatypeConverter.parseCurrency(xml.getCostPerUse()));
      mpx.setCostVariance(DatatypeConverter.parseCurrency(xml.getCostVariance()));
      mpx.setCreationDate(xml.getCreationDate());
      mpx.setCV(DatatypeConverter.parseCurrency(xml.getCV()));
      mpx.setEmailAddress(xml.getEmailAddress());
      mpx.setGroup(xml.getGroup());
      mpx.setGUID(xml.getGUID());
      mpx.setHyperlink(xml.getHyperlink());
      mpx.setHyperlinkAddress(xml.getHyperlinkAddress());
      mpx.setHyperlinkSubAddress(xml.getHyperlinkSubAddress());
      mpx.setID(NumberHelper.getInteger(xml.getID()));
      mpx.setInitials(xml.getInitials());
      mpx.setEnterprise(BooleanHelper.getBoolean(xml.isIsEnterprise()));
      mpx.setGeneric(BooleanHelper.getBoolean(xml.isIsGeneric()));
      mpx.setActive(!BooleanHelper.getBoolean(xml.isIsInactive()));
      mpx.setIsNull(BooleanHelper.getBoolean(xml.isIsNull()));
      //mpx.setLinkedFields();
      mpx.setMaterialLabel(xml.getMaterialLabel());
      mpx.setMaxUnits(DatatypeConverter.parseUnits(xml.getMaxUnits()));
      mpx.setName(xml.getName());
      if (xml.getNotes() != null && xml.getNotes().length() != 0)
      {
         mpx.setNotes(xml.getNotes());
      }
      mpx.setNtAccount(xml.getNTAccount());
      //mpx.setObjects();
      mpx.setOvertimeCost(DatatypeConverter.parseCurrency(xml.getOvertimeCost()));
      mpx.setOvertimeRate(DatatypeConverter.parseRate(xml.getOvertimeRate()));
      mpx.setOvertimeRateUnits(DatatypeConverter.parseTimeUnit(xml.getOvertimeRateFormat()));
      mpx.setOvertimeWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getOvertimeWork()));
      mpx.setPeakUnits(DatatypeConverter.parseUnits(xml.getPeakUnits()));
      mpx.setPercentWorkComplete(xml.getPercentWorkComplete());
      mpx.setPhonetics(xml.getPhonetics());
      mpx.setRegularWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getRegularWork()));
      mpx.setRemainingCost(DatatypeConverter.parseCurrency(xml.getRemainingCost()));
      mpx.setRemainingOvertimeCost(DatatypeConverter.parseCurrency(xml.getRemainingOvertimeCost()));
      mpx.setRemainingWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getRemainingWork()));
      mpx.setRemainingOvertimeWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getRemainingOvertimeWork()));
      mpx.setStandardRate(DatatypeConverter.parseRate(xml.getStandardRate()));
      mpx.setStandardRateUnits(DatatypeConverter.parseTimeUnit(xml.getStandardRateFormat()));
      mpx.setSV(DatatypeConverter.parseCurrency(xml.getSV()));
      mpx.setType(xml.getType());
      mpx.setUniqueID(NumberHelper.getInteger(xml.getUID()));
      mpx.setWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getWork()));
      mpx.setWorkGroup(xml.getWorkGroup());
      mpx.setWorkVariance(DatatypeConverter.parseDurationInThousanthsOfMinutes(xml.getWorkVariance()));

      if (mpx.getType() == ResourceType.MATERIAL && BooleanHelper.getBoolean(xml.isIsCostResource()))
      {
         mpx.setType(ResourceType.COST);
      }

      readResourceExtendedAttributes(xml, mpx);

      readResourceBaselines(xml, mpx);

      mpx.setResourceCalendar(calendarMap.get(xml.getCalendarUID()));

      // ensure that we cache this value
      mpx.setOverAllocated(BooleanHelper.getBoolean(xml.isOverAllocated()));

      readCostRateTables(mpx, xml.getRates());

      readAvailabilityTable(mpx, xml.getAvailabilityPeriods());

      m_eventManager.fireResourceReadEvent(mpx);
   }
798298
public void write(GroupAddress dst, int value, String scale)
		throws KNXTimeoutException, KNXFormatException, KNXLinkClosedException
	{
		final DPTXlator8BitUnsigned t = new DPTXlator8BitUnsigned(scale);
		t.setValue(value);
		write(dst, priority, t);
	}