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_cocoonContextThe cocoon contextprotected Context_contextThe Avalon contextprotected CurrentUserProvider_currentUserProviderThe current user provider.protected JSONUtils_jsonUtilsJSON helperprotected ObservationManager_observationManagerObserver manager.protected AmetysObjectResolver_resolverAmetys object resolver.protected SiteManager_siteManagerThe site managerprotected UploadManager_uploadManagerManager 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.voidcontextualize(Context context)protected Map<String,Object>getPictureInfo(AbstractSurveyElement elmt)Get the information about pictureprotected ModifiableTraversableAmetysObjectgetSurveyRootNode(String siteName, String lang)Get the root node for surveysvoidservice(ServiceManager serviceManager)protected voidsetPicture(AbstractSurveyElement elmt, String valueAsStr)Set the pictureprotected voidupdateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey)Update references after a survey copyprotected voidupdateReferencesAfterCopy(Survey originalSurvey, Survey createdSurvey, SurveyPage createdPage)Update references after copyprotected voidupdateReferencesAfterCopy(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:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein 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
-
-