public abstract class AbstractLesson extends Screen implements Comparable<Object>
This file is part of WebGoat, an Open Web Application Security Project utility. For details, please see http://www.owasp.org/
Copyright (c) 2002 - 20014 Bruce Mayhew
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Getting Source ==============
Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
| Modifier and Type | Field and Description |
|---|---|
static String |
ADMIN_ROLE
Description of the Field
|
static String |
CHALLENGE_ROLE
Constant
CHALLENGE_ROLE="challenge" |
static String |
HACKED_ADMIN_ROLE
Description of the Field
|
static String |
USER_ROLE
Description of the Field
|
| Constructor and Description |
|---|
AbstractLesson()
Constructor for the Lesson object
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object obj) |
boolean |
equals(Object obj) |
List<String> |
getAvailableLanguages()
Getter for the field
availableLanguages. |
Category |
getCategory()
Gets the category attribute of the Lesson object
|
abstract String |
getCurrentAction(WebSession s)
getCurrentAction.
|
protected abstract Category |
getDefaultCategory()
getDefaultCategory.
|
protected abstract boolean |
getDefaultHidden()
getDefaultHidden.
|
String |
getDefaultLanguage()
Getter for the field
defaultLanguage. |
protected abstract Integer |
getDefaultRanking()
getDefaultRanking.
|
static String |
getFileMethod(BufferedReader reader,
String methodName,
boolean numbers)
Gets the fileMethod attribute of the Lesson class
|
static String |
getFileText(BufferedReader reader,
boolean numbers)
Gets the fileText attribute of the Screen class
|
String |
getFormAction()
getFormAction.
|
boolean |
getHidden()
Gets the hidden value of the Lesson Object
|
String |
getHint(WebSession s,
int hintNumber)
Fill in a minor hint that will help people who basically get it, but are
stuck on somthing silly.
|
int |
getHintCount(WebSession s)
Gets the hintCount attribute of the Lesson object
|
protected abstract List<String> |
getHints(WebSession s)
getHints.
|
List<String> |
getHintsPublic(WebSession s)
getHintsPublic.
|
String |
getHtml_DELETE_ME(WebSession s)
getHtml_DELETE_ME.
|
abstract String |
getInstructions(WebSession s)
Gets the instructions attribute of the AbstractLesson object
|
protected LabelManager |
getLabelManager()
Getter for the field
labelManager. |
String |
getLessonName()
Gets the lessonPlan attribute of the Lesson object
|
String |
getLessonPlan(WebSession s)
Gets the content of lessonPlanURL
|
String |
getLessonPlanFileName(String lang)
Getter for the field
lessonPlanFileName. |
String |
getLessonSolutionFileName()
Getter for the field
lessonSolutionFileName. |
String |
getLink()
Get the link that can be used to request this screen.
|
String |
getName()
getName.
|
String |
getPage(WebSession s)
Get the link to the jsp page used to render this screen.
|
protected String |
getPath()
Returns the default "path" portion of a lesson's URL.
|
Integer |
getRanking()
Gets the ranking attribute of the Lesson object
|
String |
getRawSource(WebSession s)
getRawSource.
|
String |
getRole()
Gets the role attribute of the AbstractLesson object
|
int |
getScreenId()
Gets the uniqueID attribute of the AbstractLesson object
|
String |
getServletLink()
Get the link to the target servlet.
|
String |
getSolution(WebSession s)
getSolution.
|
String |
getSource(WebSession s)
getSource.
|
String |
getSourceFileName()
Getter for the field
sourceFileName. |
abstract String |
getSubmitMethod()
getSubmitMethod
|
String |
getTemplatePage(WebSession s)
Get the link to the jsp template page used to render this screen.
|
abstract String |
getTitle()
Gets the title attribute of the HelloScreen object
|
int |
getUserId(WebSession s)
getUserId.
|
String |
getUserName(WebSession s)
getUserName.
|
WebgoatContext |
getWebgoatContext()
Getter for the field
webgoatContext. |
void |
handleRequest(WebSession s)
Description of the Method
|
boolean |
isAuthorized(WebSession s,
int employeeId,
String functionId)
Override this method to implement accesss control in a lesson.
|
boolean |
isAuthorized(WebSession s,
String role,
String functionId)
Override this method to implement accesss control in a lesson.
|
boolean |
isCompleted(WebSession s)
isCompleted.
|
boolean |
isEnterprise()
Will this screen be included in an enterprise edition.
|
static String |
makeWindowScript(String windowName)
Description of the Method
|
static String |
readFromFile(BufferedReader reader,
boolean numbers)
Reads text from a file into an ElementContainer.
|
static org.apache.ecs.Element |
readFromURL(String url)
Simply reads a url into an Element for display.
|
static org.apache.ecs.Element |
readMethodFromFile(BufferedReader reader,
String methodName,
boolean numbers)
Description of the Method
|
abstract void |
restartLesson()
Initiates lesson restart functionality
|
abstract void |
setCurrentAction(WebSession s,
String lessonScreen)
setCurrentAction.
|
void |
setHidden(boolean hidden)
Setter for the field
hidden. |
void |
setLessonPlanFileName(String lang,
String lessonPlanFileName)
Setter for the field
lessonPlanFileName. |
void |
setLessonSolutionFileName(String lessonSolutionFileName)
Setter for the field
lessonSolutionFileName. |
void |
setRanking(Integer ranking)
Setter for the field
ranking. |
void |
setSourceFileName(String sourceFileName)
Setter for the field
sourceFileName. |
void |
setWebgoatContext(WebgoatContext webgoatContext)
Setter for the field
webgoatContext. |
String |
toString()
Description of the Method
|
void |
update(WebgoatProperties properties)
update.
|
convertMetachars, convertMetacharsJavaCode, createContent, createLessonTracker, createLessonTracker, getContent, getContentLength, getLessonTracker, getLessonTracker, getLessonTracker, getSponsor, getSponsorLogoResource, makeLogo, makeMessages, output, pad, setContentpublic static final String ADMIN_ROLE
public static final String CHALLENGE_ROLE
CHALLENGE_ROLE="challenge"public static final String HACKED_ADMIN_ROLE
public static final String USER_ROLE
public void setRanking(Integer ranking)
Setter for the field ranking.
ranking - a Integer object.public void setHidden(boolean hidden)
Setter for the field hidden.
hidden - a boolean.public void update(WebgoatProperties properties)
update.
properties - a WebgoatProperties object.public boolean isCompleted(WebSession s)
isCompleted.
s - a WebSession object.public int compareTo(Object obj)
Description of the Method
compareTo in interface Comparable<Object>public boolean equals(Object obj)
Description of the Method
public Category getCategory()
protected abstract Integer getDefaultRanking()
getDefaultRanking.
Integer object.protected abstract Category getDefaultCategory()
getDefaultCategory.
Category object.protected abstract boolean getDefaultHidden()
getDefaultHidden.
public static String getFileMethod(BufferedReader reader, String methodName, boolean numbers)
reader - Description of the ParametermethodName - Description of the Parameternumbers - Description of the Parameterpublic static String readFromFile(BufferedReader reader, boolean numbers)
reader - Description of the Parameternumbers - Description of the Parameterpublic static String getFileText(BufferedReader reader, boolean numbers)
reader - Description of the Parameternumbers - Description of the Parameterpublic boolean isEnterprise()
public int getHintCount(WebSession s)
s - The user's WebSessionprotected abstract List<String> getHints(WebSession s)
getHints.
s - a WebSession object.List object.public List<String> getHintsPublic(WebSession s)
getHintsPublic.
s - a WebSession object.List object.public String getHint(WebSession s, int hintNumber)
s - The users WebSessionhintNumber - a int.public abstract String getInstructions(WebSession s)
s - a WebSession object.public String getLessonName()
public abstract String getTitle()
public String getLessonPlan(WebSession s)
s - The user's WebSessionpublic Integer getRanking()
public boolean getHidden()
public String getRole()
public int getScreenId()
public String getHtml_DELETE_ME(WebSession s)
getHtml_DELETE_ME.
s - a WebSession object.String object.public String getSource(WebSession s)
getSource.
s - a WebSession object.String object.public String getRawSource(WebSession s)
getRawSource.
s - a WebSession object.String object.public String getSolution(WebSession s)
getSolution.
s - a WebSession object.String object.protected String getPath()
Returns the default "path" portion of a lesson's URL.
Legacy webgoat lesson links are of the form "attack?Screen=Xmenu=Ystage=Z". This method returns the path portion of the url, i.e., "attack" in the string above.
Newer, Spring-Controller-based classes will override this method to return "*.do"-styled paths.
String object.public String getLink()
Rendering the link in the browser may result in Javascript sending additional requests to perform necessary actions or to obtain data relevant to the lesson or the element of the lesson selected by the user. Thanks to using the hash mark "#" and Javascript handling the clicks, the user will experience less waiting as the pages do not have to reload entirely.
String object.public String getServletLink()
Unlike getLink() this method does not require rendering the output of the request to the link in order to execute the servlet's method with conventional HTTP query parameters.
String object.public String getPage(WebSession s)
s - a WebSession object.String object.public String getTemplatePage(WebSession s)
s - a WebSession object.String object.public abstract String getCurrentAction(WebSession s)
getCurrentAction.
s - a WebSession object.String object.public abstract void restartLesson()
public abstract void setCurrentAction(WebSession s, String lessonScreen)
setCurrentAction.
s - a WebSession object.lessonScreen - a String object.public boolean isAuthorized(WebSession s, int employeeId, String functionId)
s - a WebSession object.functionId - a String object.employeeId - a int.public boolean isAuthorized(WebSession s, String role, String functionId)
s - a WebSession object.functionId - a String object.role - a String object.public int getUserId(WebSession s) throws ParameterNotFoundException
getUserId.
s - a WebSession object.ParameterNotFoundException - if any.public String getUserName(WebSession s) throws ParameterNotFoundException
getUserName.
s - a WebSession object.String object.ParameterNotFoundException - if any.public static String makeWindowScript(String windowName)
windowName - Description of the Parameterpublic static org.apache.ecs.Element readFromURL(String url)
url - Description of the Parameterpublic static org.apache.ecs.Element readMethodFromFile(BufferedReader reader, String methodName, boolean numbers)
reader - Description of the Parameternumbers - Description of the ParametermethodName - Description of the Parameterpublic void handleRequest(WebSession s)
s - Description of the Parameterpublic String toString()
public String getDefaultLanguage()
Getter for the field defaultLanguage.
String object.public String getLessonPlanFileName(String lang)
Getter for the field lessonPlanFileName.
public void setLessonPlanFileName(String lang, String lessonPlanFileName)
Setter for the field lessonPlanFileName.
public List<String> getAvailableLanguages()
Getter for the field availableLanguages.
List object.public String getLessonSolutionFileName()
Getter for the field lessonSolutionFileName.
String object.public void setLessonSolutionFileName(String lessonSolutionFileName)
Setter for the field lessonSolutionFileName.
lessonSolutionFileName - a String object.public String getSourceFileName()
Getter for the field sourceFileName.
String object.public void setSourceFileName(String sourceFileName)
Setter for the field sourceFileName.
sourceFileName - a String object.public WebgoatContext getWebgoatContext()
Getter for the field webgoatContext.
WebgoatContext object.public void setWebgoatContext(WebgoatContext webgoatContext)
Setter for the field webgoatContext.
webgoatContext - a WebgoatContext object.protected LabelManager getLabelManager()
Getter for the field labelManager.
LabelManager object.Copyright © 2006–2016 OWASP. All rights reserved.