Package org.intermine.web.logic.results
Class ReportObject
- java.lang.Object
-
- org.intermine.web.logic.results.ReportObject
-
public class ReportObject extends java.lang.Object
Object to be displayed on report.do- Author:
- Radek Stepan, Richard Smith
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ReportObject.TitleValue
Holder for formatted and unformatted versions of a title part.
-
Constructor Summary
Constructors Constructor Description ReportObject(InterMineObject object, WebConfig webConfig, InterMineAPI im, java.util.Properties webProperties)
Setup internal ReportObject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,FieldDescriptor>
getAttributeDescriptors()
Get attribute descriptors.java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
Get the attribute fields and values for this objectClassDescriptor
getClassDescriptor()
Get the class descriptor for this objectjava.util.Map<java.lang.String,DisplayCollection>
getCollections()
Get the collection fields and values for this objectjava.util.Collection<FieldConfig>
getFieldConfigs()
Return a list of field configsjava.lang.String
getFieldDisplayName(java.lang.String fieldExpression)
Return a string to display as the name of a field.java.lang.Object
getFieldValue(java.lang.String fieldExpression)
Get field value for a field name (expression)java.lang.Boolean
getHasHeaderInlineLists()
Used from JSPjava.lang.Boolean
getHasNormalInlineLists()
Used from JSPjava.util.List<InlineList>
getHeaderInlineLists()
HeaderConfigLink
getHeaderLink()
java.lang.String
getHtmlHeadTitle()
Fetch a header string to use as the page title.int
getId()
Get the id of this objectjava.util.List<InlineList>
getNormalInlineLists()
java.lang.Integer
getNumberOfTableRowsToShow()
The said function will resolve the maximum number of rows to show (in Collections) from webProperties.InterMineObject
getObject()
Get InterMine objectjava.util.List<ReportObjectField>
getObjectSummaryFields()
A listing of object fields as pieced together from the various ReportObject methodsjava.util.Map<java.lang.String,DisplayField>
getRefsAndCollections()
Get all the reference and collection fields and values for this objectjava.util.Set<java.lang.String>
getReplacedFieldExprs()
Get fields and paths that are replaced by custom report displayers and should not be shown in the report page.ReportDisplayer
getReportDisplayer(java.lang.String name)
Give us a displayer by a specific name, called by AjaxServicesjava.util.Map<java.lang.String,java.util.List<ReportDisplayer>>
getReportDisplayers()
Get a map from placement (header, summary or a data category) to custom report displayers for that placement.java.lang.String
getSemanticMarkup(javax.servlet.http.HttpServletRequest request)
Get the semantic markup to include in the ld+json sectionjava.util.Map<java.lang.String,ReportObject.TitleValue>
getTitleMain()
Used by JSPjava.util.Map<java.lang.String,ReportObject.TitleValue>
getTitleSub()
Used by JSPjava.lang.String
getType()
Get the unqualified class name for the report object.protected void
setupFieldValues()
Setup fieldValues HashMap
-
-
-
Constructor Detail
-
ReportObject
public ReportObject(InterMineObject object, WebConfig webConfig, InterMineAPI im, java.util.Properties webProperties) throws java.lang.Exception
Setup internal ReportObject- Parameters:
object
- InterMineObjectwebConfig
- WebConfigim
- InterMineAPIwebProperties
- web properties config- Throws:
java.lang.Exception
- Exception
-
-
Method Detail
-
getReportDisplayers
public java.util.Map<java.lang.String,java.util.List<ReportDisplayer>> getReportDisplayers()
Get a map from placement (header, summary or a data category) to custom report displayers for that placement.- Returns:
- map from placement to displayers
-
getReportDisplayer
public ReportDisplayer getReportDisplayer(java.lang.String name)
Give us a displayer by a specific name, called by AjaxServices- Parameters:
name
- displayer name- Returns:
- ReportDisplayer
-
getId
public int getId()
Get the id of this object- Returns:
- the id
-
getAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Get the attribute fields and values for this object- Returns:
- the attributes
-
getClassDescriptor
public ClassDescriptor getClassDescriptor()
Get the class descriptor for this object- Returns:
- one class descriptor
-
getCollections
public java.util.Map<java.lang.String,DisplayCollection> getCollections()
Get the collection fields and values for this object- Returns:
- the collections
-
getObjectSummaryFields
public java.util.List<ReportObjectField> getObjectSummaryFields()
A listing of object fields as pieced together from the various ReportObject methods- Returns:
s List
-
getObject
public InterMineObject getObject()
Get InterMine object- Returns:
- InterMineObject
-
getFieldConfigs
public java.util.Collection<FieldConfig> getFieldConfigs()
Return a list of field configs- Returns:
- Collection
-
getFieldDisplayName
public java.lang.String getFieldDisplayName(java.lang.String fieldExpression)
Return a string to display as the name of a field.- Parameters:
fieldExpression
- The name of the field as configured in webconfig-model.xml- Returns:
- the field's label, or the field's name.
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.String fieldExpression)
Get field value for a field name (expression)- Parameters:
fieldExpression
- String- Returns:
- Object
-
getSemanticMarkup
public java.lang.String getSemanticMarkup(javax.servlet.http.HttpServletRequest request)
Get the semantic markup to include in the ld+json section- Parameters:
request
- the HttpServletRequest- Returns:
- a string representing the markup in json format
-
setupFieldValues
protected void setupFieldValues()
Setup fieldValues HashMap
-
getType
public java.lang.String getType()
Get the unqualified class name for the report object.- Returns:
- an unqualified class name
-
getHtmlHeadTitle
public java.lang.String getHtmlHeadTitle()
Fetch a header string to use as the page title. The title will be type of the object plus the main and sub titles if configured, otherwise any value fetched from a class key. NOTE: This is called from HtmlHeadController so will block the page starting to load until complete, avoid any unnecessary computation.- Returns:
- a title string for the page
-
getTitleMain
public java.util.Map<java.lang.String,ReportObject.TitleValue> getTitleMain()
Used by JSP- Returns:
- the main title of this object, i.e.: "eve FBgn0000606" as a Map
-
getTitleSub
public java.util.Map<java.lang.String,ReportObject.TitleValue> getTitleSub()
Used by JSP- Returns:
- the subtitle of this object, i.e.: "D. melanogaster" as a Map
-
getHeaderLink
public HeaderConfigLink getHeaderLink()
- Returns:
- a resolved link
-
getNumberOfTableRowsToShow
public java.lang.Integer getNumberOfTableRowsToShow()
The said function will resolve the maximum number of rows to show (in Collections) from webProperties.- Returns:
- Integer duh
-
getRefsAndCollections
public java.util.Map<java.lang.String,DisplayField> getRefsAndCollections()
Get all the reference and collection fields and values for this object- Returns:
- the collections
-
getReplacedFieldExprs
public java.util.Set<java.lang.String> getReplacedFieldExprs()
Get fields and paths that are replaced by custom report displayers and should not be shown in the report page.- Returns:
- fields that should not be shown
-
getAttributeDescriptors
public java.util.Map<java.lang.String,FieldDescriptor> getAttributeDescriptors()
Get attribute descriptors.- Returns:
- map of attribute descriptors
-
getNormalInlineLists
public java.util.List<InlineList> getNormalInlineLists()
- Returns:
- InlineLists that are resolved into their respective placements
-
getHeaderInlineLists
public java.util.List<InlineList> getHeaderInlineLists()
- Returns:
- InlineLists to be shown in the header
-
getHasHeaderInlineLists
public java.lang.Boolean getHasHeaderInlineLists()
Used from JSP- Returns:
- true if we have inlineListsHeader
-
getHasNormalInlineLists
public java.lang.Boolean getHasNormalInlineLists()
Used from JSP- Returns:
- true if we have InlineLists with no placement yet
-
-