Fills details about resource types of the document type into the given item. <p>

@param item the list item to fill
@param detailId the id for the detail to fill
5603
private void fillDetailResourceTypes(CmsListItem item, String detailId) {

        CmsSearchManager searchManager = OpenCms.getSearchManager();
        StringBuffer html = new StringBuffer();

        String doctypeName = (String)item.get(LIST_COLUMN_NAME);
        CmsSearchDocumentType docType = searchManager.getDocumentTypeConfig(doctypeName);

        // output of resource types
        Iterator<String> itResourcetypes = docType.getResourceTypes().iterator();
        html.append("<ul>\n");
        while (itResourcetypes.hasNext()) {
            html.append("  <li>\n").append("  ").append(itResourcetypes.next()).append("\n");
            html.append("  </li>");
        }

        html.append("</ul>\n");
        item.set(detailId, html.toString());
    }
621823
protected void showDetail(Listitem li) {
        @SuppressWarnings("unchecked")
        T value = li == null ? null : (T) li.getValue();
        String detail = value == null ? null : getDetail(value);
        detailView.setValue(detail);

        if (!getShowDetailPane() && detail != null) {
            ReportBox.modal(detail, detailTitle, getAllowPrint());
        }
    }
1351000
final public void addIdFromDoc(Integer docId, Long reference) {
    if (!closed && (docId != null)) {
      addSinglePoint(docId, 0, 0, docId, reference);
    }
  }
988747
public void setItem(java.util.Collection<ActivityResponse> item) {
        if (item == null) {
            this.item = null;
            return;
        }

        this.item = new java.util.ArrayList<ActivityResponse>(item);
    }
1003317
public void setItem(java.util.Collection<ImportJobResponse> item) {
        if (item == null) {
            this.item = null;
            return;
        }

        this.item = new java.util.ArrayList<ImportJobResponse>(item);
    }
1152563
@Override
    public void save(T item) {
        Serializable idValue = getOrGenerateIdValue(item);
        save(idValue, item);
    }
1236141
protected void initializeDetail(String detailId) {

        // if detail column visible or printable
        CmsListItemDetails details = getList().getMetadata().getItemDetailDefinition(detailId);
        if (details.isVisible() || details.isPrintable()) {
            // if the list is not empty
            if (getList().getTotalSize() > 0) {
                // if the detail column has not been previously initialized
                if (getList().getAllContent().get(0).get(detailId) == null) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug(
                            Messages.get().getBundle().key(Messages.LOG_START_DETAILS_LIST_2, getListId(), detailId));
                    }
                    fillDetails(detailId);
                    if (LOG.isDebugEnabled()) {
                        LOG.debug(
                            Messages.get().getBundle().key(Messages.LOG_END_DETAILS_LIST_2, getListId(), detailId));
                    }
                }
            }
        }
    }
843661
public void replaceItem(CmsListItem item) {

        CmsListItem oldItem = getList().getItem(item.getId());
        if (oldItem != null) {
            int index = getList().getWidgetIndex(oldItem);
            getList().removeItem(oldItem);
            if (index >= getList().getWidgetCount()) {
                getList().addItem(item);
            } else {
                getList().insertItem(item, index);
            }
        }
    }
1316499
protected void registerItem(I item) {

        if (item.getId() != null) {
            m_items.put(item.getId(), item);
        }
        if (m_tmPrefix != null) {
            item.truncate(m_tmPrefix, m_childWidth);
        }
    }
