public class ContentItem extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACCEPT_MEDIA_TYPES |
static String |
CUSTOM |
static String |
ICON |
static String |
LINEITEM |
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 |
TEXT |
static String |
TITLE |
static String |
TYPE_CONTENTITEM |
static String |
TYPE_FILEITEM |
static String |
TYPE_IMPORTITEM |
static String |
TYPE_LTILINK_OLD |
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
|
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 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_LTILINK_OLD
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 CUSTOM
public static final String ICON
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)
Copyright 2015- Charles R. Severance and licensed CC-BY Attribution 4.0