Package org.ametys.odf.program
Class ProgramDAO
- java.lang.Object
- 
- org.ametys.odf.program.ProgramDAO
 
- 
- All Implemented Interfaces:
- Component,- Serviceable
 
 public class ProgramDAO extends Object implements Serviceable, Component DAO for manipulating ODF programs.
- 
- 
Field SummaryFields Modifier and Type Field Description protected ContentWorkflowHelper_contentWorkflowHelperThe content workflow helperprotected CurrentUserProvider_currentUserProviderThe current user provider.protected ObservationManager_observationManagerObserver manager.protected ODFHelper_odfHelperODF helperprotected AmetysObjectResolver_resolverThe ametys object resolverstatic StringROLEThe Avalon role
 - 
Constructor SummaryConstructors Constructor Description ProgramDAO()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UserIdentity_getCurrentUser()Provides the current user.protected intgetCopyActionId()Get the workflow action id for copy.protected voidlinkTranslations(Map<String,String> translatedContents)Store links to the other translations for all copied contentsprotected voidlinkTranslations(ModifiableContent originalContent, ModifiableContent translatedContent)Store links to the other translations in all the translated objects.voidservice(ServiceManager manager)Map<String,String>translateProgram(String contentId, String language, boolean fullCopy)Translates a given program in a language
 
- 
- 
- 
Field Detail- 
_resolverprotected AmetysObjectResolver _resolver The ametys object resolver
 - 
_observationManagerprotected ObservationManager _observationManager Observer manager.
 - 
_currentUserProviderprotected CurrentUserProvider _currentUserProvider The current user provider.
 - 
_odfHelperprotected ODFHelper _odfHelper ODF helper
 - 
_contentWorkflowHelperprotected ContentWorkflowHelper _contentWorkflowHelper The content workflow helper
 
- 
 - 
Constructor Detail- 
ProgramDAOpublic ProgramDAO() 
 
- 
 - 
Method Detail- 
servicepublic void service(ServiceManager manager) throws ServiceException - Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
 - 
translateProgrampublic Map<String,String> translateProgram(String contentId, String language, boolean fullCopy) throws Exception Translates a given program in a language- Parameters:
- contentId- The program id
- language- The language in which to translate
- fullCopy- True if full copy
- Returns:
- A Map with id of translated program or an error message
- Throws:
- Exception- if an error occurs
 
 - 
linkTranslationsprotected void linkTranslations(Map<String,String> translatedContents) Store links to the other translations for all copied contents- Parameters:
- translatedContents- The translated contents
 
 - 
linkTranslationsprotected void linkTranslations(ModifiableContent originalContent, ModifiableContent translatedContent) Store links to the other translations in all the translated objects.- Parameters:
- originalContent- The original content
- translatedContent- The translated content
 
 - 
_getCurrentUserprotected UserIdentity _getCurrentUser() Provides the current user.- Returns:
- the identity which cannot be null.
 
 - 
getCopyActionIdprotected int getCopyActionId() Get the workflow action id for copy.- Returns:
- The workflow action id
 
 
- 
 
-