Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openolat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
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
Zentraler Informatikdienst
Digitale Medien und Lerntechnologien
olat
openolat
Commits
15131d11
Commit
15131d11
authored
4 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-5104: link quick search to ids, external ref. and display name
parent
b2408bd5
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/modules/lecture/manager/LectureBlockDAO.java
+33
-0
33 additions, 0 deletions
...ava/org/olat/modules/lecture/manager/LectureBlockDAO.java
with
33 additions
and
0 deletions
src/main/java/org/olat/modules/lecture/manager/LectureBlockDAO.java
+
33
−
0
View file @
15131d11
...
...
@@ -237,6 +237,29 @@ public class LectureBlockDAO {
.
append
(
" where block.entry.key=v.key and membership.identity.key=:teacherKey"
)
.
append
(
" )"
);
}
//quick search in repository entry infos
Long
quickId
=
null
;
String
quickRefs
=
null
;
String
quickText
=
null
;
if
(
StringHelper
.
containsNonWhitespace
(
searchParams
.
getSearchString
()))
{
quickRefs
=
searchParams
.
getSearchString
();
sb
.
append
(
" and (v.externalId=:quickRef or "
);
PersistenceHelper
.
appendFuzzyLike
(
sb
,
"v.externalRef"
,
"quickText"
,
dbInstance
.
getDbVendor
());
sb
.
append
(
" or v.softkey=:quickRef or "
);
quickText
=
PersistenceHelper
.
makeFuzzyQueryString
(
quickRefs
);
PersistenceHelper
.
appendFuzzyLike
(
sb
,
"v.displayname"
,
"quickText"
,
dbInstance
.
getDbVendor
());
if
(
StringHelper
.
isLong
(
quickRefs
))
{
try
{
quickId
=
Long
.
parseLong
(
quickRefs
);
sb
.
append
(
" or v.key=:quickVKey or res.resId=:quickVKey"
);
}
catch
(
NumberFormatException
e
)
{
//
}
}
sb
.
append
(
")"
);
}
//TODO absences coach
if
(
searchParams
.
getManager
()
!=
null
||
searchParams
.
getMasterCoach
()
!=
null
)
{
sb
.
append
(
" and exists (select membership.key from repoentrytogroup as rel, bgroupmember as membership"
)
...
...
@@ -263,6 +286,16 @@ public class LectureBlockDAO {
query
.
setParameter
(
"managerKey"
,
searchParams
.
getMasterCoach
().
getKey
());
}
if
(
quickId
!=
null
)
{
query
.
setParameter
(
"quickVKey"
,
quickId
);
}
if
(
quickRefs
!=
null
)
{
query
.
setParameter
(
"quickRef"
,
quickRefs
);
}
if
(
quickText
!=
null
)
{
query
.
setParameter
(
"quickText"
,
quickText
);
}
List
<
Object
[]>
rawObjects
=
query
.
getResultList
();
return
rawObjects
.
stream
()
.
map
(
objects
->
new
LectureRepositoryEntryInfos
((
RepositoryEntry
)
objects
[
0
],
PersistenceHelper
.
extractPrimitiveLong
(
objects
,
1
)))
...
...
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