<commit_before>(function() {

	var ds = angular.module('axelor.ds', ['ngResource']);
	
	var forEach = angular.forEach,
		extend = angular.extend,
		isArray = angular.isArray;

	ds.factory('RestService', ['$resource', function($resource) {

		// GET 		ws/rest/:model				= fetch list
		// POST		ws/rest/:model				= save (create/update)
		// PUT		ws/rest/:model				= create
		// POST		ws/rest/:model/:id			= update
		// GET		ws/rest/:model/:id			= read
		// DELETE	ws/rest/:model/:id			= delete
		// POST		ws/rest/:model/:id/remove	= delete (with payload)
		// GET		ws/rest/:model/:id/copy		= get copy
		// GET		ws/rest/:model/:id/details	= get details
		// POST		ws/rest/:model/search		= advance search
		
		function getResource(model) {
			
			return $resource('ws/rest/'+ model +'/:id/:_action', {id: '@id'}, {
				'query':  	{ method: 'GET'},
				'search': 	{ method: 'POST', params: {id: 'search'}},
				'create': 	{ method: 'PUT'},
				'update': 	{ method: 'POST'},
				'remove': 	{ method: 'POST', params: {_action: 'remove'}},
				'copy':    	{ method: 'GET', params: {_action: 'copy'}},
				'details': 	{ method: 'GET', params: {_action: 'details'}}
			});
		}
		
		return { get: getResource };
	}]);
	
	ds.factory('MenuService', ['$http', function($http) {

		function get(parent) {

			return $http.get('ws/action/menu', {
				params : {
					parent : parent
				}
			});
		}

		function action(name) {

			return $http.post('ws/action/' + name, {
				model : 'com.axelor.meta.db.MetaMenu',
				data : {}
			});
		}

		return {
			get: get,
			action: action
		};
	}]);

	ds.factory('ViewService', ['$http', '$q', '$compile', function($http, $q, $compile) {

		var ViewService = function() {
			
			this.FIELD_TYPES = {
				'STRING'		: 'string',
				'INTEGER'		: 'integer',
				'DECIMAL'		: 'decimal',
				'BOOLEAN'		: 'boolean',
				'DATE'			: 'date',
				'TIME'			: 'time',
				'DATETIME'		: 'datetime',
				'TEXT'			: 'text',
				'ONE_TO_ONE'	: 'many-to-one',
				'MANY_TO_ONE'	: 'many-to-one',
				'ONE_TO_MANY'	: 'one-to-many',
				'MANY_TO_MANY'	: 'many-to-many',
				'label'			: 'static', 
				'notebook'		: 'tabs',
				'page'			: 'tab',
				'password'		: 'password',
				'SuggestBox'	: 'suggest-box',
				'CodeEditor'	: 'code-editor',<commit_msg>Added long field widget (RM-1052).<commit_after>(function() {

	var ds = angular.module('axelor.ds', ['ngResource']);
	
	var forEach = angular.forEach,
		extend = angular.extend,
		isArray = angular.isArray;

	ds.factory('RestService', ['$resource', function($resource) {

		// GET 		ws/rest/:model				= fetch list
		// POST		ws/rest/:model				= save (create/update)
		// PUT		ws/rest/:model				= create
		// POST		ws/rest/:model/:id			= update
		// GET		ws/rest/:model/:id			= read
		// DELETE	ws/rest/:model/:id			= delete
		// POST		ws/rest/:model/:id/remove	= delete (with payload)
		// GET		ws/rest/:model/:id/copy		= get copy
		// GET		ws/rest/:model/:id/details	= get details
		// POST		ws/rest/:model/search		= advance search
		
		function getResource(model) {
			
			return $resource('ws/rest/'+ model +'/:id/:_action', {id: '@id'}, {
				'query':  	{ method: 'GET'},
				'search': 	{ method: 'POST', params: {id: 'search'}},
				'create': 	{ method: 'PUT'},
				'update': 	{ method: 'POST'},
				'remove': 	{ method: 'POST', params: {_action: 'remove'}},
				'copy':    	{ method: 'GET', params: {_action: 'copy'}},
				'details': 	{ method: 'GET', params: {_action: 'details'}}
			});
		}
		
		return { get: getResource };
	}]);
	
	ds.factory('MenuService', ['$http', function($http) {

		function get(parent) {

			return $http.get('ws/action/menu', {
				params : {
					parent : parent
				}
			});
		}

		function action(name) {

			return $http.post('ws/action/' + name, {
				model : 'com.axelor.meta.db.MetaMenu',
				data : {}
			});
		}

		return {
			get: get,
			action: action
		};
	}]);

	ds.factory('ViewService', ['$http', '$q', '$compile', function($http, $q, $compile) {

		var ViewService = function() {
			
			this.FIELD_TYPES = {
				'STRING'		: 'string',
				'INTEGER'		: 'integer',
				'LONG'			: 'integer',
				'DECIMAL'		: 'decimal',
				'BOOLEAN'		: 'boolean',
				'DATE'			: 'date',
				'TIME'			: 'time',
				'DATETIME'		: 'datetime',
				'TEXT'			: 'text',
				'ONE_TO_ONE'	: 'many-to-one',
				'MANY_TO_ONE'	: 'many-to-one',
				'ONE_TO_MANY'	: 'one-to-many',
				'MANY_TO_MANY'	: 'many-to-many',
				'label'			: 'static', 
				'notebook'		: 'tabs',
				'page'			: 'tab',
				'password'		: 'password',
				'SuggestBox'	: 'suggest-box',
				'CodeEditor'	: 'code-editor',
{'fraction_non_alphanumeric': 0.21001968934587617, 'fraction_numerical': 0.0008750820389411508, 'mean_word_length': 2.669341894060995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6601986', 'n_tokens_mistral': 2125, 'n_tokens_neox': 1800, 'n_words': 337}