Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
67a5258f
Commit
67a5258f
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1234: jump in the folder if the last element of the business path is a VFSContainer
parent
5de48a1e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java
+20
-19
20 additions, 19 deletions
...org/olat/core/commons/modules/bc/FolderRunController.java
with
20 additions
and
19 deletions
src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java
+
20
−
19
View file @
67a5258f
...
...
@@ -69,12 +69,14 @@ import org.olat.core.logging.Tracing;
import
org.olat.core.logging.activity.CoreLoggingResourceable
;
import
org.olat.core.logging.activity.ILoggingAction
;
import
org.olat.core.logging.activity.ThreadLocalUserActivityLogger
;
import
org.olat.core.util.StringHelper
;
import
org.olat.core.util.resource.OresHelper
;
import
org.olat.core.util.vfs.OlatRelPathImpl
;
import
org.olat.core.util.vfs.Quota
;
import
org.olat.core.util.vfs.VFSContainer
;
import
org.olat.core.util.vfs.VFSContainerMapper
;
import
org.olat.core.util.vfs.VFSItem
;
import
org.olat.core.util.vfs.VFSLeaf
;
import
org.olat.core.util.vfs.VFSManager
;
import
org.olat.core.util.vfs.callbacks.VFSSecurityCallback
;
import
org.olat.core.util.vfs.filters.VFSItemFilter
;
...
...
@@ -425,7 +427,7 @@ public class FolderRunController extends BasicController implements Activateable
else
if
(
!
cmd
.
equals
(
FolderCommandFactory
.
COMMAND_SERV
))
{
folderComponent
.
updateChildren
();
}
}
//TODO review
}
}
if
(
FolderCommandStatus
.
STATUS_FAILED
==
folderCommand
.
getStatus
())
{
...
...
@@ -433,14 +435,14 @@ public class FolderRunController extends BasicController implements Activateable
folderComponent
.
updateChildren
();
}
}
//fxdiff BAKS-7 Resume function
if
(
FolderCommandFactory
.
COMMAND_BROWSE
.
equals
(
cmd
))
{
updatePathResource
(
ureq
);
}
enableDisableQuota
(
ureq
);
}
}
//fxdiff BAKS-7 Resume function
private
void
updatePathResource
(
UserRequest
ureq
)
{
final
String
path
=
"path="
+
folderComponent
.
getCurrentContainerPath
();
OLATResourceable
ores
=
OresHelper
.
createOLATResourceableTypeWithoutCheck
(
path
);
...
...
@@ -509,18 +511,8 @@ public class FolderRunController extends BasicController implements Activateable
public
void
activatePath
(
UserRequest
ureq
,
String
path
)
{
if
(
path
!=
null
&&
path
.
length
()
>
0
)
{
// Check if there is something after path= e.g. '/test1/test2/readme.txt'
if
(
path
.
lastIndexOf
(
"/"
)
>
0
)
{
// ok there is file e.g. /readme.txt => navigate only to folder =>
// remove file name
String
dirPath
=
path
.
substring
(
0
,
path
.
lastIndexOf
(
"/"
));
if
(!
path
.
equals
(
""
))
{
if
(
log
.
isDebug
())
log
.
debug
(
"direct navigation to container-path="
+
dirPath
);
folderComponent
.
setCurrentContainerPath
(
dirPath
);
}
}
VFSItem
vfsItem
=
folderComponent
.
getRootContainer
().
resolve
(
path
.
endsWith
(
"/"
)
?
path
.
substring
(
0
,
path
.
length
()-
1
)
:
path
);
if
(
vfsItem
!=
null
&&
!(
vfsItem
instanceof
VFS
Container
)
)
{
if
(
vfsItem
instanceof
VFS
Leaf
)
{
// could be a file - create the mapper - otherwise don't create one if it's a directory
// Create a mapper to deliver the auto-download of the file. We have to
...
...
@@ -530,13 +522,22 @@ public class FolderRunController extends BasicController implements Activateable
// Mapper is cleaned up automatically by basic controller
String
baseUrl
=
registerMapper
(
ureq
,
new
VFSContainerMapper
(
folderComponent
.
getRootContainer
()));
// Trigger auto-download
DisplayOrDownloadComponent
dordc
=
new
DisplayOrDownloadComponent
(
"downloadcomp"
,
baseUrl
+
path
);
DisplayOrDownloadComponent
dordc
=
new
DisplayOrDownloadComponent
(
"downloadcomp"
,
baseUrl
+
path
);
folderContainer
.
put
(
"autoDownloadComp"
,
dordc
);
if
(
path
.
lastIndexOf
(
"/"
)
>
0
)
{
String
dirPath
=
path
.
substring
(
0
,
path
.
lastIndexOf
(
"/"
));
if
(
StringHelper
.
containsNonWhitespace
(
dirPath
))
{
folderComponent
.
setCurrentContainerPath
(
dirPath
);
}
}
}
else
if
(
vfsItem
instanceof
VFSContainer
)
{
if
(
StringHelper
.
containsNonWhitespace
(
path
))
{
folderComponent
.
setCurrentContainerPath
(
path
);
}
}
//fxdiff BAKS-7 Resume function
updatePathResource
(
ureq
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment