juliocamarero/liferay-portal — pull request #639 by KocsisDaniel (2012-10-30 16:10:14+00:00)
Title: LPS-30483

Hi Julio,

I heard from Mate you are really busy, so please feel free to delay or re-assign this pull request, I just wanted to send to you because you really know this area.

After I checked the issue and the environment we have for the language compatibility I found the following problems:
- we handle the name-description-structure as interconnected fields in DDMStructures, however on the UI or in the error messages we don't have any visible signs for this. It means it is required to have a name translation in the structure default language. As a user I can't change the structure default without adding a new translation to the name, meanwhile the UI let me do this without any notification. I think it is a bit confusing, but we need to have this logic to make our life easier. So I wouldn't touch this (the journal follows the same, but there we have only one, global language bar to change the article locale, so it is more consistent).
- we handle these fields also together in the export/import logic when we determine the default import locale. It is because we check only the structure locale and apply the change(if happened) to all the localized fields. So +1 to not change the locale validation.
- the only thing I can see we can modify is the way how we create the DLFileEntryType object. Currently we add the name and description to the locale maps with the user locale and the system default locale. During the import it is not always working because it is possible the structure have a valid locale but different from these 2. However we don't create any name or title with that locale and even doesn't check the structure XML. In case of the fileEntryType the name and locale translations are not valid ones, because the fields in the UI are not localized, we just create translations with the same value to pass valid maps to the DDMStructure service.

My solution is to check the ddmStructure which already exists, at least in the form of XML before we create the name/description maps with all the translation what the structure has. I also added a test for that to make sure we won't brake this one more time.

Please feel free to disagree, because there are several ways how we could resolve this, but I think this one fits best into the current structure.

thanks,
Daniel