本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
}