Nov 9, 2021 3:40:06 PM Thomas Dumont avatar

Administration features

Presentation

The administration features correspond to the set functions available in the module administrator whatever his level of access: technical administrator, webmaster or local speaker.

For each feature corresponds a right that can be assigned to a user. This right is leveled to distinguish the different user profiles. Levels values rights are as follows :

0 Technical Administrator
1 Content Producer
2 Webmaster
3 Local speaker

When the user is authorized, the functionality appears in its home menu as a title and a description. By clicking on the link, the user access the JSP which is the entry point of the functionality.

Creation

To install a new administration feature in Lutece, it must be packaged in a plugin (see Lutece plugins).

Implementation

This JSP usually has a name of type Manage<MyFeature>.jsp. The code of the JSP must verify that the current user is authorized, and if so, it will call the method of JspBean associated with functionality (typically MyFeatureJspBean) rendering the homepage of it.

<% @ include file = .. / PluginAdminHeader.jsp%>

<jsp: useBean = myFeature scope = session class = en.paris.lutece.plugins.myplugin.web.MyFeatureJspBean />
<jsp: useBean id = user scope = session class = en.paris.lutece.portal.web.user.UserJspBean />

<%
if (user.check (MYFEATURE_MANAGEMENT))
{
%>
     <% = myFeature.getManageMyFeature (request)%>
<%
}
else
{
     response.sendRedirect (user.getPluginAccessDeniedUrl ());
}
%>
<% @ include file = .. / .. / AdminFooter.jsp%>

The JSP of the functionality receives in parameter of the HTTP request the name of the plugin with which it is associated ("plugin_name" parameter). This allows two plugins to share the same features in contexts different.

Declaration

The administration feature has to be declared in the plugin configuration file by adding the following lines :

<admin-features>
    <admin-feature>
        <feature-id>MYFEATURE_MANAGEMENT</feature-id>
        <feature-title>My Feature</feature-title>
        <feature-description>Description of my feature</feature-description>
        <feature-level>3</feature-level>
        <feature-url>plugins/myplugin/ManageMyFeature.jsp</feature-url>
    </admin-feature>
    ...
</admin-features>