- IBM Rational Team Concert 2 Essentials
- Suresh Krishna TC Fenstermaker
- 2476字
- 2021-04-09 22:07:48
As we've seen in previous chapters, Rational Team Concert represents a software project as a Project Area. The project area defines the project deliverables, team structure, process, schedule, and more. A project area is stored as a top-level or root item in a repository and references project artifacts and stores the relationships between these artifacts. Access to a project area and its artifacts is controlled by permissions.
Similar to what we did when importing the JUnit sample project in the previous chapter, we are going to create a project area, only this time for the BookManager Application. Log in to the Rational Team Server as administrator. This can be done either from the Team Server web application or from the Rational Team Concert client. In the web application, go to Project Area Management from the main toolbar and create a new project area by clicking Create Project Area. Remember that a project area cannot be deleted from the repository; however, it can be archived, which places it in an inactive state.

At the time of creating the project area, we would need to enter some important attributes of the project, as follows:
- Project Name: This is the name key that will be used throughout the system.
- Process Template: Select the process template that our team uses.
- Members: Select the team members of the team for this project. We can select the users from the global list provided by the Rational Team Server.
- Administrator: Remember to add an administrator to the project, which enables the administrator to add permissions, roles, and so on.
Once we click on the Save button, it takes a few minutes for the team server to create the project area. As an administrator, we can also tweak into the timelines, roles, permissions, and access control.
Once the project area is created, the Rational Team Server prompts us if we would like to send the project invitations to the new users as shown in the next screenshot:

Once we select the users and confirm to send the invitations, we will be prompted to review the team invitation that is generated by the Rational Team Server.

With this, the process of setting up the BookManager Project team area is complete. Now go to the Rational Team Concert's client, navigate to Team Artifacts view, and right-click to add a new project area as shown in the following screenshot:

In the next step, we will import the SVN
dump file into the Rational Team Concert.
In this section, we will see different steps to import the source code from the subversion to the Rational Team Server. Assume that the code is being developed and versioned in subversion. It is assumed that the administrator has already created the subversion dump file and it is available for use. We can download the project dump file and other source code from the Packt Publishing website.
In the first phase, we specify the subversion dump file and destination, which is a component in a repository workspace. In the second phase, the importer opens the dump file and displays the folders that can be selected for import and a list of subversion user names that we can map to Rational Team Server users.
Importing the subversion dump file is done from the Rational Team Concert client. From the client, open File | Import, as shown in the following screenshot:

In the Import dialog, select the Jazz Source Control | SVN Dump File and click on Next. Notice that we could also import the Change Set Archive and ClearCase Stream or Branch into the Rational Team Server repository, as shown next:

Select the dump file by navigating and selecting the appropriate file through the Browse button. Optionally, to save a compressed dump file, select Save a compressed version of the dump file for additional imports, as shown next:

Create a new repository workspace and new component by selecting Create a new repository workspace named: and type a name for the new workspace. The import creates a new workspace and component. The component has the same name as the workspace, as shown next:

To specify a baseline name in the Post Import Baseline Name field, type a new baseline name. To generate baselines for branch and tag points, select Create baselines for branch and tag points. To specify a text file encoding in the text file encoding pane, select Other in the drop-down list, select an encoding type. To reconcile existing and imported files, select Reconcile any overlap between existing imported files and folders. To specify a revision range to import, in the Revisions to import pane, select Import all revisions within the specified range; in the Start Revision and End Revision fields, specify the revision range as shown next:

