KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > sites > JahiaSitesService


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13
// JahiaSitesService
14
//
15
// NK 12.03.2001
16
//
17
package org.jahia.services.sites;
18
19 import org.jahia.data.JahiaDOMObject;
20 import org.jahia.exceptions.JahiaException;
21 import org.jahia.services.JahiaService;
22
23 import java.util.Enumeration JavaDoc;
24
25 /**
26  * Jahia Multi Sites Management Service
27  *
28  * @author Khue ng
29  */

30 public abstract class JahiaSitesService extends JahiaService {
31
32     public static final int ORDER_BY_SERVER_NAME = 1;
33     public static final int ORDER_BY_TITLE = 2;
34
35
36     /**
37      * return the list of all sites
38      *
39      * @return Enumeration an enumeration of JahiaSite bean
40      */

41     public abstract Enumeration JavaDoc getSites ()
42             throws JahiaException;
43
44
45     /**
46      * return the site bean looking at it id
47      *
48      * @param int the JahiaSite id
49      *
50      * @return JahiaSite the JahiaSite bean
51      */

52     public abstract JahiaSite getSite (int id)
53             throws JahiaException;
54
55
56     /**
57      * return a site looking at its key
58      *
59      * @param String site key
60      *
61      * @return JahiaSite the JahiaSite bean or null
62      */

63     public abstract JahiaSite getSiteByKey (String JavaDoc siteKey)
64             throws JahiaException;
65
66     /**
67      * Find a site by it's server name value
68      *
69      * @param serverName the server name to look for
70      *
71      * @return if found, returns the site with the corresponding serverName,
72      * or the first one if there are multiple, or null if there are none.
73      *
74      * @throws JahiaException thrown if there was a problem communicating with
75      * the database.
76      */

77     public abstract JahiaSite getSiteByServerName (String JavaDoc serverName)
78             throws JahiaException;
79
80     /**
81      * return a site looking at its server name
82      *
83      * @param String site name
84      *
85      * @return JahiaSite the JahiaSite bean or null
86      */

87     public abstract JahiaSite getSite (String JavaDoc name)
88             throws JahiaException;
89
90
91     /**
92      * Add a new site only if there is no other site with same server name
93      *
94      * @param JahiaSite the JahiaSite bean
95      * @param JahiaSite the Creator
96      *
97      * @return boolean false if there is another site using same server name
98      *
99      * @auhtor NK
100      */

101     public abstract boolean addSite (JahiaSite site)
102             throws JahiaException;
103
104
105     /**
106      * remove a site
107      *
108      * @param JahiaSite the JahiaSite bean
109      */

110     public abstract void removeSite (JahiaSite site)
111             throws JahiaException;
112
113
114     /**
115      * Update a JahiaSite definition
116      *
117      * @param JahiaSite the site bean object
118      */

119     public abstract void updateSite (JahiaSite site)
120             throws JahiaException;
121
122
123
124     //-------------------------------------------------------------------------
125
/**
126      * Return the amount of sites in the system.
127      *
128      * @return Amount of sites in the system.
129      */

130     public abstract int getNbSites ()
131             throws JahiaException;
132
133     //-------------------------------------------------------------------------
134
/**
135      * Add a site to the list of site going to be deleted
136      *
137      * @param int siteID
138      */

139     public abstract void addSiteToDelete (int siteID);
140
141     //-------------------------------------------------------------------------
142
/**
143      * Remove a given site from the list of site going to be deleted
144      *
145      * @param int siteID
146      */

147     public abstract void removeSiteToDelete (int siteID);
148
149     //-------------------------------------------------------------------------
150
/**
151      * Return true if the given site is going to be deleted
152      *
153      * @param int the site id
154      *
155      * @return boolean
156      */

157     public abstract boolean isSiteToBeDeleted (int siteID);
158
159     //--------------------------------------------------------------------------
160
/**
161      * returns a DOM representation of a site
162      *
163      * @param int siteID
164      *
165      * @auhtor NK
166      */

167     public abstract JahiaDOMObject getSiteAsDOM (int siteID) throws JahiaException;
168
169     //--------------------------------------------------------------------------
170
/**
171      * returns a DOM representation of a site's properties
172      *
173      * @param int siteID
174      *
175      * @auhtor NK
176      */

177     public abstract JahiaDOMObject getSitePropsAsDOM (int siteID) throws JahiaException;
178
179     /**
180      * Returns a properties as a String.
181      *
182      * @param int siteid
183      * @param String the property name
184      */

185     public abstract String JavaDoc getProperty (int siteID, String JavaDoc key) throws JahiaException;
186
187 }
188
189
Popular Tags