public class SurveyPage extends AbstractSurveyElement<SurveyPageFactory>
AmetysObject
for storing surveyModifier and Type | Field and Description |
---|---|
private static String |
__PROPERTY_DESC
Constants for description metadata.
|
private static String |
__PROPERTY_LABEL
Constants for title metadata.
|
private static String |
__PROPERTY_RULE
Constants for rules metadata.
|
private static String |
__PROPERTY_RULE_PAGE |
private static String |
__PROPERTY_RULE_TYPE |
private static String |
__PROPERTY_TITLE
Constants for title metadata.
|
PROPERTY_PICTURE, PROPERTY_PICTURE_ALTERNATIVE, PROPERTY_PICTURE_ID, PROPERTY_PICTURE_TYPE
Constructor and Description |
---|
SurveyPage(Node node,
String parentPath,
SurveyPageFactory factory)
Creates a
SurveyPage . |
Modifier and Type | Method and Description |
---|---|
SurveyPage |
copyTo(ModifiableTraversableAmetysObject parent,
String name)
Copy the current
AmetysObject to the given object. |
SurveyPage |
copyTo(ModifiableTraversableAmetysObject parent,
String name,
List<String> restrictTo)
Copy the current
AmetysObject to the given object if it is not in the restriction list. |
void |
deleteRule()
Delete the rule
|
String |
getDescription()
Retrieves the description.
|
String |
getLabel()
Retrieves the survey name.
|
SurveyQuestion |
getQuestion(String name)
Get a question.
|
AmetysObjectIterable<SurveyQuestion> |
getQuestions()
Get the page's questions.
|
SurveyRule |
getRule()
Get rule
|
Survey |
getSurvey()
Get the Survey to which this page belongs.
|
String |
getTitle()
Retrieves the title.
|
boolean |
hasQuestion(String name)
Determines if question exists
|
boolean |
hasRule()
Determines if the page has a rule
|
void |
setDescription(String description)
Set the description.
|
void |
setLabel(String name)
Set the survey name.
|
void |
setRule(SurveyRule.RuleType ruleType,
String page)
Set the rule for branching
|
void |
setTitle(String title)
Set the title.
|
copyPictureTo, getExternalPicture, getPictureAlternative, getPictureType, getResourcePictureId, removePictureMetas, setExternalPicture, setNoPicture, setPictureAlternative, setPictureType, setResourcePicture
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getChild, getChildren, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, hasChild, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
equals, getId, getName, getParent, getParentPath, getPath, hashCode
getNode
getMetadataHolder
needsSave, rename, revertChanges, saveChanges
remove
getChildAt, getChildPosition
private static final String __PROPERTY_LABEL
private static final String __PROPERTY_TITLE
private static final String __PROPERTY_DESC
private static final String __PROPERTY_RULE
private static final String __PROPERTY_RULE_TYPE
private static final String __PROPERTY_RULE_PAGE
public SurveyPage(Node node, String parentPath, SurveyPageFactory factory)
SurveyPage
.node
- the node backing this AmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- the SurveyFactory
which creates the AmetysObject.public String getTitle() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public void setTitle(String title) throws AmetysRepositoryException
title
- the title.AmetysRepositoryException
- if an error occurs.public String getLabel() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public void setLabel(String name) throws AmetysRepositoryException
name
- the survey name.AmetysRepositoryException
- if an error occurs.public String getDescription() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public void setDescription(String description) throws AmetysRepositoryException
description
- the description.AmetysRepositoryException
- if an error occurs.public void setRule(SurveyRule.RuleType ruleType, String page) throws AmetysRepositoryException
ruleType
- the rule typepage
- the page to jump or skip. Can be null.AmetysRepositoryException
- if an error occurs.public void deleteRule() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public boolean hasRule() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public SurveyRule getRule() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs.public Survey getSurvey() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs when retrieving the survey of a pagepublic boolean hasQuestion(String name) throws AmetysRepositoryException
name
- The question nameAmetysRepositoryException
- if an error occurs when looking for a survey questionpublic SurveyQuestion getQuestion(String name) throws AmetysRepositoryException
name
- the question name.AmetysRepositoryException
- if an error occurs when retrieving a question of a surveypublic AmetysObjectIterable<SurveyQuestion> getQuestions() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurs when retrieving all the questions of a surveypublic SurveyPage copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
CopiableAmetysObject
AmetysObject
to the given object. Be careful, this method save changes.parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied objectAmetysRepositoryException
- if an error occurs.public SurveyPage copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
CopiableAmetysObject
AmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied objectrestrictTo
- A restrict list of CopiableAmetysObject
authorized to be copiedAmetysRepositoryException
- if an error occurs.