@Override
    protected List<CmsListItem> getListItems() throws CmsException {

        CmsIdentifiableObjectContainer<CmsListItem> ret = new CmsIdentifiableObjectContainer<CmsListItem>(true, false);
        Iterator<String> itUsers = CmsStringUtil.splitAsList(
            getParamUserid(),
            CmsHtmlList.ITEM_SEPARATOR,
            true).iterator();
        String storedSiteRoot = getCms().getRequestContext().getSiteRoot();
        try {
            getCms().getRequestContext().setSiteRoot("/");
            while (itUsers.hasNext()) {
                CmsUser user = getCms().readUser(new CmsUUID(itUsers.next().toString()));
                // get content
                Set<CmsResource> resources = getCms().getResourcesForPrincipal(user.getId(), null, m_showAttributes);
                Iterator<CmsResource> itRes = resources.iterator();
                while (itRes.hasNext()) {
                    CmsResource resource = itRes.next();
                    CmsListItem item = ret.getObject(resource.getResourceId().toString());
                    if (item == null) {
                        String userCreated = resource.getUserCreated().toString();
                        try {
                            userCreated = getCms().readUser(resource.getUserCreated()).getFullName();
                        } catch (CmsException exc) {
                            // noop - user id could not be resolved, so display it
                        }
                        String userLastmodified = resource.getUserLastModified().toString();
                        try {
                            userLastmodified = getCms().readUser(resource.getUserLastModified()).getFullName();
                        } catch (CmsException exc) {
                            // noop - user id could not be resolved, so display it
                        }
                        item = getList().newItem(resource.getResourceId().toString());
                        item.set(LIST_COLUMN_NAME, resource.getRootPath());
                        item.set(LIST_COLUMN_TYPE, new Integer(resource.getTypeId()));
                        item.set(LIST_COLUMN_CREATED, userCreated);
                        item.set(LIST_COLUMN_LASTMODIFIED, userLastmodified);
                        Iterator<CmsAccessControlEntry> itAces = getCms().getAccessControlEntries(
                            resource.getRootPath(),
                            false).iterator();
                        while (itAces.hasNext()) {
                            CmsAccessControlEntry ace = itAces.next();
                            if (ace.getPrincipal().equals(user.getId())) {
                                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(
                                    ace.getPermissions().getPermissionString())) {
                                    item.set(
                                        LIST_COLUMN_PERMISSIONS,
                                        user.getName() + ": " + ace.getPermissions().getPermissionString());
                                }
                                break;
                            }
                        }
                        ret.addIdentifiableObject(item.getId(), item);
                    } else {
                        String oldData = (String)item.get(LIST_COLUMN_PERMISSIONS);
                        Iterator<CmsAccessControlEntry> itAces = getCms().getAccessControlEntries(
                            resource.getRootPath(),
                            false).iterator();
                        while (itAces.hasNext()) {
                            CmsAccessControlEntry ace = itAces.next();
                            if (ace.getPrincipal().equals(user.getId())) {
                                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(
                                    ace.getPermissions().getPermissionString())) {
                                    String data = user.getName() + ": " + ace.getPermissions().getPermissionString();
                                    if (oldData != null) {
                                        data = oldData + ", " + data;
                                    }
                                    item.set(LIST_COLUMN_PERMISSIONS, data);
                                }
                                break;
                            }
                        }
                    }
                }
            }
        } finally {
            getCms().getRequestContext().setSiteRoot(storedSiteRoot);
        }
        return ret.elementList();
    }
@ Override protected List < CmsListItem > getListItems ( ) throws CmsException { CmsIdentifiableObjectContainer < CmsListItem > ret = new CmsIdentifiableObjectContainer < CmsListItem > ( true , false ) ; Iterator < String > itUsers = CmsStringUtil . splitAsList ( getParamUserid ( ) , CmsHtmlList . ITEM_SEPARATOR , true ) . iterator ( ) ; String storedSiteRoot = getCms ( ) . getRequestContext ( ) . getSiteRoot ( ) ; try { getCms ( ) . getRequestContext ( ) . setSiteRoot ( "/" ) ; while ( itUsers . hasNext ( ) ) { CmsUser user = getCms ( ) . readUser ( new CmsUUID ( itUsers . next ( ) . toString ( ) ) ) ; Set < CmsResource > resources = getCms ( ) . getResourcesForPrincipal ( user . getId ( ) , null , m_showAttributes ) ; Iterator < CmsResource > itRes = resources . iterator ( ) ; while ( itRes . hasNext ( ) ) { CmsResource resource = itRes . next ( ) ; CmsListItem item = ret . getObject ( resource . getResourceId ( ) . toString ( ) ) ; if ( item == null ) { String userCreated = resource . getUserCreated ( ) . toString ( ) ; try { userCreated = getCms ( ) . readUser ( resource . getUserCreated ( ) ) . getFullName ( ) ; } catch ( CmsException exc ) { } String userLastmodified = resource . getUserLastModified ( ) . toString ( ) ; try { userLastmodified = getCms ( ) . readUser ( resource . getUserLastModified ( ) ) . getFullName ( ) ; } catch ( CmsException exc ) { } item = getList ( ) . newItem ( resource . getResourceId ( ) . toString ( ) ) ; item . set ( LIST_COLUMN_NAME , resource . getRootPath ( ) ) ; item . set ( LIST_COLUMN_TYPE , new Integer ( resource . getTypeId ( ) ) ) ; item . set ( LIST_COLUMN_CREATED , userCreated ) ; item . set ( LIST_COLUMN_LASTMODIFIED , userLastmodified ) ; Iterator < CmsAccessControlEntry > itAces = getCms ( ) . getAccessControlEntries ( resource . getRootPath ( ) , false ) . iterator ( ) ; while ( itAces . hasNext ( ) ) { CmsAccessControlEntry ace = itAces . next ( ) ; if ( ace . getPrincipal ( ) . equals ( user . getId ( ) ) ) { if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( ace . getPermissions ( ) . getPermissionString ( ) ) ) { item . set ( LIST_COLUMN_PERMISSIONS , user . getName ( ) + ": " + ace . getPermissions ( ) . getPermissionString ( ) ) ; } break ; } } ret . addIdentifiableObject ( item . getId ( ) , item ) ; } else { String oldData = ( String ) item . get ( LIST_COLUMN_PERMISSIONS ) ; Iterator < CmsAccessControlEntry > itAces = getCms ( ) . getAccessControlEntries ( resource . getRootPath ( ) , false ) . iterator ( ) ; while ( itAces . hasNext ( ) ) { CmsAccessControlEntry ace = itAces . next ( ) ; if ( ace . getPrincipal ( ) . equals ( user . getId ( ) ) ) { if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( ace . getPermissions ( ) . getPermissionString ( ) ) ) { String data = user . getName ( ) + ": " + ace . getPermissions ( ) . getPermissionString ( ) ; if ( oldData != null ) { data = oldData + ", " + data ; } item . set ( LIST_COLUMN_PERMISSIONS , data ) ; } break ; } } } } } } finally { getCms ( ) . getRequestContext ( ) . setSiteRoot ( storedSiteRoot ) ; } return ret . elementList ( ) ; }
@see org.opencms.workplace.list.A_CmsListDialog#getListItems()