-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix intent examples in docs #65
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,24 +19,40 @@ FDC3 Intents define a standard set of verbs that can be used to put together com | |
## Using Intents | ||
Combined with [Context Data](context-intro.md) and [App Directory](appd-intro.md) standards, Intents enable rich service discovery on the desktop. For example: | ||
|
||
### Directing a market data platform to show a chart | ||
### Ask for a chart to be displayed | ||
```javascript | ||
fdc3.open("my-platform","ViewChart",{ | ||
type:"fdc3.instrument", | ||
const result = await fdc3.raiseIntent("ViewChart", { | ||
type: "fdc3.instrument", | ||
name: "IBM", | ||
id:{ | ||
id: { | ||
ticker:"ibm" | ||
} | ||
}); | ||
} | ||
}); | ||
``` | ||
|
||
### Discovering apps that can start a chat | ||
### Ask a specific application to display a chart | ||
```javascript | ||
fdc3.raiseIntent("StartChat",{ | ||
type:"fdc3.contact", | ||
const result = await fdc3.raiseIntent("ViewChart", { | ||
type: "fdc3.instrument", | ||
name: "IBM", | ||
id: { | ||
ticker:"ibm" | ||
} | ||
}, "market-data-app"); | ||
``` | ||
|
||
### Find applications that can start a chat | ||
```javascript | ||
const intentApps = await fdc3.findIntent("StartChat"); | ||
``` | ||
|
||
### Find available intents for a contact | ||
```javascript | ||
const intentsAndApps = await fdc3.findIntentsByContext({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fine, but I noticed that the example in the api docs for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, I noticed the same while doing this and then promptly forgot to change it! Will update the PR... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can do that on a separate commit if you like |
||
type: "fdc3.contact", | ||
name: "Nick Kolba", | ||
id:{ | ||
id: { | ||
email:"[email protected]" | ||
} | ||
}); | ||
} | ||
}); | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,24 +20,40 @@ FDC3 Intents define a standard set of verbs that can be used to put together com | |
## Using Intents | ||
Combined with [Context Data](context-intro.md) and [App Directory](appd-intro.md) standards, Intents enable rich service discovery on the desktop. For example: | ||
|
||
### Directing a market data platform to show a chart | ||
### Ask for a chart to be displayed | ||
```javascript | ||
fdc3.open("my-platform","ViewChart",{ | ||
type:"fdc3.instrument", | ||
const result = await fdc3.raiseIntent("ViewChart", { | ||
type: "fdc3.instrument", | ||
name: "IBM", | ||
id:{ | ||
id: { | ||
ticker:"ibm" | ||
} | ||
}); | ||
} | ||
}); | ||
``` | ||
|
||
### Discovering apps that can start a chat | ||
### Ask a specific application to display a chart | ||
```javascript | ||
fdc3.raiseIntent("StartChat",{ | ||
type:"fdc3.contact", | ||
const result = await fdc3.raiseIntent("ViewChart", { | ||
type: "fdc3.instrument", | ||
name: "IBM", | ||
id: { | ||
ticker:"ibm" | ||
} | ||
}, "market-data-app"); | ||
``` | ||
|
||
### Find applications that can start a chat | ||
```javascript | ||
const intentApps = await fdc3.findIntent("StartChat"); | ||
``` | ||
|
||
### Find available intents for a contact | ||
```javascript | ||
const intentsAndApps = await fdc3.findIntentsByContext({ | ||
type: "fdc3.contact", | ||
name: "Nick Kolba", | ||
id:{ | ||
id: { | ||
email:"[email protected]" | ||
} | ||
}); | ||
} | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
findIntents
call returns an object, not the actual apps :There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but this isn't the API docs, I wanted to be concise and unspecific and get the idea across of what it turns. Do you think I should change it? It could still be an object with that name in my example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool - just checking.