org.opencms.setup.xml
Class CmsXmlUpdateLocalizationKeys

java.lang.Object
  extended by org.opencms.setup.xml.A_CmsSetupXmlUpdate
      extended by org.opencms.setup.xml.A_CmsXmlWorkplace
          extended by org.opencms.setup.xml.CmsXmlUpdateLocalizationKeys
All Implemented Interfaces:
I_CmsSetupXmlUpdate

public class CmsXmlUpdateLocalizationKeys
extends A_CmsXmlWorkplace

Updates localization keys.

Since:
6.1.8
Version:
$Revision: 1.3 $
Author:
Michael Moossen

Constructor Summary
CmsXmlUpdateLocalizationKeys()
           
 
Method Summary
protected  boolean executeUpdate(org.dom4j.Document document, java.lang.String xpath)
          Executes the adding/updating changes on the given document.
protected  java.lang.String getCommonPath()
          Returns a parent path that is common for all nodes to modify.
 java.lang.String getName()
          Returns the nice name for the change.
 java.util.List getNewKeys()
          Returns the new Keys.
 java.util.List getOldKeys()
          Returns the old Keys.
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.
 
Methods inherited from class org.opencms.setup.xml.A_CmsXmlWorkplace
getXmlFilename, setAccessEntry, setMenuEntry
 
Methods inherited from class org.opencms.setup.xml.A_CmsSetupXmlUpdate
execute, getCodeToChange, getXPathsToRemove, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsXmlUpdateLocalizationKeys

public CmsXmlUpdateLocalizationKeys()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: I_CmsSetupXmlUpdate
Returns the nice name for the change.

Returns:
the nice name
See Also:
I_CmsSetupXmlUpdate.getName()

getNewKeys

public java.util.List getNewKeys()
Returns the new Keys.

Returns:
the new Keys

getOldKeys

public java.util.List getOldKeys()
Returns the old Keys.

Returns:
the old Keys

executeUpdate

protected boolean executeUpdate(org.dom4j.Document document,
                                java.lang.String xpath)
Description copied from class: A_CmsSetupXmlUpdate
Executes the adding/updating changes on the given document.

Only needs to be overriden if A_CmsSetupXmlUpdate.getXPathsToUpdate() is not empty.

Overrides:
executeUpdate in class A_CmsSetupXmlUpdate
Parameters:
document - the document to apply the changes to
xpath - the xpath to execute the changes for
Returns:
if something was modified
See Also:
A_CmsSetupXmlUpdate.executeUpdate(org.dom4j.Document, java.lang.String)

getCommonPath

protected java.lang.String getCommonPath()
Description copied from class: A_CmsSetupXmlUpdate
Returns a parent path that is common for all nodes to modify.

Overrides:
getCommonPath in class A_CmsSetupXmlUpdate
Returns:
common parent path
See Also:
A_CmsSetupXmlUpdate.getCommonPath()

getXPathsToUpdate

protected java.util.List getXPathsToUpdate()
Description copied from class: A_CmsSetupXmlUpdate
Returns a list of xpaths for the nodes to add/update.

Overrides:
getXPathsToUpdate in class A_CmsSetupXmlUpdate
Returns:
a list of strings
See Also:
A_CmsSetupXmlUpdate.getXPathsToUpdate()

prepareDoc

protected org.dom4j.Document prepareDoc(org.dom4j.Document doc)
Description copied from class: A_CmsSetupXmlUpdate
Prepares a new document.

Overrides:
prepareDoc in class A_CmsSetupXmlUpdate
Parameters:
doc - the original document
Returns:
a new document
See Also:
A_CmsSetupXmlUpdate.prepareDoc(org.dom4j.Document)

updateDoc

protected void updateDoc(org.dom4j.Document document,
                         org.dom4j.Document newDoc,
                         java.lang.String xpath)
Description copied from class: A_CmsSetupXmlUpdate
Updates the given doc inserting the given node corresponding to the given xpath.

Overrides:
updateDoc in class A_CmsSetupXmlUpdate
Parameters:
document - the original document to update
newDoc - the document to update
xpath - the corresponding xpath
See Also:
A_CmsSetupXmlUpdate.updateDoc(org.dom4j.Document, org.dom4j.Document, java.lang.String)