Class SilverCrawlerSessionController
- java.lang.Object
-
- org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
-
- org.silverpeas.components.silvercrawler.control.SilverCrawlerSessionController
-
- All Implemented Interfaces:
Serializable,org.silverpeas.core.web.mvc.controller.ComponentSessionController,org.silverpeas.core.web.session.SessionCloseable
public class SilverCrawlerSessionController extends org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SilverCrawlerSessionController(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl, org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)Standard Session Controller Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UploadReportcheckLastUpload()Checks upload info coming from DragNDrop.booleancheckRWSettingsAccess(boolean throwException)Only people with admin profil AND listed in silverpeas configuration are allowed to set read/write accessbooleancheckUserLANAccess(String remoteIPAdress)voidcreateFolder(String newName)FileFoldergetCurrentFolder()FileFoldergetCurrentFolder(boolean isAdmin)StringgetCurrentPath()Collection<FileDetail>getCurrentResultSearch()Collection<HistoryByUser>getHistoryByFolder(String folderName)Collection<HistoryByUser>getHistoryByFolderFromResult(String folderName)Collection<HistoryDetail>getHistoryByUser(String folderName, String userId)UploadReportgetLastUploadReport()StringgetNameFromPath(String path)StringgetNbMaxDirectoriesByPage()StringgetNbMaxFilesByPage()Collection<String>getPath()Collection<FileDetail>getResultSearch(String word)StringgetRootPath()voidgoToDirectory(String directory)voidindexFile(String fileName)voidindexPath(String folderName)voidindexPathSelected(Collection<String> dirToIndex)voidindexSelectedFiles(Collection<String> fileToIndex)BooleanisAllowedNav()BooleanisDownload()booleanisReadWriteActivated()Is read//write access has been activatedbooleanisRootPath()UploadReportprocessLastUpload()Processes the files upload by copying the uploaded files by DragAndDrop from the temporary repository to the current folder.voidremoveFile(String fileName, boolean isAdminOrPublisher)voidremoveSubFolder(String folderName, boolean isAdmin)Remove the given subfolder.voidrenameFolder(String folderName, String newName)voidresetLastUploadReport()Reset any existing upload report and clean temp folder if exists.voidsaveFile(org.apache.commons.fileupload.FileItem fileItem, boolean replaceFile)voidsetCurrentPath(String path)voidsetCurrentPathFromResult(String path)voidsetLastUploadReport(UploadReport report)voidsetRootPath()voidswitchReadWriteAccess(boolean active)Enable/disable read//write access.voidunindexFile(String fileName)voidunindexPath(String folderName)FolderZIPInfozipFolder(String folderName)-
Methods inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
addClipboardSelection, clipboardPasteDone, close, getClipboardErrorMessage, getClipboardExceptionError, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getHighestSilverpeasUserRole, getIcon, getLanguage, getLook, getMultilang, getOrganisationController, getPersonalization, getRSSUrl, getSelection, getSettings, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, getZoneId, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardSelectedElement, setComponentRootName, setSpaceModeMaintenance
-
-
-
-
Constructor Detail
-
SilverCrawlerSessionController
public SilverCrawlerSessionController(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl, org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)Standard Session Controller Constructor- Parameters:
mainSessionCtrl- The user's profilecomponentContext- The component's profile
-
-
Method Detail
-
getCurrentFolder
public FileFolder getCurrentFolder(boolean isAdmin)
-
getCurrentFolder
public FileFolder getCurrentFolder()
-
isRootPath
public boolean isRootPath()
-
setRootPath
public void setRootPath()
-
getNbMaxDirectoriesByPage
public String getNbMaxDirectoriesByPage()
-
getNbMaxFilesByPage
public String getNbMaxFilesByPage()
-
goToDirectory
public void goToDirectory(String directory)
-
isDownload
public Boolean isDownload()
-
isAllowedNav
public Boolean isAllowedNav()
-
setCurrentPath
public void setCurrentPath(String path)
-
setCurrentPathFromResult
public void setCurrentPathFromResult(String path)
-
getCurrentPath
public String getCurrentPath()
-
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 SilverCrawlerForbiddenActionExceptionEnable/disable read//write access.- Parameters:
active- true to activate read/write access- Throws:
SilverCrawlerForbiddenActionException- if the user can change the read/write access.
-
checkRWSettingsAccess
public boolean checkRWSettingsAccess(boolean throwException) throws SilverCrawlerForbiddenActionExceptionOnly 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 the given subfolder.- Parameters:
folderName- name of folder to be removedisAdmin- flag to indicate if user has admin profile- Throws:
SilverCrawlerForbiddenActionException- if the deletion is forbidden or cannot be done.
-
renameFolder
public void renameFolder(String folderName, String newName) throws SilverCrawlerFolderRenameException, IOException
-
createFolder
public void createFolder(String newName) throws SilverCrawlerFolderCreationException
-
removeFile
public void removeFile(String fileName, boolean isAdminOrPublisher) 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:
- an upload report
-
processLastUpload
public UploadReport processLastUpload()
Processes the files upload by copying the uploaded files by DragAndDrop from the temporary repository to the current folder.- Returns:
- a report about the upload process.
-
resetLastUploadReport
public void resetLastUploadReport()
Reset any existing upload report and clean temp folder if exists.
-
checkUserLANAccess
public boolean checkUserLANAccess(String remoteIPAdress)
-
-