001: package org.objectweb.salome_tmf.api.sql;
002:
003: import java.rmi.Remote;
004:
005: import org.objectweb.salome_tmf.api.data.AttachementWrapper;
006: import org.objectweb.salome_tmf.api.data.CampaignWrapper;
007: import org.objectweb.salome_tmf.api.data.DataSetWrapper;
008: import org.objectweb.salome_tmf.api.data.ExecutionAttachmentWrapper;
009: import org.objectweb.salome_tmf.api.data.ExecutionWrapper;
010: import org.objectweb.salome_tmf.api.data.FileAttachementWrapper;
011: import org.objectweb.salome_tmf.api.data.SalomeFileWrapper;
012: import org.objectweb.salome_tmf.api.data.TestCampWrapper;
013: import org.objectweb.salome_tmf.api.data.UrlAttachementWrapper;
014:
015: public interface ISQLCampaign extends Remote {
016: /**
017: * Inset a campaign in table CAMPAGNE_TEST
018: * @param idProject : id of the projet where to insert the campaign
019: * @param name of the campaign
020: * @param description of the campaign
021: * @param idPers : id of the user who insert the campaign
022: * @return the id (id_camp) of new campaign
023: * @throws Exception
024: * need permission canCreateCamp
025: */
026: public int insert(int idProject, String name, String description,
027: int idPers) throws Exception;
028:
029: /**
030: * Import a test identified by idTest (in table CAS_TEST) in the campaign identified by idCamp
031: * in table CAMPAGNE_CAS
032: * @param idCamp
033: * @param idTest
034: * @return the order of the test in the campaign
035: * @throws Exception
036: * need permission canCreateCamp
037: */
038: public int importTest(int idCamp, int idTest, int userID)
039: throws Exception;
040:
041: /**
042: * Attach a file to a campaign identified by idCamp (table CAMPAGNE_ATTACHEMENT)
043: * @param idCamp
044: * @param file : the file to insert in the database
045: * @param description
046: * @return the id of the attachement in the table ATTACHEMENT
047: * @throws Exception
048: * @see ISQLFileAttachment.insert(File, String)
049: * no permission needed
050: */
051: public int addAttachFile(int idCamp, SalomeFileWrapper file,
052: String description) throws Exception;
053:
054: /**
055: * Attach a URL to a campaign identified by idCamp (table CAMPAGNE_ATTACHEMENT)
056: * @param idCamp
057: * @param url : the url to insert in the database
058: * @param description
059: * @return the id of the attachement in the table ATTACHEMENT
060: * @throws Exception
061: * @see ISQLUrlAttachment.insert(String String)
062: * no permission needed
063: */
064: public int addAttachUrl(int idCamp, String url, String description)
065: throws Exception;
066:
067: /**
068: * Update the name and the description of the campaign identified by idCamp
069: * @param idCamp of the campaign
070: * @param name : new name of the campaign
071: * @param description : new description of the campaign
072: * @throws Exception
073: * need permission canUpdateCamp
074: */
075: public void update(int idCamp, String name, String description)
076: throws Exception;
077:
078: /**
079: * Update the order of the campaign by incrementation (if increment = true) or decrementation
080: * @param idCamp : id of the campaign
081: * @param increment
082: * @return
083: * @throws Exception
084: * need permission canUpdateCamp
085: */
086: public int updateOrder(int idCamp, boolean increment)
087: throws Exception;
088:
089: /**
090: * Update test Assignation (field assigned_user_id) in CAMPAGNE_CAS
091: * @param idCamp
092: * @param idTest
093: * @param assignedID
094: * @return
095: * @throws Exception
096: */
097: public void updateTestAssignation(int idCamp, int idTest,
098: int assignedID) throws Exception;
099:
100: /**
101: * Update test Assignation for all reference of old assignation (field assigned_user_id) in CAMPAGNE_CAS
102: * @param idCamp
103: * @param idTest
104: * @param assignedID
105: * @return
106: * @throws Exception
107: */
108: public void updateTestAssignationRef(int idCamp, int assignedOldID,
109: int assignedNewID) throws Exception;
110:
111: /**
112: * Update All test Assignation (field assigned_user_id) in CAMPAGNE_CAS
113: * @param idCamp
114: * @param idTest
115: * @param assignedID
116: * @return
117: * @throws Exception
118: */
119: public void updateCampagneAssignationRef(int idCamp,
120: int assignedNewID) throws Exception;
121:
122: /**
123: * Update Suite Assignation (field assigned_user_id for all tests in the suite) in CAMPAGNE_CAS
124: * @param idCamp
125: * @param idTest
126: * @param assignedID
127: * @return
128: * @throws Exception
129: */
130: public void updateSuiteAssignation(int idCamp, int idSuite,
131: int assignedID) throws Exception;
132:
133: /**
134: * Update Suite Assignation (field assigned_user_id for all tests in the suite) in CAMPAGNE_CAS
135: * @param idCamp
136: * @param idTest
137: * @param assignedID
138: * @return
139: * @throws Exception
140: */
141: public void updateFamilyAssignation(int idCamp, int idFamille,
142: int assignedID) throws Exception;
143:
144: /**
145: * replace all reference of user oldIdUser by newIdUser in the table (CAMPAGNE_CAS) whrerre campagne = idCamp
146: * @param oldIdUser
147: * @param newIdUser
148: * @throws Exception
149: * no permission needed
150: */
151: public void updateUserRef(int idCamp, int oldIdUser, int newIdUser)
152: throws Exception;
153:
154: /**
155: * Update test suite order in the campaign (+1 if increment = true) or -1
156: * @param idCamp : id of the campaign
157: * @param idSuite : id of the suite in table SUITE_TEST
158: * @param increment
159: * @throws Exception
160: * need permission canUpdateCamp
161: */
162: public void updateTestSuiteOrder(int idCamp, int idSuite,
163: boolean increment) throws Exception;
164:
165: /**
166: * Update a family order in the campaign (+1 if increment = true) or -1
167: * @param idCamp
168: * @param idFamily : id of the suite in table FAMILLE_TEST
169: * @param increment
170: * @throws Exception
171: * need permission canUpdateCamp
172: */
173: public void updateTestFamilyOrder(int idCamp, int idFamily,
174: boolean increment) throws Exception;
175:
176: /**
177: * Update a test order in the campaign (+1 if increment = true) or -1
178: * @param idCamp
179: * @param idTest : id of the test in the table CAS_TEST
180: * @param increment
181: * @return
182: * @throws Exception
183: * need permission canUpdateCamp
184: */
185: public int updateTestOrder(int idCamp, int idTest, boolean increment)
186: throws Exception;
187:
188: /**
189: * Delete a campaign and it's related links in the database
190: * include : delete test in campaign, dataset, execution (and result), and attachment
191: * reorder the campaign in the project
192: * @param idCamp
193: * @throws Exception
194: * need permission canDeleteCamp
195: * @see deleteTest(int,int)
196: * @see deleteAllExec(int)
197: * @see deleteAllAttach(int)
198: * @see deleteAllDataset(int)
199: * need permission canDeleteCamp
200: */
201: public void delete(int idCamp) throws Exception;
202:
203: /**
204: * Delete a campaign and it's related links in the database
205: * include : delete test in campaign, dataset, execution (and result), and attachment
206: * reorder the campaign in the project if reorder = true
207: * @param idCamp
208: * @throws Exception
209: * need permission canDeleteCamp
210: * @see deleteTest(int,int)
211: * @see deleteAllExec(int)
212: * @see deleteAllAttach(int)
213: * @see deleteAllDataset(int)
214: * need permission canDeleteCamp
215: * @TODO SOAP
216: */
217: public void delete(int idCamp, boolean reorder) throws Exception;
218:
219: /**
220: * Delete all executions reference (and it's result) for the campaign identified by idCamp
221: * @param idCamp
222: * @throws Exception
223: * @see ISQLExecution.delete(int)
224: * need permission canExecutCamp
225: */
226: public void deleteAllExec(int idCamp) throws Exception;
227:
228: /**
229: * Delete all datasets reference for the campaign identified by idCamp
230: * @param idCamp
231: * @throws Exception
232: * @see ISQLDataset.delete(int)
233: * need permission canExecutCamp
234: */
235: public void deleteAllDataset(int idCamp) throws Exception;
236:
237: /**
238: * Delete a test reference for the campaign identified by idCamp
239: * then reoder the test in the campaign, and clean result on Excecution
240: * then delete execution if empty and deleteExec = true
241: * @param idCamp
242: * @param testId
243: * @param deleteExec
244: * @throws Exception
245: * need permission canDeleteCamp
246: */
247: public void deleteTest(int idCamp, int testId, boolean deleteExec)
248: throws Exception;
249:
250: /**
251: * Delete an attachment idAttach in the campaign (table CAMPAGNE_ATTACHEMENT and ATTACHEMENT)
252: * @param idCamp
253: * @param idAttach
254: * @throws Exception
255: * @see ISQLAttachment.delete(int)
256: * no permission needed
257: */
258: public void deleteAttach(int idCamp, int idAttach) throws Exception;
259:
260: /**
261: * Delete all attachments in the campaign (table CAMPAGNE_ATTACHEMENT and ATTACHEMENT)
262: * @param idCamp
263: * @see deleteAttach(int, int)
264: * @throws Exception
265: */
266: public void deleteAllAttach(int idCamp) throws Exception;
267:
268: /**
269: * Delete a test reference in all campaign and then reorder the tests in the campaign
270: * @param idTest
271: * @see deleteTest(int, int)
272: * need permission canDeleteCamp
273: * @throws Exception
274: */
275: public void deleteTestInAllCampaign(int idTest) throws Exception;
276:
277: /**
278: * Get an Array of AttachementWrapper (FileAttachementWrapper, UrlAttachementWrapper)
279: * for the campaign identified by idCamp
280: * @param idCamp : id of the campaign
281: * @return
282: * @throws Exception
283: */
284:
285: public AttachementWrapper[] getAttachs(int idCamp) throws Exception;
286:
287: /**
288: * Get an Array of FileAttachementWrapper for the campaign identified by idCamp
289: * @param idCamp : id of the campaign
290: * @return
291: * @throws Exception
292: */
293: public FileAttachementWrapper[] getAttachFiles(int idCamp)
294: throws Exception;
295:
296: /**
297: * Get an Array of UrlAttachementWrapper for the campaign identified by idCamp
298: * @param idCamp : id of the campaign
299: * @return
300: * @throws Exception
301: */
302: public UrlAttachementWrapper[] getAttachUrls(int idCamp)
303: throws Exception;
304:
305: /**
306: * Return the number of campaign in the project identified by idProject
307: * @param idProject
308: * @return
309: * @throws Exception
310: */
311: public int getNumberOfCampaign(int idProject) throws Exception;
312:
313: /**
314: * Return the number of tests in the campaign identified by idCamp
315: * @param idCamp
316: * @return
317: * @throws Exception
318: */
319: public int getNumberOfTestInCampaign(int idCamp) throws Exception;
320:
321: /**
322: * Return an Array of CampaignWrapper representing the campaign of the project identified by idProject
323: * @param idProject
324: * @return
325: * @throws Exception
326: */
327: public CampaignWrapper[] getAllCampaigns(int idProject)
328: throws Exception;
329:
330: /**
331: * Return a CampaignWrapper representing a campaign at order 'order' in the project identified by idProject
332: * @param idProject
333: * @param order
334: * @return
335: * @throws Exception
336: */
337: public CampaignWrapper getCampaignByOrder(int idProject, int order)
338: throws Exception;
339:
340: /**
341: * Return a CampaignWrapper for the campaign identified by idCamp
342: * @param idCamp
343: * @return
344: * @throws Exception
345: */
346: public CampaignWrapper getCampaign(int idCamp) throws Exception;
347:
348: /**
349: * Get a TestCampWrapper representing the test at defined order in the campagne idCamp
350: * @param idCamp
351: * @param order
352: * @return
353: * @throws Exception
354: */
355: public TestCampWrapper getTestCampByOrder(int idCamp, int order)
356: throws Exception;
357:
358: /**
359: * Get a TestCampWrapper representing the test idTest in the campagne idCamp
360: * @param idCamp
361: * @param idTest
362: * @return
363: * @throws Exception
364: */
365: public TestCampWrapper getTestCampById(int idCamp, int idTest)
366: throws Exception;
367:
368: /**
369: * Get an ordered Array of TestCampWrapper representing test available in the campaign idCamp
370: * @param idCamp
371: * @return
372: * @throws Exception
373: */
374: public TestCampWrapper[] getTestsByOrder(int idCamp)
375: throws Exception;
376:
377: /**
378: * Get the number of tests in the family idFamily in the campaign idCamp
379: * @param idCamp
380: * @param idFamily
381: * @return
382: * @throws Exception
383: */
384: public int getSizeOfFamilyInCampaign(int idCamp, int idFamily)
385: throws Exception;
386:
387: /**
388: * Get the number of tests in the suite idSuite in the campaign idCamp
389: * @param idCamp
390: * @param idSuite
391: * @return
392: * @throws Exception
393: */
394: public int getSizeOfSuiteInCampaign(int idCamp, int idSuite)
395: throws Exception;
396:
397: /**
398: * Get the id of the campaign identified by name in the project identified by idProject
399: * @param idProject
400: * @param name
401: * @return
402: * @throws Exception
403: */
404: public int getID(int idProject, String name) throws Exception;
405:
406: /**
407: * Get an Array of DataSetWrapper used by the campaign idCamp
408: * @param idCamp
409: * @return
410: * @throws Exception
411: */
412: public DataSetWrapper[] getDatsets(int idCamp) throws Exception;
413:
414: /**
415: * Get an Array of ExecutionWrapper used by the campaign idCamp
416: * @param idCamp
417: * @return
418: * @throws Exception
419: */
420: public ExecutionWrapper[] getExecutions(int idCamp)
421: throws Exception;
422:
423: /**
424: * Get an Array ExecutionAttachmentWrapper
425: * representing all attachement of all execution result
426: * @param idCamp
427: * @return
428: * @throws Exception
429: */
430: public ExecutionAttachmentWrapper[] getResExecutionsAttachment(
431: int idCamp) throws Exception;
432: }
|