Copied to clipboard

Flag this post as spam?

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


  • Nguyen Dung Tri 106 posts 606 karma points
    Mar 21, 2017 @ 09:29
    Nguyen Dung Tri
    0

    Is there any document about Presentation layer, Business layer, and Data access layer of Merchello?

    Dear Rusty Swayne,

    I want to become professional in Merchello. So I am going to explore the Presentation layer, Business layer, and Data access layer of Merchello. But I dont know where to start yet. I already have the source code of Merchello project from GitHub but still dont understand its structure clearly.

    For example, I want to know how product listing work: enter image description here From the product listing page. I want to know some items like:

    • Where can I find the file that contains the code to edit product listing interface?
    • What controller does it call to get data from database to view on product list?
    • What service class handle retrieving data or query database from database to return to controller?
    • How does it work?

    So the above questions are to let you know what I want to achieve in my question. I want to explore the Presentation layer, Business layer, and Data access layer structure of Merchello. Could help me to find some document about this?

    Thank you

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Mar 23, 2017 @ 20:41
    Rusty Swayne
    1

    Hi Nguyen,

    I'll try to answer your specific questions to get you going ...

    Where can I find the file that contains the code to edit product listing interface?

    The back office UI is built from the Merchello.Web.Ui.Client project (Angular). Here is the list view: https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Web.UI.Client/src/views/products/productlist.html

    Here is the controller for that view: https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Web.UI.Client/src/views/products/productlist.controller.js

    The listing itself is a directive that is shared with Sales, Customers, Marketing. You can find that in the directives folder: https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Web.UI.Client/src/views/directives/merchellolistview.directive.js

    What controller does it call to get data from database to view on product list?

    All of the back office API controllers are located in Merchello.Web: https://github.com/Merchello/Merchello/tree/merchello-dev/src/Merchello.Web/Editors

    They use the Merchello services to query and return results.

    What service class handle retrieving data or query database from database to return to controller?

    In "general" you will find the naming convention is pretty straight forward. The ProductApiController will use the ProductService, etc.

    There is a lot of serialization that happens as well ... you'll see the MerchelloHelper being used quite a bit.

    Essentially what happens there, is the Merchello helper is queried, internally it looks for records in Examine, if found it returns the record otherwise it falls back to the database (service) queries, and updates the index.


    I know I've made some pretty high level responses but hopefully it's enough to get you moving in the right direction as you start looking through the code base. Be happy to try to answer any specific questions.

Please Sign in or register to post replies

Write your reply to:

Draft