Search in sources :

Example 1 with IDatabaseType

use of org.pentaho.database.model.IDatabaseType in project pentaho-platform by pentaho.

the class DefaultDatasourceMgmtWebServiceTest method mockDatabaseType.

private IDatabaseType mockDatabaseType(final String shortName) {
    IDatabaseType dbType = mock(IDatabaseType.class);
    doReturn(shortName).when(dbType).getShortName();
    return dbType;
}
Also used : IDatabaseType(org.pentaho.database.model.IDatabaseType)

Example 2 with IDatabaseType

use of org.pentaho.database.model.IDatabaseType in project pentaho-platform by pentaho.

the class JcrBackedDatasourceMgmtServiceTest method mockDatabaseType.

private IDatabaseType mockDatabaseType(final String shortName) {
    IDatabaseType dbType = mock(IDatabaseType.class);
    doReturn(shortName).when(dbType).getShortName();
    return dbType;
}
Also used : IDatabaseType(org.pentaho.database.model.IDatabaseType)

Example 3 with IDatabaseType

use of org.pentaho.database.model.IDatabaseType in project data-access by pentaho.

the class DatabaseConnectionConverterTest method testConvertToXml.

@Test
public void testConvertToXml() {
    DatabaseConnection dbConnection = new DatabaseConnection();
    dbConnection.setId("my id");
    dbConnection.setAccessType(DatabaseAccessType.NATIVE);
    List<DatabaseAccessType> accessTypes = new LinkedList<DatabaseAccessType>();
    accessTypes.add(DatabaseAccessType.NATIVE);
    DatabaseType dbType = new DatabaseType("name", "short name", accessTypes, 100500, "helpUri");
    dbConnection.setDatabaseType(dbType);
    Map<String, String> extraOptions = new HashMap<String, String>();
    extraOptions.put("opt", "value");
    dbConnection.setExtraOptions(extraOptions);
    dbConnection.setName("Best name");
    dbConnection.setHostname("localhost");
    dbConnection.setDatabaseName("foodmart");
    dbConnection.setDatabasePort("2233");
    dbConnection.setUsername("username");
    dbConnection.setPassword("password");
    dbConnection.setStreamingResults(true);
    dbConnection.setDataTablespace("tables");
    dbConnection.setIndexTablespace("indexes");
    dbConnection.setSQLServerInstance("INSTANCE_0");
    dbConnection.setUsingDoubleDecimalAsSchemaTableSeparator(true);
    dbConnection.setInformixServername("INFORM_1");
    dbConnection.addExtraOption("100", "option", "value");
    Map<String, String> attributes = new HashMap<String, String>();
    attributes.put("attr1", "value");
    dbConnection.setAttributes(attributes);
    dbConnection.setChanged(true);
    dbConnection.setQuoteAllFields(true);
    dbConnection.setForcingIdentifiersToLowerCase(true);
    dbConnection.setForcingIdentifiersToUpperCase(true);
    dbConnection.setConnectSql("select * from 1");
    dbConnection.setUsingConnectionPool(true);
    dbConnection.setInitialPoolSize(3);
    dbConnection.setMaximumPoolSize(9);
    dbConnection.setPartitioned(true);
    Map<String, String> connectionPoolingProperties = new HashMap<String, String>();
    connectionPoolingProperties.put("pool", "abc");
    dbConnection.setConnectionPoolingProperties(connectionPoolingProperties);
    List<PartitionDatabaseMeta> partitioningInformation = new LinkedList<PartitionDatabaseMeta>();
    PartitionDatabaseMeta pdm = new PartitionDatabaseMeta();
    partitioningInformation.add(pdm);
    dbConnection.setPartitioningInformation(partitioningInformation);
    List<IDatabaseType> databaseTypes = new LinkedList<IDatabaseType>();
    databaseTypes.add(dbType);
    DatabaseTypeHelper dbh = new DatabaseTypeHelper(databaseTypes);
    DatabaseConnectionConverter dbcc = new DatabaseConnectionConverter(dbh);
    String xmlCOnnection = dbcc.convertToXml(dbConnection);
}
Also used : DatabaseType(org.pentaho.database.model.DatabaseType) IDatabaseType(org.pentaho.database.model.IDatabaseType) HashMap(java.util.HashMap) PartitionDatabaseMeta(org.pentaho.database.model.PartitionDatabaseMeta) LinkedList(java.util.LinkedList) IDatabaseType(org.pentaho.database.model.IDatabaseType) DatabaseAccessType(org.pentaho.database.model.DatabaseAccessType) DatabaseTypeHelper(org.pentaho.database.util.DatabaseTypeHelper) DatabaseConnection(org.pentaho.database.model.DatabaseConnection) Test(org.junit.Test)

