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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
39bb5bdf
Commit
39bb5bdf
authored
Mar 7, 2017
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
no-jira: make setup module easily extendable
parent
b46dd1d2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/admin/setup/SetupModule.java
+21
-3
21 additions, 3 deletions
src/main/java/org/olat/admin/setup/SetupModule.java
with
21 additions
and
3 deletions
src/main/java/org/olat/admin/setup/SetupModule.java
+
21
−
3
View file @
39bb5bdf
...
...
@@ -24,14 +24,15 @@ import java.util.ArrayList;
import
org.olat.basesecurity.BaseSecurity
;
import
org.olat.basesecurity.Constants
;
import
org.olat.basesecurity.SecurityGroup
;
import
org.olat.core.commons.persistence.DB
;
import
org.olat.core.commons.persistence.DBFactory
;
import
org.olat.core.configuration.AbstractSpringModule
;
import
org.olat.core.id.Identity
;
import
org.olat.core.logging.OLATRuntimeException
;
import
org.olat.core.logging.OLog
;
import
org.olat.core.logging.Tracing
;
import
org.olat.core.util.coordinate.CoordinatorManager
;
import
org.olat.core.util.event.FrameworkStartupEventChannel
;
import
org.olat.core.util.event.GenericEventListener
;
import
org.olat.user.DefaultUser
;
import
org.olat.user.UserImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -47,7 +48,7 @@ import org.springframework.util.StringUtils;
*
*/
@Service
public
class
SetupModule
implem
en
t
s
GenericEventListener
{
public
class
SetupModule
ext
en
d
s
AbstractSpringModule
{
private
static
final
OLog
log
=
Tracing
.
createLoggerFor
(
SetupModule
.
class
);
...
...
@@ -61,21 +62,38 @@ public class SetupModule implements GenericEventListener {
@Autowired
@Qualifier
(
"testUsers"
)
private
ArrayList
<
DefaultUser
>
testUsers
;
@Autowired
protected
DB
dbInstance
;
@Autowired
private
BaseSecurity
securityManager
;
@Autowired
public
SetupModule
(
CoordinatorManager
coordinatorManager
)
{
super
(
coordinatorManager
);
coordinatorManager
.
getCoordinator
().
getEventBus
().
registerFor
(
this
,
null
,
FrameworkStartupEventChannel
.
getStartupEventChannel
());
}
@Override
public
void
init
()
{
//
}
@Override
protected
void
initFromChangedProperties
()
{
//
}
/**
* Courses are deployed after the startup has completed.
*
*/
@Override
public
void
event
(
org
.
olat
.
core
.
gui
.
control
.
Event
event
)
{
setup
();
}
protected
void
setup
()
{
createDefaultUsers
();
DBFactory
.
getInstance
().
intermediateCommit
();
}
...
...
@@ -97,7 +115,7 @@ public class SetupModule implements GenericEventListener {
}
// Cleanup, otherwhise this subjects will have problems in normal OLAT
// operation
DBFactory
.
get
Instance
()
.
commitAndCloseSession
();
db
Instance
.
commitAndCloseSession
();
}
/**
...
...
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