com.facetmap.format.excel
Class ExcelFacetmapFactory
java.lang.Object
com.facetmap.format.excel.ExcelFacetmapFactory
public class ExcelFacetmapFactory
- extends java.lang.Object
Generates a Facetmap object from data in an Excel spreadsheet. Each
column (except as specially marked, below) is treated as a Facet, and
the entries in each column comprise that Facet's Headings. The type
of entries in a column determine whether that column is a TaxonomyFacet,
a SpectrumFacet, or a DateFacet. Each row in the spreadsheet (except
the top row) represents a Resource.
Only the first worksheet in the Excel file is used. The top row of
the worksheet specifies the title of each Facet. The default behavior
is to treat each column as a facet, but that can be overridden per column
by input properties -- you can set a column to be any of the following:
- "title" = use this column for the Resource title
- "location" = use this column for the Resource location
- "ignore" = ignore this column
- "facet" = use this column as a facet (default behavior)
Columns are identified as properties by prepending
"com.facetmap.sourceTable.column." to their title (remember, the column's
title is specified by the top row in the worksheet. For example:
com.facetmap.sourceTable.column.Name=title
com.facetmap.sourceTable.column.Notes=ignore
Some Facetmap features cannot be expressed in the grid style of Excel, so
they are not supported by this factory. Namely: Headings cannot be arranged
in a hierarchy, so all a Facet's Headings will be forward headings of the
Facet's root heading. And CompoundHeadingFacet is never used, since only
one value can exist at the intersection of row and column.
|
Method Summary |
Facetmap |
getFacetmapFromExcelStream(java.io.InputStream inStream,
java.util.Properties props)
|
static void |
main(java.lang.String[] argv)
Parses the Excel file specified as first argument, and writes equivalent
Facetmap XML to standard out. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COLUMN_FACET
public static final java.lang.String COLUMN_FACET
- See Also:
- Constant Field Values
COLUMN_TITLE
public static final java.lang.String COLUMN_TITLE
- See Also:
- Constant Field Values
COLUMN_LOCATION
public static final java.lang.String COLUMN_LOCATION
- See Also:
- Constant Field Values
COLUMN_IGNORE
public static final java.lang.String COLUMN_IGNORE
- See Also:
- Constant Field Values
ExcelFacetmapFactory
public ExcelFacetmapFactory()
getFacetmapFromExcelStream
public Facetmap getFacetmapFromExcelStream(java.io.InputStream inStream,
java.util.Properties props)
throws DataException,
java.io.IOException
- Throws:
DataException
java.io.IOException
main
public static void main(java.lang.String[] argv)
throws java.io.IOException,
DataException,
InternalException
- Parses the Excel file specified as first argument, and writes equivalent
Facetmap XML to standard out. Properties (column descriptions, license
file, etc.) must be specified as system properties. For example:
java -Dcom.facetmap.licenseFile=./license.txt
-Dcom.facetmap.sourceTable.column.Name=title
com.facetmap.format.excel.ExcelFacetmapFactory records.xls
> record-facetmap.xml
- Throws:
java.io.IOException
DataException
InternalException