Package org.mycore.tools
Class MyCoReWebPageProvider
java.lang.Object
org.mycore.tools.MyCoReWebPageProvider
This class provides a simple way to dynamically create MyCoRe webpages. These pages might be rendered
through the layout service.
Example:
Example:
MyCoReWebPageProvider wp = new MyCoReWebPageProvider();
wp.addSection("Section Title", "Section Text", MyCoReWebPageProvider.DE);
Document xml = wp.getXML();
//call the layout service of an MCRServlet
getLayoutService().doLayout(job.getRequest(), job.getResponse(), xml);
- Author:
- shermann, Matthias Eichner
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
English language keystatic final String
German language keystatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSection
(String title, String xmlAsString, String lang) Adds a section to the MyCoRe webpage.addSection
(String title, List<Content> content, String lang) Adds a section to the MyCoRe webpageaddSection
(String title, Content content, String lang) Adds a section to the MyCoRe webpage.getXML()
void
updateMeta
(String editor, String labelPath) Updates the meta element of the webpage.
-
Field Details
-
EN
German language key- See Also:
-
DE
English language key- See Also:
-
XML_MYCORE_WEBPAGE
- See Also:
-
XML_SECTION
- See Also:
-
XML_LANG
- See Also:
-
XML_TITLE
- See Also:
-
XML_META
- See Also:
-
XML_LOG
- See Also:
-
XML_LASTEDITOR
- See Also:
-
XML_LABELPATH
- See Also:
-
XML_DATE
- See Also:
-
XML_TIME
- See Also:
-
DATE_FORMAT
- See Also:
-
TIME_FORMAT
- See Also:
-
-
Constructor Details
-
MyCoReWebPageProvider
public MyCoReWebPageProvider()
-
-
Method Details
-
addSection
public Element addSection(String title, String xmlAsString, String lang) throws IOException, SAXParseException, JDOMException Adds a section to the MyCoRe webpage.- Parameters:
title
- the title of the sectionxmlAsString
- xml string which is added to the sectionlang
- the language of the section specified by a language key.- Returns:
- added section
- Throws:
IOException
SAXParseException
JDOMException
-
addSection
Adds a section to the MyCoRe webpage.- Parameters:
title
- the title of the sectioncontent
- jdom element which is added to the sectionlang
- the language of the section specified by a language key.- Returns:
- added section
-
addSection
Adds a section to the MyCoRe webpage- Parameters:
title
- the title of the sectioncontent
- list of content added to the sectionlang
- the language of the section specified by a language key.- Returns:
- added section
-
updateMeta
Updates the meta element of the webpage.- Parameters:
editor
- last editor of webpagelabelPath
- path info
-
getXML
- Returns:
- an xml document with root element is
<MyCoReWebPage/>
-