SAP NetWeaver '04

com.sapportals.wcm.util.usermanagement
Class SelectionUserManager

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.usermanagement.SelectionUserManager

public final class SelectionUserManager
extends java.lang.Object

SelectionUserManager

Copyright (c) SAP AG 2001-2002


Field Summary
static java.lang.String DISPLAY_GROUP_CLOSE
          closing symbol for a selected group.
static java.lang.String DISPLAY_GROUP_OPEN
          opening symbol for a selected group.
static java.lang.String DISPLAY_ROLE_CLOSE
          closing symbol for a selected role.
static java.lang.String DISPLAY_ROLE_OPEN
          opening symbol for a selected role.
static java.lang.String DISPLAY_UNCHECKED_CLOSE
          closing symbol for an unchecked user.
static java.lang.String DISPLAY_UNCHECKED_OPEN
          opening symbol for an unchecked user.
static java.lang.String SEPARATOR
          tag to separate entries in the string export of the users, groups etc.
static java.lang.String TAG_FINALIZER
          tag to separate entries in the string export of the users, groups etc.
static java.lang.String TAG_SEPARATOR
          this is a tag to separate entries in the string export of the users, groups etc.
static int TYPE_EMAIL
          Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)
static int TYPE_GROUP
          Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)
static int TYPE_ROLE
          Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)
static int TYPE_UNCHECKED
          Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)
static int TYPE_USER
          Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)
 
Constructor Summary
SelectionUserManager()
          By default, unchecked Names and email-adresses are not allowed.
SelectionUserManager(boolean allowEmails)
          Constructor for the SelectionUserManager object
SelectionUserManager(boolean allowEmails, boolean allowUncheckedNames)
          Constructor for the SelectionUserManager object
 
Method Summary
 boolean addEmailFromInput(java.lang.String userList)
          Adds a feature to the EmailFromInput attribute of the SelectionUserManager object
 boolean addFromInput(java.lang.String userList, boolean checkInput)
           
 java.lang.String[] checkForInvalidIDs(java.lang.String userList)
           
 java.lang.String[] checkForNewInput(java.lang.String userList)
           
 java.lang.String[] checkForNonUniqueIDs(java.lang.String userList)
           
 void deleteFromInput(java.lang.String input)
          checks, if users who were selected have been deleted in the display
 java.lang.String getDisplayString()
          Gets the displayString attribute of the SelectionUserManager object
 java.lang.String[] getIDs(int typeOfList)
           
 java.lang.String getInvalidIDs()
          Are invalid IDs given?
 java.util.HashMap getNonUniqueIDs()
          Gets the nonUniqueIDs attribute of the SelectionUserManager object
 java.util.HashMap getNonUniqueIDs(java.lang.String userList)
           
 java.lang.String getSelectionList()
           
 java.util.Collection getSelectionUsers(int typeOfList)
           
 java.util.HashMap getUniqueAndValidIDs(java.lang.String userList)
           
 void handleAll(java.lang.String userInput)
          before calling this method, the SelectionUserManager needs to be initialized with the persistent string, via the method initWithString .
 boolean initWithString(java.lang.String persistentString)
           
 boolean isInvalidIDGiven()
          Gets the invalidIDGiven attribute of the SelectionUserManager object
 boolean isNonUniqueIDGiven()
          Are non UniqueIDsGiven?
 void setList(java.lang.String[] ids, int typeOfList)
          fill a collection with ids, create display names
 void setList(java.lang.String id, int typeOfList)
          fill a collection with id, create display name
 void setList(java.lang.String id, java.lang.String displayName, int typeOfList)
          fill a collection with id and displayName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_USER

public static final int TYPE_USER
Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)

TYPE_ROLE

public static final int TYPE_ROLE
Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)

TYPE_GROUP

public static final int TYPE_GROUP
Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)

TYPE_EMAIL

public static final int TYPE_EMAIL
Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)

TYPE_UNCHECKED

