You can export the results of a package or deployment query
to a CSV file so that you can sort, analyze, and save the results.
You can also create your own export utility to capture query data
in other formats.
About this task
Querying package results and deployed packages creates a
list of packages that were created from a particular package definition
or deployed packages that were deployed from a particular deployment definition.
To save your query results, complete the following steps.
Procedure
Exporting package query results
- From your project area in the Team Artifacts view,
select . Right-click your package
definition and select Show all packages. The Queried
Results view opens with the list of results.
- Right-click in the Queried Results view
and select Export.
- In the Export Query Result dialog,
select either CSV using commas or CSV
using tabs for the file format. Next, browse to the location
to store your file. Click OK. The exported
file includes a list of all the package result details that are listed
in the Queried Results view.
- Optional: Follow the Creating a customized exporter steps
to export to a different file format.
Exporting deployment query results
- From your project area in the Team Artifacts view, select . Right-click your deployment definition and select Query
Deployed Packages.
- In the Search for Deployed Packages dialog,
select a deployment definition, package definition, build agent, and
packages, then click OK. The Queried
Results view opens with a list of results.
- Right-click in the Queried Results view
and select Export.
- In the Export Query Result dialog,
select either CSV using commas or CSV
using tabs for the file format. Next, browse to the location
to store your file. Click OK. The exported
file includes a list of all the deployment result details that are
listed in the Queried Results view.
- Optional: Follow the Creating a customized exporter steps
to export to a different file format.
Creating a customized exporter
- Optional: To create a customized
exporter so that you can save results to different file formats, complete
the following steps.
- Create an Eclipse plug-in class and add com.ibm.team.enterprise.metadata.query.ui as
one of the dependencies. (Your environment might require extra Eclipse
plug-ins.)
- In the plugin.xml file, add an
extension for com.ibm.team.enterprise.metadata.query.result.exporter.
For example:
<extension
point="com.ibm.team.enterprise.metadata.query.result.exporter">
<exporter
class="com.ibm.team.enterprise.metadata.query.ui.tests.DummyExporter"
fileExtension="dummy"
id="com.ibm.team.enterprise.metadata.query.ui.tests.DummyExporter"
label="Dummy Exporter">
</exporter>
</extension>
- Create a class that implements com.ibm.team.enterprise.metadata.query.ui.export.IMetadataQueryResultExporter (...ui.tests.DummyExporter in
the previous example.)
- Optional: Use the new class to extend com.ibm.team.enterprise.metadata.query.ui.export.AbstractMetadataQueryResultExporter.
- Implement the required method:
serializeToStream(TableData
tableData, OutputStream out)
. For example:
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
for (ColumnHeader columnHeader: tableData.getColumnHeaders())
{
String columnName = columnHeader.getName();
writer.append(columnName); //output column name.
}
if (tableData.getColumnHeaders().size() > 0)
writer.append("\n");
for (Row row: tableData.getRows())
{
for (int col=0; col <tableData.getColumnHeaders().size(); col++)
{
writer.append(row.getColumnValue(col)); //output column value of each row
}
writer.append("\n");
}
writer.flush();
-
Create an update site to install the feature that contains your extended plug-in. (For more
information, see the related links of this topic.)
-
Install the feature from the update site and restart the Engineering Workflow
Management Eclipse
client.
- Run the package or deployment query again.
- From the Queried Results view,
right-click the package or deployment result you want to export and
select Export.
- From the Export Query Result dialog,
your custom exporter is now available in the File Format options.
Note: The customized file option that you create will also be
available for exporting source code data query results.