forked from eclipse/vorto
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Vorto repository basepath and linked models in the search windo…
…w to the repository
- Loading branch information
Showing
7 changed files
with
71 additions
and
62 deletions.
There are no files selected for viewing
12 changes: 0 additions & 12 deletions
12
server/devtool/src/main/java/org/eclipse/vorto/server/devtool/controller/BaseController.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...vtool/src/main/java/org/eclipse/vorto/server/devtool/controller/RepositoryController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.eclipse.vorto.server.devtool.controller; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.google.gson.JsonObject; | ||
|
||
@RestController | ||
@RequestMapping(value = "/repository") | ||
public class RepositoryController { | ||
|
||
@Value("${vorto.repository.base.path}") | ||
String repositoryBasePath; | ||
|
||
@RequestMapping(value = "/basepath", method = RequestMethod.GET) | ||
public String getRepoUrl() { | ||
JsonObject jsonObject = new JsonObject(); | ||
jsonObject.addProperty("basepath", repositoryBasePath); | ||
String json = jsonObject.toString(); | ||
return json; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
vorto.repository.base.path = http://vorto.eclipse.org//rest/ | ||
vorto.repository.rest.path = http://vorto.eclipse.org//rest/ | ||
vorto.repository.base.path = http://vorto.eclipse.org/#/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 38 additions & 27 deletions
65
server/devtool/src/main/resources/static/dist/js/devtoolApp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,40 @@ | ||
define("devtoolApp",["angular","angular-route","angular-animate","angular-aria","angular-bootstrap","angular-bootstrap-templates","smart-table","controllers","directives","jquery"],function(angular) { | ||
define("devtoolApp", ["angular", "angular-route", "angular-animate", "angular-aria", "angular-bootstrap", "angular-bootstrap-templates", "smart-table", "controllers", "directives", "jquery"], function(angular) { | ||
|
||
var app = angular.module('devtoolApp', ['ngRoute','apps.controller', 'apps.directive', 'ngAnimate','ui.bootstrap','ui.bootstrap.tpls']); | ||
|
||
app.bootstrap = function() { | ||
angular.bootstrap(document,['devtoolApp']); | ||
}; | ||
|
||
app.config([ '$routeProvider', '$httpProvider', | ||
function($routeProvider, $httpProvider) { | ||
$routeProvider | ||
.when('/editor/:projectName', { | ||
templateUrl : "templates/editor-template.html", | ||
controller : 'EditorController' | ||
}) | ||
.when('/project', { | ||
templateUrl : "templates/project-template.html", | ||
controller : 'ProjectController' | ||
}) | ||
.otherwise({ | ||
redirectTo : '/project' | ||
}); | ||
|
||
} ]).run(function($location, $http, $rootScope) { | ||
// add global functions here | ||
var app = angular.module('devtoolApp', ['ngRoute', 'apps.controller', 'apps.directive', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | ||
|
||
app.bootstrap = function() { | ||
angular.bootstrap(document, ['devtoolApp']); | ||
}; | ||
|
||
app.config(['$routeProvider', '$httpProvider', | ||
function($routeProvider, $httpProvider) { | ||
$routeProvider | ||
.when('/editor/:projectName', { | ||
templateUrl: "templates/editor-template.html", | ||
controller: 'EditorController' | ||
}) | ||
.when('/project', { | ||
templateUrl: "templates/project-template.html", | ||
controller: 'ProjectController' | ||
}) | ||
.otherwise({ | ||
redirectTo: '/project' | ||
}); | ||
|
||
} | ||
]).run(function($location, $http, $rootScope) { | ||
|
||
$rootScope.getRepositoryBasePath = function() { | ||
$http.get('./repository/basepath').success(function(data, status, headers, config) { | ||
$rootScope.repoBasePath = data['basepath']; | ||
console.log($rootScope.repoBasePath); | ||
}).error(function(data, status, headers, config) { | ||
$rootScope.repoBasePath = "/"; | ||
}); | ||
} | ||
|
||
$rootScope.getRepositoryBasePath(); | ||
}); | ||
|
||
return app; | ||
}); | ||
|
||
return app; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters