コード例 #1
0
 protected static String sheetNameFromRelAssociatesDocument(
     IfcRelAssociatesDocument relAssociatesDocument) {
   String sheetName = "";
   if ((relAssociatesDocument.getRelatedObjects() != null)
       && (relAssociatesDocument.getRelatedObjects().size() > 0)) {
     sheetName = sheetNameFromRoot(relAssociatesDocument.getRelatedObjects().get(0));
   }
   return COBieUtility.getCOBieString(sheetName);
 }
コード例 #2
0
 protected static String extIdFromRelAssociatesDocument(
     IfcRelAssociatesDocument relAssociatesDocument) {
   String extId = "";
   if ((relAssociatesDocument.getRelatedObjects() != null)
       && (relAssociatesDocument.getRelatedObjects().size() > 0)) {
     extId = COBieIfcUtility.extIdFromRoot(relAssociatesDocument.getRelatedObjects().get(0));
   }
   return COBieUtility.getCOBieString(extId);
 }
コード例 #3
0
 protected static String extObjectFromRelAssociatesDocument(
     IfcRelAssociatesDocument relAssociatesDocument) {
   String extObject = "";
   if ((relAssociatesDocument.getRelatedObjects() != null)
       && (relAssociatesDocument.getRelatedObjects().size() > 0)) {
     extObject = relAssociatesDocument.getRelatedObjects().get(0).getClass().getSimpleName();
   }
   extObject = COBieUtility.trimImplFromClassNameString(extObject);
   return COBieUtility.getCOBieString(extObject);
 }
コード例 #4
0
  private static void exportDocumentInformationObjects(
      IfcModelInterface model,
      LogHandler loggerHandler,
      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;
    for (IfcRelAssociatesDocument relAssociatesDocument :
        model.getAll(IfcRelAssociatesDocument.class)) {
      IfcDocumentSelect docInfoSelect = relAssociatesDocument.getRelatingDocument();
      if (docInfoSelect instanceof IfcDocumentInformation) {
        IfcDocumentInformation docInfo = (IfcDocumentInformation) docInfoSelect;
        try {

          name = IfcToDocument.nameFromDocumentInformation(docInfo);
          oh = relAssociatesDocument.getOwnerHistory();
          createdBy = COBieIfcUtility.getEmailFromOwnerHistory(oh);
          createdOn = IfcToContact.getCreatedOn(oh.getCreationDate());
          category = IfcToDocument.categoryFromDocumentInformation(docInfo);
          approvalBy = IfcToDocument.approvalByFromDocumentInformation(docInfo);
          stage = IfcToDocument.stageFromDocumentInformation(docInfo);
          sheetName = IfcToDocument.sheetNameFromRelAssociatesDocument(relAssociatesDocument);
          rowName = IfcToDocument.rowNameFromRelAssociatesDocument(relAssociatesDocument);
          directory = IfcToDocument.directoryFromDocumentInformation(docInfo);
          file = IfcToDocument.fileFromDocumentInformation(docInfo);
          extSystem = COBieIfcUtility.getApplicationName(oh);
          extObject = IfcToDocument.extObjectFromRelAssociatesDocument(relAssociatesDocument);
          extIdentifier = IfcToDocument.extIdFromRelAssociatesDocument(relAssociatesDocument);
          description = IfcToDocument.descriptionFromDocumentInformation(docInfo);
          reference = IfcToDocument.referenceFromDocumentInformation(docInfo);

          tempDocument = documents.addNewDocument();
          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.setExtIdentifier(extIdentifier);
          tempDocument.setExtObject(extObject);
          tempDocument.setDescription(description);
          tempDocument.setReference(reference);
          documentNames.add(name);
          loggerHandler.rowWritten();
        } catch (Exception ex) {
          loggerHandler.error(ex);
        }
      }
    }
  }