[Castore-commits] GestionCollectionsAspect.aj 1.1.2.1 1.1.2.2 ConsultationCollectionAspect.aj 1.2.2.1 1.2.2.2

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/collections/aspects
In directory adullact1:/tmp/cvs-serv20023/src/aspects/fr/emn/castor/collections/aspects

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

Index: GestionCollectionsAspect.aj
===================================================================
RCS file: /cvsroot/castore/castore-core/src/aspects/fr/emn/castor/collections/aspects/GestionCollectionsAspect.aj,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** GestionCollectionsAspect.aj	4 Jan 2006 10:32:18 -0000	1.1.2.1
--- GestionCollectionsAspect.aj	6 Mar 2006 09:53:10 -0000	1.1.2.2
***************
*** 41,47 ****
  
  import fr.emn.castor.collections.CollectionProxy;
- import fr.emn.castor.collections.Facade;
  
  /**
   * @author $Author$
   * @version $Revision$
--- 41,48 ----
  
  import fr.emn.castor.collections.CollectionProxy;
  
  /**
+  * Aspect gérant les évènement de gestion des collections.
+  * 
   * @author $Author$
   * @version $Revision$
***************
*** 50,170 ****
  
      //evenement : creation de collection privee
!     pointcut creationCollectionPrivee() : execution(
!         String CollectionProxy.createPrivCollPerso(..));
  
      //evenement : creation de collection publique
!     pointcut creationCollectionPublique() : execution(
!         String CollectionProxy.createPubCollPerso(..));
  
      //evenement : creation de collection native
!     pointcut creationCollectionNative() : execution(
!         String CollectionProxy.createCollNative(..));
  
      //evenement : creation de collection native
!     pointcut supprimerCollection() : execution(
!         void CollectionProxy.deleteCollection(..));
! 
!     //evenement : renommage de collection
!     pointcut renommerCollection() : execution(void CollectionProxy.renameCollection(..));
  
!     //evenement : modification de la description d'une collection
!     pointcut modifierDescription() : execution(
!         void Facade.modifyDescription(..));
  
      //evenement : ajout d'un document dans une collection
!     pointcut ajouterDocument(String idColl, String idDoc) : execution(
!         void CollectionProxy.addDocumentInCollection(String, String))
!         && args(idColl, idDoc)
!         && (!within(fr.emn.castor.documents.*))
!         && (!within(fr.emn.castor.documents.metier.*))
!         && (!this(fr.emn.castor.documents.Facade));
  
      //evenement : suppression d'un document dans une collection
!     pointcut supprimerDocument() : execution(
!         void CollectionProxy.deleteDocumentOfCollection(..));
  
      //evenement : ajout d'un document dans le panier
!     pointcut ajouterDocumentPanier() : execution(
!         void CollectionProxy.addDocumentToPanier(..));
! 
!     after() : creationCollectionPrivee() {
!         //construction de la signature de l'evenement
!         String eventSignature = thisJoinPointStaticPart
!             .getSignature().getDeclaringTypeName()
!                 + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
!     }
  
!     after() : creationCollectionPublique() {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
!     after() : creationCollectionNative() {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
!     after() : supprimerCollection() {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
!     after() : renommerCollection() {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
!     after() : modifierDescription() {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
!     after(String idColl, String idDoc) : ajouterDocument(idColl, idDoc) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
!     after() : supprimerDocument() {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
!     after() : ajouterDocumentPanier() {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature,thisJoinPoint.getTarget());
      }
  
      //notification de l'evenement au module de statistique
!     private void notifieEvenement(String event, Object objetAppele) {
!         CollectionProxy collProxy = (CollectionProxy) objetAppele;
!         String acteur = collProxy.getUserOnLine();        
!         
!         fr.emn.castor.statistiques.Facade.getInstance().addNewEvent(event,
!                 acteur, null);
      }
  
--- 51,162 ----
  
      //evenement : creation de collection privee
!     pointcut creationCollectionPrivee(CollectionProxy proxy) : execution(
!         String CollectionProxy.createPrivCollPerso(..))
!         && target(proxy);
  
      //evenement : creation de collection publique
!     pointcut creationCollectionPublique(CollectionProxy proxy) : execution(
!         String CollectionProxy.createPubCollPerso(..))
!         && target(proxy);
  
      //evenement : creation de collection native
!     pointcut creationCollectionNative(CollectionProxy proxy) : execution(
!         String CollectionProxy.createCollNative(..))
!         && target(proxy);
  
      //evenement : creation de collection native
!     pointcut supprimerCollection(CollectionProxy proxy) : execution(
!         void CollectionProxy.deleteCollection(..))
!         && target(proxy);
  
!     //evenement : modification de la description d'une collection, ou de son nom
!     pointcut modifierCollection(CollectionProxy proxy) : execution(
!         void CollectionProxy.setCollectionInformations(..))
!         && target(proxy);
  
      //evenement : ajout d'un document dans une collection
!     pointcut ajouterDocument(CollectionProxy proxy) : execution(
!         void CollectionProxy.addDocumentInCollection(..))
!         && target(proxy);
  
      //evenement : suppression d'un document dans une collection
!     pointcut supprimerDocument(CollectionProxy proxy) : execution(
!         void CollectionProxy.deleteDocumentOfCollection(..))
!         && target(proxy);
  
      //evenement : ajout d'un document dans le panier
!     pointcut ajouterDocumentPanier(CollectionProxy proxy) : execution(
!         void CollectionProxy.addDocumentToPanier(..))
!         && target(proxy);
  
!     after(CollectionProxy proxy) : creationCollectionPrivee(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
!     after(CollectionProxy proxy) : creationCollectionPublique(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
!     after(CollectionProxy proxy) : creationCollectionNative(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
!     after(CollectionProxy proxy) : supprimerCollection(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
!     after(CollectionProxy proxy) : modifierCollection(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
!     after(CollectionProxy proxy) : ajouterDocument(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
!     after(CollectionProxy proxy) : supprimerDocument(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
!     after(CollectionProxy proxy) : ajouterDocumentPanier(proxy) {
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
!         this.notifieEvenement(eventSignature, proxy);
      }
  
      //notification de l'evenement au module de statistique
!     private void notifieEvenement(String event, CollectionProxy collProxy) {
!         String acteur = collProxy.getUserOnLine();
!         fr.emn.castor.statistiques.Facade.getInstance().addNewEvent(
!             event, acteur, null);
      }
  

Index: ConsultationCollectionAspect.aj
===================================================================
RCS file: /cvsroot/castore/castore-core/src/aspects/fr/emn/castor/collections/aspects/ConsultationCollectionAspect.aj,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -d -r1.2.2.1 -r1.2.2.2
*** ConsultationCollectionAspect.aj	21 Dec 2005 17:02:25 -0000	1.2.2.1
--- ConsultationCollectionAspect.aj	6 Mar 2006 09:53:10 -0000	1.2.2.2
***************
*** 42,45 ****
--- 42,46 ----
  import java.util.HashMap;
  import java.util.Iterator;
+ import java.util.Map;
  
  import fr.emn.castor.collections.CollectionProxy;
***************
*** 54,84 ****
  
      //capture de l'action  : consulter une collection
!     pointcut consulterCollection(String idColl) : execution(
          Iterator CollectionProxy.contentOfCollection(String))
          && args(idColl);
  
      //apres la capture de l'evenement, ...
!     after(String idColl) : consulterCollection(idColl) {
! 
!         System.out.println("etape 0");
!         HashMap row = new HashMap();
          row.put(UsersConstants.ID_COLL, idColl);
- 
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
-         
-         CollectionProxy collProxy = (CollectionProxy) thisJoinPoint.getTarget();
-         String acteur = collProxy.getUserOnLine();   
  
!         System.out.println("etape 1");
!         
          //construction de l'evenement : consulter une collection
          try {
              fr.emn.castor.statistiques.Facade.getInstance().addNewEvent(
!                     eventSignature, acteur, null);
              fr.emn.castor.users.Facade.getInstance().addNewEvent(
!                     eventSignature, acteur, row);
          } catch (Exception e) {
              if (AspectLog.getLog().isDebugEnabled()) {
--- 55,79 ----
  
      //capture de l'action  : consulter une collection
!     pointcut consulterCollection(CollectionProxy proxy, String idColl) : execution(
          Iterator CollectionProxy.contentOfCollection(String))
+         && target(proxy)
          && args(idColl);
  
      //apres la capture de l'evenement, ...
!     after(CollectionProxy proxy, String idColl) : consulterCollection(proxy, idColl) {
!         Map<String, String> row = new HashMap<String, String>();
          row.put(UsersConstants.ID_COLL, idColl);
          //construction de la signature de l'evenement
          String eventSignature = thisJoinPointStaticPart
              .getSignature().getDeclaringTypeName()
                  + "." + thisJoinPointStaticPart.getSignature().getName();
  
!         String acteur = proxy.getUserOnLine();
          //construction de l'evenement : consulter une collection
          try {
              fr.emn.castor.statistiques.Facade.getInstance().addNewEvent(
!                 eventSignature, acteur, null);
              fr.emn.castor.users.Facade.getInstance().addNewEvent(
!                 eventSignature, acteur, row);
          } catch (Exception e) {
              if (AspectLog.getLog().isDebugEnabled()) {
***************
*** 86,90 ****
              }
          }
-         System.out.println("etape 2");
      }
  }
\ No newline at end of file
--- 81,84 ----




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