span8
span4
span8
span4
Inpart 2,you learned how to publish a workspace to FME Server and run it from the Web User Interface.Now,in part 3,you will modify that workspace so it allows for "self-serve" data access.To accomplish this,perform the following:
In part 3 of this tutorial,you'll learn how to enable an FME Workspace for self-serve data access so anyone can download your data.This involves creating published parameters in FME Workbench,publishing the workspace to FME Server,and running the workspace from the Web User Interface.Please note that this video was created with FME Server 2018.0,the interface may vary in other versions of FME.
a) Open workspace
Open the workspace frompart 2in FME Workbench.Alternatively,open the template attached to this article (亚搏国际在线官网CommunityMapping.fmwt) in FME Workbench.
On the Generic Writer,the default writer format is set to Esri Shapefile.But,the goal is for the user to select the format of their choice,from a small list,at run time.This is accomplished with published parameters.
Parameters in FME control how FME operates.They exist in many places,such as readers,writers,and transformers.
b) Take a closer look at one of the parameters for the Generic Writer: Output Format
In the Navigator window,expand the GENERIC Writer by clicking the arrow to the left of it.Double click the Output Format parameter,this shows that it's been set up so the user can select from any format in the formats gallery.
But that's not what we want.The goal is to present the user with a list of 4 common formats.So,we will create a new user parameter,and define it accordingly...
c) In the Navigator find the User Parameters,right-click,and select Create User Parameter
For Type,select Choice with Alias.
For Name,enter Output_Format.
For Prompt,enter Output Format:
Click the button next to Configuration.We're going to import the formats we want.
Click on Import,then Writer Formats.Search and select Esri Shapefile,GML,Bentley Microstation Design V8,and MapInfo TAB (MITAB).Click OK,and OK again.
Select Esri Shapefile for the default value.Note that Published is checked by default - when a user parameter is published,a user is prompted for a value when the workspace runs.Your dialog should look like this:
d) Link Published Parameter to Output Format Parameter
Our new Output_Format parameter appears under User Parameters,Published Parameters,but we still have to link it to the Generic Writer's Output Format parameter.Locate the Output [GENERIC] Writer,and expand it with the arrow to view the Parameters,the first one being Output Format.Right-click on Output Format,select Link to User Parameter,then select the new Output_Format parameter we just created.
e) Run the workspace
If you run the workspace immediately it will use the default value and output Esri Shapefile.However,if you select Prompt for User Parameters then click Run,you will be prompted to choose the output format.Notice only those 4 formats are presented now in the drop-down list.Pick GML.The workspace runs successfully.
f) Publish Features Types to Read Parameter
Set up the workspace so the user gets to choose which layers they want to request!It's actually quite simple.
In the Navigator,expand the 亚搏国际在线官网CommunityMap [FILEGDB] File Geodatabase Reader > Parameters > and double click Features to Read.This parameter lets the user decide which feature types to process when the workspace runs.Close the dialogue.
Right-click on Feature Types to Read parameter and select Create User Parameter.Go with the defaults for the definition,and click OK.Confirm the new parameter appears under Published Parameters.
g) Run Workspace with Prompt and Run
Make sure that from the Run menu that Prompt for User Parameters is checked,otherwise,this workspace will run with default values.
Run the workspace again.
Notice that this time there are 2 parameters to set.For more information on published parameters,check outthis chapterof the Server training.
a) In Workbench,go to File > Publish to FME Server,or select the Publish to FME Server tool.
b) Connect to your FME Server
If you are setting it up for the first time,under Connection choose "Add Web Connection".
Enter your Connection Name,Server URL,username & password and authenticate.
c) Select a repository and workspace name.
Select the Server Tutorial Repository.If you haven't yet created the repository,click on the New button to create a new repository.Enter Server Tutorial for the name,and FME Server Tutorial for the description.Rename the workspace to 亚搏国际在线官网CommunityMapping.fmw.
d) Upload data files
Click on the Select Files button.
Select Location.
Click the "Upload to a shared resource folder" radio button and then select the Data folder and hit OK.
Select the checkbox for 亚搏国际在线官网communitymap.gdb.OK.
Ensure "Upload data files" is checked and then click Next.
Note: if you completedpart 2and kept the same workspace name (亚搏国际在线官网CommunityMapping.fmw),you will be prompted "The Workspace ‘亚搏国际在线官网CommunityMapping.fmw' already exists in this repository.Are you sure you want to replace this workspace?" Click Replace to overwrite it,or click Cancel and go back and change the Workspace Name if you do not want to overwrite.
Ensure the Data Download Service is selected and click Publish.
a) Open the FME Server Web User Interface
Log in with the author/author username/password.
b) Click Run Workspace
On the Run Workspace page,select Server Tutorial for the repository and the 亚搏国际在线官网CommunityMapping workspace.Select Data Download for the Service.
Check out the Published Parameters.The 2 that were set up and just tested in FME Workbench are shown.Just as before,select an output format,and select one or more layers.
Click Run.
c) Results
The Data Download service presents a URL link to the translation results in a zip file.A quick inspection of the contents of the zip file confirms the results are what we expected.
Note: The parameters in this workspace were all set up manually to demonstrate how to work with published parameters.A quicker way to create the workspace is to select the Dynamic Schema option when generating the new workspace.
Schedule a Workspace to Run with FME Server
Running and Configuring a Workspace
FME Server Troubleshooting Guide
Publish a Workspace to FME Server and Run It
Tutorial: Getting Started with FME Server
Schedule a Workspace to Run with FME Server Automations
Data Distribution with Web Maps
FME Server Troubleshooting: Connecting to FME Server From FME Workbench
Making phone calls and sending automated SME messages using FME and Twilio
Data Download Service: Writing to an existing Esri File-Based Geodatabase
© 2019 亚搏在线Safe Software Inc |Legal