matethurzo/liferay-portal — pull request #885 by moltam89 (2014-12-11 18:11:13+00:00)
Title: Asset Publisher export / import

Hey Máté,

here is my first attempt to implement the data export / import for the Asset Publisher.
Sorry for sending this stuff right now, I know you are quite busy at the moment.
Of course this is not a top priority issue.

As the main idea is to have the same "view" in the live site as well, I decided to use some of the functionality from the AP, this should ensure that the currently displayed entries will be exported:

I'm using the AssetPublisherUtil.getAssetEntries method which is used by the AP as well.

I decided to use the AssetRenderers, as there are additional logic for the entry selection. E.g. In the JournalArticleAssetRendererFactory class getAssetRenderer method there is a small piece of code which returns the displayed article. I think it's necessary to have this logic during the export process as well, otherwise in some cases the wrong article version would be exported.

I'm following the pattern from JournalContentPortletDataHandler, where the doProcessExportPortletPreferences and doProcessImportPortletPreferences methods are responsible for the data export/import.

LIMITATIONS:

Right now my code only works if the AP is set to MANUAL asset selection. To get the assetEntries in dynamic mode is not that straightforward, however it will result an assetEntry list as well, so the concept will be the same.

UI is completely missing.

The AP could be configured to show entries from other Sites as well. As far as I know it's not ideal for the export/import framework. Right now only entries from the same group are considered.

cc @zsigmondrab

Thanks,
Tamás