public class Survey extends org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<SurveyFactory> implements org.ametys.web.repository.SiteAwareAmetysObject, org.ametys.plugins.repository.CopiableAmetysObject
AmetysObject for storing survey| Constructor and Description |
|---|
Survey(javax.jcr.Node node,
java.lang.String parentPath,
SurveyFactory factory)
Creates a
Survey. |
| Modifier and Type | Method and Description |
|---|---|
Survey |
copyTo(org.ametys.plugins.repository.ModifiableTraversableAmetysObject parent,
java.lang.String name) |
Survey |
copyTo(org.ametys.plugins.repository.ModifiableTraversableAmetysObject parent,
java.lang.String name,
java.util.List<java.lang.String> restrictTo) |
java.lang.String |
findUniqueQuestionName(java.lang.String originalName)
Returns a unique question name in the survey
|
java.lang.String |
getDescription()
Retrieves the description.
|
java.util.Date |
getEndDate()
Get the end date
|
java.lang.String |
getEndingMessage()
Retrieves the ending message.
|
org.ametys.plugins.repository.metadata.BinaryMetadata |
getExternalPicture()
Get the picture as a binary metadata.
|
java.util.Set<java.lang.String> |
getGrantedGroups()
Get the granted users.
|
java.util.Set<java.lang.String> |
getGrantedUsers()
Get the granted users.
|
java.lang.String |
getLabel()
Retrieves the survey label.
|
java.lang.String |
getLanguage()
Get the survey language.
|
org.ametys.plugins.repository.AmetysObjectIterable<SurveyPage> |
getPages()
Get the survey pages.
|
java.lang.String |
getPictureAlternative()
Get the picture alternative.
|
java.lang.String |
getPictureType()
Get the picture type.
|
SurveyQuestion |
getQuestion(java.lang.String name)
Get a question by its name.
|
org.ametys.plugins.repository.AmetysObjectIterable<SurveyQuestion> |
getQuestions()
Get the survey questions.
|
java.lang.String |
getRedirection()
Retrieves the redirection.
|
java.lang.String |
getResourcePictureId()
Get the picture resource ID.
|
org.ametys.web.repository.site.Site |
getSite() |
java.lang.String |
getSiteName() |
java.util.Date |
getStartDate()
Get the start date
|
java.lang.String |
getTitle()
Retrieves the title.
|
java.util.Date |
getValidationDate()
Get the date of validation
|
boolean |
isPrivate()
Determines if the survey is private.
|
boolean |
isValidated()
Determines if the survey is validated.
|
protected void |
removePictureMetas()
Remove all picture metas (picture ID and picture binary).
|
void |
setDescription(java.lang.String description)
Set the description.
|
void |
setEndDate(java.util.Date date)
Set the end date
|
void |
setEndingMessage(java.lang.String message)
Set the ending message.
|
void |
setExternalPicture(java.lang.String mimeType,
java.lang.String filename,
java.io.InputStream stream)
Set the picture from an external file.
|
void |
setGrantedGroups(java.util.Collection<java.lang.String> groups)
Set the granted users.
|
void |
setGrantedUsers(java.util.Collection<java.lang.String> users)
Set the granted users.
|
void |
setLabel(java.lang.String label)
Set the survey label.
|
void |
setNoPicture()
Removes any picture currently assigned.
|
void |
setPictureAlternative(java.lang.String alternative)
Set the picture alternative.
|
void |
setPictureType(java.lang.String type)
Set the picture type.
|
void |
setPrivate(boolean isPrivate)
Set the privacy.
|
void |
setRedirection(java.lang.String pageId)
Set the redirection.
|
void |
setResourcePicture(java.lang.String resourceId)
Set the picture from an explorer resource.
|
void |
setStartDate(java.util.Date date)
Set the start date
|
void |
setTitle(java.lang.String title)
Set the title.
|
void |
setValidated(boolean validated)
Valid or invalid survey
|
void |
setValidationDate(java.util.Date date)
Set the date of validation
|
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 Survey(javax.jcr.Node node,
java.lang.String parentPath,
SurveyFactory factory)
Survey.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 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 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 survey label.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getDescription()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setDescription(java.lang.String description)
throws org.ametys.plugins.repository.AmetysRepositoryException
description - the description.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getEndingMessage()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setEndingMessage(java.lang.String message)
throws org.ametys.plugins.repository.AmetysRepositoryException
message - the ending message.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public boolean isPrivate()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setPrivate(boolean isPrivate)
throws org.ametys.plugins.repository.AmetysRepositoryException
isPrivate - the privacyorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public boolean isValidated()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setValidated(boolean validated)
throws org.ametys.plugins.repository.AmetysRepositoryException
validated - true to validate the surveyorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setValidationDate(java.util.Date date)
throws org.ametys.plugins.repository.AmetysRepositoryException
date - The date of validationorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.Date getValidationDate()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setStartDate(java.util.Date date)
throws org.ametys.plugins.repository.AmetysRepositoryException
date - The start dateorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.Date getStartDate()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setEndDate(java.util.Date date)
throws org.ametys.plugins.repository.AmetysRepositoryException
date - The end dateorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.Date getEndDate()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.lang.String getRedirection()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setRedirection(java.lang.String pageId)
throws org.ametys.plugins.repository.AmetysRepositoryException
pageId - the page id. Can be null to delete redirectionorg.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.Set<java.lang.String> getGrantedUsers()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setGrantedUsers(java.util.Collection<java.lang.String> users)
throws org.ametys.plugins.repository.AmetysRepositoryException
users - a collection of logins of the granted users to set.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public java.util.Set<java.lang.String> getGrantedGroups()
throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public void setGrantedGroups(java.util.Collection<java.lang.String> groups)
throws org.ametys.plugins.repository.AmetysRepositoryException
groups - a collection of ids of the granted groups to set.org.ametys.plugins.repository.AmetysRepositoryException - if an error occurs.public org.ametys.plugins.repository.AmetysObjectIterable<SurveyPage> getPages() throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryExceptionpublic SurveyQuestion getQuestion(java.lang.String name) throws org.ametys.plugins.repository.AmetysRepositoryException
name - the question name.org.ametys.plugins.repository.AmetysRepositoryExceptionpublic org.ametys.plugins.repository.AmetysObjectIterable<SurveyQuestion> getQuestions() throws org.ametys.plugins.repository.AmetysRepositoryException
org.ametys.plugins.repository.AmetysRepositoryExceptionpublic org.ametys.web.repository.site.Site getSite()
throws org.ametys.plugins.repository.AmetysRepositoryException
getSite in interface org.ametys.web.repository.SiteAwareAmetysObjectorg.ametys.plugins.repository.AmetysRepositoryExceptionpublic java.lang.String getSiteName()
throws org.ametys.plugins.repository.AmetysRepositoryException
getSiteName in interface org.ametys.web.repository.SiteAwareAmetysObjectorg.ametys.plugins.repository.AmetysRepositoryExceptionpublic java.lang.String getLanguage()
public 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 java.lang.String findUniqueQuestionName(java.lang.String originalName)
originalName - The original namepublic Survey 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 Survey 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.