Search in sources :

Example 1 with ResourceAddedEvent

use of org.uberfire.workbench.events.ResourceAddedEvent in project kie-wb-common by kiegroup.

the class ResourceAddedEventAdapter method toSocial.

@Override
public SocialActivitiesEvent toSocial(Object object) {
    ResourceAddedEvent event = (ResourceAddedEvent) object;
    SocialUser socialUser = socialUserRepositoryAPI.findSocialUser(event.getSessionInfo().getIdentity().getIdentifier());
    String additionalInfo = "Added";
    String description = getCommitDescription(event);
    return new SocialActivitiesEvent(socialUser, HomePageTypes.RESOURCE_ADDED_EVENT.name(), new Date()).withLink(event.getPath().getFileName(), event.getPath().toURI()).withAdicionalInfo(additionalInfo).withDescription(description);
}
Also used : SocialUser(org.ext.uberfire.social.activities.model.SocialUser) ResourceAddedEvent(org.uberfire.workbench.events.ResourceAddedEvent) SocialActivitiesEvent(org.ext.uberfire.social.activities.model.SocialActivitiesEvent) Date(java.util.Date)

Example 2 with ResourceAddedEvent

use of org.uberfire.workbench.events.ResourceAddedEvent in project kie-wb-common by kiegroup.

the class ResourceAddedEventAdapter method isASystemEvent.

private boolean isASystemEvent(Object _event) {
    ResourceAddedEvent event = (ResourceAddedEvent) _event;
    final String user = event.getSessionInfo().getIdentity().getIdentifier();
    if (user.equalsIgnoreCase("system") || user.equalsIgnoreCase("<system>")) {
        return true;
    }
    return false;
}
Also used : ResourceAddedEvent(org.uberfire.workbench.events.ResourceAddedEvent)

Aggregations

ResourceAddedEvent (org.uberfire.workbench.events.ResourceAddedEvent)2 Date (java.util.Date)1 SocialActivitiesEvent (org.ext.uberfire.social.activities.model.SocialActivitiesEvent)1 SocialUser (org.ext.uberfire.social.activities.model.SocialUser)1