public class URLBasedDynamicInformationProvider extends AbstractLogEnabled implements DynamicInformationProvider, Configurable, PluginAware, Serviceable
DynamicInformationProvider
allowing to SAX information from a confiured URL.Modifier and Type | Field and Description |
---|---|
private static Pattern |
__CONFIG_PARAM_PATTERN |
private static Pattern |
__SITE_CONFIG_PARAM_PATTERN |
private String |
_id |
private I18nizableText |
_label |
private String |
_pluginName |
private SiteManager |
_siteManager |
private SourceResolver |
_sourceResolver |
private String |
_url |
Constructor and Description |
---|
URLBasedDynamicInformationProvider() |
Modifier and Type | Method and Description |
---|---|
private String |
_handleVariable(String url,
String siteName,
String lang,
int nbItems) |
private void |
_saxInformation(ContentHandler contentHandler,
InputStream xml)
Sax xml feed returned by URL provider.
|
private boolean |
_xsdValidation(InputStream xml)
Verify if an XML document is an instance of a specified XML schema.
|
void |
configure(Configuration configuration) |
String |
getId()
Get id of this provider
|
I18nizableText |
getLabel()
Get label of this provider
|
String |
getUrl()
Get the url of the WebService
|
void |
saxDynamicInformation(ContentHandler contentHandler,
String linkId,
String siteName,
String lang,
int nbItems)
SAX the dynamic information for a specific link
|
void |
service(ServiceManager manager) |
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
getLogger, setLogger
private static final Pattern __CONFIG_PARAM_PATTERN
private static final Pattern __SITE_CONFIG_PARAM_PATTERN
private SiteManager _siteManager
private String _pluginName
private I18nizableText _label
private SourceResolver _sourceResolver
public URLBasedDynamicInformationProvider()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void saxDynamicInformation(ContentHandler contentHandler, String linkId, String siteName, String lang, int nbItems) throws Exception
DynamicInformationProvider
saxDynamicInformation
in interface DynamicInformationProvider
contentHandler
- The contenthandler to sax intolinkId
- The id of link.siteName
- The current site namelang
- The language used.nbItems
- The number of item to get for tooltip.Exception
- if an exception error occurs.private String _handleVariable(String url, String siteName, String lang, int nbItems)
private boolean _xsdValidation(InputStream xml)
xml
- The XML feed.private void _saxInformation(ContentHandler contentHandler, InputStream xml) throws Exception
contentHandler
- The content handler to sax intoxml
- The xml feed.Exception
- if exception error occurs.public String getId()
DynamicInformationProvider
getId
in interface DynamicInformationProvider
public I18nizableText getLabel()
DynamicInformationProvider
getLabel
in interface DynamicInformationProvider