Skip to content

Commit b90877d

Browse files
authored
Merge pull request #65 from rikoe/issue-63-fix-intent-examples
Fix intent examples in docs
2 parents 493ed46 + ee2606a commit b90877d

File tree

2 files changed

+56
-24
lines changed

2 files changed

+56
-24
lines changed

docs/intents-intro.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,40 @@ FDC3 Intents define a standard set of verbs that can be used to put together com
1919
## Using Intents
2020
Combined with [Context Data](context-intro.md) and [App Directory](appd-intro.md) standards, Intents enable rich service discovery on the desktop. For example:
2121

22-
### Directing a market data platform to show a chart
22+
### Ask for a chart to be displayed
2323
```javascript
24-
fdc3.open("my-platform","ViewChart",{
25-
type:"fdc3.instrument",
24+
const result = await fdc3.raiseIntent("ViewChart", {
25+
type: "fdc3.instrument",
2626
name: "IBM",
27-
id:{
27+
id: {
2828
ticker:"ibm"
29-
}
30-
});
29+
}
30+
});
3131
```
3232

33-
### Discovering apps that can start a chat
33+
### Ask a specific application to display a chart
3434
```javascript
35-
fdc3.raiseIntent("StartChat",{
36-
type:"fdc3.contact",
35+
const result = await fdc3.raiseIntent("ViewChart", {
36+
type: "fdc3.instrument",
37+
name: "IBM",
38+
id: {
39+
ticker:"ibm"
40+
}
41+
}, "market-data-app");
42+
```
43+
44+
### Find applications that can start a chat
45+
```javascript
46+
const intentApps = await fdc3.findIntent("StartChat");
47+
```
48+
49+
### Find available intents for a contact
50+
```javascript
51+
const intentsAndApps = await fdc3.findIntentsByContext({
52+
type: "fdc3.contact",
3753
name: "Nick Kolba",
38-
id:{
54+
id: {
3955
40-
}
41-
});
56+
}
57+
});
4258
```

website/versioned_docs/version-1.0/intents-intro.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,40 @@ FDC3 Intents define a standard set of verbs that can be used to put together com
2020
## Using Intents
2121
Combined with [Context Data](context-intro.md) and [App Directory](appd-intro.md) standards, Intents enable rich service discovery on the desktop. For example:
2222

23-
### Directing a market data platform to show a chart
23+
### Ask for a chart to be displayed
2424
```javascript
25-
fdc3.open("my-platform","ViewChart",{
26-
type:"fdc3.instrument",
25+
const result = await fdc3.raiseIntent("ViewChart", {
26+
type: "fdc3.instrument",
2727
name: "IBM",
28-
id:{
28+
id: {
2929
ticker:"ibm"
30-
}
31-
});
30+
}
31+
});
3232
```
3333

34-
### Discovering apps that can start a chat
34+
### Ask a specific application to display a chart
3535
```javascript
36-
fdc3.raiseIntent("StartChat",{
37-
type:"fdc3.contact",
36+
const result = await fdc3.raiseIntent("ViewChart", {
37+
type: "fdc3.instrument",
38+
name: "IBM",
39+
id: {
40+
ticker:"ibm"
41+
}
42+
}, "market-data-app");
43+
```
44+
45+
### Find applications that can start a chat
46+
```javascript
47+
const intentApps = await fdc3.findIntent("StartChat");
48+
```
49+
50+
### Find available intents for a contact
51+
```javascript
52+
const intentsAndApps = await fdc3.findIntentsByContext({
53+
type: "fdc3.contact",
3854
name: "Nick Kolba",
39-
id:{
55+
id: {
4056
41-
}
42-
});
57+
}
58+
});
4359
```

0 commit comments

Comments
 (0)