Skip to content

Commit 9568315

Browse files
committed
Deploying to gh-pages from @ 6b9bdf0 🚀
1 parent 6b9bdf0 commit 9568315

24 files changed

+1456
-1112
lines changed
Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +0,0 @@
1-
# LoopBack Push Notification Component
2-
3-
**⚠️ LoopBack 3 is in Maintenance LTS mode, only critical bugs and critical
4-
security fixes will be provided. (See
5-
[Module Long Term Support Policy](#module-long-term-support-policy) below.)**
6-
7-
We urge all LoopBack 3 users to migrate their applications to LoopBack 4 as
8-
soon as possible. Refer to our
9-
[Migration Guide](https://loopback.io/doc/en/lb4/migration-overview.html)
10-
for more information on how to upgrade.
11-
12-
## Overview
13-
14-
> StrongLoop Labs projects provide early access to advanced or experimental functionality. In general, these projects may lack usability, completeness, documentation, and robustness, and may be outdated.
15-
However, StrongLoop supports these projects: Paying customers can open issues using the StrongLoop customer support system (Zendesk), and community users can report bugs on GitHub.
16-
17-
This module provides a set of LoopBack models to enable mobile device push notifications.
18-
19-
Please see the full documentation: [Push notifications](http://docs.strongloop.com/display/LB/Push+notifications).
20-
21-
> The loopback-component-push module supersedes [loopback-push-notification](https://www.npmjs.org/package/loopback-push-notification). Please update your package.json accordingly.
22-
23-
## Architecture
24-
25-
![push-notification.png](push-notification.png)
26-
27-
## Key Components
28-
29-
- Device model and APIs to manage devices with applications and users
30-
- Application model to provide push settings for device types such as ios and
31-
android
32-
- Notification model to capture notification messages and persist scheduled
33-
notifications
34-
- Optional Job to take scheduled notification requests
35-
- Push connector that interact with device registration records and push
36-
providers such as APNS, GCM, and MPNS
37-
- Push model to provide high level APIs for device-independent push notifications
38-
39-
## Samples
40-
41-
### Node.js server
42-
43-
This module includes an [example LoopBack server application](https://github.com/strongloop/loopback-example-push).
44-
45-
To run it, use these commands:
46-
47-
```shell
48-
$ cd example/server
49-
$ npm install
50-
$ bower install
51-
$ node app
52-
```
53-
54-
Open your browser to [http://127.0.0.1:3010](http://127.0.0.1:3010).
55-
56-
By default, the application uses an in-memory store for the application/installation data.
57-
To change to a MongoDB instance, set the MONGODB environment variable to the MongoDB URL. For example,
58-
59-
```shell
60-
MONGODB=mongodb://localhost/demo node app
61-
```
62-
63-
### iOS client
64-
65-
The [iOS example app](https://github.com/strongloop/loopback-example-push/tree/master/ios)
66-
uses the LoopBack iOS SDK to enable and handle push notifications.
67-
68-
### Android client
69-
70-
The [Android example app](https://github.com/strongloop/loopback-example-push/tree/master/android)
71-
uses the LoopBack Android SDK to enable and handle push notifications.
72-
73-
## References
74-
75-
- https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
76-
- http://developer.android.com/google/gcm/index.html
77-
- http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202945(v=vs.105).aspx
78-
- https://github.com/argon/node-apn
79-
- https://github.com/logicalparadox/apnagent-ios
80-
- https://blog.engineyard.com/2013/developing-ios-push-notifications-nodejs
81-
82-
## Module Long Term Support Policy
83-
84-
This module adopts the [
85-
Module Long Term Support (LTS)](http://github.com/CloudNativeJS/ModuleLTS) policy,
86-
with the following End Of Life (EOL) dates:
87-
88-
| Version | Status | Published | EOL |
89-
| ------- | --------------- | --------- | -------- |
90-
| 3.x | Maintenance LTS | Dec 2016 | Dec 2020 |
91-
92-
Learn more about our LTS plan in [docs](https://loopback.io/doc/en/contrib/Long-term-support.html).
Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +0,0 @@
1-
# loopback-connector-ibmi
2-
3-
This is a database connectior for Db2 on IBM i intended for use with LoopBack 3 (LoopBack 4 testing soon). It uses the npm `odbc` package to connect to the database, so installing an ODBC driver manager and driver and setting up a datasource is required for use (see below).
4-
5-
## Major differences from version 0.x of loopback-connector-ibmi
6-
This version of the module is significantly different from version 0.x and constitutes a complete rewrite. This project is a derivative of [loopback-connector-db2iseries](https://github.com/strongloop/loopback-connector-db2iseries) and the v0.x [loopback-connector-ibmi](https://github.com/andrescolodrero/loopback-connector-ibmi).
7-
8-
The main difference between this and the other packages for IBM i (including v0.x of this package) is that it uses ODBC to communicate to the database. Version 0.x of this package was built using the Db2 for i CLI API set, hence the need for important prerequisites (below).
9-
10-
## Prerequisites
11-
Before installing this package, you will need an ODBC driver and a driver manager (with development libraries).
12-
This package is primarily developed and tested with the IBM i Access ODBC driver, which is supported as part of IBM i software maintenance agreements (SWMA) and comes with no additional licensing fees.
13-
14-
### On IBM i
15-
- Install the `unixODBC-devel` package. See [the RPM and yum documentation for IBM i](http://ibm.biz/ibmi-rpms) for more detailed steps.
16-
### On Linux
17-
- Install the `unixODBC-devel` package with your operating system's package manager (apt-get, zypper, yum, etc).
18-
- Install the "Linux Application Package" of IBM i Access Client Solutions. Consult [this document](http://www-01.ibm.com/support/docview.wss?uid=nas8N1010355) for assistance.
19-
### On Windows
20-
- Install the "Windows Application Package" of IBM i Access Client Solutions. Consult [this document](http://www-01.ibm.com/support/docview.wss?uid=nas8N1010355) for assistance.
21-
22-
23-
## Installation
24-
Once the prerequisites are satisfied, enter the following in the top-level directory of your LoopBack application and install this package:
25-
26-
```
27-
$ npm install loopback-connector-ibmi
28-
```
29-
30-
## Configuration
31-
32-
In LoopBack, datasources are used to store the information about your database so it can be used by the program. Use the [data source generator](https://loopback.io/doc/en/lb3/Data-source-generator.html) to add to your application:
33-
34-
```
35-
lb datasource
36-
```
37-
38-
The datasource generator will then walk you through the process of setting up a datasource:
39-
1. `Enter the datasource name:` Any name will do, such as the name of the schema you will use or the name of your system.
40-
2. `Select connector for <name>:` LoopBack 3 does not have knowledge of `loopback-connector-ibmi`, so just press up on the arrow key once and select `other`.
41-
3. `Enter the connector's module name:` Enter `loopback-connector-ibmi`.
42-
4. `Install loopback-connector-ibmi`: If you haven't installed it, enter `Y`. If you have already installed it, select `n`.
43-
44-
This will generate an entry in your `server/datasources.json` file. It should know have an entry similar to:
45-
46-
```json
47-
"test": {
48-
"name": "test",
49-
"connector": "loopback-connector-ibmi"
50-
}
51-
```
52-
You should edit this entry to add information on how to connect to Db2. For `loopback-connector-ibmi`, you need to pass either a `connectionString`, or pass your `username`, `password`, and `dsn` (which will be the DSN name you set up for your ODBC driver).
53-
54-
```json
55-
"test": {
56-
"name": "test",
57-
"connector": "loopback-connector-ibmi",
58-
"connectionString": "DSN=MYDSN"
59-
}
60-
```
61-
62-
or
63-
64-
```json
65-
"test": {
66-
"name": "test",
67-
"connector": "loopback-connector-ibmi",
68-
"dsn": "MYDSN",
69-
"username": "FIRSTLAST",
70-
"password": "password123"
71-
}
72-
```
73-
74-
The following table describes the connector properties.
75-
76-
Property| Type | Description
77-
---| --------| --------
78-
connectionString | String | ODBC connection string for connecting to the database
79-
dsn | String | ODBC DSN to use for the connection
80-
username | String | Username on the IBM i
81-
password | String | Password on the IBM i
82-
schema | String | Specifies the default schema name that is used to qualify unqualified database objects in dynamically prepared SQL statements. The schema name is case-sensitive.
83-
84-
**More connector properties will be added as requested by the community**
85-
86-
Alternatively, you can create and configure the data source in JavaScript code.
87-
For example:
88-
89-
```javascript
90-
var DataSource = require('loopback-datasource-juggler').DataSource;
91-
var DB2 = require('loopback-connector-ibmi');
92-
93-
var config = {
94-
dsn: process.env.DSN
95-
username: process.env.DB2_USERNAME,
96-
password: process.env.DB2_PASSWORD,
97-
};
98-
99-
var db = new DataSource(DB2, config);
100-
101-
var User = db.define('User', {
102-
name: { type: String },
103-
email: { type: String },
104-
});
105-
106-
// Will make sure that 'User' table has the same format as the model
107-
db.autoupdate('User', function(err) {
108-
if (err) {
109-
console.log(err);
110-
return;
111-
}
112-
113-
User.create({
114-
name: 'Tony',
115-
email: 'tony@t.com',
116-
}, function(err, user) {
117-
console.log(err, user);
118-
});
119-
120-
User.find({ where: { name: 'Tony' }}, function(err, users) {
121-
console.log(err, users);
122-
});
123-
124-
User.destroyAll(function() {
125-
console.log('example complete');
126-
});
127-
});
128-
```
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# LoopBack JSON-RPC Connector
2+
3+
The LoopBack JSON-RPC Connector allows you to call [JSON-RPC](http://www.jsonrpc.org) services from LoopBack models. It
4+
uses [jayson](https://github.com/tedeh/jayson) as the client library.
5+
6+
## Usage
7+
8+
9+
```js
10+
11+
var ds = loopback.createDataSource({
12+
connector: require("loopback-connector-jsonrpc"),
13+
debug: false,
14+
baseURL: 'http://localhost:3000',
15+
operations: ['add', 'subtract']});
16+
17+
var model = ds.createModel('dummy');
18+
19+
model.add(1, 2, function(err, data) {
20+
console.log(err, data);
21+
});
22+
```
23+
24+
Options to configure the connector:
25+
26+
* url: Base URL to the json-rpc server
27+
* operations: An array of operation names
28+
29+
You can also configure the baseURL as follows.
30+
31+
{
32+
host: 'localhost',
33+
port: 3000
34+
}
35+
36+
Other properties will be passed to `jayson`.
37+
38+
* reviver: Function to use as a JSON reviver
39+
* replacer: Function to use as a JSON replacer
40+
* generator: Function to generate request ids with. If omitted, Jayson will just generate a "random" number that is RFC4122
41+
compliant and looks similar to this: 3d4be346-b5bb-4e28-bc4a-0b721d4f9ef9
42+
* version: Can be either 1 or 2 depending on which specification should be followed in communicating with the server.
43+
Defaults to 2 for JSON-RPC 2.0
44+
* encoding: String that determines the encoding to use and defaults to utf8
45+
46+
47+
48+
## License
49+
MIT

0 commit comments

Comments
 (0)