com.ptc.netmarkets.user
Class StandardNmUserService

java.lang.Object
  extended bywt.services.StandardManager
      extended bycom.ptc.netmarkets.user.StandardNmUserService
All Implemented Interfaces:
Manager, NetFactor, NmUserService, Serializable

public class StandardNmUserService
extends StandardManager
implements NmUserService, Serializable

Use the newStandardNmUserService static factory method(s), not the StandardNmUserService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CHECKOUT_FOLDER
           
private static String CLASSNAME
           
private static String CMDCLASSNAME
           
private static String LIMITED
           
private static boolean PDMSystemInstalled
           
private static String RESOURCE
           
private static String SENDER_EMAIL
           
private static String TABLE_SCOPE
          This following constant has to match the value of CHECKOUT_FOLDER in StandardWorkInProgressService.
private static String TIME_ZONE_RESOURCE
           
private static boolean VERBOSE
           
private static String WIP_RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardNmUserService()
           
 
Method Summary
private  void _handleMismatchedEmails(String invitedEmail, String registeredEmail, String projectOID, String dnToSwitch)
           
private  void _handleMismatchedEmails(WTUser invitedUser, WTUser newUser, Project2 project)
           
 NmChangeModel[] addToAdmin(NmCommandBean cb, ArrayList users)
          

Supported API: false
 NmDefaultHTMLTable checkedOutStuff(NmCommandBean cb)
          

Supported API: false
 ArrayList findOrgGroups(NmCommandBean cb, String query, int maxCount, int clientType)
          

Supported API: false
 ArrayList findOrgUsers(NmCommandBean cb, String query, int maxCount, int clientType)
          Searches the user repository and returns an ArrayList containing all users whose common name attribute contains the passed in query.
 ArrayList getAdminRowData(NmUser nmUser)
          

Supported API: false
private  Folder getCheckoutFolder()
          Get the current user's Checked Out folder.
 String getConceptualClassname()
          Deprecated.  
private  WTContainer getContainerContextForQuery(NmCommandBean cb)
           
 TimeZone getLocalTimeZoneForUser()
          

Supported API: false
 TimeZone getLocalTimeZoneForUser(WTPrincipal user)
          Get the preferred TimeZone for the specified user.
 String getLocalTimeZoneStringForUser()
          

Supported API: false
private  ArrayList getMembersGroups(WTUser user)
           
 NmUser getNmUser(WTUser user, WTContainer container)
          

Supported API: false
 NmUser getNmUserLastFirst(WTUser user, ContainerTeamManaged container)
          

Supported API: false
 NmUser getNmUserRegistered(WTUser user)
          

Supported API: false
 NmUser getNmUserRegisteredLastFirst(WTUser user)
          

Supported API: false
private  String getObjectIconImgTag(WTObject obj)
           
 WTUser getProjectUserByEmail(NmOid nmprojectoid, String email)
          Returns the WTUser object of the user identified by the passed in email from the current project.
 WTUser getProjectUserByEmail(Project2 project, String email)
          Returns the WTUser object of the user identified by the passed in email from the current project.
private  PrivateKey getSitePrivateKey()
           
private  PublicKey getSitePublicKey()
           
private  TimeZone getTimeZoneFromID(String zoneID)
           
private  TimeZone getTimeZoneFromOffset(String zoneID)
           
private  String getTimeZonePref(String[] contextMask)
           
 String[][] getTimeZoneStrings()
          

Supported API: false
private  NmURL getURLObject(WTObject obj)
           
 String getUserName()
          

Supported API: false
 String getUserOrgName()
          

Supported API: false
 NmOid getUserOrgOid()
          

Supported API: false
private  String getUserTimeZonePref()
           
private  String getUserTimeZonePref(WTUser user)
           
 ArrayList getUserToProfile(NmCommandBean cb)
          gets the user's directory attributes (index 0) and local time zone (index 1) for the user on the url if the user has access else the current user

Supported API: false
 boolean hasProjectLinkAccess()
          

Supported API: false
private  NmDefaultHTMLTable initializeCheckoutTable()
           
 boolean isExchangeAdmin()
          

Supported API: false
 boolean isOrgAdmin(NmCommandBean cb)
          

Supported API: false
 boolean isOrgAdmin(NmOid containerOid)
          

Supported API: false
 boolean isOrgAdmin(WTContainer container)
          

Supported API: false
 NmDefaultHTMLTable listAdmin(NmCommandBean cb)
          

