Package org.ametys.odf.program
Class ProgramDAO
java.lang.Object
org.ametys.odf.program.ProgramDAO
- All Implemented Interfaces:
Component
,Serviceable
DAO for manipulating ODF programs.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentWorkflowHelper
The content workflow helperprotected CurrentUserProvider
The current user provider.protected ObservationManager
Observer manager.protected ODFHelper
ODF helperprotected AmetysObjectResolver
The ametys object resolverstatic final String
The Avalon role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected UserIdentity
Provides the current user.protected int
Get the workflow action id for copy.protected void
linkTranslations
(Map<String, String> translatedContents) Store links to the other translations for all copied contentsprotected void
linkTranslations
(ModifiableContent originalContent, ModifiableContent translatedContent) Store links to the other translations in all the translated objects.void
service
(ServiceManager manager) translateProgram
(String contentId, String language, boolean fullCopy) Translates a given program in a language
-
Field Details
-
ROLE
The Avalon role -
_resolver
The ametys object resolver -
_observationManager
Observer manager. -
_currentUserProvider
The current user provider. -
_odfHelper
ODF helper -
_contentWorkflowHelper
The content workflow helper
-
-
Constructor Details
-
ProgramDAO
public ProgramDAO()
-
-
Method Details
-
service
- Specified by:
service
in 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
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
Provides the current user.- Returns:
- the identity which cannot be
null
.
-
getCopyActionId
Get the workflow action id for copy.- Returns:
- The workflow action id
-