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

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


    EdmEntitySet roomsSet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
    List<String> selectedNavigationProperties = new ArrayList<String>();
    selectedNavigationProperties.add("nr_Building");
    selectedNavigationProperties.add("nr_Employees");

    ExpandSelectTreeNode expandSelectTree =
        ExpandSelectTreeNode.entitySet(roomsSet).selectedLinks(selectedNavigationProperties).build();

    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.fromProperties(DEFAULT_PROPERTIES).expandSelectTree(expandSelectTree).build();
    ODataResponse entry = EntityProvider.writeEntry("application/xml", roomsSet, roomData, properties);
View Full Code Here


    selectedNavigationProperties.add("nr_Building");

    List<String> selectedProperties = new ArrayList<String>();
    selectedProperties.add("Id");

    ExpandSelectTreeNode expandSelectTree =
        ExpandSelectTreeNode.entitySet(roomsSet).selectedProperties(selectedProperties).selectedLinks(
            selectedNavigationProperties).build();

    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.fromProperties(DEFAULT_PROPERTIES).expandSelectTree(expandSelectTree).build();
View Full Code Here

  public void expandBuilding() throws Exception {
    EdmEntitySet roomsSet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
    List<String> expandedNavigationProperties = new ArrayList<String>();
    expandedNavigationProperties.add("nr_Building");

    ExpandSelectTreeNode expandSelectTree =
        ExpandSelectTreeNode.entitySet(roomsSet).expandedLinks(expandedNavigationProperties).build();

    Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
    callbacks.put("nr_Building", new LocalCallback());
    EntityProviderWriteProperties properties =
View Full Code Here

    expandedNavigationProperties.add("nr_Building");

    List<String> selectedProperties = new ArrayList<String>();
    selectedProperties.add("Id");

    ExpandSelectTreeNode expandSelectTree =
        ExpandSelectTreeNode.entitySet(roomsSet).selectedProperties(selectedProperties).expandedLinks(
            expandedNavigationProperties).build();

    Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
    callbacks.put("nr_Building", new LocalCallback());
View Full Code Here

    List<String> selectedPropertiesAtCustomProperties = new ArrayList<String>();
    selectedPropertiesAtCustomProperties.add("Id");
    EdmEntitySet buildingsSet =
        roomsSet.getRelatedEntitySet((EdmNavigationProperty) roomsSet.getEntityType().getProperty("nr_Building"));
    ExpandSelectTreeNode customNode =
        ExpandSelectTreeNode.entitySet(buildingsSet).selectedProperties(selectedPropertiesAtCustomProperties).build();

    ExpandSelectTreeNode expandSelectTree =
        ExpandSelectTreeNode.entitySet(roomsSet).customExpandedLink("nr_Building", customNode).build();

    Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
    callbacks.put("nr_Building", new LocalCallback());
    EntityProviderWriteProperties properties =
View Full Code Here

    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

  @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");
    final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
        .callbacks(callbacks)
        .expandSelectTree(expandSelectTree)
        .inlineCount(1)
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");
    final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
        .callbacks(callbacks)
        .expandSelectTree(expandSelectTree)
        .inlineCount(1)
View Full Code Here

    edm = MockFacade.getMockEdm();
  }

  @Test
  public void initialBuildWithOnlyEntitySet() throws Exception {
    ExpandSelectTreeNode node = ExpandSelectTreeNode.entitySet(mock(EdmEntitySet.class)).build();
    assertNotNull(node);
    assertTrue(node.isAll());
    assertTrue(node.getProperties().isEmpty());
    assertTrue(node.getLinks().isEmpty());
  }
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.