Class DashboardIdentityUtils
java.lang.Object
fr.paris.lutece.plugins.mydashboard.modules.identity.util.DashboardIdentityUtils
class to help managing identity feature
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionconvertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity) return an dashboardIdentity from a identityDtoconvertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse) return an dashboardIdentity from a identityDtofr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtoconvertToIdentityDto(DashboardIdentity dashboardIdentity, boolean bOnlyMandatory) return an identityDto from a DashboardIdentityfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtoconvertToIdentityDto(DashboardIdentity dashboardIdentity, boolean bOnlyMandatory, AttributeCategory attributeCategory) return an identityDto from a DashboardIdentityvoidfilterByCertifier(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity) Drop attributes from IdentityDto if there is a certificate.Gets all rulesgetCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request) fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtogetIdentity(String strConnectionId) Gets the identity.fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtogetIdentity(String strConnectionId, String strAppCode) Gets the identity.intgetIdentityCoverage(String strConnectionId, String strAppCode) Get Identity Coverage for a connectionId and a app Coestatic DashboardIdentityUtilsgetMapAttributeKey(AttributeCategory attributeCategory) get Map Attributes KeysgetMessageInSession(boolean bErrorMessage, boolean bRemoveAttribute, javax.servlet.http.HttpServletRequest request) Get message in the sessiongetNumericServiceNameInSession(javax.servlet.http.HttpServletRequest request) Get name of numeric service in the sessionfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthorGets the owner request author.getRedirectUrlAfterCompletionInSession(javax.servlet.http.HttpServletRequest request) Gets not strict rulesGets strict rulesinitMandatoryAttributeForCompletionIdentity(DashboardIdentity completionIdentity, String strOriginActionCompletion) Set mandatory attribute for completion identitybooleanisCertifiedIdentity(DashboardIdentity dashboardIdentity) Return true if identity is certified ( > 400)static booleanisContaintEmptyAttribute(DashboardIdentity dasboardIdentity, List<String> listAttributesName) Return true if any of the attributes in the list are empty in the Identity Dashboardstatic booleanisDashboardAttributeCertified(DashboardAttribute dashboardAttribute) return true if the attribute have a level of certification > declaratifbooleanisMandatoryAttribute(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, String identityAttributeKey) Return true if the attribute is mandatorybooleanReturn true if the attribute is mandatory for create account completionbooleanisMandatoryCompletionModifyAccount(Map.Entry<String, String> attribute) Return true if the attribute is mandatory for modify account completionbooleanneedCertification(DashboardIdentity dashboardIdentity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, List<String> strAttributesNeedFC, int nLevelMin, int nLevelMax) voidpopulateDashboardIdentity(DashboardIdentity identity, javax.servlet.http.HttpServletRequest request, AttributeCategory attributeCategory) populaite DashboardIdentity from the requeststatic StringPrint JsonObject as StringvoidsetCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request, DashboardIdentity dashboardIdentity) voidsetMessageInSession(String strMessage, boolean bErrorMessage, javax.servlet.http.HttpServletRequest request) Set message in the sessionvoidsetNumericServiceNameInSession(String strServiceNumericName, javax.servlet.http.HttpServletRequest request) Set Numeric service name in sessionvoidsetRedirectUrlAfterCompletionInSession(String strPage, String strView, javax.servlet.http.HttpServletRequest request) voidupdateDashboardIdentityInSession(DashboardIdentity currentDasboardIdentity, DashboardIdentity dasboardIdentitySession) Update dashboardIdentity in the sessionvoidupdateIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity) Update Identity from an IdentityDto.
-
Field Details
-
DASHBOARD_APP_CODE
-
SESSION_ERROR_MESSAGE
- See Also:
-
SESSION_INFO_MESSAGE
- See Also:
-
SESSION_SN_NAME
- See Also:
-
-
Method Details
-
getInstance
-
convertToDashboardIdentity
public DashboardIdentity convertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity) return an dashboardIdentity from a identityDto- Parameters:
identitySearchResponse- identitySearchResponse to convert- Returns:
- dashboardIdentity initialized from provided identityDto
-
convertToDashboardIdentity
public DashboardIdentity convertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse) return an dashboardIdentity from a identityDto- Parameters:
identity- identityDto to convertcontractSearchResponse- The App contract- Returns:
- dashboardIdentity initialized from provided identityDto
-
needCertification
public boolean needCertification(DashboardIdentity dashboardIdentity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, List<String> strAttributesNeedFC, int nLevelMin, int nLevelMax) -
convertToIdentityDto
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto convertToIdentityDto(DashboardIdentity dashboardIdentity, boolean bOnlyMandatory) return an identityDto from a DashboardIdentity- Parameters:
dashboardIdentity- dashboardIdentity to convertbOnlyMandatory- true the IdentitityDTO must contains only Mandatory informations- Returns:
- identityDto initialized from provided dashboardIdentity
-
convertToIdentityDto
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto convertToIdentityDto(DashboardIdentity dashboardIdentity, boolean bOnlyMandatory, AttributeCategory attributeCategory) return an identityDto from a DashboardIdentity- Parameters:
dashboardIdentity- dashboardIdentity to convertbOnlyMandatory- true the IdentitityDTO must contains only Mandatory informationsattributeCategory- update only attribute in this category- Returns:
- identityDto initialized from provided dashboardIdentity
-
isMandatoryAttribute
public boolean isMandatoryAttribute(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, String identityAttributeKey) Return true if the attribute is mandatory- Parameters:
contractSearchResponse-identityAttributeKey-- Returns:
- true if the attribute key is mandatory
-
populateDashboardIdentity
public void populateDashboardIdentity(DashboardIdentity identity, javax.servlet.http.HttpServletRequest request, AttributeCategory attributeCategory) populaite DashboardIdentity from the request- Parameters:
identity- the DashboardIdentityattributeCategory- only populate attribute associate to the categoryrequest- the HttpServletRequest
-
filterByCertifier
public void filterByCertifier(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity) Drop attributes from IdentityDto if there is a certificate. This is used to not update identity when a certificate is found.- Parameters:
identity-
-
getIdentity
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getIdentity(String strConnectionId) Gets the identity.- Parameters:
strConnectionId- the str connection id- Returns:
- the identity
-
getIdentity
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getIdentity(String strConnectionId, String strAppCode) Gets the identity.- Parameters:
strConnectionId- the str connection idstrAppCode- the str app code- Returns:
- the identity
-
getIdentityCoverage
Get Identity Coverage for a connectionId and a app Coe- Parameters:
strConnectionId-strAppCode-- Returns:
-
updateIdentity
public void updateIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity) throws fr.paris.lutece.portal.service.util.AppException Update Identity from an IdentityDto.- Parameters:
identityDto- identity Data transfer Object- Throws:
fr.paris.lutece.portal.service.util.AppException- the app exception
-
getOwnerRequestAuthor
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor getOwnerRequestAuthor()Gets the owner request author.- Returns:
- the owner request author
-
getMapAttributeKeyMatch
- Returns:
-
getCurrentDashboardIdentityInSession
public DashboardIdentity getCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request) - Parameters:
request-- Returns:
-
setCurrentDashboardIdentityInSession
public void setCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request, DashboardIdentity dashboardIdentity) - Parameters:
request-dashboardIdentity-
-
getRedirectUrlAfterCompletionInSession
- Parameters:
request-- Returns:
-
setRedirectUrlAfterCompletionInSession
public void setRedirectUrlAfterCompletionInSession(String strPage, String strView, javax.servlet.http.HttpServletRequest request) - Parameters:
strRedirectXPage-request-
-
getNumericServiceNameInSession
Get name of numeric service in the session- Parameters:
request-- Returns:
- the name of numeric service in the session
-
setNumericServiceNameInSession
public void setNumericServiceNameInSession(String strServiceNumericName, javax.servlet.http.HttpServletRequest request) Set Numeric service name in session- Parameters:
strServiceNumericName-request-
-
getMessageInSession
public String getMessageInSession(boolean bErrorMessage, boolean bRemoveAttribute, javax.servlet.http.HttpServletRequest request) Get message in the session- Parameters:
bErrorMessage- ( set true if is a error message and false if is a info message )bRemoveAttribute-request-request-- Returns:
- the message in session
-
setMessageInSession
public void setMessageInSession(String strMessage, boolean bErrorMessage, javax.servlet.http.HttpServletRequest request) Set message in the session- Parameters:
strMessage-bErrorMessage- ( set true if is a error message and false if is a info message )request-
-
getAllSuspiciousIdentityRules
Gets all rules- Returns:
-
getSuspiciousIdentityStrictRules
Gets strict rules- Returns:
- list of strict rules
-
getSuspiciousIdentityNotStrictRules
Gets not strict rules- Returns:
- list of not strict rules
-
initMandatoryAttributeForCompletionIdentity
public DashboardIdentity initMandatoryAttributeForCompletionIdentity(DashboardIdentity completionIdentity, String strOriginActionCompletion) Set mandatory attribute for completion identity -
isMandatoryCompletionCreateAndCompletionAccount
Return true if the attribute is mandatory for create account completion- Parameters:
attribute-- Returns:
- true if the attributie is mandatory
-
isMandatoryCompletionModifyAccount
Return true if the attribute is mandatory for modify account completion- Parameters:
attribute-- Returns:
- true if the attribute is mandatory
-
updateDashboardIdentityInSession
public void updateDashboardIdentityInSession(DashboardIdentity currentDasboardIdentity, DashboardIdentity dasboardIdentitySession) Update dashboardIdentity in the session- Parameters:
currentDasboardIdentity-currentDasboardIdentity- in session
-
isDashboardAttributeCertified
return true if the attribute have a level of certification > declaratif- Parameters:
dashboardAttribute-- Returns:
-
isCertifiedIdentity
Return true if identity is certified ( > 400)- Parameters:
dashboardIdentity-- Returns:
- true if identity is certified
-
getMapAttributeKey
get Map Attributes Keys- Parameters:
attributeCategory- the attribute Category- Returns:
- Map Attributes
-
printJsonObjectAsString
Print JsonObject as String- Parameters:
o- the json Object- Returns:
- Json String
-
isContaintEmptyAttribute
public static boolean isContaintEmptyAttribute(DashboardIdentity dasboardIdentity, List<String> listAttributesName) Return true if any of the attributes in the list are empty in the Identity Dashboard- Parameters:
dasboardIdentity-listAttributesName-- Returns:
-