当前位置: 首页>>代码示例>>Java>>正文


Java HtmlUtil.extractText方法代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.HtmlUtil.extractText方法的典型用法代码示例。如果您正苦于以下问题:Java HtmlUtil.extractText方法的具体用法?Java HtmlUtil.extractText怎么用?Java HtmlUtil.extractText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.kernel.util.HtmlUtil的用法示例。


在下文中一共展示了HtmlUtil.extractText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateAsset

import com.liferay.portal.kernel.util.HtmlUtil; //导入方法依赖的package包/类
@Override
public void updateAsset(long userId, TaskRecord taskRecord, long[] assetCategoryIds, String[] assetTagNames,
        long[] assetLinkEntryIds, Double priority) throws PortalException {

    // TODO
    boolean visible = true;
    // boolean visible = false;
    // if (taskRecord.isApproved()) {
    // visible = true;
    // publishDate = taskRecord.getCreateDate();
    // }

    Date publishDate = null;

    String summary = HtmlUtil.extractText(StringUtil.shorten(taskRecord.getWorkPackage(), 500));

    String className = TaskRecord.class.getName();
    long classPK = taskRecord.getTaskRecordId();

    AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId, taskRecord.getGroupId(),
            taskRecord.getCreateDate(), taskRecord.getModifiedDate(), className, classPK, taskRecord.getUuid(), 0,
            assetCategoryIds, assetTagNames, true, visible, null, null, publishDate, null, ContentTypes.TEXT_HTML,
            taskRecord.getWorkPackage(), taskRecord.getWorkPackage(), summary, null, null, 0, 0, priority);

    assetLinkLocalService.updateLinks(userId, assetEntry.getEntryId(), assetLinkEntryIds,
            AssetLinkConstants.TYPE_RELATED);
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:28,代码来源:TaskRecordLocalServiceImpl.java

示例2: updateAsset

import com.liferay.portal.kernel.util.HtmlUtil; //导入方法依赖的package包/类
@Override
public void updateAsset(long userId, Contact contact, long[] assetCategoryIds, String[] assetTagNames,
        long[] assetLinkEntryIds, Double priority) throws PortalException {

    // TODO
    boolean visible = true;
    // boolean visible = false;
    // if (contact.isApproved()) {
    // visible = true;
    // publishDate = contact.getCreateDate();
    // }

    Date publishDate = contact.getCreateDate();

    // TODO
    String description = "TODO: contact description";
    String summary = HtmlUtil.extractText(StringUtil.shorten(contact.getCard(), 500));

    String className = Contact.class.getName();
    long classPK = contact.getContactId();

    AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId, contact.getGroupId(),
            contact.getCreateDate(), contact.getModifiedDate(), className, classPK, contact.getUuid(), 0,
            assetCategoryIds, assetTagNames, true, visible, null, null, publishDate, null, ContentTypes.TEXT_HTML,
            // contact.getName(),
            "TODO: contact.getName()", description, summary, null, null, 0, 0, priority);

    assetLinkLocalService.updateLinks(userId, assetEntry.getEntryId(), assetLinkEntryIds,
            AssetLinkConstants.TYPE_RELATED);

    // assetEntryLocalService.updateVisible(Contact.class.getName(),
    // classPK, visible);

}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:35,代码来源:ContactLocalServiceImpl.java

示例3: updateAsset

import com.liferay.portal.kernel.util.HtmlUtil; //导入方法依赖的package包/类
@Override
public void updateAsset(long userId, Measurement measurement,
        long[] assetCategoryIds, String[] assetTagNames, Double priority)
        throws PortalException {

    // TODO
    boolean visible = true;
    // boolean visible = false;
    // if (measurement.isApproved()) {
    // visible = true;
    // publishDate = measurement.getCreateDate();
    // }

    Date publishDate = null;

    String summary = HtmlUtil
            .extractText(StringUtil.shorten(measurement.getData(), 500));

    String className = Measurement.class.getName();
    long classPK = measurement.getMeasurementId();

    assetEntryLocalService.updateEntry(userId, measurement.getGroupId(),
            measurement.getCreateDate(), measurement.getModifiedDate(),
            className, classPK, measurement.getUuid(), 0, assetCategoryIds,
            assetTagNames, true, visible, null, null, publishDate, null,
            ContentTypes.TEXT_HTML, measurement.getName(),
            measurement.getName(), summary, null, null, 0, 0, priority);
}
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:29,代码来源:MeasurementLocalServiceImpl.java

