Package org.ametys.plugins.survey.dao
Class AbstractDAO
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.survey.dao.AbstractDAO
-
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
- Direct Known Subclasses:
PageDAO
,QuestionDAO
,SurveyDAO
public abstract class AbstractDAO extends AbstractLogEnabled implements Serviceable, Component, Contextualizable
Abstract DAO for objects in the plugin survey.
-
-
Field Summary
Fields Modifier and Type Field Description protected Context
_cocoonContext
The cocoon contextprotected Context
_context
The Avalon contextprotected CurrentUserProvider
_currentUserProvider
The current user provider.protected JSONUtils
_jsonUtils
JSON helperprotected ObservationManager
_observationManager
Observer manager.protected AmetysObjectResolver
_resolver
Ametys object resolver.protected SiteManager
_siteManager
The site managerprotected UploadManager
_uploadManager
Manager for retrieving uploaded files
-
Constructor Summary
Constructors Constructor Description AbstractDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UserIdentity
_getCurrentUser()
Provides the current user.void
contextualize(Context context)
protected Map<String,Object>
getPictureInfo(AbstractSurveyElement elmt)
Get the information about pictureprotected ModifiableTraversableAmetysObject
getSurveyRootNode(String siteName, String lang)
Get the root node for surveysvoid
service(ServiceManager serviceManager)
protected void
setPicture(AbstractSurveyElement elmt, String valueAsStr)
Set the pictureprotected void
updateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey)
Update references after a survey copyprotected void
updateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey, SurveyPage createdPage)
Update references after copyprotected void
updateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey, SurveyQuestion createdQuestion)
Update references after copy-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
Ametys object resolver.
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_observationManager
protected ObservationManager _observationManager
Observer manager.
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider.
-
_uploadManager
protected UploadManager _uploadManager
Manager for retrieving uploaded files
-
_jsonUtils
protected JSONUtils _jsonUtils
JSON helper
-
_cocoonContext
protected Context _cocoonContext
The cocoon context
-
-
Constructor Detail
-
AbstractDAO
public AbstractDAO()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getSurveyRootNode
protected ModifiableTraversableAmetysObject getSurveyRootNode(String siteName, String lang) throws RepositoryException
Get the root node for surveys- Parameters:
siteName
- the site namelang
- the language- Returns:
- the root node
- Throws:
RepositoryException
- if an error occurs when manipulating the repository
-
_getCurrentUser
protected UserIdentity _getCurrentUser()
Provides the current user.- Returns:
- the user which cannot be
null
.
-
updateReferencesAfterCopy
protected void updateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey)
Update references after a survey copy- Parameters:
originalSurvey
- The original surveycreatedSurvey
- The created survey
-
updateReferencesAfterCopy
protected void updateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey, SurveyPage createdPage)
Update references after copy- Parameters:
originalSurvey
- The original surveycreatedSurvey
- The created surveycreatedPage
- The created survey page
-
updateReferencesAfterCopy
protected void updateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey, SurveyQuestion createdQuestion)
Update references after copy- Parameters:
originalSurvey
- The original surveycreatedSurvey
- The created surveycreatedQuestion
- The created survey question
-
setPicture
protected void setPicture(AbstractSurveyElement elmt, String valueAsStr)
Set the picture- Parameters:
elmt
- The survey elementvalueAsStr
- The value as String
-
getPictureInfo
protected Map<String,Object> getPictureInfo(AbstractSurveyElement elmt)
Get the information about picture- Parameters:
elmt
- The survey element- Returns:
- The picture
-
-