atg.portal.admin
Class CommunityPrincipalFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.droplet.TransactionalFormHandler
                      extended by atg.portal.admin.PortalGenericFormHandler
                          extended by atg.portal.admin.CommunityFormHandler
                              extended by atg.portal.admin.CommunityPrincipalFormHandler
All Implemented Interfaces:
DropletFormHandler, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class CommunityPrincipalFormHandler
extends CommunityFormHandler

This form handler provides convenient methods for 1. Assigning/revoke access to a community to/from a pricipal(user or organization, roles are not supported.) 2. Approve/reject membership requests made for a community.

All handle methods in this form handler mirror a similiar pattern. Each handleXXX process, all have an associated preXXX and postXXX method. For example, the handleAssignPrincipal has an associated preAssignPrincipal and postAssignPrincipal. These pre/post methods provide an easy way for customer's to extend the functionality of this form handler.

See Also:
TransactionalFormHandler, PortalGenericFormHandler

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
CommunityPrincipalFormHandler()
           
 
Method Summary
protected  boolean approveMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          approveMembershipRequest called by the handler to approve membership requests to a list of ids specified in property approvePrincipalIds
protected  boolean assignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          assignPrincipal is called by the handlers to assign principals access to a community.
protected  boolean declineMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          declineMembershipRequest is called by the handlers to decline membership requests for all the users whose ids are specified in declinePrincipalIds property of this form handler
 java.lang.String getAccessType()
           
 java.lang.String[] getApproveDeclineFlags()
           
 java.lang.String[] getApproveDeclinePrincipalIds()
           
 java.lang.String[] getApprovePrincipalIds()
           
 java.lang.String[] getDeclinePrincipalIds()
           
 atg.portal.email.EmailSender getEmailer()
           
 java.lang.String getEmailSenderAddress()
           
 int getNoOfMembershipRequests()
           
 java.lang.String getPostAcceptedMessage()
           
 java.lang.String getPostDeclinedMessage()
           
 java.lang.String getPreMessage()
           
 java.lang.String[] getPrincipalIds()
           
 java.lang.String getPrincipalType()
           
 java.lang.String getRequestEmailSubject()
           
 boolean getSendUserEmail()
           
 boolean handleApproveDeclineMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called to approve or decline membership requests all the membership requests for users whose ids are specified in approvePrincipalIds is approved while those in declinePrincipalIds are declined.
 boolean handleApproveMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called to approve membership requests membership requests for all the users whose id is specified in approvePrincipalIds will be approved.
 boolean handleAssignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called to assign a principal to a community.
 boolean handleDeclineMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called to decline membership requests.
 boolean handleUnassignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called to revoke a principal's access to a community.
 void postApproveDeclineMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after component update is finished
 void postApproveMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after component update is finished
 void postAssignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after component update is finished
 void postDeclineMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after component update is finished
 void postUnassignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after component update is finished
 void preApproveDeclineMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before component update is started
 void preApproveMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before component update is started
 void preAssignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before component update is started
 void preDeclineMembershipRequests(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before component update is started
 void preUnassignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before component update is started
protected  void resetBean()
          Reset this bean.
 void setAccessType(java.lang.String pAccessType)
           
 void setApproveDeclineFlags(int index, java.lang.String pApproveDeclineFlag)
           
 void setApproveDeclinePrincipalIds(int index, java.lang.String pApproveDeclinePrincipalId)
           
 void setApprovePrincipalIds(java.lang.String[] pApprovePrincipalIds)
           
 void setDeclinePrincipalIds(java.lang.String[] pDeclinePrincipalIds)
           
 void setEmailer(atg.portal.email.EmailSender pEmailer)
           
 void setEmailSenderAddress(java.lang.String pEmailSenderAddress)
           
 void setNoOfMembershipRequests(int pNoOfMembershipRequests)
           
 void setPostAcceptedMessage(java.lang.String pPostAcceptedMessage)
           
 void setPostDeclinedMessage(java.lang.String pPostDeclinedMessage)
           
 void setPreMessage(java.lang.String pPreMessage)
           
 void setPrincipalIds(java.lang.String[] pPrincipalIds)
           
 void setPrincipalType(java.lang.String pPrincipalType)
           
 void setRequestEmailSubject(java.lang.String pRequestEmailSubject)
           
 void setSendUserEmail(boolean pSendUserEmail)
           
protected  boolean unassignPrincipals(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          unassignPrincipal is called by the handlers to revoke access to a community from a pricipals.
 
Methods inherited from class atg.portal.admin.CommunityFormHandler
createCommunity, deleteCommunity, getAccessLevel, getActive, getCommunity, getDescription, getGearDefinitionFolderIds, getGearDefinitionFolders, getGearTitleTemplate, getHasFolders, getId, getMembershipRequest, getName, getPageCache, getPageTemplate, getParentFolder, getPersonalization, getPortal, getStyle, getUrl, getWirelessPage, handleCreate, handleDelete, handleReset, handleUpdate, handleUpdateGearDefinitionFolders, postCreateCommunity, postDeleteCommunity, postUpdate, postUpdateGearDefinitionFolders, preCreateCommunity, preDeleteCommunity, preUpdate, preUpdateGearDefinitionFolders, setAccessLevel, setActive, setCommunity, setDescription, setGearDefinitionFolderIds, setGearDefinitionFolders, setGearTitleTemplate, setHasFolders, setId, setMembershipRequest, setName, setPageCache, setPageTemplate, setParentFolder, setPersonalization, setPortal, setStyle, setUrl, setWirelessPage, updateCommunity, updateGearDefinitionFolders
 
Methods inherited from class atg.portal.admin.PortalGenericFormHandler
addFormException, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, getDefaultLocale, getFailureMessageProcessor, getFailureURL, getFormError, getFormInfo, getFormMessages, getLocale, getPublisher, getSuccessMessageProcessor, getSuccessURL, getUserLocale, handleResetFormExceptions, handleResetFormMessages, handleSetLocale, isUseRequestLocale, processException, processException, processException, processException, processSuccess, processSuccess, processSuccess, resetFormMessages, sendAlertMessage, setDefaultLocale, setFailureMessageProcessor, setFailureURL, setPublisher, setSuccessMessageProcessor, setSuccessURL, setUseRequestLocale
 
Methods inherited from class atg.droplet.TransactionalFormHandler
afterSet, beforeSet, checkFormRedirect, commitTransaction, getTransactionDemarcation, getTransactionStatus, isEnsureTransaction, isRollbackTransaction, isRollbackTransactionOnUnhandledException, isTransactionMarkedAsRollback, setEnsureTransaction, setRollbackTransaction, setRollbackTransactionOnUnhandledException, setTransactionDemarcation
 
Methods inherited from class atg.droplet.GenericFormHandler
addUncheckedFormException, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

CommunityPrincipalFormHandler

public CommunityPrincipalFormHandler()
Method Detail

getPrincipalType

public java.lang.String getPrincipalType()

setPrincipalType

public void setPrincipalType(java.lang.String pPrincipalType)

getPrincipalIds

public java.lang.String[] getPrincipalIds()

setPrincipalIds

public void setPrincipalIds(java.lang.String[] pPrincipalIds)

getAccessType

public java.lang.String getAccessType()

setAccessType

public void setAccessType(java.lang.String pAccessType)

setEmailer

public void setEmailer(atg.portal.email.EmailSender pEmailer)

getEmailer

public atg.portal.email.EmailSender getEmailer()

setEmailSenderAddress

public void setEmailSenderAddress(java.lang.String pEmailSenderAddress)

getEmailSenderAddress

public java.lang.String getEmailSenderAddress()

setPostAcceptedMessage

public void setPostAcceptedMessage(java.lang.String pPostAcceptedMessage)

getPostAcceptedMessage

public java.lang.String getPostAcceptedMessage()

setPostDeclinedMessage

public void setPostDeclinedMessage(java.lang.String pPostDeclinedMessage)

getPostDeclinedMessage

public java.lang.String getPostDeclinedMessage()

setPreMessage

public void setPreMessage(java.lang.String pPreMessage)

getPreMessage

public java.lang.String getPreMessage()

setRequestEmailSubject

public void setRequestEmailSubject(java.lang.String pRequestEmailSubject)

getRequestEmailSubject

public java.lang.String getRequestEmailSubject()

setSendUserEmail

public void setSendUserEmail(boolean pSendUserEmail)

getSendUserEmail

public boolean getSendUserEmail()

getDeclinePrincipalIds

public java.lang.String[] getDeclinePrincipalIds()

setDeclinePrincipalIds

public void setDeclinePrincipalIds(java.lang.String[] pDeclinePrincipalIds)

getNoOfMembershipRequests

public int getNoOfMembershipRequests()

setNoOfMembershipRequests

public void setNoOfMembershipRequests(int pNoOfMembershipRequests)

getApprovePrincipalIds

public java.lang.String[] getApprovePrincipalIds()

setApprovePrincipalIds

public void setApprovePrincipalIds(java.lang.String[] pApprovePrincipalIds)

getApproveDeclinePrincipalIds

public java.lang.String[] getApproveDeclinePrincipalIds()

setApproveDeclinePrincipalIds

public void setApproveDeclinePrincipalIds(int index,
                                          java.lang.String pApproveDeclinePrincipalId)

getApproveDeclineFlags

public java.lang.String[] getApproveDeclineFlags()

setApproveDeclineFlags

public void setApproveDeclineFlags(int index,
                                   java.lang.String pApproveDeclineFlag)

handleAssignPrincipals

public boolean handleAssignPrincipals(DynamoHttpServletRequest pRequest,
                                      DynamoHttpServletResponse pResponse)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Called to assign a principal to a community. Only pricipals of type atg.userdirectory.User and atg.userdirectory.Organization are supported.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

assignPrincipals

protected boolean assignPrincipals(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
assignPrincipal is called by the handlers to assign principals access to a community. The type of access to provide(guest, member, leader) should be specified in accessType property and the list of user ids to give access should be in principalIds property.

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

preAssignPrincipals

public void preAssignPrincipals(DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Operation called just before component update is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postAssignPrincipals

public void postAssignPrincipals(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Operation called just after component update is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleUnassignPrincipals

public boolean handleUnassignPrincipals(DynamoHttpServletRequest pRequest,
                                        DynamoHttpServletResponse pResponse)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
Called to revoke a principal's access to a community. Only pricipals of type atg.userdirectory.User and atg.userdirectory.Organization are supported.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

unassignPrincipals

protected boolean unassignPrincipals(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
unassignPrincipal is called by the handlers to revoke access to a community from a pricipals.

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

preUnassignPrincipals

public void preUnassignPrincipals(DynamoHttpServletRequest pRequest,
                                  DynamoHttpServletResponse pResponse)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Operation called just before component update is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postUnassignPrincipals

public void postUnassignPrincipals(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Operation called just after component update is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleApproveDeclineMembershipRequests

public boolean handleApproveDeclineMembershipRequests(DynamoHttpServletRequest pRequest,
                                                      DynamoHttpServletResponse pResponse)
                                               throws javax.servlet.ServletException,
                                                      java.io.IOException
Called to approve or decline membership requests all the membership requests for users whose ids are specified in approvePrincipalIds is approved while those in declinePrincipalIds are declined.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

handleApproveMembershipRequests

public boolean handleApproveMembershipRequests(DynamoHttpServletRequest pRequest,
                                               DynamoHttpServletResponse pResponse)
                                        throws javax.servlet.ServletException,
                                               java.io.IOException
Called to approve membership requests membership requests for all the users whose id is specified in approvePrincipalIds will be approved. An e-mail is sent to the user if sendUserEmail property is set to true.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

handleDeclineMembershipRequests

public boolean handleDeclineMembershipRequests(DynamoHttpServletRequest pRequest,
                                               DynamoHttpServletResponse pResponse)
                                        throws javax.servlet.ServletException,
                                               java.io.IOException
Called to decline membership requests. All the users whose user id is specified in declinePrincipalIds are declined membership.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

declineMembershipRequests

protected boolean declineMembershipRequests(DynamoHttpServletRequest pRequest,
                                            DynamoHttpServletResponse pResponse)
                                     throws javax.servlet.ServletException,
                                            java.io.IOException
declineMembershipRequest is called by the handlers to decline membership requests for all the users whose ids are specified in declinePrincipalIds property of this form handler

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

approveMembershipRequests

protected boolean approveMembershipRequests(DynamoHttpServletRequest pRequest,
                                            DynamoHttpServletResponse pResponse)
                                     throws javax.servlet.ServletException,
                                            java.io.IOException
approveMembershipRequest called by the handler to approve membership requests to a list of ids specified in property approvePrincipalIds

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

preDeclineMembershipRequests

public void preDeclineMembershipRequests(DynamoHttpServletRequest pRequest,
                                         DynamoHttpServletResponse pResponse)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException
Operation called just before component update is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postDeclineMembershipRequests

public void postDeclineMembershipRequests(DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Operation called just after component update is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

preApproveMembershipRequests

public void preApproveMembershipRequests(DynamoHttpServletRequest pRequest,
                                         DynamoHttpServletResponse pResponse)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException
Operation called just before component update is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postApproveMembershipRequests

public void postApproveMembershipRequests(DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Operation called just after component update is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

preApproveDeclineMembershipRequests

public void preApproveDeclineMembershipRequests(DynamoHttpServletRequest pRequest,
                                                DynamoHttpServletResponse pResponse)
                                         throws javax.servlet.ServletException,
                                                java.io.IOException
Operation called just before component update is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postApproveDeclineMembershipRequests

public void postApproveDeclineMembershipRequests(DynamoHttpServletRequest pRequest,
                                                 DynamoHttpServletResponse pResponse)
                                          throws javax.servlet.ServletException,
                                                 java.io.IOException
Operation called just after component update is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

resetBean

protected void resetBean()
Reset this bean. Set properties to null

Overrides:
resetBean in class CommunityFormHandler