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
Modifier and TypeFieldDescriptionprotected Context
The cocoon contextprotected Context
The Avalon contextprotected CurrentUserProvider
The current user provider.protected JSONUtils
JSON helperprotected ObservationManager
Observer manager.protected AmetysObjectResolver
Ametys object resolver.protected SiteManager
The site managerprotected UploadManager
Manager for retrieving uploaded files -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected UserIdentity
Provides the current user.void
contextualize
(Context context) 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 copyMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_resolver
Ametys object resolver. -
_siteManager
The site manager -
_observationManager
Observer manager. -
_currentUserProvider
The current user provider. -
_uploadManager
Manager for retrieving uploaded files -
_jsonUtils
JSON helper -
_context
The Avalon context -
_cocoonContext
The cocoon context
-
-
Constructor Details
-
AbstractDAO
public AbstractDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getSurveyRootNode
protected ModifiableTraversableAmetysObject getSurveyRootNode(String siteName, String lang) throws javax.jcr.RepositoryException Get the root node for surveys- Parameters:
siteName
- the site namelang
- the language- Returns:
- the root node
- Throws:
javax.jcr.RepositoryException
- if an error occurs when manipulating the repository
-
_getCurrentUser
Provides the current user.- Returns:
- the user which cannot be
null
.
-
updateReferencesAfterCopy
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
Set the picture- Parameters:
elmt
- The survey elementvalueAsStr
- The value as String
-
getPictureInfo
Get the information about picture- Parameters:
elmt
- The survey element- Returns:
- The picture
-