emiloberg / liferay-ddmtool

Tool for authoring, uploading, downloading and synchronizing Liferay DDM related stuff (Structures and Templates) across environments.
MIT License
36 stars 16 forks source link

Generic templates not tied to a structure support #1

Open pavelfomin opened 9 years ago

pavelfomin commented 9 years ago

In Liferay 6.2, you have options for whether you want your template to be permanently linked to your structure. Generic templates are templates that are not tied to a structure, which allows for reusable code that can be imported into other templates.

A good example is the template for the Dynamic Data List. Currently, such template can be downloaded but the following error is thrown when trying to upload the changes: Template didn't match structure. (Error 5001).

What would it take to support the generic templates not tied to a structure?

emiloberg commented 9 years ago

A Template needs to be tied to a Structure. This is a known limitation of the current version of the DDM Tool. As you pointed out, it's not a Liferay limitation but a limitation of the Tool. When trying to figure out what kind of template we're dealing with, we're also looking a the structure. However, this logic is not set in stone and may be changed.

But, I'm a little bit puzzled. How have you managed to create a DDL Template which is not tied to a DDL structure (Data Definition)? If go to the Control Panel and click Dynamic Data List > Manage Data Definitions > Actions on a Data Definitions > Templates, those templates are tied to that Data Definition.

This be another bug. Is it a DDL forms or display template you're working with? Forms currently don't work, but it should be an easy fix to do it.

pavelfomin commented 9 years ago

Good point. I didn't realize that the display templates can be accessed via Manage Data Definitions -> Actions -> Templates. I've followed the liferay instructions and added the display template via Add Display Template option on the dynamic list from the site page. You are correct though the template is tied to the structure which is confirmed by Manage Data Definitions -> Actions -> Templates.Both the structure and the template are downloaded under dynamic_data_lists -> structures / templates but the subsequent upload fails with

Could not upload file!
mName:      undefined
mError:     Template didn't match structure. (Error 5001
mFile Path: /portal-ddm/dynamic_data_lists/templates/Product carousel template.ftl