648220
public static void fillItemDefault(Item resourceItem, CmsObject cms, CmsResource resource, Locale locale) {

        if (resource == null) {
            LOG.error("Error rendering item for 'null' resource");
            return;
        }

        if (resourceItem == null) {
            LOG.error("Error rendering 'null' item for resource " + resource.getRootPath());
            return;
        }
        if (cms == null) {
            cms = A_CmsUI.getCmsObject();
            LOG.warn("CmsObject was 'null', using thread local CmsObject");
        }
        CmsResourceUtil resUtil = new CmsResourceUtil(cms, resource);
        Map<String, CmsProperty> resourceProps = null;
        try {
            List<CmsProperty> props = cms.readPropertyObjects(resource, false);
            resourceProps = new HashMap<String, CmsProperty>();
            for (CmsProperty prop : props) {
                resourceProps.put(prop.getName(), prop);
            }
        } catch (CmsException e1) {
            LOG.debug("Unable to read properties for resource '" + resource.getRootPath() + "'.", e1);
        }
        I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource);
        if (resourceItem.getItemProperty(PROPERTY_TYPE_ICON) != null) {
            resourceItem.getItemProperty(PROPERTY_TYPE_ICON).setValue(
                new CmsResourceIcon(resUtil, resource.getState(), true));
        }

        if (resourceItem.getItemProperty(PROPERTY_PROJECT) != null) {
            Label projectFlag = null;
            switch (resUtil.getProjectState().getMode()) {
                case 1:
                    projectFlag = new Label(
                        new CmsCssIcon(OpenCmsTheme.ICON_PROJECT_CURRENT).getHtml(resUtil.getLockedInProjectName()),
                        ContentMode.HTML);
                    break;
                case 2:
                    projectFlag = new Label(
                        new CmsCssIcon(OpenCmsTheme.ICON_PROJECT_OTHER).getHtml(resUtil.getLockedInProjectName()),
                        ContentMode.HTML);
                    break;
                case 5:
                    projectFlag = new Label(
                        new CmsCssIcon(OpenCmsTheme.ICON_PUBLISH).getHtml(resUtil.getLockedInProjectName()),
                        ContentMode.HTML);
                    break;
                default:
            }
            resourceItem.getItemProperty(PROPERTY_PROJECT).setValue(projectFlag);
        }

        if (resourceItem.getItemProperty(PROPERTY_INSIDE_PROJECT) != null) {
            resourceItem.getItemProperty(PROPERTY_INSIDE_PROJECT).setValue(Boolean.valueOf(resUtil.isInsideProject()));
        }

        if (resourceItem.getItemProperty(PROPERTY_RELEASED_NOT_EXPIRED) != null) {
            resourceItem.getItemProperty(PROPERTY_RELEASED_NOT_EXPIRED).setValue(
                Boolean.valueOf(resUtil.isReleasedAndNotExpired()));
        }

        if (resourceItem.getItemProperty(PROPERTY_RESOURCE_NAME) != null) {
            resourceItem.getItemProperty(PROPERTY_RESOURCE_NAME).setValue(resource.getName());
        }

        if (resourceItem.getItemProperty(PROPERTY_SITE_PATH) != null) {
            resourceItem.getItemProperty(PROPERTY_SITE_PATH).setValue(cms.getSitePath(resource));
        }

        if ((resourceItem.getItemProperty(PROPERTY_TITLE) != null) && (resourceProps != null)) {
            resourceItem.getItemProperty(PROPERTY_TITLE).setValue(
                resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_TITLE)
                ? resourceProps.get(CmsPropertyDefinition.PROPERTY_TITLE).getValue()
                : "");
        }
        boolean inNavigation = false;
        if ((resourceItem.getItemProperty(PROPERTY_NAVIGATION_TEXT) != null) && (resourceProps != null)) {
            resourceItem.getItemProperty(PROPERTY_NAVIGATION_TEXT).setValue(
                resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVTEXT)
                ? resourceProps.get(CmsPropertyDefinition.PROPERTY_NAVTEXT).getValue()
                : "");
            inNavigation = resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVTEXT);
        }

        if ((resourceItem.getItemProperty(PROPERTY_NAVIGATION_POSITION) != null) && (resourceProps != null)) {
            try {
                Float navPos = resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVPOS)
                ? Float.valueOf(resourceProps.get(CmsPropertyDefinition.PROPERTY_NAVPOS).getValue())
                : (inNavigation ? Float.valueOf(Float.MAX_VALUE) : null);
                resourceItem.getItemProperty(PROPERTY_NAVIGATION_POSITION).setValue(navPos);
                inNavigation = navPos != null;
            } catch (Exception e) {
                LOG.debug("Error evaluating navPos property", e);
            }
        }

        if (resourceItem.getItemProperty(PROPERTY_IN_NAVIGATION) != null) {
            if (inNavigation
                && (resourceProps != null)
                && resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVINFO)
                && CmsClientSitemapEntry.HIDDEN_NAVIGATION_ENTRY.equals(
                    resourceProps.get(CmsPropertyDefinition.PROPERTY_NAVINFO).getValue())) {
                inNavigation = false;
            }
            resourceItem.getItemProperty(PROPERTY_IN_NAVIGATION).setValue(Boolean.valueOf(inNavigation));
        }

        if ((resourceItem.getItemProperty(PROPERTY_COPYRIGHT) != null) && (resourceProps != null)) {
            resourceItem.getItemProperty(PROPERTY_COPYRIGHT).setValue(
                resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_COPYRIGHT)
                ? resourceProps.get(CmsPropertyDefinition.PROPERTY_COPYRIGHT).getValue()
                : "");
        }

        if ((resourceItem.getItemProperty(PROPERTY_CACHE) != null) && (resourceProps != null)) {
            resourceItem.getItemProperty(PROPERTY_CACHE).setValue(
                resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_CACHE)
                ? resourceProps.get(CmsPropertyDefinition.PROPERTY_CACHE).getValue()
                : "");
        }

        if (resourceItem.getItemProperty(PROPERTY_RESOURCE_TYPE) != null) {
            resourceItem.getItemProperty(PROPERTY_RESOURCE_TYPE).setValue(
                CmsWorkplaceMessages.getResourceTypeName(locale, type.getTypeName()));
        }

        if (resourceItem.getItemProperty(PROPERTY_IS_FOLDER) != null) {
            resourceItem.getItemProperty(PROPERTY_IS_FOLDER).setValue(Boolean.valueOf(resource.isFolder()));
        }

        if (resourceItem.getItemProperty(PROPERTY_SIZE) != null) {
            if (resource.isFile()) {
                resourceItem.getItemProperty(PROPERTY_SIZE).setValue(Integer.valueOf(resource.getLength()));
            }
        }

        if (resourceItem.getItemProperty(PROPERTY_PERMISSIONS) != null) {
            resourceItem.getItemProperty(PROPERTY_PERMISSIONS).setValue(resUtil.getPermissionString());
        }

        if (resourceItem.getItemProperty(PROPERTY_DATE_MODIFIED) != null) {
            resourceItem.getItemProperty(PROPERTY_DATE_MODIFIED).setValue(Long.valueOf(resource.getDateLastModified()));
        }

        if (resourceItem.getItemProperty(PROPERTY_USER_MODIFIED) != null) {
            resourceItem.getItemProperty(PROPERTY_USER_MODIFIED).setValue(resUtil.getUserLastModified());
        }

        if (resourceItem.getItemProperty(PROPERTY_DATE_CREATED) != null) {
            resourceItem.getItemProperty(PROPERTY_DATE_CREATED).setValue(Long.valueOf(resource.getDateCreated()));
        }

        if (resourceItem.getItemProperty(PROPERTY_USER_CREATED) != null) {
            resourceItem.getItemProperty(PROPERTY_USER_CREATED).setValue(resUtil.getUserCreated());
        }

        if (resourceItem.getItemProperty(PROPERTY_DATE_RELEASED) != null) {
            long release = resource.getDateReleased();
            if (release != CmsResource.DATE_RELEASED_DEFAULT) {
                resourceItem.getItemProperty(PROPERTY_DATE_RELEASED).setValue(Long.valueOf(release));
            } else {
                resourceItem.getItemProperty(PROPERTY_DATE_RELEASED).setValue(null);
            }
        }

        if (resourceItem.getItemProperty(PROPERTY_DATE_EXPIRED) != null) {
            long expire = resource.getDateExpired();
            if (expire != CmsResource.DATE_EXPIRED_DEFAULT) {
                resourceItem.getItemProperty(PROPERTY_DATE_EXPIRED).setValue(Long.valueOf(expire));
            } else {
                resourceItem.getItemProperty(PROPERTY_DATE_EXPIRED).setValue(null);
            }
        }

        if (resourceItem.getItemProperty(PROPERTY_STATE_NAME) != null) {
            resourceItem.getItemProperty(PROPERTY_STATE_NAME).setValue(resUtil.getStateName());
        }

        if (resourceItem.getItemProperty(PROPERTY_STATE) != null) {
            resourceItem.getItemProperty(PROPERTY_STATE).setValue(resource.getState());
        }

        if (resourceItem.getItemProperty(PROPERTY_USER_LOCKED) != null) {
            resourceItem.getItemProperty(PROPERTY_USER_LOCKED).setValue(resUtil.getLockedByName());
        }
    }
