Copied to clipboard

Flag this post as spam?

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


  • Jan Arenö 9 posts 40 karma points
    Apr 01, 2015 @ 12:12
    Jan Arenö
    0

    Adding metadata to structured data from backend

    Hi

    I guess this question may sound easy for you but I can't figure out where to find this info so I try asking you here. I have a backend system that have product info stored. What I like to do is to retrieve that, store it in some kind of structure/table in umbraco (not a content page).

    Then I want to create a user interface for the editor to add meta data to these products. Can be images, more selling text, technical data and so on. I'm not building a ecom so going with some eCom solution don't seems right. I will create these tables and what I need by my own, but I need to figure out a best practice for umbraco. Can someone point my nose in a good direction?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 12:22
    Jan Skovgaard
    100

    Hi Jan and welcome to our :)

    I think you should consider making a custom section in Umbraco, which you can then use for managing your data without using content nodes for it.

    Tim Geyssens from Umbraco HQ has written a blogpost about how to do it in Umbraco 7 here http://www.nibble.be/?p=440

    I think that should make a good start - If you're having doubts about anything then please let us know.

    /Jan

  • Jan Arenö 9 posts 40 karma points
    Apr 01, 2015 @ 15:56
    Jan Arenö
    0

    Thank you for a fast response!

    This looks like what I was searching for.

    Tried to modify it for a testround but ended up without any new node in admin and with an error with the scripts.

    2015-04-01 15:45:24,311 [13] ERROR Umbraco.Core.Manifest.ManifestParser - [Thread 93] An error occurred parsing manifest with contents: {
        javascript: [
        '~/App_Plugins/JfpAddon/backoffice/producttree/edit.controller.js',
        '~/App_Plugins/JfpAddon/backoffice/producttree/delete.controller.js',
        '~/App_Plugins/JfpAddon/product.resource.js'
        ]
    }

    Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: . Path '', line 0, position 0.
       at Newtonsoft.Json.JsonTextReader.ParseValue()
       at Newtonsoft.Json.JsonTextReader.ReadInternal()
       at Newtonsoft.Json.JsonTextReader.Read()
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
       at Umbraco.Core.Manifest.ManifestParser.CreateManifests(String[] manifestFileContents)

     

    As written, there is some problems with the manifest file. The path seems legit and I can access the url.

    My next guess would be that maybe the paths in resouce files is wrong. Don't know how the JfpAddon/ProductApi is routed by umbraco under the backoffice? This could be the problem I guess. 

     

    angular.module("umbraco.resources").factory("productResource", function ($http) {
        return {
            getById: function (id) {
                return $http.get("backoffice/JfpAddon/ProductApi/GetById?id=" + id);
            },
            save: function (product) {
                return $http.post("backoffice/JfpAddon/ProductApi/PostSave", angular.toJson(product));
            },
            deleteById: function (id) {
                return $http.delete("backoffice/JfpAddon/ProductApi/DeleteById?id=" + id);
            }
        };
    });

     

    Screen of project files and folders

     

  • Jan Arenö 9 posts 40 karma points
    Apr 01, 2015 @ 16:12
    Jan Arenö
    0

    Ok, just because I posted the solution was found. For reference:

    http://issues.umbraco.org/issue/U4-6043?preventRedirect=true

    BOM characters did mess upp the manifest file

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 20:25
    Jan Skovgaard
    0

    Hi Jan

    Sorry for the late reply - Happy to see you figured out what went wrong initially :) - Remember to mark the post as solved so others can jump straight to the solution if they are wondering about how to deal with the same issue.

    Happy coding! :)

    /Jan

  • Jan Arenö 9 posts 40 karma points
    Apr 02, 2015 @ 08:32
    Jan Arenö
    0

    Adding a comment that was missing in the guide I think. When submitted, you need to add access right to the section under user --> section, or else you can't see it.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 02, 2015 @ 08:51
    Jan Skovgaard
    0

    Hi Jan

    Ah yes, I should have mentioned that since it's not mentioned anywhere and it something that's easy to forget about. I have spent a lot of time pulling my hair out double checking the code until I finally remembered :)

    But good you figured it out!

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft