public synchronized void insertSchemaNode(GroupSchemaNode parent, String name, byte type, User user) throws org.dbwiki.exception.WikiException {
if (!DatabaseSchema.isValidName(name)) {
throw new WikiSchemaException(WikiSchemaException.SyntaxError, "Invalid element name " + name);
}
Version version = _versionIndex.getNextVersion(new ProvenanceUnknown(user));
SchemaNode schema = null;
if (type == SchemaNodeTypeAttribute) {
if (_schema.size() == 0) {
throw new WikiSchemaException(WikiSchemaException.InvalidSchemaType, "Schema root cannot be an attribute");