Class DashboardIdentityUtils

java.lang.Object
fr.paris.lutece.plugins.mydashboard.modules.identity.util.DashboardIdentityUtils

public class DashboardIdentityUtils extends Object
class to help managing identity feature
  • Field Details

  • Method Details

    • getInstance

      public static DashboardIdentityUtils 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 convert
      contractSearchResponse - 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 convert
      bOnlyMandatory - 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 convert
      bOnlyMandatory - true the IdentitityDTO must contains only Mandatory informations
      attributeCategory - 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 DashboardIdentity
      attributeCategory - only populate attribute associate to the category
      request - 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 id
      strAppCode - the str app code
      Returns:
      the identity
    • getIdentityCoverage

      public int getIdentityCoverage(String strConnectionId, String strAppCode)
      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

      public Map<String,String> 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

      public String getRedirectUrlAfterCompletionInSession(javax.servlet.http.HttpServletRequest request)
      Parameters:
      request -
      Returns:
    • setRedirectUrlAfterCompletionInSession

      public void setRedirectUrlAfterCompletionInSession(String strPage, String strView, javax.servlet.http.HttpServletRequest request)
      Parameters:
      strRedirectXPage -
      request -
    • getNumericServiceNameInSession

      public String getNumericServiceNameInSession(javax.servlet.http.HttpServletRequest request)
      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

      public List<String> getAllSuspiciousIdentityRules()
      Gets all rules
      Returns:
    • getSuspiciousIdentityStrictRules

      public List<String> getSuspiciousIdentityStrictRules()
      Gets strict rules
      Returns:
      list of strict rules
    • getSuspiciousIdentityNotStrictRules

      public List<String> 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

      public boolean isMandatoryCompletionCreateAndCompletionAccount(Map.Entry<String,String> attribute)
      Return true if the attribute is mandatory for create account completion
      Parameters:
      attribute -
      Returns:
      true if the attributie is mandatory
    • isMandatoryCompletionModifyAccount

      public boolean isMandatoryCompletionModifyAccount(Map.Entry<String,String> attribute)
      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

      public static boolean isDashboardAttributeCertified(DashboardAttribute dashboardAttribute)
      return true if the attribute have a level of certification > declaratif
      Parameters:
      dashboardAttribute -
      Returns:
    • isCertifiedIdentity

      public boolean isCertifiedIdentity(DashboardIdentity dashboardIdentity)
      Return true if identity is certified ( > 400)
      Parameters:
      dashboardIdentity -
      Returns:
      true if identity is certified
    • getMapAttributeKey

      public Map<String,String> getMapAttributeKey(AttributeCategory attributeCategory)
      get Map Attributes Keys
      Parameters:
      attributeCategory - the attribute Category
      Returns:
      Map Attributes
    • printJsonObjectAsString

      public static String printJsonObjectAsString(Object o)
      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: