Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to add custom properties to config page?

We would add some custom properties in to the config page https://localhost/jazz/admin#action=com.ibm.team.repository.admin.configureAdvanced. Is it possible?
Thanks in advance.

0 votes


Accepted answer

Permanent link
here is one of mine exactly

<code>
   <extension point="com.ibm.team.repository.service.serviceProvider">
           <serviceProvider
             componentId="com.xx.remoterepository"
            implementationClass="com.xx.repository.service.RepositoryFileService">
                   <provides>
                    <providedService interface="com.xx.repository.service.IRepositoryFileService"/>
                   </provides>
                   <prerequisites>
                   <requiredService
                         interface="com.ibm.team.repository.common.internal.IRepositoryRemoteService">
                   </requiredService>
                  <configurationProperties >     
                       <configurationProperty
                           accessPolicy="OPEN"
                           default="128"                                                 
                           name="sfdc.VolumeSize"
                           description="Max size (in MegaBytes) of files to copy into the RTC repository"                           
                           displayableName="Maximum file size to copy"
                           required="true"
                           type="INTEGER"
                           updatePolicy="NO_RESTART_REQUIRED">
                       </configurationProperty>
                       <configurationProperty
                           accessPolicy="OPEN"
                           default="idrive"                                                 
                           name="sfdc.VolumePrefix"
                           description="the network share name of the Shared volume (FTP server)"                           
                           displayableName="FTP Volume Share name"
                           required="true"
                           type="STRING"
                           updatePolicy="NO_RESTART_REQUIRED">
                       </configurationProperty>                      
               </configurationProperties>                    
                </prerequisites>                              
               </serviceProvider>
   </extension>
</code>
SEC Servizi selected this answer as the correct answer

0 votes


3 other answers

Permanent link
you have to attach the properties to a plugin. I have created my own services, and added properties.

see

https://jazz.net/forum/questions/62690/need-a-service-a-client-can-call-to-get-server-parameters

and you can only retrieve them THRU the plugin they are attached to.

0 votes


Permanent link
The document at https://jazz.net/wiki/bin/view/Main/ConfigurationStory shows how to declare your configuration properties:

All configuration properties must be declared via extension point using the configurationProperties element. This element is nested within a prerequisites element. The prerequisites element is included in both serviceProvider elements as well as extensionService elements.

and how to consume your configuration properties:
As mentioned previously, configuration properties are owned by a particular service. When the activate method is called on a service, it can safely assume that all of its required configuration properties are accessible via protected methods on AbstractService. These methods are called get****ConfigProperty(propertyName)The stars are replaced with one of the four valid types(Integer, Long, Boolean, String)

We add the code below to our plugin.xml:
<extension
         point="com.ibm.team.repository.service.serviceProvider">
      <serviceProvider
            componentId="componentId"
            implementationClass="implementationClass">
            <provides>
            </provides>
         <prerequisites>
            <configurationProperties>
               <configurationProperty
                     accessPolicy="OPEN"
                     default="localhost"
                     description="HOSTNAME"
                     displayableName="HOSTNAME"
                     name="HOSTNAME"
                     required="true"
                     type="STRING"
                     updatePolicy="NO_RESTART_REQUIRED">
               </configurationProperty>
            </configurationProperties>
         </prerequisites>
      </serviceProvider>
   </extension>
but then there isn't any new custom properties at /jazz/admin#action=com.ibm.team.repository.admin.configureAdvanced... Any advice?
Thanks in advance.

0 votes

Comments

I tried using the code you pasted assuming that you don't actually have the <br> tags in the code. I see the following error in my log:

10:22:06,438 [Start Level Event Dispatcher] ERROR ository.common.transport.AbstractElementDescriptor  - Failed to process 'prerequisites' child named 'configurationproperties'
10:22:06,439 [Start Level Event Dispatcher] ERROR ository.common.transport.AbstractElementDescriptor  - The foo bundle's plugin.xml file contains a <provides> element that does not contain at least one nested element.
java.lang.IllegalArgumentException: The foo bundle's plugin.xml file contains a <provides> element that does not contain at least one nested element.


Have you looked at your application's logs for errors? My guess is that you will see the same error in there.

Change your <provides> tag to something like this and see if it works:

<provides>
    <providedService interface="interface">
    </providedService>
</provides>

Yes, the XML contains the providedService tag, too. It was the copy-paste to fail... -.-


Permanent link
Sam, your interface is: 
package com.xx.repository.service;
public interface IRepositoryFileService {
    //  ...
}
and your implementation class is:
package com.xx.repository.service;
import com.ibm.team.repository.service.AbstractService;
public class RepositoryFileService extends AbstractService implements IRepositoryFileService {
public RepositoryFileService() {
super();
}

@Override
public void activate() {
// ...
}
}
If so, even the Java code seems like mine... 

0 votes

Comments

sounds like your plugin did not load, cause you forgot to identify the service NAME

this is from yours                               
           
<provides>
           
</provides>


this from mine
            <provides>                <providedservice interface="com.xx.repository.service.IRepositoryFileService"/>            </provides>

You're right, I forgot to request the Jazz server reset...

Now it works, thanks!

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936
× 51
× 11

Question asked: Aug 07 '13, 8:39 a.m.

Question was seen: 10,195 times

Last updated: Oct 24 '13, 3:06 a.m.

Confirmation Cancel Confirm