Class MCRWCMSDefaultNavigationProvider

java.lang.Object
org.mycore.wcms2.navigation.MCRWCMSDefaultNavigationProvider
All Implemented Interfaces:
MCRWCMSJSONProvider<MCRNavigation,com.google.gson.JsonObject>, MCRWCMSNavigationProvider

public class MCRWCMSDefaultNavigationProvider extends Object implements MCRWCMSNavigationProvider
Default implementation of NavigationProvider.
Author:
Matthias Eichner
  • Constructor Details

    • MCRWCMSDefaultNavigationProvider

      public MCRWCMSDefaultNavigationProvider()
  • Method Details

    • toJSON

      public com.google.gson.JsonObject toJSON(MCRNavigation navigation)
      Description copied from interface: MCRWCMSNavigationProvider

      Converts a Navigation object to a json one. The structure of the json is:

       {
         hierarchy: [
           {"wcmsId":0,"children":[
             {"wcmsId":1,"children":[
               {"wcmsId":2}
             ]}
           ]}
         }
         items: [
           {"wcmsId" : "0", "wcmsType" : "root", "mainTitle" : "My Main Title", "dir" : "/content" ...},
           {"wcmsId" : "1", "wcmsType" : "menu", "id" : "main", "labelMap":{"de":"Hauptmenü","en":"Main menu"} ... }
           {"wcmsId" : "2", "wcmsType" : "item", "type" : "intern", "style" : "bold" ...}
           ...
         ]
       }
       
      Specified by:
      toJSON in interface MCRWCMSJSONProvider<MCRNavigation,com.google.gson.JsonObject>
      Specified by:
      toJSON in interface MCRWCMSNavigationProvider
      Returns:
      the generated json
    • fromJSON

      public MCRNavigation fromJSON(com.google.gson.JsonObject navigationJSON)
      Description copied from interface: MCRWCMSNavigationProvider
      Converts an WCMS JSON Object to an Navigation object. TODO: json data structure
      Specified by:
      fromJSON in interface MCRWCMSJSONProvider<MCRNavigation,com.google.gson.JsonObject>
      Specified by:
      fromJSON in interface MCRWCMSNavigationProvider