Skip to main content

We currently have an .asp script that builds a url/uri based on a selected prefix and document ID.

When the OK button is clicked, the url/uri is opened in a new browser tab.

The server where the asp script is located is being retired so we need to come up with an alternative.

The parameters are Plan Type and Plan Number.

The parameters are used to generate a path to the document to open. Eg. \\sample.file.path\resources\SCIMsPlans\pm12345.pdf

I have converted the ASP to Python and made a self contained executable that works well but staff are used to accessing the plan search via a web link. I thought a FME web app may be suitable for this.

Can anyone point me to the correct transformers to use for this or even better, a sample workspace.

In case it helps, below is a snippet from the python script that builds the file path and opens the document.

        # The Plan document ID number
        name = self.plan_input.text().strip()
        
        # If 'dp' is selected, use 'DP_DepositedPlans' to build the path.
        folders = {
            "dp": "DP_DepositedPlans",
            "sp": "SP_StrataPlans",
            "cp": "CP_CrownPlans",
            "road": "CP_Roadplans",
            "scims_pm": "SCIMsPlans",
            "scims_ss": "SCIMsPlans",
            "scims_ts": "SCIMsPlans",
            "scims_gb": "SCIMsPlans"
        }

        # if 'dp is selected, use 'dp' as the prefix of the filename.
        prefixes = {
            "dp": "dp",
            "sp": "sp",
            "cp": "cp",
            "road": "cp",
            "scims_pm": "pm",
            "scims_ss": "ss",
            "scims_ts": "ts",
            "scims_gb": "gb"
        }

        folder = folders.get(type)
        prefix = prefixes.get(type)
        searchterm = f"{folder}\\{prefix}{name}"
        url = f"\\\\sample.dir.path\\GIS\\resources\\{searchterm}.pdf"

        webbrowser.open(url)

 

Cheers,

e.

Hi ​@earlw 
If I understand correctly, I think there would be a few options. Assuming you have FME Flow you could build a workbench that uses parameters as a choice. Your users can have the list choice and then use the user choice to build the file string. 
Essentials of Automations: Optimizing FME Workflows with Parameters - FME by Safe Software

Hope that helps!


Hi ​@crutledge ,

Thanks for your reply. I was able to move the asp script to another suitable server so did not need to progress with FME.

This one might be a case of horses for courses… I could get FME to perform the task but not in a way that would slot into our existing process.

We had a specific requirement that the parameter inputs had to open in a modal browser window and when the parameters were set, clicking a button would directly open a new tab with the linked document displaying. Changing the parameter values in the still open modal window and clicking the button, would open the new document link in another browser tab.

Not a flaw with FME, just not how it was designed.

Cheers,

e.


Reply