The following screenshot lets us map the SVN
users to Jazz Users. Rational Team Concert allows us to choose how we want to map the users, as follows:
- Prompt for Jazz users once the SVN user IDs are discovered: When we want to defer the mapping of usernames until the
SVN
usernames are discovered. - Do not map SVN users to Jazz users: When we do not want any relation between SVN users to Rational Team Server users.
- Automatically map SVN users to Jazz users with the same id and create any missing users: When we want automatic discovery of the usernames and we want Rational Team Server to create any missing usernames automatically.
- Use the mappings entered below: When we know exactly which SVN usernames map to Rational Team Server users.
- If we are not sure of the structure of the subversion repository, select Prompt to determine what folders to import when the SVN repository folder structure is known.
- To import a path as a top-level folder in the target component, select Import the paths specified below as top-level folders in the target component. To add a path, click on Add Path, and in the Add Path dialog box, type the path name in the Path field and click on OK. To load a set of paths saved to a file, click on Load and navigate to the file. To save the file to a specified location, click on Save.
- To import a path as a component root, select Import the path specified below as the root of the component. To edit a path, select it and then click on Edit. In the Path field of the Edit dialog, change the path and click on OK.
We have the complete project directly under the SVN
trunk, so choose to Import the path specified below as the root of the component, as shown in the following screenshot:

Rational Team Concert reads the complete SVN
dump file, discovers the users, and asks us which source folders to import. As we have the complete project under the top-level, click on Add Projects, as shown next:

Now, the user IDs from the SVN
dump file are discovered and Rational Team Concert displays the users. Notice that there are two user IDs, and one SVN user ID is already mapped to a Jazz user ID, as shown next:

For the other SVN
user ID (smadhuvarsu), which does not have the corresponding Jazz user ID, select the respective Jazz user ID and click on Finish. This completes the SVN dump import.

Rational Team Concert's team has imported the complete SVN
dump (read the usernames) and read the source code and revisions. This provides a seamless experience when working with team server source control. The Team Artifacts view shows an overview of the project as shown in the next screenshot. However, we need to do a few things first to be able to work with it, which are as follows:
- The BookManager project component is added to the Components under the My Repository Workspaces.
- The BookManager project repository is added to the My Repository Workspaces.
Once the project area, repository, and components are set up, it's time to load the source code and work on it. We import the source code by selecting the component from Repository Workspace, right-clicking, and selecting Load….

The Load... action invokes a wizard that gives us a choice of how we would like to load the projects. As we have an Eclipse project, select Find and load Eclipse projects. Components, that are not developed as Eclipse projects can be imported and set up from the root folders as shown next:

The wizard lists all the available projects from the root
directory of the repository. We can select the appropriate project and optionally select where the source code should be imported.

Once the import source code is finished, the component is loaded and the source code is visible in the Package Explorer.

Now that we have the code from the BookManager project, let's look at how the source code is organized. This section serves to give an introduction and overview of the application and the technologies used.
The BookManager source is comprised of servlets and JSPs, as well as some Java beans for persistence. These operate in the Apache Struts and Hibernate frameworks; therefore, we also have the libraries needed for these along with the configuration files that tell these components how to work together. The building and packaging is done using ANT, a popular, robust open source build system available from the Apache Project. The build.xml
file controls this build process.
These sources in turn are organized in packages, as shown in the following screenshot of the Package Explorer in Rational Team Client:

Each package is represented by a directory under src and contains the following:
- admin: A command-line administrative utility that allows one to create user accounts (both administrative and non-administrative), as well as the full Derby database schema, populated with demo data.
- client.action: It has the
Struts ActionServlet
classes containing the requiredexecute()
method, that perform the business logic for each user-generated action. - client.interceptor: It has the interceptor classes for log in and log out. It always validates for an authenticated session.
- client.jsp: It has all the JSP pages responsible for the UI representation on the client.
- lib: It has the library files necessary for all the third-party utilities we use, including Derby, Hibernate, and Struts.
- resources.hibernate: It has the
Hibernate config
file for the database connection and also thedomain mapping
file for theBook
entity. - resources.web: It has the resources such as
web.xml
,struts.xml
, andstyle.css
that are needed to deploy as a web application. - server.beans: It has the domain objects, implemented as simple Java beans with the required getters and setters.
- server.services: It has the Hibernate persistence utilities that handle the connections, CRUD functions, and so on.
Now that we've imported the source, we're ready to build, deploy, and execute the finished application.
From the Rational Team Concert client, go to External Tools | External Tools Configuration and create a new Ant Build configuration. Remember to use the same build file defined on the project (called, by convention, build.xml
). The build file is available on the project root of the client.