986881
private void fillDetailIndexSource(CmsListItem item, String detailId) {

        StringBuffer html = new StringBuffer();
        // search for the corresponding A_CmsSearchIndex:
        I_CmsSearchIndex idx = OpenCms.getSearchManager().getIndex((String)item.get(LIST_COLUMN_NAME));

        html.append("<ul>\n");
        // get the index sources (nice API)
        for (CmsSearchIndexSource idxSource : idx.getSources()) {
            html.append("  <li>\n").append("    ").append("name      : ").append(idxSource.getName()).append("\n");
            html.append("  </li>");

            html.append("  <li>\n").append("    ").append("indexer   : ").append(
                idxSource.getIndexerClassName()).append("\n");
            html.append("  </li>");

            html.append("  <li>\n").append("    ").append("resources : ").append("\n");
            html.append("    <ul>\n");
            List<String> resources = idxSource.getResourcesNames();
            Iterator<String> itResources = resources.iterator();
            while (itResources.hasNext()) {
                html.append("    <li>\n").append("      ").append(itResources.next()).append("\n");
                html.append("    </li>\n");
            }
            html.append("    </ul>\n");
            html.append("  </li>");

            html.append("  <li>\n").append("    ").append("doctypes : ").append("\n");
            html.append("    <ul>\n");
            resources = idxSource.getDocumentTypes();
            itResources = resources.iterator();
            while (itResources.hasNext()) {
                html.append("    <li>\n").append("      ").append(itResources.next()).append("\n");
                html.append("    </li>\n");
            }
            html.append("    </ul>\n");
            html.append("  </li>");
        }

        html.append("</ul>\n");
        item.set(detailId, html.toString());
    }
