Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## fr.gouv.culture.sdx.document
Interface Document

All Superinterfaces:
  org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, Describable, Encodable, Identifiable, Localizable, org.apache.avalon.framework.logger.LogEnabled, SdxObject, org.apache.avalon.framework.service.Serviceable, org.apache.excalibur.xml.sax.XMLizable

All Known Subinterfaces:
  Concept, Identity, IndexableDocument, ParsableDocument

All Known Implementing Classes:
  AbstractConcept, AbstractDocument, AbstractIdentity, AbstractIndexableDocument, BinaryDocument, Group, HTMLDocument, LuceneConcept, OAIDocument, User, XMLDocument

    public interface Document

extends SdxObject

A document that can be managed by SDX.

SDX is mainly a search engine for XML documents, but these documents can be linked with other documents or they may not be in XML at first. That's why we abstracted the concept of documents with this interface.

Nested Class Summary

Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject
`SdxObject.ConfigurationNode`

Field Summary
`static java.lang.String` | `CLASS_NAME_SUFFIX`
`static java.lang.String` | `DOCTYPE_BINARY` doctype Binary
`static java.lang.String` | `DOCTYPE_GROUP` doctype Group
`static java.lang.String` | `DOCTYPE_HTML` doctype HTMLDocument
`static java.lang.String` | `DOCTYPE_USER` doctype User
`static java.lang.String` | `DOCTYPE_XML` doctype XMLDocument

Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable
`DEFAULT_ENCODING`

Method Summary
`java.lang.String` | `getDocType()` Gets the docType for the document
`int` | `getLength()` Returns the length of the document (-1 if length can't be known).
`java.lang.String` | `getMimeType()` Returns the mimeType field (A String) for this document
`java.lang.String` | `getPreferredFilename()` Returns a preferred filename for this document.
`java.lang.String` | `getRepositoryForStorage()`
`java.net.URL` | `getURL()` Returns a URL for this document, null if no URL can be given.
`java.io.InputStream` | `openStream()` Opens a stream for reading the document's content.
`void` | `save(Repository r)` Saves the document within a repository.
`void` | `setContent(byte[] b)` Sets the content from a memory representation of the raw data.
`void` | `setContent(java.io.File f)` Sets the content from a file.
`void` | `setContent(java.io.InputStream is)` Sets the content from an InputStream.
`void` | `setContent(java.net.URL r)` Sets the content from a URL.
`void` | `setId(java.lang.String id)` Sets the document's id.
`void` | `setIdGenerator(IDGenerator idGen)`
`void` | `setIdGenerator(IDGenerator idGen, java.lang.String idPrefix, java.lang.String idSuffix)`
`void` | `setMimeType(java.lang.String mimeType)` Sets the mime type for the document
`void` | `setPreferredFilename(java.lang.String filename)` Sets the preferred filename for this document.
`void` | `setRepositoryForStorage(java.lang.String repoId)` Sets the id of the repository in which the document should be stored
`void` | `setURL(java.net.URL url)` Sets the URL of this document.

Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject
`getLog`

Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled
`enableLogging`

Methods inherited from interface org.apache.avalon.framework.context.Contextualizable
`contextualize`

Methods inherited from interface org.apache.avalon.framework.service.Serviceable
`service`

Methods inherited from interface org.apache.avalon.framework.configuration.Configurable
`configure`

Methods inherited from interface fr.gouv.culture.sdx.utils.Identifiable
`getId`

Methods inherited from interface fr.gouv.culture.sdx.utils.Describable
`getDescription, setDescription`

Methods inherited from interface fr.gouv.culture.sdx.utils.Encodable
`getEncoding, setEncoding`

Methods inherited from interface fr.gouv.culture.sdx.utils.Localizable
`getLocale, getXmlLang, setLocale, setXmlLang`

Methods inherited from interface org.apache.excalibur.xml.sax.XMLizable
`toSAX`

Field Detail

### CLASS_NAME_SUFFIX

    static final java.lang.String CLASS_NAME_SUFFIX

See Also:
  Constant Field Values

### DOCTYPE_HTML

    static final java.lang.String DOCTYPE_HTML

  doctype HTMLDocument

  See Also:
    Constant Field Values

### DOCTYPE_XML

    static final java.lang.String DOCTYPE_XML

  doctype XMLDocument

  See Also:
    Constant Field Values

### DOCTYPE_USER

    static final java.lang.String DOCTYPE_USER

  doctype User

  See Also:
    Constant Field Values

### DOCTYPE_GROUP

    static final java.lang.String DOCTYPE_GROUP

  doctype Group

  See Also:
    Constant Field Values

### DOCTYPE_BINARY

    static final java.lang.String DOCTYPE_BINARY

  doctype Binary

  See Also:
    Constant Field Values

Method Detail

### setId

    void setId(java.lang.String id)
               throws SDXException

  Sets the document's id.

  Specified by:
    `setId` in interface `Identifiable`
  Throws:
    `SDXException`

### openStream

    java.io.InputStream openStream()
                                   throws SDXException

  Opens a stream for reading the document's content.

  Throws:
    `SDXException`

### setContent

    void setContent(byte[] b)

  Sets the content from a memory representation of the raw data.

### setContent

    void setContent(java.io.File f)

  Sets the content from a file.

### setContent

    void setContent(java.net.URL r)

  Sets the content from a URL.

### setContent

    void setContent(java.io.InputStream is)

  Sets the content from an InputStream.

### save

    void save(Repository r)
              throws SDXException

  Saves the document within a repository.

  Throws:
    `SDXException`

### getLength

    int getLength()

  Returns the length of the document (-1 if length can't be known).

### getPreferredFilename

    java.lang.String getPreferredFilename()

  Returns a preferred filename for this document.

### getURL

    java.net.URL getURL()
                        throws SDXException

  Returns a URL for this document, null if no URL can be given.

  Throws:
    `SDXException`

### setURL

    void setURL(java.net.URL url)

  Sets the URL of this document.

### getMimeType

    java.lang.String getMimeType()

  Returns the mimeType field (A String) for this document

### setMimeType

    void setMimeType(java.lang.String mimeType)

  Sets the mime type for the document

### getDocType

    java.lang.String getDocType()

  Gets the docType for the document

### setPreferredFilename

    void setPreferredFilename(java.lang.String filename)

  Sets the preferred filename for this document.

### setIdGenerator

    void setIdGenerator(IDGenerator idGen,
                        java.lang.String idPrefix,
                        java.lang.String idSuffix)

### setIdGenerator

    void setIdGenerator(IDGenerator idGen)

### getRepositoryForStorage

    java.lang.String getRepositoryForStorage()

### setRepositoryForStorage

    void setRepositoryForStorage(java.lang.String repoId)

  Sets the id of the repository in which the document should be stored

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.