All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anosite.gen.assitedata.data.PageTemplateXMLHelper Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
/**
 ********************************************************************************
 *** PageTemplateXMLHelper.java                                               ***
 *** generated by AnoSiteGenerator (ASG), Version: 3.2.2                      ***
 *** Copyright (C) 2005 - 2023 Anotheria.net, www.anotheria.net               ***
 *** All Rights Reserved.                                                     ***
 ********************************************************************************
 *** Don't edit this code, if you aren't sure                                 ***
 *** that you do exactly know what you are doing!                             ***
 *** It's better to invest time in the generator, as into the generated code. ***
 ********************************************************************************
 */

package net.anotheria.anosite.gen.assitedata.data;

import net.anotheria.util.xml.XMLNode;
import net.anotheria.util.xml.XMLAttribute;
import net.anotheria.asg.data.XMLHelper;
import net.anotheria.asg.data.MultilingualObject;
import java.util.List;

public class PageTemplateXMLHelper{

		public static final String[] LANGUAGES = new String[]{"EN","DE"};
		private static XMLNode _toXML(PageTemplate object, String[] languages){
			XMLNode ret = new XMLNode("PageTemplate");
			ret.addAttribute(new XMLAttribute("id", object.getId()));

			ret.addChildNode(XMLHelper.createXMLNodeForStringValue("name", null, object.getName()	));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("mediaLinks", "string", object.getMediaLinks()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("scripts", "string", object.getScripts()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("c1first", "string", object.getC1first()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("c2first", "string", object.getC2first()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("c3first", "string", object.getC3first()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("c1last", "string", object.getC1last()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("c2last", "string", object.getC2last()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("c3last", "string", object.getC3last()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("meta", "string", object.getMeta()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("header", "string", object.getHeader()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("footer", "string", object.getFooter()));
			ret.addChildNode(XMLHelper.createXMLNodeForListValue("localizations", "string", object.getLocalizations()));
			ret.addChildNode(XMLHelper.createXMLNodeForTextValue("description", null, object.getDescription()	));

			ret.addChildNode(XMLHelper.createXMLNodeForStringValue("layout", null, object.getLayout()	));
			ret.addChildNode(XMLHelper.createXMLNodeForStringValue("site", null, object.getSite()	));

			if(object instanceof MultilingualObject){
				MultilingualObject multilangDoc = (MultilingualObject) object;
				ret.addChildNode(XMLHelper.createXMLNodeForBooleanValue("multilingualDisabled", null, multilangDoc.isMultilingualDisabledInstance()));
			}
			return ret;
		}

		public static XMLNode toXML(PageTemplate object){
			return _toXML(object, LANGUAGES);
		}

		public static XMLNode toXML(PageTemplate object, String... languages){
			if (languages==null || languages.length==0)
				return toXML(object);
			return _toXML(object, languages);
		}

		public static PageTemplate fromXML(XMLNode node){
			return null;
		}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy