on 11-22-2007 9:39 AM
Hello, I am doing a repository service that needs to be configurable from the SystemAdministration>systemConfiguration>contentManagement>RepositoryService Menu at the portal, just like all the standard repository services that I can see there..¿Is it possible?
I have tried with the service-profile tag in the portalapp.xml (like with the IViews), but it does not work..I have also tried with the *.co.xml and *.cc.xml, but I do not know the structure of the xml nor the tags to use...
Finally I do not know how to access to the service properties declared, in my code...
thanks
Hi,
After you created repository service you can add attribute in cc.xml file:
<ConfigClass name="com.epam.test.repservice.MyRepositoryService" extends="RepositoryService">
<attribute name="class" type="class" constant="com.epam.test.repservice.MyRepositoryService"/>
<attribute name="myattr1" type="string" />
</ConfigClass>
and in co.xml:
<Configurable configclass="com.epam.test.repservice.MyRepositoryService">
<property name="name" value="com.epam.test.repservice.MyRepositoryService" />
<property name="active" value="true" />
<property name="description" />
<property name="myattr1" value="myvalue1" />
</Configurable>
It's an example of getting properties:
protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
try {
Properties props = convertConfigToProperties(config);
if(props!=null) {
Set keys = props.keySet();
for(Iterator it = keys.iterator(); it.hasNext(); ) {
Object key = it.next();
Object value = props.get(key);
System.out.println("key = " + key + " value = " + value);
}
}
}
catch (Exception e) {
throw new StartupException(e.getMessage(), e);
}
}
Also you can add some debug in reconfigure(IConfiguration config) method and see your properties.
Regards,
Andrei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.