Liferay Resource Importer is a great tool for Theme developers to import Web Content, Structures, Templates, Document Media Library as well as Page Templates, Dynamic Data Lists(DDL) and Application Display Templates(ADT). If you are a theme developer, then you may already have used Resource Importer for importing theme resources like Web Content, Structures, Templates and Documents. However there might come a scenario when you want to import Application Display Templates(ADT) or Dynamic Data Lists structures, templates including display templates and form templates. Here is a blog to import such ADT or DDL along with theme resources in Liferay theme.
Prerequisite :
Basic Knowledge of Liferay Theme Development, Application Display Templates or Dynamic Data Lists, Liferay Theme Importer.
You can follow blog about Liferay Application Display Template (ADT), in case you are not aware with Liferay ADT.
First of all you need to uncomment following line in liferay-plugin-package.properties file of your theme.
Now you need to add all your resources in resources-importer folder under /WEB-INF/src. Consider following folder structure.
Liferay also provides templates-importer to import your template resources but do not use template-importer along with resources-importer as code for import using these two technique are written in 'else..if' condition so only one will work at a time.
You can create one sample theme which will import web content, structure, template files along with ADT. Consider following folder structure of sample theme. This theme will create and import one About Us web content (with Structure & Template) and ADT for Asset Publisher.
Here you need to create one Structure named “About Us” and add about_us.xml file under structures folder. Next step is to create folder having same name as structure xml file under templates and articles folder. Now add source files(about_us.vm, about_us.xml) of templates and content under these created folders. Now you can add ADT file under application_display folder. You can get sample News_ADT_Custom.vm ADT file from Liferay Application Display Template (ADT) Blog.
Once you deploy the theme, create one site using Site Template from deployed theme. Now you can see imported Web Contents and ADT under Site Administration of created site.
Note : In versions till LR 6.2 CE GA2, there is some issue with the resource importer plugin so in that Liferay ADT or DDL won’t be imported. If you want to import ADT or DDL with Resource Importer in CE GA2 or older version then you can update Resource Importer plugin.