653832
@Override
    public void renderItem(Listitem item, Document doc) {
        log.trace("item render");
        item.setSelectable(true);
        item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), Events.ON_DOUBLE_CLICK);
        addCell(item, "");
        addCell(item, doc.getDateTime());
        addCell(item, doc.getTitle());
        addCell(item, doc.getLocationName());
        addCell(item, doc.getAuthorName());
    }
508084
public final void add(@NonNull final AbstractItem item) {
        Condition.INSTANCE.ensureNotNull(item, "The item may not be null");
        items.add(item);

        if (item instanceof Item && ((Item) item).getIcon() != null) {
            iconCount++;
        } else if (item instanceof Divider) {
            dividerCount++;
        }

        rawItems = null;
        notifyOnDataSetChanged();
    }
763920
private void fillDetailFieldConfiguration(CmsListItem item, String detailId) {

        // search for the corresponding A_CmsSearchIndex:
        String idxName = (String)item.get(LIST_COLUMN_NAME);
        I_CmsSearchIndex idx = OpenCms.getSearchManager().getIndex(idxName);
        if (idx != null) {
            StringBuffer html = new StringBuffer();
            I_CmsSearchFieldConfiguration idxFieldConfiguration = idx.getFieldConfiguration();
            List<CmsSearchField> fields = idxFieldConfiguration.getFields();

            html.append("<ul>\n");
            html.append("  <li>\n").append("    ").append("name      : ").append(
                idxFieldConfiguration.getName()).append("\n");
            html.append("  </li>");
            html.append("  <li>\n").append("    ").append("fields : ").append("\n");
            html.append("    <ul>\n");

            Iterator<CmsSearchField> itFields = fields.iterator();
            while (itFields.hasNext()) {
                CmsLuceneField field = (CmsLuceneField)itFields.next();
                String fieldName = field.getName();
                boolean fieldStore = field.isStored();
                String fieldIndex = field.getIndexed();
                boolean fieldExcerpt = field.isInExcerpt();
                String fieldDefault = field.getDefaultValue();

                html.append("  <li>\n").append("    ");
                html.append("name=").append(fieldName);
                if (fieldStore) {
                    html.append(", ").append("store=").append(fieldStore);
                }
                if (!fieldIndex.equals("false")) {
                    html.append(", ").append("index=").append(fieldIndex);
                }
                if (fieldExcerpt) {
                    html.append(", ").append("excerpt=").append(fieldExcerpt);
                }
                if (fieldDefault != null) {
                    html.append(", ").append("default=").append(field.getDefaultValue());
                }
                html.append("\n").append("    <ul>\n");

                Iterator<I_CmsSearchFieldMapping> itMappings = field.getMappings().iterator();
                while (itMappings.hasNext()) {
                    CmsSearchFieldMapping mapping = (CmsSearchFieldMapping)itMappings.next();
                    html.append("  <li>\n").append("    ");
                    html.append(mapping.getType().toString());
                    if (CmsStringUtil.isNotEmpty(mapping.getParam())) {
                        html.append("=").append(mapping.getParam()).append("\n");
                    }
                    html.append("  </li>");
                }
                html.append("    </ul>\n");
                html.append("  </li>");
            }
            html.append("    </ul>\n");
            html.append("  </li>");
            html.append("</ul>\n");
            item.set(detailId, html.toString());
        }
    }
