001
014
015 package com.liferay.portal.model;
016
017 import com.liferay.portal.servlet.filters.cache.CacheUtil;
018
019
023 public class LayoutSetListener extends BaseModelListener<LayoutSet> {
024
025 @Override
026 public void onAfterRemove(LayoutSet layoutSet) {
027 clearCache(layoutSet);
028 }
029
030 @Override
031 public void onAfterUpdate(LayoutSet layoutSet) {
032 clearCache(layoutSet);
033 }
034
035 protected void clearCache(LayoutSet layoutSet) {
036 if (layoutSet == null) {
037 return;
038 }
039
040 if (!layoutSet.isPrivateLayout()) {
041 CacheUtil.clearCache(layoutSet.getCompanyId());
042 }
043 }
044
045 }