Supported API: false
 NmDefaultHTMLTable listUserEvents(NmCommandBean cb)
          

Supported API: false
static StandardNmUserService newStandardNmUserService()
          Default factory for the class.
private  boolean populateCheckedOutTable(NmDefaultHTMLTable CheckoutTable, NmCommandBean cb, ObjectReference objectRef, int select, int row, boolean isProjectChk, boolean pendingChange)
           
private  int populateCheckedOutTable(NmDefaultHTMLTable checkoutTable, NmCommandBean cb, Set objectRefs, int select, int row, boolean isProjectChk)
           
private  void populateReportErrorTableRow(int index, NmDefaultHTMLTable CheckoutTable)
           
 void processSwitchFormSubmittal(String signature, String invitedEmail, String registeredEmail, String dnToSwitch, String projectOID)
          

Supported API: false
private  ArrayList profileList(NmOid oid, Boolean bool)
           
 NmChangeModel[] removeFromAdmin(NmCommandBean cb, NmOid userOid)
          

Supported API: false
 NmChangeModel[] removeUserFromRole(NmCommandBean cb)
          

Supported API: false
 NmChangeModel[] replaceUserInProject(NmCommandBean cb, ArrayList users)
          Replaces the selected user with the new user.
 void resolveAmbiguousEmail(String existingUserRefString, String newUserRefString, NmOid nmprojectoid)
          Searches the user repository and returns an ArrayList containing all users whose common name attribute contains the passed in query.
 void sendSwitchForm(String invitedEmail, String registeredEmail, String projectOID, String dnToSwitch)
          

Supported API: false
private  void setColumnSort(NmDefaultHTMLTable reportTable, boolean isColumnSortAllowed)
           
 void setLocalTimeZoneForUser(String zoneID)
          

Supported API: false
 void setLocalTimeZoneForUser(TimeZone zone)
          

Supported API: false
 NmUser setUserProperties(NmOid userOid, WTContainer container)
          

Supported API: false
 String signMessage(String msg)
          

Supported API: false
 ArrayList userHasCheckouts(NmCommandBean cb, NmOid projectOid, NmOid userOid)
          Returns null if the user does not have checkouts.
 boolean verifySignedMessage(String msg, String signature)
          

Supported API: false
 NmModel view(NmCommandBean cb)
          

Supported API: false
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, performStartupProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

CMDCLASSNAME

private static final String CMDCLASSNAME

VERBOSE

private static final boolean VERBOSE

SENDER_EMAIL

private static final String SENDER_EMAIL

TABLE_SCOPE

private static final String TABLE_SCOPE
This following constant has to match the value of CHECKOUT_FOLDER in StandardWorkInProgressService. I wish that constant was public rather than private.

See Also:
Constant Field Values

LIMITED

private static final String LIMITED
See Also:
Constant Field Values

CHECKOUT_FOLDER

private static final String CHECKOUT_FOLDER
See Also:
Constant Field Values

WIP_RESOURCE

private static final String WIP_RESOURCE
See Also:
Constant Field Values

TIME_ZONE_RESOURCE

private static final String TIME_ZONE_RESOURCE
See Also:
Constant Field Values

PDMSystemInstalled

private static boolean PDMSystemInstalled
Constructor Detail

StandardNmUserService

public StandardNmUserService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardNmUserService

public static StandardNmUserService newStandardNmUserService()
                                                      throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardNmUserService
Throws:
WTException

removeUserFromRole

public NmChangeModel[] removeUserFromRole(NmCommandBean cb)
                                   throws WTException


Supported API: false

Specified by:
removeUserFromRole in interface NmUserService
Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

view

public NmModel view(NmCommandBean cb)
             throws WTException


Supported API: false

Specified by:
view in interface NmUserService
Parameters:
cb -
Returns:
NmModel
Throws:
WTException

sendSwitchForm

public void sendSwitchForm(String invitedEmail,
                           String registeredEmail,
                           String projectOID,
                           String dnToSwitch)
                    throws WTException


Supported API: false

Specified by:
sendSwitchForm in interface NmUserService
Parameters:
invitedEmail -
registeredEmail -
projectOID -
dnToSwitch -
Throws:
WTException

processSwitchFormSubmittal

public void processSwitchFormSubmittal(String signature,
                                       String invitedEmail,
                                       String registeredEmail,
                                       String dnToSwitch,
                                       String projectOID)
                                throws WTException


Supported API: false

Specified by:
processSwitchFormSubmittal in interface NmUserService
Parameters:
signature -
invitedEmail -
registeredEmail -
dnToSwitch -
projectOID -
Throws:
WTException

