Class MCRWCMSContentManager

java.lang.Object
org.mycore.wcms2.navigation.MCRWCMSContentManager

public class MCRWCMSContentManager extends Object
This class provides methods to get, create and save MyCoRe webpages.
Author:
Matthias Eichner
  • 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

      public com.google.gson.JsonObject getContent(Element e)
    • 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

      public void move(String from, String to)