com.silverpeas.silvercrawler.control
Class SilverCrawlerSessionController

java.lang.Object
  extended by com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
      extended by com.silverpeas.silvercrawler.control.SilverCrawlerSessionController
All Implemented Interfaces:
com.stratelia.silverpeas.peasCore.ComponentSessionController

public class SilverCrawlerSessionController
extends com.stratelia.silverpeas.peasCore.AbstractComponentSessionController


Field Summary
 
Fields inherited from class com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
CHARACTER_ENCODING, context
 
Constructor Summary
SilverCrawlerSessionController(com.stratelia.silverpeas.peasCore.MainSessionController mainSessionCtrl, com.stratelia.silverpeas.peasCore.ComponentContext componentContext)
          Standard Session Controller Constructor
 
Method Summary
 UploadReport checkLastUpload()
          Checks upload info coming from DragNDrop.
 boolean checkRWSettingsAccess(boolean throwException)
          Only people with admin profil AND listed in silverpeas configuration are allowed to set read/write access
 boolean checkUserLANAccess(String remoteIPAdress)
           
 void createFolder(String newName)
           
 FileFolder getCurrentFolder()
           
 FileFolder getCurrentFolder(boolean isAdmin)
           
 String getCurrentPath()
           
 Collection<FileDetail> getCurrentResultSearch()
           
 String getFullPath(String directory)
           
 Collection<HistoryByUser> getHistoryByFolder(String folderName)
           
 Collection<HistoryByUser> getHistoryByFolderFromResult(String folderName)
           
 Collection<HistoryDetail> getHistoryByUser(String folderName, String userId)
           
 UploadReport getLastUploadReport()
           
 String getNameFromPath(String path)
           
 String getNbMaxDirectoriesByPage()
           
 String getNbMaxFilesByPage()
           
 Collection<String> getPath()
           
 Collection<FileDetail> getResultSearch(String word)
           
 String getRootPath()
           
 long getSizeMax()
           
 Long getSizeMaxString()
           
 void goToDirectory(String directory)
           
 void indexFile(String fileName)
           
 void indexPath(String folderName)
           
 void indexPathSelected(Collection<String> dirToIndex)
           
 void indexSelectedFiles(Collection<String> fileToIndex)
           
 Boolean isAllowedNav()
           
 Boolean isDownload()
           
 Boolean isPrivateSearch()
           
 boolean isReadWriteActivated()
          Is read//write access has been activated
 boolean isRootPath()
           
 UploadReport processLastUpload()
          Process copy from DragAndDrop temp repository to current folder
 void removeFile(String fileName, boolean isAdminOrPublisher)
           
 void removeSubFolder(String folderName, boolean isAdmin)
          Remove given subfolder.
 void renameFolder(String folderName, String newName)
           
 void resetLastUploadReport()
          Reset any existing upload report and clean temp folder if exists.
 void saveFile(org.apache.commons.fileupload.FileItem fileItem, boolean replaceFile)
           
 void setCurrentPath(String path)
           
 void setCurrentPathFromResult(String path)
           
 void setLastUploadReport(UploadReport report)
           
 void setRootPath()
           
 void switchReadWriteAccess(boolean active)
          Activate/Desactivate read//write access.
 void unindexFile(String fileName)
           
 void unindexPath(String folderName)
           
 FolderZIPInfo zipFolder(String folderName)
           
 
Methods inherited from class com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
addClipboardSelection, clipboardPasteDone, close, getAlertUser, getClipboardCount, getClipboardErrorMessage, getClipboardExceptionError, getClipboardName, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameters, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getFavoriteSpace, getGenericPanel, getHighestSilverpeasUserRole, getIcon, getLanguage, getLastResults, getLook, getMultilang, getOrganisationController, getPersonalization, getRSSUrl, getSelection, getServerNameAndPort, getSettings, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserAvailSpaceIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoleLevel, getUserRoles, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardError, setClipboardSelectedElement, setComponentRootName, setFavoriteSpaceToMainSessionController, setGenericPanel, setIconFileName, setLastResults, setMultilangFileName, setResourceFileName, setSpaceModeMaintenance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SilverCrawlerSessionController

public SilverCrawlerSessionController(com.stratelia.silverpeas.peasCore.MainSessionController mainSessionCtrl,
                                      com.stratelia.silverpeas.peasCore.ComponentContext componentContext)
Standard Session Controller Constructor

Parameters:
mainSessionCtrl - The user's profile
componentContext - The component's profile
See Also:
Method Detail

getCurrentFolder

public FileFolder getCurrentFolder(boolean isAdmin)

