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
2b4f8623
Commit
2b4f8623
authored
11 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-648: fix RS in course preview if a course password is set
parent
6ac8985f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/course/run/preview/PreviewIdentity.java
+76
-99
76 additions, 99 deletions
...ain/java/org/olat/course/run/preview/PreviewIdentity.java
with
76 additions
and
99 deletions
src/main/java/org/olat/course/run/preview/PreviewIdentity.java
+
76
−
99
View file @
2b4f8623
...
...
@@ -35,144 +35,121 @@ import org.olat.core.id.Persistable;
import
org.olat.core.id.Preferences
;
import
org.olat.core.id.User
;
import
org.olat.core.id.UserConstants
;
import
org.olat.core.logging.AssertException
;
/**
* Initial Date: 08.02.2005
*
* @author Mike Stock
*/
final
class
PreviewIdentity
implements
Identity
{
final
class
PreviewIdentity
implements
Identity
,
User
{
private
static
final
long
serialVersionUID
=
6582855975941440446L
;
private
final
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
private
Map
<
String
,
String
>
envAttrs
;
{
data
.
put
(
UserConstants
.
FIRSTNAME
,
"Jane"
);
data
.
put
(
UserConstants
.
LASTNAME
,
"Doe"
);
data
.
put
(
UserConstants
.
EMAIL
,
"jane.doe@testmail.com"
);
}
/**
* @see org.olat.core.commons.persistence.Persistable#getKey()
*/
@Override
public
Long
getKey
()
{
return
2
l
;
}
/**
* @see org.olat.core.id.Identity#getName()
*/
@Override
public
String
getName
()
{
return
"JaneDoe"
;
}
@Override
public
void
setName
(
String
loginName
)
{
//
}
/**
* @see org.olat.core.id.Identity#getUser()
*/
@Override
public
User
getUser
()
{
return
new
User
(){
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
private
Map
<
String
,
String
>
envAttrs
;
{
data
.
put
(
UserConstants
.
FIRSTNAME
,
"Jane"
);
data
.
put
(
UserConstants
.
LASTNAME
,
"Doe"
);
data
.
put
(
UserConstants
.
EMAIL
,
"jane.doe@testmail.com"
);
}
public
Long
getKey
()
{
// TODO Auto-generated method stub
return
null
;
}
@SuppressWarnings
(
"unused"
)
public
boolean
equalsByPersistableKey
(
Persistable
persistable
)
{
// TODO Auto-generated method stub
return
false
;
}
public
Date
getLastModified
()
{
// TODO Auto-generated method stub
return
null
;
}
public
Date
getCreationDate
()
{
// TODO Auto-generated method stub
return
null
;
}
@SuppressWarnings
(
"unused"
)
public
void
setProperty
(
String
propertyName
,
String
propertyValue
)
{
// TODO Auto-generated method stub
}
@SuppressWarnings
(
"unused"
)
public
void
setPreferences
(
Preferences
prefs
)
{
// TODO Auto-generated method stub
}
@SuppressWarnings
(
"unused"
)
public
String
getProperty
(
String
propertyName
,
Locale
locale
)
{
return
data
.
get
(
propertyName
);
}
public
void
setIdentityEnvironmentAttributes
(
Map
<
String
,
String
>
identEnvAttribs
)
{
this
.
envAttrs
=
identEnvAttribs
;
}
public
String
getPropertyOrIdentityEnvAttribute
(
String
propertyName
,
Locale
locale
)
{
String
retVal
=
null
;
retVal
=
data
.
get
(
propertyName
);
if
(
retVal
==
null
&&
this
.
envAttrs
!=
null
){
retVal
=
envAttrs
.
get
(
propertyName
);
}
return
retVal
;
}
public
Preferences
getPreferences
()
{
// TODO Auto-generated method stub
return
null
;
}
};
return
this
;
}
/**
* @see org.olat.core.commons.persistence.Auditable#getCreationDate()
*/
public
Date
getCreationDate
()
{
throw
new
AssertException
(
"unsupported"
);
@Override
public
String
getProperty
(
String
propertyName
,
Locale
locale
)
{
return
data
.
get
(
propertyName
);
}
/**
* @see org.olat.core.commons.persistence.Auditable#getLastModified()
*/
public
Date
getLastModified
()
{
throw
new
AssertException
(
"unsupported"
);
@Override
public
void
setProperty
(
String
propertyName
,
String
propertyValue
)
{
data
.
put
(
propertyName
,
propertyValue
);
}
/**
* @see org.olat.core.commons.persistence.Persistable#getKey()
*/
public
Long
getKey
()
{
throw
new
AssertException
(
"unsupported"
);
@Override
public
void
setIdentityEnvironmentAttributes
(
Map
<
String
,
String
>
identEnvAttribs
)
{
this
.
envAttrs
=
identEnvAttribs
;
}
@Override
public
String
getPropertyOrIdentityEnvAttribute
(
String
propertyName
,
Locale
locale
)
{
String
retVal
=
null
;
retVal
=
data
.
get
(
propertyName
);
if
(
retVal
==
null
&&
this
.
envAttrs
!=
null
){
retVal
=
envAttrs
.
get
(
propertyName
);
}
return
retVal
;
}
@Override
public
Preferences
getPreferences
()
{
return
null
;
}
@Override
public
void
setPreferences
(
Preferences
prefs
)
{
//
}
/**
* @see org.olat.core.commons.persistence.
Persistable#equalsByPersistableKey(org.olat.core.commons.persistence.Persistable
)
* @see org.olat.core.commons.persistence.
Auditable#getCreationDate(
)
*/
public
boolean
equalsByPersistableKey
(
Persistable
persistable
)
{
throw
new
AssertException
(
"unsupported"
);
@Override
public
Date
getCreationDate
()
{
return
new
Date
();
}
@Override
public
Date
getLastLogin
()
{
throw
new
AssertException
(
"unsupported"
);
return
new
Date
(
);
}
@Override
public
void
setLastLogin
(
Date
loginDate
)
{
throw
new
AssertException
(
"unsupported"
);
//
}
@Override
public
Integer
getStatus
()
{
throw
new
AssertException
(
"unsupported"
)
;
return
Identity
.
STATUS_ACTIV
;
}
@Override
public
void
setStatus
(
Integer
newStatus
)
{
throw
new
AssertException
(
"unsupported"
);
}
public
Date
getDeleteEmailDate
()
{
throw
new
AssertException
(
"unsupported"
);
}
public
void
setDeleteEmailDate
(
Date
newDeleteEmail
)
{
throw
new
AssertException
(
"unsupported"
);
//
}
public
void
setName
(
String
loginName
)
{
/**
* @see org.olat.core.commons.persistence.Persistable#equalsByPersistableKey(org.olat.core.commons.persistence.Persistable)
*/
@Override
public
boolean
equalsByPersistableKey
(
Persistable
persistable
)
{
return
equals
(
persistable
);
}
}
\ 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