-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcat-angular-require.js.map
1 lines (1 loc) · 209 KB
/
cat-angular-require.js.map
1
{"version":3,"sources":["js-header-require.js.tpl","base/Facet.js","base/SearchRequest.js","controller/cat-base-detail-controller.js","controller/cat-base-list-controller.js","controller/cat-base-tabs-controller.js","config/cat-messages-config.js","filters/cat-replacetext.js","directives/cat-autofocus.js","directives/cat-breadcrumbs.js","directives/cat-checkbox.js","directives/cat-confirm-click.js","directives/cat-element-visible.js","directives/cat-facets.js","directives/cat-field-errors-info.js","directives/cat-field-errors.js","directives/cat-global-errors.js","directives/cat-i18n.js","directives/cat-icon.js","directives/cat-input-group.js","directives/cat-input.js","directives/cat-load-more.js","directives/cat-main-menu.js","directives/cat-messages.js","directives/cat-paginated.js","directives/cat-select.js","directives/cat-sortable.js","directives/cat-validation-group.js","directives/form.js","directives/numbers-only.js","i18n/cat-i18n-translations_de.js","i18n/cat-i18n-translations_en.js","service/cat-api-service.js","service/cat-breadcrumbs-service.js","service/cat-conversion-service.js","service/cat-element-visibility-service.js","service/cat-i18n-locale-service.js","service/cat-i18n-message-source-service.js","service/cat-i18n-service.js","service/cat-list-data-loading-service.js","service/cat-route-service.js","service/cat-search-service.js","service/cat-select-config-service.js","service/cat-url-resolver-service.js","service/cat-validation-service.js","service/cat-view-config-service.js","service/cat-view-service.js","service/http-interceptor.js","service/loading-service.js","service/main-menu-service.js","service/message-service.js","util/cat-naming-util.js","util/cat-route-util.js","module.js","js-footer-require.js.tpl"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzBA;;;;;;;;;;;;;;;;AAgBA,OAAO,IAAI,YAAY,UAAU,MAAM;IACnC,IAAI,SAAS,WAAW,OAAO;;IAE/B,KAAK,KAAK,KAAK;IACf,KAAK,OAAO,KAAK;IACjB,KAAK,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I,KAAK,WAAW,KAAK,GAAG,IAAI,MAAM,MAAM,KAAK,IAAI,MAAM;QAC/D,OAAO,EAAE,SAAS;;;;AAI1B;ACxDA;;;;AAIA;;AAEA,OAAO,IAAI,OAAO,OAAO,IAAI,QAAQ;;AAErC,OAAO,IAAI,SAAS,OAAO,IAAI,UAAU;;;;;;;AAOzC,OAAO,IAAI,KAAK,uBAAuB,UAAU,MAAM;IACnD,OAAO,OAAO,IAAI,OAAO;EAC3B;ACjBF,QAAQ,OAAO,eAAe,CAAC;;AAE/B,QAAQ,OAAO,eAAe;IAC1B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;AAGJ,QAAQ,OAAO,kBAAkB,CAAC,8BAA8B;;AAEhE,QAAQ,OAAO,kBAAkB;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;AAGJ,QAAQ,OAAO,OAAO;IAClB;IACA;IACA;IACA;IACA;;AAEJ;ACnDA;AACA","file":"cat-angular-require.js","sourcesContent":["/*!\r\n Copyright 2014-2015 the original author or authors.\r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\ndefine([\r\n 'jQuery',\r\n 'lodash',\r\n 'angular',\r\n 'angular-spinner',\r\n 'angular-ui-select2',\r\n 'angular-ui-router',\r\n 'angular-ui-bootstrap'\r\n ], function($, _, angular) {\r\n 'use strict';\r\n window.cat = window.cat || {};","'use strict';\r\n\r\n/**\r\n * @ngdoc function\r\n * @name cat.FacetTerm\r\n * @module cat\r\n *\r\n * @description\r\n * A 'FacetTerm' model used in conjunction with the cat-paginated directive where it represents a value of a group or\r\n * property which can be used to filter the shown list.\r\n * It consist of an id, a name and a count\r\n *\r\n * @param {Object} [data={}] the data used instantiate the object with. Usually this is the object representation\r\n * returned from the server.\r\n * @constructor\r\n */\r\nwindow.cat.FacetTerm = function (data) {\r\n if (data === undefined) data = {};\r\n\r\n this.id = data.id;\r\n this.name = data.name;\r\n this.count = data.count;\r\n};\r\n\r\n/**\r\n * @ngdoc overview\r\n * @name Facet\r\n *\r\n * @description\r\n * A 'Facet' model which is used in conjunction with the cat-paginated directive where it represents a group or\r\n * which property which can be used to filter the shown list.\r\n * It has a name and an array of FacetTerms\r\n *\r\n * @param {Object} [data={}] the data used instantiate the object with. Usually this is the object representation\r\n * returned from the server.\r\n * @constructor\r\n */\r\nwindow.cat.Facet = function (data) {\r\n if (data === undefined) data = {};\r\n\r\n this.name = data.name;\r\n this.terms = _.map(data.facets, function (facet) {\r\n return new window.cat.FacetTerm(facet);\r\n });\r\n};\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc function\r\n * @name cat.SearchRequest\r\n * @module cat\r\n *\r\n * @description\r\n * A 'SearchRequest' model used by the catApiService to provide the backend with certain filter, order, page and size\r\n * parameters.\r\n *\r\n *\r\n * @param {Object} [searchUrlParams] an object representing the search parameters of the current url, which are\r\n * used to initialize the properties of the SearchRequest\r\n * @constructor\r\n */\r\nwindow.cat.SearchRequest = function (searchUrlParams) {\r\n\r\n var _pagination = {\r\n page: 1,\r\n size: 100\r\n };\r\n var _sort = {};\r\n var _search = {};\r\n var _dirty = false;\r\n\r\n var lastEncoded;\r\n\r\n if (!!searchUrlParams && !_.isEmpty(searchUrlParams)) {\r\n _pagination.page = searchUrlParams.page || _pagination.page;\r\n _pagination.size = searchUrlParams.size || _pagination.size;\r\n _sort.property = searchUrlParams.sort || _sort.property;\r\n _sort.isDesc = searchUrlParams.rev || _sort.isDesc;\r\n _.forEach(_.keys(searchUrlParams), function (param) {\r\n if (param.indexOf('search.') > -1 && param.length > 7) {\r\n _search[param.substring(7)] = searchUrlParams[param];\r\n }\r\n });\r\n }\r\n\r\n var _encodeSort = function () {\r\n return (!!_sort.property ? 'sort=' + _sort.property + ':' + ((_sort.isDesc === true || _sort.isDesc === 'true') ? 'desc' : 'asc') : '');\r\n };\r\n\r\n var _encodePagination = function () {\r\n return 'page=' + (!!_pagination.page ? Math.max(0, _pagination.page - 1) : 0) + '&size=' + _pagination.size || 100;\r\n };\r\n\r\n var _concatenate = function (result, next) {\r\n if (!result) {\r\n return next;\r\n }\r\n\r\n if (!next) {\r\n return result;\r\n }\r\n return result + '&' + next;\r\n };\r\n\r\n var _encodeSearch = function () {\r\n if (!!_search && !_.isEmpty(_search)) {\r\n return $.param(_search, true);\r\n }\r\n\r\n return '';\r\n };\r\n\r\n var urlEndoded = function () {\r\n return _([_encodePagination(), _encodeSort(), _encodeSearch()]).reduce(_concatenate);\r\n };\r\n\r\n /**\r\n * @param {Object} [pagination] if given this object overrides the current 'pagination' state\r\n * @returns {{}} the object representing the current pagination state\r\n */\r\n this.pagination = function (pagination) {\r\n if (pagination === undefined) {\r\n return _pagination;\r\n } else {\r\n _pagination = pagination;\r\n _dirty = true;\r\n return _pagination;\r\n }\r\n };\r\n\r\n\r\n /**\r\n * @param {Object} [sort] if given this object overrides the current 'sort' state\r\n * @returns {{}} the object representing the current sort state\r\n */\r\n this.sort = function (sort) {\r\n if (sort === undefined) {\r\n return _sort;\r\n } else {\r\n _sort = sort;\r\n _dirty = true;\r\n return _sort;\r\n }\r\n };\r\n\r\n /**\r\n * @param {Object} [search] if given this object overrides the current 'search' state\r\n * @returns {{}} the object representing the current search state\r\n */\r\n this.search = function (search) {\r\n if (search === undefined) {\r\n return _search;\r\n } else {\r\n _search = search;\r\n _dirty = true;\r\n return _search;\r\n }\r\n };\r\n\r\n /**\r\n * @deprecated use catSearchService#encodeAsUrl instead\r\n *\r\n * @returns {String} a string representation of the current SearchRequest which can be used as part of the request\r\n * url\r\n */\r\n this.urlEncoded = function () {\r\n lastEncoded = urlEndoded();\r\n return lastEncoded;\r\n };\r\n\r\n this.setPristine = function () {\r\n _dirty = false;\r\n };\r\n\r\n /**\r\n * @returns {boolean} <code>true</code> if something changed since the last time {@link this#urlEncoded} was called\r\n */\r\n this.isDirty = function () {\r\n return _dirty;\r\n };\r\n\r\n /**\r\n * @deprecated use catSearchService#updateLocation instead\r\n *\r\n * A small helper function to update the current url to correctly reflect all properties set within this\r\n * SearchRequest\r\n * @param $location the angular $location service\r\n */\r\n this.setSearch = function ($location) {\r\n var ret = {};\r\n ret.page = _pagination.page;\r\n ret.size = _pagination.size;\r\n if (!!_sort.property) {\r\n ret.sort = _sort.property;\r\n ret.rev = _sort.isDesc || false;\r\n }\r\n _.forEach(_.keys(_search), function (s) {\r\n ret['search.' + s] = _search[s];\r\n });\r\n $location.search(ret);\r\n };\r\n};","'use strict';\r\n\r\n/**\r\n * @ngdoc controller\r\n * @name cat.controller.base.detail:CatBaseDetailController\r\n * @module cat.controller.base.detail\r\n *\r\n * @description\r\n * The CatBaseDetailController takes care of providing several common properties and functions to the scope\r\n * of every detail page. It also instantiates the controller given via the config.controller parameter and shares\r\n * the same scope with it.\r\n *\r\n * Common properties include:\r\n * * detail - the actual object to view\r\n * * editDetail - a copy of the detail object used for editing\r\n * * breadcrumbs - the breadcrumbs array\r\n * * uiStack - the ui stack array if parents exist\r\n * * editTemplate - the url of the edit template\r\n * * mainViewTemplate - the url of the main view template\r\n * * additionalViewTemplate - the url of the additional view template if it exists\r\n *\r\n * Common functions include:\r\n * * save - the save function to update / create an object\r\n * * edit - a function to switch from view to edit mode\r\n * * cancelEdit - a function to switch from edit to view mode (discarding all changes)\r\n * * add - a function to switch into edit mode of a new object\r\n * * remove - a function to delete the current object\r\n * * title - a function to resolve a 'title' of the current object\r\n *\r\n * @param {object} $scope DOCTODO\r\n * @param {object} $state DOCTODO\r\n * @param {object} $stateParams DOCTODO\r\n * @param {object} $location DOCTODO\r\n * @param {object} $window DOCTODO\r\n * @param {object} $globalMessages DOCTODO\r\n * @param {object} $controller DOCTODO\r\n * @param {object} $log DOCTODO\r\n * @param {object} catValidationService DOCTODO\r\n * @param {object} catBreadcrumbsService DOCTODO\r\n * @param {Object} config holds data like the current api endpoint, template urls, base url, the model constructor, etc.\r\n */\r\nfunction CatBaseDetailController($scope, $state, $stateParams, $location, $window, $globalMessages, $controller, $log, catValidationService, catBreadcrumbsService, config) {\r\n $scope.detail = config.detail;\r\n $scope.editDetail = undefined;\r\n\r\n $scope.config = config;\r\n var endpoint = config.endpoint;\r\n var templateUrls = config.templateUrls;\r\n var Model = config.Model;\r\n\r\n $scope.uiStack = catBreadcrumbsService.generateFromConfig(config);\r\n\r\n if ($stateParams.id === 'new') {\r\n catBreadcrumbsService.push({\r\n title: 'New',\r\n key: 'cc.catalysts.general.new'\r\n });\r\n } else {\r\n catBreadcrumbsService.push({});\r\n }\r\n\r\n $scope.editTemplate = templateUrls.edit;\r\n\r\n if (_.isObject(templateUrls.view)) {\r\n $scope.mainViewTemplate = templateUrls.view.main;\r\n $scope.additionalViewTemplate = templateUrls.view.additional;\r\n } else {\r\n $scope.mainViewTemplate = templateUrls.view;\r\n }\r\n\r\n /**\r\n * @returns {String|Number} A title of the current object or the 'id' as fallback\r\n */\r\n $scope.title = function () {\r\n var data = $scope.detail;\r\n if (_.isUndefined(data)) {\r\n return '';\r\n }\r\n return !!data.breadcrumbTitle ? data.breadcrumbTitle() : (!!data.name ? data.name : data.id);\r\n };\r\n\r\n var update = function () {\r\n catBreadcrumbsService.replaceLast({\r\n title: $scope.title()\r\n });\r\n $scope.$broadcast('cat-detail-updated', $scope.detail);\r\n };\r\n\r\n /**\r\n * reloads the current object from the server\r\n */\r\n $scope.reloadDetails = function () {\r\n endpoint.get($stateParams.id).then(function (data) {\r\n $scope.detail = data;\r\n update();\r\n });\r\n };\r\n\r\n $scope.exists = !!$stateParams.id && $stateParams.id !== 'new';\r\n\r\n /**\r\n * Creates a new copy of the given model and sets its parent if applicable.\r\n * Triggers a switch into the edit mode\r\n */\r\n $scope.add = function () {\r\n $scope.editDetail = new Model();\r\n if (_.isFunction($scope.editDetail.setParent)) {\r\n $scope.editDetail.setParent(config.parents[0]);\r\n }\r\n };\r\n\r\n /**\r\n * Creates a copy of the current object and triggers a switch into edit mode\r\n */\r\n $scope.edit = function () {\r\n if (_.isFunction($scope.detail.setParent)) {\r\n $scope.detail.setParent(config.parents[0]);\r\n }\r\n $scope.editDetail = angular.copy($scope.detail);\r\n };\r\n\r\n /**\r\n * Either cancels the current edit of an object by resetting it or triggers a history back event if the 'new' mode\r\n * is active\r\n */\r\n $scope.cancelEdit = function () {\r\n catValidationService.clearValidationErrors();\r\n $scope.$broadcast('formReset');\r\n if ($scope.exists) {\r\n $scope.editDetail = undefined;\r\n $globalMessages.clearMessages();\r\n } else {\r\n $window.history.back();\r\n }\r\n };\r\n\r\n /**\r\n * Calls the copy function of the current endpoint and redirects to the detail page of the copied object upon success\r\n */\r\n $scope.copy = function () {\r\n endpoint.copy($scope.detail.id).then(function (data) {\r\n //Note: here we go to the detail state of the copied object although we have all the data of the copied object here,\r\n // but otherwise we would have to change the url and this leads to problems with browser back and so on\r\n if (!!data.id) {\r\n $state.go('.', {id: data.id});\r\n } else {\r\n $state.go('.', {id: 'new'}, {notify: false});\r\n $scope.exists = false;\r\n $scope.editDetail = data;\r\n }\r\n });\r\n };\r\n\r\n /**\r\n * Calls the remove function of the current endpoint and redirects to the ^.list upon success\r\n */\r\n $scope.remove = function () {\r\n endpoint.remove($scope.detail.id).then(function () {\r\n if (_.isEmpty($scope.uiStack)) {\r\n $state.go('^.list');\r\n } else {\r\n var url = $state.href('^.^');\r\n $location.url(url.substring(1, url.length));\r\n $location.search('tab', endpoint.getEndpointName());\r\n }\r\n });\r\n };\r\n\r\n /**\r\n * Calls the save function of the current endpoint.\r\n * Upon success the view mode of the details of the currently created / updated object will be shown.\r\n * Upon an error the reported errors (global & field errors) will be shown to the user and the edit mode\r\n * will remain active.\r\n *\r\n * * @param {object} stayInEdit If true the view stays in detail edit state after save instead of switching to\r\n * detail view state.\r\n */\r\n $scope.save = function (stayInEdit) {\r\n // When passing data to an asynchronous method, it makes sense to clone it.\r\n endpoint.save(angular.copy($scope.editDetail)).then(function (data) {\r\n $globalMessages.clearMessages();\r\n catValidationService.clearValidationErrors();\r\n if (stayInEdit) {\r\n $scope.editDetail = data;\r\n // Refresh-Breadcrumb:\r\n $scope.reloadDetails();\r\n } else {\r\n if (!$scope.exists) {\r\n $scope.$broadcast('formReset');\r\n $state.go('.', {id: data.id});\r\n } else {\r\n $scope.editDetail = undefined;\r\n $scope.detail = data;\r\n config.detail = data;\r\n update();\r\n }\r\n }\r\n });\r\n };\r\n\r\n // TABS\r\n $scope.baseTabsController = ['$scope', function ($tabsScope) {\r\n $controller('CatBaseTabsController', {\r\n $scope: $tabsScope,\r\n config: config\r\n });\r\n }];\r\n\r\n try {\r\n // extend with custom controller\r\n $controller(config.controller, {\r\n $scope: $scope,\r\n detail: config.detail,\r\n parents: config.parents,\r\n config: config\r\n });\r\n } catch (unused) {\r\n $log.info('Couldn\\'t instantiate controller with name ' + config.controller);\r\n }\r\n\r\n if ($scope.exists) {\r\n update();\r\n } else {\r\n $scope.edit();\r\n }\r\n}\r\n\r\nangular.module('cat.controller.base.detail', ['cat.service.breadcrumbs', 'cat.controller.base.tabs'])\r\n .controller('CatBaseDetailController', CatBaseDetailController);","'use strict';\r\n\r\n\r\n/**\r\n * @ngdoc controller\r\n * @name cat.controller.base.list:CatBaseListController\r\n * @module cat.controller.base.list\r\n *\r\n * @description\r\n * The CatBaseListController takes care of providing several common properties to the scope\r\n * of every list page. It also instantiates the controller given via the config.controller parameter and shares\r\n * the same scope with it. In addition it has a common template 'cat-base-list.tpl.html' which shows a title,\r\n * new button and provides the cat-paginated directive.\r\n *\r\n * Common properties include:\r\n * * listData - the listData to be used by cat-paginated\r\n * * title - the title of the view\r\n * * searchProps - the list of search properties passed on to the cat-paginated directive\r\n * * config - the config object used to instantiate this view\r\n *\r\n * @param {object} $scope scope\r\n * @param {object} $state state service\r\n * @param {object} $controller controller\r\n * @param {object} $log log\r\n * @param {object} catBreadcrumbsService catBreadcrumbsService\r\n * @param {object} catListDataLoadingService catListDataLoadingService\r\n * @param {object} config holds data like the listData object, the template url, base url, the model constructor, etc.\r\n */\r\nfunction CatBaseListController($scope, $state, $controller, $log, catBreadcrumbsService, catListDataLoadingService, config) {\r\n if (!_.isUndefined(config.listData)) {\r\n this.titleKey = 'cc.catalysts.cat-breadcrumbs.entry.' + config.listData.endpoint.getEndpointName();\r\n\r\n catBreadcrumbsService.set([\r\n {\r\n title: config.title,\r\n key: this.titleKey\r\n }\r\n ]);\r\n\r\n $scope.listData = config.listData;\r\n } else {\r\n $log.warn('No listData available!');\r\n }\r\n\r\n this.title = config.title;\r\n this.searchProps = config.searchProps;\r\n this.config = config;\r\n\r\n this.getUrlForId = function (id) {\r\n $log.warn('use ui-sref directly - this method will be removed in the near future');\r\n return $state.href('^.detail', {id: id});\r\n };\r\n\r\n this.getUrlForNewPage = function () {\r\n return this.getUrlForId('new');\r\n };\r\n\r\n this.remove = function (id) {\r\n config.listData.endpoint.remove(id)\r\n .then(function () {\r\n catListDataLoadingService.load(config.listData.endpoint, config.listData.searchRequest).then(\r\n function (data) {\r\n _.assign($scope.listData, data);\r\n }\r\n );\r\n });\r\n };\r\n\r\n try {\r\n // extend with custom controller\r\n $controller(config.controller, {$scope: $scope, listData: config.listData, config: config});\r\n } catch (unused) {\r\n $log.info('Couldn\\'t instantiate controller with name ' + config.controller);\r\n }\r\n}\r\n\r\n\r\nangular.module('cat.controller.base.list', ['cat.service.breadcrumbs'])\r\n .controller('CatBaseListController',\r\n ['$scope', '$state', '$controller', '$log', 'catBreadcrumbsService', 'catListDataLoadingService', 'config', CatBaseListController]);\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc controller\r\n * @name cat.controller.base.tabs:CatBaseTabsController\r\n * @module cat.controller.base.tabs\r\n *\r\n * @description\r\n * The base code for handling sub entites (as tabs).\r\n * Includes the instantiation of one controller per tab/list and lazy loading of the approrpiate data\r\n *\r\n * @param {Object} $scope The angular scope\r\n * @param {Object} $controller The angular $controller service\r\n * @param {Object} $stateParams The ui-router $stateParams service\r\n * @param {Object} $location The angular $location service\r\n * @param {Object} catElementVisibilityService The visibility service to check wheter or not a tab should be rendered\r\n * @param {Object} config The config as handled by state resolve\r\n */\r\nfunction CatBaseTabsController($scope, $controller, $stateParams, $location, catElementVisibilityService, config, urlResolverService) {\r\n var endpoint = config.endpoint;\r\n\r\n function initTabs() {\r\n $scope.tabs = _.filter(config.tabs, function (tab) {\r\n var visible = catElementVisibilityService.isVisible('cat.base.tab', tab);\r\n\r\n return visible && (!_.isFunction(tab.isVisible) || tab.isVisible(config));\r\n });\r\n }\r\n\r\n initTabs();\r\n $scope.$on('cat-detail-updated', function (event, detail) {\r\n // #61 update visible tabs if details object changed\r\n config.detail = detail;\r\n initTabs();\r\n });\r\n\r\n $scope.tabNames = _.map($scope.tabs, 'name');\r\n $scope.activeTab = {};\r\n\r\n $scope.activateTab = function (tab) {\r\n $scope.$broadcast('tab-' + tab + '-active');\r\n _.forEach($scope.tabs, function (currentTab) {\r\n $scope.activeTab[currentTab.name] = false;\r\n });\r\n $scope.activeTab[tab] = true;\r\n };\r\n\r\n $scope.selectTab = function (tabName) {\r\n if (_.isUndefined($location.search().tab) && tabName === $scope.tabNames[0]) {\r\n // don't add 'default' tab to url\r\n return;\r\n }\r\n $location.search('tab', tabName);\r\n };\r\n\r\n var isTabActive = function (tab) {\r\n if (tab.name === $scope.tabNames[0] && _.isUndefined($stateParams.tab)) {\r\n // first tab is active if no parameter is given\r\n return true;\r\n }\r\n return $stateParams.tab === tab.name;\r\n };\r\n\r\n $scope.$watchCollection(function () {\r\n return $location.search();\r\n }, function (newValue) {\r\n if (_.isString(newValue.tab)) {\r\n $scope.activateTab(newValue.tab);\r\n } else if (_.isUndefined(newValue.tab)) {\r\n // activate first tab if undefined\r\n $scope.activateTab($scope.tabNames[0]);\r\n }\r\n });\r\n\r\n $scope.getTabName = function (tab) {\r\n return window.cat.util.pluralize(window.cat.util.capitalize(tab));\r\n };\r\n\r\n _.forEach($scope.tabs, function (tab) {\r\n $scope.activeTab[tab.name] = isTabActive(tab);\r\n });\r\n\r\n $scope.getTabTemplate = function (tab) {\r\n return urlResolverService.getTabTemplate(tab, config);\r\n };\r\n\r\n $scope.getTabKey = function (tabName) {\r\n var key = 'cc.catalysts.general.tab.' + endpoint.getEndpointName();\r\n\r\n var parentEndpoint = endpoint.parentEndpoint;\r\n\r\n while (parentEndpoint) {\r\n key += '.';\r\n key += parentEndpoint.getEndpointName();\r\n parentEndpoint = parentEndpoint.parentEndpoint;\r\n }\r\n\r\n return key + '.' + tabName;\r\n };\r\n\r\n var _getDefaultTabControllerName = function (tab) {\r\n var name = window.cat.util.capitalize(endpoint.getEndpointName());\r\n var parentEndpoint = endpoint.parentEndpoint;\r\n\r\n while (parentEndpoint) {\r\n name = window.cat.util.capitalize(parentEndpoint.getEndpointName()) + name;\r\n parentEndpoint = parentEndpoint.parentEndpoint;\r\n }\r\n\r\n return name + window.cat.util.capitalize(tab.name) + 'Controller';\r\n };\r\n\r\n var _getTabControllerName = function (tab) {\r\n if (!!tab.controller) {\r\n return tab.controller;\r\n }\r\n\r\n return _getDefaultTabControllerName(tab);\r\n };\r\n\r\n var tabIndex = 0;\r\n\r\n $scope.tabController = ['$scope', 'catListDataLoadingService', function ($tabScope, catListDataLoadingService) {\r\n var activeTab = $scope.tabs[tabIndex++];\r\n var tabControllerName = _getTabControllerName(activeTab);\r\n\r\n $tabScope.getSearchRequest = function () {\r\n return new window.cat.SearchRequest();\r\n };\r\n\r\n $tabScope.getEndpoint = function () {\r\n return config.detail[activeTab.name];\r\n };\r\n\r\n $tabScope.loadListData = function () {\r\n catListDataLoadingService.load($tabScope.getEndpoint(), $tabScope.getSearchRequest()).then(function (data) {\r\n $tabScope.listData = data;\r\n });\r\n };\r\n\r\n $tabScope.$on('tab-' + activeTab.name + '-active', function () {\r\n if (_.isUndefined($scope.listData)) {\r\n $tabScope.loadListData();\r\n }\r\n });\r\n\r\n $controller(tabControllerName, {\r\n $scope: $tabScope,\r\n detail: config.detail,\r\n parents: config.parents,\r\n config: config\r\n });\r\n\r\n if ($scope.activeTab[activeTab.name] === true) {\r\n $scope.activateTab(activeTab.name);\r\n }\r\n }];\r\n}\r\n\r\nangular\r\n .module('cat.controller.base.tabs', [\r\n 'cat.service.elementVisibility',\r\n 'cat.url.resolver.service'\r\n ]).controller('CatBaseTabsController', CatBaseTabsController);","'use strict';\r\n\r\nangular.module('cat.config.messages', [])\r\n\r\n/**\r\n * @description\r\n * Configuration for cat-messages.\r\n */\r\n .constant('catMessagesConfig', {\r\n knownFieldsActive: false\r\n });\r\n","'use strict';\r\n\r\n\r\nangular.module('cat.filters.replaceText', [])\r\n\r\n/**\r\n * @ngdoc filter\r\n * @name cat.filters.replaceText:replaceText\r\n *\r\n * @description\r\n * Replaces text passages with other text, based on regular expressions\r\n *\r\n * @param {string} text original text\r\n * @param {string} pattern regular expression\r\n * @param {object} options regular expression options\r\n * @param {string} replacement replacement text\r\n */\r\n .filter('replaceText', function CatReplaceTetFilter() {\r\n return function (text, pattern, options, replacement) {\r\n if (pattern === undefined)\r\n pattern = '\\n';\r\n if (options === undefined)\r\n options = 'g';\r\n if (replacement === undefined)\r\n replacement = ', ';\r\n if (!text) {\r\n return text;\r\n } else {\r\n return String(text).replace(new RegExp(pattern, options), replacement);\r\n }\r\n };\r\n });\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.autofocus:catAutofocus\r\n */\r\nangular.module('cat.directives.autofocus', [])\r\n .directive('catAutofocus', function CatAutofocusDirective($timeout) {\r\n return {\r\n restrict: 'A',\r\n link: function CatAutofocusLink(scope, element) {\r\n $timeout(function () {\r\n if (!_.isUndefined(element.data('select2'))) {\r\n element.select2('open');\r\n } else {\r\n element[0].focus();\r\n }\r\n }, 100);\r\n }\r\n };\r\n });\r\n\r\n\r\n","'use strict';\r\n\r\nangular.module('cat.directives.breadcrumbs', ['cat.service.breadcrumbs'])\r\n\r\n/**\r\n * @description\r\n * Configuration for cat-breadcrumbs.\r\n */\r\n .constant('catBreadcrumbsConfig', {\r\n homeState: 'dashboard'\r\n })\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.breadcrumbs:catBreadcrumbs\r\n */\r\n .directive('catBreadcrumbs', function CatBreadcrumbsDirective(catBreadcrumbsConfig, catBreadcrumbs) {\r\n return {\r\n restrict: 'A',\r\n templateUrl: 'template/cat-breadcrumbs.tpl.html',\r\n link: function CatAutofocusLink(scope, element) {\r\n if (catBreadcrumbsConfig.homeState) {\r\n scope.homeState = catBreadcrumbsConfig.homeState;\r\n }\r\n scope.breadcrumbs = catBreadcrumbs;\r\n scope.showHome = function () {\r\n return !!catBreadcrumbsConfig.homeState;\r\n };\r\n }\r\n };\r\n });\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.checkbox:catCheckbox\r\n */\r\nangular.module('cat.directives.checkbox', [])\r\n .directive('catCheckbox', function CatCheckboxDirective() {\r\n return {\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n checked: '='\r\n },\r\n link: function CatCheckboxLink(scope, element) {\r\n if (!!scope.checked) {\r\n element.addClass('glyphicon glyphicon-check');\r\n } else {\r\n element.addClass('glyphicon glyphicon-unchecked');\r\n }\r\n }\r\n };\r\n });","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.confirmClick:catConfirmClick\r\n */\r\nangular.module('cat.directives.confirmClick', [])\r\n .directive('catConfirmClick', function CatConfirmClickDirective() {\r\n return {\r\n restrict: 'A',\r\n link: function CatConfirmClickLink(scope, element, attr) {\r\n var msg = attr.catConfirmClick || 'Are you sure?';\r\n var clickAction = attr.catOnConfirm;\r\n element.bind('click', function (event) {\r\n if (window.confirm(msg)) {\r\n scope.$eval(clickAction);\r\n }\r\n });\r\n }\r\n };\r\n });\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.elementVisible:catElementVisible\r\n */\r\nangular.module('cat.directives.elementVisible', ['cat.service.elementVisibility'])\r\n .directive('catElementVisible', ['catElementVisibilityService',\r\n function CatElementVisibleDirective(catElementVisibilityService) {\r\n return {\r\n restrict: 'A',\r\n scope: {\r\n identifier: '@catElementVisible',\r\n data: '=?catElementData'\r\n },\r\n link: function CatElementVisibleLink(scope, element) {\r\n if (!catElementVisibilityService.isVisible(scope.identifier, scope.data)) {\r\n element.hide();\r\n }\r\n }\r\n };\r\n }]);\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.facets:catFacets\r\n */\r\nangular.module('cat.directives.facets', ['cat.directives.paginated'])\r\n .directive('catFacets', function CatFacetsDirective() {\r\n function _initDefaults(scope) {\r\n if (_.isUndefined(scope.listData)) {\r\n scope.listData = scope.$parent.listData;\r\n }\r\n }\r\n\r\n function _checkConditions(scope) {\r\n if (_.isUndefined(scope.listData)) {\r\n throw new Error('listData was not defined and couldn\\'t be found with default value');\r\n }\r\n\r\n if (_.isUndefined(scope.listData.facets)) {\r\n throw new Error('No facets are available within given listData');\r\n }\r\n }\r\n\r\n return {\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n listData: '=?',\r\n names: '='\r\n },\r\n require: '^catPaginated',\r\n templateUrl: 'template/cat-facets.tpl.html',\r\n link: function CatFacetsLink(scope, element, attrs, catPaginatedController) {\r\n _initDefaults(scope);\r\n _checkConditions(scope);\r\n\r\n scope.catPaginatedController = catPaginatedController;\r\n },\r\n controller: function CatFacetsController($scope) {\r\n $scope.isActive = function (facet) {\r\n return !!$scope.catPaginatedController.getSearch()[facet.name];\r\n };\r\n\r\n function _search(search) {\r\n return $scope.catPaginatedController.getSearchRequest().search(search);\r\n }\r\n\r\n $scope.facetName = function (facet) {\r\n if ($scope.names !== undefined && $scope.names[facet.name] !== undefined) {\r\n return $scope.names[facet.name];\r\n } else {\r\n return facet.name;\r\n }\r\n };\r\n\r\n $scope.facets = {};\r\n\r\n $scope.facetChanged = function (facet) {\r\n var search = _search();\r\n var value = $scope.facets[facet.name];\r\n if (!!value) {\r\n search[facet.name] = value;\r\n } else {\r\n delete search[facet.name];\r\n }\r\n };\r\n\r\n $scope.initFacets = function () {\r\n _.forEach($scope.listData.facets, function (facet) {\r\n if ($scope.isActive(facet)) {\r\n $scope.facets[facet.name] = $scope.catPaginatedController.getSearch()[facet.name];\r\n }\r\n });\r\n };\r\n\r\n $scope.facetSelectOptions = {\r\n allowClear: true\r\n };\r\n }\r\n };\r\n });\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.fieldErrors.info:catFieldErrorsInfo\r\n */\r\nangular.module('cat.directives.fieldErrors.info', ['cat.service.validation'])\r\n .directive('catFieldErrorsInfo', function CatFieldErrorsInfoDirective() {\r\n return {\r\n replace: 'true',\r\n restrict: 'EA',\r\n scope: true,\r\n bindToController: true,\r\n controllerAs: 'catFieldErrorsInfo',\r\n require: ['catFieldErrorsInfo', '?^^catValidationGroup'],\r\n link: function (scope, elem, attr, controllers) {\r\n elem.addClass('cat-field-errors-info');\r\n\r\n var catFieldErrors = controllers[0];\r\n var catValidationGroupCtrl = controllers[1];\r\n if (!!catValidationGroupCtrl) {\r\n catFieldErrors.contextId = catValidationGroupCtrl.getContextId();\r\n }\r\n },\r\n controller: function CatFieldErrorsController(/* CatValidationService */ catValidationService) {\r\n var that = this;\r\n\r\n this.hasErrors = function () {\r\n return catValidationService.hasAnyFieldErrors(that.contextId);\r\n };\r\n },\r\n templateUrl: 'template/cat-field-errors-info.tpl.html'\r\n };\r\n });","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.fieldError:catFieldErrors\r\n */\r\nangular.module('cat.directives.fieldErrors', ['cat.service.validation'])\r\n .directive('catFieldErrors', function CatFieldErrorsDirective() {\r\n return {\r\n replace: 'true',\r\n restrict: 'EA',\r\n scope: {\r\n name: '@'\r\n },\r\n bindToController: true,\r\n controllerAs: 'catFieldErrors',\r\n require: ['catFieldErrors', '?^^catValidationGroup'],\r\n link: function (scope, elem, attr, controllers) {\r\n elem.addClass('cat-field-errors');\r\n\r\n var catFieldErrors = controllers[0];\r\n var /* CatValidationController */ catValidationGroupCtrl = controllers[1];\r\n if (!!catValidationGroupCtrl) {\r\n catFieldErrors.contextId = catValidationGroupCtrl.getContextId();\r\n }\r\n },\r\n controller: function CatFieldErrorsController($scope, /* CatValidationService */ catValidationService) {\r\n var that = this;\r\n\r\n if (angular.version.major === 1 && angular.version.minor === 2) {\r\n $scope.$watch('name', function (name) {\r\n that.name = name;\r\n });\r\n }\r\n\r\n this.hasErrors = function() {\r\n return catValidationService.hasFieldErrors(that.name, this.contextId);\r\n };\r\n\r\n this.getErrors = function() {\r\n return catValidationService.getFieldErrors(that.name, this.contextId);\r\n };\r\n },\r\n templateUrl: 'template/cat-field-errors.tpl.html'\r\n };\r\n });","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.globalError:catGlobalErrors\r\n */\r\nangular.module('cat.directives.globalErrors', ['cat.service.validation'])\r\n .directive('catGlobalErrors', function CatGlobalErrorsDirective() {\r\n return {\r\n replace: 'true',\r\n restrict: 'EA',\r\n scope: true,\r\n bindToController: true,\r\n controllerAs: 'catGlobalErrors',\r\n require: ['catGlobalErrors', '?^^catValidationGroup'],\r\n link: function (scope, elem, attr, controllers) {\r\n elem.addClass('cat-global-errors');\r\n\r\n var catGlobalErrors = controllers[0];\r\n var /* CatValidationController */ catValidationGroupCtrl = controllers[1];\r\n if (!!catValidationGroupCtrl) {\r\n catGlobalErrors.contextId = catValidationGroupCtrl.getContextId();\r\n }\r\n },\r\n controller: function CatGlobalErrorsController($scope, /* CatValidationService */ catValidationService) {\r\n var that = this;\r\n\r\n this.hasErrors = function () {\r\n return catValidationService.hasGlobalErrors(this.contextId);\r\n };\r\n\r\n this.getErrors = function () {\r\n return catValidationService.getGlobalErrors(this.contextId);\r\n };\r\n },\r\n templateUrl: 'template/cat-global-errors.tpl.html'\r\n };\r\n });","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.i18n:catI18n\r\n */\r\nangular.module('cat.directives.i18n', ['cat.service.i18n'])\r\n .service('catI18nResponseHandler', ['$log', function CatI18nResponseHandler($log) {\r\n this.handleTranslationSuccess = function (translation, scope, element) {\r\n element.text(translation);\r\n };\r\n this.handleTranslationError = function (reason, scope, element) {\r\n element.text('##missingkey: ' + scope.key);\r\n };\r\n }])\r\n .directive('catI18n', ['$log', '$rootScope', 'catI18nService', 'catI18nResponseHandler', function catI18nDirective($log, $rootScope, catI18nService, catI18nResponseHandler) {\r\n function _translate(scope, element) {\r\n if (!scope.key) {\r\n $log.warn('No key was given for cat-i18n!');\r\n return;\r\n }\r\n catI18nService.translate(scope.key, scope.params).then(\r\n function (message) {\r\n catI18nResponseHandler.handleTranslationSuccess(message, scope, element);\r\n }, function (reason) {\r\n catI18nResponseHandler.handleTranslationError(reason, scope, element);\r\n }\r\n );\r\n }\r\n\r\n\r\n return {\r\n restrict: 'A',\r\n scope: {\r\n key: '@catI18n',\r\n params: '=?i18nParams',\r\n watchParams: '=?i18nWatchParams'\r\n },\r\n link: function CatI18nLink(scope, element) {\r\n _translate(scope, element);\r\n\r\n if (!!scope.params && scope.watchParams === true) {\r\n scope.$watch('params', function () {\r\n _translate(scope, element);\r\n }, true);\r\n }\r\n\r\n $rootScope.$on('cat-i18n-refresh', function () {\r\n _translate(scope, element);\r\n });\r\n }\r\n };\r\n }]);\r\n","'use strict';\r\n\r\nangular.module('cat.directives.icon', [])\r\n\r\n/**\r\n * @description\r\n * Configuration for cat-icon.\r\n */\r\n .constant('catIconConfig', {\r\n icons: {\r\n config: {\r\n xsClass: undefined\r\n },\r\n create: 'glyphicon glyphicon-plus',\r\n edit: 'glyphicon glyphicon-edit',\r\n remove: 'glyphicon glyphicon-remove',\r\n save: 'glyphicon glyphicon-floppy-disk'\r\n }\r\n })\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.icon:catIcon\r\n *\r\n * @param {string} icon name of the icon\r\n * @param {string} title title of the icon\r\n * @param {string} size size of the icon [undefined | '': normal, 'xs': small]\r\n */\r\n .directive('catIcon', function CatIcon() {\r\n return {\r\n restrict: 'A',\r\n replace: true,\r\n template: '<span class=\"{{iconClass}}\" title=\"{{title}}\"></span>',\r\n scope: {\r\n icon: '@catIcon',\r\n title: '@',\r\n size: '@'\r\n },\r\n controller: function ($scope, catIconConfig) {\r\n var icons = catIconConfig.icons;\r\n var iconsConfig = icons.config;\r\n\r\n var iconClasses = [];\r\n\r\n // add size class\r\n if (!!$scope.size && $scope.size === 'xs' && !!iconsConfig.xsClass) {\r\n iconClasses.push(iconsConfig.xsClass);\r\n }\r\n\r\n // add icon class\r\n iconClasses.push(icons[$scope.icon]);\r\n\r\n $scope.iconClass = iconClasses.join(' ');\r\n }\r\n };\r\n });\r\n","'use strict';\r\n\r\nangular.module('cat.directives.inputGroup', [])\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.inputGroup:catInputGroup\r\n */\r\n .directive('catInputGroup', function CatInputGroupDirective(catValidationService) {\r\n return {\r\n restrict: 'A',\r\n transclude: true,\r\n scope: {\r\n label: '@',\r\n name: '@',\r\n catI18nKey: '@'\r\n },\r\n require: '?^^catValidationGroup',\r\n link: function CatInputGroupLink(scope, element, attr, /* CatValidationController */ catValidationGroupCtrl) {\r\n if (!!catValidationGroupCtrl && !!catValidationService) {\r\n var context = catValidationService.getContext(catValidationGroupCtrl.getContextId());\r\n context.registerField(scope.name);\r\n }\r\n\r\n element.addClass('form-group');\r\n },\r\n templateUrl: 'template/cat-input.tpl.html'\r\n };\r\n });","'use strict';\r\n\r\nangular.module('cat.directives.input', [])\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.input:input\r\n */\r\n .directive('input', function CatInputDirective() {\r\n return {\r\n require: '?ngModel',\r\n restrict: 'E',\r\n link: function CatInputLink(scope, element, attrs, ctrl) {\r\n if (!!ctrl) {\r\n scope.$on('fieldErrors', function (event, fieldErrors) {\r\n if (!fieldErrors || !attrs.id) {\r\n return;\r\n }\r\n var valid = !fieldErrors[attrs.id];\r\n ctrl.$setValidity(attrs.id, valid);\r\n });\r\n }\r\n }\r\n };\r\n });","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.loadMore:catLoadMore\r\n */\r\nangular.module('cat.directives.loadMore', [])\r\n .directive('catLoadMore', function CatLoadMoreDirective() {\r\n return {\r\n replace: true,\r\n restrict: 'A',\r\n link: function CatLoadMoreLink(scope, element, attrs) {\r\n var initialCount = parseInt(attrs.catLoadMore);\r\n scope.$parent.elementsCount = scope.$parent.elementsCount || initialCount;\r\n scope.$parent.elements = scope.$parent.elements || [];\r\n scope.$parent.elements.push(element);\r\n if (scope.$parent.elements.length > scope.$parent.elementsCount) {\r\n element.addClass('hidden');\r\n }\r\n if (!element.parent().next().length && scope.$parent.elements.length > scope.$parent.elementsCount) {\r\n var elt = $('<a href=\"#\">Show more</a>');\r\n elt.on({\r\n click: function () {\r\n scope.$parent.elementsCount += initialCount;\r\n if (scope.$parent.elements.length <= scope.$parent.elementsCount) {\r\n elt.addClass('hidden');\r\n }\r\n scope.$parent.elements.forEach(function (elt, ind) {\r\n if (ind < scope.$parent.elementsCount) {\r\n elt.removeClass('hidden');\r\n }\r\n });\r\n return false;\r\n }\r\n });\r\n element.parent().after(elt);\r\n }\r\n }\r\n };\r\n });\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.menu:catLoadMore\r\n */\r\nangular.module('cat.directives.menu', ['cat.service.menu', 'cat.service.elementVisibility'])\r\n .directive('catMainMenu', ['$mainMenu', 'catElementVisibilityService', '$location',\r\n function CatMainMenuDirective($mainMenu, catElementVisibilityService, $location) {\r\n return {\r\n restrict: 'E',\r\n scope: {},\r\n link: function CatMainMenuLink(scope) {\r\n scope.getMenus = function () {\r\n return $mainMenu.getMenus();\r\n };\r\n\r\n scope.isVisible = function (entry) {\r\n var visible = false;\r\n if (entry.isMenu() || entry.isGroup()) {\r\n _.forEach(entry.getEntries(), function (subEntry) {\r\n visible = visible || scope.isVisible(subEntry);\r\n });\r\n if (entry.isMenu()) {\r\n _.forEach(entry.getGroups(), function (groups) {\r\n visible = visible || scope.isVisible(groups);\r\n });\r\n }\r\n } else {\r\n return catElementVisibilityService.isVisible('cat.menu.entry', entry);\r\n }\r\n return visible;\r\n };\r\n\r\n scope.isActive = function (path) {\r\n return $location.path().substr(0, path.length) === path;\r\n };\r\n },\r\n templateUrl: 'template/cat-main-menu.tpl.html'\r\n };\r\n }]);\r\n","'use strict';\r\n\r\nangular.module('cat.directives.messages', [\r\n 'cat.config.messages',\r\n 'cat.service.validation'\r\n])\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.messages:catMessages\r\n */\r\n .directive('catMessages', function () {\r\n return {\r\n restrict: 'A',\r\n templateUrl: 'template/cat-messages.tpl.html',\r\n scope: {\r\n type: '=?'\r\n },\r\n require: '?^^catValidationGroup',\r\n link: function (scope, elem, attr, /* CatValidationController */ catValidationGroupCtrl) {\r\n if (!!catValidationGroupCtrl) {\r\n scope.contextId = catValidationGroupCtrl.getContextId();\r\n }\r\n },\r\n controller: function ($scope, /* CatValidationService */ catValidationService) {\r\n if (!$scope.type) {\r\n $scope.type = 'error';\r\n }\r\n\r\n $scope.hasMessages = function () {\r\n return catValidationService.hasGlobalErrors($scope.contextId);\r\n };\r\n\r\n $scope.getMessages = function () {\r\n return catValidationService.getGlobalErrors($scope.contextId);\r\n };\r\n }\r\n };\r\n });","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.paginated:catPaginated\r\n */\r\nangular.module('cat.directives.paginated',\r\n [\r\n 'ui.bootstrap.pagination',\r\n 'cat.service.listDataLoading',\r\n 'cat.service.i18n',\r\n 'cat.service.search'\r\n ]).directive('catPaginated', function CatPaginatedDirective($log, catI18nService) {\r\n var SEARCH_PROP_KEY = 'cc.catalysts.cat-paginated.search.prop';\r\n\r\n return {\r\n replace: true,\r\n restrict: 'E',\r\n transclude: true,\r\n scope: {\r\n listData: '=?',\r\n syncLocation: '=?'\r\n },\r\n templateUrl: 'template/cat-paginated.tpl.html',\r\n link: function CatPaginatedLink(scope, element, attrs) {\r\n if (!!attrs.searchProps) {\r\n scope.searchProps = _.filter(attrs.searchProps.split(','), function (prop) {\r\n return !!prop;\r\n });\r\n\r\n scope.searchPropertyPlaceholders = {};\r\n\r\n _.forEach(scope.searchProps, function (searchProp) {\r\n scope.searchPropertyPlaceholders[searchProp] = 'Search by ' + searchProp;\r\n catI18nService.translate(SEARCH_PROP_KEY, {prop: searchProp})\r\n .then(function (message) {\r\n scope.searchPropertyPlaceholders[searchProp] = message;\r\n });\r\n });\r\n }\r\n },\r\n controllerAs: 'catPaginatedController',\r\n controller: function CatPaginatedController($scope, $location, $timeout, $rootScope, catListDataLoadingService, catI18nService, catSearchService) {\r\n var that = this;\r\n var searchTimeout = null, DELAY_ON_SEARCH = 500;\r\n var PAGINATION_PREVIOUS_KEY = 'cc.catalysts.cat-paginated.pagination.previous';\r\n var PAGINATION_NEXT_KEY = 'cc.catalysts.cat-paginated.pagination.next';\r\n var PAGINATION_FIRST_KEY = 'cc.catalysts.cat-paginated.pagination.first';\r\n var PAGINATION_LAST_KEY = 'cc.catalysts.cat-paginated.pagination.last';\r\n\r\n if (_.isUndefined($scope.listData)) {\r\n $scope.listData = $scope.$parent.listData;\r\n if (_.isUndefined($scope.listData)) {\r\n throw new Error('listData was not defined and couldn\\'t be found with default value');\r\n }\r\n }\r\n\r\n if (_.isUndefined($scope.syncLocation)) {\r\n $scope.syncLocation = _.isUndefined($scope.$parent.detail);\r\n }\r\n\r\n $scope.paginationText = {\r\n previous: 'Previous',\r\n next: 'Next',\r\n first: 'First',\r\n last: 'Last'\r\n };\r\n\r\n function handlePaginationTextResponse(prop) {\r\n return function (message) {\r\n $scope.paginationText[prop] = message;\r\n };\r\n }\r\n\r\n\r\n function _loadPaginationTranslations() {\r\n catI18nService.translate(PAGINATION_PREVIOUS_KEY).then(handlePaginationTextResponse('previous'));\r\n catI18nService.translate(PAGINATION_NEXT_KEY).then(handlePaginationTextResponse('next'));\r\n catI18nService.translate(PAGINATION_FIRST_KEY).then(handlePaginationTextResponse('first'));\r\n catI18nService.translate(PAGINATION_LAST_KEY).then(handlePaginationTextResponse('last'));\r\n }\r\n\r\n _loadPaginationTranslations();\r\n\r\n $rootScope.$on('cat-i18n-refresh', function () {\r\n _loadPaginationTranslations();\r\n });\r\n\r\n $scope.listData.search = $scope.listData.search || $scope.listData.searchRequest.search() || {};\r\n\r\n var searchRequest = $scope.listData.searchRequest;\r\n\r\n var reload = function (delay, force) {\r\n $timeout.cancel(searchTimeout);\r\n searchTimeout = $timeout(function () {\r\n if (searchRequest.isDirty() || !!force) {\r\n catListDataLoadingService.load($scope.listData.endpoint, searchRequest).then(\r\n function (data) {\r\n searchRequest.setPristine();\r\n _.assign($scope.listData, data);\r\n }\r\n );\r\n }\r\n }, delay || 0);\r\n };\r\n\r\n $scope.$on('cat-paginated-refresh', function () {\r\n reload(0, true);\r\n });\r\n\r\n $scope.$watch('listData.sort', function (newVal) {\r\n if (!!newVal) {\r\n console.log('broadcasting sort changed: ' + angular.toJson(newVal));\r\n $scope.$parent.$broadcast('SortChanged', newVal);\r\n }\r\n }, true);\r\n\r\n function updateLocation() {\r\n if ($scope.syncLocation !== false) {\r\n catSearchService.updateLocation(searchRequest);\r\n $location.replace();\r\n }\r\n }\r\n\r\n $scope.$watch('listData.pagination', function (newVal, oldVal) {\r\n // TODO check wheter or not this is necessary with angular >= 1.3\r\n if (angular.equals(newVal, oldVal)) {\r\n return;\r\n }\r\n searchRequest.pagination($scope.listData.pagination);\r\n updateLocation();\r\n reload();\r\n }, true);\r\n\r\n var searchChanged = function (value, delay) {\r\n searchRequest.search(value);\r\n updateLocation();\r\n $scope.listData.pagination.page = 1;\r\n reload(delay);\r\n };\r\n\r\n var updateSearch = function (newVal, oldVal) {\r\n // TODO check wheter or not this is necessary with angular >= 1.3\r\n if (angular.equals(newVal, oldVal)) {\r\n return;\r\n }\r\n var search = searchRequest.search();\r\n _.assign(search, newVal);\r\n searchChanged(newVal, DELAY_ON_SEARCH);\r\n };\r\n\r\n $scope.$watch('listData.search', updateSearch, true);\r\n\r\n this.sort = function (newVal, oldVal) {\r\n // TODO check wheter or not this is necessary with angular >= 1.3\r\n if (angular.equals(newVal, oldVal)) {\r\n return;\r\n }\r\n searchRequest.sort(newVal);\r\n updateLocation();\r\n $scope.listData.pagination.page = 1;\r\n reload();\r\n };\r\n\r\n this.getSearch = function () {\r\n return searchRequest.search();\r\n };\r\n\r\n this.getSearchRequest = function () {\r\n return searchRequest;\r\n };\r\n\r\n $scope.$on('SortChanged', function (event, value) {\r\n that.sort(value);\r\n });\r\n }\r\n };\r\n});\r\n","'use strict';\r\n\r\nfunction CatSelectLink(scope, element, attrs, ngModel) {\r\n element.addClass('form-control');\r\n // clear formatters, otherwise $viewModel will be converted to a string\r\n // see https://github.com/angular/angular.js/commit/1eda18365a348c9597aafba9d195d345e4f13d1e\r\n ngModel.$formatters = [];\r\n}\r\n\r\nfunction CatSelectController($scope, $log, catApiService, catSelectConfigService) {\r\n function fetchElements(endpoint, sort, searchRequestAdapter) {\r\n return function (queryParams) {\r\n var searchRequest = new window.cat.SearchRequest(queryParams.data);\r\n searchRequest.sort(sort || {property: 'name', isDesc: false});\r\n\r\n if (_.isFunction(searchRequestAdapter)) {\r\n searchRequest = searchRequestAdapter(searchRequest);\r\n } else if (_.isObject(searchRequestAdapter)) {\r\n _.assign(searchRequest, searchRequestAdapter);\r\n } else {\r\n $log.warn('searchRequestAdapter has to be either a function or an object but was ' + (typeof searchRequestAdapter));\r\n }\r\n\r\n return endpoint.list(searchRequest).then(queryParams.success);\r\n };\r\n }\r\n\r\n\r\n var options = catSelectConfigService.getConfig($scope.config, $scope.options);\r\n\r\n if (_.isUndefined(options)) {\r\n throw new Error('At least one of \"config\" or \"options\" has to be specified');\r\n }\r\n\r\n var searchRequestAdapter = options.searchRequestAdapter || {};\r\n\r\n var transport,\r\n quietMillis,\r\n searchRequestFunc = options.search || function (term, page) {\r\n return {\r\n 'search.name': term,\r\n page: page\r\n };\r\n },\r\n filterFunc = options.filter || function (term) {\r\n return true;\r\n };\r\n if (_.isArray(options.endpoint)) {\r\n transport = function (queryParams) {\r\n return queryParams.success({\r\n elements: options.endpoint\r\n });\r\n };\r\n quietMillis = 0;\r\n } else if (_.isFunction(options.endpoint)) {\r\n transport = options.endpoint;\r\n quietMillis = 500;\r\n } else if (_.isObject(options.endpoint)) {\r\n transport = fetchElements(options.endpoint, options.sort, searchRequestAdapter);\r\n quietMillis = 500;\r\n } else if (_.isString(options.endpoint)) {\r\n var api = catApiService[options.endpoint];\r\n if (!api) {\r\n $log.error('No api endpoint \"' + options.endpoint + '\" defined');\r\n $scope.elements = [];\r\n return;\r\n }\r\n transport = fetchElements(api, options.sort, searchRequestAdapter);\r\n quietMillis = 500;\r\n } else {\r\n $log.error('The given endpoint has to be one of the following types: array, object, string or function - but was ' + (typeof options.endpoint));\r\n $scope.elements = [];\r\n return;\r\n }\r\n\r\n $scope.selectOptions = _.assign({\r\n placeholder: ' ', // space in default placeholder is required, otherwise allowClear property does not work\r\n minimumInputLength: 0,\r\n adaptDropdownCssClass: function (cssClass) {\r\n if (_.includes(['ng-valid', 'ng-invalid', 'ng-pristine', 'ng-dirty'], cssClass)) {\r\n return cssClass;\r\n }\r\n return null;\r\n },\r\n ajax: {\r\n data: searchRequestFunc,\r\n quietMillis: quietMillis,\r\n transport: transport,\r\n results: function (data, page) {\r\n var more = (page * (options.size || 100)) < data.totalCount;\r\n return {\r\n results: _.map(_.filter(data.elements, filterFunc), function (e) {\r\n return _.assign({}, e, {name: _.escape(e.name)});\r\n }),\r\n more: more\r\n };\r\n }\r\n },\r\n formatResult: function (element) {\r\n return _.escape(element.name);\r\n },\r\n formatSelection: function (element) {\r\n return _.escape(element.name);\r\n }\r\n }, options['ui-select2']);\r\n}\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.select:catSelect\r\n * @scope\r\n * @restrict EA\r\n *\r\n * @description\r\n * The 'cat-select' directive is a wrapper around the 'ui-select2' directive which adds support for using an api\r\n * endpoint provided by catApiService. There exist 2 supported ways of configuration:\r\n * - The 'config' attribute: This represents a named configuration which will be retrieved from the catSelectConfigService\r\n * - The 'options' attribute: Here the options object can directly be passed in\r\n *\r\n * The 2 different approaches exist to easily reuse certain options, as the named config is seen as 'default' and all\r\n * values which are provided via the options object will be overridden.\r\n *\r\n * An config / options object has the following properties:\r\n * - endpoint: This can either be an array, in which case it will directly be treated as the source, an endpoint name\r\n * or an endpoint object to call the given endpoint, or a function which is used as the 'transport' function\r\n * - sort: An object which defines the 'sort' property and direction used when retrieving the list from an endpoint\r\n * - ui-select2: An config object which supports all options provided by the 'ui-select2' directive\r\n *\r\n * TODO fix returns doc (not the correct format)\r\n * returns {{\r\n * restrict: {string},\r\n * replace: {boolean},\r\n * priority: {number},\r\n * scope: {\r\n * options: {string},\r\n * id: {string},\r\n * config: {string}\r\n * },\r\n * link: {CatSelectLink},\r\n * controller: {CatSelectController},\r\n * template: {string}\r\n * }}\r\n * @constructor\r\n */\r\nfunction CatSelectDirective() {\r\n return {\r\n restrict: 'EA',\r\n replace: true,\r\n priority: 1,\r\n require: 'ngModel',\r\n scope: {\r\n options: '=?',\r\n id: '@',\r\n config: '@?'\r\n },\r\n link: CatSelectLink,\r\n controller: CatSelectController,\r\n template: '<input type=\"text\" ui-select2=\"selectOptions\">'\r\n };\r\n}\r\n\r\nangular.module('cat.directives.select', ['ui.select2', 'cat.service.api', 'cat.service.selectConfig'])\r\n .directive('catSelect', CatSelectDirective);\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.sortable:catSortable\r\n */\r\nangular.module('cat.directives.sortable', ['cat.directives.paginated'])\r\n .directive('catSortable', function CatSortableDirective($compile) {\r\n return {\r\n restrict: 'AC',\r\n require: '^catPaginated',\r\n link: function CatSortableLink(scope, element, attrs, catPaginatedController) {\r\n var title = element.text();\r\n var property = attrs.catSortable || title.toLowerCase().trim();\r\n var i18n = 'cc.catalysts.cat-sortable.sort.' + property;\r\n\r\n if (!!attrs.catI18nKey) {\r\n i18n = attrs.catI18nKey;\r\n }\r\n\r\n // todo - make configurable\r\n scope.sort = scope.listData.searchRequest.sort();\r\n scope.catPaginatedController = catPaginatedController;\r\n var icon = 'glyphicon-sort-by-attributes';\r\n\r\n if (!!attrs.sortMode) {\r\n if (attrs.sortMode === 'numeric') {\r\n icon = 'glyphicon-sort-by-order';\r\n } else if (attrs.sortMode === 'alphabet') {\r\n icon = 'glyphicon-sort-by-alphabet';\r\n }\r\n }\r\n\r\n element.text('');\r\n element.append($compile('<a class=\"sort-link\" href=\"\" ng-click=\"toggleSort(\\'' + property + '\\')\"><span cat-i18n=\"' + i18n + '\">' + title + '</span><span class=\"glyphicon\" ng-class=\"{\\'' + icon + '\\': sort.property == \\'' + property + '\\' && !sort.isDesc, \\'' + icon + '-alt\\': sort.property == \\'' + property + '\\' && sort.isDesc}\"></span></a>')(scope));\r\n },\r\n controller: function CatSortableController($scope) {\r\n $scope.toggleSort = function (property) {\r\n if ($scope.sort.property === property) {\r\n $scope.sort.isDesc = !$scope.sort.isDesc;\r\n } else {\r\n $scope.sort.property = property;\r\n $scope.sort.isDesc = false;\r\n }\r\n\r\n $scope.catPaginatedController.sort($scope.sort);\r\n };\r\n\r\n $scope.$on('SortChanged', function (event, value) {\r\n $scope.sort = value;\r\n });\r\n }\r\n };\r\n });","'use strict';\r\n\r\nfunction CatValidationController($scope, catValidationService) {\r\n var contextId = catValidationService.createContext();\r\n\r\n /**\r\n * Retuns the context identifier\r\n * @returns {string} context identifier\r\n */\r\n this.getContextId = function () {\r\n return contextId;\r\n };\r\n\r\n $scope.$on('$destroy', function () {\r\n catValidationService.destroyContext(contextId);\r\n });\r\n}\r\n\r\nangular.module('cat.directives.validation', ['cat.service.validation'])\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.validation.inputs:catValidationGroup\r\n *\r\n * @description\r\n * This directive provides a container which defines a new validation context. Via the controller the context can be\r\n * retrieved.\r\n */\r\n .directive('catValidationGroup', function CatValidationGroup() {\r\n return {\r\n restrict: 'A',\r\n controllerAs: 'catValidationGroupCtrl',\r\n bindToController: true,\r\n controller: ['$scope', 'catValidationService', CatValidationController]\r\n };\r\n });","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.form:form\r\n */\r\nangular.module('cat.directives.form', [])\r\n .directive('form', ['$timeout', function CatFormDirective($timeout) {\r\n return {\r\n restrict: 'E',\r\n scope: true,\r\n require: 'form',\r\n link: function CatFormLink(scope, element, attrs, formCtrl) {\r\n var warningMessage = attrs.eocsWarnOnNavIfDirty || 'You have unsaved changes. Leave the page?';\r\n\r\n // TODO - remove this ugly hack if ui-select2 fixes this problem...\r\n $timeout(function () {\r\n formCtrl.$setPristine(true);\r\n }, 50);\r\n\r\n scope.$on('formReset', function () {\r\n formCtrl.$setPristine(true);\r\n });\r\n\r\n scope.$on('formDirty', function () {\r\n formCtrl.$setDirty(true);\r\n });\r\n\r\n // handle angular route change\r\n scope.$on('$locationChangeStart', function (event) {\r\n if (formCtrl.$dirty) {\r\n if (!window.confirm(warningMessage)) {\r\n event.preventDefault();\r\n }\r\n }\r\n });\r\n\r\n // handle browser window/tab close\r\n $(window).on('beforeunload', function (event) {\r\n if (formCtrl.$dirty) {\r\n return warningMessage;\r\n }\r\n });\r\n\r\n // clean up beforeunload handler when scope is destroyed\r\n scope.$on('$destroy', function () {\r\n $(window).unbind('beforeunload');\r\n });\r\n }\r\n };\r\n }]);\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc directive\r\n * @name cat.directives.numbersOnly:numbersOnly\r\n */\r\nangular.module('cat.directives.numbersOnly', [])\r\n .directive('numbersOnly', function CatNumbersOnlyDirective() {\r\n return {\r\n require: 'ngModel',\r\n link: function CatNumbersOnlyLink(scope, element, attrs, modelCtrl) {\r\n modelCtrl.$parsers.push(function (inputValue) {\r\n if (!inputValue) return '';\r\n\r\n var pattern = '[^0-9]';\r\n\r\n if (!!attrs.hasOwnProperty('allowFraction')) {\r\n pattern = '[^0-9,.]';\r\n }\r\n\r\n var transformedInput = inputValue.replace(new RegExp(pattern, 'g'), '');\r\n\r\n if (transformedInput !== inputValue) {\r\n modelCtrl.$setViewValue(transformedInput);\r\n modelCtrl.$render();\r\n }\r\n\r\n return transformedInput;\r\n });\r\n }\r\n };\r\n });","/**\r\n * Created by tscheinecker on 23.10.2014.\r\n */\r\n'use strict';\r\n\r\nwindow.cat.i18n = window.cat.i18n || {};\r\nwindow.cat.i18n.de = window.cat.i18n.de || {};\r\n\r\n_.assign(window.cat.i18n.de, {\r\n 'cc.catalysts.cat-paginated.itemsFound': '{{count}} Einträge gefunden. Einträge {{firstResult}}-{{lastResult}}',\r\n 'cc.catalysts.cat-paginated.noItemsFound': 'Keine Einträge gefunden',\r\n 'cc.catalysts.general.new': 'Neu',\r\n 'cc.catalysts.general.edit': 'Bearbeiten',\r\n 'cc.catalysts.general.delete': 'Löschen',\r\n 'cc.catalysts.general.copy': 'Kopieren',\r\n 'cc.catalysts.general.save': 'Speichern',\r\n 'cc.catalysts.general.cancel': 'Abbrechen',\r\n 'cc.catalysts.cat-breadcrumbs.entry.home': 'Zuhause',\r\n 'cc.catalysts.cat-breadcrumbs.entry.edit': 'Bearbeiten',\r\n 'cc.catalysts.cat-field-errors-info.text': 'Beim speichern ist ein Fehler aufgetreten. Bitte überprüfen Sie Ihre Eingabe.',\r\n 'cc.catalysts.cat-validation-service.networkError': 'Es ist ein Netzwerkfehler aufgetreten.'\r\n});\r\n","/**\r\n * Created by tscheinecker on 23.10.2014.\r\n */\r\n'use strict';\r\n\r\nwindow.cat.i18n = window.cat.i18n || {};\r\nwindow.cat.i18n.en = window.cat.i18n.en || {};\r\n\r\n_.assign(window.cat.i18n.en, {\r\n 'cc.catalysts.cat-paginated.itemsFound': '{{count}} entries found. Entries {{firstResult}}-{{lastResult}}',\r\n 'cc.catalysts.cat-paginated.noItemsFound': 'No entries found',\r\n 'cc.catalysts.general.new': 'New',\r\n 'cc.catalysts.general.edit': 'Edit',\r\n 'cc.catalysts.general.delete': 'Delete',\r\n 'cc.catalysts.general.copy': 'Copy',\r\n 'cc.catalysts.general.save': 'Save',\r\n 'cc.catalysts.general.cancel': 'Cancel',\r\n 'cc.catalysts.cat-breadcrumbs.entry.home': 'Home',\r\n 'cc.catalysts.cat-breadcrumbs.entry.edit': 'Edit',\r\n 'cc.catalysts.cat-field-errors-info.text': 'Errors occured during save. Please verify your input.',\r\n 'cc.catalysts.cat-validation-service.networkError': 'A network error occurred.'\r\n});\r\n","'use strict';\r\n\r\n/**\r\n * @name CatApiEndpoint\r\n *\r\n * @description\r\n * A CatApiEndpoint wraps several helper functions to easily execute backend calls for the base CRUD operations.\r\n * It also adds support for 'children' which can only be used by resolving them for a parent id.\r\n * @param {string} url the base url which is added before the configured urls\r\n * @param {object} endpointConfig the configuration of this endpoint - holds properties like name, url, the model and children\r\n * @param {object} $http the angular $http service which handles the actual xhr requests\r\n * @param {object} catConversionService the catConversionService used to convert from and to server side data\r\n * @param {object} catSearchService the catSearchService for handling all operations concerning cat.uitl.SearchRequest objects\r\n * @constructor\r\n */\r\nfunction CatApiEndpoint(url, endpointConfig, $http, catConversionService, catSearchService) {\r\n var that = this;\r\n\r\n var _endpointName = endpointConfig.name;\r\n var config = endpointConfig.config;\r\n var _endpointUrl = url + (config.url || endpointConfig.name);\r\n var _childEndpointSettings = endpointConfig.children;\r\n var _endpointListConfig = config.list || {};\r\n\r\n /**\r\n * This helper function initializes all configured child endpoints by creating the appropriate url by appending\r\n * the given id before initializing them.\r\n * @return {object} a object holding all resolved child endpoints for the given id\r\n * @private\r\n */\r\n var _res = _.memoize(function (id) {\r\n var url = _endpointUrl + '/' + id + '/';\r\n var ret = {};\r\n _.forEach(_.keys(_childEndpointSettings), function (path) {\r\n ret[path] = new CatApiEndpoint(url, _childEndpointSettings[path], $http, catConversionService, catSearchService);\r\n ret[path].parentEndpoint = that;\r\n ret[path].parentId = id;\r\n ret[path].parentInfo = function () {\r\n return that.info(id);\r\n };\r\n });\r\n return ret;\r\n });\r\n\r\n var _addChildEndpoints = function (data) {\r\n _.merge(data, _res(data.id));\r\n };\r\n\r\n /**\r\n * This helper method initializes a new instance of the configured model with the given data and adds all child\r\n * endpoints to it.\r\n * @param data the data received from the backend which is used to initialize the model\r\n * @return {Object} an instance of the configured model initialized with the given data and the resolved child\r\n * endpoints\r\n * @private\r\n */\r\n var _mapResponse = function (data) {\r\n var object = catConversionService.toClient(data, config);\r\n\r\n if (!_.isUndefined(object.id)) {\r\n _addChildEndpoints(object);\r\n }\r\n\r\n if (_.isArray(object)) {\r\n _.forEach(object, _addChildEndpoints);\r\n }\r\n\r\n if (_.isArray(object.elements)) {\r\n _.forEach(object.elements, _addChildEndpoints);\r\n }\r\n\r\n return object;\r\n };\r\n\r\n /**\r\n * This helper methods deletes all child endpoints from the given object.\r\n * @param {object} object the object to remove the child endpoints from\r\n * @return {object} the passed in object without the child endpoints\r\n * @private\r\n */\r\n var _removeEndpoints = function (object) {\r\n var endpoints = _res(object.id);\r\n _.forEach(_.keys(endpoints), function (key) {\r\n delete object[key];\r\n });\r\n return object;\r\n };\r\n\r\n /**\r\n * This helper method turns a cat.SearchRequest in to en url encoded search query\r\n * @param {window.cat.SearchRequest} [searchRequest] the search request which should be url encoded\r\n * @return {string} either the url encoded search query or an empty string if no search request is given or it is not a instance of cat.SearchRequest\r\n * @private\r\n */\r\n var _getSearchQuery = function (searchRequest) {\r\n if (!!searchRequest && searchRequest instanceof window.cat.SearchRequest) {\r\n return '?' + catSearchService.encodeAsUrl(searchRequest);\r\n }\r\n\r\n return '';\r\n };\r\n\r\n /**\r\n * This method is used to instantiate actual child api endpoints which are dependent on a certain parent id\r\n * @param id the id for which to 'resolve' the child endpoints.\r\n * @return {object} a object which maps all child endpoint names to the actual endpoints where the url was resolved\r\n * with the provided id\r\n */\r\n this.res = function (id) {\r\n return _res(id);\r\n };\r\n\r\n /**\r\n * A small helper function to retrieve the actual url this endpoint resolved to.\r\n * @return {string} the resolved url of this endpoint\r\n */\r\n this.getEndpointUrl = function () {\r\n return _endpointUrl;\r\n };\r\n\r\n /**\r\n * A small helper to retrieve the name of the endpoint.\r\n * @return {string} the name of this endpoint\r\n */\r\n this.getEndpointName = function () {\r\n return _endpointName;\r\n };\r\n\r\n /**\r\n * This function calls by default the url available via #getEndpointUrl without further modification apart from\r\n * adding search parameters if the searchRequest parameter is provided. In addition an alternative endpoint url can\r\n * be configured with `endpoint.list.endpoint`, such that the request will be send to another endpoint url.\r\n * (#getEndpointUrl + additional_url).\r\n * It can handle either an array response in which case all elements will be\r\n * mapped to the appropriate configured model or a 'paginated' result in which case an object with totalCount,\r\n * facests and elements will be returned.\r\n *\r\n * @param {SearchRequest} [searchRequest] if given searchRequest#urlEncoded() will be added to the request url\r\n * @return {[{object}]|{totalCount: {Number}, facets: [{Facet}], elements: []}} a promise wrapping either a list of\r\n * instances of the configured model or a wrapper object which holds not only the list but pagination information\r\n * as well\r\n */\r\n this.list = function (searchRequest) {\r\n var url = !!_endpointListConfig.endpoint ? _endpointListConfig.endpoint : '';\r\n return $http.get(_endpointUrl + url + _getSearchQuery(searchRequest)).then(function (response) {\r\n return _mapResponse(response.data);\r\n });\r\n };\r\n\r\n /**\r\n * A helper function which adds '/all' to the request url available via #getEndpointUrl and maps the response to\r\n * the configured model.\r\n * @return [{object}] a promise wrapping an array of new instances of the configured model initialized with the data retrieved from\r\n * the backend\r\n */\r\n this.all = function () {\r\n return $http.get(_endpointUrl + '/all').then(function (response) {\r\n return _.map(response.data, function (elem) {\r\n return _mapResponse(elem);\r\n });\r\n });\r\n };\r\n\r\n /**\r\n * This method makes a GET request to the url available via #getEndpointUrl with the addition of the provided id at the end.\r\n * @param id the id which will be appended as '/:id' to the url\r\n * @return {object} a promise wrapping a new instance of the configured model initialized with the data retrieved\r\n * from the backend\r\n */\r\n this.get = function (id) {\r\n return $http.get(_endpointUrl + '/' + id).then(function (response) {\r\n return _mapResponse(response.data);\r\n });\r\n };\r\n\r\n /**\r\n * This method makes a GET request to the url available via #getEndpointUrl with the addition of '/copy' and the provided id at the end.\r\n * @param id the id which will be appended as '/copy/:id' to the url\r\n * @return {object} a promise wrapping a new instance of the configured model initialized with the data retrieved\r\n * from the backend\r\n */\r\n this.copy = function (id) {\r\n return $http.get(_endpointUrl + '/copy/' + id).then(function (response) {\r\n return _mapResponse(response.data);\r\n });\r\n };\r\n\r\n\r\n /**\r\n * This method makes a GET the url available via #getEndpointUrl with the addition of the provided id at the end + the\r\n * 'info' request parameter.\r\n * @param id the id which will be appended as '/:id' to the url\r\n * @return {*} a promise wrapping the data retrieved from the backend\r\n */\r\n this.info = function (id) {\r\n return $http.get(_endpointUrl + '/' + id + '?info').then(function (response) {\r\n return response.data;\r\n });\r\n };\r\n\r\n\r\n /**\r\n * This method is either makes a PUT or POST request to the backend depending on wheter or not the given object\r\n * has an 'id' attribute.\r\n * For PUT requests the url resolves to #getEndpointUrl + /:id, for POST requests it is just the #getEndpointUrl\r\n * @param {object} object the object which should be sent to the sever. it is stripped of all child endpoints before\r\n * it is sent.\r\n * @return {object} a promise wrapping a new instance of the configured model initialized with the data retrieved\r\n * from the backend\r\n */\r\n this.save = function (object) {\r\n if (!!object.id) {\r\n return $http.put(_endpointUrl + '/' + object.id, _removeEndpoints(object)).then(function (response) {\r\n return _mapResponse(response.data);\r\n });\r\n } else {\r\n return $http.post(_endpointUrl, _removeEndpoints(object)).then(function (response) {\r\n return _mapResponse(response.data);\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * This method executes a DELETE request to the url available via #getEndpointUrl with the addition of the provided url at the end.\r\n * @param url the url to be appended to the endpoint url - usually only the id of the object to delete\r\n * @return {*} The promise returned by the $http 'DELETE' call\r\n */\r\n this.remove = function (url) {\r\n return $http({method: 'DELETE', url: _endpointUrl + '/' + url});\r\n };\r\n\r\n /**\r\n * Simple wrapper object which contains the custom get, put and post methods\r\n * @type {{}}\r\n */\r\n this.custom = {};\r\n\r\n /**\r\n * This method executes a GET request to the url available via #getEndpointUrl joined with the provided one.\r\n * Be aware that the result of the promise will not be mapped to the configured model but instead will be passed on directly.\r\n * @param url the url to be appended to the endpoint url\r\n * @param searchRequest an optional cat.SearchRequest to be applied to the request\r\n * @return {*} The promise returned by the $http.get call\r\n */\r\n this.custom.get = function (url, searchRequest) {\r\n return $http.get([_endpointUrl, url].join('/') + _getSearchQuery(searchRequest));\r\n };\r\n\r\n /**\r\n * This method executes a POST request to the url available via #getEndpointUrl joined with the provided one.\r\n * Be aware that the result of the promise will not be mapped to the configured model but instead will be passed on directly.\r\n * @param url the url to be appended to the endpoint url\r\n * @param object hte object to send as payload - not that it will be used as is for this request\r\n * @return {*} The promise returned by the $http.post call\r\n */\r\n this.custom.post = function (url, object) {\r\n return $http.post([_endpointUrl, url].join('/'), object);\r\n };\r\n\r\n /**\r\n * This method executes a PUT request to the url available via #getEndpointUrl joined with the provided one.\r\n * Be aware that the result of the promise will not be mapped to the configured model but instead will be passed on directly.\r\n * @param url the url to be appended to the endpoint url\r\n * @param object hte object to send as payload - not that it will be used as is for this request\r\n * @return {*} The promise returned by the $http.put call\r\n */\r\n this.custom.put = function (url, object) {\r\n return $http.put([_endpointUrl, url].join('/'), object);\r\n };\r\n}\r\n\r\n/**\r\n * @ngdoc service\r\n * @name EndpointConfig\r\n *\r\n * @description\r\n * An 'EndpointConfig' basically is a wrapper around the configuration for an api endpoint during the configuration\r\n * phase which is later used to instantiate the actual CatApiEndpoints. It exposes its name, the configuration itself,\r\n * as well as a map of all its children and helper function to create or receive child endpoint configurations.\r\n *\r\n * @param {string} name the name of the endpoint\r\n * @param {object} config the api endpoint configuration which basically wraps an 'url' and a 'model' attribute.\r\n * If a 'children' attribute is present as well it will be used to create the appropriate child endpoints automatically,\r\n * without the need to call the #child method manually - this works to arbitrary deps.\r\n * @constructor\r\n */\r\nfunction EndpointConfig(name, config) {\r\n var that = this;\r\n this.config = config || {};\r\n this.children = {};\r\n this.name = name;\r\n\r\n /**\r\n * This method method either returns or creates and returns a child api endpoint of the current one.\r\n *\r\n * @param {string} childName the name of the child endpoint\r\n * @param {object} [childConfig] if given a new EndpointConfig will be created as a child of the current one. The\r\n * parent property of the created config will point to the current config\r\n * @return {EndpointConfig} the child endpoint config with the given name\r\n */\r\n this.child = function (childName, childConfig) {\r\n if (!_.isUndefined(childConfig)) {\r\n this.children[childName] = new EndpointConfig(childName, childConfig);\r\n this.children[childName].parent = this;\r\n }\r\n\r\n return this.children[childName];\r\n };\r\n\r\n // this takes care of mapping the 'old' config style to the new builder style\r\n if (!_.isUndefined(this.config.children)) {\r\n var childrenConfig = this.config.children;\r\n delete this.config.children;\r\n _.forEach(_.keys(childrenConfig), function (childName) {\r\n that.child(childName, childrenConfig[childName]);\r\n });\r\n }\r\n}\r\n\r\nfunction CatApiServiceProvider() {\r\n var _endpoints = {};\r\n\r\n /**\r\n * This method is used to either create or retrieve named endpoint configurations.\r\n * @param {string} name the name of the api endpoint to create or retrieve the configuration for\r\n * @param {object} [settings] if given a new {EndpointConfig} will be created with the given settings\r\n * @return {EndpointConfig} the endpoint config for the given name\r\n */\r\n this.endpoint = function (name, settings) {\r\n if (!_.isUndefined(settings)) {\r\n _endpoints[name] = new EndpointConfig(name, settings);\r\n }\r\n return _endpoints[name];\r\n };\r\n\r\n\r\n this.$get = ['$http', 'catConversionService', 'catSearchService', 'CAT_API_SERVICE_DEFAULTS',\r\n /**\r\n * @return {object} returns a map from names to CatApiEndpoints\r\n */\r\n function $getCatApiService($http, catConversionService, catSearchService, CAT_API_SERVICE_DEFAULTS) {\r\n var catApiService = {};\r\n\r\n var dynamicEndpoints = {};\r\n\r\n /**\r\n * This method allows to define (dynamic) endpoints after the configuration phase.\r\n * @param {string} name (optional the name of the api endpoint to create or retrieve the configuration for\r\n * @param {object} [settings] if given a new {EndpointConfig} will be created with the given settings\r\n * @returns {CatApiEndpoint}\r\n */\r\n catApiService.dynamicEndpoint = function (name, settings) {\r\n if (typeof name === 'object' && _.isUndefined(settings)) {\r\n settings = name;\r\n name = settings.url;\r\n }\r\n if (_.isUndefined(dynamicEndpoints[name])) {\r\n if (_.isUndefined(settings)) {\r\n throw new Error('Undefined dynamic endpoint settings');\r\n }\r\n dynamicEndpoints[name] = new CatApiEndpoint(CAT_API_SERVICE_DEFAULTS.endpointUrlPrefix,\r\n new EndpointConfig(name, settings), $http, catConversionService, catSearchService);\r\n }\r\n return dynamicEndpoints[name];\r\n };\r\n\r\n _.forEach(_.keys(_endpoints), function (path) {\r\n catApiService[path] = new CatApiEndpoint(CAT_API_SERVICE_DEFAULTS.endpointUrlPrefix, _endpoints[path], $http, catConversionService, catSearchService);\r\n });\r\n\r\n return catApiService;\r\n }];\r\n}\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.api:catApiService\r\n *\r\n * @description\r\n * The CatApiServiceProvider exposes a single configuration method 'endpoint' which can be used to create or retrieve\r\n * named endpoint configurations.\r\n *\r\n * @constructor\r\n */\r\nangular\r\n .module('cat.service.api', ['cat.service.conversion', 'cat.service.search'])\r\n .constant('CAT_API_SERVICE_DEFAULTS', {endpointUrlPrefix: 'api/'})\r\n .provider('catApiService', CatApiServiceProvider);\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.api:$api\r\n * @deprecated use 'catApiService'\r\n *\r\n * @description\r\n * deprecated use 'catApiService'\r\n * The CatApiServiceProvider exposes a single configuration method 'endpoint' which can be used to create or retrieve\r\n * named endpoint configurations.\r\n *\r\n * @constructor\r\n */\r\n// $api is deprecated, will be removed in a future release\r\nangular.module('cat.service.api').provider('$api', CatApiServiceProvider);\r\n","'use strict';\r\n\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.breadcrumbs:catBreadcrumbService\r\n * @service\r\n *\r\n * @description\r\n * This service is a simple wrapper around a list of Objects.\r\n * It provides some convenience methods for manipulating the list.\r\n * It's main purpose is to make breadcrumb handling less cumbersome.\r\n *\r\n * @constructor\r\n */\r\nfunction CatBreadcrumbsService(catBreadcrumbs, $state) {\r\n var that = this;\r\n\r\n this.clear = function () {\r\n catBreadcrumbs.length = 0;\r\n };\r\n\r\n this.set = function (bcs) {\r\n that.clear();\r\n _.forEach(bcs, function (bc) {\r\n catBreadcrumbs.push(bc);\r\n });\r\n };\r\n\r\n this.get = function () {\r\n return catBreadcrumbs;\r\n };\r\n\r\n this.addFirst = function (entry) {\r\n catBreadcrumbs.unshift(entry);\r\n };\r\n\r\n this.removeFirst = function () {\r\n return catBreadcrumbs.shift();\r\n };\r\n\r\n this.push = function (entry) {\r\n catBreadcrumbs.push(entry);\r\n };\r\n\r\n this.pop = function () {\r\n return catBreadcrumbs.pop();\r\n };\r\n\r\n this.length = function () {\r\n return catBreadcrumbs.length;\r\n };\r\n\r\n function capitalize(string) {\r\n return string.charAt(0).toUpperCase() + string.substring(1);\r\n }\r\n\r\n this.replaceLast = function (newVal) {\r\n catBreadcrumbs[catBreadcrumbs.length - 1] = newVal;\r\n };\r\n\r\n /**\r\n * This method auto-generates the breadcrumbs from a given view configuration\r\n * @param {Object} config a config object as provided to CatBaseDetailController\r\n * @return {Array} an array which represents the 'ui stack' of directly related parents\r\n */\r\n this.generateFromConfig = function (config) {\r\n that.clear();\r\n var uiStack = [];\r\n\r\n var currentState = $state.$current.parent;\r\n var currentEndpoint = config.endpoint;\r\n var count = 0;\r\n var parents = '^';\r\n\r\n while (!!currentState && !!currentState.parent) {\r\n var stateName = currentState.name;\r\n\r\n if (!/\\.tab$/g.test(stateName)) {\r\n var href = $state.href(parents);\r\n\r\n var breadcrumb = {};\r\n\r\n if (config.parents.length > count) {\r\n var parent = config.parents[count++];\r\n var regex = new RegExp('/' + window.cat.util.pluralize(currentEndpoint.getEndpointName()) + '$');\r\n href = href.replace(regex, '?tab=' + currentEndpoint.getEndpointName());\r\n\r\n breadcrumb = {\r\n url: href,\r\n title: parent.name\r\n };\r\n\r\n uiStack.unshift(breadcrumb);\r\n } else {\r\n breadcrumb = {\r\n title: capitalize(window.cat.util.pluralize(currentEndpoint.getEndpointName())),\r\n key: 'cc.catalysts.cat-breadcrumbs.entry.' + currentEndpoint.getEndpointName(),\r\n url: href\r\n };\r\n }\r\n\r\n that.addFirst(breadcrumb);\r\n currentEndpoint = currentEndpoint.parentEndpoint;\r\n }\r\n\r\n currentState = currentState.parent;\r\n parents += '.^';\r\n }\r\n return uiStack;\r\n };\r\n}\r\n\r\nangular.module('cat.service.breadcrumbs', [])\r\n\r\n/**\r\n * @ngdoc overview\r\n * @name cat.service.breadcrumbs:catBreadcrumbs\r\n */\r\n .value('catBreadcrumbs', [])\r\n .service('catBreadcrumbsService', CatBreadcrumbsService);","'use strict';\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.conversion:catConversionService\r\n * @module cat.service.conversion\r\n *\r\n * @description\r\n * This service handles the transformation between server and client side data.\r\n *\r\n * @constructor\r\n */\r\nfunction CatConversionService(catConversionFunctions) {\r\n this.toClient = function (serverData, context) {\r\n return catConversionFunctions.toClient(serverData, context);\r\n };\r\n\r\n this.toServer = function (clientData) {\r\n return catConversionFunctions.toServer(clientData);\r\n };\r\n}\r\n\r\nfunction _convertToClientModel(data, context) {\r\n if (!_.isUndefined(context) && _.isFunction(context.model)) {\r\n return new context.model(data);\r\n }\r\n\r\n return data;\r\n}\r\n\r\nfunction _convertToClientData(serverData, context) {\r\n if (_.isUndefined(serverData)) {\r\n return undefined;\r\n }\r\n\r\n if (_.isArray(serverData)) {\r\n return _.map(serverData, function (data) {\r\n return _convertToClientModel(data, context);\r\n });\r\n }\r\n\r\n if (_.isNumber(serverData.totalCount)) {\r\n var copy = _.clone(serverData);\r\n var facets = [];\r\n\r\n if (!!serverData.facets) {\r\n facets = _.map(serverData.facets, function (facet) {\r\n return new window.cat.Facet(facet);\r\n });\r\n }\r\n\r\n var result = {\r\n totalCount: serverData.totalCount,\r\n facets: facets,\r\n elements: _.map(serverData.elements, function (elem) {\r\n return _convertToClientData(elem, context);\r\n })\r\n };\r\n\r\n delete copy.totalCount;\r\n delete copy.elements;\r\n delete copy.facets;\r\n\r\n return _.assign(result, copy);\r\n }\r\n\r\n if (!_.isUndefined(context)) {\r\n return _convertToClientModel(serverData, context);\r\n }\r\n\r\n return serverData;\r\n}\r\n\r\n\r\nangular.module('cat.service.conversion', [])\r\n/**\r\n * @ngdoc object\r\n * @name cat.service.conversion:catConversionFunctions\r\n * @module cat.service.conversion\r\n *\r\n * @description\r\n * Value holding functions used by {@link cat.service.conversion:catConversionService catConversionService}\r\n *\r\n * @constructor\r\n */\r\n .value('catConversionFunctions', {\r\n toClient: _convertToClientData,\r\n toServer: function (clientData, context) {\r\n return clientData;\r\n }\r\n })\r\n .service('catConversionService', CatConversionService);","'use strict';\r\n\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.elementVisibility:catElementVisibilityService\r\n * @service\r\n *\r\n * @description\r\n * This service provides a entry point for handling the visibility of ui elements.\r\n * The basic implementation always returns true and is intended to be decorated accordingly within production environments.\r\n *\r\n * @constructor\r\n */\r\nfunction CatElementVisibilityService() {\r\n\r\n /**\r\n * A helper function to determine wheter or not a ui element should be visible.\r\n *\r\n * @param {string} identifier an identifier upon which the the implementation can mofiy it's behaviour\r\n * @param data the data representing the element for which the visibility check is performed\r\n * @returns {boolean} <code>true</code> if the element should be rendered, <code>false</code> otherwise\r\n */\r\n this.isVisible = function (identifier, data) {\r\n return true;\r\n };\r\n}\r\n\r\nangular.module('cat.service.elementVisibility', [])\r\n .service('catElementVisibilityService', [CatElementVisibilityService]);","'use strict';\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.i18n:catI18nLocaleService\r\n * @module cat.service.i18n\r\n */\r\nfunction CatI18nLocaleService($q, $locale, CAT_I18N_DEFAULT_LOCALE) {\r\n this.getLanguageOfLocale = function (locale) {\r\n if (_.isUndefined(locale)) {\r\n return undefined;\r\n }\r\n\r\n if (locale.indexOf('-') !== -1) {\r\n return locale.split('-')[0];\r\n }\r\n\r\n return locale;\r\n };\r\n\r\n this.getCurrentLocale = function () {\r\n return $locale.id;\r\n };\r\n\r\n this.getDefaultLocale = function () {\r\n return CAT_I18N_DEFAULT_LOCALE;\r\n };\r\n}\r\n\r\nangular.module('cat.service.i18n.locale', [])\r\n/**\r\n * @ngdoc overview\r\n * @name cat.service.i18n:CAT_I18N_DEFAULT_LOCALE\r\n * @constant\r\n *\r\n * @description\r\n * The default locale used for message translation\r\n */\r\n .constant('CAT_I18N_DEFAULT_LOCALE', 'de')\r\n .service('catI18nLocaleService', ['$q', '$locale', 'CAT_I18N_DEFAULT_LOCALE', CatI18nLocaleService]);","'use strict';\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.i18n:catI18nMessageSourceService\r\n * @module cat.service.i18n\r\n * @service\r\n *\r\n * @description\r\n * A service to retrieve message templates for a given key and locale\r\n *\r\n * @param {object} $q DOCTODO\r\n * @param {object} catI18nLocaleService DOCTODO\r\n * @param {string} CAT_I18N_DEFAULT_LOCALE DOCTODO\r\n * @constructor\r\n */\r\nfunction CatI18nMessageSourceService($q, catI18nLocaleService, CAT_I18N_DEFAULT_LOCALE) {\r\n function _getLocale(locale) {\r\n return locale || catI18nLocaleService.getDefaultLocale();\r\n }\r\n\r\n function _getMessages(locale) {\r\n var localeId = _getLocale(locale);\r\n\r\n var messages = window.cat.i18n[localeId];\r\n if (_.isUndefined(messages)) {\r\n messages = _getMessages(catI18nLocaleService.getDefaultLocale());\r\n }\r\n if (localeId !== CAT_I18N_DEFAULT_LOCALE && _.isUndefined(messages)) {\r\n messages = _getMessages(CAT_I18N_DEFAULT_LOCALE);\r\n }\r\n\r\n return messages;\r\n }\r\n\r\n /**\r\n * @ngdoc function\r\n * @name getMessages\r\n * @methodOf cat.service.i18n:catI18nMessageSourceService\r\n * @function\r\n *\r\n * @description\r\n * Function which retrieves a message bundle for a given locale\r\n *\r\n * @param {String} [locale] the locale in which the messages should be retrieved\r\n * @returns {Promise} a promise holding the retrieved message bundle\r\n */\r\n this.getMessages = function (locale) {\r\n return $q.when(_getMessages(locale));\r\n };\r\n\r\n /**\r\n * @ngdoc function\r\n * @name getMessage\r\n * @methodOf cat.service.i18n:catI18nMessageSourceService\r\n * @function\r\n *\r\n * @description\r\n * Function which retrieves a message for a given key and locale\r\n *\r\n * @param {String} key the key of the message to retrieve\r\n * @param {String} [locale = CAT_I18N_DEFAULT_LOCALE] the locale in which the messages should be retrieved\r\n * @returns {Promise} a promise holding the retrieved message\r\n */\r\n this.getMessage = function (key, locale) {\r\n var bundle = _getMessages(locale);\r\n if (_.isUndefined(bundle) || _.isUndefined(bundle[key])) {\r\n return $q.reject('No message found for key \\'' + key + '\\' and the given locale \\'' + _getLocale(locale) + '\\'');\r\n }\r\n return $q.when(bundle[key]);\r\n };\r\n\r\n\r\n /**\r\n * @ngdoc function\r\n * @name hasMessage\r\n * @methodOf cat.service.i18n:catI18nMessageSourceService\r\n * @function\r\n *\r\n * @description\r\n * Function which checks whether or not a message for a given key and locale exists\r\n *\r\n * @param {String} key the key of the message to retrieve\r\n * @param {String} [locale = CAT_I18N_DEFAULT_LOCALE] the locale in which the messages should be available\r\n * @returns {Promise} a promise holding <code>TRUE</code> if the key can be resolved for the given locale\r\n */\r\n this.hasMessage = function (key, locale) {\r\n var bundle = _getMessages(locale);\r\n return $q.when(!_.isUndefined(bundle) && !_.isUndefined(bundle[key]));\r\n };\r\n}\r\n\r\nangular.module('cat.service.i18n.message', ['cat.service.i18n.locale'])\r\n .service('catI18nMessageSourceService', ['$q', 'catI18nLocaleService', 'CAT_I18N_DEFAULT_LOCALE', CatI18nMessageSourceService]);\r\n","/**\r\n * Created by tscheinecker on 21.10.2014.\r\n */\r\n'use strict';\r\n\r\nfunction CatI18nService($q, $log, catI18nMessageSourceService, catI18nMessageParameterResolver) {\r\n var that = this;\r\n\r\n /**\r\n * @name catI18nService#translate\r\n * @function\r\n *\r\n * @description\r\n * Tries to resolve the given key to a message of the given locale. The messages are retrieved from the\r\n * {@link catI18nMessageSourceService} and then passed through {@link catI18nMessageParameterResolver}.\r\n *\r\n * @param {String} key the key of the message to be translated\r\n * @param {Object|Array} [parameters] message parameters usable in the resolved message\r\n * @param {String} [locale = CAT_I18N_DEFAULT_LOCALE] the locale to use for translation\r\n * @returns {promise} Returns a promise of the translated key\r\n */\r\n this.translate = function (key, parameters, locale) {\r\n var deferred = $q.defer();\r\n var model = parameters;\r\n\r\n if (_.isArray(parameters)) {\r\n parameters.forEach(function (value, idx) {\r\n model['p' + idx] = value;\r\n });\r\n }\r\n\r\n that.canTranslate(key, locale).then(\r\n function (canTranslate) {\r\n if (canTranslate) {\r\n catI18nMessageSourceService.getMessage(key, locale).then(\r\n function (message) {\r\n try {\r\n var translation = catI18nMessageParameterResolver(message, model);\r\n if (_.isString(translation)) {\r\n deferred.resolve(translation);\r\n } else {\r\n $log.warn('Didn\\'t get a string from catI18nMessageParameterResolver');\r\n deferred.reject(translation);\r\n }\r\n } catch (e) {\r\n $log.warn(e);\r\n deferred.reject(e);\r\n }\r\n },\r\n function (reason) {\r\n $log.warn(reason);\r\n deferred.reject(reason);\r\n }\r\n );\r\n } else {\r\n var reason = 'No translation for key \\'' + key + '\\' available!';\r\n $log.warn(reason);\r\n deferred.reject(reason);\r\n }\r\n },\r\n deferred.reject\r\n );\r\n return deferred.promise;\r\n };\r\n\r\n /**\r\n * @name catI18nService#canTranslate\r\n * @function\r\n *\r\n * @description\r\n * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\r\n * This is useful when you are dealing with an object that might or might not be a promise, or if\r\n * the promise comes from a source that can't be trusted.\r\n *\r\n * @param {String} key the key of the message to be translated\r\n * @param {String} [locale] the locale to use for translation\r\n * @returns {promise} Returns a promise which resolves to true when a message for the given key exists for the\r\n * specified locale\r\n */\r\n this.canTranslate = function (key, locale) {\r\n var deferred = $q.defer();\r\n\r\n catI18nMessageSourceService.getMessages(locale).then(\r\n function (messages) {\r\n deferred.resolve(!_.isUndefined(messages) && !_.isUndefined(messages[key]));\r\n },\r\n function (reason) {\r\n $q.reject(reason);\r\n }\r\n );\r\n\r\n return deferred.promise;\r\n };\r\n}\r\n\r\nangular.module('cat.service.i18n', ['cat.service.i18n.message'])\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.i18n:catI18nMessageParameterResolver\r\n * @value\r\n *\r\n * @description\r\n * A function which accepts a message and parameters and returns the resolved message\r\n */\r\n .value('catI18nMessageParameterResolver', function (message, parameters) {\r\n var result = _.template(message, null, {interpolate: /{{([\\s\\S\\d]+?)}}/g})(parameters || {});\r\n\r\n // lodash >=3\r\n if (_.isFunction(result)) {\r\n return result();\r\n }\r\n return result; // lodash <3\r\n })\r\n\r\n\r\n /**\r\n * @ngdoc service\r\n * @name cat.service.i18n:catI18nService\r\n * @service\r\n *\r\n * @description\r\n * A service to translate message keys to messages of specific locales\r\n *\r\n * @param {object} $q DOCTODO\r\n * @param {object} catI18nMessageSourceService DOCTODO\r\n * @param {object} catI18nMessageParameterResolver DOCTODO\r\n * @constructor\r\n */\r\n .service('catI18nService', ['$q', '$log', 'catI18nMessageSourceService', 'catI18nMessageParameterResolver', CatI18nService]);\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.listDataLoading:catListDataLoadingService\r\n */\r\nangular\r\n .module('cat.service.listDataLoading', [\r\n 'cat.service.api',\r\n 'ui.router'\r\n ])\r\n .factory('catListDataLoadingService', ['$state', '$location', '$q', 'catApiService', 'catSearchService', function CatListDataLoadingService($state, $location, $q, catApiService, catSearchService) {\r\n var load = function (endpoint, searchRequest) {\r\n var deferred = $q.defer();\r\n endpoint.list(searchRequest).then(\r\n function success(data) {\r\n var pagination = searchRequest.pagination();\r\n\r\n var result = {\r\n count: data.totalCount,\r\n collection: data.elements,\r\n pagination: pagination,\r\n firstResult: (pagination.page - 1) * pagination.size + 1,\r\n lastResult: Math.min(pagination.page * pagination.size, data.totalCount),\r\n facets: data.facets,\r\n isSinglePageList: data.totalCount <= pagination.size,\r\n endpoint: endpoint,\r\n searchRequest: searchRequest\r\n };\r\n\r\n delete data.totalCount;\r\n delete data.elements;\r\n delete data.facets;\r\n\r\n deferred.resolve(_.assign(result, data));\r\n },\r\n function error(reason) {\r\n deferred.reject(reason);\r\n });\r\n return deferred.promise;\r\n };\r\n /**\r\n *\r\n * @param {String} endpointName\r\n * @param {Object} [defaultSort={property:'name',isDesc:false}]\r\n */\r\n var resolve = function (endpointName, defaultSort) {\r\n var searchRequest = catSearchService.fromLocation();\r\n if (!defaultSort) {\r\n defaultSort = {property: 'name', isDesc: false};\r\n }\r\n if (!!defaultSort && !$location.search().sort) {\r\n searchRequest.sort(defaultSort);\r\n }\r\n return load(catApiService[endpointName], searchRequest);\r\n };\r\n\r\n return {\r\n 'load': load,\r\n 'resolve': resolve\r\n };\r\n }]);\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.route:catRouteServiceProvider\r\n * @description\r\n * This service provider delegates to the $stateProvider and actually creates 2 separate routes after applying various\r\n * conventions / defaults\r\n */\r\nfunction CatRouteServiceProvider($stateProvider) {\r\n var viewNames = [];\r\n\r\n function _getListUrl(baseUrl, name, config) {\r\n var listUrl = baseUrl + '/' + window.cat.util.pluralize(name.toLowerCase());\r\n\r\n if (!!config && config.url) {\r\n listUrl = baseUrl + '/' + config.url;\r\n }\r\n\r\n return listUrl;\r\n }\r\n\r\n function _registerAbstractState(url, name) {\r\n $stateProvider\r\n .state(name, {\r\n abstract: true,\r\n template: '<ui-view></ui-view>',\r\n url: url\r\n });\r\n }\r\n\r\n function _getStateName(name, config) {\r\n if (!!config && !!config.parent) {\r\n return config.parent + '.' + name;\r\n }\r\n\r\n return name;\r\n }\r\n\r\n\r\n /**\r\n * A helper function for detail routes which applies a few optimizations and some auto configuration.\r\n * The actual instantiated controller will be 'CatBaseDetailController' with a default templateUrl\r\n * 'template/cat-base-detail.tpl.html'. As the CatBaseDetailController expects a config object with several properties\r\n * (templateUrls, parents, detail, endpoint, etc.) this function also takes care of providing the correct 'resolve'\r\n * object which pre-loads all the necessary data.\r\n * @param {Object} config the route config object which will be used to generate the actual route configuration\r\n * @param name the name used to resolve default values like templates, etc.\r\n * @returns {{templateUrl: (string), controller: string, reloadOnSearch: (boolean), resolve: {config: (object)}}}\r\n */\r\n function _getDetailConfig(config, name) {\r\n var _config = _.assign({name: name}, config);\r\n\r\n return {\r\n url: _config.url || '/:id',\r\n templateUrl: _config.templateUrl || 'template/cat-base-detail.tpl.html',\r\n controller: 'CatBaseDetailController',\r\n reloadOnSearch: _config.reloadOnSearch,\r\n resolve: {\r\n config: function ($stateParams, catViewConfigService) {\r\n // TODO $stateParams needs to be passed from here because otherwise it's empty...\r\n return catViewConfigService.getDetailConfig(_config, $stateParams);\r\n }\r\n }\r\n };\r\n }\r\n\r\n function _registerDetailState(config, name) {\r\n var stateName = _getStateName(name, config);\r\n var detailConfig = _getDetailConfig(config, name);\r\n\r\n $stateProvider\r\n .state(stateName + '.detail', detailConfig);\r\n\r\n if (!!config && config.additionalViewTemplate === 'tabs') {\r\n $stateProvider\r\n .state(stateName + '.tab', {\r\n abstract: true,\r\n template: '<ui-view></ui-view>',\r\n url: '/:' + name.toLowerCase() + 'Id'\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * A helper function for list routes which applies a few optimizations and some auto configuration.\r\n * In the current state it handles 4 settings:\r\n * * templateUrl - Auto-generation of the correct templateUrl based on conventions and the config.name property\r\n * * controller - Auto-generation of the correct controller based on conventions and the config.name property\r\n * * reloadOnSearch - this property is set to false\r\n * * resolve - a object with a 'listData' property is returned which is resolved via the correct endpoint\r\n *\r\n * @param {Object} config the route config object which will be used to generate the actual route configuration\r\n * @param name the name used to resolve default values like templates, etc.\r\n * @return {{reloadOnSearch: boolean, controller: string, templateUrl: (string), resolve: {config: Object}}}\r\n */\r\n function _getListConfig(config, name) {\r\n var _config = _.assign({name: name}, config);\r\n\r\n return {\r\n url: _config.url || '',\r\n reloadOnSearch: false,\r\n controller: 'CatBaseListController',\r\n controllerAs: 'catBaseListController',\r\n templateUrl: _config.templateUrl || 'template/cat-base-list.tpl.html',\r\n resolve: {\r\n config: function (catViewConfigService) {\r\n return catViewConfigService.getListConfig(_config);\r\n }\r\n }\r\n };\r\n }\r\n\r\n function _registerListState(config, name) {\r\n var stateName = _getStateName(name, config);\r\n var listConfig = _getListConfig(config, name);\r\n $stateProvider\r\n .state(stateName + '.list', listConfig);\r\n }\r\n\r\n\r\n /**\r\n * @ngdoc function\r\n * @name detailRoute\r\n * @methodOf cat.service.route:catRouteServiceProvider\r\n *\r\n * @description\r\n * This function creates route url via convention from the given parameters and passes them (together with the\r\n * configuration) to the $stateProvider. The actual route configuration is received by passing the given one\r\n * to #window.cat.util.route.detail\r\n *\r\n * @param {string} baseUrl the base url which will be prepended to all routes\r\n * @param {string} name the name for which the routes will be created\r\n * @param {Object} [config] the config object which wraps the configurations for the list and detail route\r\n */\r\n this.detailRoute = function (baseUrl, name, config) {\r\n var stateName = _getStateName(name, config);\r\n\r\n var viewData = {viewData: !!config ? (config.viewData || {}) : {}};\r\n viewNames.push(stateName);\r\n\r\n var listUrl = _getListUrl(baseUrl, name, config);\r\n\r\n _registerAbstractState(listUrl, stateName);\r\n _registerDetailState(_.assign({}, config, viewData), name);\r\n };\r\n\r\n /**\r\n * @ngdoc function\r\n * @name detailRoute\r\n * @methodOf cat.service.route:catRouteServiceProvider\r\n *\r\n * @description\r\n * This function creates route urls via convention from the given parameters and passes them (together with the\r\n * configuration) to the $stateProvider. The actual route configuration is received by passing the given one\r\n * to #window.cat.util.route.list and #window.cat.util.route.detail\r\n *\r\n * @param {string} baseUrl the base url which will be prepended to all routes\r\n * @param {string} name the name for which the routes will be created\r\n * @param {Object} [config] the config object which wraps the configurations for the list and detail route\r\n */\r\n this.listAndDetailRoute = function (baseUrl, name, config) {\r\n var stateName = _getStateName(name, config);\r\n\r\n var viewData = {viewData: !!config ? (config.viewData || {}) : {}};\r\n viewNames.push(stateName);\r\n if (_.isUndefined(config)) {\r\n config = {};\r\n }\r\n\r\n var listUrl = _getListUrl(baseUrl, name, config);\r\n\r\n _registerAbstractState(listUrl, stateName);\r\n _registerDetailState(_.assign({}, config.details, viewData), name);\r\n _registerListState(_.assign({}, config.list, viewData), name);\r\n };\r\n\r\n /**\r\n * @ngdoc service\r\n * @name cat.service.route:catRouteService\r\n * @module cat.service.route\r\n *\r\n * @description\r\n * This service simply exposes the created view and endpoint names, as the provider basically only delegates\r\n * to the $stateProvider\r\n */\r\n this.$get = function () {\r\n return viewNames;\r\n };\r\n}\r\n\r\nangular\r\n .module('cat.service.route', [\r\n 'ui.router',\r\n 'cat.service.message',\r\n 'cat.service.breadcrumbs',\r\n 'cat.service.validation'\r\n ])\r\n .provider('catRouteService', CatRouteServiceProvider)\r\n .run(['$rootScope', '$log', '$globalMessages', 'catBreadcrumbsService', 'catValidationService',\r\n function ($rootScope, $log, $globalMessages, catBreadcrumbsService, catValidationService) {\r\n $rootScope.$on('$stateChangeError', function () {\r\n var exception = arguments[arguments.length - 1];\r\n $globalMessages.addMessage('warning', exception);\r\n $log.warn(exception);\r\n });\r\n $rootScope.$on('$stateChangeSuccess', function () {\r\n catBreadcrumbsService.clear();\r\n catValidationService.clearValidationErrors();\r\n });\r\n }]);","/**\r\n * Created by Thomas on 08/03/2015.\r\n */\r\n\r\n'use strict';\r\n\r\n/**\r\n * @ngdoc overview\r\n * @name cat.service.search\r\n */\r\nangular.module('cat.service.search', [])\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.search:catUrlEncodingService\r\n * @module cat.service.search\r\n *\r\n * @description\r\n * A small helper service which encapsulates the url encoding of an object.\r\n * In it's default version it just delegates to jQuery.param\r\n */\r\n .service('catUrlEncodingService', function () {\r\n this.encodeAsUrl = function (params) {\r\n if (!!params && !_.isEmpty(params)) {\r\n return $.param(params);\r\n }\r\n\r\n return '';\r\n };\r\n })\r\n /**\r\n * @ngdoc service\r\n * @name cat.service.search:catSearchService\r\n * @requires cat.service.search:catUrlEncodingService\r\n * @module cat.service.search\r\n *\r\n * @descripton\r\n * A helper service which encapsulates several operations which can be performed on a cat.SearchRequest\r\n */\r\n .service('catSearchService', function ($location, catUrlEncodingService) {\r\n\r\n var _encodeSort = function (_sort) {\r\n return (!!_sort.property ? 'sort=' + _sort.property + ':' + ((_sort.isDesc === true || _sort.isDesc === 'true') ? 'desc' : 'asc') : '');\r\n };\r\n\r\n var _encodePagination = function (_pagination) {\r\n return 'page=' + (!!_pagination.page ? Math.max(0, _pagination.page - 1) : 0) + '&size=' + _pagination.size || 100;\r\n };\r\n var _encodeSearch = function (_search) {\r\n return catUrlEncodingService.encodeAsUrl(_search);\r\n };\r\n\r\n var _concatenate = function (result, next) {\r\n if (!result) {\r\n return next;\r\n }\r\n\r\n if (!next) {\r\n return result;\r\n }\r\n return result + '&' + next;\r\n };\r\n\r\n var urlEndoded = function (searchRequest) {\r\n return _([\r\n _encodePagination(searchRequest.pagination()),\r\n _encodeSort(searchRequest.sort()),\r\n _encodeSearch(searchRequest.search())\r\n ]).reduce(_concatenate);\r\n };\r\n\r\n\r\n /**\r\n * @ngdoc function\r\n * @name encodeAsUrl\r\n * @methodOf cat.service.search:catSearchService\r\n *\r\n * @param {cat.SearchRequest} searchRequest the search request to encode as url\r\n *\r\n * @description\r\n * This methods returns an url encoded version of the given search request\r\n */\r\n this.encodeAsUrl = function (searchRequest) {\r\n if (!searchRequest) {\r\n return '';\r\n }\r\n\r\n return urlEndoded(searchRequest);\r\n };\r\n\r\n /**\r\n * @ngdoc function\r\n * @name updateLocation\r\n * @methodOf cat.service.search:catSearchService\r\n *\r\n * @param {cat.SearchRequest} searchRequest the search request from which to update the $location service\r\n *\r\n * @description\r\n * This methods updates the browsers address bar via the $location service to reflect the given SearchRequest\r\n */\r\n this.updateLocation = function (searchRequest) {\r\n if (!searchRequest) {\r\n return;\r\n }\r\n\r\n var pagination = searchRequest.pagination();\r\n var sort = searchRequest.sort();\r\n var search = searchRequest.search();\r\n var ret = {};\r\n ret.page = pagination.page;\r\n ret.size = pagination.size;\r\n if (!!sort.property) {\r\n ret.sort = sort.property;\r\n ret.rev = sort.isDesc || false;\r\n }\r\n _.forEach(_.keys(search), function (s) {\r\n ret['search.' + s] = search[s];\r\n });\r\n $location.search(ret);\r\n };\r\n\r\n /**\r\n * @ngdoc function\r\n * @name fromLocation\r\n * @methodOf cat.service.search:catSearchService\r\n *\r\n * @description\r\n * This methods returns a new instance of {@link cat.SearchRequest} with all parameters set according to the current url search parameters\r\n */\r\n this.fromLocation = function () {\r\n return new cat.SearchRequest($location.search());\r\n };\r\n });\r\n","'use strict';\r\n\r\n\r\nfunction assignDeep(target, source) {\r\n return _.assign(target, source, function (targetProperty, sourceProperty) {\r\n if (_.isObject(targetProperty) && _.isObject(sourceProperty)) {\r\n return assignDeep(targetProperty, sourceProperty);\r\n }\r\n\r\n return sourceProperty;\r\n });\r\n}\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.selectConfig:catSelectConfigService\r\n * @module cat.service.selectConfig\r\n *\r\n * @constructor\r\n */\r\nfunction CatSelectConfigService(configs) {\r\n var _configs = configs;\r\n\r\n /**\r\n * @ngdoc function\r\n * @name getConfig\r\n * @method of cat.service.selectConfig:catSelectConfigService\r\n *\r\n * @description\r\n *\r\n * @param {String} name the name of the config to retreive\r\n * @param {Object} [options] Optional options to use as default values\r\n * @returns {*} the named config object (with applied defaults) or undefined\r\n */\r\n this.getConfig = function (name, options) {\r\n var config = configs[name];\r\n\r\n if (_.isUndefined(config) && _.isUndefined(options)) {\r\n return undefined;\r\n }\r\n\r\n return assignDeep(_.clone(config) || {}, options);\r\n };\r\n}\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.selectConfig:catSelectConfigServiceProvider\r\n * @module cat.service.selectConfig\r\n *\r\n * @description\r\n *\r\n * @constructor\r\n */\r\nfunction CatSelectConfigServiceProvider() {\r\n var configs = {};\r\n\r\n /**\r\n * @ngdoc function\r\n * @name getConfig\r\n * @method of cat.service.selectConfig:catSelectConfigServiceProvider\r\n *\r\n * @description\r\n *\r\n * @param {String} name the name of the config to save or retrieve\r\n * @param {Object} [config] The config to save for the given name or undefined to receive the config\r\n * @returns {*} the named config object\r\n */\r\n this.config = function (name, config) {\r\n if (!_.isUndefined(config)) {\r\n configs[name] = config;\r\n }\r\n\r\n return configs[name];\r\n };\r\n\r\n this.$get = function () {\r\n return new CatSelectConfigService(configs);\r\n };\r\n}\r\n\r\nangular.module('cat.service.selectConfig', []).provider('catSelectConfigService', CatSelectConfigServiceProvider);","/**\r\n * Created by Mustafa on 05.08.2015.\r\n */\r\nangular.module('cat.url.resolver.service', []).service('urlResolverService', function () {\r\n\r\n 'use strict';\r\n\r\n this.getTabTemplate = function (tab, config) {\r\n\r\n var parentUrl = config.endpoint.getEndpointName();\r\n var parentTemplateNamePrefix = config.endpoint.getEndpointName();\r\n var currentEndpoint = config.endpoint;\r\n\r\n while (!_.isUndefined(currentEndpoint.parentEndpoint)) {\r\n currentEndpoint = config.endpoint.parentEndpoint;\r\n var parentEndpointName = currentEndpoint.getEndpointName();\r\n\r\n parentUrl = parentEndpointName + '/' + parentUrl;\r\n\r\n parentTemplateNamePrefix = parentEndpointName + '-' + parentTemplateNamePrefix;\r\n }\r\n return parentUrl + '/' + tab + '/' + parentTemplateNamePrefix + '-' + tab + '-list.tpl.html';\r\n };\r\n});\r\n\r\n","'use strict';\r\n\r\n/**\r\n * Validation Context which holds all information about a validation context\r\n * @param {string} uuid context identifier (optional)\r\n * @constructor\r\n */\r\nfunction ValidationContext(uuid) {\r\n var that = this;\r\n this.uuid = uuid;\r\n this.global = undefined;\r\n this.fieldErrors = {};\r\n this.knownFields = [];\r\n\r\n /**\r\n * Registers a field name to be a known field which is visible in the ui\r\n * @param {string} name name of the field\r\n */\r\n this.registerField = function (name) {\r\n if (!_.includes(that.knownFields, name)) {\r\n that.knownFields.push(name);\r\n }\r\n };\r\n}\r\n\r\nfunction CatValidationService($log,\r\n $globalMessages,\r\n catValidations,\r\n catValidationContexts,\r\n catMessagesConfig,\r\n catI18nService) {\r\n var that = this;\r\n\r\n /**\r\n * Adds a field error to the context\r\n * @param fieldName name of the faulty field\r\n * @param errorMessage associated error message to display\r\n * @param context affected context\r\n */\r\n function appendFieldErrorToContext(fieldName, errorMessage, context) {\r\n if (catMessagesConfig.knownFieldsActive === true) {\r\n // If the error is for a known field, show the error at the field.\r\n // If not, display it as a global error.\r\n if (_.includes(context.knownFields, fieldName)) {\r\n context.fieldErrors[fieldName] = context.fieldErrors[fieldName] || [];\r\n context.fieldErrors[fieldName].push(errorMessage);\r\n } else {\r\n context.global = [errorMessage];\r\n // TODO is this also context dependend? or even necessary?\r\n $globalMessages.addMessages('error', context.global, context);\r\n }\r\n } else {\r\n context.fieldErrors[fieldName] = context.fieldErrors[fieldName] || [];\r\n context.fieldErrors[fieldName].push(errorMessage);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the validations context for a specific context identifier.\r\n * @param {string} contextId context identifier\r\n * @returns {ValidationContext} validation context\r\n */\r\n this.getContext = function (contextId) {\r\n if (contextId !== undefined) {\r\n var validations = catValidationContexts[contextId];\r\n if (validations === undefined) {\r\n throw new Error('Unknown contextId: ' + contextId);\r\n }\r\n return validations;\r\n } else {\r\n return catValidations;\r\n }\r\n };\r\n\r\n /**\r\n * Creates a new validation context.\r\n * @returns {string} context identifier\r\n */\r\n this.createContext = function () {\r\n var uuid = window.cat.util.generateUUID();\r\n catValidationContexts[uuid] = new ValidationContext(uuid);\r\n return uuid;\r\n };\r\n\r\n /**\r\n * Removes/unregisters the context from the validation service.\r\n * @param contextId context context identifier\r\n */\r\n this.destroyContext = function (contextId) {\r\n delete catValidationContexts[contextId];\r\n };\r\n\r\n /**\r\n * Adds a error message for a specific field to the context.\r\n * @param fieldName name of the faulty field\r\n * @param errorMessage associated error message\r\n * @param contextId id of the affected context\r\n */\r\n this.addFieldError = function (fieldName, errorMessage, contextId) {\r\n var context = that.getContext(contextId);\r\n context.fieldErrors = context.fieldErrors || {};\r\n appendFieldErrorToContext(fieldName, errorMessage, context);\r\n };\r\n\r\n this.updateFromRejection = function (rejection) {\r\n var contextId;\r\n if (!!rejection.config) {\r\n contextId = rejection.config.catValidationContextId;\r\n }\r\n\r\n var context = that.getContext(contextId);\r\n context.fieldErrors = {};\r\n\r\n var rejectionData = rejection.data;\r\n context.global = undefined;\r\n\r\n if (!rejectionData) {\r\n $log.warn('Network error occurred');\r\n $log.warn(rejection);\r\n catI18nService\r\n .translate('cc.catalysts.cat-validation-service.networkError')\r\n .then(function(message) {\r\n context.global = [message];\r\n });\r\n return;\r\n }\r\n\r\n if (!!rejectionData.fieldErrors) {\r\n // group by field\r\n _.forEach(rejection.data.fieldErrors, function (fieldError) {\r\n // Allow config to switch between displaying errors at the field and displaying errors at known fields or globally\r\n appendFieldErrorToContext(fieldError.field, fieldError.message, context);\r\n });\r\n }\r\n\r\n if (!!rejectionData.globalErrors) {\r\n context.global = rejection.data.globalErrors;\r\n\r\n // TODO is this also context dependend? or even necessary?\r\n $globalMessages.addMessages('error', rejection.data.globalErrors, context);\r\n }\r\n };\r\n\r\n this.clearValidationErrors = function (contextId) {\r\n var context = that.getContext(contextId);\r\n delete context.global;\r\n context.fieldErrors = {};\r\n };\r\n\r\n /**\r\n * Clears existing errors for the field of the specified context\r\n * @param fieldName name of the field\r\n * @param contextId id of the affected context\r\n */\r\n this.clearFieldError = function (fieldName, contextId) {\r\n var context = that.getContext(contextId);\r\n delete context.fieldErrors[fieldName];\r\n };\r\n\r\n this.hasGlobalErrors = function (contextId) {\r\n var globalErrors = that.getContext(contextId).global;\r\n return !!globalErrors && globalErrors.length > 0;\r\n };\r\n\r\n this.getGlobalErrors = function (contextId) {\r\n return that.getContext(contextId).global;\r\n };\r\n\r\n this.hasFieldErrors = function (fieldName, contextId) {\r\n var fieldErrors = that.getContext(contextId).fieldErrors[fieldName];\r\n return !!fieldErrors && fieldErrors.length > 0;\r\n };\r\n\r\n this.hasAnyFieldErrors = function (contextId) {\r\n var fieldErrors = that.getContext(contextId).fieldErrors;\r\n return !_.isEmpty(fieldErrors);\r\n };\r\n\r\n this.getFieldErrors = function (fieldName, contextId) {\r\n return that.getContext(contextId).fieldErrors[fieldName];\r\n };\r\n\r\n this.hasErrors = function (contextId) {\r\n var hasGlobalErrors = this.hasGlobalErrors(contextId);\r\n var hasFieldErrors = this.hasAnyFieldErrors(contextId);\r\n return hasGlobalErrors || hasFieldErrors;\r\n };\r\n\r\n this.prepareConfig = function (contextId, config) {\r\n return _.assign(config || {}, {\r\n catValidationContextId: contextId\r\n });\r\n };\r\n}\r\n\r\n/**\r\n * @ngdoc overview\r\n * @name cat.service.validation\r\n *\r\n * @descripton\r\n * module wrapping the validation logic\r\n */\r\nangular.module('cat.service.validation', [\r\n 'cat.service.message',\r\n 'cat.service.i18n'\r\n ])\r\n /**\r\n * @ngdoc object\r\n * @name cat.service.validation:catValidations\r\n *\r\n * @description\r\n * value holding 'global' and 'field' errors\r\n */\r\n .value('catValidations', new ValidationContext())\r\n\r\n /**\r\n * @ngdoc object\r\n * @name cat.service.validation:catValidationContexts\r\n *\r\n * @description\r\n * value holding 'global' and 'field' errors\r\n */\r\n .value('catValidationContexts', {})\r\n\r\n /**\r\n * @ngdoc service\r\n * @name cat.service.validation:catValidationService\r\n *\r\n * @description\r\n * Service which maps the 'fieldErrors' list recieved from the backend to a usable map for the client. All methods\r\n * have a 'context' parameter as the last parameter. If no context is provided the global context will be used,\r\n * otherwise the field error messages will be assigned to the specified context.\r\n */\r\n .service('catValidationService', [\r\n '$log',\r\n '$globalMessages',\r\n 'catValidations',\r\n 'catValidationContexts',\r\n 'catMessagesConfig',\r\n 'catI18nService',\r\n CatValidationService\r\n ]);","/**\r\n * @author Thomas Scheinecker, Catalysts GmbH.\r\n */\r\n\r\n'use strict';\r\n\r\nfunction CatViewConfigService($q, catApiService, catListDataLoadingService) {\r\n function toLowerCaseName(name) {\r\n if (!name) {\r\n return '';\r\n }\r\n return name.toLowerCase();\r\n }\r\n\r\n function getDetailData($stateParams, Model, endpoint) {\r\n var detailPromise;\r\n\r\n var detailId = $stateParams.id;\r\n if (detailId === 'new') {\r\n detailPromise = $q.when(new Model());\r\n } else {\r\n detailPromise = endpoint.get(detailId);\r\n }\r\n return detailPromise;\r\n }\r\n\r\n function getEndpoint(endpointName, parentEndpointNames, $stateParams) {\r\n var endpoint = catApiService[endpointName];\r\n\r\n if (_.isArray(parentEndpointNames)) {\r\n _.forEach(parentEndpointNames, function (parentEndpointName, idx) {\r\n var currentEndpoint;\r\n if (idx === 0) {\r\n // root api endpoint\r\n currentEndpoint = catApiService[parentEndpointName];\r\n } else {\r\n // child api endpoint\r\n currentEndpoint = endpoint[parentEndpointName];\r\n }\r\n endpoint = currentEndpoint.res($stateParams[parentEndpointName + 'Id']);\r\n });\r\n\r\n endpoint = endpoint[endpointName];\r\n }\r\n\r\n return endpoint;\r\n }\r\n\r\n function getParentInfo(endpoint) {\r\n if (!_.isUndefined(endpoint) && !_.isUndefined(endpoint.parentInfo)) {\r\n var deferred = $q.defer();\r\n var parents = [];\r\n endpoint.parentInfo().then(\r\n function (parent) {\r\n parents.push(parent);\r\n getParentInfo(endpoint.parentEndpoint).then(\r\n function (response) {\r\n parents.push(response);\r\n parents = _.flatten(parents);\r\n deferred.resolve(parents);\r\n },\r\n function (error) {\r\n deferred.reject(error);\r\n }\r\n );\r\n }, function (error) {\r\n deferred.reject(error);\r\n });\r\n return deferred.promise;\r\n } else {\r\n return $q.when([]);\r\n }\r\n }\r\n\r\n this.getDetailConfig = function (config, $stateParams) {\r\n var endpointName, parentEndpointNames;\r\n\r\n if (_.isString(config.endpoint)) {\r\n endpointName = config.endpoint;\r\n } else if (_.isObject(config.endpoint)) {\r\n parentEndpointNames = config.endpoint.parents;\r\n endpointName = config.endpoint.name;\r\n } else {\r\n endpointName = toLowerCaseName(config.name);\r\n }\r\n\r\n var Model = config.model || window.cat.util.defaultModelResolver(config.name);\r\n\r\n var parentUrl = '';\r\n var parentTemplateNamePrefix = '';\r\n\r\n\r\n if (_.isArray(parentEndpointNames)) {\r\n _.forEach(parentEndpointNames, function (parentEndpointName) {\r\n parentUrl += parentEndpointName;\r\n parentUrl += '/';\r\n\r\n parentTemplateNamePrefix += parentEndpointName;\r\n parentTemplateNamePrefix += '-';\r\n });\r\n }\r\n\r\n var tabs;\r\n\r\n var templateUrls = {\r\n edit: parentUrl + endpointName + '/' + parentTemplateNamePrefix + endpointName + '-details-edit.tpl.html',\r\n view: parentUrl + endpointName + '/' + parentTemplateNamePrefix + endpointName + '-details-view.tpl.html'\r\n };\r\n\r\n if (config.additionalViewTemplate === true) {\r\n templateUrls.view = {\r\n main: templateUrls.view,\r\n additional: parentUrl + endpointName + '/' + parentTemplateNamePrefix + endpointName + '-additional-details-view.tpl.html'\r\n };\r\n } else if (config.additionalViewTemplate === 'tabs') {\r\n templateUrls.view = {\r\n main: templateUrls.view,\r\n additional: 'template/cat-base-additional-details-tabs-view.tpl.html'\r\n };\r\n tabs = config.additionalViewTemplateTabs;\r\n }\r\n\r\n var deferred = $q.defer();\r\n var endpoint = getEndpoint(endpointName, parentEndpointNames, $stateParams);\r\n\r\n var resolvedConfig = {\r\n viewData: config.viewData,\r\n name: config.name,\r\n controller: config.controller || config.name + 'DetailsController',\r\n endpoint: endpoint,\r\n Model: Model,\r\n templateUrls: templateUrls,\r\n tabs: tabs\r\n };\r\n\r\n\r\n var detailPromise = getDetailData($stateParams, Model, endpoint);\r\n detailPromise.then(function (data) {\r\n resolvedConfig.detail = data;\r\n });\r\n\r\n var parentsPromise = getParentInfo(endpoint);\r\n parentsPromise.then(function (parents) {\r\n resolvedConfig.parents = parents;\r\n });\r\n\r\n $q.all([detailPromise, parentsPromise]).then(\r\n function () {\r\n deferred.resolve(resolvedConfig);\r\n },\r\n function (reason) {\r\n deferred.reject(reason);\r\n }\r\n );\r\n\r\n return deferred.promise;\r\n };\r\n\r\n\r\n function getListDataPromise(config, name) {\r\n return catListDataLoadingService.resolve(config.endpoint || name, config.defaultSort);\r\n }\r\n\r\n this.getListConfig = function (config) {\r\n var name = toLowerCaseName(config.name);\r\n\r\n var deferredConfig = $q.defer();\r\n var resolvedConfig = {\r\n viewData: config.viewData,\r\n name: config.name,\r\n controller: config.controller || config.name + 'Controller',\r\n title: window.cat.util.pluralize(config.name),\r\n searchProps: config.searchProps || window.cat.util.defaultListSearchProps,\r\n listTemplateUrl: config.listTemplateUrl || (name + '/' + name + '-list.tpl.html')\r\n };\r\n\r\n getListDataPromise(config, name).then(\r\n function (listData) {\r\n resolvedConfig.listData = listData;\r\n deferredConfig.resolve(resolvedConfig);\r\n }\r\n );\r\n\r\n return deferredConfig.promise;\r\n };\r\n}\r\n\r\nangular\r\n .module('cat.service.view.config', [\r\n 'cat.service.api',\r\n 'cat.service.listDataLoading'\r\n ])\r\n .service('catViewConfigService', CatViewConfigService);\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.view:catViewService\r\n * @module cat.service.view\r\n *\r\n * @description\r\n * This service provider can be used to initialize an api endpoint and the according detail and list routes by simply\r\n * providing a name and a config object.\r\n *\r\n * @param {CatRouteServiceProvider} catRouteServiceProvider DOCTODO\r\n * @param {CatApiServiceProvider} catApiServiceProvider DOCTODO\r\n * @constructor\r\n */\r\nfunction CatViewServiceProvider(catRouteServiceProvider, catApiServiceProvider) {\r\n var viewNames = [];\r\n var endpointNames = [];\r\n\r\n /**\r\n * This function registers a new api endpoint with catApiServiceProvider and a list and detail route with\r\n * catRouteServiceProvider\r\n * @param {string} baseUrl the base url which will be prepended to all generated route pats\r\n * @param {string} name the name used as entry point to all routes and endpoint creations (camel cased)\r\n * @param {object} [config] the config object which can in turn hold objects used for configuration of the endpoint,\r\n * detail route or list route\r\n */\r\n this.listAndDetailView = function (baseUrl, name, config) {\r\n var endpointName = name.toLowerCase();\r\n var url = window.cat.util.pluralize(endpointName);\r\n\r\n if (!!config) {\r\n url = config.url || url;\r\n }\r\n\r\n var endpoint = {\r\n model: window.cat.util.defaultModelResolver(name),\r\n url: url\r\n };\r\n\r\n if (!!config) {\r\n endpoint = _.assign(endpoint, config.endpoint);\r\n }\r\n\r\n\r\n viewNames.push(name);\r\n endpointNames.push(endpointName);\r\n\r\n catApiServiceProvider.endpoint(name.toLowerCase(), endpoint);\r\n catRouteServiceProvider.listAndDetailRoute(baseUrl, name, config);\r\n };\r\n\r\n /**\r\n * This service simply exposes the created view and endpoint names, as the provider basically only delegates\r\n * to other service providers\r\n * @return {{views: Array, endpoints: Array}}\r\n */\r\n this.$get = function () {\r\n return {\r\n views: viewNames,\r\n endpoints: endpointNames\r\n };\r\n };\r\n}\r\n\r\nangular.module('cat.service.view',\r\n [\r\n 'cat.service.api',\r\n 'cat.service.route',\r\n 'cat.service.view.config'\r\n ]).provider('catViewService', CatViewServiceProvider);","'use strict';\r\n\r\nangular.module('cat.service.httpIntercept', ['cat.service.message', 'cat.service.loading', 'cat.service.validation'])\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.httpIntercept:errorHttpInterceptor\r\n */\r\n .factory('errorHttpInterceptor', function CatErrorHttpInterceptor($q, $globalMessages, loadingService, $injector) {\r\n function toBeIgnored(config) {\r\n return !!config && config.skipLoadingService;\r\n }\r\n\r\n return {\r\n 'request': function (config) {\r\n if (!toBeIgnored(config)) {\r\n loadingService.start();\r\n }\r\n return config;\r\n },\r\n 'requestError': function (rejection) {\r\n if (!toBeIgnored(rejection.config)) {\r\n loadingService.stop();\r\n }\r\n return $q.reject(rejection);\r\n },\r\n 'response': function (success) {\r\n if (!toBeIgnored(success.config)) {\r\n loadingService.stop();\r\n }\r\n return success;\r\n },\r\n 'responseError': function (rejection) {\r\n if (!toBeIgnored(rejection.config)) {\r\n loadingService.stop();\r\n }\r\n $injector.get('catValidationMessageHandler').handleRejectedResponse(rejection);\r\n return $q.reject(rejection);\r\n }\r\n };\r\n })\r\n .config(function ($httpProvider) {\r\n $httpProvider.interceptors.push('errorHttpInterceptor');\r\n });\r\n","'use strict';\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.loading:loadingService\r\n */\r\nangular.module('cat.service.loading', ['angularSpinner'])\r\n .constant('CAT_LOADING_SERVICE_DEFAULTS', {\r\n timeout: 50,\r\n animationDuration: 200\r\n })\r\n .service('loadingService', [\r\n '$rootScope',\r\n '$timeout',\r\n 'usSpinnerService',\r\n 'CAT_LOADING_SERVICE_DEFAULTS',\r\n function CatLoadingService($rootScope, $timeout, usSpinnerService, CAT_LOADING_SERVICE_DEFAULTS) {\r\n var that = this;\r\n var activeCount = 0;\r\n var startTime;\r\n var startTimer, stopTimer;\r\n\r\n this.start = function () {\r\n if (!activeCount && !startTimer) {\r\n if (!!stopTimer) {\r\n $timeout.cancel(stopTimer);\r\n stopTimer = undefined;\r\n }\r\n startTimer = $timeout(function () {\r\n usSpinnerService.spin('loading-spinner');\r\n $rootScope.loading = true;\r\n startTime = new Date().getTime();\r\n }, CAT_LOADING_SERVICE_DEFAULTS.timeout);\r\n }\r\n activeCount++;\r\n };\r\n\r\n this.stop = function () {\r\n activeCount--;\r\n if (!activeCount && !stopTimer) {\r\n if (!!startTimer) {\r\n $timeout.cancel(startTimer);\r\n startTimer = undefined;\r\n }\r\n var now = new Date().getTime();\r\n var stopTimeout = CAT_LOADING_SERVICE_DEFAULTS.timeout + (Math.max((CAT_LOADING_SERVICE_DEFAULTS.animationDuration - (now - startTime)), 0));\r\n stopTimer = $timeout(function () {\r\n usSpinnerService.stop('loading-spinner');\r\n $rootScope.loading = false;\r\n }, stopTimeout);\r\n }\r\n };\r\n\r\n var stateChangeInProgress = false;\r\n\r\n $rootScope.$on('$stateChangeStart', function () {\r\n if (!stateChangeInProgress) {\r\n that.start();\r\n stateChangeInProgress = true;\r\n }\r\n\r\n });\r\n $rootScope.$on('$stateChangeSuccess', function () {\r\n that.stop();\r\n stateChangeInProgress = false;\r\n });\r\n $rootScope.$on('$stateChangeError', function () {\r\n that.stop();\r\n stateChangeInProgress = false;\r\n });\r\n }]);\r\n","'use strict';\r\n\r\nfunction MenuEntry(menuEntryId, options, parent) {\r\n this.id = menuEntryId;\r\n this.completeId = parent.completeId + '.' + this.id;\r\n var _options = options;\r\n\r\n this.getOptions = function () {\r\n return _options;\r\n };\r\n\r\n this.isGroup = function () {\r\n return false;\r\n };\r\n\r\n this.isMenu = function () {\r\n return false;\r\n };\r\n}\r\n\r\nfunction MenuGroup(groupId, options, parent) {\r\n var that = this;\r\n this.id = groupId;\r\n this.completeId = parent.completeId + '.' + this.id;\r\n var _menuEntries = [];\r\n var _options = options;\r\n\r\n this.addMenuEntry = function (menuEntryId, options) {\r\n _menuEntries.push(new MenuEntry(menuEntryId, options, that));\r\n };\r\n\r\n this.getOptions = function () {\r\n return _options;\r\n };\r\n\r\n this.getEntries = function () {\r\n return _.sortBy(_menuEntries, function (entry) {\r\n return entry.getOptions().sortOrder || 10000;\r\n });\r\n };\r\n\r\n this.isGroup = function () {\r\n return true;\r\n };\r\n\r\n this.isMenu = function () {\r\n return false;\r\n };\r\n\r\n this.isSubMenu = function () {\r\n return (_options.displayAsSubMenu === true);\r\n };\r\n}\r\n\r\nfunction Menu(menuId, options) {\r\n var that = this;\r\n this.id = menuId;\r\n this.completeId = this.id;\r\n var _menuEntries = [];\r\n var _menuGroups = {};\r\n var _options = options;\r\n\r\n this.addMenuGroup = function (groupId, options) {\r\n _menuGroups[groupId] = new MenuGroup(groupId, options, that);\r\n };\r\n\r\n this.addMenuEntry = function (groupId, menuEntryId, options) {\r\n if (_.isUndefined(groupId)) {\r\n _menuEntries.push(new MenuEntry(menuEntryId, options, that));\r\n } else {\r\n _menuGroups[groupId].addMenuEntry(menuEntryId, options);\r\n }\r\n };\r\n\r\n this.getGroups = function () {\r\n return _.sortBy(_.map(_menuGroups, function (menuGroup) {\r\n return menuGroup;\r\n }), function (menuGroup) {\r\n return menuGroup.getOptions().sortOrder || 10000;\r\n });\r\n };\r\n\r\n this.getEntries = function (groupId) {\r\n if (_.isUndefined(groupId)) {\r\n return _.sortBy(_menuEntries, function (entry) {\r\n return entry.getOptions().sortOrder || 10000;\r\n });\r\n }\r\n return _menuGroups[groupId].getEntries();\r\n };\r\n\r\n this.getFlattened = function () {\r\n return _.flatten([_menuEntries, _.map(this.getGroups(), function (group) {\r\n if (group.getOptions().displayAsSubMenu === true) {\r\n group.subEntries = group.getEntries();\r\n return [group];\r\n } else {\r\n return [group, group.getEntries()];\r\n }\r\n })], !!_.flattenDeep);\r\n };\r\n\r\n this.isMenu = function () {\r\n return true;\r\n };\r\n\r\n this.isGroup = function () {\r\n return false;\r\n };\r\n\r\n this.getOptions = function () {\r\n return _options;\r\n };\r\n}\r\n\r\nfunction MenuBar(menuBarId, options) {\r\n this.id = menuBarId;\r\n var _menus = {};\r\n var _options = options;\r\n\r\n this.addMenu = function (menuId, options) {\r\n _menus[menuId] = new Menu(menuId, options);\r\n };\r\n\r\n this.addMenuGroup = function (menuId, groupId, options) {\r\n _menus[menuId].addMenuGroup(groupId, options);\r\n };\r\n\r\n this.addMenuEntry = function (menuId, groupId, menuEntryId, options) {\r\n _menus[menuId].addMenuEntry(groupId, menuEntryId, options);\r\n };\r\n\r\n this.getMenus = function () {\r\n return _.map(_menus, function (menu) {\r\n return menu;\r\n });\r\n };\r\n\r\n this.getOptions = function () {\r\n return _options;\r\n };\r\n}\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.menu:$mainMenu\r\n * @constructor\r\n */\r\nfunction MainMenuProvider() {\r\n var _mainMenu = new MenuBar('main.menu', {});\r\n\r\n var _menus = [];\r\n var _groups = [];\r\n var _entries = [];\r\n\r\n this.menu = function (moduleId, options) {\r\n _menus.push({\r\n menuId: moduleId,\r\n options: options\r\n });\r\n };\r\n\r\n this.menuGroup = function (moduleId, groupId, options) {\r\n _groups.push({\r\n menuId: moduleId,\r\n groupId: groupId,\r\n options: options\r\n });\r\n };\r\n\r\n this.menuEntry = function (moduleId, groupId, entryId, options) {\r\n if (_.isUndefined(options)) {\r\n options = entryId;\r\n entryId = groupId;\r\n groupId = undefined;\r\n }\r\n _entries.push({\r\n menuId: moduleId,\r\n groupId: groupId,\r\n entryId: entryId,\r\n options: options\r\n });\r\n };\r\n\r\n this.$get = function () {\r\n _.forEach(_menus, function (menu) {\r\n _mainMenu.addMenu(menu.menuId, menu.options);\r\n });\r\n\r\n _.forEach(_groups, function (group) {\r\n _mainMenu.addMenuGroup(group.menuId, group.groupId, group.options);\r\n });\r\n\r\n _.forEach(_entries, function (entry) {\r\n _mainMenu.addMenuEntry(entry.menuId, entry.groupId, entry.entryId, entry.options);\r\n });\r\n\r\n return _mainMenu;\r\n };\r\n}\r\n\r\nangular.module('cat.service.menu', []).provider('$mainMenu', MainMenuProvider);\r\n","'use strict';\r\n\r\nfunction CatGlobalMessages($rootScope) {\r\n\r\n function Message(data) {\r\n data = data || {};\r\n this.text = data.text || '';\r\n this.type = data.type;\r\n this.timeToLive = data.timeToLive || 0;\r\n }\r\n\r\n var messages = {};\r\n\r\n var self = this;\r\n\r\n this.getMessages = function (type) {\r\n if (!type) {\r\n return [];\r\n }\r\n\r\n return _.map(messages[type], function (message) {\r\n return message.text;\r\n });\r\n };\r\n\r\n this.hasMessages = function (type) {\r\n if (!type) {\r\n return false;\r\n }\r\n\r\n return !!messages[type] && messages[type].length !== 0;\r\n };\r\n\r\n this.clearMessages = function (type) {\r\n if (!type) {\r\n messages = {};\r\n return;\r\n }\r\n\r\n messages[type] = [];\r\n };\r\n\r\n this.clearDeadMessages = function () {\r\n for (var type in messages) {\r\n messages[type] = _.filter(messages[type], function (message) {\r\n return message.timeToLive > 0;\r\n });\r\n }\r\n };\r\n\r\n this.addMessage = function (type, message, flash) {\r\n if (!type) {\r\n return;\r\n }\r\n\r\n if (!messages[type]) {\r\n self.clearMessages(type);\r\n }\r\n\r\n messages[type].push(new Message({\r\n text: message,\r\n type: type,\r\n timeToLive: flash ? 1 : 0\r\n }));\r\n };\r\n\r\n this.decreaseTimeToLive = function () {\r\n for (var type in messages) {\r\n _.forEach(messages[type], function (message) {\r\n message.timeToLive--;\r\n });\r\n }\r\n };\r\n\r\n this.addMessages = function (type, messages) {\r\n if (!type) {\r\n return;\r\n }\r\n\r\n _.forEach(messages, function (message) {\r\n self.addMessage(type, message);\r\n });\r\n };\r\n\r\n this.setMessages = function (type, messages) {\r\n if (!type) {\r\n return;\r\n }\r\n\r\n self.clearMessages(type);\r\n if (!!messages) {\r\n self.addMessages(type, messages);\r\n }\r\n };\r\n\r\n $rootScope.$on('$stateChangeSuccess', function () {\r\n self.clearDeadMessages();\r\n self.decreaseTimeToLive();\r\n });\r\n}\r\n\r\nangular.module('cat.service.message', [\r\n 'cat.config.messages'\r\n])\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.message:catValidationMessageHandler\r\n */\r\n .service('catValidationMessageHandler', function CatValidationMessageHandler($globalMessages, catValidationService) {\r\n this.handleRejectedResponse = function (rejection) {\r\n $globalMessages.clearMessages('error');\r\n\r\n if (!!rejection.data && !!rejection.data.error) {\r\n var error = '[' + rejection.status + ' - ' + rejection.statusText + '] ' + rejection.data.error;\r\n if (!!rejection.data.cause) {\r\n error += '\\n' + rejection.data.cause;\r\n }\r\n $globalMessages.addMessage('error', error);\r\n }\r\n\r\n catValidationService.updateFromRejection(rejection);\r\n };\r\n })\r\n\r\n/**\r\n * @ngdoc service\r\n * @name cat.service.message:$globalMessages\r\n */\r\n .service('$globalMessages', ['$rootScope', CatGlobalMessages]);\r\n","'use strict';\r\n\r\nwindow.cat.util = window.cat.util || {};\r\n\r\n/**\r\n * Capitalizes a string (first letter to uppercase)\r\n * @param string\r\n * @returns {string}\r\n */\r\nwindow.cat.util.pluralize = function (string) {\r\n if (_.isUndefined(string) || string.length === 0) {\r\n return '';\r\n }\r\n var lastChar = string[string.length - 1];\r\n\r\n switch (lastChar) {\r\n case 'y':\r\n // Exception if the word ends with 'ay' e.g. 'gateway'\r\n if (string[string.length - 2] === 'a') {\r\n return string + 's';\r\n }\r\n return string.substring(0, string.length - 1) + 'ies';\r\n case 's':\r\n return string + 'es';\r\n default :\r\n return string + 's';\r\n }\r\n};\r\n\r\n/**\r\n * Pluralizes a string\r\n * @param string\r\n * @returns {*}\r\n */\r\nwindow.cat.util.capitalize = function (string) {\r\n if (_.isUndefined(string) || string.length === 0) {\r\n return '';\r\n }\r\n\r\n return string.substring(0, 1).toUpperCase() + string.substring(1, string.length);\r\n};\r\n\r\n/**\r\n * Generates a new UUID\r\n *\r\n * @returns {string} uuid\r\n */\r\nwindow.cat.util.generateUUID = function () {\r\n // http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\r\n /* jshint ignore:start */\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n /* jshint ignore:end */\r\n};\r\n","/**\r\n * Created by tscheinecker on 01.08.2014.\r\n */\r\n\r\n'use strict';\r\n\r\nwindow.cat.util = window.cat.util || {};\r\n\r\nwindow.cat.models = window.cat.models || {};\r\n\r\n/**\r\n * This helper function is used to acquire the constructor function which is used as a 'model' for the api endpoint.\r\n * @param name the name of the 'entity' for which the constructor has to be returned\r\n * @returns {Constructor}\r\n */\r\nwindow.cat.util.defaultModelResolver = function (name) {\r\n return window.cat.models[name];\r\n};","angular.module('cat.filters', ['cat.filters.replaceText']);\r\n\r\nangular.module('cat.service', [\r\n 'cat.service.conversion',\r\n 'cat.service.api',\r\n 'cat.service.breadcrumbs',\r\n 'cat.service.elementVisibility',\r\n 'cat.service.i18n',\r\n 'cat.service.listDataLoading',\r\n 'cat.service.route',\r\n 'cat.service.selectConfig',\r\n 'cat.service.view',\r\n 'cat.service.loading',\r\n 'cat.service.httpIntercept',\r\n 'cat.service.menu',\r\n 'cat.service.message',\r\n 'cat.service.search'\r\n]);\r\n\r\nangular.module('cat.controller', ['cat.controller.base.detail', 'cat.controller.base.list']);\r\n\r\nangular.module('cat.directives', [\r\n 'cat.directives.autofocus',\r\n 'cat.directives.checkbox',\r\n 'cat.directives.confirmClick',\r\n 'cat.directives.elementVisible',\r\n 'cat.directives.fieldErrors',\r\n 'cat.directives.fieldErrors.info',\r\n 'cat.directives.globalErrors',\r\n 'cat.directives.input',\r\n 'cat.directives.inputGroup',\r\n 'cat.directives.loadMore',\r\n 'cat.directives.menu',\r\n 'cat.directives.select',\r\n 'cat.directives.i18n',\r\n 'cat.directives.paginated',\r\n 'cat.directives.facets',\r\n 'cat.directives.sortable',\r\n 'cat.directives.form',\r\n 'cat.directives.numbersOnly',\r\n 'cat.directives.breadcrumbs',\r\n 'cat.directives.validation'\r\n]);\r\n\r\nangular.module('cat', [\r\n 'cat.service',\r\n 'cat.directives',\r\n 'cat.filters',\r\n 'cat.controller',\r\n 'ui.bootstrap'\r\n]);\r\n"," return 'cat';\r\n });"],"sourceRoot":"src"}