Package com.infoclinika.mssharing.model.internal.entity

Examples of com.infoclinika.mssharing.model.internal.entity.ColumnsView


    @Override
    public long createView(Long user, ColumnViewType type, String name, Set<ColumnInfo> columns, boolean primary) {
        final User user1;
        user1 = user == null ? null : userRepository.findOne(user);
        final ColumnsView view = new ColumnsView(name, transformType(type), user1);
        final Collection<ViewColumn> values = transformViewToModel(columns);
        view.getColumns().addAll(values);
        view.setPrimary(primary);
        return columnViewRepository.save(view).getId();
    }
View Full Code Here


        return columnViewRepository.save(view).getId();
    }

    @Override
    public ImmutableSortedSet<ColumnInfo> getOrderedColumnsByView(long viewId) {
        final ColumnsView columnsView = checkPresence(columnViewRepository.findOne(viewId));
        final Set<ViewColumn> columns = new HashSet<ViewColumn>(columnsView.getColumns());
        return transformColumns(columns);
    }
View Full Code Here

        return transformColumns(columns);
    }

    @Override
    public ImmutableSortedSet<ColumnInfo> getDefaultColumnSet(ColumnViewType type) {
        final ColumnsView defaultView = columnViewRepository.findDefault(transformType(type));
        return transformColumns(defaultView.getColumns());
    }
View Full Code Here

        }).toImmutableSet();
    }

    @Override
    public void updateView(long actor, ColumnView viewInfo, Set<ColumnInfo> columns) {
        final ColumnsView columnsView = checkPresence(columnViewRepository.findOne(viewInfo.id));
        if (columnsView.isDefault()) {
            throw new AccessDenied("Can't update default view");
        }
        columnsView.getColumns().clear();
        columnsView.getColumns().addAll(transformViewToModel(columns));
        columnsView.setPrimary(viewInfo.isPrimary);
        columnsView.setName(viewInfo.name);
        columnViewRepository.save(columnsView);
    }
View Full Code Here

    }

    @Override
    public void removeView(long actor, long viewId) {
        final User user = checkPresence(userRepository.findOne(actor));
        final ColumnsView view = columnViewRepository.findOne(viewId);
        if (!user.equals(view.getUser())) {
            throw new AccessDenied("User isn't permitted to remove columns view");
        }
        columnViewRepository.delete(view);
    }
View Full Code Here

TOP

Related Classes of com.infoclinika.mssharing.model.internal.entity.ColumnsView

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.