public class GlossaryDAO extends AbstractLogEnabled implements Serviceable, Component
Modifier and Type | Field and Description |
---|---|
protected AmetysObjectResolver |
_resolver
Ametys object resolver
|
protected SiteManager |
_siteManager
The site manager
|
static String |
ROLE
The Avalon role
|
Constructor and Description |
---|
GlossaryDAO() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_wordExists(String word,
String siteName,
String language)
Tests if the specified word exists in the glossary.
|
Map<String,String> |
createDefinition(String word,
String variants,
String content,
String display,
String siteName,
String language)
Creates a word definition.
|
Map<String,Object> |
deleteDefinitions(ArrayList<String> ids)
Deletes word definitions.
|
Map<String,String> |
editDefinition(String id,
String word,
String variants,
String content,
String display,
String siteName,
String language)
Edits a word definition.
|
Map<String,Object> |
getDefinition(DefaultDefinition wordDefinition)
Get the definition in JSON
|
Map<String,Object> |
getDefinition(String id)
Get properties of a word definition
|
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected SiteManager _siteManager
protected AmetysObjectResolver _resolver
public GlossaryDAO()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getDefinition(String id)
id
- the id of definitionpublic Map<String,Object> getDefinition(DefaultDefinition wordDefinition)
wordDefinition
- the word definitionpublic Map<String,String> createDefinition(String word, String variants, String content, String display, String siteName, String language)
word
- The wordvariants
- The variantscontent
- The contentdisplay
- The value of displayOnTextsiteName
- The site namelanguage
- The languagepublic Map<String,String> editDefinition(String id, String word, String variants, String content, String display, String siteName, String language)
id
- The id of the word to editword
- The new wordvariants
- The new variantscontent
- The new contentdisplay
- The new value of displayOnTextsiteName
- The site namelanguage
- The languagepublic Map<String,Object> deleteDefinitions(ArrayList<String> ids)
ids
- The ids of definitions to deleteprotected boolean _wordExists(String word, String siteName, String language) throws AmetysRepositoryException
word
- The word to test.siteName
- The site name.language
- The language.AmetysRepositoryException
- if a repository error occurs.