entries.add(new PageSelection<>(entry, false)); allSelected = false; entries.add(new PageSelection<>(entry, selected.booleanValue())); // NOSONAR
/** * Update the dataTableModel from the current {@link SecurityData} this method is automatically called by * rebuildSecurityData method */ protected void reconstructTableModel() { List<String> items = getCurrentDocumentUsers(); entries = new PageSelections<String>(); if (items != null) { for (String item : items) { if (SecurityConstants.EVERYONE.equals(item)) { final List<String> grantedPerms = securityData.getCurrentDocGrant().get(item); final List<String> deniedPerms = securityData.getCurrentDocDeny().get(item); if (deniedPerms != null && deniedPerms.contains(SecurityConstants.EVERYTHING) && grantedPerms == null && deniedPerms.size() == 1) { // the only perm is deny everything, there is no need to display the row continue; } } entries.add(new PageSelection<String>(item, false)); } } }
@Override public void retrieveVersions() { /** * in case the document is a proxy,meaning is the result of a publishing,to have the history of the document * from which this proxy was created,first we have to get to the version that was created when the document was * publish,and to which the proxy document indicates,and then from that version we have to get to the root * document. */ DocumentModel currentDocument = navigationContext.getCurrentDocument(); DocumentModel doc; if (currentDocument.isProxy()) { DocumentRef ref = currentDocument.getRef(); DocumentModel version = documentManager.getSourceDocument(ref); doc = documentManager.getSourceDocument(version.getRef()); } else { doc = currentDocument; } List<PageSelection<VersionModel>> versionModelSelections = new ArrayList<PageSelection<VersionModel>>(); for (VersionModel versionModel : documentVersioning.getItemVersioningHistory(doc)) { versionModelSelections.add(new PageSelection<VersionModel>(versionModel, isVersionSelected(versionModel))); } versionModelList = new PageSelections<VersionModel>(versionModelSelections); }