Class DocumentContentService

java.lang.Object
fr.paris.lutece.portal.service.cache.AbstractCacheableService
fr.paris.lutece.portal.service.content.ContentService
fr.paris.lutece.plugins.document.service.DocumentContentService
All Implemented Interfaces:
fr.paris.lutece.portal.service.cache.CacheableService, fr.paris.lutece.portal.service.util.LuteceService, Cloneable, net.sf.ehcache.event.CacheEventListener

public final class DocumentContentService extends fr.paris.lutece.portal.service.content.ContentService implements net.sf.ehcache.event.CacheEventListener
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
     
    Returns the Content Service name
    getPage(javax.servlet.http.HttpServletRequest request, int nMode)
    Returns the document page for a given document and a given portlet.
    boolean
    isInvoked(javax.servlet.http.HttpServletRequest request)
    Analyzes request parameters to see if the request should be handled by the current Content Service
    void
    notifyElementEvicted(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
     
    void
    notifyElementExpired(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
     
    void
    notifyElementPut(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
     
    void
    notifyElementRemoved(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
     
    void
    notifyElementUpdated(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
     
    void
    notifyRemoveAll(net.sf.ehcache.Ehcache cache)
     
    void
    removeFromCache(String strDocumentId, String strPortletId)
    Remove a document from the cache

    Methods inherited from class fr.paris.lutece.portal.service.content.ContentService

    getPluginName, setPluginName

    Methods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService

    enableCache, getCache, getCacheSize, getFromCache, getInfos, getKeys, getMaxElements, getMemorySize, getStatistics, getTimeToLive, initCache, initCache, isCacheEnable, putInCache, removeKey, resetCache

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DocumentContentService

      public DocumentContentService()
  • Method Details

    • getPage

      public String getPage(javax.servlet.http.HttpServletRequest request, int nMode) throws fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.message.SiteMessageException
      Returns the document page for a given document and a given portlet. The page is built from XML data or retrieved from the cache if it's enable and the document in it.
      Specified by:
      getPage in class fr.paris.lutece.portal.service.content.ContentService
      Parameters:
      request - The HTTP request.
      nMode - The current mode.
      Returns:
      The HTML code of the page as a String.
      Throws:
      fr.paris.lutece.portal.service.security.UserNotSignedException - If the user is not signed
      fr.paris.lutece.portal.service.message.SiteMessageException - occurs when a site message need to be displayed
    • isInvoked

      public boolean isInvoked(javax.servlet.http.HttpServletRequest request)
      Analyzes request parameters to see if the request should be handled by the current Content Service
      Specified by:
      isInvoked in class fr.paris.lutece.portal.service.content.ContentService
      Parameters:
      request - The HTTP request
      Returns:
      true if this ContentService should handle this request
    • getName

      public String getName()
      Returns the Content Service name
      Specified by:
      getName in interface fr.paris.lutece.portal.service.util.LuteceService
      Returns:
      The name as a String
    • dispose

      public void dispose()
      Specified by:
      dispose in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      dispose in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      See Also:
      • CacheEventListener.dispose()
    • notifyElementEvicted

      public void notifyElementEvicted(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
      Specified by:
      notifyElementEvicted in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      notifyElementEvicted in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      See Also:
      • CacheEventListener.notifyElementEvicted(net.sf.ehcache.Ehcache, net.sf.ehcache.Element)
    • notifyElementExpired

      public void notifyElementExpired(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
      Specified by:
      notifyElementExpired in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      notifyElementExpired in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      See Also:
      • CacheEventListener.notifyElementExpired(net.sf.ehcache.Ehcache, net.sf.ehcache.Element)
    • notifyElementPut

      public void notifyElementPut(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element) throws net.sf.ehcache.CacheException
      Specified by:
      notifyElementPut in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      notifyElementPut in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      Throws:
      net.sf.ehcache.CacheException
      See Also:
      • CacheEventListener.notifyElementPut(net.sf.ehcache.Ehcache, net.sf.ehcache.Element)
    • notifyElementRemoved

      public void notifyElementRemoved(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element) throws net.sf.ehcache.CacheException
      Specified by:
      notifyElementRemoved in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      notifyElementRemoved in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      Throws:
      net.sf.ehcache.CacheException
      See Also:
      • CacheEventListener.notifyElementRemoved(net.sf.ehcache.Ehcache, net.sf.ehcache.Element)
    • notifyElementUpdated

      public void notifyElementUpdated(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element) throws net.sf.ehcache.CacheException
      Specified by:
      notifyElementUpdated in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      notifyElementUpdated in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      Throws:
      net.sf.ehcache.CacheException
      See Also:
      • CacheEventListener.notifyElementUpdated(net.sf.ehcache.Ehcache, net.sf.ehcache.Element)
    • notifyRemoveAll

      public void notifyRemoveAll(net.sf.ehcache.Ehcache cache)
      Specified by:
      notifyRemoveAll in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      notifyRemoveAll in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      See Also:
      • CacheEventListener.notifyRemoveAll(net.sf.ehcache.Ehcache)
    • clone

      public Object clone()
      Specified by:
      clone in interface net.sf.ehcache.event.CacheEventListener
      Overrides:
      clone in class fr.paris.lutece.portal.service.cache.AbstractCacheableService
      See Also:
    • removeFromCache

      public void removeFromCache(String strDocumentId, String strPortletId)
      Remove a document from the cache
      Parameters:
      strDocumentId - the document id
      strPortletId - the portlet id