span8
span4
本文是系列的一部分:Subscribe, Report and Notify Tutorial
导航:< 2. Spatial Business Rules
The workspaces and data used in the tutorial are available for从GitHub下载。
FME Desktop 2017
FME Server 2017
PostgreSQL with PostGIS extension installed
以前完成订阅,报告和通知教程
Manually updating the subscription database works okay if there are a few, static subscriptions. However, if you expect to have many users subscribing and unsubscribing, then you will need to automate updates to the subscription database. A workspace is the perfect tool for this purpose and we can make it web accessible with FME Server.
If you are providing a service to subscribe devices/email addresses, then you need to ensure that the owner of the device/email address is the one that actually subscribes. The same goes for unsubscribing.
For email subscriptions, there are two common methods for confirming subscription that both involve sending an email to the address provided:
For SMS subscriptions, it is common to send a SMS with a code in it, which you then enter into a website. A link with a unique ID would work as well for smartphones.
For APNS/GCM subscriptions, your mobile device will ask you if you want to receive push notifications when the app is installed. The app should then provide an option to register for notifications, which should then submit a request to FME Server for subscription. The request needs to contain the device ID/token of the mobile device, which will be used in combination with the GCM and APNS subscribers to send a notification to the app. Since the device ID/token is only known by the apps on the actual device, confirmation is implicit in the request.
Create a database that connects topic names with email addresses, which we call a subscription. Each subscription has a confirmation token that will be used to confirm unsubscribe requests.
1) Open the 3_create_subscription_database.fmw workspace.
2)修改PostGIS的作家的连接参数,以配合您的PostGIS数据库。
3) Run the workspace to create a table called subscription_database.
This step provides a web service for requesting subscription to notifications sent to a specific topic within a specific geographic area.
1)打开3_request_subscription.fmw工作区。请注意,有三组公布的参数,允许输入:电子邮件,主题,高铁总站。
2)修改PostGIS的作家的连接参数,以配合您的PostGIS数据库。
3)打开FMEServerEmailGenerator变压器和修改消息参数,改变http:// link以匹配您的FME Server的主机名。这是链接确认订阅。
4)发布工作区FME服务器:
Now you have a web service that allows you to request a subscription and receive a confirmation email.
现在提供了一个Web服务,这将激活使用令牌确认订阅请求。
1)打开3_confirm_subscription.fmw工作区。请注意,有一个发布的参数:令牌。
2) Modify the FeatureReader and DatabaseDeleter transformers and PostGIS writer’s connection parameters to match your PostGIS database.
FeatureReader parameters:
Note: Make sure to select the corresponding subscription_request_database associated with your Table Qualifier - i.e. “public” in the above example.
DatabaseDeleter参数:
Note: Make sure to select the corresponding subscription_request_database associated with your Table Qualifier - i.e. “public” in the above example.
PostGIS的作家的参数:
3)Pulish工作区FME服务器:
这个步骤提供了一个Web服务,将取消使用令牌确认订阅请求。
1) Open the 3_remove_subscription.fmw workspace. Note that there is one published parameter: token.
2)修改FeatureReader / DatabaseDeleter我国ormers and PostGIS writer’s connection parameters to match your PostGIS database as you did with the previous workspace.
3)发布工作区到FME服务器:
你也应该调整你的电子邮件通知提供一个链接退订。
1) Open the 3_process_messages.fmw
2)修改FeatureReader变压器为您提供与以前做的工作空间,以配合您的PostGIS数据库。
3) Open the FMEServerEmailGenerator transformer and edit the Message parameter so that the unsubscribe URL references your FME Server.
4)发布工作区FME服务器:
Web服务,它允许用户订阅可以被集成到一个网络地图创建一个非常友好的用户体验的用户界面。在这种情况下,我们将保持它的简单和使用Web的用户界面,使该请求。
1) Open the Web User Interface and go to the Run Workspace page. Fill out the parameters as follows:
2)填写公布的参数如下:
Note: the above WKT is the geofence of a rough outline of Japan.
3) Click Run.
4)翻译成功。您的订阅确认并激活。
1) Open the FME Server REST API: Developers > REST API > API > notifications: Notification Manager > POST/notifications/topics/
2)对于身体参数输入
{ “受试者”: “最后一个游...”, “消息”:“的 RUSH 的进入的土地升起的太阳的 i>的用于一晚仅 U> !!”, “纬度”: “36”, “经度”: “140”}
3)关于主题参数输入:concert_communications
4) Click the Try it out! button.
5)系统会提示您登录,如果您还没有。(记住:用户名和密码与您的FME Server的帐户)。之后点击试试吧!再次。
6)您会收到一封电子邮件给您的concert_communications主题返回指定的,当你创建数据库的地址。
1) In the email you received there should be a link to unsubscribe. Click that link.
2)现在,让我们确认您是通过重复在报告上面的消息部的步骤取消订阅。
You shouldn’t receive any email as your subscription was removed.
So now you understand what it takes to create a system for a basic subscription service with spatial business rules.
这里有一些其他概念,你可能会考虑引入到自己的订阅,报告和通知系统:
To give you some further ideas, check out the following demos:
Sending email, Part 1: Setting up a topic and an email subscriber (2015)
Receiving email, Part 1: Setting up a topic and an email address (2015)
Sending email, Part 4: Sending prettier email using HTML (2015)
发送电子邮件,第3部分:发送电子邮件时,工作区完成(2015年)
Sending email, Part 5: Sending an email with attachments (2015)
Sending email, Part 2: Sending an email using the FMEServerNotifier (2015)
Receiving email, Part 3: Using email attachments (2015)
Sending email, Part 1: Setting up a topic and an email subscriber
©2020安全亚搏在线软件公司|法律