602216
public ComplianceItemEntry withDetails(java.util.Map<String, String> details) {
        setDetails(details);
        return this;
    }
1278649
private void fillDetailResources(CmsListItem item, String detailId) {

        CmsSearchManager searchManager = OpenCms.getSearchManager();
        StringBuffer html = new StringBuffer();

        // search for the corresponding CmsSearchIndexSource:
        String idxSourceName = (String)item.get(LIST_COLUMN_NAME);
        CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName);

        // get the index sources resource strings
        List<String> resources = idxSource.getResourcesNames();
        // output of found index sources
        Iterator<String> itResources = resources.iterator();
        html.append("<ul>\n");
        while (itResources.hasNext()) {

            html.append("  <li>\n").append("  ").append(itResources.next()).append("\n");
            html.append("  </li>");
        }

        html.append("</ul>\n");

        item.set(detailId, html.toString());
    }
1267980
public void set(ResultItem item){
        try {
            if (item.getValueType() == ValueType.DOCUMENT) {
                content = item.asString().getBytes("UTF-8");
                contentType = ContentType.XML;
            } else if (item.getValueType() == ValueType.ELEMENT) {
                content = item.asString().getBytes("UTF-8");
                contentType = ContentType.XML;
            } else if (item.getValueType() == ValueType.TEXT) {
                content = item.asString().getBytes("UTF-8");
                contentType = ContentType.TEXT;
            } else if (item.getValueType() == ValueType.BINARY) {
                if (item.isCached()) {
                    content = ((XdmBinary) item.getItem()).asBinaryData();
                } else {
                    is = item.asInputStream();
                }
                contentType = ContentType.BINARY;
            } else if (item.getValueType() == ValueType.ARRAY_NODE ||
                item.getValueType() == ValueType.BOOLEAN_NODE ||
                item.getValueType() == ValueType.NULL_NODE ||
                item.getValueType() == ValueType.NUMBER_NODE ||
                item.getValueType() == ValueType.OBJECT_NODE) {
                content = item.asString().getBytes("UTF-8");
                contentType = ContentType.JSON;
            } else {
                contentType = ContentType.UNKNOWN;
            }
        } catch (UnsupportedEncodingException e) {
            LOG.error(e);
        }
    }