Class UserComputingType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.question.computing.AbstractStaticComputingType
org.ametys.plugins.forms.question.computing.UserComputingType
- All Implemented Interfaces:
ComputingType
,LogEnabled
,PluginAware
,Configurable
,Serviceable
Class for creating user computed field
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerMap of ModelItems specific to ManualSourceTypeprotected UserManager
The users managerstatic final String
The user info attributestatic final String
Name of email userInfoStaticEnumerator entrystatic final String
Name of firstName userInfoStaticEnumerator entrystatic final String
Name of fullname userInfoStaticEnumerator entrystatic final String
Name of id userInfoStaticEnumerator entrystatic final String
Name of lastName userInfoStaticEnumerator entryFields inherited from class org.ametys.plugins.forms.question.computing.AbstractStaticComputingType
_choiceSourceTypeExtensionPoint, _computingTypeExtensionPoint, _description, _formQuestionDataTypeExtensionPoint, _id, _label, _pluginName, _xslt
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getUserInfoValue
(FormQuestion question, User user) Get user valueboolean
canEdit()
true
if the question can be edited after submissiongetComputedValue
(FormQuestion computedQuestion, FormEntry entry) Get the computed value for the fieldGet field to disable if form is publishedGet the type model items If the return value is null there won't be any processing on the server sidegetStorageType
(FormQuestion question) Get the storage type of the question typeGet the view items for the main tabvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.plugins.forms.question.computing.AbstractStaticComputingType
configure, getDescription, getId, getJSRenderer, getLabel, getXSLT, hasComputedValue, saxAdditionalValue, 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.plugins.forms.question.computing.ComputingType
isCacheable, valueToJSONForClient
-
Field Details
-
ATTRIBUTE_USER_INFO
The user info attribute- See Also:
-
EMAIL_USER_VALUE
Name of email userInfoStaticEnumerator entry- See Also:
-
ID_USER_VALUE
Name of id userInfoStaticEnumerator entry- See Also:
-
FULLNAME_USER_VALUE
Name of fullname userInfoStaticEnumerator entry- See Also:
-
FIRSTNAME_USER_VALUE
Name of firstName userInfoStaticEnumerator entry- See Also:
-
LASTNAME_USER_VALUE
Name of lastName userInfoStaticEnumerator entry- See Also:
-
_currentUserProvider
The current user provider -
_userManager
The users manager -
_userComputingItems
Map of ModelItems specific to ManualSourceType
-
-
Constructor Details
-
UserComputingType
public UserComputingType()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractStaticComputingType
- Throws:
ServiceException
-
getComputedValue
Description copied from interface:ComputingType
Get the computed value for the field- Parameters:
computedQuestion
- the questionentry
- the entry- Returns:
- the computed value
-
getModelItems
Description copied from interface:ComputingType
Get the type model items If the return value is null there won't be any processing on the server side- Returns:
- a map of the model items
-
getViewElements
Description copied from interface:ComputingType
Get the view items for the main tab- Returns:
- a list of view items
-
_getUserInfoValue
Get user value- Parameters:
question
- the questionuser
- the user- Returns:
- the user value.
null
if there is not user value
-
getStorageType
Description copied from interface:ComputingType
Get the storage type of the question type- Parameters:
question
- the question- Returns:
- the storage type
-
getFieldToDisableIfFormPublished
Description copied from interface:ComputingType
Get field to disable if form is published- Specified by:
getFieldToDisableIfFormPublished
in interfaceComputingType
- Overrides:
getFieldToDisableIfFormPublished
in classAbstractStaticComputingType
- Returns:
- the list of field name
-
canEdit
Description copied from interface:ComputingType
true
if the question can be edited after submission- Returns:
true
if the question can be edited after submission
-