Examples of ModelListener


Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.polls.model.PollsVote remove(
    com.liferay.portlet.polls.ejb.PollsVotePK pollsVotePK)
    throws com.liferay.portlet.polls.NoSuchVoteException,
      com.liferay.portal.SystemException {
    PollsVotePersistence persistence = (PollsVotePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(PollsVoteUtil.class,e.getMessage(),e);
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(pollsVotePK));
    }

    com.liferay.portlet.polls.model.PollsVote pollsVote = persistence.remove(pollsVotePK);

    if (listener != null) {
      listener.onAfterRemove(pollsVote);
    }

    return pollsVote;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.polls.model.PollsVote update(
    com.liferay.portlet.polls.model.PollsVote pollsVote)
    throws com.liferay.portal.SystemException {
    PollsVotePersistence persistence = (PollsVotePersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(PollsVoteUtil.class,e.getMessage(),e);
      }
    }

    boolean isNew = pollsVote.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(pollsVote);
      }
      else {
        listener.onBeforeUpdate(pollsVote);
      }
    }

    pollsVote = persistence.update(pollsVote);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(pollsVote);
      }
      else {
        listener.onAfterUpdate(pollsVote);
      }
    }

    return pollsVote;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.admin.model.AdminConfig remove(
    java.lang.String configId)
    throws com.liferay.portlet.admin.NoSuchConfigException,
      com.liferay.portal.SystemException {
    AdminConfigPersistence persistence = (AdminConfigPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(AdminConfigUtil.class,e.getMessage(),e);
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(configId));
    }

    com.liferay.portlet.admin.model.AdminConfig adminConfig = persistence.remove(configId);

    if (listener != null) {
      listener.onAfterRemove(adminConfig);
    }

    return adminConfig;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portlet.admin.model.AdminConfig update(
    com.liferay.portlet.admin.model.AdminConfig adminConfig)
    throws com.liferay.portal.SystemException {
    AdminConfigPersistence persistence = (AdminConfigPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(AdminConfigUtil.class,e.getMessage(),e);
      }
    }

    boolean isNew = adminConfig.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(adminConfig);
      }
      else {
        listener.onBeforeUpdate(adminConfig);
      }
    }

    adminConfig = persistence.update(adminConfig);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(adminConfig);
      }
      else {
        listener.onAfterUpdate(adminConfig);
      }
    }

    return adminConfig;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.Portlet remove(
    com.liferay.portal.ejb.PortletPK portletPK)
    throws com.liferay.portal.NoSuchPortletException,
      com.liferay.portal.SystemException {
    PortletPersistence persistence = (PortletPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(PortletUtil.class,e.getMessage(),e);
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(portletPK));
    }

    com.liferay.portal.model.Portlet portlet = persistence.remove(portletPK);

    if (listener != null) {
      listener.onAfterRemove(portlet);
    }

    return portlet;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.Portlet update(
    com.liferay.portal.model.Portlet portlet)
    throws com.liferay.portal.SystemException {
    PortletPersistence persistence = (PortletPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(PortletUtil.class,e.getMessage(),e);
      }
    }

    boolean isNew = portlet.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(portlet);
      }
      else {
        listener.onBeforeUpdate(portlet);
      }
    }

    portlet = persistence.update(portlet);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(portlet);
      }
      else {
        listener.onAfterUpdate(portlet);
      }
    }

    return portlet;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.PortletPreferences remove(
    com.liferay.portal.ejb.PortletPreferencesPK portletPreferencesPK)
    throws com.liferay.portal.NoSuchPortletPreferencesException,
      com.liferay.portal.SystemException {
    PortletPreferencesPersistence persistence = (PortletPreferencesPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(PortletPreferencesUtil.class,e.getMessage(),e);
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(portletPreferencesPK));
    }

    com.liferay.portal.model.PortletPreferences portletPreferences = persistence.remove(portletPreferencesPK);

    if (listener != null) {
      listener.onAfterRemove(portletPreferences);
    }

    return portletPreferences;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.PortletPreferences update(
    com.liferay.portal.model.PortletPreferences portletPreferences)
    throws com.liferay.portal.SystemException {
    PortletPreferencesPersistence persistence = (PortletPreferencesPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(PortletPreferencesUtil.class,e.getMessage(),e);
      }
    }

    boolean isNew = portletPreferences.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(portletPreferences);
      }
      else {
        listener.onBeforeUpdate(portletPreferences);
      }
    }

    portletPreferences = persistence.update(portletPreferences);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(portletPreferences);
      }
      else {
        listener.onAfterUpdate(portletPreferences);
      }
    }

    return portletPreferences;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.UserTrackerPath remove(
    java.lang.String userTrackerPathId)
    throws com.liferay.portal.NoSuchUserTrackerPathException,
      com.liferay.portal.SystemException {
    UserTrackerPathPersistence persistence = (UserTrackerPathPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(UserTrackerPathUtil.class,e.getMessage(),e);
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(userTrackerPathId));
    }

    com.liferay.portal.model.UserTrackerPath userTrackerPath = persistence.remove(userTrackerPathId);

    if (listener != null) {
      listener.onAfterRemove(userTrackerPath);
    }

    return userTrackerPath;
  }
View Full Code Here

Examples of com.liferay.portal.model.ModelListener

  protected static com.liferay.portal.model.UserTrackerPath update(
    com.liferay.portal.model.UserTrackerPath userTrackerPath)
    throws com.liferay.portal.SystemException {
    UserTrackerPathPersistence persistence = (UserTrackerPathPersistence)InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener)Class.forName(LISTENER).newInstance();
      }
      catch (Exception e) {
        Logger.error(UserTrackerPathUtil.class,e.getMessage(),e);
      }
    }

    boolean isNew = userTrackerPath.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(userTrackerPath);
      }
      else {
        listener.onBeforeUpdate(userTrackerPath);
      }
    }

    userTrackerPath = persistence.update(userTrackerPath);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(userTrackerPath);
      }
      else {
        listener.onAfterUpdate(userTrackerPath);
      }
    }

    return userTrackerPath;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.