Example 4 with IDatabaseType

use of org.pentaho.database.model.IDatabaseType in project data-access by pentaho.

the class ConnectionController method init.

@Bindable
public void init() {
    XulServiceCallback<List<IDatabaseType>> callback = new XulServiceCallback<List<IDatabaseType>>() {

        public void error(String message, Throwable error) {
            error.printStackTrace();
        }

        public void success(List<IDatabaseType> retVal) {
            databaseTypeHelper = new DatabaseTypeHelper(retVal);
        }
    };
    dialectService.getDatabaseTypes(callback);
    saveConnectionConfirmationDialog = // $NON-NLS-1$
    (XulDialog) document.getElementById("saveConnectionConfirmationDialogConnectionController");
    overwriteConnectionConfirmationDialog = (XulDialog) document.getElementById("overwriteConnectionConfirmationDialogConnectionController");
    renameConnectionConfirmationDialog = (XulDialog) document.getElementById("renameConnectionConfirmationDialogConnectionController");
    // $NON-NLS-1$
    errorDialog = (XulDialog) document.getElementById("errorDialog");
    // $NON-NLS-1$
    errorLabel = (XulLabel) document.getElementById("errorLabel");
    // $NON-NLS-1$
    successDialog = (XulDialog) document.getElementById("successDialog");
    // $NON-NLS-1$
    successLabel = (XulLabel) document.getElementById("successLabel");
    // $NON-NLS-1$
    removeConfirmationDialog = (XulDialog) document.getElementById("removeConfirmationDialogConnectionController");
    // $NON-NLS-1$
    successDetailsDialog = (XulDialog) document.getElementById("successDetailsDialogConnectionController");
}
Also used : XulServiceCallback(org.pentaho.ui.xul.XulServiceCallback) IDatabaseType(org.pentaho.database.model.IDatabaseType) DatabaseTypeHelper(org.pentaho.database.util.DatabaseTypeHelper) ArrayList(java.util.ArrayList) IDatabaseConnectionList(org.pentaho.ui.database.event.IDatabaseConnectionList) List(java.util.List) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 5 with IDatabaseType

use of org.pentaho.database.model.IDatabaseType in project data-access by pentaho.

the class AutobeanUtilities method dbTypeBeanToImpl.

/**
 * @param databaseType - A DatabaseType
 * @return IDatabaseType backed by an DatabaseType
 * <p/>
 * Conversion method for creating a Database Type from an Autobean implementation of IDatabaseType
 */
public static IDatabaseType dbTypeBeanToImpl(IDatabaseType databaseTypeBean) {
    DatabaseType databaseTypeImpl = new DatabaseType();
    databaseTypeImpl.setDefaultDatabasePort(databaseTypeBean.getDefaultDatabasePort());
    databaseTypeImpl.setExtraOptionsHelpUrl(databaseTypeBean.getExtraOptionsHelpUrl());
    databaseTypeImpl.setName(databaseTypeBean.getName());
    databaseTypeImpl.setShortName(databaseTypeBean.getShortName());
    databaseTypeImpl.setSupportedAccessTypes(listBeanToImpl(databaseTypeBean.getSupportedAccessTypes()));
    return databaseTypeImpl;
}
Also used : DatabaseType(org.pentaho.database.model.DatabaseType) IDatabaseType(org.pentaho.database.model.IDatabaseType)

Aggregations

IDatabaseType (org.pentaho.database.model.IDatabaseType)11 DatabaseTypeHelper (org.pentaho.database.util.DatabaseTypeHelper)5 List (java.util.List)4 XulServiceCallback (org.pentaho.ui.xul.XulServiceCallback)4 ArrayList (java.util.ArrayList)3 DatabaseType (org.pentaho.database.model.DatabaseType)3 LinkedList (java.util.LinkedList)2 Test (org.junit.Test)2 DatabaseAccessType (org.pentaho.database.model.DatabaseAccessType)2 IDatabaseConnectionList (org.pentaho.ui.database.event.IDatabaseConnectionList)2 Bindable (org.pentaho.ui.xul.stereotype.Bindable)2 Request (com.google.gwt.http.client.Request)1 RequestBuilder (com.google.gwt.http.client.RequestBuilder)1 RequestCallback (com.google.gwt.http.client.RequestCallback)1 RequestException (com.google.gwt.http.client.RequestException)1 Response (com.google.gwt.http.client.Response)1 HashMap (java.util.HashMap)1 BogoPojo (org.pentaho.agilebi.modeler.gwt.BogoPojo)1 GwtModelerServiceImpl (org.pentaho.agilebi.modeler.services.impl.GwtModelerServiceImpl)1 DatabaseConnection (org.pentaho.database.model.DatabaseConnection)1