diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js index feecdac18c..7cf9c61111 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js @@ -401,35 +401,6 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) { 'Failed to retrieve url for id:' + id); }, - /** - * @ngdoc method - * @name umbraco.resources.contentResource#getPath - * @methodOf umbraco.resources.contentResource - * - * @description - * Returns a url, given a node ID - * - * ##usage - *
- * contentResource.getPath(id)
- * .then(function(pathArray) {
- * alert('its here!');
- * });
- *
- *
- * @param {Int} id Id of node to return the public url to
- * @returns {Promise} resourcePromise object containing the url.
- *
- */
- getPath: function (id) {
- return umbRequestHelper.resourcePromise(
- $http.get(
- umbRequestHelper.getApiUrl(
- "contentApiBaseUrl",
- "GetPath",[{id: id}])),
- 'Failed to retrieve path for id:' + id);
- },
-
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getChildren
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js
index 9aa0d39040..a23697344b 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js
@@ -35,6 +35,37 @@ function entityResource($q, $http, umbRequestHelper) {
//the factory object returned
return {
+ /**
+ * @ngdoc method
+ * @name umbraco.resources.entityResource#getPath
+ * @methodOf umbraco.resources.entityResource
+ *
+ * @description
+ * Returns a path, given a node ID and type
+ *
+ * ##usage
+ *
+ * entityResource.getPath(id)
+ * .then(function(pathArray) {
+ * alert('its here!');
+ * });
+ *
+ *
+ * @param {Int} id Id of node to return the public url to
+ * @param {string} type Object type name
+ * @returns {Promise} resourcePromise object containing the url.
+ *
+ */
+ getPath: function (id, type) {
+ return umbRequestHelper.resourcePromise(
+ $http.get(
+ umbRequestHelper.getApiUrl(
+ "entityApiBaseUrl",
+ "GetPath",
+ [{ id: id, type: type }])),
+ 'Failed to retrieve path for id:' + id);
+ },
+
/**
* @ngdoc method
* @name umbraco.resources.entityResource#getById
@@ -54,7 +85,7 @@ function entityResource($q, $http, umbRequestHelper) {
*
*
* @param {Int} id id of entity to return
- * @param {string} type optional Object type name
+ * @param {string} type Object type name
* @returns {Promise} resourcePromise object containing the entity.
*
*/
@@ -87,7 +118,7 @@ function entityResource($q, $http, umbRequestHelper) {
*
*
* @param {Array} ids ids of entities to return as an array
- * @param {string} type optional type name
+ * @param {string} type type name
* @returns {Promise} resourcePromise object containing the entity array.
*
*/
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js
index f02966e029..1e584740a0 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js
@@ -1,6 +1,6 @@
//used for the media picker dialog
angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController",
- function ($scope, eventsService, contentResource, $log) {
+ function ($scope, eventsService, entityResource, contentResource, $log) {
var dialogOptions = $scope.$parent.dialogOptions;
$scope.dialogTreeEventHandler = $({});
@@ -12,10 +12,10 @@ angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController",
//if we a node ID, we fetch the current node to build the form data
if($scope.target.id){
- if(!$scope.target.path){
- contentResource.getPath($scope.target.id).then(function(path){
- $scope.target.path = path;
- })
+ if(!$scope.target.path) {
+ entityResource.getPath($scope.target.id, "Document").then(function (path) {
+ $scope.target.path = path;
+ });
}
contentResource.getNiceUrl($scope.target.id).then(function(url){
diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs
index 9784b6027d..c23495b04f 100644
--- a/src/Umbraco.Web/Editors/ContentController.cs
+++ b/src/Umbraco.Web/Editors/ContentController.cs
@@ -120,22 +120,6 @@ namespace Umbraco.Web.Editors
return url;
}
- ///