Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / app / policyApp / policy-models / Editor / src / js / providers / config.js
1 /*-
2  * ============LICENSE_START=======================================================
3  * ECOMP Policy Engine
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 (function(angular) {
22     'use strict';
23
24     angular.module('abs').provider('fileManagerConfig', function() {
25
26         var values = { 
27             appName: 'Policy Editor',
28             defaultLang: 'en',
29             listUrl: 'fm/listUrl',
30             uploadUrl: 'fm/uploadUrl',
31             renameUrl: 'fm/renameUrl',
32             copyUrl: 'fm/copyUrl',
33             removeUrl: 'fm/removeUrl',
34             editUrl: 'fm/editUrl',
35             getContentUrl: 'fm/getContentUrl',
36             createFolderUrl: 'fm/createFolderUrl',
37             downloadFileUrl: 'fm/downloadFileUrl',
38             compressUrl: 'fm/compressUrl',
39             extractUrl: 'fm/extractUrl',
40             permissionsUrl: 'fm/permissionsUrl',
41             describePolicyUrl : 'fm/describePolicyUrl',
42             viewPolicyUrl : 'fm/viewPolicyUrl',
43             addSubScopeUrl : 'fm/addSubScopeUrl',
44             switchVersionUrl : 'fm/switchVersionUrl',
45             exportUrl : 'fm/exportUrl',
46
47             sidebar: true,
48             breadcrumb: true,
49             allowedActions: {
50                 upload: true,
51                 rename: true,
52                 copy: true,
53                 edit: true,
54                 describePolicy: true,
55                 createNewPolicy: true,
56                 viewPolicy: true,
57                 changePermissions: true,
58                 compress: true,
59                 compressChooseName: true,
60                 extract: true,
61                 download: true,
62                 preview: true,
63                 remove: true,
64                 addSubScope : true,
65                 switchVersion : true,
66                 exportPolicy : true,
67                 removePolicy : true
68             },
69
70             enablePermissionsRecursive: true,
71             compressAsync: true,
72             extractAsync: true,
73
74             isEditableFilePattern: /\.(txt|html?|aspx?|ini|pl|py|md|css|js|log|htaccess|htpasswd|json|sql|xml|xslt?|sh|rb|as|bat|cmd|coffee|php[3-6]?|java|c|cbl|go|h|scala|vb)$/i,
75             isImageFilePattern: /\.(jpe?g|gif|bmp|png|svg|tiff?)$/i,
76             isExtractableFilePattern: /\.(gz|tar|rar|g?zip)$/i,
77             tplPath: 'app/policyApp/policy-models/Editor/src/templates'
78         };
79
80         return {
81             $get: function() {
82                 return values;
83             },
84             set: function (constants) {
85                 angular.extend(values, constants);
86             }
87         };
88     
89     });
90 })(angular);