-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Trunk 3499 #399
Conversation
…BaseMetadataFieldGenDatatypeHandler
import org.openmrs.messagesource.MessageSourceService; | ||
|
||
/** | ||
* This is a superclass for associated handlers of custom datatypes |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
Closing because author abandoned it. |
https://tickets.openmrs.org/browse/TRUNK-3986 [Support more CustomDatatypes and their associated CustomDatatypeHandlers]