com.wm.app.tn.db
Class OnboardingOps

java.lang.Object
  extended by com.wm.app.tn.db.OnboardingOps

public class OnboardingOps
extends java.lang.Object

Provides database operations for the Onboarding modules, that does not have its own database store class. Currently this contains the methods for E-mail invite module. This class should contain the database operations corresponding to the services in com.wm.app.tn.onboarding.Onboarding class.

This class does not have any application knowledge and the data is not validated in the services exposed. It is the responsibility of the caller to do necessary validations.


Constructor Summary
OnboardingOps()
           
 
Method Summary
static java.lang.String addInvite(com.wm.app.tn.onboarding.Invite invite)
          Insert the data for Email invite configuration.
static ActivityLogEntry createActivityLog(java.lang.String partnerID, java.lang.String questionnaire)
           
static boolean deleteInvite(java.lang.String inviteId)
          Deletes the configuration for an email invitation from database.
static com.wm.app.tn.onboarding.Invite getInvite(java.lang.String inviteId)
          Get the configuration details for an Email invite.
static com.wm.app.tn.onboarding.Invite getInviteByPartner(java.lang.String partnerID)
          Get the configuration details for an Email invite.
static java.lang.String getQuestionnaireData(java.lang.String partnerID, java.lang.String templateID)
          This is to get the QuestionnaireData for the template
static java.lang.String getSubStatus(java.lang.String partnerID)
          Gets the Substatus of Partner (Pending Partner)
static com.wm.data.IData[] getTemplates()
          Temporary method for returning the name and id of all Questionnaire templates available in the system.
static void insertActivityLog(java.lang.String partnerID, java.lang.String questionnaire)
           
static com.wm.data.IData query(InviteQuery query, int pageSize, int maxR, int qryT, int threshold, java.lang.String queryId)
           
static com.wm.data.IData[] queryTemplates(java.lang.String templateName)
          Public method to fetch template information from the DB by name
static void saveQuestionnaireData(java.lang.String partnerID, java.lang.String templateID, java.lang.String questionnaireBytes, java.lang.String status)
          This saves the questionnaire template data in the database which are associated with the partner.
static java.lang.String updateInvitationSent(com.wm.app.tn.onboarding.Invite invite)
          Update the invitationSent boolean for Email invite configuration.
static void updateInvite(com.wm.app.tn.onboarding.Invite invite)
          Updates the data for an Email invite configuration.
static void updateQuestionnaireStatus(java.lang.String partnerID, java.lang.String templateID, java.lang.String approvalStatus)
          Method to update the status of the Questionnaire
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnboardingOps

public OnboardingOps()
Method Detail

addInvite

public static java.lang.String addInvite(com.wm.app.tn.onboarding.Invite invite)
                                  throws java.sql.SQLException,
                                         com.wm.app.tn.onboarding.OnboardingException
Insert the data for Email invite configuration.

Parameters:
invite - The invite object that contains the configuration data.
Returns:
The id of the invite record created in database.
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException - - if an invite configuration already exists in the database with the same invite name.
See Also:
Invite

getSubStatus

public static java.lang.String getSubStatus(java.lang.String partnerID)
                                     throws java.sql.SQLException
Gets the Substatus of Partner (Pending Partner)

Parameters:
partnerID - of Partner for which Status is needed
Returns:
Throws:
java.sql.SQLException

updateInvitationSent

public static java.lang.String updateInvitationSent(com.wm.app.tn.onboarding.Invite invite)
                                             throws java.sql.SQLException,
                                                    com.wm.app.tn.onboarding.OnboardingException
Update the invitationSent boolean for Email invite configuration.

Parameters:
invite - The invite object that contains the configuration data.
Returns:
The id of the invite record created in database.
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException - .
See Also:
Invite

getInvite

public static com.wm.app.tn.onboarding.Invite getInvite(java.lang.String inviteId)
                                                 throws java.sql.SQLException,
                                                        com.wm.app.tn.onboarding.OnboardingException
Get the configuration details for an Email invite.

