wt.load
Class LoadUser

java.lang.Object
  extended bywt.load.LoadUser

public class LoadUser
extends Object

Used to load users, groups, associate users to groups, domains, and access rules for test or demo data in Windchill. Methods in this class are defined for use by the load package inside of the map file (wt.home.loadFile.csvmapfile.txt). These methods were written to be called by the load package using introspection not by a user interface.

Supported API: true


Field Summary
private static String ADMINISTRATORS
           
private static String defaultAdapter
           
private static String defaultDirectoryUser
           
private static boolean DIRVERBOSE
           
private static String userSearchBase
           
private static boolean VALIDATE_TYPE_FOR_ACCESS
           
 
Constructor Summary
LoadUser()
           
 
Method Summary
private static String addAddrPart(String addr, String addrPart)
           
private static void addMemberByDN(String groupDN, String memberDN)
           
private static void addMemberByName(String groupDN, String userName)
           
static boolean createAccessRule(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Create an access control rule.
static WTGroup createAdminGroupAndUser(String adminUserName, String groupName, AdministrativeDomain sysdomain, String webUserName)
          Create Administrators group and administrator user.
static boolean createDomain(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Create an administrative domain.
static boolean createGroup(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Create a group object and persist it in the database.
private static void createGroup(String dn, String description)
           
static boolean createOrgAdmin(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Provides the same functionality as createUser, while additionally making the new user a member of the given organization.
static boolean createUser(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Create a user object and persist it in the database.
static boolean createUserGroup(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Add a user to a group.
static void dirInit()
          Initialize LDAP directory service support.
private static String getGroupDN(String groupName, WTContainerRef containerRef)
           
private static String getUserDN(String userName)
           
static void loadGroup(String groupName, String groupDesc, String user, boolean dbstore, boolean addpsb)
          Deprecated. 

Supported API: false
private static void loadUser(String newName, String fullName, Vector values)
          Load a user definition into the directory and database.
private static String normalizeDn(String dn)
           
private static String queryUser(String userName)
          Query a user definition registered in the directory.
static void updateUserGroup(String groupName, String userName, boolean addpsb)
          Deprecated. 

Supported API: false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRVERBOSE

private static boolean DIRVERBOSE

VALIDATE_TYPE_FOR_ACCESS

private static boolean VALIDATE_TYPE_FOR_ACCESS

defaultAdapter

private static String defaultAdapter

userSearchBase

private static String userSearchBase

defaultDirectoryUser

private static String defaultDirectoryUser

ADMINISTRATORS

private static String ADMINISTRATORS
Constructor Detail

LoadUser

public LoadUser()
Method Detail

addAddrPart

private static String addAddrPart(String addr,
                                  String addrPart)

createUser

public static boolean createUser(Hashtable nv,
                                 Hashtable cmd_line,
                                 Vector return_objects)
Create a user object and persist it in the database.

Parameters:
nv - Name/value pairs of meta data to set on the user.
cmd_line - command line argument that can be substituted into the load data.
return_objects - Object(s) created by this method used by wt.load.StandardLoadService for user feedback messages.

Supported API: true

createAdminGroupAndUser

public static WTGroup createAdminGroupAndUser(String adminUserName,
                                              String groupName,
                                              AdministrativeDomain sysdomain,
                                              String webUserName)
                                       throws WTException
Create Administrators group and administrator user.

Parameters:
groupName - Group Name
sysdomain - System Domain
webUserName - Web User Name

Supported API: true
Throws:
WTException

queryUser

private static String queryUser(String userName)
                         throws WTException
Query a user definition registered in the directory.

Parameters:
userName - The unique identifier for a user
Returns:
The distinguished name of the matching entry, or null if no matches are found.

Supported API: false
Throws:
WTException

loadUser

private static void loadUser(String newName,
                             String fullName,
                             Vector values)
                      throws WTException
Load a user definition into the directory and database.

Supported API: true

Throws:
WTException

normalizeDn

private static String normalizeDn(String dn)

createGroup

public static boolean createGroup(Hashtable nv,
                                  Hashtable cmd_line,
                                  Vector return_objects)
Create a group object and persist it in the database.

Parameters:
nv - Name/value pairs of meta data to set on the group.
cmd_line - command line argument that can be substituted into the load data.
return_objects - Object(s) created by this method used by wt.load.StandardLoadService for user feedback messages.

Supported API: true

createUserGroup

public static boolean createUserGroup(Hashtable nv,
                                      Hashtable cmd_line,
                                      Vector return_objects)
Add a user to a group.

Parameters:
nv - Name/value pairs representing the user name and the group name.
cmd_line - command line argument that can be substituted into the load data.
return_objects - Object(s) created by this method used by wt.load.StandardLoadService for user feedback messages.

Supported API: true

getGroupDN

private static String getGroupDN(String groupName,
                                 WTContainerRef containerRef)
                          throws WTException
Throws:
WTException

getUserDN

private static String getUserDN(String userName)
                         throws WTException
Throws:
WTException

createGroup

private static void createGroup(String dn,
                                String description)
                         throws WTException,
                                IOException,
                                IEException
Throws:
WTException
IOException
IEException

addMemberByDN

private static void addMemberByDN(String groupDN,
                                  String memberDN)
                           throws WTException
Throws:
WTException

addMemberByName

private static void addMemberByName(String groupDN,
                                    String userName)
                             throws WTException
Throws:
WTException

loadGroup

public static void loadGroup(String groupName,
                             String groupDesc,
                             String user,
                             boolean dbstore,
                             boolean addpsb)
                      throws WTException
Deprecated. 

Supported API: false

Method used by other methods to load Groups into the Directory and the database.

Parameters:
groupName - Name of the group to be loaded into the Directory and the database.
groupDesc - Description of the group to be loaded into the Directory and the database.
user - Name of the user to be associated with the group. Null if none.
dbstore - true = add to the database
addpsb - true = construct the user's distinguished name from the user search base
Throws:
WTException

updateUserGroup

public static void updateUserGroup(String groupName,
                                   String userName,
                                   boolean addpsb)
                            throws WTException
Deprecated. 

Supported API: false

Add a user to a group.

Parameters:
addpsb - True = add userSearchBase to the user
Throws:
WTException

createDomain

public static boolean createDomain(Hashtable nv,
                                   Hashtable cmd_line,
                                   Vector return_objects)
Create an administrative domain.

Parameters:
nv - Name/value pairs of meta data to set on the domain.
cmd_line - command line argument that can be substituted into the load data.
return_objects - Object(s) created by this method used by wt.load.StandardLoadService for user feedback messages.

Supported API: true

createAccessRule

public static boolean createAccessRule(Hashtable nv,
                                       Hashtable cmd_line,
                                       Vector return_objects)
Create an access control rule.

Parameters:
nv - Name/value pairs of meta data to set on the access control rule.
cmd_line - command line argument that can be substituted into the load data.
return_objects - Object(s) created by this method used by wt.load.StandardLoadService for user feedback messages.

Supported API: true

dirInit

public static void dirInit()
                    throws WTException
Initialize LDAP directory service support.

Supported API: true

Throws:
WTException

createOrgAdmin

public static boolean createOrgAdmin(Hashtable nv,
                                     Hashtable cmd_line,
                                     Vector return_objects)
Provides the same functionality as createUser, while additionally making the new user a member of the given organization.

Supported API: true

Parameters:
nv -
cmd_line -
return_objects -
Returns:
true if the load succeeds
Throws:
WTException - If no organization is specified