Class GeoGebraParser
- All Implemented Interfaces:
Serializable,SelfConfiguring,Parser
The construction metadata (title, author, date) and the application
name/version are read from geogebra.xml (or, for a tool, from
geogebra_macro.xml), and the user-visible text (text objects, inline
text, captions, tool names and help) is emitted as XHTML paragraphs. For
Notes/Slides, each _slideN/geogebra.xml becomes a
<div class="slide">, in the order given by structure.json.
The representative rendering of the document, geogebra_thumbnail.png
at the root of a worksheet, the icon of a tool (iconFile of its
macro), or the first available slide thumbnail
of a Notes/Slides file, is emitted as an embedded document marked with
TikaCoreProperties.EmbeddedResourceType.THUMBNAIL, so that clients
(e.g. the unpacker's sidecar metadata) can pick it as the preview image.
Thumbnails of the remaining slides are renderings of content that is already
extracted, so they are skipped. The document script
geogebra_javascript.js is emitted as a
TikaCoreProperties.EmbeddedResourceType.MACRO, and any other
embedded file (e.g. inserted pictures) as an embedded document.
A part that cannot be read (an unsupported zip entry, malformed XML) is recorded in the metadata and skipped; the remaining parts are still parsed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyThe GeoGebra application flavor the file was written with, e.g.static final PropertyThe GeoGebra application version the file was written with.static final PropertyThe free-form date string of the construction.static final PropertyThe GeoGebra XML format version.static final Stringstatic final PropertyThe unique id GeoGebra assigns to the document.static final PropertyThe tool names of the macros in a tool file (or in a worksheet with embedded macros). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSupportedTypes(ParseContext context) Returns the set of media types supported by this parser when used with the given parse context.voidparse(TikaInputStream tis, ContentHandler handler, Metadata metadata, ParseContext context) Parses a document stream into a sequence of XHTML SAX events.
-
Field Details
-
GEOGEBRA_PREFIX
- See Also:
-
APP_NAME
The GeoGebra application flavor the file was written with, e.g. "classic", "notes", "graphing". -
APP_VERSION
The GeoGebra application version the file was written with. -
FORMAT_VERSION
The GeoGebra XML format version. -
ID
The unique id GeoGebra assigns to the document. -
DATE
The free-form date string of the construction. This is user-entered text, not necessarily a parseable date. -
TOOL_NAME
The tool names of the macros in a tool file (or in a worksheet with embedded macros). The name is thetoolNameattribute of the macro element.
-
-
Constructor Details
-
GeoGebraParser
public GeoGebraParser()
-
-
Method Details
-
getSupportedTypes
Description copied from interface:ParserReturns the set of media types supported by this parser when used with the given parse context.- Specified by:
getSupportedTypesin interfaceParser- Parameters:
context- parse context- Returns:
- immutable set of media types
-
parse
public void parse(TikaInputStream tis, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException Description copied from interface:ParserParses a document stream into a sequence of XHTML SAX events. Fills in related document metadata in the given metadata object.The given document stream is consumed but not closed by this method. The responsibility to close the stream remains on the caller.
Information about the parsing context can be passed in the context parameter. See the parser implementations for the kinds of context information they expect.
- Specified by:
parsein interfaceParser- Parameters:
handler- handler for the XHTML SAX events (output)metadata- document metadata (input and output)context- parse context- Throws:
IOException- if the document stream could not be readSAXException- if the SAX events could not be processedTikaException- if the document could not be parsed
-