001
014
015 package com.liferay.portlet.dynamicdatamapping.util;
016
017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018 import com.liferay.portal.kernel.xml.Document;
019 import com.liferay.portal.kernel.xml.DocumentException;
020
021 import java.io.IOException;
022
023 import java.util.Locale;
024
025
029 public class DDMXMLUtil {
030
031 public static String formatXML(Document document) throws IOException {
032 return getDDMXML().formatXML(document);
033 }
034
035 public static String formatXML(String xml)
036 throws DocumentException, IOException {
037
038 return getDDMXML().formatXML(xml);
039 }
040
041 public static DDMXML getDDMXML() {
042 PortalRuntimePermission.checkGetBeanProperty(DDMXMLUtil.class);
043
044 return _ddmXML;
045 }
046
047 public static String updateXMLDefaultLocale(
048 String xml, Locale contentDefaultLocale,
049 Locale contentNewDefaultLocale)
050 throws DocumentException, IOException {
051
052 return getDDMXML().updateXMLDefaultLocale(
053 xml, contentDefaultLocale, contentNewDefaultLocale);
054 }
055
056 public void setDDMXML(DDMXML ddmXML) {
057 PortalRuntimePermission.checkSetBeanProperty(getClass());
058
059 _ddmXML = ddmXML;
060 }
061
062 private static DDMXML _ddmXML;
063
064 }