Defining Document Types
In Liferay, Document Types are templates used for uploading files and categorizing them in Documents and Media. These templates are created using metadata fields and provide additional, searchable information for uploaded files.
Default Document Types
Default document types are generated when you first start a virtual instance or create a new company. To prevent their creation in future instances or companies,
-
Open the Product Menu (), navigate to Control Panel, and click System Settings.
-
Click Documents and Media under Content and Data.
-
Under Service, uncheck Add Default Structures and click Save.
This setting only applies to new instances or companies created thereafter.
You can also use a configuration file to configure this setting:
-
Create a config file named
com.liferay.document.library.configuration.DLConfiguration.config
. -
Add
addDefaultStructures=B"false"
to the file and save it. -
Place the file in the
osgi/configs
directory in your Liferay bundle before starting the server.
When set, the Add Default Structures option is unchecked on startup, and no default document types are created.
Defining a Custom Document Type
-
Navigate to the Documents and Media application in a site or asset library.
To access Documents and Media in a site, open the Site Menu () and go to Content & Data → Documents and Media.
To access Documents and Media in an asset library, navigate to any library where it’s enabled and click on Documents and Media.
-
Open the Document Types tab.
-
Click New to access the New Document Type form.
-
Enter a name for the Document Type.
-
In the Builder tab, drag and drop the desired fields into the designated drop zone.
Each field is highly configurable, with basic and advanced options.
If desired, you can create field groups by dragging and dropping fields on top of one another. Each group can also be configured as a unit.
NoteAll custom Document Types have the following fields: Upload File, Title, File Name, and Description. Fields added to a custom Document Type appear in addition to these default fields.
-
(Optional) Click on the Details tab, and enter a description.
-
(Optional) Click on the Additional Metadata Fields tab and select any existing Metadata Sets you want to add to the new Document Type.
-
(Optional) Click on the Permissions tab, and configure who can view, edit, and manage the new Document Type.
-
Click on Save.
Once saved, the new Document Type can now be accessed in the Documents and Media tab, where you can use it to start a new upload.
When the Document Type is selected, users see your configured metadata fields. See Uploading Files for more information.