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) |
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 TranslationPageDAO _translationPageDAO
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> _getTranslatedPages(Map<String,String> translations, String pageId)
translations
- the associative list of translations.pageId
- the current page ID.