KickJava   Java API By Example, From Geeks To Geeks.

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


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 //
14
// JahiaApplicationsManagerService
15
// NK 10.02.2000
16
//
17
//
18

19 package org.jahia.services.applications;
20
21 import org.jahia.data.JahiaDOMObject;
22 import org.jahia.data.applications.ApplicationBean;
23 import org.jahia.data.fields.JahiaField;
24 import org.jahia.exceptions.JahiaException;
25 import org.jahia.services.JahiaService;
26
27 import java.util.Vector JavaDoc;
28
29
30 /**
31  * This Service is used to manage the jahia application definitions.
32  *
33  * @author Khue ng
34  * @version 1.0
35  */

36 public abstract class JahiaApplicationsManagerService extends JahiaService {
37
38
39     //--------------------------------------------------------------------------
40
/**
41      * return a vector of distinct Jahia web site for all application definitions
42      *
43      * @return a Vector of Jahia Web site
44      */

45     public abstract Vector JavaDoc getWebSites ()
46             throws JahiaException;
47
48     //--------------------------------------------------------------------------
49
/**
50      * return an Application Definition get directly from db
51      *
52      * @param appID the appID
53      *
54      * @return ApplicationBean, the Application Definition
55      */

56     public abstract ApplicationBean getApplication (int appID)
57             throws JahiaException;
58
59     //--------------------------------------------------------------------------
60
/**
61      * return an Application Definition looking at its context.
62      *
63      * @param context , the context
64      *
65      * @return ApplicationBean, the Application Definition
66      */

67     public abstract ApplicationBean getApplication (String JavaDoc context)
68             throws JahiaException;
69
70     //--------------------------------------------------------------------------
71
/**
72      * return all application Definitions
73      *
74      * @return Enumeration an enumerations of ApplicationBean or null if empty
75      */

76     public abstract Vector JavaDoc getApplications ()
77             throws JahiaException;
78
79     //--------------------------------------------------------------------------
80
/**
81      * return all application Definitions for a gived site ( jahia id )
82      *
83      * @param jahiaID the JahiaID web site
84      *
85      * @return Vector of ApplicationBean
86      */

87     public abstract Vector JavaDoc getApplications (int jahiaID)
88             throws JahiaException;
89
90     //--------------------------------------------------------------------------
91
/**
92      * set an application Visible to users
93      *
94      * @param appID the application identification
95      * @param visible status
96      *
97      * @return false on error
98      */

99     public abstract boolean setVisible (int appID, boolean visible)
100             throws JahiaException;
101
102     //--------------------------------------------------------------------------
103
/**
104      * Add a new Application Definition.
105      * both in ApplicationsRegistry and in Persistance
106      *
107      * @param app the app Definition
108      *
109      * @return false on error
110      */

111     public abstract boolean addDefinition (ApplicationBean app)
112             throws JahiaException;
113
114     //--------------------------------------------------------------------------
115
/**
116      * Save the Application Definition.
117      * both in ApplicationsRegistry and in Persistance
118      *
119      * @param app the app Definition
120      *
121      * @return false on error
122      */

123     public abstract boolean saveDefinition (ApplicationBean app)
124             throws JahiaException;
125
126     //--------------------------------------------------------------------------
127
/**
128      * Removes an application from the persistant storage area and from registry.
129      *
130      * @param appID identifier of the application to remove from the persistant
131      * storage area
132      *
133      * @throws org.jahia.exceptions.JahiaException
134      * if there was an error while removing the application
135      * data from persistant storage area
136      */

137     public abstract void removeApplication (int appID)
138             throws JahiaException;
139
140     //--------------------------------------------------------------------------
141
/**
142      * delete groups associated with an application.
143      * When deleting an Application definition, should call this method to
144      * remove unused groups
145      */

146     public abstract void deleteApplicationGroups (ApplicationBean app)
147             throws JahiaException;
148
149     //--------------------------------------------------------------------------
150
/**
151      * create groups for each context, that is for each field id
152      */

153     public abstract void createApplicationGroups (ApplicationBean theApp, JahiaField theField)
154             throws JahiaException;
155
156     //--------------------------------------------------------------------------
157
/**
158      * delete groups associated with a gived context, that is attached to a field id
159      * and all its members
160      */

161     public abstract void deleteApplicationGroups (ApplicationBean theApp, JahiaField theField)
162             throws JahiaException;
163
164     //--------------------------------------------------------------------------
165
/**
166      * return a DOM document of applications definitions
167      *
168      * @param siteID the site id
169      *
170      * @return JahiaDOMObject a DOM representation of this object
171      */

172     public abstract JahiaDOMObject getApplicationDefsAsDOM (int siteID)
173             throws JahiaException;
174
175
176 } // end JahiaApplicationsService
177
Popular Tags