com.ibm.commerce.collaboration.workspaces.helper
Class CollabCommandHelper

java.lang.Object
  |
  +--com.ibm.commerce.collaboration.workspaces.helper.CollabCommandHelper

public class CollabCommandHelper
extends java.lang.Object

A set of helper methods that are used by the collaborative workspace controller commands.


Field Summary
static java.lang.String COPYRIGHT
           
 
Constructor Summary
CollabCommandHelper()
          Creates an instance of the CollabCommandHelper class.
 
Method Summary
 boolean checkUserAccessForCollabSpace(java.lang.String userDN, java.lang.String collabSpaceId, CommandContext context)
          Verifies that a user has the Manager role in the collaborative workspace or has the Site Administrator role in the seller organization.
 java.lang.String getNLName(java.lang.String firstName, java.lang.String lastName, int langId)
          Gets and formats the name of a user based on the preferred language.
static java.lang.String getRequesterDN(CommandContext commandContext)
          Extracts the requester's distinguished name from the command context object.
static java.lang.String getRequesterUid(CommandContext commandContext)
          Extracts the requester's logon id from the command context object.
static java.lang.String getUserDN(java.lang.String origDN)
          Modifies a user's distinguished name so that the Root Organization field is in lowercase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

CollabCommandHelper

public CollabCommandHelper()
Creates an instance of the CollabCommandHelper class.
Method Detail

checkUserAccessForCollabSpace

public boolean checkUserAccessForCollabSpace(java.lang.String userDN,
                                             java.lang.String collabSpaceId,
                                             CommandContext context)
Verifies that a user has the Manager role in the collaborative workspace or has the Site Administrator role in the seller organization.
Parameters:
userDN - The distinguished name of a user (ex. uid=demoUser,o=Root Organization)
collabSpaceId - The unique identifier of the collaborative workspace.
context - The command context of the request object.
Returns:
true if the user specified has a Manager role in the collaborative workspace or has the Site Administrator role in the seller organization, false otherwise.

getNLName

public java.lang.String getNLName(java.lang.String firstName,
                                  java.lang.String lastName,
                                  int langId)
Gets and formats the name of a user based on the preferred language.

For Asian languages, the name will be LastName FirstName.

For non-Asian languages, the name will be FirstName space LastName.

Parameters:
firstName - The user's first name.
lastName - The user's last name or family name.
langId - The language Id which specifies the format of the name that is returned.
Returns:
The language-specific name of the user.

getRequesterDN

public static final java.lang.String getRequesterDN(CommandContext commandContext)
Extracts the requester's distinguished name from the command context object.
Parameters:
commandContext - The command context from the request object.
Returns:
The distinguished name of the requester in the command context (ex. uid=demoUser,o=Root Organization)

getRequesterUid

public static final java.lang.String getRequesterUid(CommandContext commandContext)
Extracts the requester's logon id from the command context object.
Parameters:
commandContext - The command context from the request object.
Returns:
The logon id of the requester in the command context (ex. demoUser)

getUserDN

public static final java.lang.String getUserDN(java.lang.String origDN)
Modifies a user's distinguished name so that the Root Organization field is in lowercase.
Parameters:
origDN - The user's original distinguished name.
Returns:
The user's distinguished name with Root Organization in lowercase.