use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project openolat by klemens.
the class GroupFolderIndexer method doIndex.
@Override
public void doIndex(SearchResourceContext parentResourceContext, Object businessObj, OlatFullIndexer indexWriter) throws IOException, InterruptedException {
if (!(businessObj instanceof BusinessGroup))
throw new AssertException("businessObj must be BusinessGroup");
BusinessGroup businessGroup = (BusinessGroup) businessObj;
String path = collaborationManager.getFolderRelPath(businessGroup);
OlatRootFolderImpl rootContainer = new OlatRootFolderImpl(path, null);
SearchResourceContext forumSearchResourceContext = new SearchResourceContext(parentResourceContext);
forumSearchResourceContext.setBusinessControlFor(BusinessGroupMainRunController.ORES_TOOLFOLDER);
forumSearchResourceContext.setDocumentType(TYPE);
forumSearchResourceContext.setParentContextType(GroupDocument.TYPE);
forumSearchResourceContext.setParentContextName(businessGroup.getName());
doIndexVFSContainer(forumSearchResourceContext, rootContainer, indexWriter, "", FolderIndexerAccess.FULL_ACCESS);
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project openolat by klemens.
the class UserInfoMainController method doOpenFolder.
private FolderRunController doOpenFolder(UserRequest ureq) {
removeAsListenerAndDispose(folderRunController);
String chosenUserFolderRelPath = FolderConfig.getUserHome(chosenIdentity.getName()) + "/public";
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(chosenUserFolderRelPath, null);
OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(firstLastName, rootFolder);
// decided in plenum to have read only view in the personal visiting card, even for admin
VFSSecurityCallback secCallback = new ReadOnlyCallback();
namedFolder.setLocalSecurityCallback(secCallback);
OLATResourceable ores = OresHelper.createOLATResourceableType("userfolder");
WindowControl bwControl = addToHistory(ureq, ores, null);
folderRunController = new FolderRunController(namedFolder, false, true, false, ureq, bwControl);
folderRunController.setResourceURL("[Identity:" + chosenIdentity.getKey() + "][userfolder:0]");
listenTo(folderRunController);
return folderRunController;
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project openolat by klemens.
the class UserFoldersWebService method getFolder.
@Path("personal")
public VFSWebservice getFolder(@Context HttpServletRequest request) {
Identity ureqIdentity = getIdentity(request);
if (identity.getKey().equals(ureqIdentity.getKey())) {
// private and public folder
VFSContainer myFodlers = new BriefcaseWebDAVProvider().getContainer(ureqIdentity);
return new VFSWebservice(myFodlers);
} else {
// only public
String chosenUserFolderRelPath = FolderConfig.getUserHome(identity.getName()) + "/" + "public";
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(chosenUserFolderRelPath, null);
VFSSecurityCallback secCallback = new ReadOnlyCallback();
rootFolder.setLocalSecurityCallback(secCallback);
return new VFSWebservice(rootFolder);
}
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project openolat by klemens.
the class VideoManagerImpl method getVideoExportMediaResource.
@Override
public VideoExportMediaResource getVideoExportMediaResource(RepositoryEntry repoEntry) {
OLATResource videoResource = repoEntry.getOlatResource();
OlatRootFolderImpl baseContainer = FileResourceManager.getInstance().getFileResourceRootImpl(videoResource);
// 1) dump repo entry metadata to resource folder
LocalFolderImpl repoentryContainer = (LocalFolderImpl) VFSManager.resolveOrCreateContainerFromPath(baseContainer, DIRNAME_REPOENTRY);
RepositoryEntryImportExport importExport = new RepositoryEntryImportExport(repoEntry, repoentryContainer.getBasefile());
importExport.exportDoExportProperties();
// 2) package everything in resource folder to streaming zip resource
VideoExportMediaResource exportResource = new VideoExportMediaResource(baseContainer, repoEntry.getDisplayname());
return exportResource;
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project openolat by klemens.
the class LearningGroupWebService method getFolder.
@Path("{groupKey}/folder")
public VFSWebservice getFolder(@PathParam("groupKey") Long groupKey, @Context HttpServletRequest request) {
BusinessGroupService bgs = CoreSpringFactory.getImpl(BusinessGroupService.class);
BusinessGroup bg = bgs.loadBusinessGroup(groupKey);
if (bg == null) {
return null;
}
if (!isGroupManager(request)) {
Identity identity = RestSecurityHelper.getIdentity(request);
if (!bgs.isIdentityInBusinessGroup(identity, bg)) {
return null;
}
}
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(bg);
if (!collabTools.isToolEnabled(CollaborationTools.TOOL_FOLDER)) {
return null;
}
String relPath = collabTools.getFolderRelPath();
QuotaManager qm = QuotaManager.getInstance();
Quota folderQuota = qm.getCustomQuota(relPath);
if (folderQuota == null) {
Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS);
folderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
SubscriptionContext subsContext = null;
VFSSecurityCallback secCallback = new VFSWebServiceSecurityCallback(true, true, true, folderQuota, subsContext);
OlatRootFolderImpl rootContainer = new OlatRootFolderImpl(relPath, null);
rootContainer.setLocalSecurityCallback(secCallback);
return new VFSWebservice(rootContainer);
}
Aggregations