Examples of WriteEntryCallbackContext


Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

public class JPAExpandCallBackTest {

  @Test
  public void testRetrieveEntryResult() {
    JPAExpandCallBack callBack = getJPAExpandCallBackObject();
    WriteEntryCallbackContext writeFeedContext = EdmMockUtil.getWriteEntryCallBackContext();
    try {
      Field field = callBack.getClass().getDeclaredField("nextEntitySet");
      field.setAccessible(true);
      field.set(callBack, EdmMockUtil.mockTargetEntitySet());
      WriteEntryCallbackResult result = callBack.retrieveEntryResult(writeFeedContext);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

    final EdmNavigationProperty navigationProperty = (EdmNavigationProperty) type.getProperty(navigationPropertyName);
    final boolean isFeed = navigationProperty.getMultiplicity() == EdmMultiplicity.MANY;
    final EdmEntitySet entitySet = entityInfo.getEntitySet();
    final EdmEntitySet inlineEntitySet = entitySet.getRelatedEntitySet(navigationProperty);

    WriteCallbackContext context = isFeed ? new WriteFeedCallbackContext() : new WriteEntryCallbackContext();
    context.setSourceEntitySet(entitySet);
    context.setNavigationProperty(navigationProperty);
    context.setEntryData(data);
    context.setCurrentExpandSelectTreeNode(properties.getExpandSelectTree().getLinks().get(
        navigationPropertyName));
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

    if (eia.getExpandedNavigationPropertyNames().contains(navigationPropertyName)) {
      if (properties.getCallbacks() != null && properties.getCallbacks().containsKey(navigationPropertyName)) {
        writer.writeStartElement(Edm.NAMESPACE_M_2007_08, FormatXml.M_INLINE);

        EdmNavigationProperty navProp = (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
        WriteEntryCallbackContext context = new WriteEntryCallbackContext();
        context.setSourceEntitySet(eia.getEntitySet());
        context.setNavigationProperty(navProp);
        context.setEntryData(data);
        ExpandSelectTreeNode subNode = properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
        context.setCurrentExpandSelectTreeNode(subNode);

        ODataCallback callback = properties.getCallbacks().get(navigationPropertyName);
        if (callback == null) {
          throw new EntityProviderException(EntityProviderException.EXPANDNOTSUPPORTED);
        }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

    if (eia.getExpandedNavigationPropertyNames().contains(navigationPropertyName)) {
      if (properties.getCallbacks() != null && properties.getCallbacks().containsKey(navigationPropertyName)) {
        writer.writeStartElement(Edm.NAMESPACE_M_2007_08, FormatXml.M_INLINE);

        EdmNavigationProperty navProp = (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
        WriteEntryCallbackContext context = new WriteEntryCallbackContext();
        context.setSourceEntitySet(eia.getEntitySet());
        context.setNavigationProperty(navProp);
        context.setEntryData(data);
        ExpandSelectTreeNode subNode = properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
        context.setCurrentExpandSelectTreeNode(subNode);

        ODataCallback callback = properties.getCallbacks().get(navigationPropertyName);
        if (callback == null) {
          throw new EntityProviderException(EntityProviderException.EXPANDNOTSUPPORTED);
        }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

    return writeContext;
  }

  public static WriteEntryCallbackContext getWriteEntryCallBackContext() {
    WriteEntryCallbackContext writeContext = new WriteEntryCallbackContext();
    writeContext.setCurrentExpandSelectTreeNode(mockCurrentExpandSelectTreeNode());
    writeContext.setNavigationProperty(mockNavigationProperty());
    writeContext.setSourceEntitySet(mockSourceEntitySet());
    writeContext.setEntryData(getEntryData());
    return writeContext;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

    final EdmNavigationProperty navigationProperty = (EdmNavigationProperty) type.getProperty(navigationPropertyName);
    final boolean isFeed = navigationProperty.getMultiplicity() == EdmMultiplicity.MANY;
    final EdmEntitySet entitySet = entityInfo.getEntitySet();
    final EdmEntitySet inlineEntitySet = entitySet.getRelatedEntitySet(navigationProperty);

    WriteCallbackContext context = isFeed ? new WriteFeedCallbackContext() : new WriteEntryCallbackContext();
    context.setSourceEntitySet(entitySet);
    context.setNavigationProperty(navigationProperty);
    context.setEntryData(data);
    context.setCurrentExpandSelectTreeNode(properties.getExpandSelectTree().getLinks().get(
        navigationPropertyName));
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

public class JPAExpandCallBackTest {

  @Test
  public void testRetrieveEntryResult() {
    JPAExpandCallBack callBack = getJPAExpandCallBackObject();
    WriteEntryCallbackContext writeFeedContext = EdmMockUtil.getWriteEntryCallBackContext();
    try {
      Field field = callBack.getClass().getDeclaredField("nextEntitySet");
      field.setAccessible(true);
      field.set(callBack, EdmMockUtil.mockTargetEntitySet());
      WriteEntryCallbackResult result = callBack.retrieveEntryResult(writeFeedContext);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

                  (EdmNavigationProperty) type.getProperty(navigationPropertyName);
              final boolean isFeed = navigationProperty.getMultiplicity() == EdmMultiplicity.MANY;
              final EdmEntitySet entitySet = entityInfo.getEntitySet();
              final EdmEntitySet inlineEntitySet = entitySet.getRelatedEntitySet(navigationProperty);

              WriteCallbackContext context = isFeed ? new WriteFeedCallbackContext() : new WriteEntryCallbackContext();
              context.setSourceEntitySet(entitySet);
              context.setNavigationProperty(navigationProperty);
              context.setEntryData(data);
              context.setCurrentExpandSelectTreeNode(properties.getExpandSelectTree().getLinks().get(
                  navigationPropertyName));
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

public class JPAExpandCallBackTest {

  @Test
  public void testRetrieveEntryResult() {
    JPAExpandCallBack callBack = getJPAExpandCallBackObject();
    WriteEntryCallbackContext writeFeedContext = EdmMockUtil.getWriteEntryCallBackContext();
    try {
      Field field = callBack.getClass().getDeclaredField("nextEntitySet");
      field.setAccessible(true);
      field.set(callBack, EdmMockUtil.mockTargetEntitySet());
      WriteEntryCallbackResult result = callBack.retrieveEntryResult(writeFeedContext);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.WriteEntryCallbackContext

    if (eia.getExpandedNavigationPropertyNames().contains(navigationPropertyName)) {
      if (properties.getCallbacks() != null && properties.getCallbacks().containsKey(navigationPropertyName)) {
        writer.writeStartElement(Edm.NAMESPACE_M_2007_08, FormatXml.M_INLINE);

        EdmNavigationProperty navProp = (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
        WriteEntryCallbackContext context = new WriteEntryCallbackContext();
        context.setSourceEntitySet(eia.getEntitySet());
        context.setNavigationProperty(navProp);
        context.setEntryData(data);
        ExpandSelectTreeNode subNode = properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
        context.setCurrentExpandSelectTreeNode(subNode);

        ODataCallback callback = properties.getCallbacks().get(navigationPropertyName);
        if (callback == null) {
          throw new EntityProviderException(EntityProviderException.EXPANDNOTSUPPORTED);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.