|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.gouv.culture.sdx.utils.AbstractSdxObject fr.gouv.culture.sdx.document.AbstractDocument fr.gouv.culture.sdx.document.AbstractIndexableDocument fr.gouv.culture.sdx.document.XMLDocument fr.gouv.culture.sdx.user.AbstractIdentity fr.gouv.culture.sdx.user.User
public class User
Definition of an SDX user.
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class fr.gouv.culture.sdx.document.AbstractIndexableDocument |
---|
AbstractIndexableDocument.StoreHandler |
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
---|
SdxObject.ConfigurationNode |
Field Summary | |
---|---|
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'] |
Fields inherited from class fr.gouv.culture.sdx.document.AbstractIndexableDocument |
---|
_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 |
Fields inherited from class fr.gouv.culture.sdx.document.AbstractDocument |
---|
idGenerator, idPrefix, idSuffix, mimeType, storeRepo |
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
---|
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
Fields inherited from interface fr.gouv.culture.sdx.document.Document |
---|
CLASS_NAME_SUFFIX, DOCTYPE_BINARY, DOCTYPE_GROUP, DOCTYPE_HTML, DOCTYPE_USER, DOCTYPE_XML |
Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable |
---|
DEFAULT_ENCODING |
Constructor Summary | |
---|---|
User()
Creates an empty user. |
|
User(java.lang.String username)
Creates a user given a username. |
Method Summary | |
---|---|
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. |
Methods inherited from class fr.gouv.culture.sdx.user.AbstractIdentity |
---|
getType, setType |
Methods inherited from class fr.gouv.culture.sdx.document.XMLDocument |
---|
addAdditionalSystemFields, getLength, getMimeType, openStream, parse, parse, setContent, setTransformedDocument, setTransformedDocument |
Methods inherited from class fr.gouv.culture.sdx.document.AbstractDocument |
---|
getClassNameSuffix, getInputSource, getPreferredFilename, getRepositoryForStorage, getURL, initToSax, initVolatileObjectsToSax, save, setContent, setContent, setContent, setContent, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setPreferredFilename, setRepositoryForStorage, setURL |
Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
---|
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.gouv.culture.sdx.document.IndexableDocument |
---|
addAdditionalSystemFields, getAttachedDocuments, getBoost, getFieldValues, getStoreHandler, getSubDocuments, getTransformedDocument, resetAttachedDocuments, setBoost, setMessageHandler, setTransformedDocument, setTransformedDocument, setXMLFieldList, setXMLTransformerHandler |
Methods inherited from interface fr.gouv.culture.sdx.document.Document |
---|
getLength, getMimeType, getPreferredFilename, getRepositoryForStorage, getURL, openStream, save, setContent, setContent, setContent, setContent, setId, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setRepositoryForStorage, setURL |
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, setLocale, setXmlLang |
Methods inherited from interface org.apache.excalibur.xml.sax.XMLizable |
---|
toSAX |
Methods inherited from interface org.xml.sax.ContentHandler |
---|
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
---|
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
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
Constructor Detail |
---|
public User() throws SDXException
SDXException
AbstractSdxObject.enableLogging(org.apache.avalon.framework.logger.Logger)
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)
Method Detail |
---|
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |