span8
span4
span8
span4
注:本文适用于FME服务器2015年只。To create an custom page in FME Server 2016+ complete the数据上传3部分:REST APIarticle.
以前:数据上传第1部分:从URL中读取数据| Next:数据上传3部分:REST API
Here, you'll learn how to create a standalone web page that allows end-users to upload data to FME Server and run a workspace that uses the uploaded data.
1。建立一个自定义窗体
In the FME Server Web UI, open the workspace you published during Part 1 of this tutorial: Workspaces > DataLoading > 1_CheckFieldStatus.fmw > Data Download.Expand the Developer Information section.Copy the entire Form Example and save the text into a file called dataupload.html
Copy the file to a web-accessible location.It can be hosted by a web server like IIS or Apache.Additionally, you could make use of a service like Amazon S3 to host the page.
Note: If you are using FME Server on premises, you can host the web page from its web server root directory the HTML file into
2。启用来宾访问
Enable guest access.To avoid the need for a user to have to log in to use the web form, let’s enable guest access for this repository.In the FME Server web interface, navigate to Security > Role Policies and select the fme guest role from the role dropdown menu.Locate ‘Data Upload’ under Services and check the box called Allow.This will allow a guest user to upload a dataset to FME Server.Next, find the DataUpload repository under the section called Repositories and check the boxes to allow both ‘read’ and ‘run’ access.These are the minimum required permissions to allow a user to run a workspace on FME Server.Finally, click ‘Apply Changes’ to save the settings.
Open the web form in a new browser instance and try running it again.
3。启用CORS
From the Web Interface, go to Manage > Administration > CORS.Click on Load Template and select Allow Specific Hosts.Delete the existing hosts and add the host from which your web page is run
4。使用自定义表单运行工作区
Use your dataupload.html page to run the workspace.Click the Browse button and choose to upload the weekendplayfieldstatus.csv file.Set the Field Status File to the name of the file you just uploaded (i.e.weekendplayfieldstatus.csv), and click Run.
In this example, we have created a very basic web page using simple HTML.With this as a base, you could easily customize the look and feel of this webpage possibly using CSS and Javascript to create an interface tailored to your requirements.
© 2020 Safe Software Inc |Legal