Can any code access RTC30 project configuration data
We are extending the RTC30 client. Part of our custom code requires some configuration data. One example might be the location of our simulation test repository. So it's nothing related to the process.
It appears you can extend the configuration using extensions for the configuration data (i.e. com.ibm.team.process.service.configurationPoints).
Question: Is it possible to for any code to access the project area's configuration? We would want the client code to have access at any time ... not necessary as part of a server operation like saving a defect.
Some of my reading (https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide) appeared to indicate only code that extended IOperationAdvisor could access the configuration data.
It appears you can extend the configuration using extensions for the configuration data (i.e. com.ibm.team.process.service.configurationPoints).
Question: Is it possible to for any code to access the project area's configuration? We would want the client code to have access at any time ... not necessary as part of a server operation like saving a defect.
Some of my reading (https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide) appeared to indicate only code that extended IOperationAdvisor could access the configuration data.
7 answers
We are extending the RTC30 client. Part of our custom code requires some configuration data. One example might be the location of our simulation test repository. So it's nothing related to the process.
It appears you can extend the configuration using extensions for the configuration data (i.e. com.ibm.team.process.service.configurationPoints).
Question: Is it possible to for any code to access the project area's configuration? We would want the client code to have access at any time ... not necessary as part of a server operation like saving a defect.
Some of my reading (https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide) appeared to indicate only code that extended IOperationAdvisor could access the configuration data.
Another way that you can get configuration data information is via the ProcessService, chich has a getConfigurationElements method and getServerProcess method(IServerProcess has a get getProjectConfigurationData method).
Question: Is it possible to for any code to access the project area's configuration? We would want the client code to have access at any time ... not necessary as part of a server operation like saving a defect.
You can access configuration data on either the client or the server.
Thomas is right about the server API:
IServerProcess serverProcess = IProcessServerService.getServerProcess(processArea);
IProcessConfigurationData config = serverProcess.getProjectConfigurationData(id);
There is also a corresponding client API:
IProcessClientService processClient = IProcessClientService.getClientProcess(processArea, monitor);
IProcessConfigurationData config = processClient.getProjectConfigurationData(id, monitor);
Hope that helps,
- Jared
Thomas and Jared, I was able to use the client api to get an existing work item configuration data:
But when I specify the id from my custom configuration data using the staticConfigurationData extension, it returns null:
On the server side, the plugin.xml that was generated from using the extension point is:
The schema that it references is the following:
When I open the project, the ProcessConfiguration tab shows the ProjectConfiguration->ConfigurationData->HDWB Configuration->HDWB Project Configuration Data (unconfigured). So my category and staticConfigurationData extensions are showing.
I'm guessing the null pointer is because it is showing as unconfigured. How do I configure the values and should the editor be able to show the two string values for editing?
IProcessConfigurationData config = processClient.getProjectConfigurationData("com.ibm.team.workitem.configuration.workItemTypes", monitor);
But when I specify the id from my custom configuration data using the staticConfigurationData extension, it returns null:
IProcessConfigurationData config = processClient.getProjectConfigurationData("com.ibm.hdwb.jfs.configuration.staticHdwbProjectConfigurationData", monitor);
On the server side, the plugin.xml that was generated from using the extension point is:
<plugin>
<extension point="com.ibm.team.process.service.configurationPoints">
<staticConfigurationData categoryId="com.ibm.hdwb.jfs.configuration.hdwb"
id="com.ibm.hdwb.jfs.configuration.staticHdwbProjectConfigurationData"
name="HDWB Project Configuration Data"
schema="schema/hdwbProjectConfiguration.xsd">
</staticConfigurationData>
<category
id="com.ibm.hdwb.jfs.configuration.hdwb"
name="HDWB Configuration">
</category>
</extension>
</plugin>
The schema that it references is the following:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://com.ibm.hdwb.jfs.configuration/hdwbProjectConfiguration"
targetNamespace="http://com.ibm.hdwb.jfs.configuration/hdwbProjectConfiguration"
xmlns:process="http://com.ibm.team.process"
attributeFormDefault="unqualified" elementFormDefault="qualified">
<xsd:import namespace="http://com.ibm.team.process"
schemaLocation="platform:/plugin/com.ibm.team.process.common/schema/ProcessSettings.xsd"/>
<xsd:complexType name="hdwbProjectConfiguration">
<xsd:complexContent>
<xsd:restriction base="process:configurationDataType">
<xsd:attribute name="hdwbProjectLocation" type="xsd:string" use="required"/>
<xsd:attribute name="hdwbProfileLocation" type="xsd:string" use="required"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="configuration-data" substitutionGroup="process:configuration-data" type="hdwbProjectConfiguration"/>
</xsd:schema>
When I open the project, the ProcessConfiguration tab shows the ProjectConfiguration->ConfigurationData->HDWB Configuration->HDWB Project Configuration Data (unconfigured). So my category and staticConfigurationData extensions are showing.
I'm guessing the null pointer is because it is showing as unconfigured. How do I configure the values and should the editor be able to show the two string values for editing?
Thomas and Jared, I was able to use the client api to get an existing work item configuration data:IProcessConfigurationData config = processClient.getProjectConfigurationData("com.ibm.team.workitem.configuration.workItemTypes", monitor);
But when I specify the id from my custom configuration data using the staticConfigurationData extension, it returns null:
Looks like everything is working as expected so far. The API you're calling returns to you the configuration that exists in the Process XML. If there's no configuration, the API returns null.
To test, you can manually provide some XML configuration in the "Process Configuration Source" tab. For real users, you would probably want to provide a GUI editor for your configuration data. There is an Eclipse client extension point for this. See https://jazz.net/wiki/bin/view/Main/ProcessAspectEditorCreation
- Jared
Jared, thanks.
I manually entered some XML configuration data as you suggested and proved I could read it from the client. In addition, I went through the link you sent me and I've got at least a start of an editor that is brought up when I select my custom attribute.
One other question:
I've been stepping through code in the "Work Items -> AttributeCustomization" to model my custom configuration code after what you are doing. However, I noticed code related to AttributeValueProvider descriptors, registry, and IValueProvider interfaces. I also read http://jazz.net/library/article/537. It appears the article only applies to workItem customization. If that is true, is there some other documentation or interface I should follow to handle getting values from my IConfiguration?
I manually entered some XML configuration data as you suggested and proved I could read it from the client. In addition, I went through the link you sent me and I've got at least a start of an editor that is brought up when I select my custom attribute.
One other question:
I've been stepping through code in the "Work Items -> AttributeCustomization" to model my custom configuration code after what you are doing. However, I noticed code related to AttributeValueProvider descriptors, registry, and IValueProvider interfaces. I also read http://jazz.net/library/article/537. It appears the article only applies to workItem customization. If that is true, is there some other documentation or interface I should follow to handle getting values from my IConfiguration?