1 14 41 42 package org.jahia.data.viewhelper.sitemap; 43 44 import org.jahia.data.events.JahiaEvent; 45 import org.jahia.data.events.JahiaEventListener; 46 import org.jahia.data.fields.FieldTypes; 47 import org.jahia.data.fields.JahiaField; 48 import org.jahia.registries.ServicesRegistry; 49 import org.jahia.services.usermanager.JahiaUser; 50 51 63 public class SiteMapEventListener extends JahiaEventListener { 64 65 public SiteMapEventListener() { 66 } 67 68 74 public void pageAdded(JahiaEvent je) { 75 ServicesRegistry.getInstance().getJahiaSiteMapService().resetSiteMap(); 76 } 77 78 85 public void fieldDeleted(JahiaEvent je) { 86 JahiaField theField = (JahiaField)je.getObject(); 87 if (theField.getType() == FieldTypes.PAGE) { 88 ServicesRegistry.getInstance().getJahiaSiteMapService().resetSiteMap(); 89 } 90 } 91 92 public void fieldUpdated(JahiaEvent je) { 93 fieldDeleted(je); 94 } 95 96 103 public void userLoggedOut(JahiaEvent je) { 104 JahiaUser theUser = (JahiaUser)je.getObject(); 105 ServicesRegistry.getInstance().getJahiaSiteMapService(). 106 removeUserSiteMap(theUser.getUserKey()); 107 } 108 109 } 110 | Popular Tags |