com.sapportals.wcm.util.usermanagement

Class SelectionUserManager

java.lang.Object
  extended bycom.sapportals.wcm.util.usermanagement.SelectionUserManager

public final class SelectionUserManager
extends Object

SelectionUserManager

Copyright (c) SAP AG 2001-2002


Field Summary
static String DISPLAY_GROUP_CLOSE
          closing symbol for a selected group.
static String DISPLAY_GROUP_OPEN
          opening symbol for a selected group.
static String DISPLAY_ROLE_CLOSE
          closing symbol for a selected role.
static String DISPLAY_ROLE_OPEN
          opening symbol for a selected role.
static String DISPLAY_UNCHECKED_CLOSE
          closing symbol for an unchecked user.
static String DISPLAY_UNCHECKED_OPEN
          opening symbol for an unchecked user.
static String SEPARATOR
          tag to separate entries in the string export of the users, groups etc.
static String TAG_FINALIZER
          tag to separate entries in the string export of the users, groups etc.
static 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(String userList)
          Adds a feature to the EmailFromInput attribute of the SelectionUserManager object
 boolean addFromInput(String userList, boolean checkInput)
           
 String[] checkForInvalidIDs(String userList)
           
 String[] checkForNewInput(String userList)
           
 String[] checkForNonUniqueIDs(String userList)
           
 void deleteFromInput(String input)
          checks, if users who were selected have been deleted in the display
 String getDisplayString()
          Gets the displayString attribute of the SelectionUserManager object
 String[] getIDs(int typeOfList)
           
 String getInvalidIDs()
          Are invalid IDs given?
 HashMap getNonUniqueIDs()
          Gets the nonUniqueIDs attribute of the SelectionUserManager object
 HashMap getNonUniqueIDs(String userList)
           
 String getSelectionList()
           
 Collection getSelectionUsers(int typeOfList)
           
 HashMap getUniqueAndValidIDs(String userList)
           
 void handleAll(String userInput)
          before calling this method, the SelectionUserManager needs to be initialized with the persistent string, via the method initWithString .
 boolean initWithString(String persistentString)
           
 boolean isInvalidIDGiven()
          Gets the invalidIDGiven attribute of the SelectionUserManager object
 boolean isNonUniqueIDGiven()
          Are non UniqueIDsGiven?
 void setList(String[] ids, int typeOfList)
          fill a collection with ids, create display names
 void setList(String id, int typeOfList)
          fill a collection with id, create display name
 void setList(String id, 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)

See Also:
Constant Field Values

TYPE_ROLE

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

See Also:
Constant Field Values

TYPE_GROUP

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

See Also:
Constant Field Values

TYPE_EMAIL

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

See Also:
Constant Field Values

TYPE_UNCHECKED

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

See Also:
Constant Field Values

TAG_SEPARATOR

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

See Also:
Constant Field Values

TAG_FINALIZER

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

See Also:
Constant Field Values

DISPLAY_GROUP_OPEN

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

See Also:
Constant Field Values

DISPLAY_GROUP_CLOSE

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

See Also:
Constant Field Values

DISPLAY_ROLE_OPEN

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

See Also:
Constant Field Values

DISPLAY_ROLE_CLOSE

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

See Also:
Constant Field Values

DISPLAY_UNCHECKED_CLOSE

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

See Also:
Constant Field Values

DISPLAY_UNCHECKED_OPEN

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

See Also:
Constant Field Values

SEPARATOR

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

See Also:
Constant Field Values
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(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(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(String id,
                    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 Collection getSelectionUsers(int typeOfList)
Parameters:
typeOfList - value to distinguish between groups, roles, users...
Returns:
a Collection of SelectionUsers or NULL

getIDs

public 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 String getSelectionList()
Returns:
String to persist in Control, separated as described in initWithString

getNonUniqueIDs

public HashMap getNonUniqueIDs(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 HashMap getUniqueAndValidIDs(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 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 HashMap getNonUniqueIDs()
Gets the nonUniqueIDs attribute of the SelectionUserManager object

Returns:
The nonUniqueIDs value

getInvalidIDs

public String getInvalidIDs()
Are invalid IDs given?

Returns:
The invalidIDs value

initWithString

public boolean initWithString(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 String[] checkForInvalidIDs(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 String[] checkForNonUniqueIDs(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 String[] checkForNewInput(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(String input)
checks, if users who were selected have been deleted in the display

Parameters:
input - Description of Parameter

addFromInput

public boolean addFromInput(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(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(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


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.