예제 #1
0
  private static void exportTypeInformation(
      IfcModelInterface model,
      LogHandler loggerHandler,
      ArrayList<String> typeNames,
      ArrayList<String> documentNames,
      COBIEType.Documents documents) {
    String name;
    String createdBy;
    Calendar createdOn;
    String category;
    String approvalBy;
    String stage;
    String sheetName;
    String rowName;
    String directory;
    String file;
    String extSystem;
    String extObject;
    String extIdentifier;
    String description;
    String reference;
    IfcOwnerHistory oh;
    DocumentType tempDocument;
    if (documentNames.size() == 0) {
      for (IfcRelDefinesByType defByType : model.getAll(IfcRelDefinesByType.class)) {
        try {
          IfcTypeObject type = defByType.getRelatingType();
          if (type != null) {
            name = IfcToDocument.nameFromTypeObject(type);
            if (!typeNames.contains(name)) {

              oh = COBieIfcUtility.firstOwnerHistoryFromModel(model);
              createdBy = COBieIfcUtility.getEmailFromOwnerHistory(oh);
              createdOn = IfcToContact.getCreatedOn(oh.getCreationDate());
              category = IfcToDocument.categoryFromTypeObject(type);
              approvalBy = IfcToDocument.ApprovalBy;
              stage = IfcToDocument.Stage;
              sheetName = IfcToDocument.TypeSheetName;
              rowName = IfcToType.nameFromTypeObject(type);
              directory = IfcToDocument.Directory;
              file = IfcToDocument.File;
              extSystem = COBieIfcUtility.getApplicationName(oh);
              extObject = IfcToType.extObjectFromTypeObject(type);
              extIdentifier = COBieIfcUtility.extIdFromRoot(type);
              description = IfcToDocument.descriptionFromTypeObject(type);
              reference = IfcToDocument.Reference;

              tempDocument = documents.addNewDocument();
              typeNames.add(name);
              tempDocument.setName(name);
              tempDocument.setCreatedBy(createdBy);
              tempDocument.setCreatedOn(createdOn);
              tempDocument.setCategory(category);
              tempDocument.setApprovalBy(approvalBy);
              tempDocument.setStage(stage);
              tempDocument.setSheetName(sheetName);
              tempDocument.setRowName(rowName);
              tempDocument.setDirectory(directory);
              tempDocument.setFile(file);
              tempDocument.setExtSystem(extSystem);
              tempDocument.setExtObject(extObject);
              tempDocument.setExtIdentifier(extIdentifier);
              tempDocument.setDescription(description);
              tempDocument.setReference(reference);
              loggerHandler.rowWritten();
            }
          }
        } catch (Exception ex) {
          loggerHandler.error(ex);
        }
      }
    }
  }