public class TranslationFlaggingClientSideElement extends StaticClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
Modifier and Type | Field and Description |
---|---|
private AmetysObjectResolver |
_resolver |
private SiteManager |
_siteManager |
private TranslationPageDAO |
_translationPageDAO |
static String |
TRANSLATIONS_META
Constant for the translations metadata name
|
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
Constructor and Description |
---|
TranslationFlaggingClientSideElement() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Page> |
_getTranslatedPages(Map<String,String> translations,
String pageId)
Get translated pages from the map.
|
private Map<String,String> |
_page2json(Page page) |
List<ClientSideElement.Script> |
getScripts(boolean ignoreRights,
Map<String,Object> contextParameters)
This method return the scripts that will be used on client side.
|
Map<String,Object> |
getTranslations(String pageId)
Get all the translations associated with a page
|
void |
service(ServiceManager smanager) |
List<String> |
setTranslations(String pageId,
Map<String,String> translations)
Set the translations for a specific page
|
_configureClass, _configureParameters, _configureScript, configureInitialParameters
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, hasRight, setPluginInfo, toString
getLogger, setLogger
public static final String TRANSLATIONS_META
private AmetysObjectResolver _resolver
private SiteManager _siteManager
private TranslationPageDAO _translationPageDAO
public TranslationFlaggingClientSideElement()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class StaticFileImportsClientSideElement
ServiceException
public List<ClientSideElement.Script> getScripts(boolean ignoreRights, Map<String,Object> contextParameters)
ClientSideElement
getScripts
in interface ClientSideElement
getScripts
in class StaticFileImportsClientSideElement
ignoreRights
- True to ignore the rights verification.contextParameters
- Contextuals parameters transmitted by the environment.public Map<String,Object> getTranslations(String pageId)
pageId
- The page Idprivate Map<String,String> _page2json(Page page)
public List<String> setTranslations(String pageId, Map<String,String> translations)
pageId
- The current page idtranslations
- an association language-pageId, to set as translationsprotected Map<String,Page> _getTranslatedPages(Map<String,String> translations, String pageId)
translations
- the associative list of translations.pageId
- the current page ID.