Package org.ametys.cms.data.type
Class AbstractUserElementType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.model.type.AbstractModelItemType
org.ametys.core.model.type.AbstractElementType<UserIdentity>
org.ametys.cms.data.type.AbstractUserElementType
- All Implemented Interfaces:
ElementType<UserIdentity>
,ModelItemType
,LogEnabled
,PluginAware
,Component
,Serviceable
- Direct Known Subclasses:
UserRepositoryElementType
Abstract class for user type of elements
-
Field Summary
Modifier and TypeFieldDescriptionprotected UserHelper
The user helperprotected UserManager
The user managerFields inherited from class org.ametys.core.model.type.AbstractElementType
_jsonUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected UserIdentity
_singleValueFromXML
(Element element, Optional<Object> additionalData) Retrieves a single typed value from the given DOM nodeprotected Object
_singleValueToJSON
(UserIdentity value, DataContext context) Convert the single value into a JSON objectprotected void
_singleValueToSAX
(ContentHandler contentHandler, String tagName, UserIdentity value, Optional<ViewItem> viewItem, DataContext context, AttributesImpl attributes) Generates SAX events for the given single valueprotected boolean
Determine if the JSON format has to be used in edition mode for this element typeconvertValue
(Object value) Try to convert the given value.fromJSONForClient
(Object json) Convert the given client side JSON object to the types valueboolean
isSimple()
Determines if this type is simple or not.void
service
(ServiceManager manager) toString
(UserIdentity value) Cast a typed value to a StringMethods inherited from class org.ametys.core.model.type.AbstractElementType
_compareMultipleValues, _compareSingleValues, _getValueAttributes, _isValueFromXMLMultiple, _valueToSAX, _valueToSAX, _valueToSAXForEdition, castValue, compareValues, getManagedClass, getManagedClassArray, isCompatible, parseConfiguration, valueFromXML, valueToJSONForClient, valueToSAX, valueToSAXForEdition
Methods inherited from class org.ametys.core.model.type.AbstractModelItemType
_getContextAttributes, getId, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.type.ModelItemType
getId, valueToSAX
Methods inherited from interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
-
Field Details
-
_helper
The user helper -
_userManager
The user manager
-
-
Constructor Details
-
AbstractUserElementType
public AbstractUserElementType()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractElementType<UserIdentity>
- Throws:
ServiceException
-
convertValue
Description copied from class:AbstractElementType
Try to convert the given value.- Overrides:
convertValue
in classAbstractElementType<UserIdentity>
- Parameters:
value
- the value to convert- Returns:
- the converted value or null if it's not possible.
-
toString
Description copied from interface:ElementType
Cast a typed value to a String- Specified by:
toString
in interfaceElementType<UserIdentity>
- Overrides:
toString
in classAbstractElementType<UserIdentity>
- Parameters:
value
- the value to cast- Returns:
- the String representation of the value
-
fromJSONForClient
Description copied from interface:ElementType
Convert the given client side JSON object to the types value- Parameters:
json
- the JSON object to convert- Returns:
- the typed value corresponding to the JSON object
-
_singleValueToJSON
Description copied from class:AbstractElementType
Convert the single value into a JSON object- Overrides:
_singleValueToJSON
in classAbstractElementType<UserIdentity>
- Parameters:
value
- the value to convertcontext
- The context of the data to convert- Returns:
- The value as JSON
-
_singleValueFromXML
protected UserIdentity _singleValueFromXML(Element element, Optional<Object> additionalData) throws TransformerException, IOException Description copied from class:AbstractElementType
Retrieves a single typed value from the given DOM node- Overrides:
_singleValueFromXML
in classAbstractElementType<UserIdentity>
- Parameters:
element
- the DOM element containing the single valueadditionalData
- additional data needed to get the typed value- Returns:
- the value
- Throws:
TransformerException
- if an error occurs while parsing the DOM nodeIOException
- if an error occurs while parsing a value using the I/O API
-
_singleValueToSAX
protected void _singleValueToSAX(ContentHandler contentHandler, String tagName, UserIdentity value, Optional<ViewItem> viewItem, DataContext context, AttributesImpl attributes) throws SAXException Description copied from class:AbstractElementType
Generates SAX events for the given single value- Overrides:
_singleValueToSAX
in classAbstractElementType<UserIdentity>
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventstagName
- the tag name of the SAX event to generate.value
- the single value to SAXviewItem
- The optional view item corresponding item that is currently saxed. This view item gives context for the SAX event that will be generated here.context
- The context of the data to SAXattributes
- the attributes for the SAX event to generate- Throws:
SAXException
- if an error occurs during the SAX events generation
-
isSimple
Description copied from interface:ElementType
Determines if this type is simple or not. A simple element type is a type of elements that can be edited in a grid- Returns:
true
if the type is simple,false
otherwise
-
_useJSONForEdition
Description copied from class:AbstractElementType
Determine if the JSON format has to be used in edition mode for this element type- Overrides:
_useJSONForEdition
in classAbstractElementType<UserIdentity>
- Returns:
true
if the JSON format has to be used,false
otherwise
-