Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.DomainGroup


     * @param id
     *            the id of the group to delete.
     */
    public void deleteById(final long id)
    {
        DomainGroup group = findById(id);
        getEntityManager().remove(group);

        getEntityManager().flush();
    }
View Full Code Here


        String groupCoordinatorQuery = "SELECT g FROM DomainGroup g WHERE g.id = :groupId";

        List<DomainGroup> groupCoordinatorResult = getEntityManager().createQuery(groupCoordinatorQuery)
                .setParameter("groupId", followingId).getResultList();

        DomainGroup group = groupCoordinatorResult.get(0);

        return !group.isPublicGroup();
    }
View Full Code Here

        String entityName = request.getParameter("entityName");

        if (type.equals("DomainGroup"))
        {
            DomainGroup group = groupMapper.findByShortName(entityName);

            if (group == null)
            {
                throw new ServletException("Group:  " + entityName + " not found");
            }

            if (groupCoordinatorMapper.hasGroupCoordinatorAccessRecursively(inName, group.getId()))
            {
                transMgr.commit(transStatus);
                return group;
            }

            throw new ServletException("User " + inName + " is not a coordinator of group:  " + group.getName());
        }

        else
        {
View Full Code Here

                                        insertedActivities.add(activityForIndividual);
                                    }
                                }
                                else if (feedSubscriber.getEntityType().equals(EntityType.GROUP))
                                {
                                    DomainGroup group = groupFinder.execute(new FindByIdRequest("DomainGroup",
                                            feedSubscriber.getEntityId()));

                                    activityForIndividual.setActorId(group.getShortName());
                                    activityForIndividual.setRecipientStreamScope(group.getStreamScope());
                                    activityForIndividual.setIsDestinationStreamPublic(group.isPublicGroup());

                                    activityForIndividual.setActorType(feedSubscriber.getEntityType());
                                    insertedActivities.add(activityForIndividual);
                                }
                            }
View Full Code Here

            throws ServletException
    {

        DomainGroupMapper groupMapper = (DomainGroupMapper) getSpringContext().getBean("jpaGroupMapper");

        DomainGroup group = groupMapper.findByShortName(request.getParameter("groupName"));

        if (group == null)
        {
            throw new ServletException("Group:  " + inName + " not found");
        }
View Full Code Here

    {
        try
        {
            ReviewPendingGroupRequest request = (ReviewPendingGroupRequest) inActionContext.getActionContext()
                    .getParams();
            DomainGroup group = groupMapper.findByShortName(request.getGroupShortName());
            final long groupId = group.getId();

            if (log.isInfoEnabled())
            {
                log.info((request.getApproved() ? "Approving" : "Disapproving") + " pending group '"
                        + request.getGroupShortName() + "' with id " + groupId);
            }

            notifyCoordinators(inActionContext, group, request);

            if (request.getApproved())
            {
                group.setPending(false);
                groupMapper.flush();
                if (!group.isPublicGroup())
                {
                    addPrivateGroupIdToCachedListMapper.execute(groupId);
                }
            }
            else
View Full Code Here

     *            {@link ActionContext}.
     */
    @Override
    public void validate(final ActionContext inActionContext)
    {
        DomainGroup group = findByIdDAO.execute(new FindByIdRequest("DomainGroup", ((Long) inActionContext.getParams())
                .longValue()));

        if (null == group)
        {
            throw new ValidationException("Attempt to delete group that is no longer present");
View Full Code Here

        // make sure the group is in cache
        assertNotNull(cache.get(CacheKeys.GROUP_BY_ID + "1"));
        assertNotNull(cache.get(CacheKeys.GROUP_BY_SHORT_NAME + "group1"));

        // update it
        final DomainGroup domainGroup = getEntityManager().find(DomainGroup.class, 1L);

        // invoke SUT
        domainGroupCacheLoader.onPostUpdate(domainGroup);

        // but should keep the lookup from ID -> short name, since it can't change
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    @Test
    public void testExecute()
    {
        final DomainGroup g = context.mock(DomainGroup.class);
        final Person p1 = context.mock(Person.class, "p1");
        final Person p2 = context.mock(Person.class, "p2");

        final Set<Person> coordinators = new HashSet<Person>();
        coordinators.add(p1);
View Full Code Here

    @Override
    public DomainGroup get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields)
    {
        long id = Long.parseLong(inFields.get("id").toString());
        DomainGroup entity = getGroupMapper().findById(id);

        // store the original domain group name between get and persist
        inFields.put(ORIGINAL_GROUP_NAME_KEY, entity.getName());
        inFields.put(ORIGINAL_GROUP_COORDINATORS_KEY, (Serializable) entity.getCoordinators());

        // clear out the search text for the group coordinators now, before we
        // commit to the db
        if (!entity.isPublicGroup())
        {
            clearActivityStreamSearchStringForUsersMapper.execute(entity.getId());
        }

        return entity;
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.DomainGroup

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.