Importing common project components

After creating the common project, you are ready to import its shared components into the other Help systems in your environment. You can import common project components into a destination project by creating an import file in the destination project. In Flare, an import file references the project from which you want to import content, defines what content to import, and sets optional configuration settings.

Note    

  • Although the Flare interface defines an absolute path to the common project by default, this procedure describes how to reference the project using a relative path. Using a relative path makes your import file more portable. If multiple projects share the same relative path to the common project, you can reuse your configured import file by copying it to those projects. Also, if you work on multiple computers that potentially store projects on different drives or with different paths to the source control repository that stores your projects, you can reuse the import file on those computers (because the relative path within the repository still correctly resolves to the common project).
  • Because import files contain timestamps and local paths to imported content that is frequently updated, storing import files in source control is not recommended in environments with multiple contributing authors (because the import files are an endless source of merge conflicts). See Excluding imports from version control for information about how to exclude both the import file and the imported content from source control.

To create an import file that imports common project components

  1. In Flare, open the project into which you want to import common components.
  2. On the Project Organizer accordion tab, right-click the Imports folder, and then click Add Flare Project Import File on the shortcut menu.
  3. In the File Name box, enter Common (or whatever name you used when creating the common project and naming its member folders), and then click Add.
  4. In the Source Project path, enter a relative path from the newly created import file to the common project's .flprj file.

Tip   To define a relative path to the common project, navigate to the newly created import file in File Explorer (the file is located in the Project\Imports path of the Flare project). Then count the number of times you need to press (Up) to navigate to the first folder that is in the path of the common project. In the Source Project path, type ..\ that number of times. Then enter the rest of the path from that folder to the common project's .flproj file. For example, if you needed to press three times to get from the newly created import file to a folder in the path of the common project, and the rest of the path from that folder to the common project was Common\Common.flprj, then you would enter the path ..\..\..\Common\Common.flprj. You can test whether your path is valid by clicking Import (above the Source Project box). If, after saving your changes, an error message appears indicating that the import file is missing, then you have incorrectly defined the relative path. If, however, an Accept Imported Documents window opens, then you have correctly defined the path and can click Cancel.

  1. Select Delete stale files (during the import, this option automatically removes imported files that have been deleted from the common project).
  2. Select Delete unreferenced files (during the import, this option automatically removes imported files that are no longer included in the Include files pattern, described in the next step).
  3. In the Import Conditions box, define a conditional phrase to include those tags that you want to use in the project and explicitly exclude the tags for content you don't want. As an example, the expression below imports content flagged for inclusion in all projects and content flagged for inclusion in Product1, while excluding the content flagged for inclusion in Product2:

include[CommonInclude.All or CommonInclude.Product1, exclude[CommonInclude.Product2]

Tip   Using conditional tags to include or exclude content is easier to maintain than defining custom Include Files and Exclude Files properties in import files, because you only need to apply different conditional tags to content in the common project to include or exclude it from various projects—rather than updating the import files for multiple projects.

  1. Now that you have configured which content to import, on the File menu, click Save.
  2. Click Import to import the specified files to your project.

The Accept Imported Documents window opens.

  1. Click Select All to import all files in the list, and then click Accept.
  2. If prompted, click OK to overwrite any existing files.
  3. Repeat this procedure for each project in your environment to which you want to add common content.

After configuring all importing projects, you are ready to exclude both the import file and the imported project content from version control.