[Castore-commits] RechercheAspect.aj 1.1 1.1.2.1

Stéphane Bouchet sbouchet at adullact1.hosting.cri74.org
Lun 6 Mar 10:53:12 CET 2006


Update of /cvsroot/castore/castore-core/src/aspects/fr/emn/castor/recherche/aspects
In directory adullact1:/tmp/cvs-serv20023/src/aspects/fr/emn/castor/recherche/aspects

Modified Files:
      Tag: v1_1_branch
	RechercheAspect.aj 
Log Message:
correction bug du profil.
refactoring des aspects ( utilisation de target() )

Index: RechercheAspect.aj
===================================================================
RCS file: /cvsroot/castore/castore-core/src/aspects/fr/emn/castor/recherche/aspects/RechercheAspect.aj,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -d -r1.1 -r1.1.2.1
*** RechercheAspect.aj	15 Sep 2005 14:46:42 -0000	1.1
--- RechercheAspect.aj	6 Mar 2006 09:53:10 -0000	1.1.2.1
***************
*** 58,76 ****
  
      //capture de l'action  : faire une recherche
!     pointcut recherche(Map query) : execution(Iterator fr.emn.castor.recherche.RechercheProxy.search(Map))
          && args(query);
  
      //apres la capture de l'evenement, ...
!     after(Map query) : recherche(query) {
! 
          //construction d'une map contenant les infos de la requete
          Map rawStat = new HashMap();
          Map rawProfil = new HashMap();
- 
          // recuperation du type de recherche
          String typeRecherche = (String) query
              .get(UsersConstants.TYPE_RECHERCHE);
          if (typeRecherche.equals(UsersConstants.TYPE_RECHERCHE_SIMPLE)) {
- 
              rawStat.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
              rawProfil.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
--- 58,74 ----
  
      //capture de l'action  : faire une recherche
!     pointcut recherche(RechercheProxy proxy, Map query) : execution(Iterator RechercheProxy.search(Map))
!         && target(proxy)
          && args(query);
  
      //apres la capture de l'evenement, ...
!     after(RechercheProxy proxy, Map query) : recherche(proxy, query) {
          //construction d'une map contenant les infos de la requete
          Map rawStat = new HashMap();
          Map rawProfil = new HashMap();
          // recuperation du type de recherche
          String typeRecherche = (String) query
              .get(UsersConstants.TYPE_RECHERCHE);
          if (typeRecherche.equals(UsersConstants.TYPE_RECHERCHE_SIMPLE)) {
              rawStat.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
              rawProfil.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
***************
*** 80,84 ****
              rawStat.put(UsersConstants.REQUETE, requete);
              rawProfil.put(UsersConstants.REQUETE, requete);
- 
              //recuperation du type de recherche (normal/full-text)
              if (query.containsKey(RechercheConstants.KEYWORD_CONTENT)) {
--- 78,81 ----
***************
*** 91,101 ****
              } else {
                  rawStat.put(
!                     UsersConstants.TYPE_CIBLE, UsersConstants.RECHERCHE_METADONNEES);
                  rawProfil.put(
!                     UsersConstants.TYPE_CIBLE, UsersConstants.RECHERCHE_METADONNEES);
              }
          }
          if (typeRecherche.equals(UsersConstants.TYPE_RECHERCHE_AVANCEE)) {
- 
              rawStat.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
              rawProfil.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
--- 88,99 ----
              } else {
                  rawStat.put(
!                     UsersConstants.TYPE_CIBLE,
!                     UsersConstants.RECHERCHE_METADONNEES);
                  rawProfil.put(
!                     UsersConstants.TYPE_CIBLE,
!                     UsersConstants.RECHERCHE_METADONNEES);
              }
          }
          if (typeRecherche.equals(UsersConstants.TYPE_RECHERCHE_AVANCEE)) {
              rawStat.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
              rawProfil.put(UsersConstants.TYPE_RECHERCHE, typeRecherche);
***************
*** 103,123 ****
              rawStat.put(UsersConstants.REQUETE, query);
              rawProfil.put(UsersConstants.REQUETE, query);
- 
          }
- 
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
! 
!         RechercheProxy recProxy = (RechercheProxy) thisJoinPoint.getTarget();
!         String acteur = recProxy.getUserOnLine(); 
!         
          //construction de l'evenement : requete
          try {
              fr.emn.castor.statistiques.Facade.getInstance().addNewEvent(
!                     eventSignature, acteur, rawStat);
              fr.emn.castor.users.Facade.getInstance().addNewEvent(
!                     eventSignature, acteur, rawProfil);
          } catch (Exception e) {
              if (AspectLog.getLog().isDebugEnabled()) {
--- 101,116 ----
              rawStat.put(UsersConstants.REQUETE, query);
              rawProfil.put(UsersConstants.REQUETE, query);
          }
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         String acteur = proxy.getUserOnLine();
          //construction de l'evenement : requete
          try {
              fr.emn.castor.statistiques.Facade.getInstance().addNewEvent(
!                 eventSignature, acteur, rawStat);
              fr.emn.castor.users.Facade.getInstance().addNewEvent(
!                 eventSignature, acteur, rawProfil);
          } catch (Exception e) {
              if (AspectLog.getLog().isDebugEnabled()) {




Plus d'informations sur la liste de diffusion Castore-commits