Skip to content

Commit

Permalink
TEIIDDES-2012 Fixed issue with responding to changes in view model UDFs.
Browse files Browse the repository at this point in the history
* Now including view models correctly.
* Fixed issue with isPushdown that was preventing some view functions from getting added.
  • Loading branch information
blafond committed Jan 8, 2014
1 parent afa3207 commit 2c51b28
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void processEvent( EventObject obj ) {
} catch(Exception ex) {
UdfUiPlugin.UTIL.log(ex);
}
} else if( ModelIdentifier.isRelationalSourceModel(event.getModelResource()) ) {
} else if( ModelIdentifier.isRelationalSourceModel(event.getModelResource()) || ModelIdentifier.isRelationalViewModel(event.getModelResource())) {
// Only need to notify UdfManager if the changed resource is a Physical/source model.
// Relational View, XML view, WS view and XSD models do NOT and will not contain functions.
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,9 @@ public synchronized IFunctionLibrary<IFunctionForm, IFunctionDescriptor> getFunc
boolean javaClassAndMethodEmpty = (javaClass==null && javaMethod==null) ? true : false;

// For source pushdown function, set the category name as the Model Name
boolean isPushdown = false;
if(isPhysical && javaClassAndMethodEmpty) {
isPushdown = true;
category = sourceModel.getItemName();
if( category.endsWith(".xmi")) { //$NON-NLS-1$
category = category.replaceAll(".xmi", StringUtilities.EMPTY_STRING); //$NON-NLS-1$
Expand All @@ -536,7 +538,9 @@ public synchronized IFunctionLibrary<IFunctionForm, IFunctionDescriptor> getFunc
outputParam,
schema);

fMethodDescriptor.setPushDown(Boolean.toString(true));
if( isPushdown) {
fMethodDescriptor.setPushDown(Boolean.toString(true));
}
fMethodDescriptor.setDeterministic(wrappedProcedure.isDeterministic());

boolean varArgs = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.teiid.core.designer.ModelerCoreException;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.ObjectExtension;
import org.teiid.designer.core.workspace.ModelResource;
import org.teiid.designer.core.workspace.ModelWorkspaceException;
import org.teiid.designer.ui.PluginConstants;
import org.teiid.designer.ui.UiConstants;
import org.teiid.designer.ui.properties.ModelObjectPropertySource;
Expand Down Expand Up @@ -336,7 +338,15 @@ public final Object getValue(int index){
if( container != null ) {
result = ModelUtilities.getEMFLabelProvider().getText(modelObject.eContainer());
} else {
result = ModelUtilities.getModelName(modelObject);
try {
ModelResource mr = ModelUtilities.getModelResource(modelObject);
if( mr != null && mr.getCorrespondingResource() != null ) {
result = ModelUtilities.getModelName(modelObject);
}
} catch (ModelWorkspaceException ex) {
String message = "[ModelRowElement.getValue()]: exception finding resource for model"; //$NON-NLS-1$
UiConstants.Util.log(IStatus.ERROR, ex, message);
}
}
} else if (tableModel.isDescriptionColumn(propertyId)) {
result = ModelObjectUtilities.getDescription(modelObject);
Expand Down

0 comments on commit 2c51b28

Please sign in to comment.