|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.structconf.xconf.UpdateXconf
Tool to add, remove, or update entries in site-specific xconf file.
The preferred method of changing Xconf files is to execute
StructConfManagerCommands
via a StructConfManager. This will ensure semantic integrity of all xconf values for a site.
Field Summary | |
private boolean |
dirty_
|
private Document |
document_
|
private int |
mode_
|
private File |
xconfFile_
|
Constructor Summary | |
UpdateXconf(File file,
int mode)
|
|
UpdateXconf(int mode)
|
Method Summary | |
void |
addInclude(String path_to_include)
|
void |
addOrUpdate(String property_name,
String property_value,
File target_file)
Update the site property to the new value. |
void |
addOrUpdate(String property_name,
String property_value,
File target_file,
String comment)
Removes all elements in the document that change the specified property then adds a <Property gt;
element to the end of the document body to set the site value to
the specified value. |
void |
addToProperty(String property_name,
String property_value)
Appends an <AddToProperty ...> element to the
end of the document body without touching any other elements which may
change the value of the specified propery. |
private void |
assertDeclMode()
|
private void |
assertSiteMode()
|
private Node[] |
cleanRemove(Node parent,
Node child)
|
private void |
cleanRemoveAll(Element root,
Collection to_remove)
|
private ArrayList |
getAllElementsMatching(Element root,
String element_name,
Map attributes)
|
private Document |
getXconfDocument()
|
private String |
relativizePathToProductRoot(File path)
|
private String |
relativizePathToTargetRoot(File path)
|
private void |
removeAllPropElements(Element root,
String property_name)
|
void |
removeFromProperty(String property_name,
String property_value)
Appends a <RenoveFromProperty ...> element to the
end of the document body without touching any other elements which may
change the value of the specified propery. |
void |
resetToDefault(String property_name)
Removes all elements in the document that change the specified property then adds a <ResetProperty ...>
element to the end of the document body to reset the property to its
declared default value. |
void |
resetToDefault(String property_name,
File target_file)
Deprecated. Target file is ignored now. Use resetToDefault(java.lang.String) . |
void |
save()
|
void |
save(boolean force)
|
private String |
standardizePath(String path)
|
private Node[] |
stripPrecedingComment(Node parent,
Node child)
|
private Node[] |
stripTrailingWhiteSpace(Node parent,
Node child)
|
private void |
undefineOrResetToDefaultProperty(String property_name,
String element_name,
String name_attribute_name)
Removes all elements in the document that change the specified property then adds an element to the end of the document to either Reset or Undefine the property (which one depends on the value of the element_name parameter. |
private void |
undefineOrResetToDefaultProperty(String property_name,
String element_name,
String name_attribute_name,
File target_file)
Deprecated. Target file is ignored now. Use #undefineOrResetToDefaultProperty(java.lang.String) . |
void |
undefineProperty(String property_name)
Removes all elements in the document that change the specified property then adds an <UndefineProperty ...>
element to the end of the document body to undefine the property. |
void |
undefineProperty(String property_name,
File target_file)
Deprecated. Target file is ignored now. Use undefineProperty(java.lang.String) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int mode_
private Document document_
private boolean dirty_
private File xconfFile_
Constructor Detail |
public UpdateXconf(int mode)
public UpdateXconf(File file, int mode)
Method Detail |
private Document getXconfDocument() throws XconfException
XconfException
private void assertSiteMode() throws XconfException
XconfException
private void assertDeclMode() throws XconfException
XconfException
public void addInclude(String path_to_include) throws XconfException
XconfException
private String standardizePath(String path) throws XconfException
XconfException
private String relativizePathToTargetRoot(File path)
private String relativizePathToProductRoot(File path)
public void addOrUpdate(String property_name, String property_value, File target_file) throws XconfException
target_file
- optionally specify the properties target file
XconfException
public void addOrUpdate(String property_name, String property_value, File target_file, String comment) throws XconfException
<Property gt;
element to the end of the document body to set the site value to
the specified value.
target_file
- optionally specify the properties target file. If it is null then the current value for the target file will be retainedcomment
- optionally add a comment before the element
XconfException
public void addToProperty(String property_name, String property_value) throws XconfException
<AddToProperty ...>
element to the
end of the document body without touching any other elements which may
change the value of the specified propery.
XconfException
public void removeFromProperty(String property_name, String property_value) throws XconfException
<RenoveFromProperty ...>
element to the
end of the document body without touching any other elements which may
change the value of the specified propery.
XconfException
public void resetToDefault(String property_name, File target_file) throws XconfException
resetToDefault(java.lang.String)
.
XconfException
public void resetToDefault(String property_name) throws XconfException
<ResetProperty ...>
element to the end of the document body to reset the property to its
declared default value.
XconfException
public void undefineProperty(String property_name, File target_file) throws XconfException
undefineProperty(java.lang.String)
.
XconfException
public void undefineProperty(String property_name) throws XconfException
<UndefineProperty ...>
element to the end of the document body to undefine the property.
XconfException
private void undefineOrResetToDefaultProperty(String property_name, String element_name, String name_attribute_name, File target_file) throws XconfException
#undefineOrResetToDefaultProperty(java.lang.String)
.
XconfException
private void undefineOrResetToDefaultProperty(String property_name, String element_name, String name_attribute_name) throws XconfException
element_name
parameter.
XconfException
private void cleanRemoveAll(Element root, Collection to_remove)
private Node[] cleanRemove(Node parent, Node child)
private ArrayList getAllElementsMatching(Element root, String element_name, Map attributes)
private void removeAllPropElements(Element root, String property_name)
private Node[] stripPrecedingComment(Node parent, Node child)
private Node[] stripTrailingWhiteSpace(Node parent, Node child)
public void save() throws XconfException
XconfException
public void save(boolean force) throws XconfException
XconfException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |