The Export/Import and Staging features give users the power to plan page publication and manage content. The Export/Import feature lets users export content from the portal and import external content into the portal. Providing the export feature in your application gives users the flexibility of exporting content they’ve created in your application to other places, such as another portal instance, or to save the content for a later use. Import does the opposite: it brings the data from a LAR file into your portal.

For instance, suppose you’re managing an online education course. Because of the nature of an online course, the site’s data (grades, assignments, etc.) is purged every semester to make way for new incoming students. In a scenario like this, there is a need to frequently store a complete record of all data given during a course. The institution offering the course must keep records of the course’s data for a minimum number of years. To abide by these requirements, having a gradebook application with an export/import feature would let you clear the application’s data for a new semester, but save the previous class’s work. You could export the students’ grades as a LAR file and save it outside the course’s site. If the grades ever needed to be accessed again, you could import the LAR and view the student records.

The Export/Import feature adds another dimension to your application by letting you produce reusable content and import content from other places. To learn more about using the Export/Import feature, visit the Exporting/Importing App Data User Guide section.

Staging lets you change your site behind the scenes without affecting the live site, and then you can publish all the changes in one fell swoop. Keep in mind that Staging leverages the Export/Import framework, which is an essential part of the publishing process. If you include staging support in your application, your users can stage its content until it’s ready.

For example, if you have an application that provides information intended only during a specific holiday, supporting the Staging environment lets users save your application’s assets specific for that holiday. They’ll reside in the Staging environment until they’re ready for publishing. To learn more about Staging, visit the Staging Content for Publication section.

Besides configuring these features for your application, you can also access APIs that let you write custom code, extending Liferay’s default functionality.

In this section of tutorials, you’ll learn how to implement Staging and the Export/Import framework. The main areas of Staging code to focus on are outlined below:

  1. StagedModel: The StagedModel is the cornerstone of Staging. All content that must be handled in Staging should implement this interface; it provides the behavior contract for the entities Staging uses during the Staging process.

  2. StagedModelDataHandler: These data handlers are responsible for handling one specific entity class. For example, the BookmarksEntryStagedModelDataHandler handles the BookmarksEntry during Staging: exporting data, serializing content, finding existing entries, etc.

  3. PortletDataHandler: These data handlers are responsible for handling aspects of the portlet’s configuration and publication during Staging.

  4. ExportActionableDynamicQuery: This framework is useful when developing Staging support. Its purpose is to query data from the database and process it during publication. It’s automatically generated if your entity contains the right fields so there’s no need to worry about configuring it.

  5. ExportImportContentProcessor and ExportImportPortletPreferencesProcessor: Advanced frameworks only needed in special cases. The ExportImportContentProcessor lets you process your content during a publication process. The ExportImportPortletPreferencesProcessor lets you process your portlet preferences (application’s configuration) during a publication process.

Decision to Implement Staging

Staging is an advanced publication tool that lets you create or modify your site before releasing it to the public. Most of Liferay Portal’s included applications (e.g., Web Content, Bookmarks,...

Read More

Understanding Staged Models

To track an entity of an application with the Staging framework, you must implement the StagedModel interface in the app’s model classes. It provides the behavior contract for entities during the...

Read More

Generating Staged Models Using Service Builder

A Staged model is an essential building block to implementing the Staging and Export/Import frameworks in your application. Instead of having to create staged models for your app manually, you can...

Read More

Creating Staged Models Manually

There are times when using Service Builder to generate your staged models is not practical. In these cases, you should create your staged models manually. Make sure to read the Adapting Your...

Read More

Understanding Data Handlers

A common requirement for many data driven applications is to import and export data. This could be accomplished by accessing your database directly and running SQL queries to export/import data;...

Read More

Developing Portlet Data Handlers

There are two types of data handlers you can implement: Portlet Data Handlers and Staged Model Data Handlers. For more information on the fundamentals behind Liferay’s data handlers and how a LAR...

Read More

Developing Staged Model Data Handlers

There are two types of data handlers you can implement: Portlet Data Handlers and Staged Model Data Handlers. For more information on the fundamentals behind Liferay’s data handlers and how a LAR...

Read More

Using the Export/Import Lifecycle Listener Framework

The ExportImportLifecycleListener framework lets developers write code that listens for certain staging or export/import events during the publication process. The staging and export/import...

Read More

Initiating New Export/Import Processes

The Staging and Export/Import features are the building blocks for creating, managing, and publishing a site. These features can be accessed in the Publishing Tools menu. You can also, however,...

Read More
0 (0 Votes)
Social API Previous