use of com.haulmont.cuba.security.entity.Presentation in project cuba by cuba-platform.
the class PresentationActionsBuilder method isGlobalPresentation.
protected boolean isGlobalPresentation() {
Presentations presentations = table.getPresentations();
Presentation presentation = presentations.getCurrent();
return presentation != null && (!presentations.isGlobal(presentation) || userSessionSource.getUserSession().isSpecificPermitted("cuba.gui.presentations.global"));
}
use of com.haulmont.cuba.security.entity.Presentation in project cuba by cuba-platform.
the class SaveAsPresentationAction method actionPerform.
@Override
public void actionPerform(Component component) {
tableImpl.hidePresentationsPopup();
Presentation presentation = metadata.create(Presentation.class);
presentation.setComponentId(ComponentsHelper.getComponentPath(table));
openEditor(presentation);
}
use of com.haulmont.cuba.security.entity.Presentation in project cuba by cuba-platform.
the class SavePresentationAction method actionPerform.
@Override
public void actionPerform(Component component) {
tableImpl.hidePresentationsPopup();
Presentations presentations = table.getPresentations();
Presentation current = presentations.getCurrent();
Element e = presentations.getSettings(current);
table.saveSettings(e);
presentations.setSettings(current, e);
presentations.commit();
}
use of com.haulmont.cuba.security.entity.Presentation in project cuba by cuba-platform.
the class FolderEditWindow method fillPresentations.
protected void fillPresentations(Presentations presentations) {
presentation.removeAllItems();
final Collection<Object> availablePresentationIds = presentations.getPresentationIds();
for (final Object pId : availablePresentationIds) {
final Presentation p = presentations.getPresentation(pId);
presentation.addItem(p);
presentation.setItemCaption(p, presentations.getCaption(pId));
}
}
use of com.haulmont.cuba.security.entity.Presentation in project cuba by cuba-platform.
the class PresentationsImpl method checkLoad.
private void checkLoad() {
if (presentations == null) {
DataService ds = AppBeans.get(DataService.NAME);
LoadContext ctx = new LoadContext(Presentation.class);
ctx.setView("app");
UserSessionSource sessionSource = AppBeans.get(UserSessionSource.NAME);
UserSession session = sessionSource.getUserSession();
User user = session.getCurrentOrSubstitutedUser();
ctx.setQueryString("select p from sec$Presentation p " + "where p.componentId = :component and (p.user is null or p.user.id = :userId)").setParameter("component", name).setParameter("userId", user.getId());
final List<Presentation> list = ds.loadList(ctx);
presentations = new LinkedHashMap<>(list.size());
for (final Presentation p : list) {
presentations.put(p.getId(), p);
}
}
}
Aggregations