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
FieldsModifier and TypeFieldDescriptionprotected ContentWorkflowHelperThe content workflow helperprotected CurrentUserProviderThe current user provider.protected ObservationManagerObserver manager.protected ODFHelperODF helperprotected AmetysObjectResolverThe ametys object resolverstatic final StringThe Avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected UserIdentityProvides the current user.protected intGet 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) 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:
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
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
-