Skip to content

Commit

Permalink
TEIIDDES-2406 added Set Data Source JNDI Name modeling action & dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
blafond committed Jan 5, 2015
1 parent 32c8b9a commit 9010f62
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,21 @@ public void setTranslatorName( ModelResource modelResource, String translatorNam
modelResource.getItemName()));
}
}


public void setJNDIName( ModelResource modelResource, String jndiName ) {
CoreArgCheck.isNotNull(modelResource, "modelResource"); //$NON-NLS-1$
CoreArgCheck.isNotEmpty(jndiName, "jndiName"); //$NON-NLS-1$

try {
getHelper().setProperty(modelResource, CONNECTION_NAMESPACE + IJBossDsProfileConstants.JNDI_PROP_ID, jndiName);
} catch (Exception e) {
DatatoolsPlugin.Util.log(IStatus.ERROR,
e,
DatatoolsPlugin.Util.getString("errorFindingConnectionProfilePropertiesForModelResource", //$NON-NLS-1$
modelResource.getItemName()));
}
}

/**
* @param model the model whose JNDI data source name is being requested
Expand Down
3 changes: 3 additions & 0 deletions plugins/org.teiid.designer.dqp.ui/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ PreviewDataView.name=Preview
setTranslatorNameAction.name=setTranslatorNameAction
setTranslatorNameAction.label=Set Translator Name

setDataSourceJNDINameAction.name=setDataSourceJNDINameAction
setDataSourceJNDINameAction.label=Set Data Source JNDI Name

applyRestWarPropertiesAction.name = applyRestWarPropertiesAction
applyRestWarPropertiesAction.label = Enable REST for Procedures

Expand Down
9 changes: 9 additions & 0 deletions plugins/org.teiid.designer.dqp.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@
label="%setTranslatorNameAction.label">
</resourceAction>
</extension>
<extension
id="SetJBossDataSourceNameAction"
name="%setDataSourceJNDINameAction.name"
point="org.teiid.designer.ui.modelResourceAction">
<resourceAction
name="org.teiid.designer.runtime.ui.connection.SetJBossDataSourceNameAction"
label="%setDataSourceJNDINameAction.label">
</resourceAction>
</extension>
<extension
point="org.teiid.designer.vdb.sourceHandler">
<class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ private void setTranslatorNameInTxn(ModelResource modelResource, String translat
}
} catch (Exception e) {
MessageDialog.openError(Display.getCurrent().getActiveShell(),
DqpUiConstants.UTIL.getString("SetConnectionProfileAction.exceptionMessage"), e.getMessage()); //$NON-NLS-1$
DqpUiConstants.UTIL.getString("SetConnectionInfo.exceptionMessage"), e.getMessage()); //$NON-NLS-1$
IStatus status = new Status(IStatus.ERROR, DqpUiConstants.PLUGIN_ID,
DqpUiConstants.UTIL.getString("SetConnectionProfileAction.exceptionMessage"), e); //$NON-NLS-1$
DqpUiConstants.UTIL.getString("SetConnectionInfo.exceptionMessage"), e); //$NON-NLS-1$
DqpUiConstants.UTIL.log(status);

return;
Expand Down Expand Up @@ -159,7 +159,8 @@ public boolean isApplicable( ISelection selection ) {
return sourceModelSelected(selection);
}

private boolean sourceModelSelected( ISelection theSelection ) {
@SuppressWarnings("rawtypes")
private boolean sourceModelSelected( ISelection theSelection ) {
boolean result = false;
List allObjs = SelectionUtilities.getSelectedObjects(theSelection);
if (!allObjs.isEmpty() && allObjs.size() == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ SetConnectionProfileAction.categorySelectionMessage=Connection Profile category
SetConnectionProfileAction.okSelectionMessage=Select OK to finish
SetConnectionProfileAction.invalidSelectionMessage=No valid selection

SetConnectionInfo.exceptionMessage=Problem setting connection property values.

#########################################
# SetTranslatorNameAction
#########################################
Expand All @@ -323,6 +325,15 @@ EnterTranslatorNameDialog.message=Enter valid Teiid translator name
EnterTranslatorNameDialog.nameLabel=Name:
EnterTranslatorNameDialog.selectTranslatorMessage=Select Teiid translator

#########################################
# SetJBossDataSourceNameAction
#########################################
SetJBossDataSourceNameAction.title=Set JBoss Data Source JNDI Name
EnterDataSourceJNDINameDialog.title=Set JBoss Data Source JNDI Name
EnterDataSourceJNDINameDialog.message=Enter valid JBoss data source JNDI name
EnterDataSourceJNDINameDialog.nameLabel=Name:
EnterDataSourceJNDINameDialog.selectTranslatorMessage=Select Teiid translator

#########################################
# VdbSourceConnectionHandler
#########################################
Expand Down

0 comments on commit 9010f62

Please sign in to comment.