|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sakaiproject.entitybroker.rest.EntityDescriptionManager
public class EntityDescriptionManager
This handles all the methods related to generating descriptions for entities, html and xml currently supported
| Field Summary | |
|---|---|
protected static String |
ACTION_KEY_PREFIX
|
protected static String |
DESCRIBE
|
protected static String |
FAKE_ID
|
protected static String |
SLASH_DESCRIBE
|
protected static String |
XHTML_FOOTER
|
protected static String |
XHTML_HEADER
|
protected static String |
XML_HEADER
|
| Constructor Summary | |
|---|---|
protected |
EntityDescriptionManager()
|
|
EntityDescriptionManager(EntityViewAccessProviderManager entityViewAccessProviderManager,
HttpServletAccessProviderManager httpServletAccessProviderManager,
EntityProviderManager entityProviderManager,
EntityPropertiesService entityProperties,
EntityBrokerManager entityBrokerManager,
EntityProviderMethodStore entityProviderMethodStore)
Full constructor |
| Method Summary | |
|---|---|
protected String |
describeEntity(StringBuilder sb,
String prefix,
String id,
String format,
boolean extra,
List<Class<? extends EntityProvider>> caps,
Locale locale)
This is reducing code duplication |
void |
destroy()
|
protected String |
generateMethodDetails(String methodType,
Locale locale)
Generates the details listing which shows the response types for a view method |
protected String |
getEntityDescription(String prefix,
String descriptionkey,
Locale locale)
Get the descriptions for an entity OR its capabilities OR custom actions |
protected String[] |
getFormats(String prefix,
boolean output)
|
void |
init()
|
protected String |
makeActionURL(EntityView ev,
CustomAction customAction)
|
protected String |
makeArrayIntoString(Object[] array)
|
protected String |
makeCustomActionKeyMethodText(CustomAction customAction)
Create text to display for the CA key and method |
String |
makeDescribeAll(String format,
Locale locale)
Generate a description of all entities in the system, this is only available as XML and XHTML |
String |
makeDescribeEntity(String prefix,
String id,
String format,
Locale locale)
Generate a description of an entity type |
protected String |
makeEntityURL(EntityView ev,
String viewType)
|
protected String |
makeFormatsString(String[] formats,
String[] extraFormats,
Locale locale)
|
protected String |
makeFormatsUrlHtml(String url,
String[] formats)
|
protected String |
makeFormatUrlHtml(String url,
String format)
|
protected String |
makeFormUrlHtml(String url,
String[] formats)
|
protected String |
makeRedirectLink(String redirect,
String prefixURL)
Turn a redirect template into html for a link if it has no variables in it, otherwise output the text of the template in a span with bold |
protected String |
makeResolveType(String typeName,
String extra,
Locale locale)
|
protected String |
replacePrefix(String outgoingTemplate,
String prefix)
Replaces the {prefix} value in the template with the actual prefix, allows nulls to pass through |
void |
setEntityBrokerManager(EntityBrokerManager entityBrokerManager)
|
void |
setEntityProperties(EntityPropertiesService entityProperties)
|
void |
setEntityProviderManager(EntityProviderManager entityProviderManager)
|
void |
setEntityProviderMethodStore(EntityProviderMethodStore entityProviderMethodStore)
|
void |
setEntityViewAccessProviderManager(EntityViewAccessProviderManager entityViewAccessProviderManager)
|
void |
setHttpServletAccessProviderManager(HttpServletAccessProviderManager httpServletAccessProviderManager)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String ACTION_KEY_PREFIX
protected static String DESCRIBE
protected static String SLASH_DESCRIBE
protected static String FAKE_ID
protected static final String XML_HEADER
protected static final String XHTML_HEADER
protected static final String XHTML_FOOTER
| Constructor Detail |
|---|
protected EntityDescriptionManager()
public EntityDescriptionManager(EntityViewAccessProviderManager entityViewAccessProviderManager,
HttpServletAccessProviderManager httpServletAccessProviderManager,
EntityProviderManager entityProviderManager,
EntityPropertiesService entityProperties,
EntityBrokerManager entityBrokerManager,
EntityProviderMethodStore entityProviderMethodStore)
entityViewAccessProviderManager - httpServletAccessProviderManager - entityProviderManager - entityProperties - entityBrokerManager - entityProviderMethodStore - | Method Detail |
|---|
public void init()
public void destroy()
public void setEntityViewAccessProviderManager(EntityViewAccessProviderManager entityViewAccessProviderManager)
public void setHttpServletAccessProviderManager(HttpServletAccessProviderManager httpServletAccessProviderManager)
public void setEntityProviderManager(EntityProviderManager entityProviderManager)
public void setEntityProperties(EntityPropertiesService entityProperties)
public void setEntityBrokerManager(EntityBrokerManager entityBrokerManager)
public void setEntityProviderMethodStore(EntityProviderMethodStore entityProviderMethodStore)
public String makeDescribeAll(String format,
Locale locale)
format - XML or HTML (default is HTML)locale - the locale to use for any translations
public String makeDescribeEntity(String prefix,
String id,
String format,
Locale locale)
prefix - an entity prefixid - the entity id to use for generating URLsformat - a format to output, HTML and XML supportedlocale - the locale to use for translations
IllegalArgumentException - if the entity does not exist
protected String describeEntity(StringBuilder sb,
String prefix,
String id,
String format,
boolean extra,
List<Class<? extends EntityProvider>> caps,
Locale locale)
sb - prefix - id - format - extra - caps - locale - used for translations
protected String generateMethodDetails(String methodType,
Locale locale)
methodType - the view method (new, show, list, delete, edit)locale - the locale
protected String replacePrefix(String outgoingTemplate,
String prefix)
protected String makeRedirectLink(String redirect,
String prefixURL)
protected String makeResolveType(String typeName,
String extra,
Locale locale)
protected String makeActionURL(EntityView ev,
CustomAction customAction)
ev - the entity viewcustomAction - the custom action
protected String makeEntityURL(EntityView ev,
String viewType)
ev - entity viewviewType - the type of view
protected String makeCustomActionKeyMethodText(CustomAction customAction)
customAction -
protected String[] getFormats(String prefix,
boolean output)
protected String makeFormatsUrlHtml(String url,
String[] formats)
protected String makeFormatsString(String[] formats,
String[] extraFormats,
Locale locale)
protected String makeFormUrlHtml(String url,
String[] formats)
protected String makeFormatUrlHtml(String url,
String format)
protected String makeArrayIntoString(Object[] array)
protected String getEntityDescription(String prefix,
String descriptionkey,
Locale locale)
prefix - an entity prefixdescriptionkey - (optional) the key (simplename for capability, action.actionkey for actions)locale - the Locale to use for translations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||