public static final int TYPE_UNCHECKED
Constant to identify a selected Object's Type (User, Group, Role: from IUMPrincipal) or (email, unchecked)

TAG_SEPARATOR

public static final java.lang.String TAG_SEPARATOR
this is a tag to separate entries in the string export of the users, groups etc.

TAG_FINALIZER

public static final java.lang.String TAG_FINALIZER
tag to separate entries in the string export of the users, groups etc.

DISPLAY_GROUP_OPEN

public static final java.lang.String DISPLAY_GROUP_OPEN
opening symbol for a selected group.

DISPLAY_GROUP_CLOSE

public static final java.lang.String DISPLAY_GROUP_CLOSE
closing symbol for a selected group.

DISPLAY_ROLE_OPEN

public static final java.lang.String DISPLAY_ROLE_OPEN
opening symbol for a selected role.

DISPLAY_ROLE_CLOSE

public static final java.lang.String DISPLAY_ROLE_CLOSE
closing symbol for a selected role.

DISPLAY_UNCHECKED_CLOSE

public static final java.lang.String DISPLAY_UNCHECKED_CLOSE
closing symbol for an unchecked user.

DISPLAY_UNCHECKED_OPEN

public static final java.lang.String DISPLAY_UNCHECKED_OPEN
opening symbol for an unchecked user.

SEPARATOR

public static final java.lang.String SEPARATOR
tag to separate entries in the string export of the users, groups etc.
Constructor Detail

SelectionUserManager

public SelectionUserManager(boolean allowEmails)
Constructor for the SelectionUserManager object
Parameters:
allowEmails - email-adresses (recognized by the "@"-symbol) are allowed as valid selection

SelectionUserManager

public SelectionUserManager(boolean allowEmails,
                            boolean allowUncheckedNames)
Constructor for the SelectionUserManager object
Parameters:
allowEmails - email-adresses (recognized by the "@"-symbol) are allowed as valid selection
allowUncheckedNames - names, that are not known by the usermanagement can be used as valid selection

SelectionUserManager

public SelectionUserManager()
By default, unchecked Names and email-adresses are not allowed. With this setting, only users, groups and roles of the usermanagement can be added to the list of selected users
Method Detail

setList

public void setList(java.lang.String[] ids,
                    int typeOfList)
             throws WcmException
fill a collection with ids, create display names
Parameters:
ids - StringArray of User-IDs
typeOfList - value to distinguish between groups, roles, users...
Throws:
WcmException - is thrown when problems in UserManagement occur

setList

public void setList(java.lang.String id,
                    int typeOfList)
             throws WcmException
fill a collection with id, create display name
Parameters:
id - User-ID
typeOfList - value to distinguish between groups, roles, users...
Throws:
WcmException - is thrown when problems in UserManagement occur

setList

public void setList(java.lang.String id,
                    java.lang.String displayName,
                    int typeOfList)
             throws WcmException
fill a collection with id and displayName
Parameters:
id - User-ID
displayName - DisplayName of the given User
typeOfList - value to distinguish between groups, roles, users...
Throws:
WcmException - is thrown when problems in UserManagement occur

getSelectionUsers

public java.util.Collection getSelectionUsers(int typeOfList)
Parameters:
typeOfList - value to distinguish between groups, roles, users...
Returns:
a Collection of SelectionUsers or NULL

getIDs

public java.lang.String[] getIDs(int typeOfList)
Parameters:
typeOfList - value to distinguish between groups, roles, users...
Returns:
an Array with the IDs of the list or NULL

getSelectionList

public java.lang.String getSelectionList()
Returns:
String to persist in Control, separated as described in initWithString

getNonUniqueIDs

public java.util.HashMap getNonUniqueIDs(java.lang.String userList)
Parameters:
userList - a List of user-ids, display-names etc. (Usually submitted from a user-Input)
Returns:
a HashMap with three String[] Lists of nonUnique Recipients or NULL, if all is ok

getUniqueAndValidIDs

