package com.webpagebytes.cms.appinterfaces;

import java.util.Map;
import java.util.Set;

public class WBModel {
	
	public static final String GLOBALS_KEY = "wbGlobals";
	public static final String REQUEST_KEY = "wbRequest";
	public static final String PAGE_PARAMETERS_KEY = "wbPageParams";
	public static final String URI_PARAMETERS_KEY = "wbUriParams";
	
	public static final String PAGE_CONTROLLER_MODEL_KEY = "wbPageModel";
	public static final String URI_CONTROLLER_MODEL_KEY = "wbUriModel";
	
	public static final String LOCALE_KEY = "wbLocale";
	public static final String LOCALE_LANGUAGE_KEY = "wbLocaleLanguage";
	public static final String LOCALE_COUNTRY_KEY = "wbLocaleCountry";
	public static final String LOCALE_MESSAGES = "wbMessages";
	public static final String MODULE_DIRECTIVE = "wbModule";
	public static final String IMAGE_DIRECTIVE = "wbImage";
	public static final String ARTICLE_DIRECTIVE = "wbArticle";
	public static final String TEXT_FORMAT_DIRECTIVE = "wbFormatText";
	public static final String FORMAT_TEXT_METHOD = "wbFormatText";
	
	
	public static final String GLOBAL_PROTOCOL = "WB_GLOBAL_PROTOCOL";
	public static final String GLOBAL_DOMAIN = "WB_GLOBAL_DOMAIN";
	public static final String GLOBAL_URI_PREFIX = "WB_GLOBAL_URI_PREFIX";

	protected WBCmsModel cmsModel = new WBCmsModel();
	protected WBCustomModel customModel = new WBCustomModel();
	
	public WBCmsModel getCmsModel()
	{
		return cmsModel;
	}
	public WBCustomModel getCmsCustomModel()
	{
		return customModel;
	}
	
	public void transferModel(Map<String, Object> rootObject)
	{
		Set<String> keys = cmsModel.keySet();
		for(String key: keys)
		{
			rootObject.put(key, cmsModel.get(key));
		}
				
	}
}

@@ -152,16 +152,17 @@
 KEY = %22w
+p
 bGlobals
@@ -208,16 +208,17 @@
 KEY = %22w
+p
 bRequest
@@ -268,24 +268,25 @@
 ERS_KEY = %22w
+p
 bPageParams%22
@@ -334,24 +334,25 @@
 ERS_KEY = %22w
+p
 bUriParams%22;
@@ -412,16 +412,17 @@
 KEY = %22w
+p
 bPageMod
@@ -483,16 +483,17 @@
 KEY = %22w
+p
 bUriMode
@@ -537,24 +537,25 @@
 ALE_KEY = %22w
+p
 bLocale%22;%0A%09p
@@ -600,24 +600,25 @@
 AGE_KEY = %22w
+p
 bLocaleLangu
@@ -674,16 +674,17 @@
 KEY = %22w
+p
 bLocaleC
@@ -740,16 +740,17 @@
 GES = %22w
+p
 bMessage
@@ -802,16 +802,17 @@
 IVE = %22w
+p
 bModule%22
@@ -861,16 +861,17 @@
 IVE = %22w
+p
 bImage%22;
@@ -921,16 +921,17 @@
 IVE = %22w
+p
 bArticle
@@ -983,24 +983,25 @@
 RECTIVE = %22w
+p
 bFormatText%22
@@ -1053,16 +1053,17 @@
 HOD = %22w
+p
 bFormatT
@@ -1116,24 +1116,25 @@
 ROTOCOL = %22W
+P
 B_GLOBAL_PRO
@@ -1183,24 +1183,25 @@
 _DOMAIN = %22W
+P
 B_GLOBAL_DOM
@@ -1256,16 +1256,17 @@
 FIX = %22W
+P
 B_GLOBAL

rename freemarker predefined model variables of webpagebytes to start with wpb