use of org.apache.syncope.common.lib.to.ConnInstanceTO in project syncope by apache.
the class TopologyTogglePanel method onEvent.
@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof AjaxWizard.NewItemFinishEvent) {
final AjaxWizard.NewItemFinishEvent item = AjaxWizard.NewItemFinishEvent.class.cast(event.getPayload());
final Serializable result = item.getResult();
final AjaxRequestTarget target = item.getTarget();
if (result != null && result instanceof ConnInstanceTO) {
// update Toggle Panel header
ConnInstanceTO conn = ConnInstanceTO.class.cast(result);
setHeader(target, StringUtils.abbreviate(conn.getDisplayName(), HEADER_FIRST_ABBREVIATION));
}
}
}
use of org.apache.syncope.common.lib.to.ConnInstanceTO in project syncope by apache.
the class ConnectorLogic method readByResource.
@PreAuthorize("hasRole('" + StandardEntitlement.CONNECTOR_READ + "')")
@Transactional(readOnly = true)
public ConnInstanceTO readByResource(final String resourceName, final String lang) {
CurrentLocale.set(StringUtils.isBlank(lang) ? Locale.ENGLISH : new Locale(lang));
ExternalResource resource = resourceDAO.find(resourceName);
if (resource == null) {
throw new NotFoundException("Resource '" + resourceName + "'");
}
ConnInstanceTO connInstance = binder.getConnInstanceTO(connFactory.getConnector(resource).getConnInstance());
connInstance.setKey(resource.getConnector().getKey());
return connInstance;
}
Aggregations