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 Summary
Fields 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 Summary
Constructors Constructor Description ProgramDAO() 
- 
Method Summary
All 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
- 
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver 
- 
_observationManager
protected ObservationManager _observationManager
Observer manager. 
- 
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider. 
- 
_odfHelper
protected ODFHelper _odfHelper
ODF helper 
- 
_contentWorkflowHelper
protected ContentWorkflowHelper _contentWorkflowHelper
The content workflow helper 
 - 
 
- 
Constructor Detail
- 
ProgramDAO
public ProgramDAO()
 
 - 
 
- 
Method Detail
- 
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 
- 
translateProgram
public Map<String,String> translateProgram(String contentId, String language, boolean fullCopy) throws Exception
Translates a given program in a language- Parameters:
 contentId- The program idlanguage- The language in which to translatefullCopy- True if full copy- Returns:
 - A Map with id of translated program or an error message
 - Throws:
 Exception- if an error occurs
 
- 
linkTranslations
protected void linkTranslations(Map<String,String> translatedContents)
Store links to the other translations for all copied contents- Parameters:
 translatedContents- The translated contents
 
- 
linkTranslations
protected void linkTranslations(ModifiableContent originalContent, ModifiableContent translatedContent)
Store links to the other translations in all the translated objects.- Parameters:
 originalContent- The original contenttranslatedContent- The translated content
 
- 
_getCurrentUser
protected UserIdentity _getCurrentUser()
Provides the current user.- Returns:
 - the identity which cannot be 
null. 
 
- 
getCopyActionId
protected int getCopyActionId()
Get the workflow action id for copy.- Returns:
 - The workflow action id
 
 
 - 
 
 -