checkedOutStuff

public NmDefaultHTMLTable checkedOutStuff(NmCommandBean cb)
                                   throws WTException


Supported API: false

Specified by:
checkedOutStuff in interface NmUserService
Parameters:
cb -
Returns:
NmDefaultHTMLTable
Throws:
WTException

listUserEvents

public NmDefaultHTMLTable listUserEvents(NmCommandBean cb)
                                  throws WTException


Supported API: false

Specified by:
listUserEvents in interface NmUserService
Parameters:
cb -
Returns:
NmDefaultHTMLTable
Throws:
WTException

setUserProperties

public NmUser setUserProperties(NmOid userOid,
                                WTContainer container)
                         throws WTException


Supported API: false

Specified by:
setUserProperties in interface NmUserService
Parameters:
userOid -
container -
Returns:
NmUser
Throws:
WTException

setLocalTimeZoneForUser

public void setLocalTimeZoneForUser(TimeZone zone)
                             throws WTException


Supported API: false

Specified by:
setLocalTimeZoneForUser in interface NmUserService
Parameters:
zone -
Throws:
WTException

setLocalTimeZoneForUser

public void setLocalTimeZoneForUser(String zoneID)
                             throws WTException


Supported API: false

Specified by:
setLocalTimeZoneForUser in interface NmUserService
Parameters:
zoneID -
Throws:
WTException

getLocalTimeZoneForUser

public TimeZone getLocalTimeZoneForUser()
                                 throws WTException


Supported API: false

Specified by:
getLocalTimeZoneForUser in interface NmUserService
Returns:
TimeZone
Throws:
WTException

getLocalTimeZoneForUser

public TimeZone getLocalTimeZoneForUser(WTPrincipal user)
                                 throws WTException
Get the preferred TimeZone for the specified user.

Supported API: false

Specified by:
getLocalTimeZoneForUser in interface NmUserService
Parameters:
user -
Returns:
TimeZone
Throws:
WTException

getLocalTimeZoneStringForUser

public String getLocalTimeZoneStringForUser()
                                     throws WTException


Supported API: false

Specified by:
getLocalTimeZoneStringForUser in interface NmUserService
Returns:
String
Throws:
WTException

getTimeZoneStrings

public String[][] getTimeZoneStrings()
                              throws WTException


Supported API: false

Specified by:
getTimeZoneStrings in interface NmUserService
Returns:
String[][]
Throws:
WTException

getUserName

public String getUserName()
                   throws WTException


Supported API: false

Specified by:
getUserName in interface NmUserService
Returns:
String
Throws:
WTException

getUserOrgName

public String getUserOrgName()
                      throws WTException


Supported API: false

Specified by:
getUserOrgName in interface NmUserService
Returns:
String
Throws:
WTException

findOrgUsers

public ArrayList findOrgUsers(NmCommandBean cb,
                              String query,
                              int maxCount,
                              int clientType)
                       throws WTException
Searches the user repository and returns an ArrayList containing all users whose common name attribute contains the passed in query. All users returned are from the current session principals organization, or if the current session principal is an exchange admin and the current project is an organization, the users returned belong to the organization that is set as the current project.

Supported API: false

Specified by:
findOrgUsers in interface NmUserService
Parameters:
cb -
query -
maxCount -
clientType -
Returns:
ArrayList
Throws:
WTException

resolveAmbiguousEmail

public void resolveAmbiguousEmail(String existingUserRefString,
                                  String newUserRefString,
                                  NmOid nmprojectoid)
                           throws WTException
Searches the user repository and returns an ArrayList containing all users whose common name attribute contains the passed in query. All users returned are from the current session principals organization only.

Supported API: false

Specified by:
resolveAmbiguousEmail in interface NmUserService
Parameters:
existingUserRefString -
newUserRefString -
nmprojectoid -
Throws:
WTException

getProjectUserByEmail

public WTUser getProjectUserByEmail(NmOid nmprojectoid,
                                    String email)
                             throws WTException
Returns the WTUser object of the user identified by the passed in email from the current project.

Supported API: false

Specified by:
getProjectUserByEmail in interface NmUserService
Parameters:
nmprojectoid -
email -
Returns:
WTUser
Throws:
WTException

getProjectUserByEmail

public WTUser getProjectUserByEmail(Project2 project,
                                    String email)
                             throws WTException
Returns the WTUser object of the user identified by the passed in email from the current project.

Supported API: false

