コード例 #1
0
  @Override
  public TechnicalInterventionRequest clone() {
    TechnicalInterventionRequest clone =
        new TechnicalInterventionRequest(
            getRequestData().clone(), technicalInterventionRequestData.clone());
    Map<String, Object> stepState;

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "uncomplete");
    stepState.put("required", true);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("intervention", stepState);

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "unavailable");
    stepState.put("required", false);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("document", stepState);

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "unavailable");
    stepState.put("required", true);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("validation", stepState);

    return clone;
  }
コード例 #2
0
  public static TechnicalInterventionRequest xmlToModel(
      TechnicalInterventionRequestDocument technicalInterventionRequestDoc) {
    TechnicalInterventionRequestDocument.TechnicalInterventionRequest
        technicalInterventionRequestXml =
            technicalInterventionRequestDoc.getTechnicalInterventionRequest();
    Calendar calendar = Calendar.getInstance();
    LocalTime localTime = new LocalTime();
    List list = new ArrayList();
    TechnicalInterventionRequest technicalInterventionRequest = new TechnicalInterventionRequest();
    technicalInterventionRequest.fillCommonModelInfo(
        technicalInterventionRequest, technicalInterventionRequestXml);

    technicalInterventionRequest.setInterventionDescription(
        technicalInterventionRequestXml.getInterventionDescription());

    if (technicalInterventionRequestXml.getInterventionPlace() != null)
      technicalInterventionRequest.setInterventionPlace(
          Address.xmlToModel(technicalInterventionRequestXml.getInterventionPlace()));

    List<fr.cg95.cvq.business.request.LocalReferentialData> interventionTypeList =
        new ArrayList<fr.cg95.cvq.business.request.LocalReferentialData>(
            technicalInterventionRequestXml.sizeOfInterventionTypeArray());
    for (LocalReferentialDataType object :
        technicalInterventionRequestXml.getInterventionTypeArray()) {
      interventionTypeList.add(
          fr.cg95.cvq.business.request.LocalReferentialData.xmlToModel(object));
    }
    technicalInterventionRequest.setInterventionType(interventionTypeList);

    technicalInterventionRequest.setOtherInterventionLabel(
        technicalInterventionRequestXml.getOtherInterventionLabel());

    return technicalInterventionRequest;
  }