当前位置: 首页>>代码示例>>Java>>正文


Java EntityProvider.writeServiceDocument方法代码示例

本文整理汇总了Java中org.apache.olingo.odata2.api.ep.EntityProvider.writeServiceDocument方法的典型用法代码示例。如果您正苦于以下问题:Java EntityProvider.writeServiceDocument方法的具体用法?Java EntityProvider.writeServiceDocument怎么用?Java EntityProvider.writeServiceDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.olingo.odata2.api.ep.EntityProvider的用法示例。


在下文中一共展示了EntityProvider.writeServiceDocument方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readServiceDocument

import org.apache.olingo.odata2.api.ep.EntityProvider; //导入方法依赖的package包/类
/**
 * @see ServiceDocumentProcessor
 */
@Override
public ODataResponse readServiceDocument(final GetServiceDocumentUriInfo uriInfo, final String contentType)
    throws ODataException {
  final Edm edm = getContext().getService().getEntityDataModel();

  //Service Document has version 1.0 specifically
  if ("HEAD".equals(getContext().getHttpMethod())) {
    return ODataResponse.header(ODataHttpHeaders.DATASERVICEVERSION, ODataServiceVersion.V10).build();
  } else {
    final String serviceRoot = getContext().getPathInfo().getServiceRoot().toASCIIString();
    final ODataResponse response = EntityProvider.writeServiceDocument(contentType, edm, serviceRoot);
    return ODataResponse.fromResponse(response)
        .header(ODataHttpHeaders.DATASERVICEVERSION, ODataServiceVersion.V10).build();
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:19,代码来源:ODataSingleProcessor.java

示例2: readServiceDocument

import org.apache.olingo.odata2.api.ep.EntityProvider; //导入方法依赖的package包/类
@Override
public ODataResponse readServiceDocument(GetServiceDocumentUriInfo uri_info, String content_type)
      throws ODataException
{
   Edm edm = new EdmWrapper(getContext().getService().getEntityDataModel());
   return EntityProvider.writeServiceDocument(content_type, edm, ServiceFactory.ROOT_URL);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:8,代码来源:Processor.java

示例3: testServiceDocumentXml

import org.apache.olingo.odata2.api.ep.EntityProvider; //导入方法依赖的package包/类
@Test
public void testServiceDocumentXml() throws EntityProviderException, ODataException {
  ODataResponse response =
      EntityProvider.writeServiceDocument(HttpContentType.APPLICATION_ATOM_XML, edm, "http://localhost/");

  assertNull("EntityProvider should not set content header", response.getContentHeader());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:8,代码来源:ServiceDocumentProducerTest.java

示例4: writeEmptyServiceDocumentOverRuntimeDelegate

import org.apache.olingo.odata2.api.ep.EntityProvider; //导入方法依赖的package包/类
@Test
public void writeEmptyServiceDocumentOverRuntimeDelegate() throws Exception {
  ODataResponse response =
      EntityProvider.writeServiceDocument(HttpContentType.APPLICATION_ATOM_XML, edm, "http://localhost");
  String xmlString = verifyResponse(response);

  assertXpathExists("/a:service", xmlString);
  assertXpathExists("/a:service/a:workspace", xmlString);
  assertXpathExists("/a:service/a:workspace/atom:title", xmlString);
  assertXpathEvaluatesTo("Default", "/a:service/a:workspace/atom:title", xmlString);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:12,代码来源:AtomServiceDocumentProducerTest.java


注:本文中的org.apache.olingo.odata2.api.ep.EntityProvider.writeServiceDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。