|
@@ -1092,11 +1092,6 @@ public class ViewRegistry {
|
|
persistedView = viewDAO.merge(view);
|
|
persistedView = viewDAO.merge(view);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, ViewInstanceEntity> xmlInstanceEntityMap = new HashMap<String, ViewInstanceEntity>();
|
|
|
|
- for( ViewInstanceEntity instance : view.getInstances()) {
|
|
|
|
- xmlInstanceEntityMap.put(instance.getName(), instance);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
view.setResourceType(persistedView.getResourceType());
|
|
view.setResourceType(persistedView.getResourceType());
|
|
view.setPermissions(persistedView.getPermissions());
|
|
view.setPermissions(persistedView.getPermissions());
|
|
|
|
|
|
@@ -1106,8 +1101,6 @@ public class ViewRegistry {
|
|
String instanceName = persistedInstance.getName();
|
|
String instanceName = persistedInstance.getName();
|
|
ViewInstanceEntity instance = view.getInstanceDefinition(instanceName);
|
|
ViewInstanceEntity instance = view.getInstanceDefinition(instanceName);
|
|
|
|
|
|
- xmlInstanceEntityMap.remove(instanceName);
|
|
|
|
-
|
|
|
|
// if the persisted instance is not in the view ...
|
|
// if the persisted instance is not in the view ...
|
|
if (instance == null) {
|
|
if (instance == null) {
|
|
if (persistedInstance.isXmlDriven()) {
|
|
if (persistedInstance.isXmlDriven()) {
|
|
@@ -1123,15 +1116,10 @@ public class ViewRegistry {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
instance.setResource(persistedInstance.getResource());
|
|
instance.setResource(persistedInstance.getResource());
|
|
|
|
+ instance.setViewInstanceId(persistedInstance.getViewInstanceId());
|
|
|
|
+ instance.setData(persistedInstance.getData());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- // these instances appear in the view.xml but are not present in the db...
|
|
|
|
- // add them to db
|
|
|
|
- for (ViewInstanceEntity instance : xmlInstanceEntityMap.values()) {
|
|
|
|
- instance.setResource(createViewInstanceResource(resourceType));
|
|
|
|
- instanceDAO.merge(instance);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// create an admin resource to represent a view instance
|
|
// create an admin resource to represent a view instance
|