Aug 8, 2018 3:03:19 PM Alexandre CLOSE avatar   919

Create a new ContentService


Definition

A content service is a content service that is responsible for producing himself his pages. Each content service has a call parameter that allows to the portal to dispatcher requests on the service. Lutece uses several default ContentServices that:

ServiceParameter Description
PageService id_page Lutece page construction and display service
ArticleService id_article Building and display service of Lutece items
SearchService query Lutece Research Service
XPageService page Lutear's XPage Application Container

Interface of a ContentService

Here are the methods of the interface of a ContentService:

MethodDescription
getName Returns the name of the content service.
isInvoked Determines from the parameters of the HTTP request, if it is intended for it. For example, the PageService service will check that the query contains the id_page parameter.
getCache Indicates whether the service has a cache enabled.
getCacheSize Returns the number of objects in the cache.
getPage Constructs a page for query and mode parameters.
resetCache Empty the content service cache.

Creating a ContentService

It is possible to add new content services through the through plugins. The plugin will have to define the ContentService in its file deployment as follows:

<!-- Content Service -->
  <content-services>
     <content-service>
         <content-service-id>myContentService</content-service-id>
         <content-service-class>fr.paris.lutece.plugins.myplugin.service.MyContentService</content-service-class>
     </content-service> 
  </content-services>