Hiding Files in the SuiteApp Type of SuiteCloud Project

In SuiteCloud Development Framework (SDF), you can hide files in your SuiteCloud project when that project is of type SuiteApp. Hiding a file prevents anyone who installs the SuiteApp from accessing the file in the target account.

When hiding files, consider the following important information:

To hide files in a SuiteCloud project of SuiteApp type

  1. Create a hiding.xml file in the InstallationPreferences folder of your SuiteCloud project of SuiteApp type. To create the file using a SuiteCloud IDE, see Creating an Installation Preference File with SuiteCloud IDE Plug-in for WebStorm. If you already have a hiding.xml file in your SuiteCloud project, proceed directly to the next step.

  2. In the hiding.xml of your SuiteCloud project, enter values for the following attributes and fields:

    • For the type attribute of the <preference> element, specify the installation preference type to be HIDING. For more information about installation preferences, see Installation Preferences in the SuiteApp of SuiteCloud Project.

    • For the defaultAction attribute of the <preference> element, specify a default hiding action for all files in your SuiteCloud project. Valid values are HIDE and UNHIDE.

      The default action applies to content in your project that is not in the apply list of your hiding.xml file. In the following example, the default preference for files in the SuiteCloud project is UNHIDE, so all files except the myScript.js file are not hidden:

                          <preference type="HIDING" defaultAction="UNHIDE">
      
          <apply action="HIDE">
      
              <path>~/FileCabinet/SuiteApps/com.example.myFile/myScript.js</path>
      
          </apply>
      
      </preference> 
      
                        
    • For the action attribute of the <apply> element, specify a value that will apply to the file or files. Valid values are HIDE and UNHIDE. For example, <apply action="HIDE"> hides the specified file or files.

    • For the <path> element, specify a file path for the files to hide. The following are the possible ways to specify paths:

      • You can specify a path to a single file. For example, <path>~/FileCabinet/SuiteApps/com.example.myFile/myScript.js</path>.

      • You can specify a path to all files in a target folder (multiple files) using the wildcard (*) and the appliesTo attribute for the <path> element. For example, <path appliesTo="FILES">~/FileCabinet/SuiteApps/com.example.myFiles/*</path>.

        Note:

        A <path> element with a value that contains the wildcard (*) requires an appliesTo attribute to be set.

  3. Save your changes in the hiding.xml file.

    When you later deploy the SuiteCloud project, to enable the values specified in the hiding.xml file, you must select the Apply Installation Preferences box. For more information about selecting that preference during deployment, see Applying Installation Preferences During SuiteCloud Project Validation and Deployment.

Hiding a File using SDF Example

The following hiding.xml file example hides the myScript.js file by setting the preference type to HIDING, the apply action to HIDE, and the path to the file.

            <preference type="HIDING" defaultAction="UNHIDE">

    <apply action="HIDE">

        <path>~/FileCabinet/SuiteApps/com.example.myFile/myScript.js</path>

    </apply>

</preference> 

          

Hiding Multiple Files using SDF Example

The following hiding.xml file example hides all of the files in the folder com.example.myFiles by using the wildcard (*) and the appliesTo="FILES" attribute:

            <preference type="HIDING" defaultAction="UNHIDE">

    <apply action="HIDE">

        <path appliesTo="FILES">~/FileCabinet/SuiteApps/com.example.myFiles/*</path>

    </apply>

</preference> 

          

Related Topics

Installation Preferences in the SuiteApp of SuiteCloud Project
Default Installation Preferences
Locking SDF Custom Objects in the SuiteApp Type of SuiteCloud Project
Locking Files in the SuiteApp Type of SuiteCloud Project
Overwrite Settings for SuiteApp Projects
Applying Installation Preferences During SuiteCloud Project Validation and Deployment
Installation Preferences Validation in SuiteCloud Projects
Installation Preference File Structure in SuiteCloud Projects

General Notices