KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > exceptions > JahiaTemplateNotFoundException


1 // $Id: JahiaTemplateNotFoundException.java 3567 2003-06-30 22:32:03Z shuber $
2
//
3
//
4
// ____.
5
// __/\ ______| |__/\. _______
6
// __ .____| | \ | +----+ \
7
// _______| /--| | | - \ _ | : - \_________
8
// \\______: :---| : : | : | \________>
9
// |__\---\_____________:______: :____|____:_____\
10
// /_____|
11
//
12
// . . . i n j a h i a w e t r u s t . . .
13
//
14

15
16 package org.jahia.exceptions;
17
18
19 /**
20  * This exception is raised when a page template object is requested and is not
21  * present in the database.
22  *
23  * @author Fulco Houkes
24  * @version 1.1
25  *
26  * @see JahiaException
27  */

28 public class JahiaTemplateNotFoundException extends JahiaException
29 {
30     private int mPageTemplateID = -1;
31     private String JavaDoc mPageTemplateName = null;
32
33     //-------------------------------------------------------------------------
34
/** Default constructor
35      *
36      * @param templateID
37      * The page tempate ID.
38      */

39     public JahiaTemplateNotFoundException (int templateID)
40     {
41         super ("The page template could not be found",
42                "The page template ["+templateID+"] could not be found",
43                LOCK_ERROR, ERROR_SEVERITY);
44
45         mPageTemplateID = templateID;
46     }
47
48     //-------------------------------------------------------------------------
49
/** Default constructor
50      *
51      * @param templateName
52      * The page tempalte name.
53      */

54     public JahiaTemplateNotFoundException (String JavaDoc templateName)
55     {
56         super ("The page template could not be found",
57                "The page template ["+templateName+"] could not be found",
58                LOCK_ERROR, ERROR_SEVERITY);
59
60         mPageTemplateName = templateName;
61     }
62
63
64     //-------------------------------------------------------------------------
65
/** Return the page template ID
66      *
67      * @return
68      * Return the page template ID. Return -1 if the template was not
69      * accessed by it's ID. In this case, the method
70      * {@link #getPageTemplateName() getPageTemplateName()} will
71      * return the page template name.
72      */

73     public final int getPageTemplateID () {
74         return mPageTemplateID;
75     }
76
77     //-------------------------------------------------------------------------
78
/** Return the page template name.
79      *
80      * @return
81      * Return the page template name. Return null if the template was not
82      * accessed by it's name, in this case the method
83      * {@link #getPageTemplateID() getPageTemplateID()} will return the
84      * page template ID.
85      */

86     public final String JavaDoc getPageTemplateName () {
87         return mPageTemplateName;
88     }
89 }
90
Popular Tags