private void registerAttributeHandlers(ReadManager reader) {
reader.addAttributeHandler(MAP_EXTENSION_XML_TAG, PROJECT_ID_XML_TAG, new IAttributeHandler() {
public void setAttribute(Object map, String value) {
final MapModel mapModel = (MapModel) map;
WorkspaceMapModelExtension wmme = WorkspaceController.getMapModelExtension(mapModel);
if(wmme.getProject() == null) {
AWorkspaceProject prj = WorkspaceController.getCurrentModel().getProject(value);
if(prj == null) {
//WORKSPACE - todo: propagate exception
LogUtils.warn("project with id="+value+" was not found");
return;
}
wmme.setProject(prj);
}
}
});
reader.addAttributeHandler(MAP_EXTENSION_XML_TAG, PROJECT_HOME_XML_TAG, new IAttributeHandler() {
public void setAttribute(Object map, String value) {
final MapModel mapModel = (MapModel) map;
WorkspaceMapModelExtension wmme = WorkspaceController.getMapModelExtension(mapModel);
if(wmme.getProject() == null) {
//WORKSPACE - todo: find project for uri?
// AWorkspaceProject prj = WorkspaceController.getCurrentModel().getProject(value);