Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.GroupRepository.findOne()


        for (Integer groupId : userGroups) {
            Specifications<OperationAllowed> spec = where(hasGroupId(groupId)).and(hasMetadataId(userId));
            long count = opAllowedRepo.count(spec);

            if (count > 0) {
                Group group = groupRepository.findOne(groupId);

                if (group != null) {
                    Element record = group.asXml();
                    record.detach();
                    record.setName("group");
View Full Code Here


            }
        }

        for (Integer groupId : myGroups) {
            @SuppressWarnings("unchecked")
            Group group = groupRepository.findOne(groupId);

            if (group != null) {
                Element record = group.asXml();
                record.detach();
                record.setName("targetGroup");
View Full Code Here

        OperationAllowedRepository operationAllowedRepository = context.getBean(OperationAllowedRepository.class);
        List<OperationAllowed> opsAllowed = operationAllowedRepository.findAllById_MetadataId(iId);

        for (OperationAllowed operationAllowed : opsAllowed) {
            int grpId = operationAllowed.getId().getGroupId();
            Group group = groupRepository.findOne(grpId);
            String grpName = group.getName();

            if (!userGroups.contains(grpId)) {
                continue;
            }
View Full Code Here

                List<OperationAllowed> opsAllowed = opAllowedRepo.findByMetadataId(id);

                final GroupRepository groupRepository = context.getBean(GroupRepository.class);

                for (OperationAllowed opAllowed : opsAllowed) {
                    Group group = groupRepository.findOne(opAllowed.getId().getGroupId());
                    String  name  = group.getName();
          String  email = group.getEmail();

          if (email.trim().length() != 0) {
            String subject = "File " + theFile + " has been downloaded at "+dateTime;
View Full Code Here

   * @return
   * @throws java.sql.SQLException
   */
  Group getGroup(ServiceContext context) throws SQLException {
        final GroupRepository bean = context.getBean(GroupRepository.class);
        return bean.findOne(ReservedGroup.guest.getId());
  }

  // --------------------------------------------------------------------------
   
  /**
 
View Full Code Here

                final GroupRepository groupRepository = context.getBean(GroupRepository.class);

                List<OperationAllowed> opsAllowed = opAllowedRepo.findByMetadataId(id);
               
        for (OperationAllowed opAllowed : opsAllowed) {
                    Group group = groupRepository.findOne(opAllowed.getId().getGroupId());
          String  name  = group.getName();
          String  email = group.getEmail();

          if (email.trim().length() != 0)
          {
View Full Code Here

            java.util.List<Element> userGroups = params.getChildren(Params.GROUPS + '_' + profile);
      for (Element element : userGroups) {
        String groupEl = element.getText();
        if (!groupEl.equals("")) {
          int groupId = Integer.valueOf(groupEl);
                    Group group = groupRepository.findOne(groupId);

                    // Combine all groups editor and reviewer groups
                    if (profile.equals(Profile.Reviewer.name())) {
                        final UserGroup userGroup = new UserGroup()
                                .setGroup(group)
View Full Code Here

                int groupId = operationAllowedId.getGroupId();
                int operationId = operationAllowedId.getOperationId();

                moreFields.add(SearchManager.makeField("_op" + operationId, String.valueOf(groupId), true, true));
                if(operationId == ReservedOperation.view.getId()) {
                    Group g = groupRepository.findOne(groupId);
                    if (g != null) {
                        moreFields.add(SearchManager.makeField("_groupPublished", g.getName(), true, true));
                    }
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.