Search in sources :

Example 1 with NoSuchResourceException

use of com.liferay.portal.NoSuchResourceException in project liferay-ide by liferay.

the class SearchPermissionCheckerImpl method addPermissionFields.

@Override
public void addPermissionFields(long companyId, Document document) {
    try {
        long groupId = GetterUtil.getLong(document.get(Field.GROUP_ID));
        String className = document.get(Field.ENTRY_CLASS_NAME);
        boolean relatedEntry = GetterUtil.getBoolean(document.get(Field.RELATED_ENTRY));
        if (relatedEntry) {
            long classNameId = GetterUtil.getLong(document.get(Field.CLASS_NAME_ID));
            className = PortalUtil.getClassName(classNameId);
        }
        if (Validator.isNull(className)) {
            return;
        }
        String classPK = document.get(Field.ROOT_ENTRY_CLASS_PK);
        if (Validator.isNull(classPK)) {
            classPK = document.get(Field.ENTRY_CLASS_PK);
        }
        if (relatedEntry) {
            classPK = document.get(Field.CLASS_PK);
        }
        if (Validator.isNull(classPK)) {
            return;
        }
        Indexer indexer = IndexerRegistryUtil.getIndexer(className);
        if (!indexer.isPermissionAware()) {
            return;
        }
        doAddPermissionFields_6(companyId, groupId, className, classPK, document);
    } catch (NoSuchResourceException nsre) {
    } catch (Exception e) {
        _log.error(e, e);
    }
}
Also used : NoSuchResourceException(com.liferay.portal.NoSuchResourceException) Indexer(com.liferay.portal.kernel.search.Indexer) NoSuchResourceException(com.liferay.portal.NoSuchResourceException)

Aggregations

NoSuchResourceException (com.liferay.portal.NoSuchResourceException)1 Indexer (com.liferay.portal.kernel.search.Indexer)1