changing to 'id' for linking in YmlBasedLesson
This commit is contained in:
parent
d27712affa
commit
8e862ba9c3
@ -88,7 +88,7 @@ public class StartLesson {
|
|||||||
List<AbstractLesson> lessons = ws.getCourse()
|
List<AbstractLesson> lessons = ws.getCourse()
|
||||||
.getLessons(ws, AbstractLesson.USER_ROLE);//TODO this should work with the security roles of Spring
|
.getLessons(ws, AbstractLesson.USER_ROLE);//TODO this should work with the security roles of Spring
|
||||||
Optional<AbstractLesson> lesson = lessons.stream()
|
Optional<AbstractLesson> lesson = lessons.stream()
|
||||||
.filter(l -> l.getHtml().equals(lessonName))
|
.filter(l -> l.getId().equals(lessonName))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
model.setViewName("lesson_content");
|
model.setViewName("lesson_content");
|
||||||
model.addObject("lesson", lesson.get());
|
model.addObject("lesson", lesson.get());
|
||||||
|
@ -626,7 +626,7 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
|
|||||||
* @return a {@link java.lang.String} object.
|
* @return a {@link java.lang.String} object.
|
||||||
*/
|
*/
|
||||||
protected String getPath() {
|
protected String getPath() {
|
||||||
return "#attack";
|
return "#lesson/";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -645,9 +645,10 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
|
|||||||
StringBuffer link = new StringBuffer(getPath());
|
StringBuffer link = new StringBuffer(getPath());
|
||||||
|
|
||||||
// mvc update:
|
// mvc update:
|
||||||
return link
|
// return link
|
||||||
.append("/").append(getScreenId())
|
// .append("/").append(getScreenId())
|
||||||
.append("/").append(getCategory().getRanking()).toString();
|
// .append("/").append(getCategory().getRanking()).toString();
|
||||||
|
return link.append(getId()).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -999,7 +1000,7 @@ public abstract class AbstractLesson extends Screen implements Comparable<Object
|
|||||||
return labelManager;
|
return labelManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHtml() {
|
public String getId() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public class Plugin {
|
|||||||
final String category = (String) lessonYml.get("category");
|
final String category = (String) lessonYml.get("category");
|
||||||
final List<String> hints = (List<String>) lessonYml.get("hints");
|
final List<String> hints = (List<String>) lessonYml.get("hints");
|
||||||
final String title = (String) lessonYml.get("title");
|
final String title = (String) lessonYml.get("title");
|
||||||
final String html = (String) lessonYml.get("html");
|
final String html = (String) lessonYml.get("id");
|
||||||
this.ymlBasedLesson = new YmlBasedLesson(category, hints, title, html);
|
this.ymlBasedLesson = new YmlBasedLesson(category, hints, title, html);
|
||||||
this.lesson = null;
|
this.lesson = null;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -41,13 +41,13 @@ public class YmlBasedLesson extends LessonAdapter {
|
|||||||
private final String category;
|
private final String category;
|
||||||
private final List<String> hints;
|
private final List<String> hints;
|
||||||
private final String title;
|
private final String title;
|
||||||
private final String html;
|
private final String id;
|
||||||
|
|
||||||
public YmlBasedLesson(String category, List<String> hints, String title, String html) {
|
public YmlBasedLesson(String category, List<String> hints, String title, String id) {
|
||||||
this.category = category;
|
this.category = category;
|
||||||
this.hints = hints;
|
this.hints = hints;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.html = html;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -70,8 +70,8 @@ public class YmlBasedLesson extends LessonAdapter {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHtml() {
|
public String getId() {
|
||||||
return html;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user