@Override
	public void onNodeCreate(DataSourceEvent event) throws ResourceException {
		DataNode node = event.getNode();
		DataNode parentNode = event.getParent();

		if (node.getName().equals(ResourceDefinition.RESOURCE_TAG)) {

			String id = node.getAttribute(ResourceDefinition.ID);
			String parentId = parentNode.getAttribute(ResourceDefinition.ID);

			ResourceDefinition definition = getElement(id);
			definition = computeDefinition(definition, node);

			if (parentNode != null) {
				if (parentNode.getName()
						.equals(ResourceDefinition.RESOURCE_TAG)) {
					ResourceDefinition parentDefinition = getElement(parentId);
					parentDefinition = computeDefinition(parentDefinition,
							parentNode);
					parentDefinition.addChild(definition);
				} else if (parentNode.getName().equals(
						ResourceGroup.RESOURCE_TAG)) {
					ResourceGroup group = manager.getElement(parentId);
					group = manager.computeGroup(group, parentNode);
					group.addResourceDefinition(definition);
				} else {
					// Create root group
					DataNode rootNode = new BasicDataNode(
							ResourceGroup.RESOURCE_TAG);
					rootNode.addAttribute(ResourceGroup.ID,
							ResourceGroup.DEFAULT_ID);

					ResourceGroup root = manager
							.getElement(ResourceGroup.DEFAULT_ID);
					root = manager.computeGroup(root, parentNode);
					root.addResourceDefinition(definition);
				}
			}

		}
	}