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, HTMLDocument, 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 inherited from class 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

    public static final java.lang.String CLASS_NAME_SUFFIX

See Also:
  Constant Field Values

### DOCTYPE_HTML

    public static final java.lang.String DOCTYPE_HTML

  doctype HTMLDocument

  See Also:
    Constant Field Values

### DOCTYPE_XML

    public static final java.lang.String DOCTYPE_XML

  doctype XMLDocument

  See Also:
    Constant Field Values

### DOCTYPE_USER

    public static final java.lang.String DOCTYPE_USER

  doctype User

  See Also:
    Constant Field Values

### DOCTYPE_GROUP

    public static final java.lang.String DOCTYPE_GROUP

  doctype Group

  See Also:
    Constant Field Values

### DOCTYPE_BINARY

    public static final java.lang.String DOCTYPE_BINARY

  doctype Binary

  See Also:
    Constant Field Values

Method Detail

### setId

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

  Sets the document's id.

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

### openStream

    public java.io.InputStream openStream()
                                   throws SDXException

  Opens a stream for reading the document's content.

  Throws:
    `SDXException`

### setContent

    public void setContent(byte[] b)

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

### setContent

    public void setContent(java.io.File f)

  Sets the content from a file.

### setContent

    public void setContent(java.net.URL r)

  Sets the content from a URL.

### setContent

    public void setContent(java.io.InputStream is)

  Sets the content from an InputStream.

### save

    public void save(Repository r)
              throws SDXException

  Saves the document within a repository.

  Throws:
    `SDXException`

### getLength

    public int getLength()

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

### getPreferredFilename

    public java.lang.String getPreferredFilename()

  Returns a preferred filename for this document.

### getURL

    public java.net.URL getURL()
                        throws SDXException

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

  Throws:
    `SDXException`

### setURL

    public void setURL(java.net.URL url)

  Sets the URL of this document.

### getMimeType

    public java.lang.String getMimeType()

  Returns the mimeType field (A String) for this document

### setMimeType

    public void setMimeType(java.lang.String mimeType)

  Sets the mime type for the document

### getDocType

    public java.lang.String getDocType()

  Gets the docType for the document

### setPreferredFilename

    public void setPreferredFilename(java.lang.String filename)

  Sets the preferred filename for this document.

### setIdGenerator

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

### setIdGenerator

    public void setIdGenerator(IDGenerator idGen)

### getRepositoryForStorage

    public java.lang.String getRepositoryForStorage()

### setRepositoryForStorage

    public 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-2003 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.