|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.gouv.culture.sdx.utils.SdxObjectImpl
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
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 inherited from class fr.gouv.culture.sdx.document.AbstractIndexableDocument |
AbstractIndexableDocument.StoreHandler |
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.user.AbstractIdentity |
logger |
Fields inherited from class fr.gouv.culture.sdx.document.AbstractIndexableDocument |
_boost, _currentFieldBoost, _msgHandler, 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, 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.SdxObjectImpl |
encoding |
Fields inherited from interface fr.gouv.culture.sdx.document.Document |
DOCTYPE_BINARY, DOCTYPE_GROUP, DOCTYPE_HTML, DOCTYPE_USER, DOCTYPE_XML |
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.avalon.excalibur.xml.Parser parser,
org.apache.cocoon.xml.XMLConsumer consumer)
Starts the indexing process. |
Methods inherited from class fr.gouv.culture.sdx.user.AbstractIdentity |
enableLogging, 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 |
getId, getInputSource, getPreferredFilename, getRepositoryForStorage, getURL, save, setContent, setContent, setContent, setContent, setId, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setPreferredFilename, setRepositoryForStorage, setURL |
Methods inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl |
getChildLogger, setEncoding |
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 |
Methods inherited from interface fr.gouv.culture.sdx.document.Document |
getId, getLength, getMimeType, getPreferredFilename, getRepositoryForStorage, getURL, openStream, save, setContent, setContent, setContent, setContent, setId, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setRepositoryForStorage, setURL |
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
AbstractIdentity.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 logger should be set after user creation.AbstractIdentity.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.avalon.excalibur.xml.Parser 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()
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 |