Specified by:
getProjectUserByEmail in interface NmUserService
Parameters:
project -
email -
Returns:
WTUser
Throws:
WTException

replaceUserInProject

public NmChangeModel[] replaceUserInProject(NmCommandBean cb,
                                            ArrayList users)
                                     throws WTException
Replaces the selected user with the new user.

Supported API: false

Specified by:
replaceUserInProject in interface NmUserService
Parameters:
cb -
users -
Returns:
NmChangeModel[]
Throws:
WTException

userHasCheckouts

public ArrayList userHasCheckouts(NmCommandBean cb,
                                  NmOid projectOid,
                                  NmOid userOid)
                           throws WTException
Returns null if the user does not have checkouts.

Supported API: false

Specified by:
userHasCheckouts in interface NmUserService
Parameters:
cb -
projectOid -
userOid -
Returns:
ArrayList
Throws:
WTException

getNmUser

public NmUser getNmUser(WTUser user,
                        WTContainer container)
                 throws WTException


Supported API: false

Specified by:
getNmUser in interface NmUserService
Parameters:
user -
container -
Returns:
NmUser
Throws:
WTException

getNmUserRegistered

public NmUser getNmUserRegistered(WTUser user)
                           throws WTException


Supported API: false

Specified by:
getNmUserRegistered in interface NmUserService
Parameters:
user -
Returns:
NmUser
Throws:
WTException

getNmUserLastFirst

public NmUser getNmUserLastFirst(WTUser user,
                                 ContainerTeamManaged container)
                          throws WTException


Supported API: false

Specified by:
getNmUserLastFirst in interface NmUserService
Parameters:
user -
container -
Returns:
NmUser
Throws:
WTException

getNmUserRegisteredLastFirst

public NmUser getNmUserRegisteredLastFirst(WTUser user)
                                    throws WTException


Supported API: false

Specified by:
getNmUserRegisteredLastFirst in interface NmUserService
Parameters:
user -
Returns:
NmUser
Throws:
WTException

isExchangeAdmin

public boolean isExchangeAdmin()
                        throws WTException


Supported API: false

Specified by:
isExchangeAdmin in interface NmUserService
Returns:
boolean
Throws:
WTException

getUserToProfile

public ArrayList getUserToProfile(NmCommandBean cb)
                           throws WTException
gets the user's directory attributes (index 0) and local time zone (index 1) for the user on the url if the user has access else the current user

Supported API: false

Specified by:
getUserToProfile in interface NmUserService
Parameters:
cb -
Returns:
ArrayList
Throws:
WTException

getUserOrgOid

public NmOid getUserOrgOid()
                    throws WTException


Supported API: false

Specified by:
getUserOrgOid in interface NmUserService
Returns:
NmOid
Throws:
WTException

findOrgGroups

public ArrayList findOrgGroups(NmCommandBean cb,
                               String query,
                               int maxCount,
                               int clientType)
                        throws WTException


Supported API: false

Specified by:
findOrgGroups in interface NmUserService
Parameters:
cb -
query -
maxCount -
clientType -
Returns:
ArrayList
Throws:
WTException

signMessage

public String signMessage(String msg)
                   throws WTException


Supported API: false

Specified by:
signMessage in interface NmUserService
Parameters:
msg -
Returns:
String
Throws:
WTException

verifySignedMessage

public boolean verifySignedMessage(String msg,
                                   String signature)
                            throws WTException


Supported API: false

Specified by:
verifySignedMessage in interface NmUserService
Parameters:
msg -
signature -
Returns:
boolean
Throws:
WTException

listAdmin

public NmDefaultHTMLTable listAdmin(NmCommandBean cb)
                             throws WTException


Supported API: false

Specified by:
listAdmin in interface NmUserService
Parameters:
cb -
Returns:
NmDefaultHTMLTable
Throws:
WTException

removeFromAdmin

public NmChangeModel[] removeFromAdmin(NmCommandBean cb,
                                       NmOid userOid)
                                throws WTException


Supported API: false

Specified by:
removeFromAdmin in interface NmUserService
Parameters:
cb -
userOid -
Returns:
NmChangeModel[]
Throws:
WTException

addToAdmin

public NmChangeModel[] addToAdmin(NmCommandBean cb,
                                  ArrayList users)
                           throws WTException


Supported API: false

Specified by:
addToAdmin in interface NmUserService
Parameters:
cb -
users -
Returns:
NmChangeModel[]
Throws:
WTException

getAdminRowData

