Package net.sf.mpxj.mspdi.schema

Examples of net.sf.mpxj.mspdi.schema.TimephasedDataType


    */
   private void writeAssignmentTimephasedData(BigInteger assignmentID, List<TimephasedDataType> list, List<TimephasedWork> data, int type)
   {
      for (TimephasedWork mpx : data)
      {
         TimephasedDataType xml = m_factory.createTimephasedDataType();
         list.add(xml);

         xml.setStart(DatatypeConverter.printDate(mpx.getStart()));
         xml.setFinish(DatatypeConverter.printDate(mpx.getFinish()));
         xml.setType(BigInteger.valueOf(type));
         xml.setUID(assignmentID);
         xml.setUnit(DatatypeConverter.printDurationTimeUnits(mpx.getTotalAmount(), false));
         xml.setValue(DatatypeConverter.printDuration(this, mpx.getTotalAmount()));
      }
   }
View Full Code Here


   * @see org.apache.commons.collections.Closure#execute(java.lang.Object)
   */
  public void execute(Object arg0) {
    if (!consumer.acceptValue(functor.getValue())) return; //hack LC
   
    TimephasedDataType timephasedDataType;
    //try {
      timephasedDataType = factory.createTimephasedDataType();
//    } catch (JAXBException e) {
//      e.printStackTrace();
//      return;
//    }
    timephasedDataType.setType(this.type);
    timephasedDataType.setUID(this.id);
//    System.out.println("Id is " + id);

    timephasedDataType.setUnit(BigInteger.valueOf(3L));
    HasStartAndEnd interval = (HasStartAndEnd)arg0;
    Calendar startCal = DateTime.calendarInstance();
    startCal.setTimeInMillis(DateTime.fromGmt(interval.getStart())); // for 2007, convert from gmt
    Calendar endCal = DateTime.calendarInstance();
    endCal.setTimeInMillis(DateTime.fromGmt(interval.getEnd())); // for 2007, convert from gmt
    timephasedDataType.setStart(startCal);
    timephasedDataType.setFinish(endCal);
    double v = functor.getValue() / WorkCalendar.MILLIS_IN_HOUR;
    net.sf.mpxj.Duration d = net.sf.mpxj.Duration.getInstance(v,TimeUnit.HOURS);
    XsdDuration xsdDuration = new XsdDuration(d);
    timephasedDataType.setValue(xsdDuration.toString());
    consumer.consumeTimephased(timephasedDataType);
  }
View Full Code Here

    final Assignment projityAssignment = (Assignment) projityAssignmentMap.get(mpx);
    // baselines
    final List timephasedList = xml.getTimephasedData();
    TimephasedService.getInstance().consumeTimephased(projityAssignment, new TimephasedConsumer() {
      public void consumeTimephased(Object timephased) {
        TimephasedDataType t=(TimephasedDataType) timephased;
        //if ("PT0H0M0S".equals(t.getValue())) return;
        ((TimephasedDataType) timephased).setUID(xml.getUID());
        timephasedList.add(timephased);
      }
      public boolean acceptValue(double value) { //TODO hack, consumeTimephased shouldn't give PT0H0M0S
View Full Code Here

TOP

Related Classes of net.sf.mpxj.mspdi.schema.TimephasedDataType

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.