Package org.mycore.wcms2.navigation
Class MCRWCMSContentManager
java.lang.Object
org.mycore.wcms2.navigation.MCRWCMSContentManager
This class provides methods to get, create and save MyCoRe webpages.
- Author:
- Matthias Eichner
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObject
getContent
(String webpageId) Return a json object with the content of a MyCoRe webpage.com.google.gson.JsonObject
void
void
save
(com.google.gson.JsonArray items) Saves the content of the given items.
-
Constructor Details
-
MCRWCMSContentManager
public MCRWCMSContentManager()
-
-
Method Details
-
getContent
public com.google.gson.JsonObject getContent(String webpageId) throws IOException, JDOMException, SAXException Return a json object with the content of a MyCoRe webpage.{ type: "content", content: @see
MCRWCMSDefaultSectionProvider
}If an error occur (e.g. file not exist) the returning json looks like:
{ type: "error", errorType: "invalidFile" webpageId: "myfolder/webpage1.xml" }- Parameters:
webpageId
- id of the webpage- Returns:
- json object
- Throws:
IOException
JDOMException
SAXException
- See Also:
-
getContent
-
save
public void save(com.google.gson.JsonArray items) Saves the content of the given items. Returns a json object, if everything is ok:{ type: "saveDone" }
If one or more files could'nt be saved because of an error the returning json looks like:
{ type: "error", errorArray: [ {type: "error", errorType: "invalidDirectory", webpageId: "abc.xml"}, {type: "error", errorType: "invalidFile", webpageId: "abc2.xml"} ... ] } -
move
-