com.wm.app.tn.db
Class TemplatesOps

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

public class TemplatesOps
extends java.lang.Object

Provides database operations for the Onboarding Templates related API. This class should contain the database operations corresponding to the services in wm.tn.portal.onboarding.templates class.


Constructor Summary
TemplatesOps()
           
 
Method Summary
static void addGroup(java.sql.Connection conn, com.wm.app.tn.onboarding.TemplateGroup groups)
           
static java.lang.String addGroup(com.wm.app.tn.onboarding.TemplateGroup group)
           
static void addTemplateField(java.sql.Connection conn, java.lang.String templateId, com.wm.app.tn.onboarding.TemplateField field, java.lang.String templateFieldOrder)
          This is to insert the template fields associated with the template.
static java.lang.String addTemplateField(java.sql.Connection conn, com.wm.app.tn.onboarding.TemplateField field)
           
static java.lang.String addTemplateField(com.wm.app.tn.onboarding.TemplateField field)
          Insert the data for a template field.
static java.lang.String createTemplate(com.wm.app.tn.onboarding.Template template)
           
static java.util.List<com.wm.app.tn.onboarding.TemplateField> getFieldsByGroup(java.lang.String groupID, java.lang.String groupName)
          Fetches list of Template fields defined for a Template Group
static com.wm.data.IData[] getQuestionnares(java.lang.String userName)
           
static com.wm.data.IData[] getSubmittedQuestionnares(java.lang.String queryString)
          This Method returns list of submitted questionnaires
static com.wm.app.tn.onboarding.Template getTemplate(java.sql.Connection conn, java.lang.String templateId, java.lang.String templateName)
           
static com.wm.app.tn.onboarding.Template getTemplate(java.lang.String templateId, java.lang.String templateName)
           
static com.wm.app.tn.onboarding.TemplateField getTemplateField(java.lang.String fieldId)
           
static com.wm.app.tn.onboarding.TemplateGroup[] getTemplateGroups(java.sql.Connection conn, java.lang.String templateId)
          This is to get the template groups associated with the template
static java.lang.String insertTemplate(java.sql.Connection conn, com.wm.app.tn.onboarding.Template template)
          This is used to create a template using the open connection.
static boolean isTemplateDisabled(java.lang.String templateId)
           
static java.lang.String[] listGroups()
           
static boolean templatefieldExists(java.sql.Connection conn, java.lang.String fldID)
          This is used to check whether the templatefield exists.
static boolean updateGroup(com.wm.app.tn.onboarding.TemplateGroup group)
           
static void updateTemplate(java.sql.Connection conn, com.wm.app.tn.onboarding.Template template)
          This is used to update the template having open connection.
static void updateTemplate(com.wm.app.tn.onboarding.Template template)
          This is used to update the template.
static java.lang.String updateTemplateField(com.wm.app.tn.onboarding.TemplateField field)
          Update the data for a template field.
static com.wm.app.tn.onboarding.TemplateGroup viewGroup(java.lang.String groupID, java.lang.String groupName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplatesOps

public TemplatesOps()
Method Detail

addTemplateField

public static java.lang.String addTemplateField(java.sql.Connection conn,
                                                com.wm.app.tn.onboarding.TemplateField field)
                                         throws java.sql.SQLException,
                                                com.wm.app.tn.onboarding.OnboardingException
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException

addTemplateField

public static java.lang.String addTemplateField(com.wm.app.tn.onboarding.TemplateField field)
                                         throws java.sql.SQLException,
                                                com.wm.app.tn.onboarding.OnboardingException
Insert the data for a template field.

Parameters:
field - The templateField object that contains the data.
Returns:
The Id of the templateField created in the database.
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException - - if a field already exists in the database with the same field name.

updateTemplateField

public static java.lang.String updateTemplateField(com.wm.app.tn.onboarding.TemplateField field)
                                            throws java.sql.SQLException,
                                                   com.wm.app.tn.onboarding.OnboardingException
Update the data for a template field.

Parameters:
field - The templateField object that contains the data.
Returns:
The Id of the templateField created in the database.
Throws:
java.sql.SQLException
OnboardingException- - if a field already exists in the database with the same field name.
com.wm.app.tn.onboarding.OnboardingException

getFieldsByGroup

public static java.util.List<com.wm.app.tn.onboarding.TemplateField> getFieldsByGroup(java.lang.String groupID,
                                                                                      java.lang.String groupName)
                                                                               throws java.sql.SQLException,
                                                                                      com.wm.app.tn.onboarding.OnboardingException
Fetches list of Template fields defined for a Template Group

Parameters:
groupID - - The template Group ID. groupName - The template Group Name
Returns:
list of Template fields defined for a Template Group
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException

updateGroup

public static boolean updateGroup(com.wm.app.tn.onboarding.TemplateGroup group)
                           throws java.lang.Exception
Throws:
java.lang.Exception

viewGroup

public static com.wm.app.tn.onboarding.TemplateGroup viewGroup(java.lang.String groupID,
                                                               java.lang.String groupName)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

addGroup

public static java.lang.String addGroup(com.wm.app.tn.onboarding.TemplateGroup group)
                                 throws java.io.IOException,
                                        java.sql.SQLException,
                                        com.wm.app.tn.onboarding.OnboardingException
Throws:
java.io.IOException
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException

getTemplateField

public static com.wm.app.tn.onboarding.TemplateField getTemplateField(java.lang.String fieldId)
                                                               throws java.sql.SQLException,
                                                                      com.wm.app.tn.onboarding.OnboardingException
Throws:
java.sql.SQLException
com.wm.app.tn.onboarding.OnboardingException

addGroup

public static void addGroup(java.sql.Connection conn,
                            com.wm.app.tn.onboarding.TemplateGroup groups)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

listGroups

public static java.lang.String[] listGroups()
                                     throws java.sql.SQLException,
                                            java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException

getQuestionnares

public static com.wm.data.IData[] getQuestionnares(java.lang.String userName)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

createTemplate

public static java.lang.String createTemplate(com.wm.app.tn.onboarding.Template template)
                                       throws java.sql.SQLException,
                                              java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

insertTemplate

public static java.lang.String insertTemplate(java.sql.Connection conn,
                                              com.wm.app.tn.onboarding.Template template)
                                       throws java.lang.Exception
This is used to create a template using the open connection.

Parameters:
conn -
template -
Returns:
Throws:
java.lang.Exception

addTemplateField

public static void addTemplateField(java.sql.Connection conn,
                                    java.lang.String templateId,
                                    com.wm.app.tn.onboarding.TemplateField field,
                                    java.lang.String templateFieldOrder)
                             throws java.lang.Exception
This is to insert the template fields associated with the template.

Parameters:
conn -
templateId -
field -
templateFieldOrder -
Throws:
java.lang.Exception

templatefieldExists

public static boolean templatefieldExists(java.sql.Connection conn,
                                          java.lang.String fldID)
                                   throws java.sql.SQLException
This is used to check whether the templatefield exists.

Parameters:
conn -
fldID -
Returns:
Throws:
java.sql.SQLException

updateTemplate

public static void updateTemplate(com.wm.app.tn.onboarding.Template template)
                           throws java.sql.SQLException,
                                  java.lang.Exception
This is used to update the template.

Parameters:
template -
Throws:
java.sql.SQLException
java.lang.Exception

updateTemplate

public static void updateTemplate(java.sql.Connection conn,
                                  com.wm.app.tn.onboarding.Template template)
                           throws java.lang.Exception
This is used to update the template having open connection.

Parameters:
conn -
template -
Throws:
java.lang.Exception

getTemplate

public static com.wm.app.tn.onboarding.Template getTemplate(java.lang.String templateId,
                                                            java.lang.String templateName)
                                                     throws java.lang.Exception
Parameters:
templateId -
templateName -
Returns:
Throws:
java.lang.Exception

getTemplate

public static com.wm.app.tn.onboarding.Template getTemplate(java.sql.Connection conn,
                                                            java.lang.String templateId,
                                                            java.lang.String templateName)
                                                     throws java.lang.Exception
Parameters:
conn -
templateId -
templateName -
Returns:
Throws:
java.lang.Exception

getTemplateGroups

public static com.wm.app.tn.onboarding.TemplateGroup[] getTemplateGroups(java.sql.Connection conn,
                                                                         java.lang.String templateId)
                                                                  throws java.sql.SQLException,
                                                                         ProfileStoreException,
                                                                         java.lang.Exception
This is to get the template groups associated with the template

Parameters:
conn -
templateId -
Returns:
Throws:
java.sql.SQLException
ProfileStoreException
java.lang.Exception

getSubmittedQuestionnares

public static com.wm.data.IData[] getSubmittedQuestionnares(java.lang.String queryString)
                                                     throws java.lang.Exception
This Method returns list of submitted questionnaires

Parameters:
queryString -
Returns:
Throws:
java.lang.Exception

isTemplateDisabled

public static boolean isTemplateDisabled(java.lang.String templateId)
                                  throws java.lang.Exception
Throws:
java.lang.Exception