You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

Folder

Folder is the base type for all types that need folder-like functionality.

Folder extends AbstractNode and provides the following additional properties.

Name | Type | Description
– | – | –
folders | List of Folders | A filtered list of children of this Folder, Folders only
files | List of Files | A filtered list of children of this Folder, Files only
images | List of Image | A filtered list of children of this Folder, Images only
homeFolderOfUser | User | The user of which this Folder is the home folder (optional), requires the configuration switch application.filesystem.enabled (see structr.conf) to be enabled.
includeInFrontendExport | Boolean | Whether to include this Folder (and its contents, recursively) in the Frontend Export. (see Deployment).
isFolder | Boolean | A read-only value that will always be true for all Folder types and their subtypes

Search results for "Folder"

Deployment Format

folder / filedescription
componentsContains the shared components of the pages editor of Structr.
filesContains all files out of Sturctr’s virtual filesystem. Folders and files in the virtual filesystem are not being exported by default. If you want to include a folder or file into the export you have to set the flag includeInFrontendExport on each file or folder. Each file or folder will inherit this flag from its parent folder.
mail-templatesContains the mail-templates.
modulesContains the application configuration and definition of additional modules of Structr e.g. the flow engine.
pagesContains the created pages in the pages editor of Structr.
schemaContains the schema definition and code entered in the schema and code section of the Structr UI.
securityContains the resource access grants defined in the security section of the Structr UI.
templatesContains all template elements of the pages editor of Structr.
application-configuration-data.jsonContains the configured schema layouts of Structr’s schema editor.
components.jsonContains the settings e.g. visiblity flags, contentType or uuid for each file in the components folder of the export.
deploy.confContains information about the Structr system that created the export of the application.
files.jsonContains the settings e.g. visiblity flags, contentType or uuid for each file in the files folder of the export.
localizations.jsonContains the localizations that where created in the localizations section of the Structr UI and that can be used in server side scripting with the localize() function of Structr.
mail-templates.jsonContains the settings e.g. visiblity flags, locale or uuid for each file in the mail-templates folder of the export.
pages.jsonContains the settings e.g. visiblity flags, contentType or uuid for each file in the pages folder of the export.
pre-deploy.confScript that is run before deployment import. Use this to create users who are granted access to nodes in the export files.
post-deploy.confScript that is run after deployment import. Can be used to start any tasks which are necessary after import.
sites.jsonContains sites that are configured in the pages section of the Structr UI.
templates.jsonContains the settings e.g. visiblity flags, contentType or uuid for each file in the templates folder of the export.
widget.jsonContains the widgets that were created in the pages section of the Structr UI.

Built-in Properties

Key Description
Include In Frontend Export Should this file/folder (and all subfiles/-folders) be included in the deployment export.
Is Mounted Is this file/folder mounted from the host file system.
Last Seen Mounted if the folder is not mounted, when was it last mounted.
Use As Javascript Library Is this folder used as a server-side javascript library.
Content Type The content type of the given file.
Don’t Cache Is Structr allowed to cache the given file.

Actions Section

Add Folder Add folder
Add File Add file
Mound Folder Mount folder

File Navigation

The file navigation provides an overview over the file and folder hierarchy. You can expand individual folders to view their subfolders. Additionally, you can drag files from the content area into another folder in the navigation menu to move the respective file as shown below.

Actions Section

The Add Folders and Add Files buttons create a new folder, respectively file, in the current directory. Both the folder and file are schema types in Structr, from which other types an inherit. Therefore, the drop-down menu in front of the buttons allows you to specify further which type of folder or file should be created. For instance, for the file Structr already provides the specializations Image, VideoFile, MinifiedCssFile and MinifiedJavaScriptFile which you can select when creating a new file.

Content of Current Folder

Size for files this is the size in bytes, and for folders this is the number of subfiles and folders.
Type the type of the folder or file (for files the filetype is also shown).
Owner the user who owns the file or folder.

Actions Section

Name The name under which the folder is to be mounted into Structr’s virtual file system.
Mount Target The full path to the directory on Structr’s host operating system.
Do Fulltext Indexing If the files should be full text indexed.
Scan Interval(s) The rate at which the mounted directory should be refreshed.
Mount Target Folder Type The Schema Type under which Folders in the directory are to be mounted.
Mount Target File Type The Schema Type under which Files in the directory are to be mounted.
Enabled Checksums List of checksum types which are automatically computed on file creation.
Watch Folder Contents Bidirectional synchronization of the files in the mounted directory.

