Introduction

documentsmediadatabasechecker
The Documents and Media File System Checker portlet was developed by XTIVIA, the 2012, 2013 and 2014 Liferay North America Partner of the Year. As we work with Liferay customers, we often run into situations where the client has a Liferay environment (from test all the way to production) with an inconsistent data set for the documents and media functionality. The preferred Liferay configuration is to store the meta-data about documents and media in the Liferay database and to store files on the file system. Due to various reasons this data can get into an inconsistent state, for instance:

  • You may be moving data from one environment to another (for example, from production down to QA and test). If you accidentally copy the database backup from yesterday and the file system backup from today and in the interim, users have uploaded new files to the production system.
  • You run a LAR export from one environment and import into another, but due to various reasons (from a Liferay defect to a buggy customization done by you) you end up introducing inconsistent data.
  • You accidentally delete a file on the file system to free up disk space.

To help you detect and resolve these data inconsistencies, XTIVIA developed this plugin. The Documents and Media File System Checker portlet provides a dashboard view of all the missing documents in the file system that have a corresponding file entry in the database. It also enables the user to list all the documents residing in the file system that are in synchronization with the database, as well as all the missing documents in file system that have a representation in the database.

The listing is displayed in a data table that enables the user to navigate through the dataset, to sort the dataset multiple ways, and to modify number of documents per page. Apart from this, the user can create a dummy file in the file system for missing documents pertaining to each of the missing documents listed so as to re-establish consistency between the Liferay database and the file system.

Note: Please note that this plugin is intended to work with the File System Store. See here for more details.

Key Features:

  • List missing documents in the file system (that have a corresponding file entry in the Liferay database) as the default view.
  • List all documents in the file system (that are in synchronization with the database) along with the missing documents in the file system.
  • Resolve missing documents in file system using the action – Create dummy file in File System.
  • Navigate through the data set
  • Sort documents
  • Modify number of documents displayed per page.

Portlet Setup

Before you use the File System Checker portlet the first time in your Liferay portal, you’ll need to install the portlet from the Liferay Marketplace. These instructions apply to either the Liferay 6.2 EE or CE version.

Once you’ve installed the portlet, you can access the portlet from the Control Panel. Normally this means you must have Administrator privileges.

Control Panel View

Navigate to the Control Panel and the Documents Media File System Checker portlet can be seen in the Apps category. Click the link to view the listing of the documents in file system.

Control Panel View

Figure 1 Documents Media File System Checker portlet in Apps category

Dashboard View – Missing Documents

No Missing Documents: The dashboard will display the following message if no missing documents exist in the file system.

Dashboard View – Missing Documents

Figure 2 No missing documents in file system message

Missing Documents Exist: The dashboard will display the list of missing documents in the file system that have a corresponding file entry in the database. The listing is displayed as shown below.

Missing Documents Exist

Figure 3 Display missing documents in the file system using data table

Default View: The dashboard displays the list of missing documents in the file system in the default view, as shown below.

Default View

Figure 4 Default View Type – Show Missing Documents in file system

Missing Documents Status: The missing documents displayed in the listing are shown with the error status icon.

Missing Documents Status

Figure 5 Display status column with red error icons for the missing documents

Resolve Missing Documents – Create Dummy File

The user can create a dummy file in the file system to reestablish synchronization between the database and the file system.

Resolve Missing Documents

Figure 6 Actions pertaining to each of the missing documents in the listing

Create Dummy File in File System: This will create a dummy file in the file system to compensate for the missing document. The path and the version of the dummy document will correspond to the file entry in database that represents the missing document.

Dashboard View – All Documents

Selecting the option to show all documents will list all the documents residing in the file system that are in sync with the database along with all the missing documents in file system that have a representation in the database. The listing is displayed as shown below.

Dashboard View

Figure 7 View Type – Show All Documents in displays all documents in the file system including the missing ones in file system

Documents Status: The status columns for documents residing in file system that have a valid representation in database are denoted with green icons and the missing documents that have a representation in database are denoted with red error icons. The status icons can be seen below.

Documents Status

Figure 8 View Type – All valid documents in database have a green icon status and the missing ones are denoted using a red error icon.

Navigation:

The page navigation feature as shown below is used to navigate across the listing of documents back and forth. The Previous and Next buttons navigate in the backward and forward direction respectively. The page numbers display the data view for the given page.

The page navigation

Figure 9 Navigate through the dataset using the pagination feature

Data set:

The dropdown shown below is used to modify the number of documents/entries per page. The is useful for navigational purpose over a large set of documents. The default value is 10.

Data set

Figure 10 Modify the number of entries per page view using the dropdown shown

Visit the Liferay Marketplace to download.

Share This