JournalArticleContentDashboardItem implements ContentDashboardItem<JournalArticle> { @Override public boolean isViewable(HttpServletRequest httpServletRequest) { if (!_journalArticle.hasApprovedVersion()) { return false; } Optional<ContentDashboardItemActionProvider> contentDashboardItemActionProviderOptional = _contentDashboardItemActionProviderTracker. getContentDashboardItemActionProviderOptional( JournalArticle.class.getName(), ContentDashboardItemAction.Type.VIEW); return contentDashboardItemActionProviderOptional.map( contentDashboardItemActionProvider -> contentDashboardItemActionProvider.isShow( _journalArticle, httpServletRequest) ).orElse( false ); } JournalArticleContentDashboardItem(
		List<AssetCategory> assetCategories, List<AssetTag> assetTags,
		ContentDashboardItemActionProviderTracker
			contentDashboardItemActionProviderTracker,
		ContentDashboardItemType contentDashboardItemType, Group group,
		InfoItemFieldValuesProvider<JournalArticle> infoItemFieldValuesProvider,
		JournalArticle journalArticle, Language language,
		JournalArticle latestApprovedJournalArticle); @Override List<AssetCategory> getAssetCategories(); @Override List<AssetCategory> getAssetCategories(long assetVocabularyId); @Override List<AssetTag> getAssetTags(); @Override List<Locale> getAvailableLocales(); @Override List<ContentDashboardItemAction> getContentDashboardItemActions(
		HttpServletRequest httpServletRequest,
		ContentDashboardItemAction.Type... types); @Override ContentDashboardItemType getContentDashboardItemType(); @Override Date getCreateDate(); @Override Map<String, Object> getData(Locale locale); @Override Locale getDefaultLocale(); @Override Object getDisplayFieldValue(String fieldName, Locale locale); @Override InfoItemReference getInfoItemReference(); @Override Date getModifiedDate(); @Override String getScopeName(Locale locale); @Override String getTitle(Locale locale); @Override long getUserId(); @Override List<Version> getVersions(Locale locale); @Override boolean isViewable(HttpServletRequest httpServletRequest);  }
@Test public void testIsViewable() throws Exception { JournalArticle journalArticle = _getJournalArticle(); JournalArticleContentDashboardItem journalArticleContentDashboardItem = new JournalArticleContentDashboardItem( null, null, _getContentDashboardItemActionProviderTracker("validURL"), null, null, null, journalArticle, _getLanguage(), null); Assert.assertTrue( journalArticleContentDashboardItem.isViewable( _getHttpServletRequest())); }