public class SurveyQuestion extends org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<SurveyQuestionFactory> implements org.ametys.plugins.repository.CopiableAmetysObject
AmetysObject for storing survey| Modifier and Type | Class and Description |
|---|---|
static class |
SurveyQuestion.QuestionType
Type of a page.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
OPTION_NAME_PREFIX
Prefix for options
|
| Constructor and Description |
|---|
SurveyQuestion(javax.jcr.Node node,
java.lang.String parentPath,
SurveyQuestionFactory factory)
Creates a
SurveyQuestion. |
| Modifier and Type | Method and Description |
|---|---|
void |
addRules(java.lang.String option,
SurveyRule.RuleType ruleType,
java.lang.String page)
Add a rule for branching
|
SurveyQuestion |
copyTo(org.ametys.plugins.repository.ModifiableTraversableAmetysObject parent,
java.lang.String name) |
SurveyQuestion |
copyTo(org.ametys.plugins.repository.ModifiableTraversableAmetysObject parent,
java.lang.String name,
java.util.List<java.lang.String> restrictTo) |
void |
deleteRule(java.lang.String option)
Delete a rule
|
java.util.Map<java.lang.String,java.lang.String> |
getColumns()
Get columns
|
org.ametys.plugins.repository.metadata.BinaryMetadata |
getExternalPicture()
Get the picture as a binary metadata.
|
java.lang.String |
getLabel()
Retrieves the label.
|
java.util.Map<java.lang.String,java.lang.String> |
getOptions()
Get options
|
java.lang.String |
getPictureAlternative()
Get the picture alternative.
|
java.lang.String |
getPictureType()
Get the picture type.
|
java.lang.String |
getRegExpPattern()
Get the validation pattern.
|
java.lang.String |
getRegExpType()
Retrieves the regexp type.
|
java.lang.String |
getResourcePictureId()
Get the picture resource ID.
|
java.util.List<SurveyRule> |
getRules()
Get the rules
|
Survey |
getSurvey()
Get the survey to which this question belongs.
|
SurveyPage |
getSurveyPage()
Get the page to which this question belongs.
|
java.lang.String |
getTitle()
Retrieves the title.
|
SurveyQuestion.QuestionType |
getType()
Retrieves the title.
|
boolean |
hasOtherOption()
Determines if the question has a "other" option
|
boolean |
hasRule(java.lang.String option)
Determines if a rule with given option exists
|
boolean |
isMandatory()
Determines if the question is mandatory.
|
protected void |
removePictureMetas()
Remove all picture metas (picture ID and picture binary).
|
void |
setColumns(java.util.Map<java.lang.String,java.lang.String> columns)
Set columns
|
void |
setExternalPicture(java.lang.String mimeType,
java.lang.String filename,
java.io.InputStream stream)
Set the picture from an external file.
|
void |
setLabel(java.lang.String label)
Set the label.
|
void |
setMandatory(boolean mandatory)
Set the mandatory.
|
void |
setNoPicture()
Removes any picture currently assigned.
|
void |
setOptions(java.util.Map<java.lang.String,java.lang.String> options)
Set options
|
void |
setOtherOption(boolean other)
Set the "other" option.
|
void |
setPictureAlternative(java.lang.String alternative)
Set the picture alternative.
|
void |
setPictureType(java.lang.String type)
Set the picture type.
|
void |
setRegExpType(java.lang.String regexp)
Set the regexp type.
|
void |
setResourcePicture(java.lang.String resourceId)
Set the picture from an explorer resource.
|
void |
setTitle(java.lang.String title)
Set the title.
|
void |
setType(SurveyQuestion.QuestionType type)
Set the type.
|
createChild, getChild, getChildren, hasChild_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, getId, getName, getParent, getParentPath, getPath, hashCodegetMetadataHolderpublic static final java.lang.String OPTION_NAME_PREFIX
public SurveyQuestion(javax.jcr.Node node,
java.lang.String parentPath,
SurveyQuestionFactory factory)
SurveyQuestion.node - the node backing this AmetysObject.parentPath - the parent path in the Ametys hierarchy.factory - the SurveyFactory which creates the AmetysObject.public java.lang.String getLabel()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setLabel(java.lang.String label)
throws org.ametys.plugins.repository.AmetysRepositoryException
label - the label.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getTitle()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setTitle(java.lang.String title)
throws org.ametys.plugins.repository.AmetysRepositoryException
title - the title.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public SurveyQuestion.QuestionType getType() throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setType(SurveyQuestion.QuestionType type) throws org.ametys.plugins.repository.AmetysRepositoryException
type - the type.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getRegExpType()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setRegExpType(java.lang.String regexp)
throws org.ametys.plugins.repository.AmetysRepositoryException
regexp - the regexp type.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getRegExpPattern()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public boolean isMandatory()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setMandatory(boolean mandatory)
throws org.ametys.plugins.repository.AmetysRepositoryException
mandatory - true for mandatoryorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public boolean hasOtherOption()
public void setOtherOption(boolean other)
other - true to add the "other" optionpublic void setOptions(java.util.Map<java.lang.String,java.lang.String> options)
throws org.ametys.plugins.repository.AmetysRepositoryException
options - the options as a Map of key, valueorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.Map<java.lang.String,java.lang.String> getOptions()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setColumns(java.util.Map<java.lang.String,java.lang.String> columns)
throws org.ametys.plugins.repository.AmetysRepositoryException
columns - the columns as a Map of key, valueorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.Map<java.lang.String,java.lang.String> getColumns()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void addRules(java.lang.String option,
SurveyRule.RuleType ruleType,
java.lang.String page)
throws org.ametys.plugins.repository.AmetysRepositoryException
option - the chosen optionruleType - the rule typepage - the page to jump or skip. Can be null.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public boolean hasRule(java.lang.String option)
throws org.ametys.plugins.repository.AmetysRepositoryException
option - the optionorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void deleteRule(java.lang.String option)
throws org.ametys.plugins.repository.AmetysRepositoryException
option - the option to deleteorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.List<SurveyRule> getRules() throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public SurveyPage getSurveyPage() throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryExceptionpublic Survey getSurvey() throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryExceptionpublic org.ametys.plugins.repository.metadata.BinaryMetadata getExternalPicture()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setExternalPicture(java.lang.String mimeType,
java.lang.String filename,
java.io.InputStream stream)
throws org.ametys.plugins.repository.AmetysRepositoryException
mimeType - the file MIME type.filename - the file name.stream - an input stream on the file bytes.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getResourcePictureId()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setResourcePicture(java.lang.String resourceId)
throws org.ametys.plugins.repository.AmetysRepositoryException
resourceId - the resource ID.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setNoPicture()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getPictureType()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setPictureType(java.lang.String type)
throws org.ametys.plugins.repository.AmetysRepositoryException
type - the picture type to set.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getPictureAlternative()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setPictureAlternative(java.lang.String alternative)
throws org.ametys.plugins.repository.AmetysRepositoryException
alternative - the picture alternative to set.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.protected void removePictureMetas()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - if an error occurs.public SurveyQuestion copyTo(org.ametys.plugins.repository.ModifiableTraversableAmetysObject parent, java.lang.String name) throws org.ametys.plugins.repository.AmetysRepositoryException
copyTo in interface org.ametys.plugins.repository.CopiableAmetysObjectorg.ametys.plugins.repository.AmetysRepositoryExceptionpublic SurveyQuestion copyTo(org.ametys.plugins.repository.ModifiableTraversableAmetysObject parent, java.lang.String name, java.util.List<java.lang.String> restrictTo) throws org.ametys.plugins.repository.AmetysRepositoryException
copyTo in interface org.ametys.plugins.repository.CopiableAmetysObjectorg.ametys.plugins.repository.AmetysRepositoryExceptionCopyright © 2010 Anyware Services. All Rights Reserved.