use of org.guvnor.structure.repositories.NewRepositoryEvent in project kie-wb-common by kiegroup.
the class NewRepositoryEventAdapter method toSocial.
@Override
public SocialActivitiesEvent toSocial(Object object) {
NewRepositoryEvent event = (NewRepositoryEvent) object;
SocialUser socialUser = null;
try {
socialUser = socialUserRepositoryAPI.findSocialUser(loggedUser.getIdentifier());
} catch (ContextNotActiveException e) {
// clean repository
socialUser = new SocialUser("system");
}
String additionalInfo = "Created";
return new SocialActivitiesEvent(socialUser, ExtendedTypes.NEW_REPOSITORY_EVENT, new Date()).withAdicionalInfo(additionalInfo).withLink(event.getNewRepository().getAlias(), event.getNewRepository().getUri()).withDescription("");
}
Aggregations