示例4: doGetDocument

import com.liferay.portal.kernel.util.HtmlUtil; //导入方法依赖的package包/类
@Override
protected Document doGetDocument(Object obj) throws Exception {
	Course entry = (Course)obj;
	AssetEntry asset=AssetEntryLocalServiceUtil.getEntry(Course.class.getName(), entry.getCourseId());
	long companyId = entry.getCompanyId();
	long groupId = getParentGroupId(entry.getGroupId());
	long scopeGroupId = entry.getGroupId();
	long userId = entry.getUserId();
	User user=UserLocalServiceUtil.getUser(userId);
	String userName = user.getFullName();
	long entryId = entry.getCourseId();
	String title = entry.getTitle();
	String content = HtmlUtil.extractText(entry.getDescription());
	Date displayDate = asset.getPublishDate();

	long[] assetCategoryIds =AssetCategoryLocalServiceUtil.getCategoryIds(Course.class.getName(), entryId);
	String[] assetTagNames =AssetTagLocalServiceUtil.getTagNames(Course.class.getName(), entryId);

	ExpandoBridge expandoBridge = entry.getExpandoBridge();

	Document document = new DocumentImpl();

	document.addUID(PORTLET_ID, entryId);

	document.addModifiedDate(displayDate);

	document.addKeyword(Field.COMPANY_ID, companyId);
	document.addKeyword(Field.PORTLET_ID, PORTLET_ID);
	document.addKeyword(Field.GROUP_ID, groupId);
	document.addKeyword(Field.SCOPE_GROUP_ID, scopeGroupId);
	document.addKeyword(Field.USER_ID, userId);
	document.addText(Field.USER_NAME, userName);

	document.addText(Field.TITLE, title);
	document.addText(Field.CONTENT, content);
	document.addKeyword(Field.ASSET_CATEGORY_IDS, assetCategoryIds);
	document.addKeyword(Field.ASSET_TAG_NAMES, assetTagNames);

	document.addKeyword(Field.ENTRY_CLASS_NAME, LearningActivity.class.getName());
	document.addKeyword(Field.ENTRY_CLASS_PK, entryId);

	ExpandoBridgeIndexerUtil.addAttributes(document, expandoBridge);

	return document;
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:46,代码来源:CourseIndexer.java

示例5: doGetDocument

import com.liferay.portal.kernel.util.HtmlUtil; //导入方法依赖的package包/类
protected Document doGetDocument(Object obj) {
	try{
		LearningActivity entry = (LearningActivity)obj;

		long companyId = entry.getCompanyId();
		long groupId = getParentGroupId(entry.getGroupId());
		long scopeGroupId = entry.getGroupId();
		long userId = entry.getUserId();
		String userName = PortalUtil.getUserName(userId, entry.getUserName());
		long entryId = entry.getActId();
		String title = entry.getTitle();
		String content = HtmlUtil.extractText(entry.getDescription());
		Date displayDate = entry.getCreateDate();

		long[] assetCategoryIds = new long[0];
			//AssetCategoryLocalServiceUtil.getCategoryIds(				LearningActivity.class.getName(), entryId);
		String[] assetTagNames =new String[0];
			//AssetTagLocalServiceUtil.getTagNames(			BlogsEntry.class.getName(), entryId);

		ExpandoBridge expandoBridge = entry.getExpandoBridge();

		Document document = new DocumentImpl();

		document.addUID(PORTLET_ID, entryId);

		document.addModifiedDate(displayDate);

		document.addKeyword(Field.COMPANY_ID, companyId);
		document.addKeyword(Field.PORTLET_ID, PORTLET_ID);
		document.addKeyword(Field.GROUP_ID, groupId);
		document.addKeyword(Field.SCOPE_GROUP_ID, scopeGroupId);
		document.addKeyword(Field.USER_ID, userId);
		document.addText(Field.USER_NAME, userName);

		document.addText(Field.TITLE, title);
		document.addText(Field.CONTENT, content);
		document.addKeyword(Field.ASSET_CATEGORY_IDS, assetCategoryIds);
		document.addKeyword(Field.ASSET_TAG_NAMES, assetTagNames);

		document.addKeyword(Field.ENTRY_CLASS_NAME, LearningActivity.class.getName());
		document.addKeyword(Field.ENTRY_CLASS_PK, entryId);

		ExpandoBridgeIndexerUtil.addAttributes(document, expandoBridge);

		return document;
	}catch(Exception e){
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:51,代码来源:LearningActivityIndexer.java


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