-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathReadme.txt
More file actions
112 lines (75 loc) · 4.12 KB
/
Readme.txt
File metadata and controls
112 lines (75 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
InitialSetupReadme.txt file has initial setup
==============================================
How to run:
==============================================
1) mvn clean install
builds jar file
2)
// spark : not using spark anymore
// heroku local web -p 8991 (this set PORT env variable)
tomcat:
target\bin\webapp.bat
==============================================
How it works: local
==============================================
1) .env files stores all variable which are avialble via System.getenv
** ONLY APPLIES TO LOCAL : heroku local web -p 9000 **
2) system.propties determines which version of JRE to use
*** ONLY APPLIES TO SERVER ***
3) pom.xml has build is plugin is used by heroku
-> build will generate the odata.jar file
-> this jar file has main class which is com.spring.heroku.odata.SparkMain
-> procFile which is read by Heroku has entry to execute odata.jar file
so heroku local or server
reads Procfile -> reads Jar -> Jar has Main file which runs spark jetty
==============================================
How it works: server
==============================================
Just Commit. It picks up from Procfile
==============================================
Salesforce Configuration
==============================================
Create external data source with : http://odata-cshah.herokuapp.com/odata.svc
if you want to view all supported operations : http://odata-cshah.herokuapp.com/odata.svc/$metadata
Click on sync, and it will automatically create all the external objects with their fields.
==============================================
How it works: ODATA 4.0
==============================================
-root (e.g. http://www.odata.org/getting-started/basic-tutorial/#modifyData)
http://services.odata.org/V4/Northwind/Northwind.svc/
-lists all services supported and their metadata, pick one and use next
http://services.odata.org/V4/Northwind/Northwind.svc/$metadata
Note: same line, attribute, new line, element
Note: We can have all entity container in one schema and entity type in other, and a lot more other combination.
DataServices
Schema (*) : Namespace
EntityType(*) : Name
Property (Name, Type)
Key (PropertyRef)
EntityContainer (*) : Name
EntitySet(*) : Name, EntityType = "Schema.EntityType"
In code we implement : DemoEdmProvider
getEntityContainerInfo() : when we click on http://localhost:8080/odata.svc/ (root document)
getSchemas() The Schema is the root element to carry the elements.
getEntityType() Here we declare the EntityType “Product” and a few of its properties
getEntityContainer() Here we provide a Container element that is necessary to host the EntitySet.
getEntitySet() Here we state that the list of products can be called via the EntitySet “Products”
http://localhost:8080/odata.svc/$metadata calls : schemas, entitytype for each, then entity container for each and entity set for each.
-lists results of Category_Sales_for_1997 (which is entity set name)
http://services.odata.org/V4/Northwind/Northwind.svc/Category_Sales_for_1997
- id would be @odata.id from the above request. Unfortunately it doesn't have odata id
http://services.odata.org/V4/Northwind/Northwind.svc/Category_Sales_for_1997(id)
- this just returns that field, could be complex which can walk through /
http://services.odata.org/V4/Northwind/Northwind.svc/Category_Sales_for_1997(id)/field1
- filter
http://services.odata.org/V4/Northwind/Northwind.svc/Category_Sales_for_1997?$filter=contains(CategoryName,'ts')
http://services.odata.org/V4/Northwind/Northwind.svc/Category_Sales_for_1997?$filter=CategoryName eq 'ts'
http://services.odata.org/V4/Northwind/Northwind.svc/Category_Sales_for_1997?$filter=CategoryName eq 'Condiments'
- $orderby=EndsAt desc
- ?$top=2
- $skip=18
- $count
- $expand=Friends (expands that relation)
- $select=Name, IcaoCode (limited set of properties)
- $search=Boise (depends on implementation)
-