public ArrayList getAdminRowData(NmUser nmUser)
                          throws WTException


Supported API: false

Specified by:
getAdminRowData in interface NmUserService
Parameters:
nmUser -
Returns:
ArrayList
Throws:
WTException

hasProjectLinkAccess

public boolean hasProjectLinkAccess()
                             throws WTException


Supported API: false

Specified by:
hasProjectLinkAccess in interface NmUserService
Returns:
boolean
Throws:
WTException

isOrgAdmin

public boolean isOrgAdmin(WTContainer container)
                   throws WTException


Supported API: false

Specified by:
isOrgAdmin in interface NmUserService
Parameters:
container -
Returns:
boolean
Throws:
WTException

isOrgAdmin

public boolean isOrgAdmin(NmOid containerOid)
                   throws WTException


Supported API: false

Specified by:
isOrgAdmin in interface NmUserService
Parameters:
containerOid -
Returns:
boolean
Throws:
WTException

isOrgAdmin

public boolean isOrgAdmin(NmCommandBean cb)
                   throws WTException


Supported API: false

Specified by:
isOrgAdmin in interface NmUserService
Parameters:
cb -
Returns:
boolean
Throws:
WTException

getCheckoutFolder

private Folder getCheckoutFolder()
                          throws WTException
Get the current user's Checked Out folder.

This is an alternative implementation of StandardWorkInProgressService.getCheckoutFolder() that does not require a call to StandardFolderService.getFolder(String). That method requires a call to wt.projmgmt.admin.StandardProjAdminService#findSearchConditions and that method is a performance bottle-neck when called with a null container argument - as it is in this case because the Checked Out folder is in the global USER domain.

Throws:
WTException
See Also:
StandardWorkInProgressService.getCheckoutFolder()

getTimeZoneFromOffset

private TimeZone getTimeZoneFromOffset(String zoneID)

getUserTimeZonePref

private String getUserTimeZonePref()

getUserTimeZonePref

private String getUserTimeZonePref(WTUser user)

getTimeZonePref

private String getTimeZonePref(String[] contextMask)

getTimeZoneFromID

private TimeZone getTimeZoneFromID(String zoneID)

_handleMismatchedEmails

private void _handleMismatchedEmails(WTUser invitedUser,
                                     WTUser newUser,
                                     Project2 project)
                              throws WTException
Throws:
WTException

_handleMismatchedEmails

private void _handleMismatchedEmails(String invitedEmail,
                                     String registeredEmail,
                                     String projectOID,
                                     String dnToSwitch)
                              throws WTException
Throws:
WTException

getMembersGroups

private ArrayList getMembersGroups(WTUser user)
                            throws WTException
Throws:
WTException

profileList

private ArrayList profileList(NmOid oid,
                              Boolean bool)
                       throws WTException
Throws:
WTException

getSitePrivateKey

private PrivateKey getSitePrivateKey()
                              throws WTException
Throws:
WTException

getSitePublicKey

private PublicKey getSitePublicKey()
                            throws WTException
Throws:
WTException

getURLObject

private NmURL getURLObject(WTObject obj)
                    throws WTException
Throws:
WTException

getObjectIconImgTag

private String getObjectIconImgTag(WTObject obj)
                            throws WTException
Throws:
WTException

getContainerContextForQuery

private WTContainer getContainerContextForQuery(NmCommandBean cb)
                                         throws WTException
Throws:
WTException

initializeCheckoutTable

private NmDefaultHTMLTable initializeCheckoutTable()
                                            throws WTException
Throws:
WTException

populateCheckedOutTable

private int populateCheckedOutTable(NmDefaultHTMLTable checkoutTable,
                                    NmCommandBean cb,
                                    Set objectRefs,
                                    int select,
                                    int row,
                                    boolean isProjectChk)
                             throws WTException
Throws:
WTException

populateCheckedOutTable

private boolean populateCheckedOutTable(NmDefaultHTMLTable CheckoutTable,
                                        NmCommandBean cb,
                                        ObjectReference objectRef,
                                        int select,
                                        int row,
                                        boolean isProjectChk,
                                        boolean pendingChange)
                                 throws WTException
Throws:
WTException

populateReportErrorTableRow

private void populateReportErrorTableRow(int index,
                                         NmDefaultHTMLTable CheckoutTable)
                                  throws WTException
Throws:
WTException

setColumnSort

private void setColumnSort(NmDefaultHTMLTable reportTable,
                           boolean isColumnSortAllowed)
                    throws WTException
Throws:
WTException