@Override public AssetTag incrementAssetCount(long tagId, long classNameId) throws PortalException, SystemException { AssetTag tag = assetTagPersistence.findByPrimaryKey(tagId); tag.setAssetCount(tag.getAssetCount() + 1); assetTagPersistence.update(tag); assetTagStatsLocalService.updateTagStats(tagId, classNameId); return tag; }
/** * Converts the soap model instance into a normal model instance. * * @param soapModel the soap model instance to convert * @return the normal model instance */ public static AssetTag toModel(AssetTagSoap soapModel) { if (soapModel == null) { return null; } AssetTag model = new AssetTagImpl(); model.setUuid(soapModel.getUuid()); model.setTagId(soapModel.getTagId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); model.setName(soapModel.getName()); model.setAssetCount(soapModel.getAssetCount()); model.setLastPublishDate(soapModel.getLastPublishDate()); return model; }