@Override protected Summary doGetSummary( Document document, Locale locale, String snippet, PortletURL portletURL, PortletRequest portletRequest, PortletResponse portletResponse) { LiferayPortletURL liferayPortletURL = (LiferayPortletURL) portletURL; liferayPortletURL.setLifecycle(PortletRequest.ACTION_PHASE); try { liferayPortletURL.setWindowState(LiferayWindowState.EXCLUSIVE); } catch (WindowStateException wse) { } String fileEntryId = document.get(Field.ENTRY_CLASS_PK); portletURL.setParameter("struts_action", "/document_library/get_file"); portletURL.setParameter("fileEntryId", fileEntryId); Summary summary = createSummary(document, Field.TITLE, Field.CONTENT); summary.setMaxContentLength(200); summary.setPortletURL(portletURL); return summary; }
@Override protected Summary doGetSummary( Document document, Locale locale, String snippet, PortletURL portletURL) { LiferayPortletURL liferayPortletURL = (LiferayPortletURL) portletURL; liferayPortletURL.setLifecycle(PortletRequest.ACTION_PHASE); try { liferayPortletURL.setWindowState(LiferayWindowState.EXCLUSIVE); } catch (WindowStateException wse) { } String folderId = document.get(Field.ENTRY_CLASS_PK); portletURL.setParameter("struts_action", "/journal/view"); portletURL.setParameter("folderId", folderId); Summary summary = createSummary(document, Field.TITLE, Field.DESCRIPTION); summary.setMaxContentLength(200); summary.setPortletURL(portletURL); return summary; }
@Override protected Summary doGetSummary( Document document, Locale locale, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) { Summary summary = createSummary(document, Field.TITLE, Field.CONTENT); summary.setMaxContentLength(200); return summary; }
@Override protected Summary doGetSummary( Document document, Locale locale, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) { String calendarId = document.get(Field.ENTRY_CLASS_PK); Summary summary = createSummary(document, Field.NAME, Field.DESCRIPTION); summary.setMaxContentLength(200); return summary; }
@Override protected Summary doGetSummary( Document document, Locale locale, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) { Locale defaultLocale = LocaleUtil.fromLanguageId(document.get("defaultLanguageId")); Locale snippetLocale = getSnippetLocale(document, locale); String localizedTitleName = DocumentImpl.getLocalizedName(locale, Field.TITLE); if ((snippetLocale == null) && (document.getField(localizedTitleName) == null)) { snippetLocale = defaultLocale; } else { snippetLocale = locale; } String title = document.get( snippetLocale, Field.SNIPPET + StringPool.UNDERLINE + Field.TITLE, Field.TITLE); if (Validator.isNull(title) && !snippetLocale.equals(defaultLocale)) { title = document.get( defaultLocale, Field.SNIPPET + StringPool.UNDERLINE + Field.TITLE, Field.TITLE); } String content = getDDMContentSummary(document, snippetLocale, portletRequest, portletResponse); if (Validator.isNull(content) && !snippetLocale.equals(defaultLocale)) { content = getDDMContentSummary(document, defaultLocale, portletRequest, portletResponse); } Summary summary = new Summary(snippetLocale, title, content); summary.setMaxContentLength(200); return summary; }