Community Server *_override.config
Although there have been a couple examples of how to use the *_override.config files in Community Server floating around, I haven't found a good reference on what is available. Fortunately, Telligent makes the source available for much of the CS platform. Looking at how these files work resulted in the following longer than expected information.
The first thing that must be recognized is the format of the override file. The following schema is a rough approximation of what will work.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Overrides">
<xs:sequence>
<xs:element name="Override">
<xs:complexType mixed="true">
<xs:attribute name="xpath" type="xs:string" use="required"/>
<xs:attribute name="mode" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="value" type="xs:string"/>
<xs:attribute name="where" type="xs:string"/>
</xs:element>
</xs:sequence>
</xs:element>
</xs:schema>
The following operations (values for mode) are available to alter attributes within the configuration files.
- new
Creates a new attribute on the node selected with the xpath expression. The name,value pair of the attribute are specified as name and value in the <Override> element. If the attribute already exists an exception is thrown.
- change
Replaces the value of the attribute with the one specified in the <Override> element. The attribute must exist or an exception is thrown.
- remove
Deletes the attribute from the element. The attribute must exist or an exception is thrown.
The following operations (values for mode) are available to change elements within the configuration files. They all ignore the name and value attributes in the
- add
The content inserted is the InnerXML of the Override element. This is the only place that the where attribute can be used, and only one value is valid. If you specify where="start" then it will be added as the first child of the node selected by the xpath attribute, otherwise it will be added as the last child of the selected node. It would be nice if the where attribute could also be a xpath expression that would allow the element to be inserted as a sibling at the point selected by the where expression.
- update
Simply replaces the content of the node selected by the xpath with InnerXML of the Override element.
- remove
Deletes all descendent nodes of the selected element. Be careful with this one as you can remove a bunch of elements without realizing it.
Examples to follow in another post.