Package org.mycore.wcms2.navigation
Class MCRWCMSDefaultSectionProvider
java.lang.Object
org.mycore.wcms2.navigation.MCRWCMSDefaultSectionProvider
- All Implemented Interfaces:
MCRWCMSJSONProvider<Element,
,com.google.gson.JsonArray> MCRWCMSSectionProvider
The default implementation to convert MyCoRe Webpage sections
from and to json.
- Author:
- Matthias Eichner
-
Field Summary
Fields inherited from interface org.mycore.wcms2.navigation.MCRWCMSSectionProvider
JSON_DATA, JSON_LANG, JSON_TITLE
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MCRWCMSDefaultSectionProvider
public MCRWCMSDefaultSectionProvider()
-
-
Method Details
-
toJSON
Description copied from interface:MCRWCMSSectionProvider
Converts a MyCoRe Webpage to a json array. The array contains all the section elements of the webpage including their content.[
{title: "title of section", lang: "de", data: "<xml>content of section</xml>"},
{title: "title of section 2", lang: "en", data: "<xml>content of section 2</xml>"}
]- Specified by:
toJSON
in interfaceMCRWCMSJSONProvider<Element,
com.google.gson.JsonArray> - Specified by:
toJSON
in interfaceMCRWCMSSectionProvider
-
getContent
Returns the content of an element as string. The element itself is ignored.- Parameters:
e
- the element to get the content from- Returns:
- the content as string
- Throws:
IOException
-
fromJSON
- Specified by:
fromJSON
in interfaceMCRWCMSJSONProvider<Element,
com.google.gson.JsonArray> - Specified by:
fromJSON
in interfaceMCRWCMSSectionProvider
-