Interface CustomDataProvider

All Known Implementing Classes:
AbstractPrivilegedRelationDataProvider, AttachmentMimeTypeIconCustomDataProvider, AuthorPostCountProvider, BinarySizeCustomDataProvider, EditedUrlCustomDataProvider, EntityDocThumbnailDataProvider, EvaluationSourceDataProvider, ExternalTemplateCustomDataProvider, ForumAdministratorProvider, FreemarkerTitleDataProvider, IsForumSubscribedDataProvider, LicenceOverviewAddressRelationPrivilegedCustomDataProvider, LicenceOverviewUserRelationPrivilegedCustomDataProvider, MarkProvider, MembershipAdministrationAddressPrivilegedCustomDataProvider, MembershipAdministrationUserNrCustomDataProviderPrivileged, MembershipAdministrationUserPrivilegedCustomDataProvider, MimeTypeCustomDataProvider, MimeTypeIconCustomDataProvider, PostDocumentsDataProvider, ReferencesCustomDataProvider, ReservationRegistrationUserCustomDataProvider, ShowRegisterButtonProvider, SubscriptionProvider, ThumbnailCustomDataProvider, UrlCustomDataProvider

public interface CustomDataProvider

This interface can be implemented to display custom data in a grid or form. For example if you want to display, if the current principal is subscribed to a certain entity or to list 1:n relations.

The provider can be referenced in form model by using the prefix "custom:" and the full qualified class name.

The declaration in the form model:

 <column name="subscribed">
    <checkbox data=""/>

Please note, that the using component for the custom data must be specified (don't just use <field ... >), because there exists no such field in the entity model to get this information from.

If you are using something like a DataView and you need some fancy data, you can use a custom-data-field and return a TypedValue of type "custom".

An example of how to do this:

 CustomData<FancyDataObject> data = new CustomData<FancyDataObject>(myFancyDataObject);
 Type<CustomData<FancyDataObject>> customType = (Type<CustomData<FancyDataObject>>) typeManager.requireType("custom");
 return new TypedValue<CustomData<FancyDataObject>>(customType, data);

  • Method Summary

    Modifier and Type
    getData(@Nullable Entity entity)
    Collects the custom data for this field and returns it as a TypedValue.