KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > files > JahiaTextFileService


1 //
2
// Interface JahiaTextFileService
3
// EV 18.11.2000
4
//
5
// init()
6
// composeJahiaFileName()
7
// loadContents()
8
// saveContents()
9
// fileExists()
10
// readFile()
11
// writeFile()
12
//
13

14 package org.jahia.services.files;
15
16
17 import java.io.IOException JavaDoc;
18
19 import org.jahia.exceptions.JahiaException;
20 import org.jahia.exceptions.JahiaInitializationException;
21 import org.jahia.services.JahiaService;
22 import org.jahia.services.usermanager.JahiaUser;
23 import org.jahia.settings.SettingsBean;
24
25 /**
26  * <p>Title: Jahia text file service</p>
27  * <p>Description: This services provides all the operations to store and
28  * retrieve "BigText" jahia fields data.</p>
29  * <p>Copyright: Copyright (c) 2002</p>
30  * <p>Company: </p>
31  * @author unascribed
32  * @version 1.0
33  */

34 public abstract class JahiaTextFileService extends JahiaService {
35
36
37
38    /***
39     * init
40     */

41     public abstract void init( SettingsBean jSettings )
42     throws JahiaInitializationException;
43
44
45    /***
46     * loadContents
47     */

48     public abstract String JavaDoc loadBigTextValue(int jahiaID, int pageID, int fieldID, String JavaDoc fieldValue,
49             int versionID, int versionStatus, String JavaDoc languageCode)
50     throws JahiaException;
51
52
53    /***
54     * saveContents
55     */

56     public abstract String JavaDoc saveContents( int jahiaID, int pageID, int fieldID,
57                                          String JavaDoc fieldValue,
58                                          int versionID,
59                                          int versionStatus,
60                                          String JavaDoc languageCode )
61     throws JahiaException;
62
63
64     /***
65     * getFileName
66      * YG 29.08.2001
67      * returns the file name
68     *
69     */

70     public abstract String JavaDoc getFileName( int jahiaID, int pageID, int fieldID,
71                                         int versionID,
72                                         int versionStatus,
73                                         String JavaDoc languageCode)
74     throws JahiaException;
75
76     //--------------------------------------------------------------------------
77
/**
78      * Copy all big text of a site in a gived folder
79      * This folder must be a valid folder
80      *
81      * @param int siteID the id of the requested site
82      * @param String destFolder the destination Folder
83      * @return the number of duplicated files, -1 on error
84      * @author NK
85      */

86     public abstract int copySiteBigText(int siteID, String JavaDoc destFolder)
87     throws IOException JavaDoc;
88
89     //--------------------------------------------------------------------------
90
/**
91      * Delete all big text files of a site
92      *
93      * @param int siteID the id of the requested site
94      * @param User the user must be a root user
95      * @return false on error
96      * @author NK
97      */

98     public abstract boolean deleteSiteBigText(int siteID, JahiaUser user)
99     throws IOException JavaDoc;
100
101     /**
102      * renames a file
103      * first half of the parameters are describing the old file, other half the new one.
104      * @return true if it worked
105      */

106     public abstract boolean renameFile (int jahiaID, int pageID, int fieldID,
107                                         int versionID,
108                                         int versionStatus,
109                                         String JavaDoc languageCode,
110
111                                         int njahiaID, int npageID, int nfieldID,
112                                         int nversionID,
113                                         int nversionStatus,
114                                         String JavaDoc nlanguageCode) throws Exception JavaDoc;
115
116     /**
117      * copy a file
118      * first half of the parameters are describing the old file, other half the new one.
119      * @return true if it worked
120      */

121     public abstract boolean copyFile (int jahiaID, int pageID, int fieldID,
122                                       int versionID,
123                                       int versionStatus,
124                                       String JavaDoc languageCode,
125
126                                       int njahiaID, int npageID, int nfieldID,
127                                       int nversionID,
128                                       int nversionStatus,
129                                       String JavaDoc nlanguageCode);
130
131     /**
132      * delete a file
133      * @return true if it worked
134      */

135     public abstract boolean deleteFile (int jahiaID, int pageID, int fieldID,
136                                         int versionID,
137                                         int versionStatus,
138                                         String JavaDoc languageCode);
139
140 } // end JahiaTextFileService
141
Popular Tags