1 20 package org.jahia.services.filemanager; 21 22 23 import org.jahia.data.JahiaDOMObject; 24 import org.jahia.data.files.JahiaFile; 25 import org.jahia.data.files.JahiaFileField; 26 import org.jahia.exceptions.JahiaException; 27 import org.jahia.exceptions.JahiaInitializationException; 28 import org.jahia.params.ParamBean; 29 import org.jahia.services.JahiaService; 30 import org.jahia.services.sites.JahiaSite; 31 import org.jahia.services.usermanager.JahiaUser; 32 import org.jahia.settings.SettingsBean; 33 import org.jahia.tools.files.FileUpload; 34 35 import javax.servlet.ServletContext ; 36 import javax.servlet.ServletException ; 37 import javax.servlet.http.HttpServletRequest ; 38 import javax.servlet.http.HttpServletResponse ; 39 import java.io.File ; 40 import java.io.IOException ; 41 import java.util.Vector ; 42 43 44 51 public abstract class JahiaFilemanagerService extends JahiaService { 52 53 54 61 public abstract void init (SettingsBean jSettings) 62 throws JahiaInitializationException; 63 64 65 71 72 79 public abstract Vector getFilesByPage (int siteID, int pageID, boolean publicFile); 80 81 87 public abstract void changeFile (int fieldID, int fileID) 88 throws JahiaException; 89 90 96 97 100 public abstract String getFileRepositoryRootPath (); 101 102 103 108 protected abstract void setFileRepositoryRootPath (String path); 109 110 111 114 public abstract String getDirPrefixName (); 115 116 117 122 public abstract void setDirPrefixName (String prefixName); 123 124 128 public abstract File getRealFile (JahiaFile jahiaFile); 129 130 136 public abstract boolean handleFileDownload ( 137 HttpServletRequest req, 138 HttpServletResponse res, 139 int fileID, String versionID 140 ); 141 142 143 148 public abstract boolean deleteFile (JahiaFile fileItem); 149 150 151 154 public abstract int getFileUploadMaxSize (); 155 156 157 162 public abstract void setFileUploadMaxSize (int maxSize); 163 164 165 173 public abstract File createDirectory (); 174 175 176 184 public abstract File createDirectory (JahiaSite site); 185 186 187 195 public abstract File createDirectory (String dirName, boolean overwrite); 196 197 209 public abstract FileUpload getFileUploadHandler ( 210 ServletContext context, 211 HttpServletRequest req 212 ) throws ServletException , IOException ; 213 214 215 222 public abstract int handleFileUpload ( 223 ParamBean jParams, 224 FileUpload fupload, 225 int folderID, 226 String fileTitle, 227 String uploadUser, 228 int isPublic 229 230 ) throws ServletException , IOException , JahiaException; 231 232 233 241 public abstract int copyJahiaFile (JahiaFile jahiaFile, 242 ParamBean jParams, 243 String fileTitle, 244 int isPublic, 245 String filePrefixName) 246 throws ServletException , IOException , JahiaException; 247 248 256 257 260 public abstract boolean createFilemanager (int ownerID); 261 262 265 public abstract boolean deleteFilemanager (JahiaUser user, int ownerID) 266 throws JahiaException; 267 268 269 277 public abstract Filemanager getFilemanager (int filemanagerID); 278 279 287 public abstract Filemanager getFilemanagerByOwner (int ownerID); 288 289 290 291 299 300 305 public abstract int insertFileDB (JahiaFileField aFile) throws JahiaException; 306 307 314 public abstract int insertFileDB (JahiaFile aFile) throws JahiaException; 315 316 324 public abstract boolean updateFileDB (JahiaFile aFile, String oldVersion); 325 326 333 public abstract boolean deleteFileDB (int fileID); 334 335 343 public abstract boolean deleteFileDB (int fileID, String version); 344 345 353 public abstract JahiaFile getFileDB (int fileID, String versionID); 354 355 363 public abstract JahiaFile getFileDB (int fileID); 364 365 366 374 public abstract Vector getFilesDB (String sqlWhere); 375 376 385 public abstract Vector getFilesByFolderDB (int folderID, String orderSql); 386 387 388 395 public abstract boolean deleteFilesDB (int folderID) throws JahiaException; 396 397 398 406 407 415 public abstract Folder getFolderByFile (int fileID); 416 417 418 426 public abstract Folder getFolder (int folderID); 427 428 429 437 438 446 public abstract JahiaDOMObject getFileMgrAsDOM (int siteID) 447 throws JahiaException; 448 449 450 451 459 public abstract JahiaDOMObject getFileMgrFoldersAsDOM (int siteID) 460 throws JahiaException; 461 462 463 471 public abstract JahiaDOMObject getFileMgrFilesAsDOM (int siteID) 472 throws JahiaException; 473 474 475 485 public abstract JahiaDOMObject getFileMgrFileFieldsAsDOM (int siteID) 486 throws JahiaException; 487 488 489 } | Popular Tags |