Class DominoUtils


  • public class DominoUtils
    extends java.lang.Object
    Utility class
    • Constructor Summary

      Constructors 
      Constructor Description
      DominoUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String buildNotesFormulaElement​(SearchCriteria.rscSearch criteria)
      Builds Notes formula element.
      static SearchCriteria cloneSearchCriteria​(SearchCriteria aSearch)
      Clones the search criteria.
      static boolean denyGroupExist​(lotus.domino.Database aDatabase, java.lang.String aDenyGroupName, java.lang.String denyGroupViewName)
      Checks if the provided group name is in the data base view with the denied groups.
      static java.lang.String getDenyGroupViewName​(lotus.domino.Database database)
      Try to guess the name of the view that contains the deny groups
      static java.lang.String getNotesFormula​(SearchCriteria aSearch)
      Builds Notes formula.
      static java.lang.String getUserAbbreviatedName​(lotus.domino.Session aSession, java.lang.String aUserName)
      Retrieves user's abbreviated name.
      static java.lang.String getUserCanonicalName​(lotus.domino.Session aSession, java.lang.String aUserName)
      Retrieves the canonical name of the user.
      static boolean groupExist​(lotus.domino.Database aDatabase, java.lang.String aGroupName)
      Checks if the provided group name exists in the database.
      static boolean isDenyGroupMember​(lotus.domino.Database aDatabase, java.lang.String aUserName)
      Checks whether a user is in the deny groups view of the data base.
      static boolean isDenyGroupMember​(lotus.domino.Database aDatabase, java.lang.String aUserName, java.lang.String aDenyGroupName)
      Performs verification if the the group is part of the deny groups of the data base and if so is the user part of this group.
      static boolean isDenyGroupMember​(lotus.domino.Document aDenyGroupDoc, java.lang.String aUserName)
      Checks whether the provided name is in the denied list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VIEW_NAME_DENY_GROUPS

        public static final java.lang.String VIEW_NAME_DENY_GROUPS
        View name : "Server\\Deny Access Groups"
        See Also:
        Constant Field Values
      • VIEW_NAME_DENY_GROUPS_2

        public static final java.lang.String VIEW_NAME_DENY_GROUPS_2
        New name for deny list view
        See Also:
        Constant Field Values
      • ITEM_NAME_GROUP_NAME

        public static final java.lang.String ITEM_NAME_GROUP_NAME
        Item name : "ListName"
        See Also:
        Constant Field Values
      • ITEM_NAME_GROUP_MEMBERS

        public static final java.lang.String ITEM_NAME_GROUP_MEMBERS
        Item name : "Members"
        See Also:
        Constant Field Values
      • ITEM_NAME_FORM

        public static final java.lang.String ITEM_NAME_FORM
        Item name : "Form"
        See Also:
        Constant Field Values
      • ITEM_VALUE_PERSON

        public static final java.lang.String ITEM_VALUE_PERSON
        Item value : "Person"
        See Also:
        Constant Field Values
      • GROUP_SEARCH_FILTER

        public static final java.lang.String GROUP_SEARCH_FILTER
        Group search filter : "Form = \"Group\""
        See Also:
        Constant Field Values
    • Constructor Detail

      • DominoUtils

        public DominoUtils()
    • Method Detail

      • groupExist

        public static boolean groupExist​(lotus.domino.Database aDatabase,
                                         java.lang.String aGroupName)
                                  throws lotus.domino.NotesException
        Checks if the provided group name exists in the database.
        Parameters:
        aDatabase - date base to look into.
        aGroupName - name of the group
        Returns:
        true if exists.
        Throws:
        lotus.domino.NotesException
      • denyGroupExist

        public static boolean denyGroupExist​(lotus.domino.Database aDatabase,
                                             java.lang.String aDenyGroupName,
                                             java.lang.String denyGroupViewName)
                                      throws lotus.domino.NotesException
        Checks if the provided group name is in the data base view with the denied groups.
        Parameters:
        aDatabase - database to look into
        aDenyGroupName - group name to look for
        denyGroupViewName - name of view containing deny groups
        Returns:
        true if group is denied.
        Throws:
        lotus.domino.NotesException - if an error occurs.
      • isDenyGroupMember

        public static boolean isDenyGroupMember​(lotus.domino.Document aDenyGroupDoc,
                                                java.lang.String aUserName)
                                         throws java.lang.Exception
        Checks whether the provided name is in the denied list.
        Parameters:
        aDenyGroupDoc - deny group Document to look into
        aUserName - user name to check
        Returns:
        true if match found
        Throws:
        java.lang.Exception - if an error occurs.
      • isDenyGroupMember

        public static boolean isDenyGroupMember​(lotus.domino.Database aDatabase,
                                                java.lang.String aUserName)
                                         throws java.lang.Exception
        Checks whether a user is in the deny groups view of the data base.
        Parameters:
        aDatabase - data base to check
        aUserName - user name to check
        Returns:
        true if match found
        Throws:
        java.lang.Exception - if an error occurs.
      • isDenyGroupMember

        public static boolean isDenyGroupMember​(lotus.domino.Database aDatabase,
                                                java.lang.String aUserName,
                                                java.lang.String aDenyGroupName)
                                         throws java.lang.Exception
        Performs verification if the the group is part of the deny groups of the data base and if so is the user part of this group.
        Parameters:
        aDatabase - data base to search into
        aUserName - user name to check
        aDenyGroupName - name of the deny group
        Returns:
        true if the user is part of the deny group.
        Throws:
        java.lang.Exception - if the provided group deny name is not in the database view or if some other error occurs.
      • getUserCanonicalName

        public static java.lang.String getUserCanonicalName​(lotus.domino.Session aSession,
                                                            java.lang.String aUserName)
                                                     throws lotus.domino.NotesException
        Retrieves the canonical name of the user.
        Parameters:
        aSession - Session
        aUserName - user name
        Returns:
        user's canonical name
        Throws:
        lotus.domino.NotesException - if an error occurs
      • getUserAbbreviatedName

        public static java.lang.String getUserAbbreviatedName​(lotus.domino.Session aSession,
                                                              java.lang.String aUserName)
                                                       throws lotus.domino.NotesException
        Retrieves user's abbreviated name.
        Parameters:
        aSession - Session
        aUserName - user name
        Returns:
        user's abbreviated name
        Throws:
        lotus.domino.NotesException
      • cloneSearchCriteria

        public static SearchCriteria cloneSearchCriteria​(SearchCriteria aSearch)
        Clones the search criteria.
        Parameters:
        aSearch - SearchCriteria to copy
        Returns:
        exact copy of the provided SearchCriteria
      • buildNotesFormulaElement

        public static java.lang.String buildNotesFormulaElement​(SearchCriteria.rscSearch criteria)
        Builds Notes formula element.
        Parameters:
        criteria - search criteria
        Returns:
        the built element
      • getDenyGroupViewName

        public static java.lang.String getDenyGroupViewName​(lotus.domino.Database database)
                                                     throws lotus.domino.NotesException
        Try to guess the name of the view that contains the deny groups
        Parameters:
        database -
        Returns:
        Throws:
        lotus.domino.NotesException