Package org.ametys.plugins.core.ui.about
Class AboutInfoProvider
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.ui.about.AboutInfoProvider
-
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
public class AboutInfoProvider extends AbstractLogEnabled implements Serviceable, Component, Contextualizable
Helper providing information (versions, licenses) on running application for "About Ametys" feature.
-
-
Field Summary
Fields Modifier and Type Field Description private Context
_cocoonContext
The cocoon contextprivate VersionsHandler
_versionsHandler
The versions handlerprivate static String
LOGO_FILE_PATH
The path of the Application logoprivate static String
NOTICE_FILE_PATH
The name of the license text filestatic String
ROLE
The Avalon role
-
Constructor Summary
Constructors Constructor Description AboutInfoProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextualize(Context context)
String
getApplicationLogo()
Get the path of the application logoString
getApplicationName(String lang)
Gets the application nameMap<String,Object>
getInfo(String lang)
Gets the information for "About Ametys" featureString
getLicenseText()
Gets the content of the license text.List<Map<String,Object>>
getVersions()
Gets the available versions of the application.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
NOTICE_FILE_PATH
private static final String NOTICE_FILE_PATH
The name of the license text file- See Also:
- Constant Field Values
-
LOGO_FILE_PATH
private static final String LOGO_FILE_PATH
The path of the Application logo- See Also:
- Constant Field Values
-
_versionsHandler
private VersionsHandler _versionsHandler
The versions handler
-
_cocoonContext
private Context _cocoonContext
The cocoon context
-
-
Constructor Detail
-
AboutInfoProvider
public AboutInfoProvider()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getInfo
public Map<String,Object> getInfo(String lang) throws IOException
Gets the information for "About Ametys" feature- Parameters:
lang
- the lang- Returns:
- A map of information needed for "About Ametys" feature. Contains the application name, the versions of the application and the license text.
- Throws:
IOException
- if there are issue while reading the license file
-
getApplicationLogo
public String getApplicationLogo()
Get the path of the application logo- Returns:
- The path to the Ametys application logo.
-
getApplicationName
public String getApplicationName(String lang)
Gets the application name- Parameters:
lang
- The lang- Returns:
- The name of the application.
-
getVersions
public List<Map<String,Object>> getVersions()
Gets the available versions of the application.- Returns:
- The list of versions
-
getLicenseText
public String getLicenseText() throws IOException
Gets the content of the license text.- Returns:
- The content of the license text.
- Throws:
IOException
- If the license file cannot be read
-
-