• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JournalArticle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.liferay.journal.model.JournalArticle的典型用法代码示例。如果您正苦于以下问题:Java JournalArticle类的具体用法?Java JournalArticle怎么用?Java JournalArticle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JournalArticle类属于com.liferay.journal.model包,在下文中一共展示了JournalArticle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: buildFields

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
/**
 * Build content field
 *
 * @param groupId Company group ID
 * @param locales locales
 * @param baseArticle content data
 * @return DDMStructure applied content XML strings
 * @throws Exception
 */
public String buildFields(long groupId, String[] locales, String baseArticle) throws Exception {
	DDMStructure ddmStructure = 
		_DDMStructureLocalService.getStructure(
			groupId,
			PortalUtil.getClassNameId(JournalArticle.class), 
			LDFPortletKeys._DDM_STRUCTURE_KEY
		);

	Map<String, Serializable> fieldsMap = Maps.newConcurrentMap();
	fieldsMap.put(DDM_CONTENT, baseArticle);

	Fields fields = _ddmLocalUtil.toFields(
			ddmStructure.getStructureId(), 
			fieldsMap, 
			locales,
			LocaleUtil.getDefault());

	return _journalConverter.getContent(ddmStructure, fields);
}
 
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:29,代码来源:JournalUtils.java


示例2: _addJournalArticle

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
private JournalArticle _addJournalArticle(
	Long groupId, WebPageElementCreatorForm webPageElementCreatorForm) {

	ServiceContext serviceContext = new ServiceContext();

	serviceContext.setAddGroupPermissions(true);
	serviceContext.setAddGuestPermissions(true);
	serviceContext.setScopeGroupId(groupId);

	Try<JournalArticle> journalArticleTry = Try.fromFallible(() ->
		_journalArticleService.addArticle(
			groupId, webPageElementCreatorForm.getFolder(), 0, 0, null,
			true, webPageElementCreatorForm.getTitleMap(),
			webPageElementCreatorForm.getDescriptionMap(),
			webPageElementCreatorForm.getText(),
			webPageElementCreatorForm.getStructure(),
			webPageElementCreatorForm.getTemplate(), null,
			webPageElementCreatorForm.getDisplayDateMonth(),
			webPageElementCreatorForm.getDisplayDateDay(),
			webPageElementCreatorForm.getDisplayDateYear(),
			webPageElementCreatorForm.getDisplayDateHour(),
			webPageElementCreatorForm.getDisplayDateMinute(), 0, 0, 0, 0, 0,
			true, 0, 0, 0, 0, 0, true, true, null, serviceContext));

	return journalArticleTry.getUnchecked();
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:27,代码来源:WebPageElementNestedCollectionResource.java


示例3: _updateJournalArticle

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
private JournalArticle _updateJournalArticle(
	Long journalArticleId,
	WebPageElementUpdaterForm webPageElementUpdaterForm) {

	ServiceContext serviceContext = new ServiceContext();

	serviceContext.setAddGroupPermissions(true);
	serviceContext.setAddGuestPermissions(true);
	serviceContext.setScopeGroupId(webPageElementUpdaterForm.getGroup());

	Try<JournalArticle> journalArticleTry = Try.fromFallible(() ->
		_journalArticleService.updateArticle(
			webPageElementUpdaterForm.getUser(),
			webPageElementUpdaterForm.getGroup(),
			webPageElementUpdaterForm.getFolder(),
			String.valueOf(journalArticleId),
			webPageElementUpdaterForm.getVersion(),
			webPageElementUpdaterForm.getTitleMap(),
			webPageElementUpdaterForm.getDescriptionMap(),
			webPageElementUpdaterForm.getText(), null, serviceContext));

	return journalArticleTry.getUnchecked();
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:24,代码来源:WebPageElementNestedCollectionResource.java


示例4: getPrivacyJournalArticle

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
public static JournalArticle getPrivacyJournalArticle(
	long groupId, String articleId) {

	if (Validator.isNull(articleId) || Validator.isNull(groupId)) {
		return null;
	}

	try {
		return JournalArticleLocalServiceUtil.fetchArticle(
			groupId, articleId);
	}
	catch (Exception e) {
		_log.error(e, e);
	}

	return null;
}
 
开发者ID:smclab,项目名称:liferay-7-workspace,代码行数:18,代码来源:PrivacyUtil.java


示例5: buildClassesCondition

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
/**
 * Add classes condition.
 * 
 * @throws ParseException
 */
protected void buildClassesCondition()
	throws ParseException {

	List<String> classNames = _queryParams.getClassNames();

	BooleanQuery query = new BooleanQueryImpl();

	// Is this a single asset type targeted query
	
	boolean dedicatedTypeQuery = classNames.size() == 1;
	
	for (String className : classNames) {

		// Handle journal article and DLFileEntry separately.

		if (className.equals(JournalArticle.class.getName())) {
			addJournalArticleClassCondition(query, dedicatedTypeQuery);
		}
		else if (className.equals(DLFileEntry.class.getName())) {
			addDLFileEntryClassCondition(query, dedicatedTypeQuery);
		}
		else {
			
			TermQuery condition = new TermQueryImpl(Field.ENTRY_CLASS_NAME, className); 
			query.add(condition, BooleanClauseOccur.SHOULD);
		}
	}
	addAsQueryFilter(query);
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:35,代码来源:QueryFilterBuilderImpl.java


示例6: getJournalArticle

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
/**
 * Get journal article.
 * 
 * @return
 * @throws PortalException 
 */
protected JournalArticle getJournalArticle() throws PortalException {

	if (_journalArticle == null) {
		_journalArticle = _journalArticleService.getLatestArticle(_entryClassPK);
	}
	return _journalArticle;
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:14,代码来源:JournalArticleItemBuilder.java


示例7: getNotLayoutBoundJournalArticleUrl

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
/**
 * Get a view url for an article which is not bound to a layout or has a
 * default view page.
 * 
 * @return url string
 * @throws PortalException
 */
protected String getNotLayoutBoundJournalArticleUrl()
	throws PortalException {

	ThemeDisplay themeDisplay =
		(ThemeDisplay) _portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

	Layout layout = GSearchUtil.getLayoutByFriendlyURL(
		_portletRequest, _assetPublisherPageFriendlyURL);

	String assetPublisherInstanceId =
		GSearchUtil.findDefaultAssetPublisherInstanceId(layout);

	JournalArticle journalArticle = getJournalArticle();

	StringBundler sb = new StringBundler();
	sb.append(PortalUtil.getLayoutFriendlyURL(layout, themeDisplay));
	sb.append("/-/asset_publisher/");
	sb.append(assetPublisherInstanceId);
	sb.append("/content/");
	sb.append(journalArticle.getUrlTitle());
	sb.append("?_");
	sb.append(AssetPublisherPortletKeys.ASSET_PUBLISHER);
	sb.append("_INSTANCE_");
	sb.append(assetPublisherInstanceId);
	sb.append("_groupId=");
	sb.append(journalArticle.getGroupId());

	return sb.toString();
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:37,代码来源:JournalArticleItemBuilder.java


示例8: getResultBuilder

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public ResultItemBuilder getResultBuilder(
	PortletRequest portletRequest, PortletResponse portletResponse,
	Document document, String assetPublisherPageFriendlyURL) {

	String entryClassName = document.get(Field.ENTRY_CLASS_NAME);

	ResultItemBuilder resultItemBuilder;

	if (BlogsEntry.class.getName().equals(entryClassName)) {
		resultItemBuilder = new BlogsEntryItemBuilder();
	}
	else if (DLFileEntry.class.getName().equals(entryClassName)) {
		resultItemBuilder = new DLFileEntryItemBuilder();
	}
	else if (JournalArticle.class.getName().equals(entryClassName)) {
		resultItemBuilder = new JournalArticleItemBuilder();
	}
	else if (MBMessage.class.getName().equals(entryClassName)) {
		resultItemBuilder = new MBMessageItemBuilder();
	}
	else if (WikiPage.class.getName().equals(entryClassName)) {
		resultItemBuilder = new WikiPageItemBuilder();
	}
	else if ("non-liferay-type".equals(entryClassName)) {
			resultItemBuilder = new NonLiferaySampleItemBuilder();

	} else {
		throw new UnsupportedOperationException("Result item builder not implemented for " + entryClassName);
	}

	resultItemBuilder.setProperties(
		portletRequest, portletResponse, document,
		assetPublisherPageFriendlyURL);

	return resultItemBuilder;
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:40,代码来源:ResultItemBuilderFactoryImpl.java


示例9: collectionRoutes

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
@Override
public NestedCollectionRoutes<JournalArticle> collectionRoutes(
	NestedCollectionRoutes.Builder<JournalArticle, Long> builder) {

	return builder.addGetter(
		this::_getPageItems
	).addCreator(
		this::_addJournalArticle, WebPageElementCreatorForm::buildForm
	).build();
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:11,代码来源:WebPageElementNestedCollectionResource.java


示例10: itemRoutes

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
@Override
public ItemRoutes<JournalArticle> itemRoutes(
	ItemRoutes.Builder<JournalArticle, Long> builder) {

	return builder.addGetter(
		this::_getJournalArticle
	).addRemover(
		this::_deleteJournalArticle
	).addUpdater(
		this::_updateJournalArticle, WebPageElementUpdaterForm::buildForm
	).build();
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:13,代码来源:WebPageElementNestedCollectionResource.java


示例11: representor

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
@Override
public Representor<JournalArticle, Long> representor(
	Representor.Builder<JournalArticle, Long> builder) {

	return builder.types(
		"WebPageElement"
	).identifier(
		JournalArticle::getFolderId
	).addBidirectionalModel(
		"webSite", "webPageElements", WebSite.class,
		this::_getWebSiteOptional, WebSite::getWebSiteId
	).addDate(
		"dateCreated", JournalArticle::getCreateDate
	).addDate(
		"dateModified", JournalArticle::getModifiedDate
	).addDate(
		"datePublished", JournalArticle::getLastPublishDate
	).addDate(
		"lastReviewed", JournalArticle::getReviewDate
	).addLinkedModel(
		"author", User.class, this::_getUserOptional
	).addLinkedModel(
		"creator", User.class, this::_getUserOptional
	).addString(
		"description", JournalArticle::getDescription
	).addString(
		"text", JournalArticle::getContent
	).addString(
		"title", JournalArticle::getTitle
	).build();
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:32,代码来源:WebPageElementNestedCollectionResource.java


示例12: _deleteJournalArticle

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
private void _deleteJournalArticle(Long journalArticleId) {
	try {
		JournalArticle article = _journalArticleService.getArticle(
			journalArticleId);

		_journalArticleService.deleteArticle(
			article.getGroupId(), article.getArticleId(),
			article.getArticleResourceUuid(), new ServiceContext());
	}
	catch (NoSuchArticleException nsae) {
	}
	catch (PortalException pe) {
		throw new ServerErrorException(500, pe);
	}
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:16,代码来源:WebPageElementNestedCollectionResource.java


示例13: _getJournalArticle

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
private JournalArticle _getJournalArticle(Long journalArticleId) {
	try {
		return _journalArticleService.getArticle(journalArticleId);
	}
	catch (NoSuchArticleException nsae) {
		throw new NotFoundException(
			"Unable to get article " + journalArticleId, nsae);
	}
	catch (PortalException pe) {
		throw new ServerErrorException(500, pe);
	}
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:13,代码来源:WebPageElementNestedCollectionResource.java


示例14: _getPageItems

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
private PageItems<JournalArticle> _getPageItems(
	Pagination pagination, Long groupId) {

	List<JournalArticle> journalArticles =
		_journalArticleService.getArticles(
			groupId, 0, pagination.getStartPosition(),
			pagination.getEndPosition(), null);
	int count = _journalArticleService.getArticlesCount(groupId, 0);

	return new PageItems<>(journalArticles, count);
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:12,代码来源:WebPageElementNestedCollectionResource.java


示例15: _getUserOptional

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
private Optional<User> _getUserOptional(JournalArticle journalArticle) {
	try {
		return Optional.ofNullable(
			_userService.getUserById(journalArticle.getUserId()));
	}
	catch (NoSuchUserException | PrincipalException e) {
		throw new NotFoundException(
			"Unable to get user " + journalArticle.getUserId(), e);
	}
	catch (PortalException pe) {
		throw new ServerErrorException(500, pe);
	}
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:14,代码来源:WebPageElementNestedCollectionResource.java


示例16: showPrivacyInfoMessage

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
public static boolean showPrivacyInfoMessage(
	boolean signedIn, boolean privacyEnabled, JournalArticle privacyPolicy,
	HttpServletRequest request, String nameExtend) {

	if (signedIn) {
		return false;
	}
	else if (!privacyEnabled) {
		if (_log.isDebugEnabled()) {
			_log.debug("Privacy is NOT enabled.");
		}

		return false;
	}

	if (Validator.isNull(privacyPolicy)) {
		if (_log.isWarnEnabled()) {
			_log.warn(
				"Privacy is enabled but no web content is set for " +
					"Privacy Policy!");
		}

		return false;
	}

	long cookieValidationDateMillis = GetterUtil.getLong(
		CookieKeys.getCookie(request, PRIVACY_READ + nameExtend));

	if (cookieValidationDateMillis == 0) {
		return true;
	}

	return false;
}
 
开发者ID:smclab,项目名称:liferay-7-workspace,代码行数:35,代码来源:PrivacyUtil.java


示例17: associateTags

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
public static void associateTags(long groupId, Article article, JournalArticle journalArticle) throws PortalException {

        List<Tag> tags = article.getTag();
        String[] tagNames = null;
        if (tags != null) {
            tagNames = tags.stream().map(Tag::getName).toArray(String[]::new);
        }
        AssetEntry entry = AssetEntryLocalServiceUtil.getEntry(JournalArticle.class.getName(), journalArticle.getResourcePrimKey());
        AssetEntryLocalServiceUtil.updateEntry(LiferaySetup.getRunAsUserId(), groupId, JournalArticle.class.getName(), entry.getClassPK(), null, tagNames);
    }
 
开发者ID:mimacom,项目名称:liferay-db-setup-core,代码行数:11,代码来源:TaggingUtil.java


示例18: associateTagsWithJournalArticle

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
public static void associateTagsWithJournalArticle(final List<String> tags,
                                                   final List<String> categories, final long userId, final long groupId,
                                                   final long primaryKey) {

    try {
        long[] catIds = new long[0];
        if (categories != null) {
            catIds = getCategories(categories, groupId, userId);
        }
        AssetEntryLocalServiceUtil.updateEntry(userId, groupId, JournalArticle.class.getName(),
                primaryKey, catIds, tags.toArray(new String[tags.size()]));
    } catch (PortalException | SystemException e) {
        e.printStackTrace();
    }
}
 
开发者ID:mimacom,项目名称:liferay-db-setup-core,代码行数:16,代码来源:TaggingUtil.java


示例19: getArticleByArticleID

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
public static JournalArticle getArticleByArticleID(final String articleId, final long groupId)
        throws SystemException {
    JournalArticle article = null;
    article = JournalArticleLocalServiceUtil.fetchLatestArticle(groupId, articleId,
            WorkflowConstants.STATUS_APPROVED);

    return article;
}
 
开发者ID:mimacom,项目名称:liferay-db-setup-core,代码行数:9,代码来源:ResolverUtil.java


示例20: _getWebSiteOptional

import com.liferay.journal.model.JournalArticle; //导入依赖的package包/类
private Optional<WebSite> _getWebSiteOptional(
	JournalArticle journalArticle) {

	return _webSiteService.getWebSite(journalArticle.getGroupId());
}
 
开发者ID:liferay,项目名称:com-liferay-apio-architect,代码行数:6,代码来源:WebPageElementNestedCollectionResource.java



注:本文中的com.liferay.journal.model.JournalArticle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FrameGrabber类代码示例发布时间:2022-05-23
下一篇:
Java CtVariableAccess类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap