com.buildforge.services.client.dbo
Class Template

java.lang.Object
  extended by com.buildforge.services.client.dbo.Template

public class Template
extends java.lang.Object

This class represents the email notification templates used by the system to generate notification emails on specific events. They are owned and scoped by a specific Project's Step.


Field Summary
static java.lang.Class<Template> CLASS
           
 
Constructor Summary
Template(APIClientConnection conn, int projectId, int stepId)
          Deprecated. use Template(APIClientConnection, int, int, String, String) instead
Template(APIClientConnection conn, int projectId, int stepId, java.lang.String name, java.lang.String locale)
          Defines a new Template for a specific Project's Step
 
Method Summary
 Template create()
          Creates a new Template in the database
 void delete()
          Removes this Template from the database
static void deleteById(APIClientConnection conn, int projectId, int stepId, java.lang.String name, java.lang.String locale)
          Removes the specified Template from the database
static java.util.List<Template> findAll(APIClientConnection conn, int projectId, int stepId)
          Deprecated. Use findById(APIClientConnection, int, int, String, String) instead.
static Template findById(APIClientConnection conn, int projectId, int stepId, java.lang.String templateName, java.lang.String locale)
          Retrieves a specific named Template of a Project's Step
 java.lang.String getBodyText()
          Returns the text of the Template itself
 java.lang.String getDescription()
          Returns the user-defined decription of this Template
 java.lang.String getFrom()
          Returns the address to be used as the 'From' address when emailing this Template
 java.lang.String getLocale()
          Returns the ISO 639 code for the language of this template, e.g.: 'en_US', 'fr_CA', etc.
 java.lang.String getName()
          Returns the unique (project step-wide) name of this Template
 int getProjectId()
          Returns the identifier of the Project that owns this Template
 int getStepId()
          Returns the identifier of the Step that owns this Template
 java.lang.String getSubject()
          Returns the text of the 'Subject' that will be used when emailing this Template
 void setBodyText(java.lang.String bodyText)
          Sets the text of the Template itself
 void setDescription(java.lang.String description)
          Sets user-defined decription of this Template
 void setFrom(java.lang.String from)
          Sets the address to be used as the 'From' address when emailing this Template
 void setLocale(java.lang.String newLocale)
          Sets the ISO 639 code for the language of this template, e.g.: 'en_US', 'fr_CA', etc.
 void setName(java.lang.String name)
          Sets the unique (project step-wide) name of this Template
 void setProjectId(int newProjectId)
          Sets the identifier of the Project that owns this Template
 void setStepId(int newStepId)
          Sets the identifier of the Step that owns this Template
 void setSubject(java.lang.String subject)
          Sets the text of the 'Subject' that will be used when emailing this Template
 java.lang.String toString()
           
 Template update()
          Commits the current state of this Template to the database
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.Class<Template> CLASS
Constructor Detail

Template

public Template(APIClientConnection conn,
                int projectId,
                int stepId)
Deprecated. use Template(APIClientConnection, int, int, String, String) instead

Defines a new Template for a specific Project's Step

Parameters:
conn -
projectId - The integer identifier of the Project to which this Template belongs
stepId - The integer identifer of the Step to which this Template belongs

Template

public Template(APIClientConnection conn,
                int projectId,
                int stepId,
                java.lang.String name,
                java.lang.String locale)
Defines a new Template for a specific Project's Step

Parameters:
conn -
projectId - The integer identifier of the Project to which this Template belongs
stepId - The integer identifer of the Step to which this Template belongs
name - The unique name of this Template
locale - The ISO 639 code for the language of this template, e.g.: 'en_US', 'fr_CA', etc.
Method Detail

findAll

public static java.util.List<Template> findAll(APIClientConnection conn,
                                               int projectId,
                                               int stepId)
                                        throws java.io.IOException,
                                               ServiceException
Deprecated. Use findById(APIClientConnection, int, int, String, String) instead.

Retrieves all Templates for a given Project's Step.

Parameters:
conn -
projectId -
stepId -
Returns:
Throws:
java.io.IOException
ServiceException

findById

public static Template findById(APIClientConnection conn,
                                int projectId,
                                int stepId,
                                java.lang.String templateName,
                                java.lang.String locale)
                         throws java.io.IOException,
                                ServiceException
Retrieves a specific named Template of a Project's Step

Parameters:
conn - the API client connection to use
projectId - the id of the project for the template
stepId - 1 based step id (or 0 if no step)
templateName - name of the template
locale - locale of the template
Returns:
Throws:
java.io.IOException
ServiceException

create

public Template create()
                throws java.io.IOException,
                       ServiceException
Creates a new Template in the database

Returns:
Throws:
java.io.IOException
ServiceException

update

public Template update()
                throws java.io.IOException,
                       ServiceException
Commits the current state of this Template to the database

Returns:
Throws:
java.io.IOException
ServiceException

delete

public void delete()
            throws java.io.IOException,
                   ServiceException
Removes this Template from the database

Throws:
java.io.IOException
ServiceException

deleteById

public static void deleteById(APIClientConnection conn,
                              int projectId,
                              int stepId,
                              java.lang.String name,
                              java.lang.String locale)
                       throws java.io.IOException,
                              ServiceException
Removes the specified Template from the database

Parameters:
conn -
projectId -
stepId -
name -
locale -
Throws:
java.io.IOException
ServiceException

getProjectId

public int getProjectId()
Returns the identifier of the Project that owns this Template


getStepId

public int getStepId()
Returns the identifier of the Step that owns this Template


getBodyText

public java.lang.String getBodyText()
Returns the text of the Template itself


getDescription

public java.lang.String getDescription()
Returns the user-defined decription of this Template


getFrom

public java.lang.String getFrom()
Returns the address to be used as the 'From' address when emailing this Template


getLocale

public java.lang.String getLocale()
Returns the ISO 639 code for the language of this template, e.g.: 'en_US', 'fr_CA', etc.


getName

public java.lang.String getName()
Returns the unique (project step-wide) name of this Template


getSubject

public java.lang.String getSubject()
Returns the text of the 'Subject' that will be used when emailing this Template


setBodyText

public void setBodyText(java.lang.String bodyText)
Sets the text of the Template itself

Parameters:
bodyText -

setDescription

public void setDescription(java.lang.String description)
Sets user-defined decription of this Template

Parameters:
description -

setFrom

public void setFrom(java.lang.String from)
Sets the address to be used as the 'From' address when emailing this Template

Parameters:
from -

setLocale

public void setLocale(java.lang.String newLocale)
Sets the ISO 639 code for the language of this template, e.g.: 'en_US', 'fr_CA', etc.

Parameters:
newLocale -

setName

public void setName(java.lang.String name)
Sets the unique (project step-wide) name of this Template

Parameters:
name -

setProjectId

public void setProjectId(int newProjectId)
Sets the identifier of the Project that owns this Template

Parameters:
newProjectId - the new Project identifier

setStepId

public void setStepId(int newStepId)
Sets the identifier of the Step that owns this Template

Parameters:
newStepId - the new Step identifier

setSubject

public void setSubject(java.lang.String subject)
Sets the text of the 'Subject' that will be used when emailing this Template

Parameters:
subject -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object