public java.util.HashMap getUniqueAndValidIDs(java.lang.String userList)
Parameters:
userList - a List of user-ids, display-names etc. (Usually submitted from a user-Input)
Returns:
a HashMap with three String[] Lists of nonUnique Recipients or NULL, if all is ok

getDisplayString

public java.lang.String getDisplayString()
Gets the displayString attribute of the SelectionUserManager object
Returns:
The displayString value

isInvalidIDGiven

public boolean isInvalidIDGiven()
Gets the invalidIDGiven attribute of the SelectionUserManager object
Returns:
The invalidIDGiven value

isNonUniqueIDGiven

public boolean isNonUniqueIDGiven()
Are non UniqueIDsGiven?
Returns:
The nonUniqueIDGiven value

getNonUniqueIDs

public java.util.HashMap getNonUniqueIDs()
Gets the nonUniqueIDs attribute of the SelectionUserManager object
Returns:
The nonUniqueIDs value

getInvalidIDs

public java.lang.String getInvalidIDs()
Are invalid IDs given?
Returns:
The invalidIDs value

initWithString

public boolean initWithString(java.lang.String persistentString)
                       throws WcmException
Parameters:
persistentString - HtmlB/Wdf-Controls persist the value of User-Input fields with strings. The SelectionUserManager, which takes care of the user-selection in controls, offers two methods to initialize itself with the persistent data from the control (that is this method!) and to create a String with all information needed, after the user-input has been submitted to the SelectionUserManager. That is the method getSelectionList. The String combines User-ID, descriptionName and Type of User (user, role, group...) in triples and separates them from the next entry.
Returns:
flag, if operation successful or not
Throws:
WcmException - Description of Exception

checkForInvalidIDs

public java.lang.String[] checkForInvalidIDs(java.lang.String userList)
Parameters:
userList - a list of UserIDs, displaynames etc., ususally coming from a user-input-field
Returns:
a SEPARATOR seperated List of invalid Recipients or NULL, if all is ok

checkForNonUniqueIDs

public java.lang.String[] checkForNonUniqueIDs(java.lang.String userList)
Parameters:
userList - a list of UserIDs, displaynames etc., ususally coming from a user-input-field
Returns:
a SEPARATOR seperated List of nonUnique Recipients or NULL, if all is ok

checkForNewInput

public java.lang.String[] checkForNewInput(java.lang.String userList)
Parameters:
userList - a list of UserIDs, displaynames etc., ususally coming from a user-input-field
Returns:
a List of all inputs, that are not known to the Manager at this time.
null, if all inputs are known

deleteFromInput

public void deleteFromInput(java.lang.String input)
checks, if users who were selected have been deleted in the display
Parameters:
input - Description of Parameter

addFromInput

public boolean addFromInput(java.lang.String userList,
                            boolean checkInput)
                     throws WcmException
Parameters:
userList - a list of UserIDs, displaynames etc., ususally coming from a user-input-field
checkInput - flag, if it is needed to check for invalid or nonUnique IDs
Returns:
flag, if operation successful or not
Throws:
WcmException - is thrown when problems in the usermanagement occur

addEmailFromInput

public boolean addEmailFromInput(java.lang.String userList)
                          throws WcmException
Adds a feature to the EmailFromInput attribute of the SelectionUserManager object
Parameters:
userList - The feature to be added to the EmailFromInput attribute
Returns:
Description of the Returned Value
Throws:
WcmException - Description of Exception

handleAll

public void handleAll(java.lang.String userInput)
               throws WcmException
before calling this method, the SelectionUserManager needs to be initialized with the persistent string, via the method initWithString . All information for control logic afterwards (invalid or non unique users), all actions (delete, add, format displaynames) are performed in this method. The persistence for the control once again can be exported via setList .
Parameters:
userInput - A list of UserIDs, Displaynames etc. usually coming from a user-input-field.
Throws:
WcmException - problems occured within the UserManagement

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.