Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.MetadataStatusRepository


            for (MetadataCategory category : fullMd.getCategories()) {
                moreFields.add(SearchManager.makeField("_cat", category.getName(), true, true));
            }

            final MetadataStatusRepository statusRepository = _applicationContext.getBean(MetadataStatusRepository.class);

            // get status
            Sort statusSort = new Sort(Sort.Direction.DESC, MetadataStatus_.id.getName() + "." + MetadataStatusId_.changeDate.getName());
            List<MetadataStatus> statuses = statusRepository.findAllById_MetadataId(id$, statusSort);
            if (!statuses.isEmpty()) {
                MetadataStatus stat = statuses.get(0);
                String status = String.valueOf(stat.getId().getStatusId());
                moreFields.add(SearchManager.makeField("_status", status, true, true));
                String statusChangeDate = stat.getId().getChangeDate().getDateAndTime();
View Full Code Here


    public boolean isUserMetadataOwner(int userId) throws Exception {
        return _metadataRepository.count(MetadataSpecs.isOwnedByUser(userId)) > 0;
    }

    public boolean isUserMetadataStatus(int userId) throws Exception {
        MetadataStatusRepository statusRepository = _applicationContext.getBean(MetadataStatusRepository.class);

        return statusRepository.count(MetadataStatusSpecs.hasUserId(userId)) > 0;
    }
View Full Code Here

     * @throws Exception
     *
     */
    public MetadataStatus getStatus(int metadataId) throws Exception {
        String sortField = SortUtils.createPath(MetadataStatus_.id,MetadataStatusId_.changeDate);
        final MetadataStatusRepository statusRepository = _applicationContext.getBean(MetadataStatusRepository.class);
        List<MetadataStatus> status = statusRepository.findAllById_MetadataId(metadataId, new Sort(Sort.Direction.DESC, sortField));
        if (status.isEmpty()) {
            return null;
        } else {
            return status.get(0);
        }
View Full Code Here

TOP

Related Classes of org.fao.geonet.repository.MetadataStatusRepository

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.