public class TranslationFlaggingClientSideElement extends StaticClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
Modifier and Type | Field and Description |
---|---|
private ObservationManager |
_observationManager |
private AmetysObjectResolver |
_resolver |
private SiteManager |
_siteManager |
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 void |
_cleanPage(ModifiablePage page)
Clean a page of its translations metadata.
|
protected Map<String,Page> |
_getTranslatedPages(Map<String,String> translations,
String pageId)
Get translated pages from the map.
|
protected Map<String,Page> |
_getTranslations(Page page)
Get the translation of a given page.
|
private Map<String,String> |
_page2json(Page page) |
protected void |
_setTranslations(ModifiablePage page,
Map<String,Page> pages)
Set the translations of a page in its metadata.
|
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, getScripts, hasRight, setPluginInfo, toString
getLogger, setLogger
public static final String TRANSLATIONS_META
private AmetysObjectResolver _resolver
private SiteManager _siteManager
private ObservationManager _observationManager
public TranslationFlaggingClientSideElement()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class StaticFileImportsClientSideElement
ServiceException
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> _getTranslations(Page page)
page
- the page.protected Map<String,Page> _getTranslatedPages(Map<String,String> translations, String pageId)
translations
- the associative list of translations.pageId
- the current page ID.protected void _setTranslations(ModifiablePage page, Map<String,Page> pages)
page
- the page.pages
- the translated pages to set.protected void _cleanPage(ModifiablePage page)
page
- the page to clean.