2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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 * ================================================================================
20 app.controller('notebookFrameController', function ($scope,$location,$window,$http,$routeParams) {
22 //alert($location.search(1, $scope.additionalqueryParams));
23 //var nid = $routeParams.nid;
24 //var qprms = $routeParams.qprms;
25 //var value = $routeParams.value;
26 //console.log('check id ');
27 var nid = $window.location.search.substr($window.location.search.indexOf("=")+1);
28 console.log('nid',nid);
29 //console.log('qprms',qprms);
31 if ($window.location.search.substr($window.location.search.indexOf("=")+1)) {
32 $scope.queryParams = $window.location.search;
34 if ($window.location.search.indexOf("&")!=-1) {
35 $scope.notebookparam = $window.location.search.substring($window.location.search.indexOf("?")+1,$window.location.search.indexOf("&"));
36 $scope.additionalqueryParams = JSON.parse('{"' + decodeURI($scope.queryParams.substr($scope.queryParams.indexOf("&")+1).replace(/&/g, "\",\"").replace(/=/g,"\":\"")) + '"}');
37 console.log('Additional parameters present');
40 $scope.notebookparam = $window.location.search.substr($window.location.search.indexOf("?")+1);
41 console.log('Additional parameters absent');
43 console.log('add parameters',$scope.additionalqueryParams);
44 // $scope.notebookid = $scope.notebookparam.substring(0,$scope.notebookparam.indexOf("="));
45 $scope.notebookvalue = $scope.notebookparam.substr($scope.notebookparam.indexOf("=")+1);
46 //$scope.postData = $window.location.search.substr($window.location.search.indexOf("=")+1);
47 console.log('Notebook value present ',$scope.notebookvalue);
50 $scope.notebookvalue = '833c0a69ec1433fbb2f8752af733cf0e';
51 console.log('Notebook value absent ',$scope.notebookvalue);
56 $http({method:'POST', url:'rNotebookFE/authCr', data: $scope.notebookvalue, params:{'qparams' : $scope.additionalqueryParams}}).success(function(data, status) {
57 console.log('Data received', data);
58 console.log('Status ', status);
59 document.getElementById('itestframe').src = data;