use of org.dom4j.Element in project Openfire by igniterealtime.
the class AdminConsole method overrideTab.
private static void overrideTab(Element tab, Element overrideTab) {
// Override name, url, description.
if (overrideTab.attributeValue("name") != null) {
tab.addAttribute("name", overrideTab.attributeValue("name"));
}
if (overrideTab.attributeValue("url") != null) {
tab.addAttribute("url", overrideTab.attributeValue("url"));
}
if (overrideTab.attributeValue("description") != null) {
tab.addAttribute("description", overrideTab.attributeValue("description"));
}
if (overrideTab.attributeValue("plugin") != null) {
tab.addAttribute("plugin", overrideTab.attributeValue("plugin"));
}
// Override sidebar items.
for (Iterator i = overrideTab.elementIterator(); i.hasNext(); ) {
Element sidebar = (Element) i.next();
String id = sidebar.attributeValue("id");
Element existingSidebar = getElemnetByID(id);
// Simple case, there is no existing sidebar with the same id.
if (existingSidebar == null) {
tab.add(sidebar.createCopy());
} else // More complex case -- a sidebar with the same id already exists.
// In this case, we have to overrite only the difference between
// the two elements.
{
overrideSidebar(existingSidebar, sidebar);
}
}
}
use of org.dom4j.Element in project Openfire by igniterealtime.
the class ChangeNickname method readExternal.
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
Element packetElement = (Element) ExternalizableUtil.getInstance().readSerializable(in);
presence = new Presence(packetElement, true);
oldNick = ExternalizableUtil.getInstance().readSafeUTF(in);
newNick = ExternalizableUtil.getInstance().readSafeUTF(in);
}
use of org.dom4j.Element in project Openfire by igniterealtime.
the class OccupantAddedEvent method readExternal.
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
Element packetElement = (Element) ExternalizableUtil.getInstance().readSerializable(in);
presence = new Presence(packetElement, true);
role = ExternalizableUtil.getInstance().readInt(in);
affiliation = ExternalizableUtil.getInstance().readInt(in);
voiceOnly = ExternalizableUtil.getInstance().readBoolean(in);
roleAddress = (JID) ExternalizableUtil.getInstance().readSerializable(in);
userAddress = (JID) ExternalizableUtil.getInstance().readSerializable(in);
nodeID = NodeID.getInstance(ExternalizableUtil.getInstance().readByteArray(in));
sendPresence = ExternalizableUtil.getInstance().readBoolean(in);
}
use of org.dom4j.Element in project Openfire by igniterealtime.
the class UpdateOccupant method readExternal.
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
Element packetElement = (Element) ExternalizableUtil.getInstance().readSerializable(in);
presence = new Presence(packetElement, true);
nickname = ExternalizableUtil.getInstance().readSafeUTF(in);
role = ExternalizableUtil.getInstance().readInt(in);
affiliation = ExternalizableUtil.getInstance().readInt(in);
}
use of org.dom4j.Element in project Openfire by igniterealtime.
the class UpdatePresence method readExternal.
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
Element packetElement = (Element) ExternalizableUtil.getInstance().readSerializable(in);
presence = new Presence(packetElement, true);
nickname = ExternalizableUtil.getInstance().readSafeUTF(in);
}
Aggregations