Once the Ant Build configuration is set up, add the configuration to the External Tools' Favorite menu, and run the BookManager_AntBuild configuration, which compiles the sources and creates both the standalone admin.jar
(for the command-line administrative utility) and an application WAR file that can be deployed to any standard servlet container.

The bookmanager-admin.jar
file is an executable JAR that provides a simple command-line administrative interface for managing the database and users for the BookManager application. There are options to create and list users, and assign them administrative roles. It can also be used to populate the database schema with sample data from the comma-separated value (csv) file created during the build.
Before we run the web-based application, let's use the bookmanager-admin.jar
to create some administrative and non-administrative users, and populate the database with sample data. Copy the bookmanager-admin.jar
and samplebooks.csv
files created from the BookManager build to the <tomcatHome>/bin
directory. Open a command prompt and go to <tomcatHome>/bin
. We assume that the java path is already set and we can run java from the command line. To create a user, enter the following command line:
java -jar bookmanager-admin.jar adduser <username> <password> <usertype>
Select the username of our choice, and a password that will be SHA encrypted. If we wish to make this user an administrator, enter "admin" for the usertype; otherwise enter "user."
If the BookManager database doesn't already exist, bookmanager-admin.jar
will first create the necessary Derby files and schema, before adding the user.
We can use this utility to add as many administrative and non-administrative users as we like.

To see a list of existing users, along with their SHA encrypted password and their role, enter java -jar bookmanager-admin.jar listusers
as shown next:

To populate the database with sample data, enter the following:
java -jar bookmanager-admin.jar popdb ./samplebooks.csv.

We're now ready to deploy the generated WAR file to any standard servlet container. In our case, we will use Apache Tomcat.
- Start the Tomcat server using the appropriate Tomcat utility. Make sure that this is a separate instance from the Rational Team Server, listening on a different port.
- Go to Management console. If we deployed Tomcat on 8080, browse to
http://localhost:8080/manager/html.
- Select the WAR file generated by the build and click on Deploy.
- Once the application is deployed, we can access the application by browsing to
http://localhost:8080/BookManager/welcome.jsp.
If we log in as an admin user, the Welcome screen enables us to add, modify, delete, and list the books. Each time we add a new book, the application automatically redirects us to the List View action. Every screen in the application displays the current username and a logout facility.

All the actions in the application are represented by the breadcrumb widget, and as a user, we know exactly how to get to the Home screen. Try using the Add Books action to put more books in the database; we will see a simple web form with basic information about the book. Clicking Add will execute the appropriate Struts action, and save our new book in the Derby database, Hibernate. It should then appear on the list of books.

In the next chapters of this book, we will test the BookManager application and enhance it using Rational Team Concert client and server. In particular, we will get introduced in depth to various aspects of team server, collaboration, work items, planning, builds, and release management.
- Joomla! 1.5 Site Blueprints
- AutoCAD 2020中文版從入門到精通(標準版)
- Adobe創意大學InDesign CS5 版式設計師標準實訓教材
- UG NX 完全實例解析
- 新編AutoCAD制圖快捷命令速查一冊通
- UI功夫:PC和APP界面設計全流程圖解
- 中文版Dreamweaver基礎培訓教程
- Power Query從入門到精通
- 中文版3ds Max/VRay效果圖制作完全自學教程(實例培訓教材版)
- 中文版Photoshop CS6應用技法教程
- Building Websites with XOOPS : A step/by/step tutorial
- 中文版Photoshop CS5基礎培訓教程(移動學習版)
- Flash ActionScript 3.0互動設計項目教程
- 剪輯師寶典:視頻剪輯思維與案例實戰
- Adobe Illustrator CC 2019經典教程(彩色版)