T - as Report row Record typeRM - as ReporterMeta typepublic class ReportResult<T extends Serializable,RM extends ReporterMeta> extends org.apache.wicket.markup.html.WebMarkupContainer implements ChangeListener<Object[]>
TODO: All markups using this have the same HTML, consider making this a Panel ?!,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected AuthorizationModule<Void> |
authorizationModule |
protected Object[] |
params |
protected static org.slf4j.Logger |
secirityLog |
| Constructor and Description |
|---|
ReportResult(String id)
Report definition
ReporterMeta, passed on dynamically after construction |
ReportResult(String id,
org.apache.wicket.model.IModel<RM> model,
Object[] params)
Report definition
ReporterMeta, provided @ construction time. |
| Modifier and Type | Method and Description |
|---|---|
protected List<org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<?>> |
defineColumns(RM reporterMeta)
It will use
ReporterMeta.getReporter().Reporter.getColumnNames() to define all the Columns in the report. |
protected org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider |
defineReportDataProvider()
Add ability to Sort on the Report by overriding the
SortableDataProvider and customizing it
Assumes Reporter is DataSourceReporter using a JPAQueryTransformer |
protected boolean |
filter(User user,
FacetMeta facetMeta)
By default Filter Authorizable Columns(FacetMeta) that are not meant for current user
|
protected org.apache.wicket.Component |
getComponentForCell(String componentId,
Object value,
Object record,
int colIndex,
String fieldName,
RM reporterMeta)
By default converts every cell data into a Label
|
org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable |
getDataPanel()
Access the DataTable directly
|
Object[] |
getParams()
Supply the
Reporter additional params, if supported/necessary |
protected boolean |
getStatelessHint() |
void |
onChange(ChangeGenerator<Object[]> changeGenerator,
Object[] params) |
void |
onInitialize() |
protected void |
populateBulkButtonItem(org.apache.wicket.model.IModel<Collection<Long>> selectedList,
org.apache.wicket.markup.html.list.ListItem<FacetMeta> item)
Bulk buttons override option for more cool buttons.
|
protected Object |
secure(Object value,
String fieldName)
Data may come from anywhere, including user interfaces.
|
void |
setParams(Object[] params)
Supply the
Reporter additional params, if supported/necessary |
getMarkupType, getWebPage, getWebRequestadd, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdImpl, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onComponentTag, onConfigure, onDetach, onEndRequest, onModelChanged, onModelChanging, onRemove, prepareForRender, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrapprotected static org.slf4j.Logger secirityLog
protected transient Object[] params
protected AuthorizationModule<Void> authorizationModule
public ReportResult(String id)
ReporterMeta, passed on dynamically after constructionReportingAdminpublic ReportResult(String id, org.apache.wicket.model.IModel<RM> model, Object[] params)
ReporterMeta, provided @ construction time.protected boolean filter(User user, FacetMeta facetMeta)
public org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable getDataPanel()
public void onInitialize()
onInitialize in class org.apache.wicket.Componentprotected org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider defineReportDataProvider()
SortableDataProvider and customizing it
DataSourceReporter using a JPAQueryTransformerprotected List<org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn<?>> defineColumns(RM reporterMeta)
ReporterMeta.getReporter().Reporter.getColumnNames() to define all the Columns in the report.
ReporterMeta#getColumnToEntityNameMapping() is defined, it will use that to drive the original entity field to associate with.
This can be used for more control over the Grid, like sorting that will require one to know the field it is associated/data-source.
#getComponentForCell(String, Object, Object, int, ReporterMeta)
ReporterMeta.getColumnToEntityValueMapping() the Mapping of AuthorizableFacetMeta will apply Authorization on that columnprotected void populateBulkButtonItem(org.apache.wicket.model.IModel<Collection<Long>> selectedList, org.apache.wicket.markup.html.list.ListItem<FacetMeta> item)
FacetMeta.getSubmitTransformer()
and the result is synchronously returned/added as String in the listing FeedbackPanel.protected org.apache.wicket.Component getComponentForCell(String componentId, Object value, Object record, int colIndex, String fieldName, RM reporterMeta)
componentId - as String, passed Id for component from the Container like a Data gridvalue - as Object of the cellrecord - as Object, defining the row as a List, Array or any EntitycolIndex - as intfieldName - as String (Name of the field if its an entity or ColIndex is not)reporterMeta - as protected Object secure(Object value, String fieldName) throws SecurityException
value - as ObjectfieldName - as String (provided for any conditional checks; optional). Its advised that all checks be on all data without exceptions.SecurityExceptionprotected boolean getStatelessHint()
getStatelessHint in class org.apache.wicket.Componentpublic Object[] getParams()
Reporter additional params, if supported/necessarypublic void setParams(Object[] params)
Reporter additional params, if supported/necessarypublic void onChange(ChangeGenerator<Object[]> changeGenerator, Object[] params)
onChange in interface ChangeListener<Object[]>changeGenerator - as the generator that caused the change. Specially useful if the Listener is subscribing to multiple ChangeGeneratorsparams - as the model change communicatedCopyright © 2018. All rights reserved.