public class ContentItem extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACCEPT_MEDIA_TYPES |
static String |
ACCEPT_MULTIPLE |
static String |
BAD_CONTENT_MESSAGE |
static String |
BAD_DATA_MESSAGE |
static String |
CONTENT_ITEMS |
static String |
CUSTOM |
static String |
ICON |
static String |
LINEITEM |
static String |
MEDIA_ALL |
static String |
MEDIA_CC |
static String |
MEDIA_CC_1_1 |
static String |
MEDIA_CC_1_2 |
static String |
MEDIA_CC_1_3 |
static String |
MEDIA_LTILINKITEM |
static String |
NO_CONTENT_ITEMS |
static String |
NO_DATA_MESSAGE |
static String |
NO_GRAPH_MESSAGE |
static String |
SCORE_CONSTRAINTS |
static String |
SCORE_CONSTRAINTS_EXTRA_CREDIT_MAXIMUM |
static String |
SCORE_CONSTRAINTS_NORMAL_MAXIMUM |
static String |
SCORE_CONSTRAINTS_TOTAL_MAXIMUM |
static String |
TEXT |
static String |
TITLE |
static String |
TYPE_CONTENTITEM |
static String |
TYPE_FILEITEM |
static String |
TYPE_IMPORTITEM |
static String |
TYPE_LTILINKITEM |
static String |
URL |
| Constructor and Description |
|---|
ContentItem(javax.servlet.http.HttpServletRequest req)
We check for the fields essential for the class to operate here.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
buildLaunch(String contentLaunch,
String contentReturn,
Properties contentData)
Build up a ContentItem launch URL from a base url, return url and extra data
|
String |
getBaseString()
Return the base string
|
org.json.simple.JSONObject |
getContentItem()
Retrieve the parsed tool_proxy
|
Properties |
getDataProperties()
Get the data properties from the incoming request
|
String |
getErrorMessage()
Return the error message
|
org.json.simple.JSONArray |
getGraph()
Retrieve the @graph from the content item
|
org.json.simple.JSONObject |
getItemOfType(String itemType)
Retrieve a particular type from the graph
|
static Double |
getScoreMaximum(org.json.simple.JSONObject lineItem)
Get the maximum score from a lineItem
This logic is to produce the DeepLink equivalent of maxScore from a Content Item
|
String |
toString()
Return a string
|
boolean |
validate(String oauth_consumer_key,
String oauth_secret,
String URL)
Validate the incoming request
|
public static final String ACCEPT_MEDIA_TYPES
public static String MEDIA_LTILINKITEM
public static String MEDIA_ALL
public static String ACCEPT_MULTIPLE
public static final String MEDIA_CC_1_1
public static final String MEDIA_CC_1_2
public static final String MEDIA_CC_1_3
public static final String MEDIA_CC
public static final String TYPE_LTILINKITEM
public static final String TYPE_CONTENTITEM
public static final String TYPE_FILEITEM
public static final String TYPE_IMPORTITEM
public static final String TITLE
public static final String TEXT
public static final String URL
public static final String LINEITEM
public static final String SCORE_CONSTRAINTS
public static final String SCORE_CONSTRAINTS_NORMAL_MAXIMUM
public static final String SCORE_CONSTRAINTS_EXTRA_CREDIT_MAXIMUM
public static final String SCORE_CONSTRAINTS_TOTAL_MAXIMUM
public static final String CUSTOM
public static final String ICON
public static final String CONTENT_ITEMS
public static final String NO_CONTENT_ITEMS
public static final String BAD_CONTENT_MESSAGE
public static final String NO_DATA_MESSAGE
public static final String NO_GRAPH_MESSAGE
public static final String BAD_DATA_MESSAGE
public ContentItem(javax.servlet.http.HttpServletRequest req)
public boolean validate(String oauth_consumer_key, String oauth_secret, String URL)
URL - The URL of the incoming request. If this in null, the URL is taken
from the request object. Sometimes the request object can be misleading when
sitting behind a load balancer or some kind of proxy.public org.json.simple.JSONObject getContentItem()
public org.json.simple.JSONArray getGraph()
public org.json.simple.JSONObject getItemOfType(String itemType)
String - messageType - Which item type you are looking forpublic Properties getDataProperties()
public String getBaseString()
public String getErrorMessage()
public static String buildLaunch(String contentLaunch, String contentReturn, Properties contentData)
public static Double getScoreMaximum(org.json.simple.JSONObject lineItem)
Copyright 2015- Charles R. Severance and licensed CC-BY Attribution 4.0