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.
|
Accepted answer
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
|
3 other answers
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. |
The document at https://jazz.net/wiki/bin/view/Main/ConfigurationStory shows how to declare your configuration properties:
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
but then there isn't any new custom properties at /jazz/admin#action=com.ibm.team.repository.admin.configureAdvanced... Any advice?
Thanks in advance.
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:
SEC Servizi
commented Aug 09 '13, 11:25 a.m.
Yes, the XML contains the providedService tag, too. It was the copy-paste to fail... -.- |
Sam, your interface is:
package com.xx.repository.service;
and your implementation class is:
package com.xx.repository.service;
If so, even the Java code seems like mine...
Comments sounds like your plugin did not load, cause you forgot to identify the service NAME
SEC Servizi
commented Aug 26 '13, 9:23 a.m.
You're right, I forgot to request the Jazz server reset...
Now it works, thanks!
|
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.