001
014
015 package com.liferay.portlet.dynamicdatamapping.model.impl;
016
017 import com.liferay.portal.kernel.util.LocaleUtil;
018 import com.liferay.portal.kernel.xml.Document;
019 import com.liferay.portal.kernel.xml.Element;
020 import com.liferay.portal.kernel.xml.SAXReaderUtil;
021
022 import java.util.Locale;
023
024
027 public class DDMTemplateImpl extends DDMTemplateBaseImpl {
028
029 public DDMTemplateImpl() {
030 }
031
032 public String getDefaultLanguageId() {
033 Document document = null;
034
035 try {
036 document = SAXReaderUtil.read(getName());
037
038 if (document != null) {
039 Element rootElement = document.getRootElement();
040
041 return rootElement.attributeValue("default-locale");
042 }
043 }
044 catch (Exception e) {
045 }
046
047 Locale locale = LocaleUtil.getDefault();
048
049 return locale.toString();
050 }
051
052 }