psdi.app.bim.parser.cobie

Class BIMProjectParser

  • java.lang.Object
    • psdi.app.bim.parser.cobie.BIMProjectParser
  • All Implemented Interfaces:
    Parser


    public class BIMProjectParser
    extends java.lang.Object
    implements Parser
    • Field Detail

      • _pageNames

        public static final java.lang.String[] _pageNames
        List of supported COBie Sheet names in the order to be processed
    • Constructor Detail

      • BIMProjectParser

        public BIMProjectParser(long flags)
      • BIMProjectParser

        public BIMProjectParser(IdFactory idFactory,
                                MessageLogger logger,
                                java.util.Locale locale,
                                long flags)
    • Method Detail

      • addConvertedField

        public void addConvertedField(java.lang.String tableName,
                                      java.lang.String fieldName,
                                      java.lang.String attributeName)
        Fields in this list are converted to COBie attributes instead of treated as standard parts of the COBie table. Use of this mechanism should Normally be restricted to the green optional columns
        Specified by:
        addConvertedField in interface Parser
        Parameters:
        tableName -
        fieldName -
        attributeName - COBie attribute name to which the field is converted
      • getConvertedField

        public java.lang.String getConvertedField(java.lang.String tableName,
                                                  java.lang.String fieldName)
        Specified by:
        getConvertedField in interface Parser
      • addFile

        public void addFile(InputFile cobieFile)
                     throws ParseException
        Specify the file name for a single sheet from a COBie spread sheet to loading
        Parameters:
        fileName -
        sheetName -
        Throws:
        ParseException
      • addSkippedSpace

        public void addSkippedSpace(java.lang.String spaceName)
        Description copied from interface: Parser
        The parser tracks all spaces that are skipped so that things that reference a skipped space can also be skipped
        Specified by:
        addSkippedSpace in interface Parser
        Parameters:
        spaceName - Name of the skipped pace;
      • isSpaceSkipped

        public boolean isSpaceSkipped(java.lang.String spaceName)
        Description copied from interface: Parser
        Test if spaceName is in the skipped spaces list
        Specified by:
        isSpaceSkipped in interface Parser
        Returns:
      • addFilter

        public void addFilter(Filter filter)
      • filters

        public java.util.Iterator filters()
        Description copied from interface: Parser
        List of filters to restrict value on input.
        Specified by:
        filters in interface Parser
        Returns:
      • execute

        public void execute()
      • deleteFiles

        public void deleteFiles(java.lang.String workingDirRoot)
      • addPage

        public void addPage(Page page)
      • clenup

        public void clenup()
      • parseFile

        protected void parseFile(java.lang.String sheetName)
        Find any instance of the requested sheet (Maybe more than one) and load into the parser
        Parameters:
        sheetName -
      • findAttributeType

        protected ItemAttributeType findAttributeType(java.lang.String name)
        Lookup the attribute type record by name;
        Parameters:
        name -
        Returns:
      • resolveReferences

        public void resolveReferences()
        Walk the parse tree and call resolve reference on every item found Must be called after all data is loaded.
      • categoryFromAttribute

        public void categoryFromAttribute(java.lang.String omniClassAttribute)
        Populate the COBie category field from the specified attribute
        Parameters:
        omniClassAttribute -
      • spacesFromAttribute

        public void spacesFromAttribute(java.lang.String spaceAttrib)
      • levelsFromAttribute

        public void levelsFromAttribute(java.lang.String levelAttrib)
      • areaFromAttribute

        public void areaFromAttribute(java.lang.String areaAttribute)
      • perimeterFromAttribute

        public void perimeterFromAttribute(java.lang.String perimeterAttribute)
      • systemsFromAttribute

        public void systemsFromAttribute(java.lang.String systemNameAttrib)
      • associateCategoriesWithAttributeTypes

        public void associateCategoriesWithAttributeTypes(java.lang.String[] pageList)
      • getValueList

        public ItemValueList getValueList(java.util.HashSet valueSet)
      • extractAttributeTypes

        protected void extractAttributeTypes()
      • consolidateComponetAttribsOnType

        protected void consolidateComponetAttribsOnType()
      • extractCompanies

        protected void extractCompanies()
      • caculateItemCount

        public void caculateItemCount()
      • getPage

        public Page getPage(java.lang.String pageName)
        Specified by:
        getPage in interface Parser
      • getItem

        public Item getItem(java.lang.String pageName,
                            java.lang.String key)
        Description copied from interface: Parser
        Retrieves an item from the parse tree
        Specified by:
        getItem in interface Parser
        Returns:
      • getAttributeType

        public ItemAttributeType getAttributeType(java.lang.String typeName)
      • convertCase

        public java.lang.String convertCase(java.lang.String s)
        Provides a centralized place to control if the parser is case sensitive. Only partially implemented.
        Specified by:
        convertCase in interface Parser
        Parameters:
        s -
        Returns:
      • getLocale

        public java.util.Locale getLocale()
        Specified by:
        getLocale in interface Parser
      • getItemCount

        public int getItemCount()
        Description copied from interface: Parser
        This is set by resolveReferences, and is used to show a % complete
        Specified by:
        getItemCount in interface Parser
        Returns:
        The total number of items loaded by the parser
      • getVendorAttribute

        public java.lang.String getVendorAttribute()
        Description copied from interface: Parser
        An attribute name can be specified for components that has company reference for the supplier/vendor of the component. The reference is to the company name not the contact email
        Specified by:
        getVendorAttribute in interface Parser
        Returns:
      • printPage

        public void printPage(Page page)
      • printAll

        public void printAll()
      • setVendorAttribute

        public void setVendorAttribute(java.lang.String vendorAttribute)
      • export

        public void export(java.lang.String fileName,
                           java.lang.String[] pageList,
                           java.io.InputStream templateStream,
                           ExportProgressTracker tracker,
                           Exporter.ExportFormat fileFormat)
        Description copied from interface: Parser
        Parsers should implement this method to support export functionality
        Specified by:
        export in interface Parser
        Parameters:
        fileName - Name of export file
        pageList - List of pages to export
        templateStream - JSOM configuration object describing excel formating
        tracker - Progress tracker
        fileFormat - Export file format xls or xlsx
      • messageFromException

        public static java.lang.String messageFromException(java.lang.Throwable t)
      • main

        public static void main(java.lang.String[] args)