adding category to new created journal article in liferay -
i trying add category new created article. code here:
servicecontext servicecontext = servicecontextfactory.getinstance( journalarticle.class.getname(), actionrequest ); article = journalarticlelocalserviceutil.addarticle( importerconstants.importer_id, importerconstants.group_id, importerconstants.doc_folder_id, titlemap, descmap, content, structureid, templateid, servicecontext ); assetentry ae = assetentrylocalserviceutil.fetchentry( journalarticle.class.getname(), article.getresourceprimkey() ); //returns assetentry assetentrylocalserviceutil.addassetcategoryassetentry(48183, ae);
article created without problem, when try call
assetentrylocalserviceutil.addassetcategoryassetentry(48183, ae)
or
assetcategorylocalserviceutil.addassetentryassetcategory(ae.getentryid(), 48183)
it won't bring results , table assetentries_assetcategories
without changes. number 48183 categoryid
from table `assetcategory.
can tell me can problem? ps: using liferay portal community edition 6.2.0 ce ga1
thanks
try updating article asset entry required category id
assetentry updateentry( long userid, long groupid, string classname, long classpk, string classuuid, long classtypeid, long[] categoryids, string[] tagnames, boolean visible, date startdate, date enddate, date publishdate, date expirationdate, string mimetype, string title, string description, string summary, string url, string layoutuuid, int height, int width, integer priority, boolean sync) throws portalexception, systemexception assetentrylocalservice.updateentry( userid, entry.getgroupid(), journalarticle.class.getname(), entry.getentryid(), entry.getuuid(), 0, assetcategoryids, assettagnames, visible, null, null, entry.getdisplaydate(), null, contenttypes.text_html, entry.gettitle(), null, summary, null, null, 0, 0, null, false);
Comments
Post a Comment