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
FieldsModifier and TypeFieldDescriptionprotected ContextThe cocoon contextprotected ContextThe Avalon contextprotected CurrentUserProviderThe current user provider.protected JSONUtilsJSON helperprotected ObservationManagerObserver manager.protected AmetysObjectResolverAmetys object resolver.protected SiteManagerThe site managerprotected UploadManagerManager for retrieving uploaded files -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected UserIdentityProvides the current user.voidcontextualize(Context context) 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 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:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein 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
-