Fórum

Categories create by code doesn’t appears for classification

Cesar Quinteiro, modificado 7 Anos atrás.

Categories create by code doesn’t appears for classification

Junior Member Postagens: 34 Data de Entrada: 18/10/11 Postagens Recentes
I am inserting AssetCategories using the following code in a HOOK (Liferay Tomcat Bundle 6.2 GA6)
........
		ServiceContext serviceContext = new ServiceContext();
			serviceContext.setCompanyId(themeDisplay.getCompanyId());
			serviceContext.setLanguageId(LanguageUtil.getLanguageId(actionRequest));
			serviceContext.setAttribute("defaultLanguageId", "es_ES");
			serviceContext.setScopeGroupId(themeDisplay.getScopeGroupId());
			serviceContext.setAddGuestPermissions(true);
			serviceContext.setAddGroupPermissions(true);

	try {
			AssetCategory newCat = AssetCategoryLocalServiceUtil.addCategory(userId,
					articleId,
					61167, // get from table Asset Category from vocabulary Id
			         serviceContext);
.........


Is i login as administrator the category is show but is not show when I try to add to any asset using classification, only appears the first (order alphabetical) that corresponds with number of categories I add by hand in Control panel, the only way to make them (the ones created by code) to apear is creating by hand the same number and starting with “Z” letter, to push up the good ones.

I got the same problem If i create them using Json WS.

      url = "http://............./api/jsonws/assetcategory/add-category/parent-category-id/"+parentCategoryId+"/title-map/"+vTitleMap+"/-description-map/vocabulary-id/"+vocabularyId+"/-category-properties/serviceContext.addGuestPermissions/true";