|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.setup.xml.A_CmsSetupXmlUpdate
Skeleton for xml update plugins.
Constructor Summary | |
A_CmsSetupXmlUpdate()
|
Method Summary | |
void |
execute(CmsSetupBean setupBean)
Execute the change. |
protected boolean |
executeUpdate(org.dom4j.Document document,
java.lang.String xpath)
Executes the adding/updating changes on the given document. |
java.lang.String |
getCodeToChange(CmsSetupBean setupBean)
Returns the code to be added OR removed in the xml file. |
protected java.lang.String |
getCommonPath()
Returns a parent path that is common for all nodes to modify. |
protected java.util.List |
getXPathsToRemove()
Returns a list of xpaths for the nodes to remove. |
protected java.util.List |
getXPathsToUpdate()
Returns a list of xpaths for the nodes to add/update. |
protected org.dom4j.Document |
prepareDoc(org.dom4j.Document doc)
Prepares a new document. |
protected void |
updateDoc(org.dom4j.Document document,
org.dom4j.Document newDoc,
java.lang.String xpath)
Updates the given doc inserting the given node corresponding to the given xpath. |
boolean |
validate(CmsSetupBean setupBean)
Validates the need to apply this change. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opencms.setup.xml.I_CmsSetupXmlUpdate |
getName, getXmlFilename |
Constructor Detail |
public A_CmsSetupXmlUpdate()
Method Detail |
public void execute(CmsSetupBean setupBean) throws java.lang.Exception
I_CmsSetupXmlUpdate
execute
in interface I_CmsSetupXmlUpdate
setupBean
- the setup bean
java.lang.Exception
- if something goes wrongI_CmsSetupXmlUpdate.execute(org.opencms.setup.CmsSetupBean)
public java.lang.String getCodeToChange(CmsSetupBean setupBean) throws java.lang.Exception
I_CmsSetupXmlUpdate
getCodeToChange
in interface I_CmsSetupXmlUpdate
setupBean
- the setup bean
java.lang.Exception
- if something goes wrongI_CmsSetupXmlUpdate.getCodeToChange(org.opencms.setup.CmsSetupBean)
protected void updateDoc(org.dom4j.Document document, org.dom4j.Document newDoc, java.lang.String xpath)
document
- the original document to updatenewDoc
- the document to updatexpath
- the corresponding xpathprotected java.lang.String getCommonPath()
public boolean validate(CmsSetupBean setupBean) throws java.lang.Exception
I_CmsSetupXmlUpdate
validate
in interface I_CmsSetupXmlUpdate
setupBean
- the setup bean
true
if needed
java.lang.Exception
- if something goes wrongI_CmsSetupXmlUpdate.validate(org.opencms.setup.CmsSetupBean)
protected boolean executeUpdate(org.dom4j.Document document, java.lang.String xpath)
Only needs to be overriden if getXPathsToUpdate()
is not empty.
document
- the document to apply the changes toxpath
- the xpath to execute the changes for
protected java.util.List getXPathsToRemove()
protected java.util.List getXPathsToUpdate()
protected org.dom4j.Document prepareDoc(org.dom4j.Document doc)
doc
- the original document
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |