Sapui5 使用Eclipse中的OData
我一直在用文档练习SAPUI5,但他们使用SAPWebIDE来使用OData服务。然而,因为我的公司不会将他们的服务器公开给云,所以我不能使用SAP Web IDE,所以我需要使用eclipse。我需要一个使用eclipse中的SAPUI5逐步使用OData的教程(针对傻瓜)。我已经知道如何创建它们,但不知道如何从eclipse中使用它们 我使用Northwind的OData服务,但在SAP中,我需要凭据和其他东西Sapui5 使用Eclipse中的OData,sapui5,sap-web-ide,Sapui5,Sap Web Ide,我一直在用文档练习SAPUI5,但他们使用SAPWebIDE来使用OData服务。然而,因为我的公司不会将他们的服务器公开给云,所以我不能使用SAP Web IDE,所以我需要使用eclipse。我需要一个使用eclipse中的SAPUI5逐步使用OData的教程(针对傻瓜)。我已经知道如何创建它们,但不知道如何从eclipse中使用它们 我使用Northwind的OData服务,但在SAP中,我需要凭据和其他东西 "dataSources": { "invoiceRemote": {
"dataSources": {
"invoiceRemote": {
"uri": "https://services.odata.org/V2/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
}
我会给你一些光,但不是一个完整的教程 在eclipse中工作与在WebIDE中工作并没有什么不同。 首先,您需要使用JSONModel()。你可以找到参考资料 创建一个JSONModel对象,然后使用该方法。 对于sURL使用(在您的示例中): “?$format=json” 然后,你会有你的小田在你的前端。现在您只需要学习如何在视图元素中使用它。你可以学习它 如果您需要进一步的解释,请提出小而具体的问题,以便更容易根据您的需要回答 […]因为他们不会向云公开他们的服务器,所以我不能使用SAP Web IDE 基于clould的Web IDE的另一个替代方案是,您可以在本地计算机上部署它,但仍然在浏览器(localhost)中运行。创建一个对应的连接到远程系统,其余的与云上旧的基于Orion的WebIDE几乎相同 这是来自(例如Northwind)的服务的目标文件
否则,如果您想坚持使用eclipse,请查看文档主题
- 及其基本主题
//between sap.app key you put this:
"dataSources": {
"mainService": {
"uri": "/northwind/V2/OData/OData.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0",
"localUri": "localService/metadata.xml"
}
}
}
...
// this can be empty the if your using more than two just one can be empty
"": {
"dataSource": "mainService",
"preload": true
}
在我看来,我将使用以下数据:
<List
id="list"
items="{
path: '/Categories',
sorter: {
path: 'Name',
descending: false
},
groupHeaderFactory: '.createGroupHeader'
}"
busyIndicatorDelay="{masterView>/delay}"
noDataText="{masterView>/noDataText}"
mode="{= ${device>/system/phone} ? 'None' : 'SingleSelectMaster'}"
growing="true"
growingScrollToLoad="true"
updateFinished="onUpdateFinished"
selectionChange="onSelectionChange">
<infoToolbar>
<Toolbar
active="true"
id="filterBar"
visible="{masterView>/isFilterBarVisible}"
press="onOpenViewSettings">
<Title
id="filterBarLabel"
text="{masterView>/filterBarLabel}" />
</Toolbar>
</infoToolbar>
<items>
<ObjectListItem
type="Active"
press="onSelectionChange"
title="{Name}">
</ObjectListItem>
</items>
</List>
如果您要使用和使用odata made for YOUR或消费,只需将url粘贴到yo key dataSource的属性“uri”中(如下所示:“不要担心,这个url是您可以在yo/IWFND/MAINT_服务时看到的),并且当您已经部署它时,只需将uri保留为您创建的odata_SRV的/sap/opu/odata/sap/ZNAME_即可,是的,我知道sap web ide和personal edition,但在我的公司中,不会安装从ide查看服务器所需的sap cloud connector,因此我必须使用eclipse:C@NaotoAmari这就是个人版的全部要点。您保留本地服务,并仅通过目标文件连接它们。您的公司不需要安装Cloud Connector。请按照我的答案中链接的文档进行操作。本周我将尝试让您知道,谢谢!部署的过程是什么?@NaotoAmari我还没有从个人版进行任何部署,但过程应该是相同的:。也要检查一下。如果您遇到问题,可能会有所帮助。@NaotoAmari那么,您现在正在使用Web IDE个人版吗?进展如何?根据您的建议,它似乎工作正常。如中所建议的,在这种情况下,请使用SAP Web IDE个人版。用于Eclipse的SAPUI5工具现在正式被弃用。
<List
id="list"
items="{
path: '/Categories',
sorter: {
path: 'Name',
descending: false
},
groupHeaderFactory: '.createGroupHeader'
}"
busyIndicatorDelay="{masterView>/delay}"
noDataText="{masterView>/noDataText}"
mode="{= ${device>/system/phone} ? 'None' : 'SingleSelectMaster'}"
growing="true"
growingScrollToLoad="true"
updateFinished="onUpdateFinished"
selectionChange="onSelectionChange">
<infoToolbar>
<Toolbar
active="true"
id="filterBar"
visible="{masterView>/isFilterBarVisible}"
press="onOpenViewSettings">
<Title
id="filterBarLabel"
text="{masterView>/filterBarLabel}" />
</Toolbar>
</infoToolbar>
<items>
<ObjectListItem
type="Active"
press="onSelectionChange"
title="{Name}">
</ObjectListItem>
</items>
</List>