public class User extends AbstractIdentity
A user is defined by the contents of an XML document. Once this document is
transformed during indexing, it must return a name
. This is the
only restriction for a user definition document and its accompanying
transformation : the application developer is free to put any other information
within the XML document, and index it as he or she wishes.
Users are authentificated against a password, but this password is not kept within the XML definition document. It is given to the application when the user is added or updated. It is the responsibility of the application to manage users and passwords.
A user may be a member of one or more groups. Once again, the relationships between users and groups are not kept within the user definition file, but managed by the application.
For compatibility reasons, this class can manage the following user properties:
But in SDX 2, the most important property is the preferred locale, which
may be used in setting the current locale of a given acceptRequest. The preferred
locale is defined with the language
, country
and
variant
fields derived from the value of xml:lang when the user is indexed.
AbstractIndexableDocument.StoreHandler
SdxObject.ConfigurationNode
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
XCONF_EMAIL
The code from the field in document(application.xconf)/sdx:application/sdx:userDocumentBase/sdx:fieldList/sdx:field[@code='email']
|
static java.lang.String |
XCONF_FIRSTNAME
The code from the field in document(application.xconf)/sdx:application/sdx:userDocumentBase/sdx:fieldList/sdx:field[@code='firstname']
|
static java.lang.String |
XCONF_LANG
The code from the field in document(application.xconf)/sdx:application/sdx:userDocumentBase/sdx:fieldList/sdx:field[@code='lang']
|
static java.lang.String |
XCONF_LASTNAME
The code from the field in document(application.xconf)/sdx:application/sdx:userDocumentBase/sdx:fieldList/sdx:field[@code='lastname']
|
static java.lang.String |
XCONF_VARIANT
The code from the field in document(application.xconf)/sdx:application/sdx:userDocumentBase/sdx:fieldList/sdx:field[@code='variant']
|
_boost, _currentFieldBoost, _msgHandler, _xmlFieldList, _xmlFieldOutput, _xmlFieldTransformer, attachedDocuments, contentHandler, DOC_ATTACHEDOC_ELEMENT_NAME, DOC_FIELD_ELEMENT_NAME, DOC_MSG_ELEMENT_NAME, DOC_NAMESPACE, DOC_ROOT_ELEMENT_NAME, lexicalHandler, nsTable, openSdxDocElems, properties, storeHandler, subDoc, subDocBytes, subDocuments, transformedDoc, withinSdxElement, withinXmlField, xmlConsumer
idGenerator, idPrefix, idSuffix, mimeType, storeRepo
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
CLASS_NAME_SUFFIX, DOCTYPE_BINARY, DOCTYPE_GROUP, DOCTYPE_HTML, DOCTYPE_USER, DOCTYPE_XML
DEFAULT_ENCODING
Constructor and Description |
---|
User()
Creates an empty user.
|
User(java.lang.String username)
Creates a user given a username.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDocType()
Gets the docType for the document
|
java.lang.String |
getEmail()
Returns the user's email.
|
java.lang.String |
getFirstname()
Returns the user's firstname.
|
java.lang.String |
getLastname()
Returns the user's lastname.
|
java.util.Locale |
getPreferredLocale()
Returns the user's preferred locale.
|
java.lang.String |
getXmlLang()
Returns the user's language.
|
void |
setEmail(java.lang.String email)
Sets the user's email
|
void |
startIndexing(org.apache.excalibur.xml.sax.SAXParser parser,
org.apache.cocoon.xml.XMLConsumer consumer)
Starts the indexing process.
|
getType, setType
addAdditionalSystemFields, getLength, getMimeType, openStream, parse, parse, setContent, setTransformedDocument, setTransformedDocument
addAttachedDocument, characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, generateId, getAttachedDocuments, getAttachedDocumentsSize, getBoost, getFieldValues, getStoreHandler, getSubDocuments, getSubDocumentsSize, getTransformedDocument, handleDocumentId, ignorableWhitespace, processingInstruction, resetAttachedDocuments, resetFields, setAttachedDocuments, setBoost, setConsumer, setContentHandler, setDocumentLocator, setLexicalHandler, setMessageHandler, setUpdateAttachedDocuments, setUpTransformedDocument, setXMLFieldList, setXMLTransformerHandler, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, updateAttachedDocuments
getClassNameSuffix, getInputSource, getPreferredFilename, getRepositoryForStorage, getURL, initToSax, initVolatileObjectsToSax, save, setContent, setContent, setContent, setContent, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setPreferredFilename, setRepositoryForStorage, setURL
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAdditionalSystemFields, getAttachedDocuments, getBoost, getFieldValues, getStoreHandler, getSubDocuments, getTransformedDocument, resetAttachedDocuments, setBoost, setMessageHandler, setTransformedDocument, setTransformedDocument, setXMLFieldList, setXMLTransformerHandler
getLength, getMimeType, getPreferredFilename, getRepositoryForStorage, getURL, openStream, save, setContent, setContent, setContent, setContent, setId, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setRepositoryForStorage, setURL
getId
getDescription, setDescription
getEncoding, setEncoding
getLocale, setLocale, setXmlLang
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
public static final java.lang.String XCONF_FIRSTNAME
public static final java.lang.String XCONF_LASTNAME
public static final java.lang.String XCONF_EMAIL
public static final java.lang.String XCONF_LANG
public static final java.lang.String XCONF_VARIANT
public User() throws SDXException
public User(java.lang.String username) throws SDXException
username
- The username to use.
If logging is desired the super.getLog() should be set after user creation.SDXException
AbstractSdxObject.enableLogging(org.apache.avalon.framework.logger.Logger)
public java.lang.String getDocType()
getDocType
in interface Document
getDocType
in class XMLDocument
public void startIndexing(org.apache.excalibur.xml.sax.SAXParser parser, org.apache.cocoon.xml.XMLConsumer consumer) throws SDXException
Indexing is done in the usual way but at the end we keep specific user information and make them available for the getters.
startIndexing
in interface IndexableDocument
startIndexing
in class XMLDocument
parser
- A parser that can be used for the indexing.consumer
- The consumer that will receive the indexing process (may be null
. The previously provided consumer will then be used)SDXException
public java.lang.String getXmlLang()
getXmlLang
in interface Localizable
getXmlLang
in class AbstractSdxObject
public java.lang.String getFirstname()
public java.lang.String getLastname()
public java.util.Locale getPreferredLocale()
public java.lang.String getEmail()
public void setEmail(java.lang.String email)
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.