Package com.simplicite.util
Class GrantHooksInterface
- java.lang.Object
-
- com.simplicite.util.GrantHooksInterface
-
- Direct Known Subclasses:
GrantHooks
,ScriptedGrantHooks
public abstract class GrantHooksInterface extends java.lang.Object
Grant hooks abstract class (empty implementation)
-
-
Constructor Summary
Constructors Constructor Description GrantHooksInterface()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canPreviewDocument(Grant g, DocumentDB doc)
Hook called before document previewstatic boolean
changeScope(Grant g, View home)
This method is called when the user has changed its application scopestatic java.lang.String
customAuth(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
This method is called before any standard authentication mechanism.static void
downloadDocument(Grant g, DocumentDB doc)
Hook called after allowing document for downloadstatic java.lang.String
event(Grant g, java.lang.String origin, java.lang.Object data)
Hook called on eventstatic java.lang.String
generatePassword(Grant g)
This method is called to generate a new password
The default implementation generates a random passwordstatic void
init(Grant g, Parameters params)
This method is dedicated to be called when initializing presentation layers (in particular it is called by generic web UI main page display)static boolean
isMenuEnable(Grant g, java.lang.String domain, java.lang.String item)
Hook to limit access to menustatic void
logout(Grant g)
Hook called before logoutstatic java.lang.String
parseAuth(Grant sys, SessionInfo info)
This method is called for session info to extract user login fromstatic java.lang.String
parseAuth(Grant sys, java.lang.String authString)
This LEGACY method is called for parsing authentication string to extract user login from
It is now replaced by theparseAuth
method with the session info argumentstatic void
postAuth(Grant sys, java.lang.String login, boolean success)
This method is called after processing internal authenticationstatic void
postLoadGrant(Grant g)
This method is called after loading grantstatic java.lang.String
postLoadHome(Grant g, java.lang.String home)
This method is called after loading home page (and before assigning it)static void
postLoadLogEvents(Grant g)
This method is called after loading log eventsstatic void
postLoadMenu(Grant g)
This method is called after loading user's menustatic void
postLoadProfile(Grant g)
This method is called after loading user profile datastatic void
postLoadResponsibilities(Grant g)
This method is called after loading user's menustatic java.util.List<java.lang.String>
postLoadScope(Grant g, java.util.List<java.lang.String> views)
Hook to customize the available scopesstatic void
postLoadSystemParams(Grant g)
This method is called after loading of system parametersstatic java.lang.String
postPlatformInit(Grant sys)
This method is called after platform initializationstatic java.util.List<SearchItem>
postSearchIndex(Grant g, java.util.List<SearchItem> rows)
Hook to change the result after the search in indexstatic java.util.List<SearchItem>
postSearchIndex(Grant g, java.util.List<SearchItem> rows, java.util.List<java.lang.String> objects, int context, ObjectDB parent)
Hook to change the result after the search in indexstatic void
preAuth(Grant sys, java.lang.String login, java.lang.String password)
This method is called before processing internal authenticationstatic void
preLoadGrant(Grant g)
This method is called before loading grantstatic void
preLoadHome(Grant g)
This method is called before loading home pagestatic void
preLoadLogEvents(Grant g)
This method is called before loading log eventsstatic void
preLoadMenu(Grant g)
This method is called before loading loading user's menustatic void
preLoadProfile(Grant g)
This method is called before loading user profile datastatic void
preLoadResponsibilities(Grant g)
This method is called before loading loading user's responsibilitiesstatic void
preLoadSystemParams(Grant g)
This method is called before loading of system parametersstatic java.lang.String
preSearchIndex(Grant g, java.lang.String search)
Hook to change the query before the search in indexstatic java.lang.String
preSearchIndex(Grant g, java.lang.String search, java.util.List<java.lang.String> objects, int context, ObjectDB parent)
Hook (extended) to change the query before the search in indexstatic void
socialPost(Grant g, java.lang.String postId, java.lang.String userId, java.lang.String message, boolean pub, java.lang.String target, java.lang.String rowId, java.lang.String level, java.lang.String status)
Hook called on social poststatic java.lang.String
unitTests(Grant g)
Unit testsstatic java.util.List<java.lang.String>
validatePassword(Grant g, java.lang.String password)
This method is called before updating the password
The default implementation checks minimum password size
-
-
-
Method Detail
-
postPlatformInit
public static java.lang.String postPlatformInit(Grant sys)
This method is called after platform initialization- Parameters:
sys
- System admin grant
-
customAuth
public static java.lang.String customAuth(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
This method is called before any standard authentication mechanism.
It can be used to return a custom authentication string from the incoming request.- Parameters:
request
- HTTP requestresponse
- HTTP response- Returns:
- Custom authentication string or null
- Throws:
java.lang.Exception
-
parseAuth
public static java.lang.String parseAuth(Grant sys, java.lang.String authString)
This LEGACY method is called for parsing authentication string to extract user login from
It is now replaced by theparseAuth
method with the session info argument- Parameters:
sys
- System admin grantauthString
- Authentication string to extract login from- Returns:
- Login
-
parseAuth
public static java.lang.String parseAuth(Grant sys, SessionInfo info)
This method is called for session info to extract user login from- Parameters:
sys
- System admin grantinfo
- Session info- Returns:
- Login
-
preAuth
public static void preAuth(Grant sys, java.lang.String login, java.lang.String password) throws GrantException
This method is called before processing internal authentication- Parameters:
sys
- System admin grantlogin
- Authentication stringpassword
- Authentication password- Throws:
GrantException
- to cancel authentication process
-
postAuth
public static void postAuth(Grant sys, java.lang.String login, boolean success) throws GrantException
This method is called after processing internal authentication- Parameters:
sys
- System admin grantlogin
- Authentication stringsuccess
- Authentication success?- Throws:
GrantException
- to cancel authentication success
-
preLoadGrant
public static void preLoadGrant(Grant g)
This method is called before loading grant- Parameters:
g
- Grant
-
postLoadGrant
public static void postLoadGrant(Grant g)
This method is called after loading grant- Parameters:
g
- Grant
-
preLoadSystemParams
public static void preLoadSystemParams(Grant g)
This method is called before loading of system parameters- Parameters:
g
- Grant
-
postLoadSystemParams
public static void postLoadSystemParams(Grant g)
This method is called after loading of system parameters- Parameters:
g
- Grant
-
preLoadProfile
public static void preLoadProfile(Grant g)
This method is called before loading user profile data- Parameters:
g
- Grant
-
postLoadProfile
public static void postLoadProfile(Grant g)
This method is called after loading user profile data- Parameters:
g
- Grant
-
preLoadResponsibilities
public static void preLoadResponsibilities(Grant g)
This method is called before loading loading user's responsibilities- Parameters:
g
- Grant
-
postLoadResponsibilities
public static void postLoadResponsibilities(Grant g)
This method is called after loading user's menu- Parameters:
g
- Grant
-
preLoadMenu
public static void preLoadMenu(Grant g)
This method is called before loading loading user's menu- Parameters:
g
- Grant
-
postLoadMenu
public static void postLoadMenu(Grant g)
This method is called after loading user's menu- Parameters:
g
- Grant
-
preLoadHome
public static void preLoadHome(Grant g)
This method is called before loading home page- Parameters:
g
- Grant
-
postLoadHome
public static java.lang.String postLoadHome(Grant g, java.lang.String home)
This method is called after loading home page (and before assigning it)- Parameters:
g
- Granthome
- Home page name- Returns:
- New home page name or null if no home page
-
preLoadLogEvents
public static void preLoadLogEvents(Grant g)
This method is called before loading log events- Parameters:
g
- Grant
-
postLoadLogEvents
public static void postLoadLogEvents(Grant g)
This method is called after loading log events- Parameters:
g
- Grant
-
generatePassword
public static java.lang.String generatePassword(Grant g)
This method is called to generate a new password
The default implementation generates a random password- Parameters:
g
- Grant
-
validatePassword
public static java.util.List<java.lang.String> validatePassword(Grant g, java.lang.String password)
This method is called before updating the password
The default implementation checks minimum password size- Parameters:
g
- Grantpassword
- Password
-
init
public static void init(Grant g, Parameters params)
This method is dedicated to be called when initializing presentation layers (in particular it is called by generic web UI main page display)- Parameters:
g
- Grantparams
- Parameters
-
changeScope
public static boolean changeScope(Grant g, View home)
This method is called when the user has changed its application scope- Parameters:
g
- Granthome
- new home page- Returns:
- true on success
-
postLoadScope
public static java.util.List<java.lang.String> postLoadScope(Grant g, java.util.List<java.lang.String> views)
Hook to customize the available scopes- Parameters:
g
- User rightsviews
- List of home pages based on user rights- Returns:
- Available views
-
isMenuEnable
public static boolean isMenuEnable(Grant g, java.lang.String domain, java.lang.String item)
Hook to limit access to menu- Parameters:
g
- User rightsdomain
- Domain nameitem
- Optional Object or Process name- Returns:
- true when menu item can be displayed
-
preSearchIndex
public static java.lang.String preSearchIndex(Grant g, java.lang.String search)
Hook to change the query before the search in index- Parameters:
g
- User rightssearch
- User query- Returns:
- Overridden query
-
preSearchIndex
public static java.lang.String preSearchIndex(Grant g, java.lang.String search, java.util.List<java.lang.String> objects, int context, ObjectDB parent)
Hook (extended) to change the query before the search in index- Parameters:
g
- User rightssearch
- User queryobjects
- Optional list of objects to limit searchcontext
- Search contextparent
- Optional parent context (OBJECT_REFSELECT)- Returns:
- Overridden query
-
postSearchIndex
public static java.util.List<SearchItem> postSearchIndex(Grant g, java.util.List<SearchItem> rows)
Hook to change the result after the search in index- Parameters:
g
- User rightsrows
- search result- Returns:
- Overridden result
-
postSearchIndex
public static java.util.List<SearchItem> postSearchIndex(Grant g, java.util.List<SearchItem> rows, java.util.List<java.lang.String> objects, int context, ObjectDB parent)
Hook to change the result after the search in index- Parameters:
g
- User rightsrows
- search resultobjects
- Optional list of objects to limit searchcontext
- Search contextparent
- Optional parent context (OBJECT_REFSELECT)- Returns:
- Overridden result
-
canPreviewDocument
public static boolean canPreviewDocument(Grant g, DocumentDB doc)
Hook called before document preview- Parameters:
g
- User rightsdoc
- Document- Returns:
- true if preview is permitted
-
downloadDocument
public static void downloadDocument(Grant g, DocumentDB doc)
Hook called after allowing document for download- Parameters:
g
- User rightsdoc
- Document
-
event
public static java.lang.String event(Grant g, java.lang.String origin, java.lang.Object data) throws java.lang.Exception
Hook called on event- Parameters:
g
- Grantorigin
- Event origindata
- Event data- Returns:
- Event processing log
- Throws:
java.lang.Exception
-
socialPost
public static void socialPost(Grant g, java.lang.String postId, java.lang.String userId, java.lang.String message, boolean pub, java.lang.String target, java.lang.String rowId, java.lang.String level, java.lang.String status)
Hook called on social post- Parameters:
g
- GrantpostId
- Social post row IDuserId
- Author row IDmessage
- Posted messagepub
- Public or private?target
- Optional object namerowId
- Optional object row IDlevel
- Optional level of audit poststatus
- Optional status of audit post
-
logout
public static void logout(Grant g)
Hook called before logout- Parameters:
g
- User rights
-
unitTests
public static java.lang.String unitTests(Grant g)
Unit tests- Parameters:
g
- User rights- Returns:
- Unit tests results
-
-