Guide for Document and Media Library in Liferay Portal 6.1 and 6.2

Liferay Support does not recommend or endorse specific third-party products over others. Liferay is not responsible for any instructions herein or referenced regarding these products. Any implementation of these principles is the responsibility of the subscriber.

This is a guide for setting up and using the Document and Media Library in Liferay Portal 6.1 and 6.2. The goal is to give adequate information so that it can be properly evaluated and/or utilized.

Resolution

General Setup

By default, Liferay Portal 6.1 and 6.2 are configured to use the FileSystemStore, which stores files on a local file system repository. You can change the Store or storage method by selecting a different Document Library Store option using this property: dl.store.impl=

Document Library Store Options

  1. com.liferay.portlet.documentlibrary.store.AdvancedFileSystemStore

    The AdvancedFileSystemStore distributes the files into multiple directories and thus circumvents filesystem limitations. This store can be used for small and large deployments in a clustered or non-clustered environment. Liferay does not implement any file level locking, so use this only if you're using a SAN that supports file locking (most modern ones do but check your SAN documentation to be sure). The path for storing your documents is set also set using the dl.store.file.system.root.dir property in the portal.properties. The AdvancedFileSystemStore 's code base is created and maintained by Liferay.

  2. com.liferay.portlet.documentlibrary.store.DBStore

    If a SAN is not available, and files need to be persisted in the database, another option in a clustered environment would be DBStore. The DBStore's code base is created and maintained by Liferay.

  3. com.liferay.portlet.documentlibrary.store.FileSystemStore

    This is the default Store in 6.1EE and 6.2 EE. Use this Store for a single server Liferay installation where you want your files stored on a file system. The path for storing your documents is set using the dl.store.file.system.root.dir property in the portal.properties.There may be performance limitations on clustered or larger deployments. The FileSystemStore 's code base is created and maintained by Liferay.

  4. com.liferay.portlet.documentlibrary.store.S3Store

    Use this Store for storing your documents using Amazon's Simple Storage Service. If using this Store, there are additional settings that must be configured in the portal.properties.

  5. com.liferay.portlet.documentlibrary.store.JCRStore

    This is a JCR-170 compliant Store. The only feature of JCRStore is the ability to store files on the database.This is a JCR-170 compliant store that can be used for small deployments when you don't have a SAN to store files. Jackrabbit does not take care of file locking issues when storing on a file system, so for clustered environments, use Jackrabbit in conjuction with a transactional database. There are several jcr properties in the portal.properties and additional configuration is done through the ${liferay.home}/data/jackrabbit/repository.xml If you do choose this option, be sure to use a transactional database. There may be performance impacts surrounding JCRStore on larger deployments. Jackrabbit's code base is created and maintained by Apache.

Cluster Setup Test

How do you know whether you are sharing the Document Library file repository successfully? Using two nodes, Node1 and Node2, you can do a simple test. In Node1, upload a file to Document Library. Now go to Node2 to see if the file can be downloaded. If you can see the file, and if the document library folder that you've specified (via dl.store.file.system.root.dir for instance) contains corresponding data, then the setup is correct. If you can't download the file for any reason, however, you need to recheck your setup.

File Migration

If you switch DL Stores without a proper migration, your previously uploaded files will not be accessible.

Best Practices

Before you go into production, you should decide whether there is a possibility of clustering. If there is, you should select a Document Library Store that is suitable for a clustered environment so that you don't have to worry about migration. For example, you would not want to use FileSystemStore since this Store stores files exclusively on the local file system and cannot be used for a clustered environment.

Avoid switching between Document Library Stores when you have already started uploading files. The result would be losing the files you uploaded on the previously used Store.

If the files are physically stored on the database or on a file system, you should be careful never to edit these files. The Document Library stores the path of the physical file on the database, so when you change the name or path of the phyical files or directories, then the Document Library won't be able to locate the file.

Backend

The Document Media and Library generally stores file data in two places, the database and the filesystem. Metadata including the file's path to the actual file location on the filesystem is stored in the database (see dl* tables). The physical file is stored either on the filesystem or in the database, dependent on the type of Document Library Store you utilize.

Additional Information

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0