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


Java AssetTagLocalServiceUtil.getTagNames方法代码示例

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


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

示例1: doGetDocument

import com.liferay.portlet.asset.service.AssetTagLocalServiceUtil; //导入方法依赖的package包/类
@Override
protected Document doGetDocument(Object obj) throws Exception {
	Competence entry = (Competence)obj;

	long companyId = entry.getCompanyId();
	long groupId = getParentGroupId(entry.getGroupId());
	long scopeGroupId = entry.getGroupId();
	long userId = entry.getUserId();
	long entryId = entry.getCompetenceId();
	String title = entry.getTitle();

	AssetEntry assetEntry=AssetEntryLocalServiceUtil.getEntry(Competence.class.getName(), entryId);
	String content=entry.getDescription();

	long[] assetCategoryIds = AssetCategoryLocalServiceUtil.getCategoryIds(
			Competence.class.getName(), entryId);

	String[] assetTagNames = AssetTagLocalServiceUtil.getTagNames(
			Competence.class.getName(), entryId);

	Document document = new DocumentImpl();
	document.addUID(PORTLET_ID, entryId);

	document.addKeyword(Field.CLASS_PK, entryId);
	document.addKeyword(Field.ENTRY_CLASS_NAME, Competence.class.getName());
	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.TITLE, title);
	document.addText(Field.CONTENT, content);
	document.addText(Field.DESCRIPTION, assetEntry.getSummary());
	document.addKeyword(Field.ASSET_CATEGORY_IDS, assetCategoryIds);
	document.addKeyword(Field.ASSET_TAG_NAMES, assetTagNames);
	
	return document;
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:40,代码来源:CompetenceIndexer.java

示例2: doGetDocument

import com.liferay.portlet.asset.service.AssetTagLocalServiceUtil; //导入方法依赖的package包/类
@Override
	protected Document doGetDocument(Object obj) throws Exception {
//		_log.debug("doGetDocument()");
		Application application = (Application) obj;
        long companyId = application.getCompanyId();
//        long groupId = getParentGroupId(application.getGroupId());
//        long scopeGroupId = application.getGroupId();
//        long groupId = 20102;
//        long scopeGroupId = 20102;
      
        long userId = application.getUserId();
        long resourcePrimKey = application.getPrimaryKey();
        String title = application.getName().toLowerCase();
        String content = "";
        String description = application.getDescription().toLowerCase();
        String regions = application.getRegionString().toLowerCase();
        String categoryString = application.getCategoryString().toLowerCase();
        String targetOS = application.getTargetOS().toLowerCase();
        content = content + " " + application.getRegionString().toLowerCase();
        content = content + " " + application.getCategoryString().toLowerCase();
        content = content + " " + application.getTargetOS().toLowerCase();
//        content = content + " " + application.getMinTargetOSVersion();

        
        Date modifiedDate = application.getModifiedDate();

       long[] assetCategoryIds = AssetCategoryLocalServiceUtil.getCategoryIds(Application.class.getName(), resourcePrimKey);
       
       List<AssetCategory> categories = AssetCategoryLocalServiceUtil.getCategories(Application.class.getName(), resourcePrimKey);

       String[] assetCategoryNames = StringUtil.split(ListUtil.toString(categories, "name"));
       
       // EE lets you do this quicker: 
       
       // String[] assetCategoryNames =
       //     AssetCategoryLocalServiceUtil.getCategoryNames(
       //         Slogan.class.getName(), resourcePrimKey);
       
       String[] assetTagNames = AssetTagLocalServiceUtil.getTagNames(Application.class.getName(), resourcePrimKey);

        Document document = new DocumentImpl();

        document.addUID(PORTLET_ID, resourcePrimKey);

        document.addDate("modifiedDate", modifiedDate);
        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.TITLE, title);
        document.addText(Field.CONTENT, content);
        document.addText(Field.DESCRIPTION, description);
        document.addText("regions", regions);
        document.addText("categoryString", categoryString);
        document.addText("targetOS", targetOS);
        document.addKeyword(Field.ASSET_CATEGORY_IDS, assetCategoryIds);
        document.addKeyword("assetCategoryNames", assetCategoryNames);
        //document.addKeyword(Field.ASSET_CATEGORY_NAMES, assetCategoryNames);
        document.addKeyword(Field.ASSET_TAG_NAMES, assetTagNames);
        document.addKeyword(Field.ENTRY_CLASS_NAME, Application.class.getName());
        document.addKeyword(Field.ENTRY_CLASS_PK, resourcePrimKey);
        
        return document;
	}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:66,代码来源:ApplicationIndexer.java

示例3: doGetDocument

import com.liferay.portlet.asset.service.AssetTagLocalServiceUtil; //导入方法依赖的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


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