Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

This page is for application designers who need the ability to download files and/or access them programmatically.

Within your application screens, you may use images and files that have been uploaded onto the PhixFlow server. For example,

  • allowing users to download a file.
  • displaying an image based on expression logic. For example,  display a user image based on the logged in user.


Your administrator can configure the Tomcat webserver to see specific directories by creating soft links from the <path>/tomcat/webapps/phixflow directory; see Configuring Soft Links Between PhixFlow and Tomcat

Operating SystemSource (Tomcat)
which points to → 
Target (Directory)Example Files
Linux<path>/tomcat/webapps/phixflow/datalink

<path>/phixflow/data/datalink/

Snapshot.jpg

MyData.xlsx

Windows<path>\tomcat\webapps\phixflow\datalink<path>/phixflow/data/datalink/

To link to the files use the soft link:

  • For download, create an action which opens the URL: "datalink/MyData.xlsx"
    • Note, not all file types will invoke a download, for example a PDF will simply open in a new browser tab.

  • For display, an image or PDF can be embedded in a URL component using the value: url("https:datalink/Snapshot.jpg")
  • For display, images can be applied to areas by setting the CSS property to background-image: "datalink/Snapshot.jpg"

Example Setup for Images using a Soft Link

This example covers the scenario where a user has a set of logos and needs PhixFlow to display them based on the Business currently selected.

Step1: Setup the soft link

See Configuring Soft Links Between PhixFlow and Tomcat for the commands

Example locations are shown below:

Operating SystemSource (Tomcat)Target (Directory)
Linux<path>/tomcat/webapps/phixflow/datalink

<path>/phixflow/data/datalink/

Windows<path>\tomcat\webapps\phixflow\datalink<path>/phixflow/data/datalink/

The business logos should be uploaded onto the server into the Target directory using the appropriate protocol e.g. FTP.

It should be noted it is a good idea to create subdirectories under the Target directory for different types of information i.e. "customImages" for the customer logos we are uploading. 

In this example we will upload our images to: <path>/phixflow/data/datalink/customImages.

It is assumed that a table exists which contains the names of the Business logos. For example a Businesses table with an attribute called LogoName that holds the name of the business's logo.

Setup

  1. Create a new screen
  2. Open the palette and add one of the Complete Screens to the screen by dragging and dropping it.
  3. Open the table containing the names of the customer logo e.g. Businesses
  4. Drag the attribute containing the logo name onto the screen e.g. LogoName.
  5. Setting the background image
    1. In the palette find the Area component and drag it onto the screen.
    2. Navigate to its Style Tab and set the following:
      1. Background Repeat: no-repeat
      2. Background Size:      100%
        1. See Image Sizing for more information on this.
    3. In the CSS Properties section, click the add button and set the following:
      1. CSS Tag: background-Image
      2.  Value: "datalink/customerImages"+_form.LogoName
        1. If you are obtaining the logo name from an attribute on a grid or card component, these can be referenced using:
        2. Grid: _selected. AttributeName
        3. Card Component: _current.AttributeName
      3. Expression: Tick
    4. Save all changes
  6. The image should now display inside the Area component.
  • No labels