KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > applications > JahiaApplicationsPersistanceService


1 //
2
// JahiaApplicationsDBService
3
// EV 29.11.2000
4
//
5
// get_applications_list( jahiaID )
6
// get_application_definition( appID )
7

8 // add_application( appBean )
9
// update_application( appBean )
10
//
11

12 package org.jahia.services.applications;
13
14 import org.jahia.data.JahiaDOMObject;
15 import org.jahia.data.applications.ApplicationBean;
16 import org.jahia.exceptions.JahiaException;
17 import org.jahia.services.JahiaService;
18 import org.jahia.services.usermanager.JahiaUser;
19
20 import java.util.Vector JavaDoc;
21
22
23 /**
24  * This services offers methods that allow the storage and retrieval of application
25  * information from a persistant source, such as a database, flat files, XML
26  * files.
27  * You should not directly access this service, but rather through the JahiaApplicationManagerService !
28  *
29  * @author Eric Vassalli
30  * @author Serge Huber
31  * @version 1.0
32  */

33
34 public abstract class JahiaApplicationsPersistanceService extends JahiaService {
35
36
37     /**
38      * Retrieves the number of distinct jahia website
39      * exist it creates it.
40      *
41      * @return
42      */

43     public abstract Vector JavaDoc getWebSites () throws JahiaException;
44
45
46     /**
47      * Retrieves the list of available applications .
48      * called by FieldForms.drawApplicationForm
49      *
50      * @param visibleOnly if true, return only applications with visible status = 1
51      *
52      * @return Vector containing ApplicationBean objects that contain the application
53      * definitions
54      *
55      * @throws JahiaException generated if an error occured during retrieval
56      * fromm persistant storage
57      */

58     public abstract Vector JavaDoc get_applications_list (boolean visibleOnly) throws JahiaException;
59
60
61     /**
62      * Retrieves the list of available applications for a jahia site.
63      * called by FieldForms.drawApplicationForm
64      *
65      * @param jahiaID identifier of the jahia site that we are requesting the
66      * applications for
67      * @param visibleOnly if true, return only applications with visible status = 1
68      *
69      * @return Vector containing ApplicationBean objects that contain the application
70      * definitions
71      *
72      * @throws JahiaException generated if an error occured during retrieval
73      * fromm persistant storage
74      */

75     public abstract Vector JavaDoc get_applications_list (int jahiaID, boolean visibleOnly)
76             throws JahiaException;
77
78     /**
79      * Retrieves a single application definition by specifying it's index in the
80      * persistant storage area.
81      * called by ApplicationsRegistry.getApplication()
82      *
83      * @param appID identifier of the application
84      *
85      * @return ApplicationBean object containing the information relative to
86      * the application retrieved from persistant storage
87      */

88     public abstract ApplicationBean get_application_definition (int appID)
89             throws JahiaException;
90
91     /**
92      * return an Application Definition , looking at the context
93      */

94     public abstract ApplicationBean get_application_definition (String JavaDoc context)
95             throws JahiaException;
96
97
98     /**
99      * Adds an application entry in persistant storage
100      * called by DownloadApp_Engine.processForm()
101      *
102      * @param theApp an ApplicationBean to be stored in persistant storage area
103      *
104      * @throws JahiaException if there was an error during storage
105      */

106     public abstract void add_application (ApplicationBean theApp)
107             throws JahiaException;
108
109     /**
110      * Updates the entry for an application in the persistant storage area
111      * called by add_application
112      *
113      * @param theApp an ApplicationBean object containing the new data that
114      * will replace the data stored in the persistant storage area
115      *
116      * @throws JahiaException if there was an error while updating the data
117      * in the persistant storage area
118      */

119     public abstract void update_application (ApplicationBean theApp)
120             throws JahiaException;
121
122     /**
123      * Removes an application from the persistant storage area
124      *
125      * @param theApp an ApplicationBean object containing the application to
126      * remove from the persistant storage area
127      *
128      * @throws org.jahia.exceptions.JahiaException
129      * if there was an error while removing the application
130      * data from persistant storage area
131      */

132     public abstract void removeApplication (ApplicationBean theApp)
133             throws JahiaException;
134
135     /**
136      * Removes an application from the persistant storage area
137      *
138      * @param appID identifier of the application to remove from the persistant
139      * storage area
140      *
141      * @throws org.jahia.exceptions.JahiaException
142      * if there was an error while removing the application
143      * data from persistant storage area
144      */

145     public abstract void removeApplication (int appID)
146             throws JahiaException;
147
148     /**
149      * return a DOM document of applications definitions
150      *
151      * @param siteID the site id
152      *
153      * @return JahiaDOMObject a DOM representation of this object
154      */

155     public abstract JahiaDOMObject getApplicationDefsAsDOM (int siteID)
156             throws JahiaException;
157
158
159     ///////////////////////////////////////////////////////////////////////////////////////////////
160
// FIXME -Fulco-
161
//
162
// The purpose of the method is only to add the creator of an application
163
// (application adding on a page) into the groups "manager" and "administrator".
164
//
165
// REMOVE THIS METHOD AS SOON AS POSSIBLE !!!!!!
166
//
167
///////////////////////////////////////////////////////////////////////////////////////////////
168
public abstract void fake_create_application_groups (ApplicationBean theApp,
169                                                          int fieldID,
170                                                          JahiaUser user)
171             throws JahiaException;
172
173 }
174
Popular Tags