use of com.servoy.j2db.server.ngclient.IServoyDataConverterContext in project servoy-client by Servoy.
the class MediaPropertyType method wrap.
@Override
public MediaWrapper wrap(Object value, MediaWrapper previousValue, PropertyDescription propertyDescription, IWrappingContext dataConverterContext) {
if (previousValue != null && Utils.equalObjects(value, previousValue.mediaUrl)) {
return previousValue;
}
IServoyDataConverterContext servoyDataConverterContext = ((IContextProvider) dataConverterContext.getWebObject()).getDataConverterContext();
FlattenedSolution flattenedSolution = servoyDataConverterContext.getSolution();
INGApplication application = servoyDataConverterContext.getApplication();
String url = getMediaUrl(value, flattenedSolution, application);
if (url != null)
return new MediaWrapper(value, url);
if (value != null && !Utils.equalObjects(value, Integer.valueOf(0)))
Debug.log("cannot convert media " + value + " using converter context " + servoyDataConverterContext);
return null;
}
Aggregations