Package org.apache.olingo.odata2.api.uri

Examples of org.apache.olingo.odata2.api.uri.ExpandSelectTreeNode$ExpandSelectTreeNodeBuilder


    assertEquals("1", properties.get("Id"));
    assertEquals("Room 1", properties.get("Name"));
    assertEquals((short) 1, properties.get("Seats"));
    assertEquals((short) 1, properties.get("Version"));
    //
    ExpandSelectTreeNode expandTree = entry.getExpandSelectTree();
    assertNotNull(expandTree);

    ODataEntry inlineBuilding = (ODataEntry) properties.get("nr_Building");
    Map<String, Object> inlineBuildingProps = inlineBuilding.getProperties();
    assertEquals("1", inlineBuildingProps.get("Id"));
View Full Code Here


    Map<String, Object> properties = entry.getProperties();
    assertEquals("1", properties.get("Id"));
    assertEquals("Team 1", properties.get("Name"));
    assertEquals(Boolean.FALSE, properties.get("isScrumTeam"));
    //
    ExpandSelectTreeNode expandTree = entry.getExpandSelectTree();
    assertNotNull(expandTree);
    // TODO: do more testing here
    //
    ODataFeed employeesFeed = (ODataFeed) properties.get("nt_Employees");
    List<ODataEntry> employees = employeesFeed.getEntries();
View Full Code Here

  public void testGetCallbacks() {
    Map<String, ODataCallback> callBacks = null;
    try {
      URI baseUri =
          new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/");
      ExpandSelectTreeNode expandSelectTreeNode = EdmMockUtil.mockExpandSelectTreeNode();
      List<ArrayList<NavigationPropertySegment>> expandList = EdmMockUtil.getExpandList();
      callBacks = JPAExpandCallBack.getCallbacks(baseUri, expandSelectTreeNode, expandList);
    } catch (URISyntaxException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    } catch (EdmException e) {
View Full Code Here

  private JPAExpandCallBack getJPAExpandCallBackObject() {
    Map<String, ODataCallback> callBacks = null;
    try {
      URI baseUri =
          new URI("http://localhost:8080/org.apache.olingo.odata2.processor.ref.web/SalesOrderProcessing.svc/");
      ExpandSelectTreeNode expandSelectTreeNode = EdmMockUtil.mockExpandSelectTreeNode();
      List<ArrayList<NavigationPropertySegment>> expandList = EdmMockUtil.getExpandList();
      callBacks = JPAExpandCallBack.getCallbacks(baseUri, expandSelectTreeNode, expandList);
    } catch (URISyntaxException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    } catch (EdmException e) {
View Full Code Here

    }
    writer.append("</li>\n");
    if (!expandSelect.getLinks().isEmpty()) {
      for (final String name : expandSelect.getLinks().keySet()) {
        writer.append("<li>link <span class=\"link\">").append(name).append("</span>");
        final ExpandSelectTreeNode link = expandSelect.getLinks().get(name);
        if (link != null) {
          writer.append('\n');
          appendExpandSelect(link, writer);
        }
        writer.append("</li>\n");
View Full Code Here

    HashMap<String, Object> inlinedEntry = (HashMap<String, Object>) context.getEntryData();
    List<Map<String, Object>> edmEntityList = new ArrayList<Map<String, Object>>();
    JPAEntityParser jpaResultParser = new JPAEntityParser();
    List<EdmNavigationProperty> currentNavPropertyList = null;
    EdmNavigationProperty currentNavigationProperty = context.getNavigationProperty();
    ExpandSelectTreeNode currentExpandTreeNode = context.getCurrentExpandSelectTreeNode();

    try {
      @SuppressWarnings({ "unchecked" })
      Collection<Object> listOfItems = (Collection<Object>) inlinedEntry.get(context.getNavigationProperty().getName());
      if (nextEntitySet == null) {
        nextEntitySet = context.getSourceEntitySet().getRelatedEntitySet(currentNavigationProperty);
      }
      if (currentExpandTreeNode.getProperties().size() > 0) {
        edmEntityList =
            jpaResultParser.parse2EdmEntityList(listOfItems, getEdmProperties(nextEntitySet,
                currentExpandTreeNode));
      } else {
        edmEntityList = jpaResultParser.parse2EdmEntityList(listOfItems, nextEntitySet.getEntityType());
      }
      result.setFeedData(edmEntityList);

      if (currentExpandTreeNode.getLinks().size() > 0) {
        currentNavPropertyList = new ArrayList<EdmNavigationProperty>();
        EdmNavigationProperty nextNavProperty =
            getNextNavigationProperty(context.getSourceEntitySet().getEntityType(), context.getNavigationProperty());
        if (nextNavProperty != null) {
          currentNavPropertyList.add(nextNavProperty);
View Full Code Here

            + "$skiptoken=" + odataJPAContext.getPaging().getNextPage();
        entityFeedPropertiesBuilder.nextLink(nextLink);
      }
      entityFeedPropertiesBuilder.inlineCount(count);
      entityFeedPropertiesBuilder.inlineCountType(resultsView.getInlineCount());
      ExpandSelectTreeNode expandSelectTree =
          UriParser.createExpandSelectTree(resultsView.getSelect(), resultsView.getExpand());

      Map<String, ODataCallback> expandCallBack =
          JPAExpandCallBack.getCallbacks(serviceRoot, expandSelectTree, resultsView.getExpand());
View Full Code Here

  }

  private static EntityProviderWriteProperties getEntityProviderProperties(final ODataJPAContext odataJPAContext,
      final GetEntityUriInfo resultsView) throws ODataJPARuntimeException {
    ODataEntityProviderPropertiesBuilder entityFeedPropertiesBuilder = null;
    ExpandSelectTreeNode expandSelectTree = null;
    try {
      entityFeedPropertiesBuilder =
          EntityProviderWriteProperties.serviceRoot(odataJPAContext.getODataContext().getPathInfo().getServiceRoot());
      expandSelectTree = UriParser.createExpandSelectTree(resultsView.getSelect(), resultsView.getExpand());
      entityFeedPropertiesBuilder.expandSelectTree(expandSelectTree);
View Full Code Here

  @Test
  public void buildPropertiesDefaults() throws Exception {
    URI serviceRoot = new URI("http://localhost:80/");
    Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
    callbacks.put("aCallback", new MyCallback(null, null));
    ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
    URI selfLink = new URI("http://some.uri");
    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
    links.put("aNavigationProperty", Collections.<String, Object> emptyMap());
    final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
        .callbacks(callbacks)
View Full Code Here

  @Test
  public void buildEntryPropertiesFromExisting() throws Exception {
    URI serviceRoot = new URI("http://localhost:80/");
    Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
    callbacks.put("aCallback", new MyCallback(null, null));
    ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
    URI selfLink = new URI("http://some.uri");
    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
    links.put("aNavigationProperty", Collections.<String, Object> emptyMap());
    final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
        .callbacks(callbacks)
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.uri.ExpandSelectTreeNode$ExpandSelectTreeNodeBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.