public class ThemeDAO extends AbstractLogEnabled implements Serviceable, Component
Theme
Modifier and Type | Field and Description |
---|---|
private CurrentUserProvider |
_currentUserProvider |
private DirectoryHelper |
_directoryHelper |
private ObservationManager |
_observationManager |
private AmetysObjectResolver |
_resolver |
private SiteManager |
_siteManager |
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
ThemeDAO() |
Modifier and Type | Method and Description |
---|---|
private Set<String> |
_deleteThemeRefIntoLinks(String siteName,
String lang,
String themeId) |
private Set<String> |
_getReferencingLinks(String siteName,
String lang,
String themeId) |
String |
createTheme(String siteName,
String language,
String originalLabel)
Create a new theme
|
Map<String,Object> |
deleteTheme(List<String> ids)
Delete themes
|
Map<String,Object> |
getTheme(String themeId)
Convert a
Theme to JSON object |
Map<String,Object> |
getThemes(List<String> ids)
Get themes
|
void |
service(ServiceManager manager) |
protected boolean |
themeExists(String label,
String siteName,
String language)
Test if a link with the specified url exists in the directory.
|
Map<String,Object> |
updateTheme(String siteName,
String language,
String id,
String label)
Update a theme
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private AmetysObjectResolver _resolver
private ObservationManager _observationManager
private SiteManager _siteManager
private CurrentUserProvider _currentUserProvider
private DirectoryHelper _directoryHelper
public ThemeDAO()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getThemes(List<String> ids)
ids
- the id of themespublic Map<String,Object> getTheme(String themeId) throws UnknownAmetysObjectException
Theme
to JSON objectthemeId
- the theme's idUnknownAmetysObjectException
- if the theme does not exist.public String createTheme(String siteName, String language, String originalLabel)
siteName
- the site namelanguage
- the site languageoriginalLabel
- the label of the themepublic Map<String,Object> deleteTheme(List<String> ids)
ids
- the id of themes to deletepublic Map<String,Object> updateTheme(String siteName, String language, String id, String label)
siteName
- the site namelanguage
- the site languageid
- the theme idlabel
- the new theme labelprivate Set<String> _getReferencingLinks(String siteName, String lang, String themeId)
private Set<String> _deleteThemeRefIntoLinks(String siteName, String lang, String themeId)
protected boolean themeExists(String label, String siteName, String language) throws AmetysRepositoryException
label
- the url to test.siteName
- the site name.language
- the language.AmetysRepositoryException
- if a repository error occurs.