* @package phpcr
*/
interface Repository
{
/**
* The descriptor key for the version of the specification
* that this repository implements.
*/
const SPEC_VERSION_DESC = "jcr.specification.version";
/**
* The descriptor key for the name of the specification
* that this repository implements.
*/
const SPEC_NAME_DESC = "jcr.specification.name";
/**
* The descriptor key for the name of the repository vendor.
*/
const REP_VENDOR_DESC = "jcr.repository.vendor";
/**
* The descriptor key for the URL of the repository vendor.
*/
const REP_VENDOR_URL_DESC = "jcr.repository.vendor.url";
/**
* The descriptor key for the name of this repository implementation.
*/
const REP_NAME_DESC = "jcr.repository.name";
/**
* The descriptor key for the version of this repository implementation.
*/
const REP_VERSION_DESC = "jcr.repository.version";
/**
* The presence of this key indicates that this implementation supports
* all level 1 features. This key will always be present.
*/
const LEVEL_1_SUPPORTED = "level.1.supported";
/**
* The presence of this key indicates that this implementation supports
* all level 2 features.
*/
const LEVEL_2_SUPPORTED = "level.2.supported";
/**
* The presence of this key indicates that this implementation supports transactions.
*/
const OPTION_TRANSACTIONS_SUPPORTED = "option.transactions.supported";
/**
* The presence of this key indicates that this implementation supports versioning.
*/
const OPTION_VERSIONING_SUPPORTED = "option.versioning.supported";
/**
* The presence of this key indicates that this implementation supports observation.
*/
const OPTION_OBSERVATION_SUPPORTED = "option.observation.supported";
/**
* The presence of this key indicates that this implementation supports locking.
*/
const OPTION_LOCKING_SUPPORTED = "option.locking.supported";
/**
* The presence of this key indicates that this implementation supports the SQL query language.
*/
const OPTION_QUERY_SQL_SUPPORTED = "option.query.sql.supported";
/**
* The presence of this key indicates that the index position notation for
* same-name siblings is supported within XPath queries.
*/
const QUERY_XPATH_POS_INDEX = "query.xpath.pos.index";
/**
* The presence of this key indicates that XPath queries return results in document order.
*/
const QUERY_XPATH_DOC_ORDER = "query.xpath.doc.order";
/**
* The presence of this key indicates that SQL queries can SELECT the pseudo-property
* jcr:path
.
*/
const QUERY_JCRPATH = "query.jcrpath";
/**
* The presence of this key indicates that the jcr:score
pseudo-property is
* available in XPath and SQL queries that include a jcrfn:contains
* (in XPath) or CONTAINS
(in SQL) function to do a full-text search.
*/
const QUERY_JCRSCORE = "query.jcrscore";
/**
* Returns a string array holding all descriptor keys available for this implementation.
* This set must contain at least the built-in keys defined by the string constants in
* this interface.Used in conjunction with {@link #getDescriptor(String name)}
* to query information about this repository implementation.
*/
public function getDescriptorKeys();
/**
* Returns the descriptor for the specified key. Used to query information about this
* repository implementation. The set of available keys can be found by calling
* {@link #getDescriptorKeys}. If the specifed key is not found, null
is returned.
*
* @param key a string corresponding to a descriptor for this repsoitory implementation.
* @return a descriptor string
*/
public function getDescriptor( $key );
/**
* Authenticates the user using the supplied credentials
.
*
* If workspaceName
is recognized as the name of an existing workspace in the repository and
* authorization to access that workspace is granted, then a new Session
object is returned.
* The format of the string workspaceName
depends upon the implementation.
*
* If credentials
is null
, it is assumed that authentication is handled by a
* mechanism external to the repository itself (for example, through the JAAS framework) and that the
* repository implementation exists within a context (for example, an application server) that allows
* it to handle authorization of the request for access to the specified workspace.
*
* If workspaceName
is null
, a default workspace is automatically selected by
* the repository implementation. This may, for example, be the "home workspace" of the user whose
* credentials were passed, though this is entirely up to the configuration and implementation of the
* repository. Alternatively, it may be a "null workspace" that serves only to provide the method
* {@link Workspace#getAccessibleWorkspaceNames}, allowing the client to select from among available "real"
* workspaces.
*
* If authentication or authorization for the specified workspace fails, a LoginException
is
* thrown.
*
* If workspaceName
is not recognized, a NoSuchWorkspaceException
is thrown.
*
* @param credentials The credentials of the user
* @param workspaceName the name of a workspace.
* @return a valid session for the user to access the repository.
* @throws LoginException If the login fails.
* @throws NoSuchWorkspaceException If the specified workspaceName
is not recognized.
* @throws RepositoryException if another error occurs.
*/
public function login( $credentials = null, $workspaceName = null );
}
?>