IllegalStateException: URI has an authority component

2020-03-31 12:33:56.703 [qtp1327213994-88] WARN  org.eclipse.jetty.server.HttpChannel - /resources/script.js
java.lang.IllegalArgumentException: URI has an authority component
at java.base/sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:53)
at java.base/sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:103)
at java.base/java.nio.file.Path.of(Path.java:203)
at java.base/java.nio.file.Paths.get(Paths.java:97)
at org.structr.web.entity.AbstractFile.defaultGetFileOnDisk(AbstractFile.java:257)
at org.structr.web.entity.Folder.getFileOnDisk(Folder.java:205)
at org.structr.dynamic.Folder.getFileOnDisk(Folder.java:95)

Actions Section

The Mount Folder button allows you to mount a folder from the operating system where Structr is hosted into Structr’s virtual file system. On pressing the Mount Folder button you are presented with a dialog that allows you to specify:

Changelog

The changelog itself can be retrieved using the builtin changelog() function. The changelog is written to disk at changelog.path with the subfolders n for nodes and r for relationships. If user-centric changelog (application.changelog.user_centric.enabled) is enabled the changelog is written to the subfolder u. In older versions of structr the changelog was written to the structrChangeLog property of a node. The following tables show the possible keys/values of modification records. Modification records are stored as a JSON string. (see the example below)

Content of Current Folder

In the content area of the current folder all files and folders are listed with their respective:

Deployment Format

Structr exports an application to a specific folder and file structure. Each component of the application is exported to a file into an designated folder. Each file has a corresponding entry in a settings json file. A typical Structr application has the following export content:

Pagination Menu

Below the actions section you can find the pagination menu. It allows you to navigate more easily through folders containing a large number of files and subfolders. In particular, you can select the number of items to be displayed on one page and browse through the individual pages. Additionally, you can filter the items.

Filesystem

application.filesystem.enabled Enables the creation of home directories for each users.
application.filesystem.unique.paths Enforces unique paths for files and folders.
application.filesystem.unique.insertionposition
startprefixes the name with a timestamp
beforeextensionputs the timestamp before the last dot (or at the end if the name does not contain a dot)
endappends the timestamp after the complete name
application.filesystem.checksums.default List of checksums to be calculated on file creation by default.
application.filesystem.indexing.enabled Globally enables indexing. Indexing can still be controlled on a file basis.
application.filesystem.indexing.maxsize Maximum size (MB) for a file to be indexed.
application.filesystem.limit Maximum number of words to be indexed per file.
application.filesystem.indexing.minlength Minimum length of words to be indexed.
application.filesystem.indexing.maxlength Maximum length of words to be indexed.
application.filesystem.mount.followsymlinks Enables support for symbolic links in mounted directories.
applications.uploads.folder Default path for files uploaded via the UploadServlet.

Paths

base.path Path of the Structr working directory. All files will be located relative to this directory.
tmp.path Path to the temporary directory. Uses java.io.tmpdir by default.
database.path Path of the Neo4j db/ directory.
files.path Path to the Structr file storage folder.
changelog.path Path to the Structr changelog storage folder.
data.exchange.path Path to the exchange directory. This path is relative to the base path of the Structr installation to prevent access to files outside of the installation directory. The exchange directory is used by the I/O built-in functions read, write and append.
snapshot.path Path to the snapshot directory. This path is relative to the base path of the Structr installation to prevent access to files outside of the installation directory. The snapshot directory is used by the snapshot() built-in function that allows you to read / write the schema of your application from / to a JSON file.
data.webapp.path Path to the webapp directory. This path is relative to the base path of the Structr installation to prevent access to files outside of the installation directory. The webapp directory is used by the internal web server to serve resource files needed by the Structr UI.

Node-level security

Every entity created by Structr in the underlying graph database is stored as a node with different relationships to other nodes. Following this concept even files, folders, users, groups, pages etc. always have a node representing them in the database and Structr makes use of this for its security system to provide security on the level of those nodes.

Apple macOS

  1. Download the file ending with -dist.zip from https://structr.com/resources/download.

  2. Open a terminal, cd to the Download folder and extract the downloaded file:
    unzip structr-<version>-dist.zip

  3. Enter the directory which has been created
    cd structr-<version>

  4. Start Structr
    bin/start
    You should see the following console output: