private void appendAtomContentLink(final XMLStreamWriter writer, final EntityInfoAggregator eia, final Map<String, Object> data, final String selfLink) throws EntityProviderException, EdmException { try { String mediaResourceMimeType = properties.getMediaResourceMimeType(); if (mediaResourceMimeType == null) { EdmMapping entityTypeMapping = eia.getEntityType().getMapping(); if (entityTypeMapping != null) { String mediaResourceMimeTypeKey = entityTypeMapping.getMediaResourceMimeTypeKey(); if (mediaResourceMimeTypeKey != null) { mediaResourceMimeType = (String) data.get(mediaResourceMimeTypeKey); } } if (mediaResourceMimeType == null) { mediaResourceMimeType = ContentType.APPLICATION_OCTET_STREAM.toString(); } } writer.writeStartElement(FormatXml.ATOM_LINK); writer.writeAttribute(FormatXml.ATOM_HREF, selfLink + "/$value"); writer.writeAttribute(FormatXml.ATOM_REL, Edm.LINK_REL_EDIT_MEDIA); writer.writeAttribute(FormatXml.ATOM_TYPE, mediaResourceMimeType); writer.writeEndElement(); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.COMMON, e); } }
String mediaResourceMimeType = properties.getMediaResourceMimeType(); EdmMapping entityTypeMapping = eia.getEntityType().getMapping(); String self = null;
public ODataEntityProviderPropertiesBuilder fromProperties(final EntityProviderWriteProperties properties) { this.properties.mediaResourceMimeType = properties.getMediaResourceMimeType(); this.properties.inlineCountType = properties.getInlineCountType(); this.properties.inlineCount = properties.getInlineCount(); this.properties.nextLink = properties.getNextLink(); this.properties.expandSelectTree = properties.getExpandSelectTree(); this.properties.callbacks = properties.getCallbacks(); this.properties.selfLink = properties.getSelfLink(); this.properties.includeSimplePropertyType = properties.includeSimplePropertyType; return this; } }
String mediaResourceMimeType = properties.getMediaResourceMimeType(); EdmMapping entityTypeMapping = entityInfo.getEntityType().getMapping(); String mediaSrc = null;