Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.DomainGroup


     * @return DeleteGroupResponse
     */
    @Override
    public DeleteGroupResponse execute(final Long inRequest)
    {
        DomainGroup group = groupMapper.execute(new FindByIdRequest("DomainGroup", inRequest));
        Long groupId = group.getId();

        DeleteGroupResponse response = new DeleteGroupResponse(groupId, group.getShortName(), new Long(group
                .getStreamScope().getId()));

        getEntityManager().createQuery(
                "DELETE FROM StreamHashTag WHERE streamEntityUniqueKey = :uniqueKey AND streamScopeType = :type")
                .setParameter("uniqueKey", group.getUniqueId()).setParameter("type", ScopeType.GROUP).executeUpdate();

        // delete the group hibernate should take care of following since we are deleting via entity manager.
        // Hibernate: delete from Group_Capability where domainGroupId=?
        // Hibernate: delete from Group_Task where groupId=?
        // Hibernate: delete from Group_Coordinators where DomainGroup_id=?
View Full Code Here


        {
            log.error("Object to convert is not a DomainGroup.");
            return null;
        }

        DomainGroup group = (DomainGroup) inGroupObj;
        return group.isPending() ? "f" : "t";
    }
View Full Code Here

    // TODO: for now this comes from entity as it did before. Should create new mapper and set up cache for group
    // capabilities to improve performance.
    private List<String> getCapabilities(final Long groupId)
    {
        List<String> results = new ArrayList<String>();
        DomainGroup g = groupEntityMapper.execute(new FindByIdRequest("DomainGroup", groupId));
        List<BackgroundItem> caps = g.getCapabilities();
        for (BackgroundItem bgi : caps)
        {
            results.add(bgi.getName());
        }
View Full Code Here

    {
        if (domainGroupObj == null || !(domainGroupObj instanceof DomainGroup))
        {
            return null;
        }
        DomainGroup domainGroup = (DomainGroup) domainGroupObj;

        if (domainGroupMapper == null)
        {
            throw new IllegalStateException("static domainGroupMapper must be injected into this class bridge");
        }
View Full Code Here

    @Override
    public DomainGroup get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields)
    {
        // create the group
        DomainGroup group = new DomainGroup();

        StreamScope groupScope = new StreamScope(ScopeType.GROUP, (String) inFields.get("shortName"));
        group.setStreamScope(groupScope);

        // set the capabilities as a new list to avoid search indexing problems
        group.setCapabilities(new ArrayList<BackgroundItem>());

        return group;
    }
View Full Code Here

        DomainGroupCacheUpdaterRequest request = (DomainGroupCacheUpdaterRequest) inActionContext.getParams();

        Long domainGroupId = request.getDomainGroupId();

        log.info("Loading domain group by id #" + domainGroupId);
        DomainGroup domainGroup = domainGroupMapper.findById(domainGroupId);

        log.info("Updating the cached list of coordinators for group #" + domainGroupId + " from the database");

        List<Long> peopleIds = groupCoordinatorCacheManager.execute(domainGroup);

        // if this is a private group, this change will affect the coordinators'
        // and followers' activity search
        if (!domainGroup.isPublicGroup())
        {
            if (request.getIsUpdate())
            {
                log.info("Looping across the coordinators to update"
                        + " their private group access list to include the group #" + domainGroupId);
                for (Long coordinatorPersonId : peopleIds)
                {
                    cache.addToSet(CacheKeys.PRIVATE_GROUP_IDS_VIEWABLE_BY_PERSON_AS_COORDINATOR + coordinatorPersonId,
                            domainGroupId);
                }
            }
            // skip if it is pending. Will be added on approval.
            else if (!domainGroup.isPending())
            {
                // This will search for all users who have coordinator access to this group
                // through either group or org coordinator roles and add the id to their cached
                // private group access list.
                addPrivateGroupIdToCachedListMapper.execute(domainGroupId);
            }
        }

        // find all the activity ids to update
        List<Long> activityIds = getActivityIdsAuthordedByEntityDbMapper.execute(domainGroup.getShortName(),
                EntityType.GROUP);

        if (log.isInfoEnabled())
        {
            log.info("Found info for '" + domainGroup.getShortName() + "' - applying it to " + activityIds.size()
                    + " activities.");
        }

        for (Long activityId : activityIds)
        {
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public NotificationBatch translate(final TargetEntityNotificationsRequest inRequest)
    {
        DomainGroup group = groupDAO.execute(new FindByIdRequest("DomainGroup", inRequest.getTargetEntityId()));

        List<Long> admins = systemAdminIdsDAO.execute(null);

        NotificationBatch batch = new NotificationBatch(NotificationType.REQUEST_NEW_GROUP, admins);
        batch.setProperty(NotificationPropertyKeys.ACTOR, PersonModelView.class, inRequest.getActorId());
View Full Code Here

    @Override
    public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext)
    {
        DomainGroupShortNameRequest request = (DomainGroupShortNameRequest) inActionContext.getActionContext()
                .getParams();
        DomainGroup target = groupMapper.findByShortName(request.getGroupShortName());
        if (null == target)
        {
            throw new IllegalArgumentException("Tried to send a request for access to an invalid group"
                    + request.getGroupShortName());
        }

        long personId = inActionContext.getActionContext().getPrincipal().getId();

        // save the request
        insertMembershipRequestMapper.execute(new RequestForGroupMembershipRequest(target.getId(), personId));

        // send notification
        // Note: doesn't check whether the request was freshly added or whether it was already found, thus allowing a
        // user to "nag" the coordinators for access
        inActionContext.getUserActionRequests().add(
                new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null,
                        new TargetEntityNotificationsRequest(RequestType.REQUEST_GROUP_ACCESS, personId, target
                                .getId())));

        return null;
    }
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.