getCurrentFolder

public FileFolder getCurrentFolder()

isRootPath

public boolean isRootPath()

setRootPath

public void setRootPath()

getSizeMax

public long getSizeMax()

getSizeMaxString

public Long getSizeMaxString()

getNbMaxDirectoriesByPage

public String getNbMaxDirectoriesByPage()

getNbMaxFilesByPage

public String getNbMaxFilesByPage()

goToDirectory

public void goToDirectory(String directory)

isDownload

public Boolean isDownload()

isPrivateSearch

public Boolean isPrivateSearch()

isAllowedNav

public Boolean isAllowedNav()

setCurrentPath

public void setCurrentPath(String path)

setCurrentPathFromResult

public void setCurrentPathFromResult(String path)

getNameFromPath

public String getNameFromPath(String path)

getCurrentPath

public String getCurrentPath()

getFullPath

public String getFullPath(String directory)

getPath

public Collection<String> getPath()

zipFolder

public FolderZIPInfo zipFolder(String folderName)

getHistoryByFolder

public Collection<HistoryByUser> getHistoryByFolder(String folderName)

getHistoryByFolderFromResult

public Collection<HistoryByUser> getHistoryByFolderFromResult(String folderName)

getHistoryByUser

public Collection<HistoryDetail> getHistoryByUser(String folderName,
                                                  String userId)

unindexPath

public void unindexPath(String folderName)

unindexFile

public void unindexFile(String fileName)

indexPath

public void indexPath(String folderName)

indexFile

public void indexFile(String fileName)

indexPathSelected

public void indexPathSelected(Collection<String> dirToIndex)

indexSelectedFiles

public void indexSelectedFiles(Collection<String> fileToIndex)

getResultSearch

public Collection<FileDetail> getResultSearch(String word)

getCurrentResultSearch

public Collection<FileDetail> getCurrentResultSearch()

getRootPath

public String getRootPath()

isReadWriteActivated

public boolean isReadWriteActivated()
Is read//write access has been activated

Returns:
true only if is activated both in platform and component instance

switchReadWriteAccess

public void switchReadWriteAccess(boolean active)
                           throws SilverCrawlerRuntimeException,
                                  SilverCrawlerForbiddenActionException
Activate/Desactivate read//write access.

Parameters:
active - true to activate read/write access
Throws:
SilverCrawlerForbiddenActionException
SilverCrawlerRuntimeException

checkRWSettingsAccess

public boolean checkRWSettingsAccess(boolean throwException)
                              throws SilverCrawlerForbiddenActionException
Only people with admin profil AND listed in silverpeas configuration are allowed to set read/write access

Parameters:
throwException - true if exception must be thrown if checks failed. (else just return false)
Throws:
SilverCrawlerForbiddenActionException - if user doesn't have those requirements.

removeSubFolder

public void removeSubFolder(String folderName,
                            boolean isAdmin)
                     throws SilverCrawlerForbiddenActionException
Remove given subfolder.

Parameters:
folderName - name of folder to be removed
isAdmin - flag to indicate if user has admin profile
Throws:
SilverCrawlerForbiddenActionException

renameFolder

public void renameFolder(String folderName,
                         String newName)
                  throws SilverCrawlerFolderRenameException,
                         IOException
Throws:
SilverCrawlerFolderRenameException
IOException

createFolder

public void createFolder(String newName)
                  throws SilverCrawlerFolderCreationException
Throws:
SilverCrawlerFolderCreationException

removeFile

public void removeFile(String fileName,
                       boolean isAdminOrPublisher)
                throws SilverCrawlerForbiddenActionException
Throws:
SilverCrawlerForbiddenActionException

saveFile

public void saveFile(org.apache.commons.fileupload.FileItem fileItem,
                     boolean replaceFile)
              throws SilverCrawlerFileUploadException
Throws:
SilverCrawlerFileUploadException

setLastUploadReport

public void setLastUploadReport(UploadReport report)

getLastUploadReport

public UploadReport getLastUploadReport()

checkLastUpload

public UploadReport checkLastUpload()
Checks upload info coming from DragNDrop. Uses UploadReport to retrieves folders/files list and detect conflicts

Returns:

processLastUpload

public UploadReport processLastUpload()
Process copy from DragAndDrop temp repository to current folder

Returns:

resetLastUploadReport

public void resetLastUploadReport()
Reset any existing upload report and clean temp folder if exists.


checkUserLANAccess

public boolean checkUserLANAccess(String remoteIPAdress)


Copyright © 2016 Silverpeas. All Rights Reserved.