@Override
  protected void doImportStagedModel(
      PortletDataContext portletDataContext, WSRPConsumerPortlet wsrpConsumerPortlet)
      throws Exception {

    StagedModelDataHandlerUtil.importReferenceStagedModel(
        portletDataContext,
        wsrpConsumerPortlet,
        WSRPConsumer.class,
        wsrpConsumerPortlet.getWsrpConsumerId());

    Map<Long, Long> wsrpConsumerIds =
        (Map<Long, Long>) portletDataContext.getNewPrimaryKeysMap(WSRPConsumer.class);

    long wsrpConsumerId =
        MapUtil.getLong(
            wsrpConsumerIds,
            wsrpConsumerPortlet.getWsrpConsumerId(),
            wsrpConsumerPortlet.getWsrpConsumerId());

    ServiceContext serviceContext = portletDataContext.createServiceContext(wsrpConsumerPortlet);

    WSRPConsumerPortlet importedWSRPConsumerPortlet = null;

    if (portletDataContext.isDataStrategyMirror()) {
      WSRPConsumerPortlet existingWSRPConsumerPortlet =
          WSRPConsumerPortletLocalServiceUtil.fetchWSRPConsumerPortletByUuidAndCompanyId(
              wsrpConsumerPortlet.getUuid(), portletDataContext.getCompanyId());

      if (existingWSRPConsumerPortlet == null) {
        serviceContext.setUuid(wsrpConsumerPortlet.getUuid());

        importedWSRPConsumerPortlet =
            WSRPConsumerPortletLocalServiceUtil.addWSRPConsumerPortlet(
                wsrpConsumerId,
                wsrpConsumerPortlet.getName(),
                wsrpConsumerPortlet.getPortletHandle(),
                serviceContext);
      } else {
        existingWSRPConsumerPortlet.setWsrpConsumerId(wsrpConsumerId);
        existingWSRPConsumerPortlet.setName(wsrpConsumerPortlet.getName());
        existingWSRPConsumerPortlet.setPortletHandle(wsrpConsumerPortlet.getPortletHandle());

        importedWSRPConsumerPortlet =
            WSRPConsumerPortletLocalServiceUtil.updateWSRPConsumerPortlet(
                existingWSRPConsumerPortlet);
      }
    } else {
      importedWSRPConsumerPortlet =
          WSRPConsumerPortletLocalServiceUtil.addWSRPConsumerPortlet(
              wsrpConsumerId,
              wsrpConsumerPortlet.getName(),
              wsrpConsumerPortlet.getPortletHandle(),
              serviceContext);
    }

    portletDataContext.importClassedModel(wsrpConsumerPortlet, importedWSRPConsumerPortlet);
  }
  @Override
  protected boolean validateMissingReference(String uuid, long companyId, long groupId) {

    WSRPConsumerPortlet wsrpConsumerPortlet =
        WSRPConsumerPortletLocalServiceUtil.fetchWSRPConsumerPortletByUuidAndCompanyId(
            uuid, companyId);

    if (wsrpConsumerPortlet == null) {
      return false;
    }

    return true;
  }
  @Override
  public void deleteStagedModel(String uuid, long groupId, String className, String extraData)
      throws PortalException {

    Group group = GroupLocalServiceUtil.getGroup(groupId);

    WSRPConsumerPortlet wsrpConsumerPortlet =
        WSRPConsumerPortletLocalServiceUtil.fetchWSRPConsumerPortletByUuidAndCompanyId(
            uuid, group.getCompanyId());

    if (wsrpConsumerPortlet != null) {
      WSRPConsumerPortletLocalServiceUtil.deleteWSRPConsumerPortlet(wsrpConsumerPortlet);
    }
  }