Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trunk 3499 #399

Closed
wants to merge 7 commits into from
Closed

Trunk 3499 #399

wants to merge 7 commits into from

Conversation

k-joseph
Copy link
Member

@k-joseph k-joseph commented Sep 6, 2013

https://tickets.openmrs.org/browse/TRUNK-3986 [Support more CustomDatatypes and their associated CustomDatatypeHandlers]

import org.openmrs.messagesource.MessageSourceService;

/**
* This is a superclass for associated handlers of custom datatypes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should say custom datatypes for metadata

@Override
public CustomDatatype.Summary toHtmlSummary(CustomDatatype<T> datatype, String valueReference) {
SerializingCustomDatatype<T> dt = (SerializingCustomDatatype<T>) datatype;
return new CustomDatatype.Summary(dt.deserialize(valueReference).getName(), true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djazayeri would you consider this to be the complete HTML summary? Or complete will include the description?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The javadoc on toHtmlSummary is:

  • Renders an HTML-formatted summary view of the custom value, that does
    not take a lot of space. (This is
  • subjective, but generally means < 100 characters in length, or an image
    of < 200 pixels in each dimension.)
  • This method should return quickly, e.g. in case we're rendering
    thousands of custom values in a table.

So basically, yes, it is appropriate for this to be the name (with no
description).

On Fri, Oct 25, 2013 at 11:21 AM, wluyima notifications@github.com wrote:

In
web/src/main/java/org/openmrs/web/attribute/handler/BaseMetadataFieldGenDatatypeHandler.java:

+/**

  • * This is a superclass for custom datatypes for metadata
  • * @SInCE 1.10
  • */
    +public abstract class BaseMetadataFieldGenDatatypeHandler implements FieldGenDatatypeHandler<SerializingCustomDatatype, T> {
  • /**
  • * @see org.openmrs.web.attribute.handler.HtmlDisplayableDatatypeHandler#toHtmlSummary(org.openmrs.customdatatype.CustomDatatype,
  • * java.lang.String)
  • */
  • @OverRide
  • public CustomDatatype.Summary toHtmlSummary(CustomDatatype datatype, String valueReference) {
  •   SerializingCustomDatatype<T> dt = (SerializingCustomDatatype<T>) datatype;
    
  •   return new CustomDatatype.Summary(dt.deserialize(valueReference).getName(), true);
    

@djazayeri https://github.com/djazayeri would you consider this to be
the complete HTML summary? Or complete will include the description?


Reply to this email directly or view it on GitHubhttps://github.com//pull/399/files#r7223969
.

@dkayiwa
Copy link
Member

dkayiwa commented Jan 23, 2014

Closing because author abandoned it.

@dkayiwa dkayiwa closed this Jan 23, 2014
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants