use of org.obeonetwork.dsl.soa.System in project InformationSystem by ObeoNetwork.
the class WireItemProvider method addSourcePropertyDescriptor.
/**
* This adds a property descriptor for the Source feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
protected void addSourcePropertyDescriptor(Object object) {
final System system = getContainingSystem((EObject) object);
itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Wire_source_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Wire_source_feature", "_UI_Wire_type"), SoaPackage.Literals.WIRE__SOURCE, true, false, true, null, null, null) {
public java.util.Collection<?> getChoiceOfValues(Object object) {
Collection<Object> choiceOfValues = new ArrayList<Object>();
List<org.obeonetwork.dsl.soa.Service> services = getRequiredServices(system);
choiceOfValues.addAll(services);
return choiceOfValues;
}
});
}
use of org.obeonetwork.dsl.soa.System in project InformationSystem by ObeoNetwork.
the class WireItemProvider method addDestPropertyDescriptor.
/**
* This adds a property descriptor for the Dest feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
protected void addDestPropertyDescriptor(Object object) {
final System system = getContainingSystem((EObject) object);
itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Wire_dest_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Wire_dest_feature", "_UI_Wire_type"), SoaPackage.Literals.WIRE__DEST, true, false, true, null, null, null) {
public java.util.Collection<?> getChoiceOfValues(Object object) {
Collection<Object> choiceOfValues = new ArrayList<Object>();
List<org.obeonetwork.dsl.soa.Service> services = getProvidedServices(system);
choiceOfValues.addAll(services);
return choiceOfValues;
}
});
}
use of org.obeonetwork.dsl.soa.System in project InformationSystem by ObeoNetwork.
the class SoaModelWizard method createInitialModel.
/**
* Create a new model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
protected EObject createInitialModel() {
System rootObject = soaFactory.createSystem();
rootObject.setCreatedOn(new Date());
return rootObject;
}
use of org.obeonetwork.dsl.soa.System in project InformationSystem by ObeoNetwork.
the class SoaMigrationHelper method postLoad.
@Override
public void postLoad(XMLResource resource, InputStream inputStream, Map<?, ?> options) {
// Remove old DTO Registry level
for (EObject rootObject : resource.getContents()) {
if (rootObject instanceof System) {
System system = (System) rootObject;
if (system.getOwnedNamespaces().size() == 1) {
Namespace oldDtoRegistry = system.getOwnedNamespaces().get(0);
removeDtoRegistry(oldDtoRegistry);
}
}
}
}
use of org.obeonetwork.dsl.soa.System in project InformationSystem by ObeoNetwork.
the class SoaMigrationHelper method removeDtoRegistry.
private void removeDtoRegistry(Namespace dtoRegistry) {
System system = (System) dtoRegistry.eContainer();
if (!dtoRegistry.getOwnedNamespaces().isEmpty()) {
// Store XMI IDs
Map<EObject, String> eObjectToIds = new HashMap<EObject, String>();
TreeIterator<EObject> eAllContents = dtoRegistry.eAllContents();
while (eAllContents.hasNext()) {
EObject child = eAllContents.next();
String xmiId = child.eResource().getURIFragment(child);
eObjectToIds.put(child, xmiId);
}
// Change parent of children
Collection<Namespace> children = new ArrayList<Namespace>(dtoRegistry.getOwnedNamespaces());
for (Namespace child : children) {
system.getOwnedNamespaces().add(child);
}
// Restore XMI IDs
for (Entry<EObject, String> eObjectToIdEntry : eObjectToIds.entrySet()) {
EObject object = eObjectToIdEntry.getKey();
String id = eObjectToIdEntry.getValue();
((XMLResource) object.eResource()).setID(object, id);
}
}
// Delete old DTO registry
EcoreUtil.delete(dtoRegistry, false);
}
Aggregations