Using Oracle Cloud to Power Your Application Development Lifecycle Srikanth Sallaka Oracle Product Management Dana Singleterry Oracle Product Management Greg Stachnick Oracle Product Management
Using Oracle Cloud to Power Your Application Development Lifecycle In this lab you ll create a project from template in Oracle Developer Cloud Service (ODCS) Web Dashboard. This is a simple Java EE SOAP web service application that will be the basis for exploring ODCS both within the web dashboard and through integration within Oracle Enterprise Pack for Eclipse (OEPE). In the first part of the lab, you ll log in to your ODCS web instance and start with creating a project from template. After creating the project you ll explore the features of ODCS and then proceed to create a couple tasks that you will activate and complete within OEPE. As part of this lab you ll build this project using Hudson Continuous Integration Tooling within ODCS and automatically deploy the application to Oracle Java Cloud Service (OJCS). You will then validate the web service url endpoint. Why ODCS? In recent years the world of application development has adopted new methodologies that aim to improve the quality and speed in which applications are being delivered. The introduction of innovative development approaches such as test driven development and agile development gave rise to a set of new techniques and tools that enable those methodologies. Tools such as automatic build utilities combined with continuous integration platforms, as well as enhanced collaborative tools such as wikis and code review utilities aim to simplify the adoption of these new methodologies. However, for many IT shops setting up these environments and maintaining them was difficult and cost prohibiting, resulting in many organizations sticking to the old way of building applications. Now Oracle is aiming to change this by introducing a new simpler way to adopt modern development methodology and tools with a cloud based offering known as ODCS. Requirements: For this lab, all the required software is provided. If you do not finish this lab you can run through it at your convenience from home. All you need to is the following: 1. Create an Oracle Java Cloud Service SaaS Extension account here. You will be provided with a 30 day free access account along with an entitlement for Oracle Developer Cloud Service and Oracle Database Cloud Service. 2. Download and install Oracle Enterprise Pack for Eclipse. 3. Download and install Maven. The latest version will work (3.2.3). 4. Download and install Java SDK 7. Grab the latest update. 5. You can access the lab from the Oracle Developer Cloud Service product page here.
Step 1: Create a project from template 1. Begin by logging in to your ODCS web dashboard. https://cloud.oracle.com 2. Select Data Center US Commercial 2 and proceed to sign in to your services. 3. Provide the User Name, Password, and Identity Domain that you were given by your lab instructor. Note: You may be prompted to change your password the first time you log in. 4. Once you have authenticated, you will see a Dashboard that displays all your active platform services. Select the Developer (Developer) service link.
5. Select the Open Service Console button. This open the ODCS Projects view. 6. Select Create Project button. 7. Give your project a Name such as OOW Contacts Soap Service and Description similar to the following: OOW Contacts SOAP Service created from the Simple SOAP Service Template. You can leave the Privacy setting to Private. Select the Next button.
8. Select the Simple SOAP Service Template followed by the Next button. 9. Go with the defaults for Wiki Markup. Select the Create Project button. 10. Project services are now being provisioned and can take up to a minute. You will notice the tabs in the web dashboard coming on-line as each of the features are being provisioned.
11. Explore the various Features of ODCS. The Home tab for instance provides details about the newly created project including the location of the Git source code repositories as well as the Maven repository. You will also notice new activities within the project as they occur. 12. The Dashboard tab provides details such as build status, commits by team members, activity within the last 60 days including open tasks, closed tasks, etc as well as recent activity. 13. The Tasks tab is where you can create and assign new tasks to team members. You can also search for specific tasks with advanced search capabilities or via the standard search that s provided.
14. The Browse tab is where you can browse the Git repositories and perform file diffs, etc... 15. The Build tab is where you create new Hudson build jobs, further configure your jobs, start builds, check the status of builds, view build history, etc Until you have a project that you re building, this tab will provide limited details. 16. The Reviews tab allows you to create new code reviews and invite team members to participate in the code review. Each team member is allowed to approve/reject the code and provide a description of their analysis. The team member that created the code review has the final approval. You can look at all open reviews as well as all reviews historically including the ability to filter on reviews.
17. The Deploy tab allows you to create new deployment configurations for your project. After creating a New Configuration, you can start a deployment, undeploy an application, redeploy an application, edit and delete a deployment configuration. 18. The Wiki tab allows you to create new Wiki pages for collaboration with members of your development team. This is a good starting point to start creating use cases and other design documents for your application. 19. Create a new Wiki page. Select the New Page button now and provide some descriptive text for your project as seen in this image. Select the Save button once complete.
20. The Team tab is where you can manage your development team. 21. Select the Manage Members button. This takes you to the Admin tab if you are the project Administrator. Here you can mange project settings, tasks, source code and team. For Team, you can add new members to collaborate on your project. For Source Code, you can add new hosted repositories or even external repositories. The Tasks sub-tab allows you to create new Products, Iterations, Tags and Custom Fields. Explore the various features but no need to change anything at this point. Step 2: Open Oracle Enterprise Pack for Eclipse (OEPE) and connect to your ODCS instance. You will also clone/import your project. 1. Open OEPE. Look for the OEPE icon on your desktop. 2. Within OEPE you can close the Welcome page and switch to the Java EE perspective by selecting the open perspective icon on the top right of the IDE to the left of Resource.
3. Select the OK button. 4. In the bottom left of your IDE you should now have a cloud view, Oracle Cloud, where you can connect to your ODCS instance. Select the Connect link. 5. Enter the credentials supplied by your lab instructor and select the Finish button. 6. Right click on the Developer item and select Activate to fetch your existing cloud projects.
7. Right click on the OOW Contacts SOAP Service or the project name that you created earlier if different and select Activate. Once done, expand the OOW Contacts SOAP Service. 8. Expand the Source item in the tree and right click on the Git repository, it should be the 2 nd one, named [developer-oracletemplates_simple-soapservice.git] and select Activate to clone your project to your local Git repository. 9. A dialogue will appear indicating that the cloning process is running. Let it complete. 10. Right click on the developer-oracletemplates_simple-soap-service.git repository in your Source within your Oracle Cloud view and select Import Projects.
11. An import wizard will appear. Select Import existing projects radio button if not selected followed by selecting the Next button. 12. Go with the default setting on the next dialogue of the Import Projects wizard and select the Finish button. 13. Your contacts project is now successfully imported into your IDE (OEPE) and should resemble the following image as seen in the Project Explorer view.
Step 3: Create a new task within your browser (ODCS Web Dashboard) and resolve the task within your IDE (OEPE). 1. Select the Tasks tab within the ODCS Web Dashboard browser. 2. Select the New Task button to create a new task. Enter details similar to these provided here. For Owner, assign the task to yourself. Select the Create Task button once complete.
3. You ve created your first task and can edit this task and/or post comments as desired. 4. Now go to your Oracle Cloud view in the lower left of your IDE (OEPE) and right click on Tasks and select Activate. Right click on Open tasks in the tree and select Activate and expand it to see the task you just created in the ODCS Web Dashboard browser. 5. There are various ways to work with tasks so now within your IDE as opposed to working within the Oracle Cloud view in the bottom left corner of OEPE, let s take a look at the Task List in the upper right corner of OEPE beneath Resources. Expand the Open tree table if needed.
6. Right click on the Create web methods create, update, and delete. and select Activate to activate the task. 7. Open the ContactsService.java object within the Project Explorer in OEPE and add the web methods create, update, and delete. The ContactsService.java object is located within the tree structure src main java services. Copy the following code and paste it into the ContactsService.java object and be sure to save your work. Note: In a real development scenario you may want to create a branch that you could add your code to and once validated, merge that code back into master. Also, be sure to save you work periodically. @WebMethod public void createcontact() { return; } @WebMethod public void updatecontact() { return; } @WebMethod public void deletecontact() { return; }
8. Your code should now look like the following: 9. Now that you have added the methods as requested within the task that you created, you can commit your changes to the local Git repository and then push your changes to the remote repository. This can be done in one step within OEPE. Right select on the ContactsService.java object within the Project Explorer and select Team Commit. You will see a dialogue that asks you to Please identify yourself. Provide appropriate information for Name and User e-mail and select the ok button. You can update the Commit message or go with the default as preferred. Select the Commit and Push button to commit and push your changes to the remote repository.
10. You will receive a dialogue with the results of the commit / push operation. Select the ok button to exit the notification. 11. Now that you ve committed and pushed your changes to the Git repository, you need to update the task. Right click on the task in the Task List within OEPE and select Open. This opens the task within OEPE so that you can update it as resolved. Add a new comment such as Method for create, update, and delete have been added in the ContactsService.java object. This task is now complete. Select the radio button Resolve as and select FIXED from the list-of-values. Select the Submit button to update this task. 12. Now that this task has been completed, you can Right click on the task within the Task List tab in OEPE and select to deactivate the task. This will strike through the task as deactivated and complete.
13. Go back to you ODCS Web Dashboard browser. Select the Dashboard tab to see the new activity stream with the updates for the previous task. 14. Select the Browse Tab followed by the View Commits link. 15. Select the ContactsService.java object to see a diff of the changes you ve made.
16. Let s create one more task to update a jsp page. This time, let s create the task from within the IDE (OEPE). Within the Oracle Cloud view, in the lower left corner of your IDE (OEPE), Right click on Tasks and select New Task. 17. Provide the following details for the new task: Name: Update index.jsp with new message or something similar Due Date: Set it to the current date Estimated Time: 1hr Description: Enter some descriptive text Assignee: Assign this task to yourself Once you are done filling in the details of this task, select the Submit button.
18. As before you can go back to your ODCS Web Dashboard browser and select the Dashboard tab to see the activity and that the new task has synchronized with ODCS. 19. Activate the task in your IDE (OEPE) by Right clicking on the task in Task List and selecting Activate. 20. Now open index.jsp and add some updated message to the page. index.jsp can be found in your Project Explorer within your IDE (OEPE) in the following location src main webapp. 21. Your index.jsp page should resemble the following:
22. Be sure to save your work and Right click on index.jsp in your IDE (OEPE) Project Explorer view and select Team Commit. 23. Update the Commit message if you prefer and select the Commit and Push button. 24. You will see the results of the Commit and Push operation in a dialogue once complete. Select the OK button to exit.
25. You should still have the task open so select the Update index.jsp with new message tab. If it s not open you can right click on the task in Task List and select open. Update the task with a New Comment and an action of Resolve as and select Fixed from the list-of-values. Select the Submit button to update the task. 26. Deactivate the task as before by Right clicking on the task in the Task List and selecting Deactivate. 27. This will strike through the task as deactivated and complete.
28. You can now go back to your ODCS Web Dashboard browser and select the Dashboard tab to see the most recent activity. Likewise you can follow the steps earlier in this lab to perform a diff on index.jsp to see the changes you ve made. Step 4: Create a new branch within the Git repository within your IDE (OEPE) and then create a new code review within your browser (ODCS Web Dashboard). 1. Within OEPE create a new code branch by expanding the Git repository (developer-oracletemplates_simple-soap-service.git) tree within the Oracle Cloud view and Right clicking on Branches and selecting Switch to New Branch. Note: Best practice here is to create a branch at the beginning of the project and this is where your code changes would occur. You would later merge that branch back into the master. This would also allow you to add code comments during the Code Review, which is a feature not covered in this lab. 2. Provide a name for your branch such as crudbranch. Select Configure upstream for push and pull. Go with defaults for the rest of the options and select the Finish button.
3. Push the newly created branch to the remote repository by Right clicking on the crudbranch within your Oracle Cloud view in your IDE (OEPE) by expanding Branches Local and selecting Push. For Branch name provide crudbranch. Go with the defaults for the rest of the options and select the Next button to continue. 4. Go with the defaults for Push Confirmation and select the Finish button. 5. Review the results of the Push operation and select the OK button to exit.
6. You can see that you created the remote branch by looking at the Oracle Cloud view within your IDE (OEPE) and expanding the Remote Tracking item under Branches. 7. Now that you ve created a branch, let s create a code review within ODCS Web Dashboard browser. Select the Reviews tab. In the Reviews tab select the New Review button. 8. Enter the following details or similar in the Code Review form and select the Create button. Submitter by default will be the creator of the code review Repository: developer-oracletemplates_simple-soap-service.git Review Branch: crudbranch Target Branch: master Summary: Code Review of new web methods and index.jsp Reviewers: Add yourself. Note: You would generally add other team members. Description: Add some descriptive text
9. Team members that you ve added to this code review would now receive messaging (email) that they ve been asked to collaborate in a code review on the project. They can Approve or Reject the code review and provide descriptive text to support their decision. Browse the code changes if desired by going to the objects modified in the Git repository via the Browse tab. At this point, go ahead and Approve the code review by selecting the Approve button and provide an appropriate description of the approval. Select the OK button. Note: As state above, if this Code Review was taking place on a branch created where the code changes occurred, you would be able to add comments on the code in the Code Review as opposed to just top-level comments on the overall Code Review. 10. Select the Complete button to complete the code review. 11. Select the Yes button to mark the code review complete. No further updates will be permitted for the review. 12. As before, you can navigate back to the Dashboard tab within the ODCS Web Dashboard browser and see the recent activity which includes the code review.
Step 5: Build the OOW Contacts SOAP Service project. 1. To build the OOW Contacts SOAP Service project go to the Build tab on the ODCS Web Dashboard browser. 2. In the project creation from template at the beginning of this lab the Hudson build job was created for you. It was actually copied from the Simple SOAP Service template. You can see that the OOW Contacts SOAP Service project has successfully built by the green icon in the first row of the table. 3. You can build this project again by simply selecting the icon to Schedule a build which is the last column of the first row of this table. 4. The project is queued up in the Build Queue and once a Build Executor is available, the project begins the build process.
5. Select the Build History link to view the history of the builds for your project and to see the results of your most recent build. 6. Select the link for the most recent build, in this example contacts-build #5, to see all the details for this build including the ability to rebuild the project, further configure the Hudson build job, edit the description, etc
Step 6: Deploy the OOW Contacts SOAP Service project to the Oracle Java Cloud Service (OJCS) SaaS extension. 1. In order to deploy the OOW Contacts SOAP Service project that you just built, select the Deploy tab in the ODCS Web Dashboard browser. 2. Select the New Configuration button to create a new deployment configuration and provide the following configuration details. Configuration Name: contacts Application Name: contacts Java Service: jcs1 Type: On Demand Job: developer-oracletemplates_oow-contacts-soap-service.contacts-build Build: Select your most recent successful build. Artifact: contacts/target/contacts.war Once you ve completed the New Deployment Configuration select the Save and Deploy button.
3. Once you select the Save and Deploy button your project will be saved and deployed to OJCS and you can view the status of your configuration creation and deployment. 4. Select the Java Service link oracletemplates/jcs1. 5. Sign in to your OJCS using the credentials provided by your lab instructor if you are prompted to log in.
6. Once authenticated, the OJCS Control is launched in the browser. Explore the various panel boxes within the OJCS Control dashboard. 7. Select the contacts application in the Applications panel box on the top right of the OJCS Control Dashboard. 8. Select the Application URL link to launch a test jsp page that is part of the OOW Contacts SOAP Service project.
9. You now see the test jsp page for your project that has been successfully built and deployed from ODCS to OJCS. Summary In this tutorial you created an ODCS project from template. You learned how to: Work with ODCS and the various features provided within the dashboard Connect to your ODCS instance from within your IDE (OEPE) Clone a project from ODCS and import it into your IDE (OEPE) Created tasks within ODCS and resolve those tasks within your IDE (OEPE) Commit / push your contacts project code updates to the Git repository within ODCS Created a Code Review Built your project with Hudson Continuous Integration in ODCS Deployed your contacts application to OJCS To learn more about using ODCS, refer to the product page: https://cloud.oracle.com/developer