public abstract class A_CmsSetupXmlUpdate extends java.lang.Object implements I_CmsSetupXmlUpdate
构造器和说明 |
---|
A_CmsSetupXmlUpdate() |
限定符和类型 | 方法和说明 |
---|---|
static org.dom4j.Element |
createElementFromXml(java.lang.String xml)
Creates a dom4j element from an XML string.
|
void |
execute(CmsSetupBean setupBean)
Execute the change.
|
protected boolean |
executeUpdate(org.dom4j.Document document,
java.lang.String xpath,
boolean forReal)
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<java.lang.String> |
getXPathsToRemove()
Returns a list of xpaths for the nodes to remove.
|
protected java.util.List<java.lang.String> |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getXmlFilename
public void execute(CmsSetupBean setupBean) throws java.lang.Exception
I_CmsSetupXmlUpdate
execute
在接口中 I_CmsSetupXmlUpdate
setupBean
- the setup beanjava.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
在接口中 I_CmsSetupXmlUpdate
setupBean
- the setup beanjava.lang.Exception
- if something goes wrongI_CmsSetupXmlUpdate.getCodeToChange(org.opencms.setup.CmsSetupBean)
public boolean validate(CmsSetupBean setupBean) throws java.lang.Exception
I_CmsSetupXmlUpdate
validate
在接口中 I_CmsSetupXmlUpdate
setupBean
- the setup beantrue
if neededjava.lang.Exception
- if something goes wrongI_CmsSetupXmlUpdate.validate(org.opencms.setup.CmsSetupBean)
protected boolean executeUpdate(org.dom4j.Document document, java.lang.String xpath, boolean forReal)
Only needs to be overriden if getXPathsToUpdate()
is not empty.
document
- the document to apply the changes toxpath
- the xpath to execute the changes forforReal
- is false
, it is only on a empty doc to display the changes to the userprotected java.lang.String getCommonPath()
protected java.util.List<java.lang.String> getXPathsToRemove()
protected java.util.List<java.lang.String> getXPathsToUpdate()
protected org.dom4j.Document prepareDoc(org.dom4j.Document doc)
doc
- the original documentprotected 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 xpathpublic static org.dom4j.Element createElementFromXml(java.lang.String xml) throws org.dom4j.DocumentException
xml
- the xml stringorg.dom4j.DocumentException
- if the XML parsing fails