Bug 24015 - Missing records in RecordFactory and EventRecordFactory static Class[]
Summary: Missing records in RecordFactory and EventRecordFactory static Class[]
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre3
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2003-10-22 17:50 UTC by Robert Flaherty
Modified: 2008-05-05 19:53 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Robert Flaherty 2003-10-22 17:50:56 UTC
- Related to my post #23631 about PaneRecord missing from both.
- In addition, RecalcIdRecord is missing from EventRecordFactory.
- Both are missing many others (not sure if this is intentional).  Would we be 
better served changing the static block of code in say RecordFactory to use 
reflection to get all *Record.class files in org.apache.poi.hssf.record and 
eliminate Record and UnknownRecord.  Then expose the static Class[] with a 
getter for EventRecordFactory.  Anyway, here's the list:
[       ]BackupRecord
[       ]BlankRecord
[       ]BOFRecord
[       ]BookBoolRecord
[       ]BoolErrRecord
[       ]BottomMarginRecord
[       ]BoundSheetRecord
[       ]CalcCountRecord
[       ]CalcModeRecord
[       ]CodepageRecord
[       ]ColumnInfoRecord
[       ]ContinueRecord
[       ]CountryRecord
[       ]DateWindow1904Record
[       ]DBCellRecord
[       ]DefaultColWidthRecord
[       ]DefaultRowHeightRecord
[       ]DeltaRecord
[       ]DimensionsRecord
[       ]DSFRecord
[       ]EOFRecord
[       ]ExtendedFormatRecord
[       ]ExternSheetRecord
[       ]ExtSSTRecord
[       ]FnGroupCountRecord
[       ]FontRecord
[       ]FooterRecord
[       ]FormatRecord
[       ]FormulaRecord
[       ]GridsetRecord
[       ]GutsRecord
[       ]HCenterRecord
[       ]HeaderRecord
[       ]HideObjRecord
[       ]IndexRecord
[       ]InterfaceEndRecord
[       ]InterfaceHdrRecord
[       ]IterationRecord
[       ]LabelRecord
[       ]LabelSSTRecord
[       ]LeftMarginRecord
[       ]MergeCellsRecord
[       ]MMSRecord
[       ]MulBlankRecord
[       ]MulRKRecord
[       ]NameRecord
[       ]NumberRecord
[       ]PaletteRecord
[       ]PasswordRecord
[       ]PasswordRev4Record
[       ]PrecisionRecord
[       ]PrintGridlinesRecord
[       ]PrintHeadersRecord
[       ]PrintSetupRecord
[       ]ProtectionRev4Record
[       ]ProtectRecord
[       ]RecalcIdRecord
[       ]RefModeRecord
[       ]RefreshAllRecord
[       ]RightMarginRecord
[       ]RKRecord
[       ]RowRecord
[       ]SaveRecalcRecord
[       ]SelectionRecord
[       ]SharedFormulaRecord
[       ]SSTRecord
[       ]StringRecord
[       ]StyleRecord
[       ]TabIdRecord
[       ]TopMarginRecord
[       ]UseSelFSRecord
[       ]VCenterRecord
[       ]WindowOneRecord
[       ]WindowProtectRecord
[       ]WindowTwoRecord
[       ]WriteAccessRecord
[       ]WSBoolRecord
Comment 1 Jason Height 2003-10-22 22:08:55 UTC
Hi Robert,

In so far as eliminating UnknownRecord, this record is actually quite useful
when debugging and extending HSSF with newer record types. There are some
records that we simply dont implement. This may be due to the fact that i use
Excel XP here at work and it has introduced new record types that we dont
support, or there are records that we have chosed not to support.

Now just scanning your list the missing records seem to mainly be chart records.
Some such as ExtSSTInfoSubRecord are actually not really true excel records but
have been implemented that way.

However, Is anyone actively working on charts? Can we add these records to be
read/written in the head. 

Unless someone beats me to it, i will have a look at the non-graph records that
you mention.

Everyone: I assume that there is no reason why the non graph records havent been
added to the factory?

Comment 2 Robert Flaherty 2003-10-23 03:11:14 UTC
Jason, I wasn't suggesting that we remove the UnknownRecord class itself, just 
that if we use reflection to enumerate all of the record classes to use in the 
factory, we should special case Record and UnknownRecord and not add them to 
the list b/c we'll never get a record read in from the stream for them (Record 
has no sid, and UnknownRecord has a 0 sid); UnknownRecord is created as a 
catch all.  What do you think about using reflection to prevent further 
missing classes?
Comment 3 Josh Micich 2008-05-05 19:53:32 UTC
Automatically generating the list of Record classes to be served by EventRecordFactory won't work at the moment, because there are some records which must not be created directly (this was discovered while working on bug 44894).

The first step will be to remove all old code from RecordFactory and use EventRecordFactory alone. 

There might still be ways to improve the management of the record classes list.