Skip to content
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

Rewrite the FME-Server plugin #750

Closed
maan002 opened this issue Apr 12, 2021 · 6 comments
Closed

Rewrite the FME-Server plugin #750

maan002 opened this issue Apr 12, 2021 · 6 comments
Assignees
Labels
module:admin module:backend MapService stuff module:client/plugin Functionality that goes into plugins in client new feature Request for adding/changing functionality
Milestone

Comments

@maan002
Copy link
Contributor

maan002 commented Apr 12, 2021

Update from @Hallbergs: The old FME-plugin will be removed and replaced by a completely new plugin. Here's some information about the new one:

FME-Server Plugin

The main purpose for this plugin is to run FME-workspaces that are published to an FME server.
The plugin allows for both Data-download (targeting /fmeproxy/fmedatadownload/repository/workspace) as well as running with the REST-api (v3) (targeting /fmeproxy/fmerest/v3/transformations/submit/repository/workspace). Currently, the plugin is only available for users with the nodeJS backend, simply because the plugin relies on the fact that mapServiceBase/fmeProxy exists (and this is currently only implemented in the nodeJS backend).

Developer info

The FmeServer-plugin is built as a functional component, and might seem a bit strange at first sight if you've only dealt with class components. However, remember that React is leaning toward more and more functional components, and in my opinion all new plugins should be built as functional components.
Functional components are really fun to build! I suggest you give it a go if you are planning on building/rewriting a plugin.

TODO:s

Further development

Ideas for the future:

  • Add possibility to extract all features from the draw-layer, so that these could be sent to FME-server

Feel free to add more!

Setup

There are a few steps that an admin must complete before the plugin will function:

  • Add a user to FME-server that can access and run workspaces in some repository.
  • Enter details about the FME-server instance and the user created above in the .env-file (located in /new-backend).
  • Enable the plugin in the admin-UI.
  • Add a couple of products (workspaces) in the admin-ui.
  • Make sure that everything works!

The Admin UI

In the Admin UI, the administrators can add and remove products. Unfortunately, the Admin UI does not allow for editing of already added products. (Which means that the admin must remove the old product, then add it again with the new value if they want to change anything). There are a few settings on the products that might need some explanation:

  • Name: The name of the product
  • Group: Which group should the product belong to?
  • Repository: In which repository is the workspace located?
  • Workspace: Which workspace should the product target?
  • geoAttribute: Which published parameter should we save the geometry to? (If no geometry is needed, set "none").
  • maxArea: To avoid killing the FME-server instance, we allow for a max area for the drawn geometries (-1 can be used for no restrictions).
  • infoUrl: If set, the plugin will display an IconButton pointing to the url supplied.
  • availableForGroups: Set to comma-separated string of AD-groups if some products should only be visible for some users.

The Admin UI fetches information such as available repositories and workspaces (for the user specified in the .env-file) automatically to simplify the work for the administrators.

Usage

The plugin is (should) be really simple to use. it is based on the idea of a stepper, where the user can move on only when they have completed the step they are on. The stepper should lead to a minimum of errors in the end, since we can force the user to make good choices.


Original issue, by @maan002:
Enhancements identified to the FME Server Datadownload plugin:

  • Both "YTA" and "REKTANGEL" draws a rectangle.
  • Workspace parameters must be specified in map_1.json (see readme.txt for instructions). Add support in backend to fetch them from FME Server.
  • The following workspace parameters are supported: TEXT, LOOKUP_LISTBOX, LOOKUP_CHOICE. Add support for more types.
  • The mail address is specified in map_1.json. Add support in backend to retrieve the current user's mail address.
  • When you order ("BESTÄLL" button) the request goes directly to FME Server. Add support in backend to communicate with FME Server to eliminate CORS problem.
  • The FME token must be updated manually in map_1.json. Add support in backend to retrieve a new FME token.
  • Add Admin support for this plugin.
  • Use hfetch instead of fetch.
@Hallbergs
Copy link
Member

Hallbergs commented Oct 26, 2021

The progress can be tracked in this branch

@Hallbergs Hallbergs added module:client/plugin Functionality that goes into plugins in client new feature Request for adding/changing functionality labels Oct 26, 2021
@Hallbergs Hallbergs added this to the 3.x milestone Oct 26, 2021
@Hallbergs Hallbergs modified the milestones: 3.x, 3.8 Nov 8, 2021
@Hallbergs Hallbergs changed the title Enhance FME Server Datadownload plugin Rewrite the FME-Server plugin Nov 8, 2021
jacobwod added a commit that referenced this issue Nov 9, 2021
@Hallbergs
Copy link
Member

The plugin is now merged to develop, and will be available in release 3.8!

@jacobwod
Copy link
Member

jacobwod commented Nov 9, 2021

Fantastic @Hallbergs! 🚀 💯

@maan002
Copy link
Contributor Author

maan002 commented Nov 11, 2021

Hi Henrik,

I found a bug in the multiple select. The way the plugin sends the selected values are wrong.

image

The way the selected values should be sent are:

INFORMATION: LAS,HOJDKURVA

@Hallbergs
Copy link
Member

@maan002 fix coming in a couple of minutes!

Hallbergs added a commit that referenced this issue Nov 11, 2021
Hallbergs added a commit that referenced this issue Nov 11, 2021
…mail if we are to make a dataDownload request
@Hallbergs
Copy link
Member

Closing this issue now when 3.8.0-rc1 is out. If more bugs are found, they can be described in the discussion thread connected to the 3.8.0 release candidate! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:admin module:backend MapService stuff module:client/plugin Functionality that goes into plugins in client new feature Request for adding/changing functionality
Projects
None yet
Development

No branches or pull requests

3 participants