Parameters:
inviteId - The id for which the invite details need to be retrieved.
Returns:
the com.wm.app.tn.onboarding.Invite object containing the details. Returns null if there is no data corresponding to the invitation id.
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException - if any error occurs while retrieving the ScheduleData for the email invitation.
See Also:
Invite

getInviteByPartner

public static com.wm.app.tn.onboarding.Invite getInviteByPartner(java.lang.String partnerID)
                                                          throws java.sql.SQLException,
                                                                 com.wm.app.tn.onboarding.OnboardingException
Get the configuration details for an Email invite.

Parameters:
partnerId - The id of the partner for which invitation being resent.
Returns:
the com.wm.app.tn.onboarding.Invite object containing the details. Returns null if there is no data corresponding to the invitation id.
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException - if any error occurs while retrieving the ScheduleData for the email invitation.
See Also:
Invite

updateInvite

public static void updateInvite(com.wm.app.tn.onboarding.Invite invite)
                         throws java.sql.SQLException,
                                com.wm.app.tn.onboarding.OnboardingException
Updates the data for an Email invite configuration.

Parameters:
invite - The com.wm.app.tn.onboarding.Invite object that contains the configuration data.
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException - - if an invite configuration already exists in the database with the same invite name.
See Also:
Invite

deleteInvite

public static boolean deleteInvite(java.lang.String inviteId)
                            throws java.sql.SQLException
Deletes the configuration for an email invitation from database.

Parameters:
inviteId - Id of the email invitation to be deleted.
Returns:
true if the data is successfully deleted. false if the data corresponding to the email id is not present in the database.
Throws:
java.sql.SQLException - if there a database exception while removing Invitation data.
See Also:
Invite

getTemplates

public static com.wm.data.IData[] getTemplates()
                                        throws java.sql.SQLException
Temporary method for returning the name and id of all Questionnaire templates available in the system. This is a temporary method, since the template module is not yet implemented.

Returns:
Array of IData. Each IData element will contain the keys "id" and "name", and the correspoding values will be the template id and template name.
Throws:
java.sql.SQLException

query

public static com.wm.data.IData query(InviteQuery query,
                                      int pageSize,
                                      int maxR,
                                      int qryT,
                                      int threshold,
                                      java.lang.String queryId)
                               throws java.sql.SQLException,
                                      java.io.IOException,
                                      com.wm.app.repo.RepositoryException,
                                      com.wm.app.b2b.server.ServiceException
Throws:
java.sql.SQLException
java.io.IOException
com.wm.app.repo.RepositoryException
com.wm.app.b2b.server.ServiceException

queryTemplates

public static com.wm.data.IData[] queryTemplates(java.lang.String templateName)
                                          throws java.lang.Exception
Public method to fetch template information from the DB by name

Parameters:
templateName - String name of the template
Returns:
IData[] Templates with details
Throws:
java.lang.Exception

saveQuestionnaireData

public static void saveQuestionnaireData(java.lang.String partnerID,
                                         java.lang.String templateID,
                                         java.lang.String questionnaireBytes,
                                         java.lang.String status)
                                  throws java.lang.Exception
This saves the questionnaire template data in the database which are associated with the partner.

Parameters:
partnerID -
templateID - template ID
questionnaireBytes - Questionnaire data
status - status of the Questionnaire Data
Throws:
java.sql.SQLException
java.lang.Exception

getQuestionnaireData

public static java.lang.String getQuestionnaireData(java.lang.String partnerID,
                                                    java.lang.String templateID)
                                             throws java.lang.Exception
This is to get the QuestionnaireData for the template

Parameters:
partnerID -
templateID -
Returns:
Template
Throws:
java.lang.Exception

createActivityLog

public static ActivityLogEntry createActivityLog(java.lang.String partnerID,
                                                 java.lang.String questionnaire)

insertActivityLog

public static void insertActivityLog(java.lang.String partnerID,
                                     java.lang.String questionnaire)

updateQuestionnaireStatus

public static void updateQuestionnaireStatus(java.lang.String partnerID,
                                             java.lang.String templateID,
                                             java.lang.String approvalStatus)
                                      throws java.lang.Exception
Method to update the status of the Questionnaire

Parameters:
partnerID -
templateID -
approvalStatus -
Throws:
java.lang.Exception