From f9d1dbeeb2ec4aea91de53117254f34ce5a7dd0f Mon Sep 17 00:00:00 2001 From: Geert Josten Date: Thu, 21 May 2015 21:18:25 +0200 Subject: [PATCH] Undoing earlier changes, they didn't work out as expected --- deploy/ml-config.xml | 2 +- server.js | 2 ++ ui/app/scripts/controllers/demo.js | 26 +++++++++++++++++++------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/deploy/ml-config.xml b/deploy/ml-config.xml index a1a5c04..2139204 100644 --- a/deploy/ml-config.xml +++ b/deploy/ml-config.xml @@ -745,7 +745,7 @@ marklogic-ldap Authentication against MarkLogic LDAP ldap - 300 + 999999999 ldap ldap://ldap.marklogic.com:3268 OU=Employees,OU=CORP,DC=marklogic,DC=com diff --git a/server.js b/server.js index aa49d62..3aafdf2 100644 --- a/server.js +++ b/server.js @@ -50,6 +50,7 @@ exports.buildExpress = function(options) { } function clearLdapCache(req) { + /* GJo: not working as expected. Instead we will use unlimited cache timeout.. var mlReq = http.request({ hostname: options.mlHost, port: options.mlPort, @@ -63,6 +64,7 @@ exports.buildExpress = function(options) { }); mlReq.end(); + */ } function proxy(req, res) { diff --git a/ui/app/scripts/controllers/demo.js b/ui/app/scripts/controllers/demo.js index e9f2b4b..889aca3 100644 --- a/ui/app/scripts/controllers/demo.js +++ b/ui/app/scripts/controllers/demo.js @@ -2,12 +2,10 @@ 'use strict'; angular.module('demoCat') + .factory('DemoModel', DemoModel) .controller('DemoCtrl', DemoCtrl); - DemoCtrl.$inject = ['$scope', 'MLRest', '$location', '$routeParams', 'demo', 'user', '$modal', '$sce', 'demoService', '$sanitize']; - - function DemoCtrl($scope, mlRest, $location, $routeParams, demo, user, $modal, $sce, demoService, $sanitize) { - var uri = $routeParams.uri; + function DemoModel() { var commentModel = { // set by model binding msg: '', @@ -32,7 +30,6 @@ var model = { // your model stuff here - uri: $routeParams.uri, demo: { comments: [], bugs: [] @@ -60,9 +57,18 @@ /* jshint camelcase: false */ toolbar_full: '', followError: false - }, - user: user + } }; + return model; + } + + DemoCtrl.$inject = ['$scope', 'MLRest', '$location', '$routeParams', 'demo', 'user', '$modal', '$sce', 'demoService', '$sanitize', 'DemoModel']; + + function DemoCtrl($scope, mlRest, $location, $routeParams, demo, user, $modal, $sce, demoService, $sanitize, model) { + var uri = $routeParams.uri; + model.uri = $routeParams.uri; + model.user = user; + if (demo) { var imageExtensions = ['jpeg','jpg','gif','png']; var videoExtensions = ['webm','ogg','mp4']; @@ -93,6 +99,12 @@ bug.nr = index + 1; } }); + } else { + model.demo = { + comments: [], + bugs: [] + }; + model.attachedMedia = []; } angular.extend($scope, {