INSERT INTO TEMPLATE (ID, TYPE, PATH, CONTENT) VALUES (1, 'NOTIFY', '/db/notify/apns/hae_motion.txt', '{
	"notifications":
	[
		{	
			"tokens":[ [# th:each="TOKEN,iter : ${TOKENS}" ][# th:if="${iter.index}>0"] ,[/]"[(${TOKEN})]"[/] ],
			"platform":1,
			"data":{"aps":{"alert":{"loc-key":"motion_detected_by","loc-args":["[(${CAMERA_NAME})]", "[(${#dates.format(new java.util.Date(), ''yy.MM.dd H:mm'')})]"]}, "sound":"default"}},
			"priority":"high",
			"topic":"com.vestiacom.internetboxvoip", 
			"sound":"default"
		}
	]
}');
INSERT INTO TEMPLATE (ID, TYPE, PATH, CONTENT) VALUES (3, 'NOTIFY', '/db/notify/apns/voip.txt', '{
	"notifications":
	[
		{
			"tokens":[ [# th:each="TOKEN,iter : ${TOKENS}" ][# th:if="${iter.index}>0"] ,[/]"[(${TOKEN})]"[/] ],
			"platform":1,
			"data":{"aps":{"alert":"You got a VoIP call."},"callingnr":"[(${callingnr})]","extnr":[ [# th:each="er,iter : ${extnr}" ][# th:if="${iter.index}>0"] ,[/]"[(${er})]"[/] ]},
			"priority":"high"
		}
	]
}');
INSERT INTO TEMPLATE (ID, TYPE, PATH, CONTENT) VALUES (4, 'NOTIFY', '/db/notify/gcm/voip.txt', '{
	"notifications":
	[
		{
			"tokens":[ [# th:each="TOKEN,iter : ${TOKENS}" ][# th:if="${iter.index}>0"] ,[/]"[(${TOKEN})]"[/] ],
			"platform":2,
			"data":{"aps":{"alert":"You got a VoIP call."},"callingnr":"[(${callingnr})]","extnr":[ [# th:each="er,iter : ${extnr}" ][# th:if="${iter.index}>0"] ,[/]"[(${er})]"[/] ]},
			"priority":"high"
		}
	]
}');
INSERT INTO TEMPLATE (ID, TYPE, PATH, CONTENT) VALUES (2, 'NOTIFY', '/db/notify/gcm/hae_motion.txt', '{
	"notifications":
	[
		{
			"tokens":[ [# th:each="TOKEN,iter : ${TOKENS}" ][# th:if="${iter.index}>0"] ,[/]"[(${TOKEN})]"[/] ],
			"platform":2,
			"data":{"cameraName":"[(${CAMERA_NAME})]", "dateEvent":"[(${#dates.format(new java.util.Date(), ''EEE MMM d HH:mm:ss z yyyy'')})]"}, 
			"priority":"high"
		}
	]
}');

INSERT INTO NOTIFY_PLATFORM (ID, PLATFORM, COMPONENT) VALUES (1, 'APNS', 'remoteNotificationEngine');
INSERT INTO NOTIFY_PLATFORM (ID, PLATFORM, COMPONENT) VALUES (2, 'GCM', 'remoteNotificationEngine');

INSERT INTO NOTIFY_TYPE (ID, TYPE, EVENT_NAME, ACTIVE, PLATFORM_ID, CONTENT_TEMPLATE_ID, TITLE_TEMPLATE_ID, REQUEST_URLS) VALUES (1, 'LOGITECH', 'MOTION', 1, 1, 1, null, 'http://195.186.157.201:8089/api/push;http://195.186.157.202:8089/api/push;http://195.186.157.203:8089/api/push;http://195.186.196.201:8089/api/push;http://195.186.196.202:8089/api/push;http://195.186.196.203:8089/api/push');
INSERT INTO NOTIFY_TYPE (ID, TYPE, EVENT_NAME, ACTIVE, PLATFORM_ID, CONTENT_TEMPLATE_ID, TITLE_TEMPLATE_ID, REQUEST_URLS) VALUES (2, 'LOGITECH', 'MOTION', 1, 2, 2, null, 'http://195.186.157.201:8089/api/push;http://195.186.157.202:8089/api/push;http://195.186.157.203:8089/api/push;http://195.186.196.201:8089/api/push;http://195.186.196.202:8089/api/push;http://195.186.196.203:8089/api/push');
INSERT INTO NOTIFY_TYPE (ID, TYPE, EVENT_NAME, ACTIVE, PLATFORM_ID, CONTENT_TEMPLATE_ID, TITLE_TEMPLATE_ID, REQUEST_URLS) VALUES (3, 'VOIP', 'CALL', 1, 1, 3, null, 'http://195.186.157.201:8088/api/push;http://195.186.157.202:8088/api/push;http://195.186.157.203:8088/api/push;http://195.186.196.201:8088/api/push;http://195.186.196.202:8088/api/push;http://195.186.196.203:8088/api/push');
INSERT INTO NOTIFY_TYPE (ID, TYPE, EVENT_NAME, ACTIVE, PLATFORM_ID, CONTENT_TEMPLATE_ID, TITLE_TEMPLATE_ID, REQUEST_URLS) VALUES (4, 'VOIP', 'CALL', 1, 2, 4, null, 'http://195.186.157.201:8088/api/push;http://195.186.157.202:8088/api/push;http://195.186.157.203:8088/api/push;http://195.186.196.201:8088/api/push;http://195.186.196.202:8088/api/push;http://195.186.196.203:8088/api/push');

commit;
