List of usage examples for com.liferay.portal.kernel.repository.capabilities RelatedModelCapability getClassPK
public long getClassPK(FileEntry fileEntry);
From source file:com.liferay.wiki.search.WikiPageIndexer.java
License:Open Source License
@Override public void addRelatedEntryFields(Document document, Object obj) throws Exception { long classPK = 0; if (obj instanceof Comment) { Comment comment = (Comment) obj; classPK = comment.getClassPK();/*from w w w. j a va 2 s.c o m*/ } else if (obj instanceof FileEntry) { FileEntry fileEntry = (FileEntry) obj; RelatedModelCapability relatedModelCapability = fileEntry .getRepositoryCapability(RelatedModelCapability.class); classPK = relatedModelCapability.getClassPK(fileEntry); } WikiPage page = null; try { page = _wikiPageLocalService.getPage(classPK); } catch (Exception e) { return; } document.addKeyword(Field.NODE_ID, page.getNodeId()); }