Package org.nuxeo.ecm.activity

Examples of org.nuxeo.ecm.activity.ActivityBuilder


    private Activity createActivity(Principal principal,
            SocialWorkspace socialWorkspace, RelationshipKind kind,
            boolean addContext) {
        String socialWorkspaceActivityObject = ActivityHelper.createDocumentActivityObject(socialWorkspace.getDocument());
        return new ActivityBuilder().actor(
                ActivityHelper.createUserActivityObject(principal.getName())).displayActor(
                ActivityHelper.generateDisplayName(principal)).verb(
                kind.toString()).object(
                ActivityHelper.createDocumentActivityObject(socialWorkspace.getDocument())).displayObject(
                socialWorkspace.getTitle()).target(
View Full Code Here


    }

    @Override
    public MiniMessage addMiniMessage(Principal principal, String message,
            Date publishedDate, String contextActivityObject) {
        Activity activity = new ActivityBuilder().actor(
                ActivityHelper.createUserActivityObject(principal)).displayActor(
                ActivityHelper.generateDisplayName(principal)).verb(VERB).object(
                message).publishedDate(publishedDate).context(
                contextActivityObject).build();
        activity = getActivityStreamService().addActivity(activity);
View Full Code Here

            activity.setDisplayTarget(oldDisplayActor);
            activity.setContext(oldDisplayActor);
            em.merge(activity);

            // Store activity without context
            Activity newActivity = new ActivityBuilder(activity).context(null).build();
            em.persist(newActivity);
        }
    }
View Full Code Here

    protected void addMakeDocumentPublicActivity(DocumentModel doc,
            Principal principal) {
        String socialWorkspaceActivityObject = ActivityHelper.createDocumentActivityObject(socialWorkspace.getDocument());
        ActivityStreamService activityStreamService = Framework.getLocalService(ActivityStreamService.class);
        Activity activity = new ActivityBuilder().verb(
                MAKE_DOCUMENT_PUBLIC_VERB).actor(
                ActivityHelper.createUserActivityObject(principal)).displayActor(
                ActivityHelper.generateDisplayName(principal)).object(
                ActivityHelper.createDocumentActivityObject(doc)).displayObject(
                ActivityHelper.getDocumentTitle(doc)).target(
View Full Code Here

        }
    }

    protected void addNewRelationActivity(String actorActivityObject,
            String targetActivityObject, RelationshipKind relationshipKind) {
        Activity activity = new ActivityBuilder().actor(actorActivityObject).displayActor(
                Functions.userFullName(ActivityHelper.getUsername(actorActivityObject))).verb(
                relationshipKind.getGroup()).object(targetActivityObject).displayObject(
                Functions.userFullName(ActivityHelper.getUsername(targetActivityObject))).build();
        Framework.getLocalService(ActivityStreamService.class).addActivity(
                activity);
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.activity.ActivityBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.