Package com.orchestranetworks.ui
Interface UILabelRendererContext
- All Superinterfaces:
UIBodyWriter
- All Known Subinterfaces:
UILabelRendererForHierarchyContext
Provides a context for displaying a record.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondisplayOccurrenceValue(Path aPath, boolean useLabels) Returns a user-friendly representation of the specified value, according the current locale.Returns the localized label as specified by the default pattern.Returns the current locale of the user session.Returns the current record that is being displayed.Returns the current user session.getURLForResource(ResourceType aResourceType, String aResourceName) Returns the URL of the specified web resource, in the current module and for the current session locale.getURLForResource(ResourceType aResourceType, String aResourceName, Locale aLocale) Returns the URL of the specified web resource, in the current module (that is, the module of the current adaptation).getURLForResource(String aModuleAliasOrName, ResourceType aResourceType, String aResourceName, Locale aLocale) Returns the URL of the specified web resource.booleanReturnstrueif the HTML tags in the label are escaped,falseif they are interpreted.Methods inherited from interface com.orchestranetworks.ui.UIBodyWriter
add, add, add, add_cr, add_cr, addSafeAttribute, addSafeAttribute, addSafeInnerHTML, addSafeInnerHTML
-
Method Details
-
getLocale
Locale getLocale()Returns the current locale of the user session.- Throws:
RuntimeException- if this method is called by a renderer defined inside a foreign key constraint.
-
getURLForResource
Returns the URL of the specified web resource, in the current module and for the current session locale. Returnsnullif called outside the context of an HTTP request (for instance throughAdaptation.getLabel(Locale)).- Throws:
UnsupportedOperationException- if the resource type is internal (not accessible from HTTP).ModuleNotFoundException- if the alias or name specified does not correspond to a module.- See Also:
-
getURLForResource
Returns the URL of the specified web resource, in the current module (that is, the module of the current adaptation). Returnsnullif called outside the context of an HTTP request (for instance throughAdaptation.getLabel(Locale)).- Throws:
UnsupportedOperationException- if the resource type is internal (not accessible from HTTP).ModuleNotFoundException- if the alias or name specified does not correspond to a module.
-
getURLForResource
String getURLForResource(String aModuleAliasOrName, ResourceType aResourceType, String aResourceName, Locale aLocale) throws ModuleNotFoundException Returns the URL of the specified web resource. Returnsnullif called outside the context of an HTTP request (for instance throughAdaptation.getLabel(Locale)).- Throws:
RuntimeException- if the resource type is internal (not accessible from HTTP).ModuleNotFoundException- if the alias or name specified does not correspond to a module.
-
getOccurrence
Adaptation getOccurrence()Returns the current record that is being displayed. -
displayOccurrenceValue
Returns a user-friendly representation of the specified value, according the current locale.Value display
A value can have be displayed differently from a standard XML formatted value since it can take into account locale-dependent formatting for numbers and dates and also, if
useLabelsistruefor specific value labeling.For more information, see
value display section.- Parameters:
aPath- specifies the value to display in the record (a relative path is interpreted based on the root node of this context).useLabels- Iftrueand labeling is enabled (see above), specifies that the label associated with the value must be returned. Otherwise, the formatted value is returned.- Throws:
IllegalStateException- if this node is not for a record (seegetOccurrence()).RuntimeException- if this method is called by a renderer defined inside a foreign key constraint.- See Also:
-
getLabelFromDefaultPattern
String getLabelFromDefaultPattern()Returns the localized label as specified by the default pattern. The default pattern is looked up on the elements<defaultLabel [xml:lang="..."]>which are specified by the table definition.- See Also:
-
getSession
Session getSession()Returns the current user session. -
isHTMLForbidden
boolean isHTMLForbidden()Returnstrueif the HTML tags in the label are escaped,falseif they are interpreted.If this method returns
true, HTML tags in the label will not be interpreted and will thus be displayed as plain text.- Since:
- 5.9.0
-