use of org.ligoj.app.api.ConfigurablePlugin in project ligoj-api by ligoj.
the class ServicePluginLocatorTest method getResourceTypeParent.
@Test
public void getResourceTypeParent() {
final ConfigurablePlugin resource = component.getResource(JiraBaseResource.KEY + ":any", ConfigurablePlugin.class);
Assertions.assertNotNull(resource);
Assertions.assertTrue(resource instanceof BugTrackerResource);
}
use of org.ligoj.app.api.ConfigurablePlugin in project ligoj-api by ligoj.
the class ServicePluginLocatorTest method getResourceType.
@Test
public void getResourceType() {
final ConfigurablePlugin resource = component.getResource(JiraBaseResource.KEY, ConfigurablePlugin.class);
Assertions.assertNotNull(resource);
Assertions.assertTrue(resource instanceof BugTrackerResource);
}
use of org.ligoj.app.api.ConfigurablePlugin in project ligoj-api by ligoj.
the class SubscriptionResource method getConfiguration.
/**
* Return tools specific configuration. Only non secured parameters are returned.
*
* @param id
* The subscription identifier.
* @return tools specific configuration.
* @throws Exception
* When the configuration gathering fails. Managed at JAX-RS level.
*/
@GET
@Path("{id:\\d+}/configuration")
@org.springframework.transaction.annotation.Transactional(readOnly = true)
public ConfigurationVo getConfiguration(@PathParam("id") final int id) throws Exception {
// Copy subscription details
final Subscription entity = checkVisibleSubscription(id);
final ConfigurationVo vo = new ConfigurationVo();
vo.setNode(NodeResource.toVo(entity.getNode()));
vo.setParameters(getNonSecuredParameters(id));
vo.setSubscription(id);
vo.setProject(DescribedBean.clone(entity.getProject()));
// Get specific configuration
final ConfigurablePlugin servicePlugin = locator.getResource(vo.getNode().getId(), ConfigurablePlugin.class);
if (servicePlugin != null) {
// Specific configuration is available
vo.setConfiguration(servicePlugin.getConfiguration(id));
}
return vo;
}
Aggregations