public static ExpandItem getExpandAll(final ExpandOption expand) { for (final ExpandItem item : expand.getExpandItems()) { if (item.isStar()) { return item; } } return null; }
public static ExpandItem getExpandAll(final ExpandOption expand) { for (final ExpandItem item : expand.getExpandItems()) { if (item.isStar()) { return item; } } return null; }
public static ExpandItem getExpandItem(final List<ExpandItem> expandItems, final String propertyName) { for (final ExpandItem item : expandItems) { if (item.isStar()) { continue; } final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); UriResource resource = null; if (resourceParts.get(resourceParts.size() - 1) instanceof UriResourceRef || resourceParts.get(resourceParts.size() - 1) instanceof UriResourceCount) { resource = resourceParts.get(resourceParts.size() - 2); } else { resource = resourceParts.get(resourceParts.size() - 1); } if ((resource instanceof UriResourceNavigation && propertyName.equals(((UriResourceNavigation) resource).getProperty().getName())) || resource instanceof UriResourceProperty && propertyName.equals(((UriResourceProperty) resource).getProperty().getName())) { return item; } } return null; }
public static ExpandItem getExpandItem(final List<ExpandItem> expandItems, final String propertyName) { for (final ExpandItem item : expandItems) { if (item.isStar()) { continue; } final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); UriResource resource = null; if (resourceParts.get(resourceParts.size() - 1) instanceof UriResourceRef || resourceParts.get(resourceParts.size() - 1) instanceof UriResourceCount) { resource = resourceParts.get(resourceParts.size() - 2); } else { resource = resourceParts.get(resourceParts.size() - 1); } if ((resource instanceof UriResourceNavigation && propertyName.equals(((UriResourceNavigation) resource).getProperty().getName())) || resource instanceof UriResourceProperty && propertyName.equals(((UriResourceProperty) resource).getProperty().getName())) { return item; } } return null; }
public static Set<List<String>> getExpandedItemsPath(ExpandOption expand) { Set<List<String>> expandPaths = new HashSet<List<String>>(); if (expand != null) { List<ExpandItem> expandItems = expand.getExpandItems(); for (ExpandItem item : expandItems) { if (item.isStar()) { continue; } List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); if (resourceParts.get(0) instanceof UriResourceComplexProperty) { List<String> path = new ArrayList<String>(); for (UriResource resource : resourceParts) { if (resource instanceof UriResourceNavigation) { path.add(((UriResourceNavigation) resource).getProperty().getName()); } else if (resource instanceof UriResourceProperty) { path.add(((UriResourceProperty) resource).getProperty().getName()); } } expandPaths.add(path); } } } return expandPaths; }
for (final ExpandItem item : expandItems) { boolean matched = false; if (item.isStar()) { continue;
public static Set<List<String>> getExpandedItemsPath(ExpandOption expand) { Set<List<String>> expandPaths = new HashSet<List<String>>(); if (expand != null) { List<ExpandItem> expandItems = expand.getExpandItems(); for (ExpandItem item : expandItems) { if (item.isStar()) { continue; } List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); if (resourceParts.get(0) instanceof UriResourceComplexProperty) { List<String> path = new ArrayList<String>(); for (UriResource resource : resourceParts) { if (resource instanceof UriResourceNavigation) { path.add(((UriResourceNavigation) resource).getProperty().getName()); } else if (resource instanceof UriResourceProperty) { path.add(((UriResourceProperty) resource).getProperty().getName()); } } expandPaths.add(path); } } } return expandPaths; }
for (final ExpandItem item : expandItems) { boolean matched = false; if (item.isStar()) { continue;
private void appendExpandItemJson(final JsonGenerator gen, final ExpandItem item) throws IOException { gen.writeStartObject(); if (item.isStar()) { gen.writeBooleanField("star", item.isStar()); } else if (item.getResourcePath() != null && !item.getResourcePath().getUriResourceParts().isEmpty()) { gen.writeFieldName("expandPath"); appendURIResourceParts(gen, item.getResourcePath().getUriResourceParts()); } if (item.isRef()) { gen.writeBooleanField("isRef", item.isRef()); } if (item.getLevelsOption() != null) { gen.writeFieldName("levels"); if (item.getLevelsOption().isMax()) { gen.writeString("max"); } else { gen.writeNumber(item.getLevelsOption().getValue()); } } appendCommonJsonObjects(gen, item.getCountOption(), item.getSkipOption(), item.getTopOption(), item.getFilterOption(), item.getOrderByOption(), item.getSelectOption(), item.getExpandOption(), item.getSearchOption(), item.getApplyOption()); gen.writeEndObject(); }
if (item.isStar()) { final EdmEntitySet edmEntitySet = determineTargetEntitySet(startResourceList); try {
private void checkForUnimplementedFeaturesWithinExpand(List<ExpandItem> expandItems,ODataRequest request) throws CDSRuntimeException { for(ExpandItem expandItem : expandItems) { CDSRuntimeException cdsRuntimeException; if((expandItem).getCountOption() != null){ cdsRuntimeException = new CDSRuntimeException(CDSRuntimeException.MessageKeys.NOT_IMPLEMENTED, "$count in expand is not implemented", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), HeaderUtil.getlocale(request), "$count in Expand"); logger.error("$count system query option is not implemented", cdsRuntimeException); throw cdsRuntimeException; } if(expandItem.getLevelsOption() != null){ cdsRuntimeException = new CDSRuntimeException(CDSRuntimeException.MessageKeys.NOT_IMPLEMENTED, "$level in expand is not implemented", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), HeaderUtil.getlocale(request), "$level in Expand"); logger.error("$levels option is not implemented", cdsRuntimeException); throw cdsRuntimeException; } if(expandItem.isStar()){ cdsRuntimeException = new CDSRuntimeException(CDSRuntimeException.MessageKeys.NOT_IMPLEMENTED, "$expand=* in Expand not mplemented", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), HeaderUtil.getlocale(request), "$expand=* in Expand"); logger.error("$expand=* option is not implemented", cdsRuntimeException); throw cdsRuntimeException; } } }
private void appendExpandItemJson(final JsonGenerator gen, final ExpandItem item) throws IOException { gen.writeStartObject(); if (item.isStar()) { gen.writeBooleanField("star", item.isStar()); } else if (item.getResourcePath() != null && !item.getResourcePath().getUriResourceParts().isEmpty()) { gen.writeFieldName("expandPath"); appendURIResourceParts(gen, item.getResourcePath().getUriResourceParts()); } if (item.isRef()) { gen.writeBooleanField("isRef", item.isRef()); } if (item.getLevelsOption() != null) { gen.writeFieldName("levels"); if (item.getLevelsOption().isMax()) { gen.writeString("max"); } else { gen.writeNumber(item.getLevelsOption().getValue()); } } appendCommonJsonObjects(gen, item.getCountOption(), item.getSkipOption(), item.getTopOption(), item.getFilterOption(), item.getOrderByOption(), item.getSelectOption(), item.getExpandOption(), item.getSearchOption(), item.getApplyOption()); gen.writeEndObject(); }
List<ExpandItem> expandItems = expandOption.getExpandItems(); for (ExpandItem expandItem : expandItems) { if (expandItem.isStar()) { List<EdmNavigationPropertyBinding> bindings = edmEntitySet.getNavigationPropertyBindings();
EdmNavigationProperty property = esb.getNavigationProperty(); if (property == null) { if (ei.isStar()) { if (starLevels > 0) { throw new TeiidProcessingException(