Class CurrentPageIdComputingType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.question.computing.AbstractStaticComputingType
org.ametys.plugins.forms.question.computing.CurrentPageIdComputingType
- All Implemented Interfaces:
ComputingType
,LogEnabled
,PluginAware
,Configurable
,Contextualizable
,Serviceable
public class CurrentPageIdComputingType
extends AbstractStaticComputingType
implements Contextualizable
Class for current page id computing type
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The contextprotected AmetysObjectResolver
The ametys object resolverFields inherited from class org.ametys.plugins.forms.question.computing.AbstractStaticComputingType
_choiceSourceTypeExtensionPoint, _computingTypeExtensionPoint, _description, _formQuestionDataTypeExtensionPoint, _id, _label, _pluginName, _xslt
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canEdit()
true
if the question can be edited after submissionvoid
contextualize
(Context context) getComputedValue
(FormQuestion question, FormEntry entry) Get the computed value for the fieldGet the renderer for jsGet 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
saxAdditionalValue
(ContentHandler contentHandler, FormQuestion question, FormEntry entry) Sax additional valuesvoid
service
(ServiceManager manager) valueToJSONForClient
(Object value, FormQuestion question, FormEntry entry, ModelItem modelItem) Convert the entry value into a JSON object to use client sideMethods inherited from class org.ametys.plugins.forms.question.computing.AbstractStaticComputingType
configure, getDescription, getFieldToDisableIfFormPublished, getId, getLabel, getXSLT, hasComputedValue, 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
-
Field Details
-
_context
The context -
_resolver
The ametys object resolver
-
-
Constructor Details
-
CurrentPageIdComputingType
public CurrentPageIdComputingType()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractStaticComputingType
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getComputedValue
Description copied from interface:ComputingType
Get the computed value for the field- Specified by:
getComputedValue
in interfaceComputingType
- Parameters:
question
- 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- Specified by:
getModelItems
in interfaceComputingType
- Returns:
- a map of the model items
-
getStorageType
Description copied from interface:ComputingType
Get the storage type of the question type- Specified by:
getStorageType
in interfaceComputingType
- Parameters:
question
- the question- Returns:
- the storage type
-
getViewElements
Description copied from interface:ComputingType
Get the view items for the main tab- Specified by:
getViewElements
in interfaceComputingType
- Returns:
- a list of view items
-
saxAdditionalValue
public void saxAdditionalValue(ContentHandler contentHandler, FormQuestion question, FormEntry entry) throws SAXException Description copied from interface:ComputingType
Sax additional values- Specified by:
saxAdditionalValue
in interfaceComputingType
- Overrides:
saxAdditionalValue
in classAbstractStaticComputingType
- Parameters:
contentHandler
- the content handlerquestion
- the questionentry
- the entry- Throws:
SAXException
- if an error occurred
-
getJSRenderer
Description copied from interface:ComputingType
Get the renderer for js- Specified by:
getJSRenderer
in interfaceComputingType
- Overrides:
getJSRenderer
in classAbstractStaticComputingType
- Returns:
- the js renderer
-
valueToJSONForClient
public Object valueToJSONForClient(Object value, FormQuestion question, FormEntry entry, ModelItem modelItem) throws Exception Description copied from interface:ComputingType
Convert the entry value into a JSON object to use client side- Specified by:
valueToJSONForClient
in interfaceComputingType
- Parameters:
value
- the value to convertquestion
- the form questionentry
- the form entrymodelItem
- the model item- Returns:
- The value as JSON
- Throws:
Exception
- if an error occurred
-
canEdit
Description copied from interface:ComputingType
true
if the question can be edited after submission- Specified by:
canEdit
in interfaceComputingType
- Returns:
true
if the question can be edited after submission
-