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:
-
SuiteCloud Development Framework (SDF) validates that hiding preferences match with any existing
hideinbundle
file attributes. You cannot use a conflicting hiding preference andhideinbundle
attribute on the same file. For information about changing a file attribute, see Modifying SuiteCloud Project File and Folder Attributes in an XML Definition. -
Even when using only hiding preferences without locking preferences, your SuiteCloud project must include both the
hiding.xml
andlocking.xml
files for the project to successfully deploy to a target account. -
It is not possible to hide client script SuiteScript files in a SuiteCloud project of SuiteApp type. For client script files, do not set the HIDING preference action value to HIDE.
To hide files in a SuiteCloud project of SuiteApp type
-
Create a
hiding.xml
file in theInstallationPreferences
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 ahiding.xml
file in your SuiteCloud project, proceed directly to the next step. -
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 beHIDING
. 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 areHIDE
andUNHIDE
.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 isUNHIDE
, so all files except themyScript.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 areHIDE
andUNHIDE
. 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 anappliesTo
attribute to be set.
-
-
-
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