@Override public Object run(Domain writeableDomain) throws PropertyVetoException, TransactionFailure { ConfigBeanProxy child = writeableDomain.createChild(type); Dom domDomain = Dom.unwrap(writeableDomain); final String elementName; try { elementName = GenericCrudCommand.elementName(domDomain.document, Domain.class, type); } catch (ClassNotFoundException e) { throw new TransactionFailure(e.toString()); } if (elementName==null) { String msg = localStrings.getLocalString(TypeResolver.class, "TypeResolver.no_element_of_that_type", "The Domain configuration does not have a sub-element of the type {0}", type.getSimpleName()); throw new TransactionFailure(msg); } domDomain.setNodeElements(elementName, Dom.unwrap(child)); // add to the habitat habitat.addIndex(new ExistingSingletonInhabitant<ConfigBeanProxy>(child), type.getName(), null); return child; } }, domain));
@Override public Object run(Domain writeableDomain) throws PropertyVetoException, TransactionFailure { ConfigBeanProxy child = writeableDomain.createChild(type); Dom domDomain = Dom.unwrap(writeableDomain); final String elementName; try { elementName = GenericCrudCommand.elementName(domDomain.document, Domain.class, type); } catch (ClassNotFoundException e) { throw new TransactionFailure(e.toString()); } if (elementName==null) { String msg = localStrings.getLocalString(TypeResolver.class, "TypeResolver.no_element_of_that_type", "The Domain configuration does not have a sub-element of the type {0}", type.getSimpleName()); throw new TransactionFailure(msg); } domDomain.setNodeElements(elementName, Dom.unwrap(child)); // add to the habitat ServiceLocatorUtilities.addOneConstant(habitat, child, null, type); return child; } }, domain));
String elementName = GenericCrudCommand.elementName(parentDom.document, targetType, type); if (elementName==null) { return null;
String elementName = GenericCrudCommand.elementName(parentDom.document, targetType, type); if (elementName==null) { return null;