Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jason Espin 368 posts 1335 karma points
    Oct 22, 2016 @ 13:00
    Jason Espin
    0

    Using treesource as a prevalue editor

    Hi all,

    I'm having some difficult using the treesource property editor as a prevalue editor for one of my Umbraco plugins.

    Basically I am making a number of WebApi queries to manipulate content using my plugin however when using the XPATH mode of treesource all that is returned is the query i put in. How do I then resolve this to a node using the XPATH query as passing the XPATH query via url to the restful service could cause all sorts of problems.

    So for example, currently in angular I am doing the following:

    $scope.initialiseTags = function () {
            $http.get("/umbraco/backoffice/tagliatelle/TagEditorApi/GetTags/?currentNodeId=" + currentNodeId + "&containerId=" + $scope.model.config.parentContainer + "&documentTypeAlias=" + $scope.model.config.documentTypeAlias)
                .success(function (data, status, headers, config) {
                    $scope.tags = data;
                });
        }
    

    This is fairly straightforward as all of the variables and parameters are url safe (text or int). However, when using XPATH there are url unsafe characters such as: $, // , / etc that would be passed into the url and ultimately would not resolve on the WepAPI end of the solution.

    Any pointers would be extremely helpful.

    Cheers,

    Jason

    N.B. My repo is here if you want a better idea of the current architecture https://github.com/JasonEspin/jezzipin.TagliatelleTagManager

Please Sign in or register to post replies

Write your reply to:

Draft