org.obe.spi.service
Interface ResourceRepository

All Superinterfaces:
org.xml.sax.EntityResolver, javax.xml.transform.URIResolver, WorkflowService

public interface ResourceRepository
extends WorkflowService, org.xml.sax.EntityResolver, javax.xml.transform.URIResolver

A repository for XML documents, schemas, DTDs, transforms and templates. The repository can also be used as a SAX EntityResolver.

Author:
Adrian Price

Field Summary
static java.lang.String DTD
          Type key for XML Document Type Definitions.
static java.lang.String SERVICE_NAME
           
static java.lang.String VM
          Type key for Velocity templates.
static java.lang.String WSDL
          Type key for Web Services Description Language.
static java.lang.String XML
          Type key for XML document instances.
static java.lang.String XSD
          Type key for XML Schemas.
static java.lang.String XSL
          Type key for XML Stylesheets and Transformations.
 
Method Summary
 void createEntity(ResourceMetaData entity)
          Registers an XML entity.
 void deleteEntity(java.lang.String id)
          Unregisters an XML entity.
 java.io.InputStream findEntity(java.lang.String id)
          Opens an XML entity for reading.
 ResourceMetaData[] findXMLMetaData(boolean includeContent)
          Finds meta-data for all entities.
 ResourceMetaData findXMLMetaData(java.lang.String id, boolean includeContent)
          Finds meta-data for an XML entity.
 ResourceMetaData findXMLType(java.lang.String type, java.lang.String locale)
          Returns information about the specified XML type.
 ResourceMetaData[] findXMLTypes(java.lang.String locale)
          Finds all entity types known to the repository.
 void updateEntity(ResourceMetaData entity)
          Updates an XML entity.
 
Methods inherited from interface org.obe.spi.WorkflowService
exit, getServiceManager, getServiceName, init
 
Methods inherited from interface org.xml.sax.EntityResolver
resolveEntity
 
Methods inherited from interface javax.xml.transform.URIResolver
resolve
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
See Also:
Constant Field Values

XML

public static final java.lang.String XML
Type key for XML document instances.

See Also:
Constant Field Values

DTD

public static final java.lang.String DTD
Type key for XML Document Type Definitions.

See Also:
Constant Field Values

XSD

public static final java.lang.String XSD
Type key for XML Schemas.

See Also:
Constant Field Values

XSL

public static final java.lang.String XSL
Type key for XML Stylesheets and Transformations.

See Also:
Constant Field Values

WSDL

public static final java.lang.String WSDL
Type key for Web Services Description Language.

See Also:
Constant Field Values

VM

public static final java.lang.String VM
Type key for Velocity templates.

See Also:
Constant Field Values
Method Detail

findXMLTypes

public ResourceMetaData[] findXMLTypes(java.lang.String locale)
                                throws RepositoryException
Finds all entity types known to the repository. This method is intended to support design-time clients and management applications.

Parameters:
locale - The locale in which the results should be formatted.
Returns:
All entity types.
Throws:
RepositoryException - if an error occurred.

findXMLType

public ResourceMetaData findXMLType(java.lang.String type,
                                    java.lang.String locale)
                             throws RepositoryException
Returns information about the specified XML type. This method is intended to support design-time clients and management applications.

Parameters:
type - The entity type: XML, DTD, XSD, XSL, VM.
locale - The locale in which the results should be formatted.
Returns:
Information about the specified entity type.
Throws:
ObjectNotFoundException - if the entity type is unknown.
RepositoryException - if some other error occurred.

createEntity

public void createEntity(ResourceMetaData entity)
                  throws RepositoryException
Registers an XML entity. The entity meta-data must contain non-null content.

Parameters:
entity - The entity definition.
Throws:
ObjectAlreadyExistsException - if the entity ID is already registered.
RepositoryException - if the entity could not be registered some other reason.

deleteEntity

public void deleteEntity(java.lang.String id)
                  throws RepositoryException
Unregisters an XML entity.

Parameters:
id - The entity ID (publicId if it has one, otherwise systemId).
Throws:
ObjectNotFoundException - if the entity ID is not registered.
RepositoryException - if the entity could not be unregistered for some other reason.

updateEntity

public void updateEntity(ResourceMetaData entity)
                  throws RepositoryException
Updates an XML entity. If the entity meta-data contains non-null content, the repository persists the updated content. Otherwise, any existing content remains intact.

Parameters:
entity - The entity definition.
Throws:
ObjectNotFoundException - if the entity ID is not registered.
RepositoryException - if the entity could not be updated for some other reason.

findXMLMetaData

public ResourceMetaData[] findXMLMetaData(boolean includeContent)
                                   throws RepositoryException
Finds meta-data for all entities. This method is intended to support design-time clients and management applications.

Parameters:
includeContent - true if the content property of the returned meta-data objects should be populated with the content of the XML entities.
Returns:
The list of all entities.
Throws:
RepositoryException - if an error occurred.

findXMLMetaData

public ResourceMetaData findXMLMetaData(java.lang.String id,
                                        boolean includeContent)
                                 throws RepositoryException
Finds meta-data for an XML entity. This method is intended to support design-time clients and management applications.

Parameters:
id - The entity ID.
includeContent - true if the content property of the returned meta-data object should be populated with the content of the XML entity.
Returns:
Meta-data about the requested entity.
Throws:
ObjectNotFoundException - if the entity ID is not registered.
RepositoryException - if some other error occurred.

findEntity

public java.io.InputStream findEntity(java.lang.String id)
                               throws RepositoryException
Opens an XML entity for reading. This method is called by the engine at run-time when it needs to resolve the entity from the given ID.

Parameters:
id - The entity ID.
Returns:
The requested entity.
Throws:
ObjectNotFoundException - if the entity ID is not registered.
RepositoryException - if some other error occurred.


SourceForge.net Logo OBE-1.0 Copyright (c) 2002-2006 Adrian Price. All Rights Reserved.