Package org.zanata.model

Examples of org.zanata.model.Activity


    public void testNewReviewActivityInserted() throws Exception {
        activityService.logTextFlowStateUpdate(new TextFlowTargetStateEvent(
                personId, versionId, documentId, null, new LocaleId("as"),
                textFlowTargetId, ContentState.Approved,
                ContentState.NeedReview));
        Activity activity =
                activityService.findActivity(personId,
                        EntityType.HProjectIteration, projectVersionId,
                        ActivityType.REVIEWED_TRANSLATION, new Date());
        assertThat(activity, not(nullValue()));
        assertThat(activity.getEventCount(), equalTo(1));
    }
View Full Code Here


        activities =
                activityService.findLatestActivitiesForContext(personId,
                        projectVersionId, 0, 10);
        assertThat(activities.size(), equalTo(1));

        Activity activity =
                activityService.findActivity(personId,
                        EntityType.HProjectIteration, projectVersionId,
                        ActivityType.REVIEWED_TRANSLATION, new Date());
        assertThat(activity.getEventCount(), equalTo(2));
    }
View Full Code Here

        activityService.logTextFlowStateUpdate(new TextFlowTargetStateEvent(
                personId, versionId, documentId, null, new LocaleId("as"),
                textFlowTargetId, ContentState.Translated,
                ContentState.NeedReview));

        Activity activity =
                activityService.findActivity(personId,
                        EntityType.HProjectIteration, projectVersionId,
                        ActivityType.UPDATE_TRANSLATION, new Date());
        assertThat(activity, not(nullValue()));

        Long id = activity.getId();

        activityService.logTextFlowStateUpdate(new TextFlowTargetStateEvent(
                personId, versionId, documentId, null, new LocaleId("as"),
                textFlowTargetId, ContentState.NeedReview, ContentState.New));

        activity =
                activityService.findActivity(personId,
                        EntityType.HProjectIteration, projectVersionId,
                        ActivityType.UPDATE_TRANSLATION, new Date());
        assertThat(activity.getId(), equalTo(id));
    }
View Full Code Here

    private void logActivityAlreadyLocked(long actorId,
            IsEntityWithType context, IsEntityWithType target,
            ActivityType activityType, int wordCount) {
        if (context != null && activityType != null) {
            Date currentActionTime = new Date();
            Activity activity =
                    findActivity(actorId, context.getEntityType(),
                            context.getId(), activityType, currentActionTime);
            if (activity != null) {
                activity.updateActivity(currentActionTime, target, wordCount);
            } else {
                HPerson actor = personDAO.findById(actorId);
                activity =
                        new Activity(actor, context, target, activityType,
                                wordCount);
            }
            activityDAO.makePersistent(activity);
            activityDAO.flush();
        }
View Full Code Here

TOP

Related Classes of org.zanata.model.Activity

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.