protected void importAssetLink(AssetLink assetLink, long entryId1) throws PortalException, SystemException { long entryId2 = assetLink.getEntryId2(); AssetEntry assetEntry2 = assetEntryPersistence.findByPrimaryKey(entryId2); if (assetEntry2.getClassNameId() == classNameLocalService.getClassNameId(CalEvent.class)) { CalEvent calEvent = calEventPersistence.findByPrimaryKey(assetEntry2.getClassPK()); importCalEvent(calEvent); assetEntry2 = assetEntryPersistence.findByG_CU(calEvent.getGroupId(), calEvent.getUuid()); entryId2 = assetEntry2.getEntryId(); } long linkId = counterLocalService.increment(); addAssetLink( linkId, assetLink.getCompanyId(), assetLink.getUserId(), assetLink.getUserName(), assetLink.getCreateDate(), entryId1, entryId2, assetLink.getType(), assetLink.getWeight()); }