이 콘텐츠는 선택한 언어로 제공되지 않습니다.
13.2. Use the Data Virtualization Web Interface on OpenShift
Procedure 13.1. Install a Box Grinder plug-in
- Firstly, assign a MySQL database to your OpenShift Data Virtualization instance. Go to the overview page for your Data Virtualization application Click on the Add MySQL 5.5 link (found under the Databases section.)The MySQL cartridge will deploy. When complete, you will see a success screen
Important
Ensure that you save the credentials information for later reference. - Under Tools and Support, click on the Add phpMyAdmin 4.0 link. This adds the web interface for easy management of your MySQL database.The MySQL database and management interface deployments are now complete.
- Load some data into the database using the phpMyAdmin interface. Use the link that was displayed when you installed the phpMyAdmin cartridge at https://myApp-myDomain.rhcloud.com/phpmyadminUse the Root User and Root Password you received when the cartridge was installed.In the left tree panel, click on the database that matches the name of your DV application (for instance, jbossdv1). Select the SQL tab. On the SQL tab, copy this DDL and paste it into the text area:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Finally, click thebutton on the far right of the management interface.The PricesTable table has now been created and populated. You can verify the contents by clicking on it. - Restart the Data Virtualization cartridge. This is required to initialize the MySQL datasource. Click the Restart application icon on the application overview page
- Go to http://www.developerforce.com/events/regular/registration.php?d=70130000000EjHb , to register for a Salesforce account. (You will receive an email with a link to login into your account.)
- Log in to Salesforce interface with your user name an dpassword, then go to Personal Setup - Reset My Security Token. Reset the security token. You will get another email with the security token.
- When you establish connectivity to the Salesforce instance in the example below, use the Salesforce username. (The password is the combination of Salesforce password and security token.)
- go to the deployed Web interface on OpenShift at http://APP-NAME-DOMAIN-NAME.rhcloud.com/dv-ui. (APP-NAME is the name you gave the application and DOMAIN-NAME is your OpenShift domain name).
- From the Data Library screen, click the Create Data Services link. You will be directed to the Create Data Service page.
- Click on the Manage Data Sources pagebutton. You will be directed to the
- Click on the MySQLDS source: it is configured, but inactive. Select the mysql5 translator for the source and click thebutton. Upon deployment, the source should become active (a green check mark will appear).
- Click the Add Source button. This will create a default H2 source called MyNewSource.
- Click on MyNewSource.In the displayed properties, enter SalesforceDS for the Name, Under Source Type, click on the salesforce button. Click the Ok button as this will change the source to salesforce type and set the translator to salesforce. Under Connection Properties, enter the user name for your salesforce account. Enter the password and token combination for the password.
- Click on the Save Changes button. Click Ok for each dialog box. The salesforce source will deploy (it will take a couple of minutes to finish).
- Click the back link to go back to the Create Data Service page
- The next phase is to carete a data service which accesses the MySQL database table. Enter MySQLService for the service name. Enter a description for the service.
- Click on MySQLDS on the Service Helpers Active Sources tab.
- Click on the dv61.PricesTable under Tables, then select both columns via the checkboxes.
- To create the Service View Definition, click the Create Service View button. This will populate the Service View Definition text area.
- Click the Test Service button to test the service.
- Click Create Data Service. This will accept your entries and create the service. You will be redirected to the Data Service Details page.
- The steps to create a salesforce-only service follow the same pattern. Go back to the Data Library then click the Create Data Service button to create a new service.
- Enter SalesforceProductService for the service name. Enter a description for the service.
- Click on SalesforceDS on the Service Helpers Active Sources tab
- Click on Product2 under Tables, then select the Name and ProductCode columns via the checkboxes.
- To create the Service view definition, click the Create Service View button. This will populate the Service View Definition text area.
- Test the service as before to see sample data, the click Create Service to create the service.
- The steps to create a mashup service once more follow the same pattern. Go back to the Data Library then click the Create Data Service button to create a new service.
- Enter MashupService for the service name. Enter a description for the service.
- In the Service Helpers section, click on the Join Definition tab. (It is here that you define the join.)
- Select MySQLDS in the Available Sources drop-down. Under Source Tables, click the PricesTable. Then click the left-hand button to specify it as the Left table.
- Select SalesforceDS in the Available Sources drop-down. Under Source Tables, click the Product2 table. Then click the right-hand button to specify it as the Right table.
- In the left-hand side Prices table, check the ProdCode and SalePrice columns. In the right-hand side Product2 table, check the Name column.
- Leave the JoinType selection on Inner Join.
- Select ProdCode for the left-hand side Join Criteria column.
- Select ProductCode for the right-hand side Join Criteria column.
- Click the Apply button to generate the Service Definition DDL.
- Click the Test Service button to see example data.
- Click the Create Service button to create the Mashup service. You will be redirected to the Data Service Details page. The Data Service Details page shows a sample of data and also provides connection instructions and URLs for the different connection options.
- Click the Back to Library link to go back to your Data Library. On the Data Library page you will see the three services that you just created.
Note
Notice that for each service, there are more actions available to you:- Edit Service - redirects to the Edit Data Service page.
- Duplicate Service - makes a copy of the selected service.
- Test Service - redirects to the Data Service Details page.
- Delete Service - delete the selected service.
- Save to File - A service is backed by a teiid 'Dynamic VDB'. This action saves the dynamic VDB xml to a file.